Browse Source

feat(default plugin): 添加默认插件;项目列表;全局项目最大高度设置

tall
wally 4 years ago
parent
commit
ed1d87b9c2
  1. 3
      CHANGELOG.md
  2. 7
      src/apis/plugin.js
  3. 4
      src/components/Globals/Globals.vue
  4. 26
      src/components/Plugin/Plugin.vue
  5. 11
      src/components/Projects/Projects.vue
  6. 47
      src/config/plugin.js
  7. 7
      src/plugins/p-deliver-check/p-deliver-check.vue
  8. 7
      src/plugins/p-manage-member/p-manage-member.vue
  9. 7
      src/plugins/p-manage-project/p-manage-project.vue
  10. 7
      src/plugins/p-manage-role/p-manage-role.vue
  11. 7
      src/plugins/p-manage-task/p-manage-task.vue
  12. 9
      src/plugins/p-task-description/p-task-description.vue
  13. 16
      src/plugins/p-task-duration-delay/p-task-duration-delay.vue
  14. 10
      src/plugins/p-task-start-time-delay/p-task-start-time-delay.vue
  15. 9
      src/plugins/p-task-title/p-task-title.vue
  16. 3
      src/plugins/p-wbs-import/p-wbs-import.vue
  17. 2
      tailwind.config.js

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2021-08-06)
# 0.1.0 (2021-08-09)
### 🌟 新功能
范围|描述|commitId
@ -36,6 +36,7 @@
- | 距调整pc端 | 5069aa1
- | 配置默认插件接口 | f0c177d
- | 面变化首页变化 | 5e860f1
- | 项目列表, 项目url | 32e005b
- | 首页项目样式改变 | 8514c85

7
src/apis/plugin.js

@ -1,7 +1,10 @@
// 插件的地址是固定的
const url = process.env.VUE_APP_API_URL;
const install = (Vue, vm) => {
vm.$u.api = { ...vm.$u.api } || {};
vm.$u.api.getPlugin = param => vm.$u.post(`${uni.$t.domain}/plugin`, param);
vm.$u.api.getOtherPlugin = param => vm.$u.post(`${uni.$t.domain}/pluginshop/plugin/query`, param);
// 获取插件信息
vm.$u.api.getOtherPlugin = param => vm.$u.post(`${url}/pluginshop/plugin/query`, param);
};
export default { install };

4
src/components/Globals/Globals.vue

@ -1,8 +1,8 @@
<template>
<view class="m-2" v-if="globals && globals.length">
<u-card :show-foot="false" :show-head="false" :style="{ height: isShrink ? '106rpx' : '340rpx' }" border-radius="25" margin="0">
<u-card :show-foot="false" :show-head="false" :style="{ 'max-height': isShrink ? '106rpx' : '340rpx' }" border-radius="25" margin="0">
<view slot="body">
<scroll-view :scrollY="true" :style="{ height: isShrink ? '50rpx' : '280rpx' }">
<scroll-view :scrollY="true" :style="{ 'max-height': isShrink ? '50rpx' : '280rpx' }">
<skeleton :banner="false" :loading="!globals.length" :row="4" animate class="u-line-2 skeleton"></skeleton>
<view class="grid gap-2">
<template v-for="item in globals">

26
src/components/Plugin/Plugin.vue

@ -20,23 +20,32 @@
</view>
<view v-else>
<p-task-title :name="task.name" v-if="pluginId === '1'" />
<p-task-description :text="task.description" v-if="pluginId === '2'" />
<p-task-duration-delay :realDuration="task.realDuration" :planDuration="task.planDuration" v-if="pluginId === '3'" />
<p-task-start-time-delay :realStart="task.realStart" :planStart="task.planStart" v-if="pluginId === '4'" />
<!-- <p-task-start-time-delay :task="task" v-if="pluginId === '4'" /> -->
<!-- <plugin-default /> -->
<!-- <component :task="task" :is="pluginComponent"></component> -->
<p-task-title :task="task" v-if="pluginId === '1'" />
<p-task-description :task="task" v-if="pluginId === '2'" />
<p-task-duration-delay :task="task" v-if="pluginId === '3'" />
<p-task-start-time-delay :task="task" v-if="pluginId === '4'" />
<!-- <p-deliverable :task="task" v-if="pluginId === '5'" /> -->
<!-- <p-subtasks :task="task" v-if="pluginId === '6'" /> -->
<!-- <p-subproject :task="task" v-if="pluginId === '7'" /> -->
<!-- <p-task-countdown :task="task" v-if="pluginId === '8'" /> -->
<p-manage-project :task="task" v-if="pluginId === '9'" />
<p-manage-role :task="task" v-if="pluginId === '10'" />
<p-manage-member :task="task" v-if="pluginId === '11'" />
<p-manage-task :task="task" v-if="pluginId === '12'" />
<p-wbs-import :task="task" v-if="pluginId === '13' || pluginId === '14'" />
<p-deliver-check :task="task" v-if="pluginId === '15'" />
</view>
</view>
</template>
<script>
import { mapGetters, mapState } from 'vuex';
import pManageProject from '../../plugins/p-manage-project/p-manage-project.vue';
export default {
components: { pManageProject },
name: 'Plugin',
props: {
task: { default: () => {}, type: Object },
@ -55,6 +64,13 @@ export default {
...mapState('user', ['token']),
...mapGetters('user', ['userId']),
...mapGetters('project', ['projectId']),
//
// pluginComponent() {
// const target = this.$t.plugin.defaults.find(item => item.id === +this.pluginId);
// if (!target) return '';
// return target.component;
// },
},
created() {

11
src/components/Projects/Projects.vue

@ -29,14 +29,17 @@
</template>
<script>
import { mapState } from 'vuex';
import { mapGetters, mapState } from 'vuex';
export default {
data() {
return {};
},
computed: mapState('project', ['projects']),
computed: {
...mapState('project', ['projects']),
...mapGetters('user', ['userId']),
},
methods: {
/**
@ -44,12 +47,10 @@ export default {
* @param {object} project 所点击的项目的信息
*/
openProject(project) {
console.log('project: ', project);
const { name, id, url } = project;
console.log(uni.$t.domain);
url && (uni.$t.domain = url);
console.log('uni.$t.domain: ', uni.$t.domain);
this.$u.route('pages/project/project', {
u: this.userId,
p: id,
pname: name,
url: encodeURIComponent(url),

47
src/config/plugin.js

@ -40,9 +40,9 @@ export default {
},
{
id: 7,
name: 'SUBPROJECT',
name: 'SUB_PROJECT',
description: '子项目插件:显示子项目',
component: 'p-subproject',
component: 'p-sub-project',
},
{
id: 8,
@ -50,5 +50,48 @@ export default {
description: '任务倒计时插件',
component: 'p-task-countdown',
},
{
id: 9,
name: 'MANAGE_PROJECT',
description: '项目信息管理插件',
component: 'p-manage-project',
},
{
id: 10,
name: 'MANAGE_ROLE',
description: '角色信息管理插件',
component: 'p-manage-role',
},
{
id: 11,
name: 'MANAGE_MEMBER',
description: '成员信息管理插件',
component: 'p-manage-member',
},
{
id: 12,
name: 'MANAGE_TASK',
description: '任务信息管理插件',
component: 'p-manage-task',
},
{
id: 13,
name: 'WBS_IMPORT',
description: '导入WBS新建项目',
component: 'p-wbs-import',
},
{
id: 14,
name: 'WBS_IMPORT_UPDATE',
description: '导入WBS更新项目',
component: 'p-wbs-update',
},
{
id: 15,
name: 'DELIVER_CHECK',
description: '交付物检查',
component: 'p-deliver-check',
},
], // 默认插件id列表
};

7
src/plugins/p-deliver-check/p-deliver-check.vue

@ -0,0 +1,7 @@
<template>
<view>交付物检查</view>
</template>
<script>
export default {};
</script>

7
src/plugins/p-manage-member/p-manage-member.vue

@ -0,0 +1,7 @@
<template>
<view>成员管理</view>
</template>
<script>
export default {};
</script>

7
src/plugins/p-manage-project/p-manage-project.vue

@ -0,0 +1,7 @@
<template>
<view>项目管理</view>
</template>
<script>
export default {};
</script>

7
src/plugins/p-manage-role/p-manage-role.vue

@ -0,0 +1,7 @@
<template>
<view>角色管理</view>
</template>
<script>
export default {};
</script>

7
src/plugins/p-manage-task/p-manage-task.vue

@ -0,0 +1,7 @@
<template>
<view>任务管理</view>
</template>
<script>
export default {};
</script>

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

@ -1,11 +1,16 @@
<template>
<!-- 任务描述 -->
<view>{{ text }}</view>
<view>{{ task.description }}</view>
</template>
<script>
export default {
name: 'p-task-description',
props: { text: { type: String, default: '' } },
props: {
task: {
type: Object,
default: () => {},
},
},
};
</script>

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

@ -15,6 +15,20 @@
<script>
export default {
name: 'p-task-duration-delay',
props: { planDuration: { type: String, default: '0' }, realDuration: { type: String, default: '0' } },
props: {
task: {
type: Object,
default: () => {},
},
},
computed: {
realDuration() {
return this.task.realDuration;
},
planDuration() {
return this.task.planDuration;
},
},
};
</script>

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

@ -9,6 +9,14 @@
<script>
export default {
name: 'p-task-start-time-delay',
props: { realStart: { type: String, default: '0' }, planStart: { type: String, default: '0' } },
props: { task: { type: Object, default: () => {} } },
computed: {
realStart() {
return this.task.realStart;
},
planStart() {
return this.task.planStart;
},
},
};
</script>

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

@ -1,11 +1,16 @@
<template>
<!-- 任务名插件 -->
<view>{{ name }}</view>
<view>{{ task.name }}</view>
</template>
<script>
export default {
name: 'p-task-title',
props: { name: { type: String, default: '' } },
props: {
task: {
type: Object,
default: () => {},
},
},
};
</script>

3
src/plugins/p-wbs-import/p-wbs-import.vue

@ -0,0 +1,3 @@
<template>
<view>导入wbs</view>
</template>

2
tailwind.config.js

@ -6,7 +6,7 @@ module.exports = {
theme: {
extend: {},
colors: {
blue: colors.lightBlue,
blue: colors.sky,
gray: colors.blueGray,
red: colors.red,
orange: colors.orange,

Loading…
Cancel
Save