Browse Source

Merge pull request 'temp' (#15) from temp into develop

Reviewed-on: https://dd.tall.wiki/gitea/wally/TALL-MUI-3/pulls/15
develop
wally 4 years ago
parent
commit
62457f36bb
  1. 93
      CHANGELOG.md
  2. 96
      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. 9
      src/plugins/TaskTitle/TaskTitle.vue
  10. 7
      src/store/home/actions.js
  11. 17
      src/store/home/mutations.js

93
CHANGELOG.md

@ -15,88 +15,77 @@
- | 添加时间轴上下滚动 | [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)
- | 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)
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
--|--|--
- | 代码格式细节调整 | [cb2532b](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/cb2532b)
- | 任务快捷方式图标增加 | [4aba872](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/4aba872)
- | 修改角色样式 | [73e268e](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/73e268e)
- | 图标修改 | [54bca09](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/54bca09)
- | 无基本变化 | [21ac4bb](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/21ac4bb)
- | 日常任务修改 | [dfa7ee2](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/dfa7ee2)
- | 更新代码 | [8c27e68](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/8c27e68)
- | 更新代码 | [1f40a76](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/1f40a76)
- | 组件新建 | [89c0035](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/89c0035)
- | 代码格式细节调整 | [cb2532b](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/cb2532b)
- | 更新代码 | [8c27e68](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/8c27e68)
- | 更新代码 | [1f40a76](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/1f40a76)
- | 任务快捷方式图标增加 | [4aba872](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/4aba872)
- | 日常任务修改 | [dfa7ee2](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/dfa7ee2)
- | 删除插件携带的多余文件 | [0f392bb](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/0f392bb)
- | 添加插件数据 | [2f11b42](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/2f11b42)
- | 图标修改 | [54bca09](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/54bca09)
- | 无基本变化 | [21ac4bb](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/21ac4bb)
- | 修改角色样式 | [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 修复
范围|描述|commitId
--|--|--
- | 上下滚动时间轴 | [d533a01](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/d533a01)
- | 修改main | [749ae9a](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/749ae9a)
- | 修改角色栏组件 | [a54c601](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/a54c601)
- | 提示信息显示bug及日常任务收缩问题 | [f2f06c5](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/f2f06c5)
- | 时间轴上下滑动 | [4d0ae46](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/4d0ae46)
- | 时间轴上下滚动数据加载bug修改 | [e82ede4](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/e82ede4)
- | 角色栏修改 | [19228d6](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/19228d6)
- | 骨架屏替换 | [e9fdd71](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/e9fdd71)
- | 角色栏修改 | [19228d6](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/19228d6)
- | 骨架屏替换 | [e9fdd71](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/e9fdd71)
- | 角色栏修改 | [19228d6](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/19228d6)
- | 上下滚动时间轴 | [d533a01](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/d533a01)
- | 时间轴上下滚动数据加载bug修改 | [e82ede4](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/e82ede4)
- | 时间轴上下滑动 | [4d0ae46](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/4d0ae46)
- | 提示信息显示bug及日常任务收缩问题 | [f2f06c5](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/f2f06c5)
- | 修改角色栏组件 | [a54c601](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/a54c601)
- | 修改main | [749ae9a](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/749ae9a)
### 📝 文档
范围|描述|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
--|--|--
- | api 封装 | [8dcb8a2](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/8dcb8a2)
- | 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)
template | eslint prettier sass uview tailwindcss | [9c966a1](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/9c966a1)
### 🚀 性能优化
范围|描述|commitId
--|--|--
- | style:index | [978f272](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/978f272)
- | !2 基础模板v1.1.0 | [f5e61dd](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/f5e61dd)
- | init | [c0f1deb](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/c0f1deb)
- | 角色栏文字颜色修改 | [215c6b3](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/215c6b3)
- | 解决警告 | [c932b09](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/c932b09)
- | 组件文件夹新建 | [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
--|--|--
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
--|--|--
- | 组件文件夹新建 | [22bfe7b](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/22bfe7b)
- | 组件文件夹新建 | [17bb8c9](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/17bb8c9)
- | 组件文件夹新建 | [1421504](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/1421504)
- | 角色栏文字颜色修改 | [215c6b3](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/215c6b3)
- | style:index | [978f272](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/978f272)
- | !2 基础模板v1.1.0 | [f5e61dd](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/f5e61dd)
- | init | [c0f1deb](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/c0f1deb)

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

@ -1,13 +1,6 @@
<!--
* @Author: aBin
* @email: binbin0314@126.com
* @Date: 2021-07-19 15:36:28
* @LastEditors: aBin
* @LastEditTime: 2021-07-19 18:54:55
-->
<template>
<view class="px-3 pb-10">
<view :key="index" v-for="(item, index) in list">
<view :key="index" v-for="(item, index) in tasks">
<view class="flex items-center">
<TimeStatus :content="JSON.stringify(item.state)" :status="item.state" />
<view class="flex-1 ml-2 flex justify-between">
@ -23,19 +16,30 @@
</view>
<view class="border-l-2 border-gray-300 ml-3.5 my-2">
<view class="ml-4 shadow-lg task-box overflow-hidden">
<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.panel.height + 'px' }"
class="h-16"
margin="0"
v-if="item.panel.height"
>
<view slot="body">
<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">
<text v-if="p.pluginId === '444'">这是个基准线</text>
<!-- 默认插件任务名 -->
<task-title v-if="p.pluginId === '111'" />
<!-- 默认插件任务描述 -->
<task-desc v-if="p.pluginId === '222'" />
<!-- 默认插件任务时差 -->
<task-time-difference v-if="p.pluginId === '333'" />
<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">
<text v-if="p.pluginId === 4">这是个基准线</text>
<component :is="currentComponent"></component>
<task-title v-if="p.pluginId === 1" />
<task-description v-if="p.pluginId === 2" />
<task-duration-delay v-if="p.pluginId === 3" />
</view>-->
</view>
</view>
</u-card>
@ -48,69 +52,39 @@
<script>
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 TimeStatus from './TimeStatus.vue';
import TaskTimeDifference from '@/plugins/TaskTimeDifference/TaskTimeDifference.vue';
import TaskDurationDelay from '@/plugins/TaskDurationDelay/TaskDurationDelay.vue';
export default {
name: 'TimeBox',
components: { TimeStatus, TaskTitle, TaskDesc, TaskTimeDifference },
components: { TimeStatus, TaskTitle, TaskDescription, TaskDurationDelay },
data() {
return {
list: [
{
state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '222' }]],
TaskPanel: { height: '100' },
},
{
state: 1,
plugins: [[{ pluginId: '111' }], [{ pluginId: '222' }]],
TaskPanel: { height: '100' },
},
{
state: 2,
plugins: [[{ pluginId: '111' }], [{ pluginId: '333' }]],
TaskPanel: { height: '100' },
},
{
state: 3,
plugins: [[{ pluginId: '111' }], [{ pluginId: '444' }]],
TaskPanel: { height: '100' },
},
{
state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '555' }]],
TaskPanel: { height: '100' },
},
{
state: 1,
plugins: [[{ pluginId: '111' }], [{ pluginId: '666' }]],
TaskPanel: { height: '100' },
},
],
currentComponent: '',
addList: [
{
state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '222' }]],
TaskPanel: { height: '100' },
plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
panel: { height: '100' },
},
{
state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '222' }]],
TaskPanel: { height: '100' },
plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
panel: { height: '100' },
},
{
state: 0,
plugins: [[{ pluginId: '111' }], [{ pluginId: '333' }]],
TaskPanel: { height: '100' },
plugins: [[{ pluginId: 1 }], [{ pluginId: 3 }]],
panel: { height: '100' },
},
],
};
},
computed: mapState('home', ['roleId', 'timeNode', 'timeUnit']),
computed: mapState('home', ['roleId', 'timeNode', 'timeUnit', 'tasks']),
created() {},
@ -118,11 +92,11 @@ export default {
...mapMutations('home', ['setTipsContent', 'setTipsContent']),
addTopList() {
this.list = this.addList.concat(this.list);
this.tasks = this.addList.concat(this.tasks);
},
addBottomList() {
this.list = this.list.concat(this.addList);
this.tasks = this.tasks.concat(this.addList);
},
},
};

51
src/config/plugin.js

@ -1,5 +1,54 @@
// 定义插件相关信息
/* eslint-disable */
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,
msg: 'ok',
success: true,
data: {
description: 'string',
detailId: 147258,
id: 258147,
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,
},
data: [
{
description: 'string',
detailId: 147258,
id: 258147,
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,
},
process: 0,
realDuration: 123456789,
realStart: 123456789,
skip: -1,
skipTaskId: 123456789,
},
],
});
},
},
@ -203,41 +205,43 @@ export default [
code: 200,
msg: 'ok',
success: true,
data: {
description: 'string',
detailId: 147258,
id: 258147,
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,
},
data: [
{
description: 'string',
detailId: 147258,
id: 258147,
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,
},
process: 0,
realDuration: 123456789,
realStart: 123456789,
skip: -1,
skipTaskId: 123456789,
},
],
});
},
},
@ -250,41 +254,113 @@ export default [
code: 200,
msg: 'ok',
success: true,
data: {
description: 'string',
detailId: 147258,
id: 258147,
name: 'string',
panel: {
backgroundColor: 'string',
border: 'string',
borderRadius: 'string',
col: 132,
height: 'string',
row: 147,
shadow: 'string',
width: 'string',
data: [
{
description: 'string',
detailId: 147258,
id: 258147,
name: 'string',
panel: {
backgroundColor: 'string',
border: 'string',
borderRadius: 'string',
col: 132,
height: '100',
row: 147,
shadow: 'string',
width: 'string',
},
planDuration: 123,
planStart: 123456789,
plugins: [
[
{
col: 123,
colspan: 123,
param: 123,
pluginId: 1,
row: 123,
rowspan: 123,
},
],
],
process: 0,
realDuration: 123456789,
realStart: 123456789,
skip: -1,
skipTaskId: 123456789,
},
planDuration: 123,
planStart: 123456789,
plugins: [
[
{
col: 123,
colspan: 123,
param: 123,
pluginId: 123456789,
row: 123,
rowspan: 123,
},
{
description: 'string',
detailId: 147258,
id: 254565,
name: 'string',
panel: {
backgroundColor: 'string',
border: 'string',
borderRadius: 'string',
col: 132,
height: '100',
row: 147,
shadow: 'string',
width: 'string',
},
planDuration: 123,
planStart: 123456789,
plugins: [
[
{
col: 123,
colspan: 123,
param: 123,
pluginId: 2,
row: 123,
rowspan: 123,
},
],
],
],
process: 0,
realDuration: 123456789,
realStart: 123456789,
skip: -1,
skipTaskId: 123456789,
},
process: 0,
realDuration: 123456789,
realStart: 123456789,
skip: -1,
skipTaskId: 123456789,
},
{
description: 'string',
detailId: 147258,
id: 111125,
name: 'string',
panel: {
backgroundColor: 'string',
border: 'string',
borderRadius: 'string',
col: 132,
height: '100',
row: 147,
shadow: 'string',
width: 'string',
},
planDuration: 123,
planStart: 123456789,
plugins: [
[
{
col: 123,
colspan: 123,
param: 123,
pluginId: 3,
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);
// id
await this.getRoles(params);
console.log('this.visibleRoles: ', this.visibleRoles);
this.setInitialRoleId(this.visibleRoles);
//
await this.getTasks();
await this.getTasks(0);
await this.getTasks(1);
},
mounted() {
@ -45,7 +45,7 @@ export default {
methods: {
...mapMutations('user', ['setToken', 'setUser']),
...mapMutations('home', ['setProject', 'setInvisibleRoles', 'setVisibleRoles', 'setRoleId']),
...mapMutations('home', ['setProject', 'setInvisibleRoles', 'setVisibleRoles', 'setRoleId', 'setUpTasks', 'setDownTasks']),
...mapActions('user', ['getUserId']),
...mapActions('home', ['getProjectById', 'getRoles', 'handleRegularTask']),
@ -67,16 +67,22 @@ export default {
* @param {string} roleId 角色id
* @param {string} timeNode 时间基准点 默认当前
* @param {string} timeUnit 时间颗粒度 默认天
* @param {string} queryNum 查找颗粒度数量 默认3个
* @param {string} queryType 0向上查找 1向下查找(默认) 下查包含自己上查不包含
*/
async getTasks() {
async getTasks(queryType) {
try {
const { roleId, timeNode, timeUnit } = this;
const params = {
roleId,
timeNode,
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) {
console.log('error: ', error);
}

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

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

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

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

9
src/plugins/TaskTitle/TaskTitle.vue

@ -1,19 +1,22 @@
<template>
<div class="task-title">{{ plugin.name }}</div>
<div class="task-title">{{ item.name }}</div>
</template>
<script>
export default {
name: 'TaskTitle',
props: {},
props: { item: { type: Object, default: null } },
data() {
return {
plugin: {
name: '任务名',
id: '111',
id: '1',
},
};
},
mounted() {
console.log('item', this.item);
},
computed: {},
methods: {},
watch: {},

7
src/store/home/actions.js

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

17
src/store/home/mutations.js

@ -101,12 +101,23 @@ const mutations = {
},
/**
* 设置定期任务数据
* 设置向上查到的定期任务数据
* @param {Object} state
* @param {Array} data 服务端返回的模板数组
*/
setTasks(state, data) {
state.tasks = data || [];
setUpTasks(state, 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