Browse Source

feat: 插件面板分开显示

deliver
song 4 years ago
parent
commit
fb5e86b6af
  1. 22
      App.vue
  2. 3
      CHANGELOG.md
  3. 5
      common/styles/theme/default.scss
  4. 2
      components/Plugin/Plugin.vue
  5. 22
      components/Render/Render.vue
  6. 42
      components/TimeLine/component/TimeBox.vue
  7. 4
      pages/project/project.vue
  8. 56
      plugins/p-deliver-check/p-deliver-check.vue
  9. 11
      plugins/p-deliver/p-deliver.vue
  10. 12
      plugins/p-delivery-history/p-delivery-history.vue
  11. 149
      plugins/p-delivery-history/p-delivery-history1.vue
  12. 11
      plugins/p-manage-member/p-manage-member.vue
  13. 11
      plugins/p-manage-project/p-manage-project.vue
  14. 11
      plugins/p-manage-role/p-manage-role.vue
  15. 11
      plugins/p-manage-task/p-manage-task.vue
  16. 11
      plugins/p-subproject/p-subproject.vue
  17. 11
      plugins/p-subtasks/p-subtasks.vue
  18. 11
      plugins/p-task-countdown/p-task-countdown.vue
  19. 11
      plugins/p-task-description/p-task-description.vue
  20. 11
      plugins/p-task-duration-delay/p-task-duration-delay.vue
  21. 11
      plugins/p-task-start-time-delay/p-task-start-time-delay.vue
  22. 13
      plugins/p-task-title/p-task-title.vue
  23. 11
      plugins/p-upload-deliverable/p-upload-deliverable.vue
  24. 11
      plugins/p-wbs-import/p-wbs-import.vue

22
App.vue

@ -43,19 +43,18 @@ export default {
if (token && tokenIsAvailable) {
// 1.1 storetoken 使storetoken
return token;
} else {
// 2. userIdtoken
if (userId) {
try {
const { token } = await this.$store.dispatch('user/getTokenByUserId', userId);
return token;
} catch (error) {
console.error('error: ', error);
return null;
}
} else {
}
// 2. userIdtoken
if (userId) {
try {
const { token } = await this.$store.dispatch('user/getTokenByUserId', userId);
return token;
} catch (error) {
console.error('error: ', error);
return null;
}
} else {
return null;
}
},
@ -166,4 +165,5 @@ export default {
page {
height: 100%;
}
</style>

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 1.0.0 (2022-01-11)
# 1.0.0 (2022-01-12)
### 🌟 新功能
范围|描述|commitId
@ -37,6 +37,7 @@
createTask | 修复createTask v-model的问题 | [b20d3f0](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b20d3f0)
- | defineExpose, defineEmits不需要引入 | [902cacc](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/902cacc)
- | 修复一些内容 | [3cdb1ce](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3cdb1ce)
- | 插件接口修改 | [53c6b90](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/53c6b90)
- | 时间轴任务 | [98abdf6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/98abdf6)
- | 解决warning | [dcb0079](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/dcb0079)

5
common/styles/theme/default.scss

@ -1,7 +1,7 @@
// 默认主题文件
.theme-default {
background-color: #007aff;
color: #fff;
// color: #fff;
.u-card {
font-size: 24px !important;
color: #0f0;
@ -13,4 +13,7 @@
color: #fff !important;
}
}
button{
border: none!important;
}
}

2
components/Plugin/Plugin.vue

@ -1,6 +1,6 @@
<template>
<view class="u-font-14" style="height: 100%">
<view @click="setStorage" class="grid gap-3">
<view @click="setStorage">
<Render :task="task" :pluginId="pluginId" :styleType="styleType" :pluginTaskId="pluginTaskId" :param="param" />
<!-- <plugin-default /> -->
<!-- <component :task="task" :is="pluginComponent"></component> -->

22
components/Render/Render.vue

@ -1,8 +1,9 @@
<template>
<view>
<view class="render-box shadow-lg" v-if="show">
<!-- #ifdef H5 -->
<view
class="content"
style="border-radius: 8px;"
id="project"
:data-did="task.detailId"
:data-param="param"
@ -40,7 +41,7 @@
</template>
<script setup>
import { computed } from 'vue';
import { computed, reactive } from 'vue';
import { useStore } from 'vuex';
defineProps({
@ -51,6 +52,8 @@ defineProps({
param: { type: String, default: '' },
});
const data = reactive({ show: true });
const store = useStore();
const roleId = computed(() => store.state.role.roleId);
const token = computed(() => store.state.user.token);
@ -64,6 +67,7 @@ export default {
return {
pluginContent: null,
pluginJs: null,
show: false,
};
},
@ -83,6 +87,7 @@ export default {
} else {
if (!res || !res.id) return;
if (res.html && res.js) {
this.show = true;
this.$nextTick(() => {
this.init(res);
});
@ -102,3 +107,16 @@ export default {
},
};
</script>
<style scoped lang="scss">
.render-box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
button{
border: none!important;
}
</style>

42
components/TimeLine/component/TimeBox.vue

@ -15,13 +15,14 @@
</view>
<view class="plugin">
<view class="h-3" v-if="task.process === 4"></view>
<view class="ml-3 overflow-hidden shadow-lg task-box">
<!-- <view class="ml-3 overflow-hidden shadow-lg task-box"> -->
<view class="ml-3">
<u-card :show-foot="false" :show-head="false" :style="{ height: setHeight(task.panel) }" class="h-16" margin="0" v-if="showSkeleton">
<view slot="body">
<view><skeleton :banner="false" :loading="true" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton></view>
</view>
</u-card>
<u-card
<!-- <u-card
@click="onClickTask(task.planStart - 0, task.id)"
:style="{ height: setHeight(task.panel) }"
:show-foot="false"
@ -30,25 +31,27 @@
margin="0"
v-if="tasks && tasks.length && task.process !== 4 && !showSkeleton"
>
<template v-slot:body>
<view class="p-0 u-col-between">
<view :key="pIndex" v-for="(row, pIndex) in task.plugins">
<view class="grid gap-2 grid-cols-1" v-if="row.length">
<Plugin
:class="[`row-span-${plugin.row}`, `col-span-${plugin.col}`]"
:task="task"
:key="plugin.pluginTaskId"
:plugin-task-id="plugin.pluginTaskId"
:plugin-id="plugin.pluginId"
:param="plugin.param"
:style-type="data.styleType || 0"
v-for="plugin in row"
/>
</view>
<template v-slot:body> -->
<view class="h-16" v-if="tasks && tasks.length && task.process !== 4 && !showSkeleton" @click="onClickTask(task.planStart - 0, task.id)">
<view class="p-0 u-col-between grid gap-3">
<view :key="pIndex" v-for="(row, pIndex) in task.plugins">
<view class="grid gap-2 grid-cols-1" v-if="row.length">
<Plugin
:class="[`row-span-${plugin.row}`, `col-span-${plugin.col}`]"
:task="task"
:key="plugin.pluginTaskId"
:plugin-task-id="plugin.pluginTaskId"
:plugin-id="plugin.pluginId"
:param="plugin.param"
:style-type="data.styleType || 0"
v-for="plugin in row"
/>
</view>
</view>
</template>
</u-card>
</view>
</view>
<!-- </template>
</u-card> -->
</view>
</view>
</view>
@ -65,7 +68,6 @@ import TimeStatus from './TimeStatus.vue';
import TaskTools from './TaskTools.vue';
import Skeleton from '@/components/Skeleton/Skeleton.vue';
const data = reactive({
currentComponent: '',
styleType: 0,

4
pages/project/project.vue

@ -1,5 +1,5 @@
<template>
<view :style="{ height: height }" class="flex flex-col overflow-hidden u-font-14">
<theme :style="{ height: height }" class="flex flex-col overflow-hidden u-font-14">
<!-- 标题栏 -->
<Title />
@ -16,7 +16,7 @@
<!-- TODO: DEBUG: -->
<u-button @click="$store.commit('setTheme', 'theme-test')">测试切换主题</u-button>
</view>
</view>
</theme>
</template>
<script setup>

56
plugins/p-deliver-check/p-deliver-check.vue

@ -1,5 +1,6 @@
<template>
<!-- 上传交付物 -->
<view class="box shadow-lg">
<view class="px-3 py-6 bg-white">
<u-input :auto-height="autoHeight" :border="border" :height="height" :type="type" placeholder="输入备注" v-model="remark" />
<view class="flex flex-row-reverse text-xs text-gray-400 mt-2">{{ wordNum }}/140</view>
@ -14,49 +15,56 @@
<u-button @click="$emit('closeScore')" class="mt-2" size="medium">取消</u-button>
</view>
</view>
</view>
</template>
<script setup>
import { reactive, watchEffect, defineEmits } from 'vue';
const data = reactive({
remark: '',
type: 'textarea',
border: true,
height: 100,
autoHeight: true,
wordNum: 0,
score: 0,
type1: 'number',
remark: '',
type: 'textarea',
border: true,
height: 100,
autoHeight: true,
wordNum: 0,
score: 0,
type1: 'number',
});
const emit = defineEmits(['submit']);
watchEffect(() => {
if(remark) {
if (remark) {
data.wordNum = remark.value.length;
}
if(score) {
if (score) {
data.score1 = score.value;
}
});
//
function submit() {
emit('submit', this.remark, this.score);
}
//
function submit() {
emit('submit', this.remark, this.score);
}
function sliderChange(e) {
data.score = e.detail.value;
}
function sliderChange(e) {
data.score = e.detail.value;
}
function changeNumber(e) {
if (e > 100) {
data.score = 100;
}
}
function changeNumber(e) {
if (e > 100) {
data.score = 100;
}
}
</script>
<style></style>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-deliver/p-deliver.vue

@ -1,9 +1,18 @@
<template>
<view class="box shadow-lg">
<view class="deliver-container">p-deliver</view>
</view>
</template>
<script setup>
</script>
<style lang="scss"></style>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

12
plugins/p-delivery-history/p-delivery-history.vue

@ -1,5 +1,6 @@
<template>
<!-- 交付物 -->
<view class="box shadow-lg">
<view class="mt-3">
<view v-if="data.lists && data.lists.length">
<view :key="list.id" v-for="list in data.lists">
@ -39,6 +40,7 @@
<!-- 评分 -->
<!-- <uni-popup :maskClick="false" background-color="#fff" ref="popup" type="bottom"><PDeliverCheck @closeScore="closeScore" @submit="submit"></PDeliverCheck></uni-popup> -->
</view>
</view>
</template>
<script setup>
@ -128,4 +130,12 @@ function CheckUrl(url) {
}
</script>
<style></style>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

149
plugins/p-delivery-history/p-delivery-history1.vue

@ -1,149 +0,0 @@
<template>
<!-- 交付物 -->
<view class="mt-3">
<view v-if="lists && lists.length">
<view :key="list.id" v-for="list in lists">
<view class="text-gray-400 u-font-12 font-thin leading-none">
<span class="mr-2">{{ list.name }}</span>
<span>{{ $moment(+list.time).format('YYYY-MM-DD HH:mm:ss') }}</span>
</view>
<view class="mt-2 py-1 px-2.5 border border-gray-200 rounded flex flex-wrap overflow-hidden break-all" v-if="list.content">
<a :href="list.content" class="text-blue-500 u-font-12 font-thin" target="_blank" v-if="CheckUrl(list.content)">{{
list.content
}}</a>
<span v-else>{{ list.content }}</span>
</view>
<view :class="index === 0 ? 'mt-4' : 'mt-3'" v-for="(checker, index) in list.checkerList" :key="index">
<view class="flex justify-between leading-none">
<view>
{{ checker.checkerName }}
<span v-if="checker.isMine">()</span>
</view>
<view>
<span class="text-blue-500" v-if="checker.status === 1">通过</span>
<span class="text-red-500" v-if="checker.status === 2">驳回</span>
<span class="ml-4" v-if="checker.status !== 0">{{ checker.score }}</span>
<span class="text-gray-400" v-if="checker.status === 0 && !checker.isMine">未审核</span>
<view v-if="checker.status === 0 && checker.isMine">
<u-button class="action-btn mr-2" @click="showScore(checker.checkId, 1)" size="mini" shape="circle" type="primary">
通过
</u-button>
<u-button class="action-btn" @click="showScore(checker.checkId, 2)" size="mini" shape="circle" type="error">驳回</u-button>
</view>
</view>
</view>
<view class="text-gray-400 text-xs mt-1">{{ checker.remark }}</view>
</view>
</view>
</view>
<u-empty icon-size="90" mode="history" text="暂未上传交付物" v-else></u-empty>
<!-- 评分 -->
<uni-popup :maskClick="false" background-color="#fff" ref="popup" type="bottom">
<PDeliverCheck @closeScore="closeScore" @submit="submit"></PDeliverCheck>
</uni-popup>
</view>
</template>
<script>
import { mapGetters } from 'vuex';
import UniPopup from '../../components/uni-popup/uni-popup.vue';
import PDeliverCheck from '../p-deliver-check/p-deliver-check.vue';
export default {
name: 'p-delivery-history',
props: { task: { type: Object, default: null } },
components: { PDeliverCheck, UniPopup },
data() {
return {
lists: [],
show: false,
options: null,
loading: true, //
};
},
computed: mapGetters('project', ['projectId']),
mounted() {
this.getDeliverOfTask();
},
methods: {
async getDeliverOfTask() {
try {
const { projectId, task } = this;
const params = { projectId, taskSubId: task.id };
const data = await this.$u.api.queryDeliverOfTask(params);
this.lists = data;
} catch (error) {
console.error('p-delivery-history.vue getDeliverOfTask error: ', error);
this.$t.ui.showToast(error.msg || '提交失败');
}
},
showScore(checkId, status) {
// refuni-popup , type ['top','left','bottom','right','center']
this.$refs.popup.open('bottom');
this.options = { checkId, status };
},
closeScore() {
this.$refs.popup.close('bottom');
},
async submit(remark, score) {
try {
await this.checkDeliver(remark, score);
this.closeScore();
} catch (error) {
console.error('error: ', error);
}
},
/**
* 检查交付物
* @param {string} checkId 检查记录id
* @param {string} projectId 项目id
* @param {string} remark 评论
* @param {number} score 分数
* @param {number} status 检查状态(1-通过,2-驳回)
*/
async checkDeliver(remark, score) {
try {
this.show = true;
const { projectId, options } = this;
const { checkId, status } = options;
const params = { checkId, projectId, status, remark, score };
await this.$u.api.checkDeliver(params);
this.$t.ui.showToast('交付物检查成功');
this.options = null;
this.getDeliverOfTask();
} catch (error) {
console.error('p-delivery-history.vue checkDeliver error: ', error);
this.$t.ui.showToast('交付物检查失败,请稍后重试');
this.options = null;
}
},
//
CheckUrl(url) {
var reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(.)+$/;
if (!reg.test(url)) {
return false;
} else {
return true;
}
},
},
};
</script>
<style scoped>
.action-btn {
padding: 0;
width: 80rpx;
height: 40rpx;
line-height: 40rpx;
}
</style>

11
plugins/p-manage-member/p-manage-member.vue

@ -1,6 +1,17 @@
<template>
<view class="box shadow-lg">
<view>成员管理</view>
</view>
</template>
<script setup>
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-manage-project/p-manage-project.vue

@ -1,6 +1,17 @@
<template>
<view class="box shadow-lg">
<view>项目管理</view>
</view>
</template>
<script setup>
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-manage-role/p-manage-role.vue

@ -1,6 +1,17 @@
<template>
<view class="box shadow-lg">
<view>角色管理</view>
</view>
</template>
<script setup>
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-manage-task/p-manage-task.vue

@ -1,6 +1,17 @@
<template>
<view class="box shadow-lg">
<view>任务管理</view>
</view>
</template>
<script setup>
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-subproject/p-subproject.vue

@ -1,6 +1,6 @@
<template>
<!-- 子项目插件 -->
<view>
<view class="box shadow-lg">
<view v-for="item in data.sonProject" :key="item.detailId">
<span class="text-xs text-blue-500" @click="openProject(item)">{{ item.name }}</span>
</view>
@ -51,4 +51,11 @@ function openProject(project) {
}
</script>
<style></style>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-subtasks/p-subtasks.vue

@ -1,5 +1,5 @@
<template>
<view>
<view class="box shadow-lg">
<view v-for="item in data.sonTask" :key="item.detailId">
<span class="text-xs text-gray-500">{{ item.name }}</span>
</view>
@ -28,4 +28,11 @@ async function getSonTask() {
getSonTask();
</script>
<style></style>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-task-countdown/p-task-countdown.vue

@ -1,10 +1,19 @@
<template>
<!-- 任务倒计时插件 -->
<view class="box shadow-lg">
<view>任务倒计时插件</view>
</view>
</template>
<script setup>
</script>
<style></style>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-task-description/p-task-description.vue

@ -1,9 +1,20 @@
<template>
<!-- 任务描述 -->
<view class="box shadow-lg">
<view>{{ task.description }}</view>
</view>
</template>
<script setup>
defineProps({ task: { default: () => {}, type: Object } });
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-task-duration-delay/p-task-duration-delay.vue

@ -1,5 +1,5 @@
<template>
<view v-if="realDuration && planDuration">
<view v-if="realDuration && planDuration" class="box shadow-lg">
<!-- 任务时长延迟插件 -->
<!-- 超时 -->
<span class="font-bold text-green-500" v-if="realDuration - 0 > planDuration - 0">
@ -21,3 +21,12 @@ const realDuration = computed(() => props.task.realDuration);
const planDuration = computed(() => props.task.planDuration);
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-task-start-time-delay/p-task-start-time-delay.vue

@ -1,10 +1,12 @@
<template>
<view class="box shadow-lg">
<!-- <view>任务开始时间延迟插件</view> -->
<view v-if="realStart && planStart">
<!-- 任务开始时间延迟插件 -->
<!-- 超时 -->
<span>{{ $time.formatDuration(+realStart - +planStart) }}</span>
</view>
</view>
</template>
<script setup>
@ -16,3 +18,12 @@ const realStart = computed(() => props.task.realStart);
const planStart = computed(() => props.task.planStart);
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

13
plugins/p-task-title/p-task-title.vue

@ -1,10 +1,19 @@
<template>
<!-- 任务名插件 -->
<theme>
<view class="box shadow-lg">
<view>{{ task.name }}</view>
</theme>
</view>
</template>
<script setup>
defineProps({ task: { type: Object, default: () => {} } });
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-upload-deliverable/p-upload-deliverable.vue

@ -1,6 +1,6 @@
<template>
<!-- 上传交付物 -->
<view class="py-2">
<view class="box shadow-lg py-2">
<u-input :auto-height="data.autoHeight" :border="data.border" :height="data.height" :type="data.type" v-model="data.content" width="100" />
<!-- 选择检查人 -->
@ -87,4 +87,11 @@ async function submit() {
}
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

11
plugins/p-wbs-import/p-wbs-import.vue

@ -1,5 +1,5 @@
<template>
<view>
<view class="box shadow-lg">
<view @click="handleUpload" v-if="task.name === '导入WBS新建项目'">{{ task.name }}</view>
<view @click="handleUpdate" v-if="task.name === '导入WBS更新项目'">{{ task.name }}</view>
<!-- 全局提示框 -->
@ -69,3 +69,12 @@ async function handleUpload() {
}
}
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

Loading…
Cancel
Save