|
|
@ -14,7 +14,7 @@ |
|
|
|
<TimeLine @getTasks="getTasks" class="flex-1 overflow-hidden" ref="timeLine" /> |
|
|
|
|
|
|
|
<!-- 医院项目的问卷悬浮按钮 --> |
|
|
|
<view class="absolute bottom-10 right-5" v-if="showQuestion"> |
|
|
|
<!-- <view class="absolute bottom-10 right-5" v-if="showQuestion"> |
|
|
|
<view |
|
|
|
@click="openQuestionnaire(false)" |
|
|
|
class="relative text-white bg-blue-400 flex justify-center items-center w-12 h-12 rounded-full shadow-2xl" |
|
|
@ -40,7 +40,7 @@ |
|
|
|
<view class="fixed bottom-0 bg-white h-6 w-full"></view> |
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -52,7 +52,15 @@ import { flatten } from 'lodash'; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { height: '', show: false, showQuestion: false, questionnaires: [], count: 0, showQuestionList: false, chooseItem: false }; |
|
|
|
return { |
|
|
|
height: '', |
|
|
|
// show: false, |
|
|
|
// showQuestion: false, |
|
|
|
// questionnaires: [], |
|
|
|
// count: 0, |
|
|
|
// showQuestionList: false, |
|
|
|
// chooseItem: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
@ -81,6 +89,7 @@ export default { |
|
|
|
* 永久日常任务不发生改变 |
|
|
|
*/ |
|
|
|
timeNode(val) { |
|
|
|
console.log('切换角色', val); |
|
|
|
if (val && this.roleId) { |
|
|
|
this.clearTasksData(); |
|
|
|
this.getGlobalData(); // 查可变日常任务 |
|
|
@ -115,16 +124,16 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 医院项目下的调查问卷 |
|
|
|
questionnaires(val) { |
|
|
|
if (val && val.length) { |
|
|
|
this.showQuestion = true; |
|
|
|
val.forEach(item => { |
|
|
|
if (item.isWrite === 0 || item.isWrite === -1) { |
|
|
|
this.count += 1; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
// questionnaires(val) { |
|
|
|
// if (val && val.length) { |
|
|
|
// this.showQuestion = true; |
|
|
|
// val.forEach(item => { |
|
|
|
// if (item.isWrite === 0 || item.isWrite === -1) { |
|
|
|
// this.count += 1; |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
@ -176,9 +185,12 @@ export default { |
|
|
|
|
|
|
|
// 切换了 颗粒度 || 角色时候 获取初始定期任务 |
|
|
|
getInitTasks() { |
|
|
|
console.log('切换角色'); |
|
|
|
// 预加载 上下的定期任务 |
|
|
|
function preloadFn(that) { |
|
|
|
const detailId = that.tasks.findIndex(task => task.detailId); |
|
|
|
console.log('预加载', that, detailId); |
|
|
|
|
|
|
|
const arr = []; |
|
|
|
that.tasks.forEach(task => { |
|
|
|
if (task.detailId) { |
|
|
@ -221,7 +233,8 @@ export default { |
|
|
|
* @param {number} query.queryType 0向上查找 1向下查找(默认) 下查包含自己,上查不包含 |
|
|
|
*/ |
|
|
|
getTasks(query, fn) { |
|
|
|
this.setShowSkeleton(true); |
|
|
|
console.log('根据时间基准点和角色查找定期任务', query, fn); |
|
|
|
this.setShowSkeleton(false); |
|
|
|
const params = this.generateGetTaskParam(query); |
|
|
|
|
|
|
|
this.$t.$q.getRegularTask(params, (err, data) => { |
|
|
@ -424,9 +437,17 @@ export default { |
|
|
|
if (err) { |
|
|
|
console.error('err: ', err || '获取角色信息失败'); |
|
|
|
} else { |
|
|
|
console.log('data', data, params); |
|
|
|
this.setInvisibleRoles(data ? data.invisibleList : []); |
|
|
|
this.setVisibleRoles(data ? data.visibleList : []); |
|
|
|
this.setInitialRoleId(data ? data.visibleList : []); |
|
|
|
|
|
|
|
let obj = {}; |
|
|
|
obj.visible = data.visibleList; |
|
|
|
obj.invisible = data ? data.invisibleList : []; |
|
|
|
this.$t.storage.setStorageSync('roles_' + params.projectId, obj); |
|
|
|
let roles = this.$t.storage.getStorageSync('roles_' + params.projectId); |
|
|
|
console.log(JSON.parse(roles)); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
@ -478,14 +499,14 @@ export default { |
|
|
|
// }, |
|
|
|
|
|
|
|
// 打开问卷 |
|
|
|
openQuestionnaire(value) { |
|
|
|
this.chooseItem = value; |
|
|
|
if (this.count === 1 || this.chooseItem) { |
|
|
|
window.location.href = 'https://www.baidu.com/'; |
|
|
|
} else { |
|
|
|
this.showQuestionList = true; |
|
|
|
} |
|
|
|
}, |
|
|
|
// openQuestionnaire(value) { |
|
|
|
// this.chooseItem = value; |
|
|
|
// if (this.count === 1 || this.chooseItem) { |
|
|
|
// window.location.href = 'https://www.baidu.com/'; |
|
|
|
// } else { |
|
|
|
// this.showQuestionList = true; |
|
|
|
// } |
|
|
|
// }, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|