Browse Source

style: 添加插件数据

develop
lucky 4 years ago
parent
commit
2f11b423f7
  1. 92
      CHANGELOG.md
  2. 52
      src/components/TimeLine/component/TimeBox.vue
  3. 51
      src/config/plugin.js
  4. 278
      src/mock/mock.js
  5. 16
      src/pages/project/project.vue
  6. 2
      src/plugins/TaskDescription/TaskDescription.vue
  7. 2
      src/plugins/TaskDurationDelay/TaskDurationDelay.vue
  8. 23
      src/plugins/TaskTitle copy/TaskTitle.vue
  9. 4
      src/plugins/TaskTitle/TaskTitle.vue
  10. 7
      src/store/home/actions.js
  11. 17
      src/store/home/mutations.js

92
CHANGELOG.md

@ -15,88 +15,76 @@
- | 添加时间轴上下滚动 | [2b81bbc](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/2b81bbc) - | 添加时间轴上下滚动 | [2b81bbc](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/2b81bbc)
- | db store | [6414c4f](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/6414c4f) - | db store | [6414c4f](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/6414c4f)
- | indexedDB | [687394e](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/687394e) - | indexedDB | [687394e](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/687394e)
- | post 封装 | [da52e94](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/da52e94)
- | tall插件封装 | [1bcb920](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/1bcb920)
富文本插件 | 富文本插件demo测试 | [ed3d644](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/ed3d644) 富文本插件 | 富文本插件demo测试 | [ed3d644](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/ed3d644)
pinch | alloy finger实现图片的pinch放大缩小 | [de01343](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/de01343) pinch | alloy finger实现图片的pinch放大缩小 | [de01343](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/de01343)
- | db store | [6414c4f](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/6414c4f)
- | indexedDB | [687394e](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/687394e)
- | post 封装 | [da52e94](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/da52e94)
- | tall插件封装 | [1bcb920](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/1bcb920)
- | 存token | [b8a178d](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/b8a178d)
- | 提交到本地 | [9cbe411](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/9cbe411)
- | 时间基准线,默认插件 | [a33ba1e](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/a33ba1e)
- | 时间轴修改状态时提示框增加 | [e841392](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/e841392)
- | 时间轴界面 | [33927e9](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/33927e9)
- | 标题栏变化 | [c0fcd9d](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/c0fcd9d)
- | 标题栏角色栏全局任务组件新建 | [0500cb4](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/0500cb4)
- | 模拟接口测试 | [69e7931](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/69e7931)
- | 添加时间轴上下滚动 | [2b81bbc](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/2b81bbc)
- | 角色栏实现 | [94cd671](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/94cd671)
pinch | alloy finger实现图片的pinch放大缩小 | [de01343](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/de01343)
富文本插件 | 富文本插件demo测试 | [ed3d644](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/ed3d644)
### 🎨 代码样式 ### 🎨 代码样式
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 代码格式细节调整 | [cb2532b](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/cb2532b) - | 代码格式细节调整 | [cb2532b](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/cb2532b)
- | 任务快捷方式图标增加 | [4aba872](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/4aba872) - | 更新代码 | [8c27e68](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/8c27e68)
- | 修改角色样式 | [73e268e](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/73e268e) - | 更新代码 | [1f40a76](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/1f40a76)
- | 图标修改 | [54bca09](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/54bca09) - | 任务快捷方式图标增加 | [4aba872](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/4aba872)
- | 无基本变化 | [21ac4bb](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/21ac4bb) - | 日常任务修改 | [dfa7ee2](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/dfa7ee2)
- | 日常任务修改 | [dfa7ee2](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/dfa7ee2) - | 删除插件携带的多余文件 | [0f392bb](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/0f392bb)
- | 更新代码 | [8c27e68](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/8c27e68) - | 图标修改 | [54bca09](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/54bca09)
- | 更新代码 | [1f40a76](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/1f40a76) - | 无基本变化 | [21ac4bb](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/21ac4bb)
- | 组件新建 | [89c0035](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/89c0035) - | 修改角色样式 | [73e268e](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/73e268e)
- | 组件新建 | [89c0035](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/89c0035)
### 🐛 Bug 修复 ### 🐛 Bug 修复
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 上下滚动时间轴 | [d533a01](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/d533a01) - | 骨架屏替换 | [e9fdd71](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/e9fdd71)
- | 修改main | [749ae9a](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/749ae9a) - | 角色栏修改 | [19228d6](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/19228d6)
- | 修改角色栏组件 | [a54c601](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/a54c601) - | 上下滚动时间轴 | [d533a01](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/d533a01)
- | 提示信息显示bug及日常任务收缩问题 | [f2f06c5](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/f2f06c5) - | 时间轴上下滚动数据加载bug修改 | [e82ede4](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/e82ede4)
- | 时间轴上下滑动 | [4d0ae46](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/4d0ae46) - | 时间轴上下滑动 | [4d0ae46](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/4d0ae46)
- | 时间轴上下滚动数据加载bug修改 | [e82ede4](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/e82ede4) - | 提示信息显示bug及日常任务收缩问题 | [f2f06c5](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/f2f06c5)
- | 角色栏修改 | [19228d6](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/19228d6) - | 修改角色栏组件 | [a54c601](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/a54c601)
- | 骨架屏替换 | [e9fdd71](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/e9fdd71) - | 修改main | [749ae9a](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/749ae9a)
- | 角色栏修改 | [19228d6](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/19228d6)
### 📝 文档 ### 📝 文档
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | README.md | [ab0eb05](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/ab0eb05) - | README.md | [ab0eb05](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/ab0eb05)
### chore ### 🔨 代码重构
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | api 封装 | [8dcb8a2](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/8dcb8a2) template | eslint prettier sass uview tailwindcss | [9c966a1](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/9c966a1)
- | env host修改 | [a79a4a5](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/a79a4a5)
- | mock | [51c24a5](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/51c24a5)
pwa 小程序 | 移除了pwa,alloyFinger添加平台判断 | [875fab4](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/875fab4)
- | uview-ui | [a9ea34b](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/a9ea34b)
信息配置 | 配置eslint等配置 | [7421443](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/7421443)
### 🚀 性能优化
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | style:index | [978f272](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/978f272) - | 角色栏文字颜色修改 | [215c6b3](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/215c6b3)
- | !2 基础模板v1.1.0 | [f5e61dd](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/f5e61dd) - | 解决警告 | [c932b09](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/c932b09)
- | init | [c0f1deb](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/c0f1deb) - | 组件文件夹新建 | [22bfe7b](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/22bfe7b)
- | 组件文件夹新建 | [17bb8c9](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/17bb8c9)
- | 组件文件夹新建 | [1421504](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/1421504)
### 🔨 代码重构 ### chore
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
template | eslint prettier sass uview tailwindcss | [9c966a1](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/9c966a1) - | api 封装 | [8dcb8a2](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/8dcb8a2)
- | env host修改 | [a79a4a5](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/a79a4a5)
- | mock | [51c24a5](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/51c24a5)
pwa 小程序 | 移除了pwa,alloyFinger添加平台判断 | [875fab4](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/875fab4)
- | uview-ui | [a9ea34b](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/a9ea34b)
信息配置 | 配置eslint等配置 | [7421443](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/7421443)
### 🚀 性能优化
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 组件文件夹新建 | [22bfe7b](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/22bfe7b) - | style:index | [978f272](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/978f272)
- | 组件文件夹新建 | [17bb8c9](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/17bb8c9) - | !2 基础模板v1.1.0 | [f5e61dd](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/f5e61dd)
- | 组件文件夹新建 | [1421504](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/1421504) - | init | [c0f1deb](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/c0f1deb)
- | 角色栏文字颜色修改 | [215c6b3](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/215c6b3)

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

@ -1,10 +1,3 @@
<!--
* @Author: aBin
* @email: binbin0314@126.com
* @Date: 2021-07-19 15:36:28
* @LastEditors: aBin
* @LastEditTime: 2021-07-19 18:54:55
-->
<template> <template>
<view class="px-3 pb-10"> <view class="px-3 pb-10">
<view :key="index" v-for="(item, index) in list"> <view :key="index" v-for="(item, index) in list">
@ -26,15 +19,19 @@
<u-card :show-foot="false" :show-head="false" :style="{ height: item.TaskPanel.height + 'px' }" class="h-16" margin="0"> <u-card :show-foot="false" :show-head="false" :style="{ height: item.TaskPanel.height + 'px' }" class="h-16" margin="0">
<view slot="body"> <view slot="body">
<view :key="pluginIndex" class="u-col-between p-0 u-skeleton" v-for="(plugin, pluginIndex) in item.plugins"> <view :key="pluginIndex" class="u-col-between p-0 u-skeleton" v-for="(plugin, pluginIndex) in item.plugins">
<!-- <view class="u-skeleton-rect">瓶身描绘的牡丹一如你初妆</view> --> <!-- <view :key="p.pluginId" v-for="p in plugin">
<component
:is="$t.plugin.defaults.find(item => item.id === p.pluginId).component"
:item="item"
v-if="$t.plugin.defaults.find(item => item.id === p.pluginId)"
></component>
</view>-->
<view :key="p.pluginId" v-for="p in plugin"> <view :key="p.pluginId" v-for="p in plugin">
<text v-if="p.pluginId === '444'">这是个基准线</text> <text v-if="p.pluginId === 4">这是个基准线</text>
<!-- 默认插件任务名 --> <component :is="currentComponent"></component>
<task-title v-if="p.pluginId === '111'" /> <task-title v-if="p.pluginId === 1" />
<!-- 默认插件任务描述 --> <task-description v-if="p.pluginId === 2" />
<task-desc v-if="p.pluginId === '222'" /> <task-duration-delay v-if="p.pluginId === 3" />
<!-- 默认插件任务时差 -->
<task-time-difference v-if="p.pluginId === '333'" />
</view> </view>
</view> </view>
</view> </view>
@ -48,62 +45,63 @@
<script> <script>
import { mapState, mapMutations } from 'vuex'; import { mapState, mapMutations } from 'vuex';
import TaskDesc from '@/plugins/TaskDesc/TaskDesc.vue'; import TaskDescription from '@/plugins/TaskDescription/TaskDescription.vue';
import TaskTitle from '@/plugins/TaskTitle/TaskTitle.vue'; import TaskTitle from '@/plugins/TaskTitle/TaskTitle.vue';
import TimeStatus from './TimeStatus.vue'; import TimeStatus from './TimeStatus.vue';
import TaskTimeDifference from '@/plugins/TaskTimeDifference/TaskTimeDifference.vue'; import TaskDurationDelay from '@/plugins/TaskDurationDelay/TaskDurationDelay.vue';
export default { export default {
name: 'TimeBox', name: 'TimeBox',
components: { TimeStatus, TaskTitle, TaskDesc, TaskTimeDifference }, components: { TimeStatus, TaskTitle, TaskDescription, TaskDurationDelay },
data() { data() {
return { return {
currentComponent: '',
list: [ list: [
{ {
state: 0, state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '222' }]], plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
TaskPanel: { height: '100' }, TaskPanel: { height: '100' },
}, },
{ {
state: 1, state: 1,
plugins: [[{ pluginId: '111' }], [{ pluginId: '222' }]], plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
TaskPanel: { height: '100' }, TaskPanel: { height: '100' },
}, },
{ {
state: 2, state: 2,
plugins: [[{ pluginId: '111' }], [{ pluginId: '333' }]], plugins: [[{ pluginId: 1 }], [{ pluginId: 3 }]],
TaskPanel: { height: '100' }, TaskPanel: { height: '100' },
}, },
{ {
state: 3, state: 3,
plugins: [[{ pluginId: '111' }], [{ pluginId: '444' }]], plugins: [[{ pluginId: 1 }], [{ pluginId: 4 }]],
TaskPanel: { height: '100' }, TaskPanel: { height: '100' },
}, },
{ {
state: 0, state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '555' }]], plugins: [[{ pluginId: 1 }], [{ pluginId: 5 }]],
TaskPanel: { height: '100' }, TaskPanel: { height: '100' },
}, },
{ {
state: 1, state: 1,
plugins: [[{ pluginId: '111' }], [{ pluginId: '666' }]], plugins: [[{ pluginId: 1 }], [{ pluginId: 6 }]],
TaskPanel: { height: '100' }, TaskPanel: { height: '100' },
}, },
], ],
addList: [ addList: [
{ {
state: 0, state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '222' }]], plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
TaskPanel: { height: '100' }, TaskPanel: { height: '100' },
}, },
{ {
state: 0, state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '222' }]], plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
TaskPanel: { height: '100' }, TaskPanel: { height: '100' },
}, },
{ {
state: 0, state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '333' }]], plugins: [[{ pluginId: 1 }], [{ pluginId: 3 }]],
TaskPanel: { height: '100' }, TaskPanel: { height: '100' },
}, },
], ],

51
src/config/plugin.js

@ -1,5 +1,54 @@
// 定义插件相关信息 // 定义插件相关信息
/* eslint-disable */ /* eslint-disable */
export default { export default {
defaults: [], // 默认插件id列表 defaults: [
{
id: 1,
name: 'TASK_NAME',
description: '任务名插件',
component: 'TaskTitle',
},
{
id: 2,
name: 'TASK_DESCRIPTION',
description: '任务描述插件',
component: 'TaskDescription',
},
{
id: 3,
name: 'TASK_DURATION_DELAY',
description: '任务时长延迟插件(+-1min)时间格式可设置',
component: 'TaskDurationDelay',
},
{
id: 4,
name: 'TASK_START_TIME_DELAY',
description: '任务开始时间延迟插件(+-1hour)',
component: 'TaskStartTimeDelay',
},
{
id: 5,
name: 'DELIVERABLE',
description: '交付物插件(人 + 交付物)可配置【仅人】 or 【仅交付物】 or 【人+交付物】',
component: 'Deliverable',
},
{
id: 6,
name: 'SUBTASKS',
description: '子任务插件:显示子任务',
component: 'Subtasks',
},
{
id: 7,
name: 'SUBPROJECT',
description: '子项目插件:显示子项目',
component: 'Subproject',
},
{
id: 8,
name: 'TASK_COUNTDOWN',
description: '任务倒计时插件',
component: 'TaskCountdown',
},
], // 默认插件id列表
}; };

278
src/mock/mock.js

@ -156,41 +156,43 @@ export default [
code: 200, code: 200,
msg: 'ok', msg: 'ok',
success: true, success: true,
data: { data: [
description: 'string', {
detailId: 147258, description: 'string',
id: 258147, detailId: 147258,
name: 'string', id: 258147,
panel: { name: 'string',
backgroundColor: 'string', panel: {
border: 'string', backgroundColor: 'string',
borderRadius: 'string', border: 'string',
col: 132, borderRadius: 'string',
height: 'string', col: 132,
row: 147, height: 'string',
shadow: 'string', row: 147,
width: 'string', shadow: 'string',
}, width: 'string',
planDuration: 123, },
planStart: 123456789, planDuration: 123,
plugins: [ planStart: 123456789,
[ plugins: [
{ [
col: 123, {
colspan: 123, col: 123,
param: 123, colspan: 123,
pluginId: 123456789, param: 123,
row: 123, pluginId: 123456789,
rowspan: 123, row: 123,
}, rowspan: 123,
},
],
], ],
], process: 0,
process: 0, realDuration: 123456789,
realDuration: 123456789, realStart: 123456789,
realStart: 123456789, skip: -1,
skip: -1, skipTaskId: 123456789,
skipTaskId: 123456789, },
}, ],
}); });
}, },
}, },
@ -203,41 +205,43 @@ export default [
code: 200, code: 200,
msg: 'ok', msg: 'ok',
success: true, success: true,
data: { data: [
description: 'string', {
detailId: 147258, description: 'string',
id: 258147, detailId: 147258,
name: 'string', id: 258147,
panel: { name: 'string',
backgroundColor: 'string', panel: {
border: 'string', backgroundColor: 'string',
borderRadius: 'string', border: 'string',
col: 132, borderRadius: 'string',
height: 'string', col: 132,
row: 147, height: 'string',
shadow: 'string', row: 147,
width: 'string', shadow: 'string',
}, width: 'string',
planDuration: 123, },
planStart: 123456789, planDuration: 123,
plugins: [ planStart: 123456789,
[ plugins: [
{ [
col: 123, {
colspan: 123, col: 123,
param: 123, colspan: 123,
pluginId: 123456789, param: 123,
row: 123, pluginId: 123456789,
rowspan: 123, row: 123,
}, rowspan: 123,
},
],
], ],
], process: 0,
process: 0, realDuration: 123456789,
realDuration: 123456789, realStart: 123456789,
realStart: 123456789, skip: -1,
skip: -1, skipTaskId: 123456789,
skipTaskId: 123456789, },
}, ],
}); });
}, },
}, },
@ -250,41 +254,113 @@ export default [
code: 200, code: 200,
msg: 'ok', msg: 'ok',
success: true, success: true,
data: { data: [
description: 'string', {
detailId: 147258, description: 'string',
id: 258147, detailId: 147258,
name: 'string', id: 258147,
panel: { name: 'string',
backgroundColor: 'string', panel: {
border: 'string', backgroundColor: 'string',
borderRadius: 'string', border: 'string',
col: 132, borderRadius: 'string',
height: 'string', col: 132,
row: 147, height: 'string',
shadow: 'string', row: 147,
width: 'string', shadow: 'string',
width: 'string',
},
planDuration: 123,
planStart: 123456789,
plugins: [
[
{
col: 123,
colspan: 123,
param: 123,
pluginId: 123456789,
row: 123,
rowspan: 123,
},
],
],
process: 0,
realDuration: 123456789,
realStart: 123456789,
skip: -1,
skipTaskId: 123456789,
}, },
planDuration: 123, {
planStart: 123456789, description: 'string',
plugins: [ detailId: 147258,
[ id: 254565,
{ name: 'string',
col: 123, panel: {
colspan: 123, backgroundColor: 'string',
param: 123, border: 'string',
pluginId: 123456789, borderRadius: 'string',
row: 123, col: 132,
rowspan: 123, height: 'string',
}, row: 147,
shadow: 'string',
width: 'string',
},
planDuration: 123,
planStart: 123456789,
plugins: [
[
{
col: 123,
colspan: 123,
param: 123,
pluginId: 123456789,
row: 123,
rowspan: 123,
},
],
], ],
], process: 0,
process: 0, realDuration: 123456789,
realDuration: 123456789, realStart: 123456789,
realStart: 123456789, skip: -1,
skip: -1, skipTaskId: 123456789,
skipTaskId: 123456789, },
}, {
description: 'string',
detailId: 147258,
id: 111125,
name: 'string',
panel: {
backgroundColor: 'string',
border: 'string',
borderRadius: 'string',
col: 132,
height: 'string',
row: 147,
shadow: 'string',
width: 'string',
},
planDuration: 123,
planStart: 123456789,
plugins: [
[
{
col: 123,
colspan: 123,
param: 123,
pluginId: 123456789,
row: 123,
rowspan: 123,
},
],
],
process: 0,
realDuration: 123456789,
realStart: 123456789,
skip: -1,
skipTaskId: 123456789,
},
],
}); });
}, },
}, },

16
src/pages/project/project.vue

@ -33,10 +33,10 @@ export default {
await this.getProjectById(params); await this.getProjectById(params);
// id // id
await this.getRoles(params); await this.getRoles(params);
console.log('this.visibleRoles: ', this.visibleRoles);
this.setInitialRoleId(this.visibleRoles); this.setInitialRoleId(this.visibleRoles);
// //
await this.getTasks(); await this.getTasks(0);
await this.getTasks(1);
}, },
mounted() { mounted() {
@ -45,7 +45,7 @@ export default {
methods: { methods: {
...mapMutations('user', ['setToken', 'setUser']), ...mapMutations('user', ['setToken', 'setUser']),
...mapMutations('home', ['setProject', 'setInvisibleRoles', 'setVisibleRoles', 'setRoleId']), ...mapMutations('home', ['setProject', 'setInvisibleRoles', 'setVisibleRoles', 'setRoleId', 'setUpTasks', 'setDownTasks']),
...mapActions('user', ['getUserId']), ...mapActions('user', ['getUserId']),
...mapActions('home', ['getProjectById', 'getRoles', 'handleRegularTask']), ...mapActions('home', ['getProjectById', 'getRoles', 'handleRegularTask']),
@ -67,16 +67,22 @@ export default {
* @param {string} roleId 角色id * @param {string} roleId 角色id
* @param {string} timeNode 时间基准点 默认当前 * @param {string} timeNode 时间基准点 默认当前
* @param {string} timeUnit 时间颗粒度 默认天 * @param {string} timeUnit 时间颗粒度 默认天
* @param {string} queryNum 查找颗粒度数量 默认3个
* @param {string} queryType 0向上查找 1向下查找(默认) 下查包含自己上查不包含
*/ */
async getTasks() { async getTasks(queryType) {
try { try {
const { roleId, timeNode, timeUnit } = this; const { roleId, timeNode, timeUnit } = this;
const params = { const params = {
roleId, roleId,
timeNode, timeNode,
timeUnit, timeUnit,
queryNum: 3,
queryType,
}; };
await this.handleRegularTask(params); const res = await this.handleRegularTask(params);
console.log('res: ', res);
queryType === 0 ? this.setUpTasks(res) : this.setDownTasks(res);
} catch (error) { } catch (error) {
console.log('error: ', error); console.log('error: ', error);
} }

2
src/plugins/TaskDesc/TaskDesc.vue → src/plugins/TaskDescription/TaskDescription.vue

@ -4,7 +4,7 @@
<script> <script>
export default { export default {
name: 'TaskDesc', name: 'TaskDescription',
props: {}, props: {},
data() { data() {
return { return {

2
src/plugins/TaskTimeDifference/TaskTimeDifference.vue → src/plugins/TaskDurationDelay/TaskDurationDelay.vue

@ -4,7 +4,7 @@
<script> <script>
export default { export default {
name: 'TaskTimeDifference', name: 'TaskDurationDelay',
props: {}, props: {},
data() { data() {
return { return {

23
src/plugins/TaskTitle copy/TaskTitle.vue

@ -0,0 +1,23 @@
<template>
<div class="task-title">{{ plugin.name }}</div>
</template>
<script>
export default {
name: 'TaskTitle',
props: {},
data() {
return {
plugin: {
name: '任务名',
id: '111',
},
};
},
computed: {},
methods: {},
watch: {},
};
</script>
<style></style>

4
src/plugins/TaskTitle/TaskTitle.vue

@ -5,12 +5,12 @@
<script> <script>
export default { export default {
name: 'TaskTitle', name: 'TaskTitle',
props: {}, props: { item: { type: Object, default: null } },
data() { data() {
return { return {
plugin: { plugin: {
name: '任务名', name: '任务名',
id: '111', id: '1',
}, },
}; };
}, },

7
src/store/home/actions.js

@ -37,12 +37,9 @@ const actions = {
* @param {string} timeNode 时间基准点 默认当前 * @param {string} timeNode 时间基准点 默认当前
* @param {string} timeUnit 时间颗粒度 默认天 * @param {string} timeUnit 时间颗粒度 默认天
*/ */
async handleRegularTask({ commit }, params) { async handleRegularTask(params) {
try { try {
uni.$u.api.getRegularTask(params).then(res => { return await uni.$u.api.getRegularTask(params);
commit('setTasks', res);
return res;
});
} catch (error) { } catch (error) {
throw error || '获取定期任务失败'; throw error || '获取定期任务失败';
} }

17
src/store/home/mutations.js

@ -101,12 +101,23 @@ const mutations = {
}, },
/** /**
* 设置定期任务数据 * 设置向上查到的定期任务数据
* @param {Object} state * @param {Object} state
* @param {Array} data 服务端返回的模板数组 * @param {Array} data 服务端返回的模板数组
*/ */
setTasks(state, data) { setUpTasks(state, data) {
state.tasks = data || []; console.log('data: ', data);
state.tasks = [...data.concat(state.tasks)] || [];
},
/**
* 设置向下查到的定期任务数据
* @param {Object} state
* @param {Array} data 服务端返回的模板数组
*/
setDownTasks(state, data) {
console.log('data: ', data);
state.tasks = [...state.tasks.concat(data)] || [];
}, },
}; };

Loading…
Cancel
Save