|
|
@ -1,21 +1,21 @@ |
|
|
|
<template> |
|
|
|
<view :style="{ height: height }" class="flex flex-col overflow-hidden u-font-14"> |
|
|
|
<!-- 引导页 --> |
|
|
|
<Guide v-if="showGuide" @changGuide="showGuide = false" /> |
|
|
|
<!-- <Guide v-if="showGuide" @changGuide="showGuide = false" /> --> |
|
|
|
<!-- 标题栏 --> |
|
|
|
<Title /> |
|
|
|
<!-- <Title /> --> |
|
|
|
|
|
|
|
<view class="container flex flex-col flex-1 mx-auto overflow-hidden bg-gray-100"> |
|
|
|
<!-- 角色栏 --> |
|
|
|
<Roles /> |
|
|
|
<!-- 体验项目切换角色 --> |
|
|
|
<Experience v-if="showEXP" /> |
|
|
|
<!-- <Experience v-if="showEXP" /> --> |
|
|
|
<Greenway v-if="greenMsgs.length" /> |
|
|
|
<!-- 日常任务面板 --> |
|
|
|
<Globals /> |
|
|
|
<Globals v-if="globals.length" @changeShowLine="changeShowLine" /> |
|
|
|
|
|
|
|
<!-- 定期任务面板 --> |
|
|
|
<TimeLine @getTasks="getTasks" class="flex-1 overflow-hidden" ref="timeLine" /> |
|
|
|
<TimeLine v-if="!globals.length || showLine" @getTasks="getTasks" class="flex-1 overflow-hidden" ref="timeLine" /> |
|
|
|
|
|
|
|
<!-- 医院项目的问卷悬浮按钮 --> |
|
|
|
<view style="z-index: 99" class="absolute bottom-10 right-5" v-if="name"> |
|
|
@ -24,26 +24,7 @@ |
|
|
|
class="relative text-white bg-blue-400 flex justify-center items-center w-12 h-12 rounded-full shadow-2xl" |
|
|
|
> |
|
|
|
{{ name }} |
|
|
|
<!-- <u-badge type="error" :count="count" :offset="[-8, -8]"></u-badge> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <u-popup v-model="showQuestionList" mode="bottom" border-radius="14"> |
|
|
|
<view class="h-64"> |
|
|
|
<view class="text-center font-bold fixed bg-white py-3 top-0 w-full">请选择</view> |
|
|
|
<view class="flex flex-col mx-3 pt-10 pb-6 h-full overflow-y-auto" :class="questionnaires.length < 5 ? 'justify-center' : ''"> |
|
|
|
<view |
|
|
|
v-for="(item, index) in questionnaires" |
|
|
|
:key="item.id" |
|
|
|
class="p-2 text-center" |
|
|
|
@click="openQuestionnaire(true, item.type)" |
|
|
|
:class="index === questionnaires.length - 1 ? '' : 'border-b'" |
|
|
|
> |
|
|
|
<view class="text-gray-500">{{ item.questionnaireName }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="fixed bottom-0 bg-white h-6 w-full"></view> |
|
|
|
</view> |
|
|
|
</u-popup> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -70,6 +51,7 @@ export default { |
|
|
|
url: '', |
|
|
|
showStatus: 0, |
|
|
|
detailId: '', |
|
|
|
showLine: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@ -79,7 +61,7 @@ export default { |
|
|
|
...mapState('task', ['timeNode', 'timeUnit', 'tasks', 'regularTask', 'newProjectInfo', 'showSkeleton', 'showScrollTo']), |
|
|
|
...mapState('messages', ['greenMsgs']), |
|
|
|
...mapState('project', ['project']), |
|
|
|
...mapGetters('task', ['timeGranularity']), |
|
|
|
...mapGetters('task', ['timeGranularity', 'globals']), |
|
|
|
...mapGetters('project', ['projectId']), |
|
|
|
...mapGetters('user', ['userId']), |
|
|
|
}, |
|
|
@ -187,6 +169,11 @@ export default { |
|
|
|
'setShowScrollTo', |
|
|
|
]), |
|
|
|
|
|
|
|
// 修改状态,是否显示时间轴 |
|
|
|
changeShowLine(status) { |
|
|
|
this.showLine = status; |
|
|
|
}, |
|
|
|
|
|
|
|
// 初始化 定期任务 |
|
|
|
async initPlanTasks() { |
|
|
|
this.setPrevPlaceholderTasks(); // 向上加载空数据 |
|
|
@ -387,6 +374,7 @@ export default { |
|
|
|
if (!options || !options.p) { |
|
|
|
this.$t.ui.showToast('缺少项目信息参数'); // 没有项目id参数 |
|
|
|
} else { |
|
|
|
uni.setNavigationBarTitle({ title: options.pname }); |
|
|
|
if (options.p !== this.$t.storage.getStorageSync('projectId')) { |
|
|
|
console.log('切项目了'); |
|
|
|
this.$t.storage.setStorageSync('roleId', ''); |
|
|
@ -467,13 +455,22 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 设置 初始显示角色信息 |
|
|
|
setInitialRoleId(visibleList) { |
|
|
|
async setInitialRoleId(visibleList) { |
|
|
|
if (!visibleList || !visibleList.length) return; |
|
|
|
const index = visibleList.findIndex(item => +item.mine === 1); |
|
|
|
const currentRole = index > 0 ? visibleList[index] : visibleList[0]; |
|
|
|
const storageRoleId = this.$t.storage.getStorageSync('roleId'); |
|
|
|
const currentRoleId = storageRoleId ? storageRoleId : currentRole ? currentRole.id : ''; |
|
|
|
this.setRoleId(currentRoleId); |
|
|
|
const params = { param: { projectId: this.projectId } }; |
|
|
|
const data = await uni.$u.api.queryLastRoleChoose(params); |
|
|
|
console.log('data: ', data); |
|
|
|
if (data && data.roleId) { |
|
|
|
this.setRoleId(data.roleId); |
|
|
|
} else { |
|
|
|
const saveParams = { param: { roleId: currentRoleId, projectId: this.projectId } }; |
|
|
|
await uni.$u.api.saveRoleRecord(saveParams); |
|
|
|
const currentRoleId = storageRoleId ? storageRoleId : currentRole ? currentRole.id : ''; |
|
|
|
this.setRoleId(currentRoleId); |
|
|
|
} |
|
|
|
// 清空storage |
|
|
|
this.$t.storage.setStorageSync('roleId', ''); |
|
|
|
}, |
|
|
|