Browse Source

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

tall
wally 4 years ago
parent
commit
465b594e3e
  1. 14
      CHANGELOG.md
  2. 14
      src/components/Globals/Globals.vue
  3. 4
      src/components/Plugin/Plugin.vue
  4. 86
      src/components/TimeLine/TimeLine.vue
  5. 37
      src/components/TimeLine/component/TimeStatus.vue
  6. 25
      src/pages/project/project.vue
  7. 3
      src/plugins/p-deliverable/p-deliverable.vue
  8. 3
      src/plugins/p-subproject/p-subproject.vue
  9. 2
      src/plugins/p-subtasks/p-subtasks.vue
  10. 3
      src/plugins/p-task-countdown/p-task-countdown.vue
  11. 3
      src/plugins/p-task-description/p-task-description.vue
  12. 12
      src/plugins/p-task-duration-delay/p-task-duration-delay.vue
  13. 8
      src/plugins/p-task-start-time-delay/p-task-start-time-delay.vue
  14. 3
      src/plugins/p-task-title/p-task-title.vue
  15. 8
      src/store/home/mutations.js
  16. 4
      src/store/home/state.js
  17. 12
      src/utils/time.js
  18. 2
      vue.config.js

14
CHANGELOG.md

@ -67,6 +67,18 @@
- | 更新代码 | 1f40a76
- | 添加插件数据 | 2f11b42
- | 组件新建 | 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)
- | 删除多余字段 | [5ae3973](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/5ae3973)
- | 添加插件数据 | [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 修复
@ -92,6 +104,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)
- | 日常任务插件遍历时的key值修改 | [cd26285](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/cd26285)
- | 日常任务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)
@ -101,6 +114,7 @@
- | 时间轴上下滑动 | [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)
- | 下拉加载定期任务传参,时间格式化修改 | [0b95a0e](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/0b95a0e)
- | 修改报错 | [531c14d](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/531c14d)
- | 修改角色栏组件 | [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)

14
src/components/Globals/Globals.vue

@ -4,20 +4,20 @@
<view slot="body">
<scroll-view :scrollY="true" :style="{ height: isShrink ? '40rpx' : '240rpx' }">
<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">
<view class="grid gap-2">
<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">
<template v-for="pluginArr in item.plugins">
<template class="p-0 u-col-between" v-if="pluginArr.length">
<Plugin
:item="item"
:class="getClass(plugin.col, plugin.row)"
:item="item"
:key="plugin.pluginTaskId"
:pluginId="plugin.pluginId"
:styleType="plugin.styleType || 0"
v-for="plugin in pluginArr"
/>
</view>
</template>
</template>
</template>
</template>
@ -43,10 +43,8 @@ export default {
};
},
// mounted() {
// setTimeout(() => (this.loading = false), 2000);
// },
computed: mapState('home', ['isShrink']),
methods: {
getClass(col, row) {
return [`row-span-${row}`, `col-span-${col}`];

4
src/components/Plugin/Plugin.vue

@ -9,7 +9,8 @@
<p-task-title :item="item" v-if="pluginId === '1'" />
<p-task-description :item="item" v-if="pluginId === '2'" />
<p-task-duration-delay :item="item" v-if="pluginId === '3'" />
<p-task-start-time-delay :item="item" v-if="pluginId === '4'" />
<p-task-start-time-delay :item="item" />
<!-- <p-task-start-time-delay :item="item" v-if="pluginId === '4'" /> -->
<p-deliverable :item="item" v-if="pluginId === '5'" />
<p-subtasks :item="item" v-if="pluginId === '6'" />
<p-subproject :item="item" v-if="pluginId === '7'" />
@ -47,7 +48,6 @@ export default {
},
async created() {
console.log(this.pluginId);
await this.getPlugin();
let domList = Array.from(document.getElementsByTagName('script'));
const index = domList.findIndex(item => item.id === `p${this.pluginContent.pluginId}`);

86
src/components/TimeLine/TimeLine.vue

@ -38,7 +38,7 @@ export default {
},
methods: {
...mapMutations('home', ['setScrollTop', 'setShrink', 'setRoleId']),
...mapMutations('home', ['setScrollTop', 'setShrink', 'setRoleId', 'setUpTasks', 'setDownTasks']),
//
scroll(e) {
@ -50,26 +50,79 @@ export default {
//
async handleScrollTop() {
if (this.topEnd) return;
const upQuery = {
timeNode: +this.tasks[0].planStart,
queryType: 0,
queryNum: 6,
};
await this.$emit('getTasks', upQuery);
const startTime = this.tasks[0].planStart - 0;
console.log('this.topEnd: ', this.topEnd);
console.log('this.tasks: ', this.tasks);
console.log('this.tasks[0].plugins: ', this.tasks[0].plugins);
if (this.tasks[0].plugins && this.tasks[0].plugins.length === 0 && !this.topEnd) {
//
console.log('没有数据时: ');
const addTasks = [
{
panel: {},
plugins: [],
planStart: this.$t.time.add(startTime, -3, 'day').valueOf(),
},
{
panel: {},
plugins: [],
planStart: this.$t.time.add(startTime, -2, 'day').valueOf(),
},
{
panel: {},
plugins: [],
planStart: this.$t.time.add(startTime, -1, 'day').valueOf(),
},
];
this.setUpTasks([...addTasks.concat(this.tasks)]);
} else {
//
console.log('有数据时: ');
const upQuery = {
timeNode: startTime,
queryType: 0,
queryNum: 6,
};
await this.$emit('getTasks', upQuery);
}
},
//
async handleScrollBottom() {
if (this.bottomEnd) return;
// =+
const cycle = this.$t.time.computeCycle('天');
const timeNode = this.$t.time.add(+this.tasks[this.tasks.length - 1].planStart, 1, cycle).valueOf();
const downQuery = {
timeNode,
queryType: 1,
queryNum: 6,
};
await this.$emit('getTasks', downQuery);
const startTime = this.tasks[this.tasks.length - 1].planStart - 0;
if (this.tasks[0].plugins && this.tasks[0].plugins.length === 0 && !this.topEnd) {
//
console.log('没有数据时: ');
const addTasks = [
{
panel: {},
plugins: [],
planStart: this.$t.time.add(startTime, 1, 'day').valueOf(),
},
{
panel: {},
plugins: [],
planStart: this.$t.time.add(startTime, 2, 'day').valueOf(),
},
{
panel: {},
plugins: [],
planStart: this.$t.time.add(startTime, 3, 'day').valueOf(),
},
];
this.setDownTasks([...this.tasks.concat(addTasks)]);
} else {
// =+
const cycle = this.$t.time.computeCycle('天');
const timeNode = this.$t.time.add(startTime, 1, cycle).valueOf();
const downQuery = {
timeNode,
queryType: 1,
queryNum: 6,
};
await this.$emit('getTasks', downQuery);
}
},
//
@ -80,7 +133,6 @@ export default {
const scrollHeight = document.getElementById('scroll').clientHeight;
let width = document.documentElement.clientWidth;
for (let i = 0; i < 3; i++) {
// TODO:
if (tasks[i].panel && tasks[i].panel.height) {
// + 42
tasksHeight += +tasks[i].panel.height + 42;

37
src/components/TimeLine/component/TimeStatus.vue

@ -1,25 +1,34 @@
<template>
<view>
<view class="flex items-center justify-center text-blue-400 rounded-full h-7 w-7" v-if="status === 0" @tap="changeStatus($event, 0)">
<u-circle-progress :percent="100" active-color="#2979ff" bgColor="rgba(255,255,255,0)" borderWidth="4" width="66">
<view @tap="changeStatus($event, 0)" class="flex items-center justify-center text-blue-400 rounded-full h-7 w-7" v-if="status === 0">
<view class="circular text-center">
<u-icon color="#2979ff" name="checkmark" size="30"></u-icon>
</view>
<!-- <u-circle-progress
:percent="100"
active-color="#2979ff"
bg-color="rgba(255,255,255,0)"
borderWidth="4"
width="66"
>
<view class="u-progress-content">
<view class="u-progress-dot"></view>
<view class="u-progress-info">
<u-icon name="checkmark" size="30"></u-icon>
</view>
</view>
</u-circle-progress>
</u-circle-progress>-->
</view>
<view class="flex items-center justify-center text-black rounded-full h-7 w-7" v-if="status === 1" @tap="changeStatus($event, 1)">
<u-circle-progress :percent="80" active-color="#2979ff" bgColor="rgba(255,255,255,0)" borderWidth="6" width="66">
<view @tap="changeStatus($event, 1)" class="flex items-center justify-center text-black rounded-full h-7 w-7" v-if="status === 1">
<u-circle-progress :percent="80" active-color="#2979ff" bg-color="rgba(255,255,255,0)" borderWidth="6" width="66">
<view class="u-progress-content">
<view class="u-progress-dot"></view>
<view class="u-progress-info">{{ time }}</view>
</view>
</u-circle-progress>
</view>
<view class="flex items-center justify-center text-gray-400 rounded-full h-7 w-7" v-if="status === 2" @tap="changeStatus($event, 2)">
<u-circle-progress :percent="40" active-color="#2979ff" bgColor="rgba(255,255,255,0)" borderWidth="6" width="66">
<view @tap="changeStatus($event, 2)" class="flex items-center justify-center text-gray-400 rounded-full h-7 w-7" v-if="status === 2">
<u-circle-progress :percent="40" active-color="#2979ff" bg-color="rgba(255,255,255,0)" borderWidth="6" width="66">
<view class="u-progress-content">
<view class="u-progress-dot"></view>
<view class="u-progress-info">
@ -29,11 +38,11 @@
</u-circle-progress>
</view>
<view
@tap="changeStatus($event, 3)"
class="flex items-center justify-center font-black text-red-800 rounded-full h-7 w-7"
v-if="status === 3"
@tap="changeStatus($event, 3)"
>
<u-circle-progress :percent="80" active-color="#2979ff" bgColor="rgba(255,255,255,0)" borderWidth="6" width="66">
<u-circle-progress :percent="80" active-color="#2979ff" bg-color="rgba(255,255,255,0)" borderWidth="6" width="66">
<view class="u-progress-content">
<view class="u-progress-dot"></view>
<view class="u-progress-info">
@ -96,3 +105,13 @@ export default {
},
};
</script>
<style lang="scss" scoped>
.circular {
width: 62rpx;
height: 62rpx;
border-radius: 50%;
border: 6rpx solid #2979ff;
line-height: 56rpx;
}
</style>

25
src/pages/project/project.vue

@ -16,7 +16,7 @@ import { mapState, mapMutations, mapActions } from 'vuex';
export default {
data() {
return { height: '', plugins: [] };
return { height: '', plugins: [], allPlugins: [], timePlugins: [] };
},
computed: {
@ -34,20 +34,24 @@ export default {
* 重新根据时间和角色查询普通日常任务
* 永久日常任务不发生改变
*/
async timeNode() {
//
await this.getGlobal();
async timeNode(val) {
if (val) {
//
await this.getGlobal();
}
},
/**
* 当角色发生变化时
* 重新查询永久日常任务和普通日常任务
*/
async roleId() {
this.setTimeNode(new Date().getTime());
//
await this.getPermanent();
//
await this.getGlobal();
async roleId(val) {
if (val) {
this.setTimeNode(new Date().getTime());
//
await this.getPermanent();
//
await this.getGlobal();
}
},
},
@ -171,7 +175,6 @@ export default {
// }
// }
this.allPlugins = res;
console.log('allPlugins', this.allPlugins);
} catch (error) {
console.log('error: ', error);
}

3
src/plugins/p-deliverable/p-deliverable.vue

@ -1,5 +1,6 @@
<template>
<div>交付物</div>
<!-- 交付物 -->
<view>交付物</view>
</template>
<script>

3
src/plugins/p-subproject/p-subproject.vue

@ -1,5 +1,6 @@
<template>
<div>子项目插件显示子项目</div>
<!-- 子项目插件 -->
<view>子项目插件显示子项目</view>
</template>
<script>

2
src/plugins/p-subtasks/p-subtasks.vue

@ -1,5 +1,5 @@
<template>
<div>子任务插件显示子任务</div>
<view>子任务插件显示子任务</view>
</template>
<script>

3
src/plugins/p-task-countdown/p-task-countdown.vue

@ -1,5 +1,6 @@
<template>
<div>任务倒计时插件</div>
<!-- 任务倒计时插件 -->
<view>任务倒计时插件</view>
</template>
<script>

3
src/plugins/p-task-description/p-task-description.vue

@ -1,5 +1,6 @@
<template>
<div>{{ item.description }}</div>
<!-- 任务描述 -->
<view>{{ item.description }}</view>
</template>
<script>

12
src/plugins/p-task-duration-delay/p-task-duration-delay.vue

@ -1,5 +1,15 @@
<template>
<div>任务时长延迟插件+-1min时间格式可设置</div>
<view v-if="item.realDuration && item.planDuration">
<!-- 任务时长延迟插件 -->
<!-- 超时 -->
<span class="text-green-500 font-bold" v-if="+item.realDuration > +item.planDuration"
>+{{ $t.time.formatDuration(+item.realDuration - +item.planDuration) }}</span
>
<!-- 延时 -->
<span class="text-red-500 font-bold" v-if="+item.realDuration < +item.planDuration"
>-{{ $t.time.formatDuration(+item.planDuration - +item.realDuration) }}</span
>
</view>
</template>
<script>

8
src/plugins/p-task-start-time-delay/p-task-start-time-delay.vue

@ -1,5 +1,11 @@
<template>
<div>任务开始时间延迟插件+-1hour</div>
<!-- <view v-if="item.realStart && item.planStart"> -->
<view>
<!-- 任务开始时间延迟插件 -->
<!-- 超时 -->
<!-- <span>{{ $t.time.formatBeginTime((+item.realStart) - (+item.planStart)) }}</span> -->
<span>{{ $t.time.formatDuration(1626843599995 - 1626757200000) }}</span>
</view>
</template>
<script>

3
src/plugins/p-task-title/p-task-title.vue

@ -1,5 +1,6 @@
<template>
<div>{{ item.name }}</div>
<!-- 任务名插件 -->
<view>{{ item.name }}</view>
</template>
<script>

8
src/store/home/mutations.js

@ -125,7 +125,6 @@ const mutations = {
if (!data || !data.length) {
state.topEnd = true;
}
console.log('!state.tasks.plugins.length: ', !state.tasks[0].name);
if (!state.tasks[0].name) {
state.tasks = [...data];
} else {
@ -154,21 +153,22 @@ const mutations = {
* @param {Object} state
*/
setTasks(state) {
const time = +new Date().getTime();
const data = [
{
panel: {},
plugins: [],
planStart: new Date().getTime(),
planStart: uni.$t.time.add(time, -1, 'day').valueOf(),
},
{
panel: {},
plugins: [],
planStart: new Date().getTime(),
planStart: time,
},
{
panel: {},
plugins: [],
planStart: new Date().getTime(),
planStart: uni.$t.time.add(time, 1, 'day').valueOf(),
},
];
state.tasks = data;

4
src/store/home/state.js

@ -18,7 +18,7 @@ const state = {
{
panel: {},
plugins: [],
planStart: new Date().getTime(),
planStart: uni.$t.time.add(+new Date().getTime(), -1, 'day').valueOf(),
},
{
panel: {},
@ -28,7 +28,7 @@ const state = {
{
panel: {},
plugins: [],
planStart: new Date().getTime(),
planStart: uni.$t.time.add(+new Date().getTime(), 1, 'day').valueOf(),
},
], // 定期任务
topEnd: false, // 时间轴向上查任务到顶了

12
src/utils/time.js

@ -241,6 +241,17 @@ const formatObjectTimeToMs = (days = 0, hours = 0, minutes = 0, seconds = 0) =>
return days * 24 * 60 * 60 * 1000 + hours * 60 * 60 * 1000 + minutes * 60 * 1000 + seconds * 1000;
};
const setDuringTime = time => {
// 小时
const hour = time / (60 * 60);
// 分钟
const min = time / 60 - hour * 60;
// 秒
const sec = time - hour * 60 * 60 - min * 60;
const result = hour + '时' + min + '分' + sec + '秒';
return result;
};
/**
* 计算过滤 周期
* @param {string} time 周期字符串
@ -307,4 +318,5 @@ export default {
formatObjectTimeToMs,
computeCycle,
formatStartTimeToCycleTime,
setDuringTime,
};

2
vue.config.js

@ -8,7 +8,7 @@ module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? publicPath : '/',
devServer: {
// open: true,
host: '127.0.0.1',
// host: '127.0.0.1',
overlay: { warnings: false, errors: true },
// proxy: {}
},

Loading…
Cancel
Save