Browse Source

feat: 查找任务时,返回交付物和财务条插件初始数据

test2
xuesinan 3 years ago
parent
commit
29d717308f
  1. 1
      CHANGELOG.md
  2. 1
      components/Globals/Globals.vue
  3. 2
      components/Plugin/Plugin.vue
  4. 1
      components/TimeLine/component/TimeBox.vue
  5. 3
      plugins/p-deliver/p-deliver.vue
  6. 11
      plugins/p-finance/p-finance.vue

1
CHANGELOG.md

@ -10,6 +10,7 @@
- | 插件的填写与提交,修改与删除 | [d461252](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d461252)
- | 插件调用 | [9146b40](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9146b40)
- | 插件面板分开显示 | [fb5e86b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/fb5e86b)
- | 插件渲染 | [e15123a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/e15123a)
- | 插件api | [08bdf74](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/08bdf74)
- | 登录、日历页小绿点、二级项目列表 | [e676cf0](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/e676cf0)
- | 登录按钮 | [527b0e5](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/527b0e5)

1
components/Globals/Globals.vue

@ -30,6 +30,7 @@
:class="[`row-span-${plugin.row}`, `col-span-${plugin.col}`]"
:task="item"
:key="plugin.pluginTaskId"
:plugin-info="plugin"
:plugin-task-id="plugin.pluginTaskId"
:business-plugin-id="plugin.businessPluginId"
:plugin-id="plugin.pluginId"

2
components/Plugin/Plugin.vue

@ -53,9 +53,11 @@ const props = defineProps({
pluginTaskId: { default: '', type: String },
businessPluginId: { default: '', type: String },
param: { type: String, default: '' },
pluginInfo: { default: () => {}, type: Object }
});
provide('task', props.task);
provide('pluginInfo', props.pluginInfo);
const store = useStore();
const roleId = computed(() => store.state.role.roleId);

1
components/TimeLine/component/TimeBox.vue

@ -38,6 +38,7 @@
:class="[`row-span-${plugin.row}`, `col-span-${plugin.col}`]"
:task="task"
:key="plugin.pluginTaskId"
:plugin-info="plugin"
:plugin-task-id="plugin.pluginTaskId"
:business-plugin-id="plugin.businessPluginId"
:plugin-id="plugin.pluginId"

3
plugins/p-deliver/p-deliver.vue

@ -23,11 +23,12 @@ import { ref, inject, provide, computed } from 'vue';
const store = useStore();
const task = inject('task');
const pluginInfo = inject('pluginInfo');
const deliver = ref(null); //
const isMine = computed(() => store.getters['role/isMine']); //
deliver.value = pluginInfo && pluginInfo.data ? JSON.parse(pluginInfo.data) : null;
provide('deliver', deliver);
// id
async function getDeliverData() {
try {

11
plugins/p-finance/p-finance.vue

@ -7,13 +7,13 @@
class="finance-item"
:style="{ width: `${(+data.budget * 100) / (+data.budget + +data.bonus)}%`, 'background-color': '#93C5FD' }"
>
预算{{ data.budget / 100 }}
预算{{ (data.budget ? data.budget : 0) / 100 }}
</view>
<view
class="finance-item"
:style="{ width: `${(+data.bonus * 100) / (+data.budget + +data.bonus)}%`, 'background-color': '#12c77e' }"
>
奖金{{ data.bonus / 100 }}
奖金{{ (data.bonus ? data.bonus : 0) / 100 }}
</view>
</view>
<!-- 项目采购日常采购 -->
@ -22,13 +22,13 @@
class="finance-item"
:style="{ width: `${(+data.projectExpend * 100) / (+data.projectExpend + +data.dailyExpend)}%`, 'background-color': '#FBBF24' }"
>
项目采购{{ data.dailyExpend / 100 }}
项目采购{{ (data.dailyExpend ? data.dailyExpend : 0) / 100 }}
</view>
<view
class="finance-item"
:style="{ width: `${(+data.dailyExpend * 100) / (+data.projectExpend + +data.dailyExpend)}%`, 'background-color': '#a1fd93' }"
>
日常采购{{ +data.dailyExpend / 100 }}
日常采购{{ +(data.dailyExpend ? data.dailyExpend : 0) / 100 }}
</view>
</view>
</view>
@ -41,6 +41,9 @@ import useGenerateWebviewParam from '@/hooks/project/useGenerateWebviewParam';
const task = inject('task');
const data = ref(null);
const { projectId, projectName, token } = useGenerateWebviewParam();
const pluginInfo = inject('pluginInfo');
data.value = pluginInfo && pluginInfo.data ? JSON.parse(pluginInfo.data) : null;
//
async function getFinanceByTaskData() {

Loading…
Cancel
Save