Browse Source

Merge remote-tracking branch 'origin/featComponent' into song

develop
lucky 4 years ago
parent
commit
ee6c357f92
  1. 3
      CHANGELOG.md
  2. 33
      src/components/Globals/Globals.vue
  3. 11
      src/components/Plugin/Plugin.vue
  4. 2
      src/components/TimeLine/component/TimeBox.vue
  5. 26
      src/pages/project/project.vue

3
CHANGELOG.md

@ -13,6 +13,7 @@
- | 模拟接口测试 | [69e7931](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/69e7931)
- | 配置默认插件接口 | [f0c177d](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/f0c177d)
- | 全局插件及默认插件位置修改 | [6c80d08](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/6c80d08)
- | 日常任务插件调整 | [c1881f9](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/c1881f9)
- | 时间基准线,默认插件 | [a33ba1e](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/a33ba1e)
- | 时间轴界面 | [33927e9](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/33927e9)
- | 时间轴修改状态时提示框增加 | [e841392](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/e841392)
@ -52,6 +53,7 @@
- | 骨架屏替换 | [e9fdd71](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/e9fdd71)
- | 角色栏修改 | [19228d6](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/19228d6)
- | 解决时间轴报错 | [da1eece](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/da1eece)
- | 日常任务html数据查验 | [880ce5c](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/880ce5c)
- | 上下滚动时间轴 | [d533a01](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/d533a01)
- | 上下滑动加载定期任务 | [4090d89](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/4090d89)
- | 时间轴插件 | [225d3cc](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/225d3cc)
@ -107,4 +109,3 @@
- | 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)

33
src/components/Globals/Globals.vue

@ -3,17 +3,24 @@
<u-card :show-foot="false" :show-head="false" :style="{ height: isShrink ? '96rpx' : '300rpx' }" border-radius="25" margin="0">
<view slot="body">
<scroll-view :scrollY="true" :style="{ height: isShrink ? '40rpx' : '240rpx' }">
<skeleton :banner="false" :loading="!plugins.length" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton>
<view class="p-0 u-col-between">
<view class="grid grid-cols-3 gap-2 h-auto" v-if="plugins.length">
<Plugin
:class="getClass(plugin.colspan, plugin.rowspan)"
:key="pluginIndex"
:pluginId="plugin.pluginId"
:styleType="plugin.styleType || 0"
v-for="(plugin, pluginIndex) in plugins"
/>
</view>
<skeleton :banner="false" :loading="!tasks.length" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton>
<view class="grid grid-cols-3 gap-2 h-auto">
<template v-for="item in tasks">
<template v-if="item.plugins">
<template v-for="(pluginArr, arrIndex) in item.plugins">
<view class="p-0 u-col-between" :key="pluginArr[arrIndex].pluginTaskId">
<Plugin
:item="item"
:class="getClass(plugin.col, plugin.row)"
:key="plugin.pluginTaskId"
:pluginId="plugin.pluginId"
:styleType="plugin.styleType || 0"
v-for="plugin in pluginArr"
/>
</view>
</template>
</template>
</template>
</view>
</scroll-view>
</view>
@ -28,12 +35,10 @@ import Skeleton from '@/components/Skeleton/Skeleton';
export default {
name: 'Global',
components: { Skeleton },
props: { plugins: { type: Array, default: () => [] } },
props: { tasks: { type: Array, default: () => [] } },
data() {
return {
// loading: true,
pluginId: 0,
styleType: 0,
task: null,
};
},

11
src/components/Plugin/Plugin.vue

@ -29,13 +29,17 @@ export default {
type: Object,
},
pluginId: {
default: '0',
default: '1',
type: String,
},
styleType: {
default: 0,
type: Number,
},
pluginTaskId: {
default: '0',
type: String,
},
},
data() {
@ -43,8 +47,11 @@ export default {
},
async created() {
console.log(this.pluginId);
await this.getPlugin();
if (this.pluginContent.js) {
let domList = Array.from(document.getElementsByTagName('script'));
const index = domList.findIndex(item => item.id === `p${this.pluginContent.pluginId}`);
if (this.pluginContent.js && index === -1) {
var scriptDom = document.createElement('script');
scriptDom.id = `p${this.pluginContent.pluginId}`;
scriptDom.innerHTML = this.pluginContent.js;

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

@ -36,7 +36,7 @@
<view :key="pIndex" v-for="(p, pIndex) in item.plugins">
<view class="grid gap-2" v-if="p.length">
<Plugin
:class="getClass(plugin.colspan, plugin.rowspan)"
:class="getClass(plugin.col, plugin.row)"
:item="item"
:key="plugin.pluginTaskId"
:pluginId="plugin.pluginId"

26
src/pages/project/project.vue

@ -5,9 +5,7 @@
<view class="container flex flex-col flex-1 overflow-hidden bg-gray-100">
<!-- 角色栏 -->
<Roles @getTasksByRole="getTasksByRole" />
<!-- 日常任务 -->
<Globals :plugins="plugins" />
<!-- 定期任务 -->
<Globals :tasks="allPlugins.concat(timePlugins)" />
<TimeLine @getTasks="getTasks" class="flex-1 overflow-hidden" ref="child" />
</view>
</view>
@ -167,10 +165,13 @@ export default {
try {
this.allPlugins = [];
const res = await this.$u.api.getPermanent({ roleId: this.roleId });
for (let item of res) {
this.allPlugins = this.allPlugins.concat(item.plugins);
}
console.log('res', res);
// for (let item of res) {
// if (item.plugins) {
// this.allPlugins = this.allPlugins.concat(item.plugins);
// }
// }
this.allPlugins = res;
console.log('allPlugins', this.allPlugins);
} catch (error) {
console.log('error: ', error);
}
@ -188,11 +189,12 @@ export default {
const { roleId, timeNode, timeUnit } = this;
const params = { roleId, timeNode, timeUnit };
const res = await this.$u.api.getGlobal(params);
for (let task of res) {
for (let item of task.plugins) {
this.timePlugins.push(...item);
}
}
// for (let task of res) {
// for (let item of task.plugins) {
// this.timePlugins.push(...item);
// }
// }
this.timePlugins = res;
this.setDailyTasks(res);
} catch (error) {
console.log('error: ', error);

Loading…
Cancel
Save