Browse Source

fix: 跳转详情页返回路径修改

tall
song 4 years ago
parent
commit
c5e17c0a74
  1. 1
      CHANGELOG.md
  2. 5
      src/components/Roles/Roles.vue
  3. 8
      src/components/TimeLine/component/TimeBox.vue
  4. 2
      src/components/TimeLine/component/TimeStatus.vue
  5. 29
      src/pages/project/project.vue
  6. 1
      src/store/task/mutations.js

1
CHANGELOG.md

@ -154,6 +154,7 @@
--|--|--
- | 修改定期任务骨架屏高度 | [909a734](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/909a734)
- | 插件查询及展示 | [4dba770](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/4dba770)
- | 整理代码 | [7a55315](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/7a55315)
- | 日历的更改 | [7353ac8](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/7353ac8)
- | 测试接口 | [215e074](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/215e074)
- | 组件文件夹新建 | [22bfe7b](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/22bfe7b)

5
src/components/Roles/Roles.vue

@ -56,9 +56,9 @@ export default {
},
methods: {
...mapActions('task', ['handleRegularTask']),
...mapActions('task', ['handleRegularTask', 'getPermanent']),
...mapMutations('role', ['setRoleId']),
...mapMutations('task', ['setPermanents', 'setDailyTasks', 'clearEndFlag']),
...mapMutations('task', ['setPermanents', 'setDailyTasks', 'clearEndFlag', 'setTimeNode']),
//
setCurrentRole(index) {
@ -85,6 +85,7 @@ export default {
// projectroleId
changeRole(id, index) {
try {
console.log('切换角色');
// script
this.clearPluginScript();
this.$nextTick(() => {

8
src/components/TimeLine/component/TimeBox.vue

@ -19,7 +19,6 @@
:show-foot="false"
:show-head="false"
:style="{ height: setHeight(task.panel) }"
@click="onClickTask(+task.planStart)"
class="h-16"
margin="0"
v-if="showSkeleton"
@ -35,12 +34,11 @@
:show-foot="false"
:show-head="false"
:style="{ height: setHeight(task.panel) }"
@click="onClickTask(+task.planStart)"
class="h-16"
margin="0"
v-if="tasks && tasks.length && task.process !== 4 && !showSkeleton"
@click="onClickTask(+task.planStart)"
>
<!-- v-if="task.plugins && task.plugins.length" -->
<!-- 任务面板插件 -->
<view slot="body">
<view class="p-0 u-col-between">
@ -92,7 +90,7 @@ export default {
methods: {
...mapActions('task', ['getGlobal']),
...mapMutations('task', ['setTipsContent', 'setTipsContent', 'setTimeNode']),
...mapMutations('task', ['setTipsContent', 'setTipsContent']),
//
setHeight(panel) {
@ -110,6 +108,8 @@ export default {
onClickTask(planStart) {
const param = { roleId: this.roleId, timeNode: planStart, timeUnit: this.timeUnit };
this.getGlobal(param);
this.$t.storage.setStorageSync('timeNode', planStart);
this.$t.storage.setStorageSync('roleId', this.roleId);
},
//

2
src/components/TimeLine/component/TimeStatus.vue

@ -163,7 +163,7 @@ export default {
const { realStart, planDuration } = this.task;
const leftTime = +realStart + +planDuration - Date.now(); //
const { num, time } = this.$t.time.computeDurationText(leftTime);
console.log('time', time); // DEBUG:
// console.log('time', time); // DEBUG:
this.$nextTick(() => {
if (!time) return;
this.timer = setTimeout(() => {

29
src/pages/project/project.vue

@ -44,8 +44,8 @@ export default {
timeNode(val) {
if (val && this.roleId) {
//
this.getGlobalData();
this.getInitTasks();
// this.getGlobalData();
// this.getInitTasks();
}
},
@ -57,7 +57,11 @@ export default {
*/
roleId(val) {
if (val) {
this.setTimeNode(Date.now());
// storagetimeNode,storetimeNode
this.setTimeNode(+this.$t.storage.getStorageSync('timeNode') || Date.now());
// storage
this.$t.storage.setStorageSync('timeNode', '');
console.log('当角色发生变化时: ', this.timeNode);
//
this.getPermanent(val);
}
@ -106,13 +110,19 @@ export default {
// id
this.$t.ui.showToast('缺少项目信息参数');
} else {
// storagetimeNode,storetimeNode
this.setTimeNode(this.$t.storage.getStorageSync('timeNode') - 0);
// storage
this.$t.storage.setStorageSync('timeNode', '');
console.log('timeNode: ', this.$t.storage.getStorageSync('timeNode'), this.timeNode);
// id
await this.getProjectById({ projectId: options.p });
// id
await this.getRoles({ projectId: options.p });
this.setInitialRoleId(this.visibleRoles);
//
// await this.getInitTasks();
//
await this.getGlobalData();
await this.getInitTasks();
}
} catch (error) {
console.error('project init function:', error);
@ -126,7 +136,7 @@ export default {
await this.getTasks({ queryType: 1 });
//
if (this.tasks && this.tasks.length && this.tasks.plugins && this.tasks.plugins.length) {
if (this.tasks && this.tasks.length && this.tasks.id) {
this.$nextTick(() => {
const { tasks, timeGranularity } = this;
this.getTasks({ timeNode: +tasks[0].planStart, queryType: 0, queryNum: 6 });
@ -146,8 +156,11 @@ export default {
setInitialRoleId(visibleList) {
const index = visibleList.findIndex(item => item.mine === '1');
const currentRole = index > 0 ? visibleList[index] : visibleList[0];
const currentRoleId = currentRole ? currentRole.id : '';
const storageRoleId = this.$t.storage.getStorageSync('roleId');
const currentRoleId = storageRoleId ? storageRoleId : currentRole ? currentRole.id : '';
this.setRoleId(currentRoleId);
// storage
this.$t.storage.setStorageSync('roleId', '');
},
/**
@ -170,7 +183,7 @@ export default {
queryNum: query.queryNum || 3,
queryType: query.queryType,
};
console.log('params: ', params);
await this.getRegulars(params);
this.setShowSkeleton(false);
} catch (error) {

1
src/store/task/mutations.js

@ -52,6 +52,7 @@ const mutations = {
*/
setTimeNode(state, data) {
state.timeNode = data;
console.log('state.timeNode : ', state.timeNode);
},
/**

Loading…
Cancel
Save