Browse Source

feat: 配置默认插件接口

develop
lucky 4 years ago
parent
commit
f0c177d976
  1. 1
      CHANGELOG.md
  2. 64
      src/components/TimeLine/component/TimeBox.vue
  3. 12
      src/mock/mock.js
  4. 5
      src/plugins/TaskTitle/TaskTitle.vue

1
CHANGELOG.md

@ -30,6 +30,7 @@
- | 任务快捷方式图标增加 | [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)

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

@ -1,6 +1,6 @@
<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">
@ -16,23 +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 :key="p.pluginId" v-for="p in plugin">
<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>
<!-- <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>
</view>
</u-card>
@ -56,59 +63,28 @@ export default {
data() {
return {
currentComponent: '',
list: [
{
state: 0,
plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
TaskPanel: { height: '100' },
},
{
state: 1,
plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
TaskPanel: { height: '100' },
},
{
state: 2,
plugins: [[{ pluginId: 1 }], [{ pluginId: 3 }]],
TaskPanel: { height: '100' },
},
{
state: 3,
plugins: [[{ pluginId: 1 }], [{ pluginId: 4 }]],
TaskPanel: { height: '100' },
},
{
state: 0,
plugins: [[{ pluginId: 1 }], [{ pluginId: 5 }]],
TaskPanel: { height: '100' },
},
{
state: 1,
plugins: [[{ pluginId: 1 }], [{ pluginId: 6 }]],
TaskPanel: { height: '100' },
},
],
addList: [
{
state: 0,
plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
TaskPanel: { height: '100' },
panel: { height: '100' },
},
{
state: 0,
plugins: [[{ pluginId: 1 }], [{ pluginId: 2 }]],
TaskPanel: { height: '100' },
panel: { height: '100' },
},
{
state: 0,
plugins: [[{ pluginId: 1 }], [{ pluginId: 3 }]],
TaskPanel: { height: '100' },
panel: { height: '100' },
},
],
};
},
computed: mapState('home', ['roleId', 'timeNode', 'timeUnit']),
computed: mapState('home', ['roleId', 'timeNode', 'timeUnit', 'tasks']),
created() {},
@ -116,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);
},
},
};

12
src/mock/mock.js

@ -265,7 +265,7 @@ export default [
border: 'string',
borderRadius: 'string',
col: 132,
height: 'string',
height: '100',
row: 147,
shadow: 'string',
width: 'string',
@ -278,7 +278,7 @@ export default [
col: 123,
colspan: 123,
param: 123,
pluginId: 123456789,
pluginId: 1,
row: 123,
rowspan: 123,
},
@ -300,7 +300,7 @@ export default [
border: 'string',
borderRadius: 'string',
col: 132,
height: 'string',
height: '100',
row: 147,
shadow: 'string',
width: 'string',
@ -313,7 +313,7 @@ export default [
col: 123,
colspan: 123,
param: 123,
pluginId: 123456789,
pluginId: 2,
row: 123,
rowspan: 123,
},
@ -335,7 +335,7 @@ export default [
border: 'string',
borderRadius: 'string',
col: 132,
height: 'string',
height: '100',
row: 147,
shadow: 'string',
width: 'string',
@ -348,7 +348,7 @@ export default [
col: 123,
colspan: 123,
param: 123,
pluginId: 123456789,
pluginId: 3,
row: 123,
rowspan: 123,
},

5
src/plugins/TaskTitle/TaskTitle.vue

@ -1,5 +1,5 @@
<template>
<div class="task-title">{{ plugin.name }}</div>
<div class="task-title">{{ item.name }}</div>
</template>
<script>
@ -14,6 +14,9 @@ export default {
},
};
},
mounted() {
console.log('item', this.item);
},
computed: {},
methods: {},
watch: {},

Loading…
Cancel
Save