Browse Source

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

pull/1/head
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) - | 修改定期任务骨架屏高度 | [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) - | 插件查询及展示 | [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) - | 日历的更改 | [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) - | 测试接口 | [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) - | 组件文件夹新建 | [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: { methods: {
...mapActions('task', ['handleRegularTask']), ...mapActions('task', ['handleRegularTask', 'getPermanent']),
...mapMutations('role', ['setRoleId']), ...mapMutations('role', ['setRoleId']),
...mapMutations('task', ['setPermanents', 'setDailyTasks', 'clearEndFlag']), ...mapMutations('task', ['setPermanents', 'setDailyTasks', 'clearEndFlag', 'setTimeNode']),
// //
setCurrentRole(index) { setCurrentRole(index) {
@ -85,6 +85,7 @@ export default {
// projectroleId // projectroleId
changeRole(id, index) { changeRole(id, index) {
try { try {
console.log('切换角色');
// script // script
this.clearPluginScript(); this.clearPluginScript();
this.$nextTick(() => { this.$nextTick(() => {

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

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

29
src/pages/project/project.vue

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

1
src/store/task/mutations.js

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

Loading…
Cancel
Save