Compare commits
22 Commits
cd2ce78bff
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| fd78ecbdac | |||
| 8566e3fd7e | |||
| 93f6f8aa54 | |||
| 5a58c7611e | |||
| e7fbb06041 | |||
| be4f296a35 | |||
| 3a27a4a63d | |||
| fe2f85e788 | |||
| b95c990a5c | |||
| eb45374b95 | |||
| d4f45cf936 | |||
|
|
4fcdf08dc8 | ||
|
|
910dd8bca3 | ||
|
|
f81cae3f25 | ||
| 0e03ce7026 | |||
| d5da6f3167 | |||
| c52d96636b | |||
| 442e22e396 | |||
| a58b2d0291 | |||
| 4fc04e4032 | |||
| a925d2058f | |||
| ed07af95d7 |
@@ -50,3 +50,7 @@ export const getDemandDetailApi = (params: any) => {
|
||||
export const queryDemandFilesApi = (params: any) => {
|
||||
return post(`${PREFIX}demand/queryDemandFiles`, params);
|
||||
};
|
||||
// 撤销需求
|
||||
export const withdrawDemandApi = (params: any) => {
|
||||
return post(`${PREFIX}demand/withdrawDemand`, params);
|
||||
};
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
:belongProject="belongProject"
|
||||
:parentCategoryPath="parentNodeCategoryPath"
|
||||
:existingNodeCodes="existingNodeCodes"
|
||||
:showNodeExtraInfo="showNodeExtraInfo"
|
||||
@confirm="onNodeDetailConfirmFun"
|
||||
v-bind="$attrs"
|
||||
/>
|
||||
@@ -124,6 +125,7 @@ interface Props {
|
||||
checkMethod?: any; // 处理勾选逻辑
|
||||
showAddCategoryButton?: boolean; // 是否显示添加分类按钮
|
||||
allowRootAddTask?: boolean; // 是否允许在根节点添加任务
|
||||
showNodeExtraInfo?: boolean; // 显示扩展信息tab(日志/附件/闭环/异常)
|
||||
hideEditFn?: (row: any) => boolean; // 外部控制编辑按钮隐藏逻辑
|
||||
}
|
||||
|
||||
@@ -157,6 +159,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
checkMethod: null,
|
||||
showAddCategoryButton: true,
|
||||
allowRootAddTask: false,
|
||||
showNodeExtraInfo: false,
|
||||
hideEditFn: undefined,
|
||||
});
|
||||
|
||||
@@ -428,7 +431,10 @@ const actionList = computed(() => {
|
||||
deleteTableRowFun(row);
|
||||
},
|
||||
hide: (row: any) => {
|
||||
return props.readonly || (props.belongProject && row.uuid && enableConfigByTenant([TENANT_ENUM.LYRIC]));
|
||||
return (
|
||||
props.readonly ||
|
||||
(props.belongProject && row.uuid && enableConfigByTenant([TENANT_ENUM.LYRIC]))
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -11,7 +11,11 @@
|
||||
>
|
||||
<template #default>
|
||||
<el-tabs
|
||||
v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])"
|
||||
v-if="
|
||||
enableConfigByTenant([TENANT_ENUM.LYRIC]) &&
|
||||
showNodeExtraInfo &&
|
||||
formData?.nodeType === NODE_TYPE.TASK
|
||||
"
|
||||
v-model="tabName"
|
||||
type="card"
|
||||
class="node-detail-tab-content"
|
||||
@@ -139,6 +143,7 @@ interface Props {
|
||||
parentCategoryPath?: string[];
|
||||
existingNodeCodes?: string[];
|
||||
enableSelectCode?: boolean;
|
||||
showNodeExtraInfo?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -157,6 +162,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
parentCategoryPath: () => [],
|
||||
existingNodeCodes: () => [],
|
||||
enableSelectCode: false,
|
||||
showNodeExtraInfo: false,
|
||||
});
|
||||
|
||||
const emits = defineEmits(['update:modelValue', 'confirm']);
|
||||
|
||||
@@ -163,40 +163,34 @@ const sliceFileFun = async (fileIndex: number) => {
|
||||
const start = chunkIndex * chunkSize;
|
||||
const end = Math.min(start + chunkSize, file.size);
|
||||
const chunkFile = file.slice(start, end);
|
||||
const params: any = fileData.isSubmitFile
|
||||
? {
|
||||
uploadTaskId: fileData.uploadTaskId,
|
||||
businessId: fileData.businessId,
|
||||
jobName: fileData.jobName,
|
||||
selectDirName: fileData.selectDirName,
|
||||
selectFilePath: fileData.selectFilePath,
|
||||
sourceFileName: fileData.sourceFileName,
|
||||
isSubmitFile: fileData.isSubmitFile,
|
||||
uuid: fileData.uuid,
|
||||
chunk: chunkIndex + 1,
|
||||
chunkTotal: totalChunks,
|
||||
file: chunkFile,
|
||||
}
|
||||
: {
|
||||
uploadTaskId: fileData.uploadTaskId,
|
||||
businessId: fileData.businessId,
|
||||
objectKey: fileData.objectKey,
|
||||
sourceFileName: fileData.sourceFileName,
|
||||
chunk: chunkIndex + 1,
|
||||
chunkTotal: totalChunks,
|
||||
file: chunkFile,
|
||||
isSaveLocal: fileData.isSaveLocal,
|
||||
};
|
||||
const commonParams = {
|
||||
uploadTaskId: fileData.uploadTaskId,
|
||||
businessId: fileData.businessId,
|
||||
objectKey: fileData.objectKey,
|
||||
sourceFileName: fileData.sourceFileName,
|
||||
chunk: chunkIndex + 1,
|
||||
chunkTotal: totalChunks,
|
||||
file: chunkFile,
|
||||
isSaveLocal: fileData.isSaveLocal,
|
||||
};
|
||||
const submitFileParams = {
|
||||
uploadTaskId: fileData.uploadTaskId,
|
||||
businessId: fileData.businessId,
|
||||
jobName: fileData.jobName,
|
||||
selectDirName: fileData.selectDirName,
|
||||
selectFilePath: fileData.selectFilePath,
|
||||
sourceFileName: fileData.sourceFileName,
|
||||
isSubmitFile: fileData.isSubmitFile,
|
||||
uuid: fileData.uuid,
|
||||
chunk: chunkIndex + 1,
|
||||
chunkTotal: totalChunks,
|
||||
file: chunkFile,
|
||||
};
|
||||
const params: any = fileData.isSubmitFile ? submitFileParams : commonParams;
|
||||
if (fileTempPath) {
|
||||
params.fileTempPath = fileTempPath;
|
||||
}
|
||||
|
||||
let res: any;
|
||||
if (fileData.isSubmitFile) {
|
||||
res = await uploadSubmitFun(params);
|
||||
} else {
|
||||
res = await uploadFun(params);
|
||||
}
|
||||
const res = await uploadFun(params, fileData.isSubmitFile);
|
||||
if (res.result) {
|
||||
fileTempPath = res.fileTempPath;
|
||||
fileObj.data.total = totalChunks;
|
||||
@@ -268,22 +262,23 @@ const callBackFun = (data: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
const uploadFun = async (params: any) => {
|
||||
const uploadFun = async (params: any, isSubmitFile?: boolean) => {
|
||||
const starTime = new Date().getTime();
|
||||
const res: any = await chunkUploadToMinioApi(params);
|
||||
let apiName: any = chunkUploadToMinioApi;
|
||||
if (isSubmitFile) {
|
||||
apiName = chunkUploadToLocalApi;
|
||||
}
|
||||
const res: any = await apiName(params);
|
||||
const data = res.data || {};
|
||||
if (isSubmitFile) {
|
||||
data.result = true;
|
||||
}
|
||||
const endTime = new Date().getTime();
|
||||
data.speed = formatFileSize(chunkSize / ((endTime - starTime) / 1000)); // 根据每次分片上传时间大致算一个速度
|
||||
return data;
|
||||
};
|
||||
|
||||
const uploadSubmitFun = async (params: any) => {
|
||||
const starTime = new Date().getTime();
|
||||
const res: any = await chunkUploadToLocalApi(params);
|
||||
const data = res.data || {};
|
||||
data.result = true;
|
||||
const endTime = new Date().getTime();
|
||||
data.speed = formatFileSize(chunkSize / ((endTime - starTime) / 1000)); // 根据每次分片上传时间大致算一个速度
|
||||
let duringTime = (endTime - starTime) / 1000;
|
||||
if (duringTime < 1) {
|
||||
duringTime = 1;
|
||||
}
|
||||
data.speed = formatFileSize(chunkSize / duringTime); // 根据每次分片上传时间大致算一个速度
|
||||
return data;
|
||||
};
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ export default [
|
||||
title: '我提出的',
|
||||
path: '/task/sponsor',
|
||||
name: 'TaskSponsor',
|
||||
component: () => import('@/tenants/lyric/views/task/demand.vue'),
|
||||
component: () => import('@/views/task/simulationTask/newDemand/index.vue'),
|
||||
},
|
||||
{
|
||||
title: '我分发的',
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
:showAddCategoryButton="false"
|
||||
:allowRootAddTask="true"
|
||||
:defaultExpandAll="false"
|
||||
:showNodeExtraInfo="true"
|
||||
>
|
||||
<template #otherOptions>
|
||||
<el-tooltip
|
||||
@@ -770,7 +771,7 @@ const createTaskPoolFun = async (formData: any) => {
|
||||
const wrappedNodes = wrapWithVirtualNodeFun(nodes);
|
||||
const pickedNodes = transformTreeToPoolNodes(wrappedNodes);
|
||||
|
||||
const poolBrief:any = {
|
||||
const poolBrief: any = {
|
||||
poolName: currentPoolBrief.value.poolName,
|
||||
tenantId: currentPoolBrief.value.tenantId,
|
||||
};
|
||||
|
||||
@@ -18,6 +18,8 @@ export enum TASK_PROCESS_STATUS {
|
||||
POSTPONED = '7',
|
||||
/** 已闭环 */
|
||||
CLOSED_LOOP = '8',
|
||||
/** 已撤回 */
|
||||
CANCELED = '9',
|
||||
}
|
||||
|
||||
/** 任务状态颜色映射 */
|
||||
@@ -90,6 +92,7 @@ export const TASK_PROCESS_STATUS_OBJ: any = {
|
||||
[TASK_PROCESS_STATUS.CLOSED]: '已关闭',
|
||||
[TASK_PROCESS_STATUS.POSTPONED]: '已延期',
|
||||
[TASK_PROCESS_STATUS.CLOSED_LOOP]: '已闭环',
|
||||
[TASK_PROCESS_STATUS.CANCELED]: '已撤回',
|
||||
};
|
||||
|
||||
export const TASK_PROCESS_STATUS_OPTIONS = (
|
||||
@@ -188,6 +191,7 @@ export const disposeDisabledExeStatus = (
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
// 上传试验相关文件后,任务状态就会 自动 变成已闭环,已完成就不允许再改了
|
||||
if (status === TASK_PROCESS_STATUS.COMPLETED) {
|
||||
return true;
|
||||
}
|
||||
@@ -201,6 +205,7 @@ export const disposeDisabledExeStatus = (
|
||||
TASK_PROCESS_STATUS.NO_STARTED,
|
||||
TASK_PROCESS_STATUS.CLOSED,
|
||||
TASK_PROCESS_STATUS.COMPLETED,
|
||||
TASK_PROCESS_STATUS.CANCELED,
|
||||
].includes(option.value);
|
||||
} else {
|
||||
return [TASK_PROCESS_STATUS.NO_STARTED, TASK_PROCESS_STATUS.CLOSED].includes(option.value);
|
||||
@@ -211,6 +216,7 @@ export const disposeDisabledExeStatus = (
|
||||
TASK_PROCESS_STATUS.PAUSED,
|
||||
TASK_PROCESS_STATUS.CLOSED,
|
||||
TASK_PROCESS_STATUS.COMPLETED,
|
||||
TASK_PROCESS_STATUS.CANCELED,
|
||||
].includes(option.value);
|
||||
}
|
||||
if (status === TASK_PROCESS_STATUS.PAUSED) {
|
||||
@@ -219,4 +225,10 @@ export const disposeDisabledExeStatus = (
|
||||
if (status === TASK_PROCESS_STATUS.REJECTED) {
|
||||
return true;
|
||||
}
|
||||
if (status === TASK_PROCESS_STATUS.CANCELED) {
|
||||
return true;
|
||||
}
|
||||
if (status === TASK_PROCESS_STATUS.CLOSED_LOOP) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -588,8 +588,8 @@ export const isJSONFun = (str: any) => {
|
||||
|
||||
// 删除无用附件文件
|
||||
export const removeAttachmentFileIds = (oldIds: string, newIds: any) => {
|
||||
const oldList = oldIds.split(',');
|
||||
const newList = newIds.split(',');
|
||||
const oldList = oldIds?.split(',') || [];
|
||||
const newList = newIds?.split(',') || [];
|
||||
const newSet = new Set(newList);
|
||||
const delIds: any[] = oldList.filter((id) => !newSet.has(id));
|
||||
delIds.forEach((id: any) => {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<Dialog
|
||||
v-model="visible"
|
||||
:diaTitle="`${currentRow?.id ? '编辑' : '新增'}应用`"
|
||||
:width="'25%'"
|
||||
:width="'50%'"
|
||||
:height="'70%'"
|
||||
@close="closeFun"
|
||||
show-footer
|
||||
@@ -24,6 +24,7 @@
|
||||
limit: 1,
|
||||
},
|
||||
}"
|
||||
@change="formChangeFun"
|
||||
>
|
||||
</TableForm>
|
||||
<!-- <el-form :model="appformData" labelWidth="80">
|
||||
@@ -31,7 +32,41 @@
|
||||
<UploadImg v-model="appformData.appImage" :limit-upload="true" :multiple="false" />
|
||||
</el-form-item>
|
||||
</el-form> -->
|
||||
|
||||
<el-form :model="appformData" labelWidth="80">
|
||||
<el-form-item label="命令参数">
|
||||
<BaseTable
|
||||
tableName="COMMAND_PARAM_TABLE"
|
||||
ref="baseTableRef"
|
||||
fullHeight
|
||||
:hide-pagination="true"
|
||||
>
|
||||
<template #keyCnName="{ row }">
|
||||
<el-input v-model="row.keyCnName"></el-input>
|
||||
</template>
|
||||
<template #defaultValue="{ row }">
|
||||
<el-input v-model="row.defaultValue"></el-input>
|
||||
</template>
|
||||
<template #isDisplay="{ row }">
|
||||
<el-switch
|
||||
v-model="row.isDisplay"
|
||||
inline-prompt
|
||||
active-value="Y"
|
||||
inactive-value="N"
|
||||
/>
|
||||
</template>
|
||||
<template #valueType="{ row }">
|
||||
<el-select v-model="row.valueType">
|
||||
<el-option
|
||||
v-for="item in valueTypeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</BaseTable>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="pic-content" ref="appNameRef" v-show="appName">
|
||||
<appNameBg :app-name="appName"></appNameBg>
|
||||
</div>
|
||||
@@ -57,6 +92,7 @@ import { delayTime } from '@/utils/common';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
// import UploadImg from '@/components/common/uploadImg/index.vue';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
|
||||
const props = defineProps(['currentAppInfo', 'tableName']);
|
||||
const emit = defineEmits(['cancel', 'submit']);
|
||||
@@ -69,9 +105,10 @@ const loading = ref(false);
|
||||
const closeFun = () => {
|
||||
emit('cancel');
|
||||
};
|
||||
|
||||
const baseTableRef = ref();
|
||||
const appformData = reactive<any>({
|
||||
appImage: '',
|
||||
commandConfigs: [],
|
||||
});
|
||||
|
||||
const submitFun = async () => {
|
||||
@@ -81,6 +118,7 @@ const submitFun = async () => {
|
||||
if (valid) {
|
||||
const fromData = tableFormRef.value.getFormDataFun();
|
||||
const appImage: any = fromData.appImage;
|
||||
fromData.commandConfigs = appformData.commandConfigs;
|
||||
// 判断是否上传了图片
|
||||
if (!appImage) {
|
||||
appName.value = fromData.appName;
|
||||
@@ -128,19 +166,75 @@ const updatePngFun = async (name: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getUseformDataFun = () => {
|
||||
nextTick(() => {
|
||||
const fromData = tableFormRef.value.getFormDataFun();
|
||||
const appImage = fromData.extras.find((item: any) => {
|
||||
return item.propertyName === 'appImage';
|
||||
})?.propertyValue;
|
||||
// const getUseformDataFun = () => {
|
||||
// nextTick(() => {
|
||||
// const fromData = tableFormRef.value.getFormDataFun();
|
||||
// const appImage = fromData.extras.find((item: any) => {
|
||||
// return item.propertyName === 'appImage';
|
||||
// })?.propertyValue;
|
||||
|
||||
if (appImage?.length) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
// if (appImage?.length) {
|
||||
// return true;
|
||||
// } else {
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
const valueTypeList = ref<any>([
|
||||
{
|
||||
label: '共享云盘文件',
|
||||
value: 'file',
|
||||
},
|
||||
{
|
||||
label: '用户自定义输入',
|
||||
value: 'input',
|
||||
},
|
||||
]);
|
||||
|
||||
const formChangeFun = (data: any) => {
|
||||
console.log(data, 'data');
|
||||
|
||||
if (data?.key === 'hpcCommand') {
|
||||
getCommandConfigsFun(data.val);
|
||||
}
|
||||
};
|
||||
|
||||
const getCommandConfigsFun = (str: any) => {
|
||||
const params = str
|
||||
? str.split(' ').filter((item: any) => {
|
||||
return item.startsWith('%');
|
||||
})
|
||||
: [];
|
||||
|
||||
const list = params.map((item: any) => {
|
||||
return item.replace('%', '');
|
||||
});
|
||||
appformData.commandConfigs = appformData.commandConfigs.filter((item: any) => {
|
||||
return list.includes(item.keyEnName);
|
||||
});
|
||||
|
||||
const appParams = appformData.commandConfigs.map((item: any) => {
|
||||
return item.keyEnName;
|
||||
});
|
||||
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (!appParams.includes(list[i])) {
|
||||
appformData.commandConfigs.push({
|
||||
defaultValue: 'default',
|
||||
featchType: 'param',
|
||||
fileRegular: '',
|
||||
keyCnName: '',
|
||||
keyEnName: list[i],
|
||||
valueType: 'input',
|
||||
isDisplay: 'Y',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
console.log(list);
|
||||
console.log(appformData.commandConfigs);
|
||||
baseTableRef.value.setDataFun(appformData.commandConfigs);
|
||||
};
|
||||
|
||||
watch(
|
||||
@@ -149,12 +243,14 @@ watch(
|
||||
if (newVal) {
|
||||
currentRow.value = cloneDeep(newVal);
|
||||
appformData.appImage = currentRow.value?.appImage;
|
||||
appformData.commandConfigs = currentRow.value?.commandConfigs || [];
|
||||
setTimeout(() => {
|
||||
if (currentRow.value?.id) {
|
||||
tableFormRef.value.setFormDataFun(currentRow.value);
|
||||
} else {
|
||||
tableFormRef.value.resetFun();
|
||||
}
|
||||
baseTableRef.value.setDataFun(appformData.commandConfigs);
|
||||
}, 100);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div>
|
||||
<el-button type="primary" @click="editAppInfoFun">新增应用 </el-button>
|
||||
<el-button type="primary" @click="editAppInfoFun">新增应用</el-button>
|
||||
<el-button type="" @click="showAppUseFun">应用统计 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -283,6 +283,9 @@ const updateAppInfoFun = async (data: any) => {
|
||||
machineCode: data.machineCode,
|
||||
comment: data.comment,
|
||||
uuid: data.uuid,
|
||||
commandConfigs: data.commandConfigs,
|
||||
hpcCommand: data.hpcCommand,
|
||||
hpcGroup: 'HPC_PACK',
|
||||
// creator: 'vu0151d',
|
||||
});
|
||||
if (res && res.code === 200) {
|
||||
@@ -304,6 +307,9 @@ const updateAppInfoFun = async (data: any) => {
|
||||
comment: data.comment || '',
|
||||
creator: getUserId() || '',
|
||||
creatorName: getUserData()?.nickname || '',
|
||||
commandConfigs: data.commandConfigs,
|
||||
hpcCommand: data.hpcCommand,
|
||||
hpcGroup: 'HPC_PACK',
|
||||
};
|
||||
|
||||
const res: any = await addApplicationApi(param);
|
||||
@@ -357,7 +363,7 @@ const timer: any = ref(null);
|
||||
const startAppFun = async (data: any) => {
|
||||
await getdeviceuuidFun();
|
||||
|
||||
const uuid = localStorage.getItem('USER_UUID') ;
|
||||
const uuid = localStorage.getItem('USER_UUID');
|
||||
if (uuid) {
|
||||
const res: any = await execApi({
|
||||
path: data.appPath,
|
||||
|
||||
@@ -36,7 +36,7 @@ const getDifficultyLevelColor = (difficulty: number) => {
|
||||
if (Number(difficulty) <= 1) {
|
||||
return '#67c23a'; // 绿色
|
||||
} else if (Number(difficulty) == 2) {
|
||||
return 'rgb(248, 227, 197)';
|
||||
return 'rgb(243, 209, 158)';
|
||||
} else {
|
||||
return '#f56c6c'; // 红色
|
||||
}
|
||||
@@ -54,6 +54,7 @@ const initUserDifficultyCoefficientChart = async (formData: any) => {
|
||||
let xData: any = [];
|
||||
let titles: any = [];
|
||||
let colors: any = [];
|
||||
let legendData: any = [];
|
||||
const seriesList: any = [];
|
||||
const params = {
|
||||
...formData,
|
||||
@@ -66,14 +67,16 @@ const initUserDifficultyCoefficientChart = async (formData: any) => {
|
||||
res.data?.result?.map((item: any) => {
|
||||
return item.userName;
|
||||
}) || [];
|
||||
titles = res.data?.alldifficultyValue || [];
|
||||
colors = titles
|
||||
.sort((a: any, b: any) => Number(a) - Number(b))
|
||||
.map((key: any) => getDifficultyLevelColor(Number(key)));
|
||||
// titles = res.data?.alldifficultyValue || [];
|
||||
titles = (res.data?.alldifficultyValue || [])
|
||||
.filter((key: string) => DIFFICULTY_COEFFICIENT.value.O.hasOwnProperty(key))
|
||||
.sort((a: any, b: any) => Number(a) - Number(b));
|
||||
legendData = titles.map((key: any) => getDifficultyLevel(Number(key)));
|
||||
colors = titles.map((key: any) => getDifficultyLevelColor(Number(key)));
|
||||
for (let i = 0; i < titles.length; i++) {
|
||||
const str = titles[i].toFixed(1);
|
||||
const obj: any = {
|
||||
name: getDifficultyLevel(Number(str)) + str,
|
||||
name: getDifficultyLevel(Number(str)),
|
||||
coefficient: Number(str),
|
||||
type: 'bar',
|
||||
emphasis: {
|
||||
@@ -89,7 +92,7 @@ const initUserDifficultyCoefficientChart = async (formData: any) => {
|
||||
const option = {
|
||||
color: colors,
|
||||
legend: {
|
||||
data: titles,
|
||||
data: legendData,
|
||||
},
|
||||
grid: {
|
||||
bottom: '50',
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
'createTime',
|
||||
'finishTime',
|
||||
]"
|
||||
:multipleItems="['user']"
|
||||
:nodata="nodata"
|
||||
@update="updateStatistics"
|
||||
/>
|
||||
@@ -36,7 +35,7 @@ const getDifficultyLevelColor = (difficulty: number) => {
|
||||
if (Number(difficulty) <= 1) {
|
||||
return '#67c23a'; // 绿色
|
||||
} else if (Number(difficulty) == 2) {
|
||||
return 'rgb(248, 227, 197)';
|
||||
return 'rgb(243, 209, 158)';
|
||||
} else {
|
||||
return '#f56c6c'; // 红色
|
||||
}
|
||||
@@ -57,19 +56,20 @@ const updateStatistics = async (formData: any) => {
|
||||
nodata.value = res.data.result.length === 0;
|
||||
res.data.result.forEach((item: any) => {
|
||||
// 遍历item.difficultyCount这个对象,将key和value分别存入difficultyCount对象中,如果key已经存在,则将value累加
|
||||
Object.keys(item.difficultyCount).forEach((key: any) => {
|
||||
if (difficultyCount[key]) {
|
||||
difficultyCount[key] += item.difficultyCount[key];
|
||||
} else {
|
||||
difficultyCount[key] = item.difficultyCount[key];
|
||||
}
|
||||
});
|
||||
Object.keys(item.difficultyCount)
|
||||
.filter((key: string) => DIFFICULTY_COEFFICIENT.value.O.hasOwnProperty(Number(key)))
|
||||
.forEach((key: any) => {
|
||||
if (difficultyCount[key]) {
|
||||
difficultyCount[key] += item.difficultyCount[key];
|
||||
} else {
|
||||
difficultyCount[key] = item.difficultyCount[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const seriesData = Object.keys(difficultyCount).map((key: any) => {
|
||||
return {
|
||||
key: Number(key),
|
||||
name: getDifficultyLevel(key) + key,
|
||||
name: getDifficultyLevel(key),
|
||||
value: difficultyCount[key],
|
||||
};
|
||||
});
|
||||
|
||||
@@ -498,7 +498,7 @@ const submitFun = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
if (props.taskInfo.exeStatus != 8) {
|
||||
if (props.taskInfo.exeStatus != TASK_PROCESS_STATUS.CLOSED_LOOP) {
|
||||
if (enableConfigByTenant([TENANT_ENUM.LYRIC])) {
|
||||
await updateTaskExeStatusFun();
|
||||
}
|
||||
|
||||
@@ -145,14 +145,14 @@ const performanceColorList = getAchieveColorList(
|
||||
const taskExeStatusLegendData = TASK_ACHIEVE_STATUS.value.A.map((item: any) => {
|
||||
return { name: item.label };
|
||||
});
|
||||
const difficultyCountColorList = [
|
||||
'#67c23a',
|
||||
'rgb(179, 225, 157)',
|
||||
'rgb(248, 227, 197)',
|
||||
'rgb(243, 209, 158)',
|
||||
'rgb(248, 152, 152)',
|
||||
'#f56c6c',
|
||||
];
|
||||
// const difficultyCountColorList = [
|
||||
// '#67c23a',
|
||||
// 'rgb(179, 225, 157)',
|
||||
// 'rgb(248, 227, 197)',
|
||||
// 'rgb(243, 209, 158)',
|
||||
// 'rgb(248, 152, 152)',
|
||||
// '#f56c6c',
|
||||
// ];
|
||||
// 封装方法,根据对象的某个属性对对象数组进行排序 升序
|
||||
const sortObjectArray = (arr: any, key: any) => {
|
||||
return arr.sort((a: any, b: any) => {
|
||||
@@ -216,7 +216,7 @@ const getDifficultyLevelColor = (difficulty: number) => {
|
||||
if (Number(difficulty) <= 1) {
|
||||
return '#67c23a'; // 绿色
|
||||
} else if (Number(difficulty) == 2) {
|
||||
return 'rgb(248, 227, 197)';
|
||||
return 'rgb(243, 209, 158)';
|
||||
} else {
|
||||
return '#f56c6c'; // 红色
|
||||
}
|
||||
@@ -234,14 +234,17 @@ const queryUserDifficultStatistics = async () => {
|
||||
xData = res.data.result.map((item: any) => {
|
||||
return item.userName;
|
||||
});
|
||||
titles = res.data.alldifficultyValue;
|
||||
// titles = res.data.alldifficultyValue;
|
||||
titles = (res.data?.alldifficultyValue || []).filter((key: string) =>
|
||||
DIFFICULTY_COEFFICIENT.value.O.hasOwnProperty(key)
|
||||
);
|
||||
colors = titles
|
||||
.sort((a: any, b: any) => Number(a) - Number(b))
|
||||
.map((key: any) => getDifficultyLevelColor(Number(key)));
|
||||
seriesData = titles.map((title: any) => {
|
||||
const str = title.toFixed(1);
|
||||
return {
|
||||
name: getDifficultyLevel(Number(str)) + str,
|
||||
name: getDifficultyLevel(Number(str)),
|
||||
coefficient: Number(str),
|
||||
type: 'bar',
|
||||
emphasis: {
|
||||
|
||||
@@ -296,8 +296,9 @@ const actionList = ref<any>([
|
||||
},
|
||||
hide: (row: any) => {
|
||||
return (
|
||||
row.exeStatus === TASK_PROCESS_STATUS.COMPLETED ||
|
||||
row.exeStatus === TASK_PROCESS_STATUS.REJECTED
|
||||
row.exeStatus === TASK_PROCESS_STATUS.REJECTED ||
|
||||
row.exeStatus === TASK_PROCESS_STATUS.CLOSED_LOOP ||
|
||||
row.exeStatus === TASK_PROCESS_STATUS.CANCELED
|
||||
);
|
||||
},
|
||||
},
|
||||
@@ -328,10 +329,15 @@ const actionList = ref<any>([
|
||||
{
|
||||
title: '驳回',
|
||||
type: 'danger',
|
||||
needConfirm: true,
|
||||
confirmTip: '确认驳回吗?',
|
||||
needConfirm: !enableConfigByTenant([TENANT_ENUM.LYRIC]),
|
||||
confirmTip: !enableConfigByTenant([TENANT_ENUM.LYRIC]) ? '确认驳回吗?' : '',
|
||||
click: (row: any) => {
|
||||
changeTaskStatus(row, TASK_PROCESS_STATUS.REJECTED);
|
||||
if (!enableConfigByTenant([TENANT_ENUM.LYRIC])) {
|
||||
changeTaskStatus(row, TASK_PROCESS_STATUS.REJECTED);
|
||||
} else {
|
||||
editRow.value = row;
|
||||
rejectVisible.value = true;
|
||||
}
|
||||
},
|
||||
hide: (row: any) => {
|
||||
return !(
|
||||
@@ -340,23 +346,6 @@ const actionList = ref<any>([
|
||||
);
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '驳回',
|
||||
// type: 'danger',
|
||||
// click: (row: any) => {
|
||||
// editRow.value = row;
|
||||
// rejectVisible.value = true;
|
||||
// },
|
||||
// hide: (row: any) => {
|
||||
// return (
|
||||
// enableConfigByTenant([TENANT_ENUM.BASE]) ||
|
||||
// !(
|
||||
// row.exeStatus === TASK_PROCESS_STATUS.NO_STARTED ||
|
||||
// row.exeStatus === TASK_PROCESS_STATUS.IN_PROGRESS
|
||||
// )
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
]);
|
||||
const showTaskDetailFun = (row: any) => {
|
||||
showTaskDetailDialog.value = true;
|
||||
|
||||
@@ -185,10 +185,15 @@ const actionList = ref([
|
||||
{
|
||||
title: '驳回',
|
||||
type: 'danger',
|
||||
needConfirm: true,
|
||||
confirmTip: '确认驳回吗?',
|
||||
needConfirm: !enableConfigByTenant([TENANT_ENUM.LYRIC]),
|
||||
confirmTip: !enableConfigByTenant([TENANT_ENUM.LYRIC]) ? '确认驳回吗?' : '',
|
||||
click: (row: any) => {
|
||||
changeTaskStatus(row, TASK_PROCESS_STATUS.REJECTED);
|
||||
if (!enableConfigByTenant([TENANT_ENUM.LYRIC])) {
|
||||
changeTaskStatus(row, TASK_PROCESS_STATUS.REJECTED);
|
||||
} else {
|
||||
editRow.value = row;
|
||||
rejectVisible.value = true;
|
||||
}
|
||||
},
|
||||
hide: (row: any) => {
|
||||
return !(
|
||||
@@ -198,23 +203,6 @@ const actionList = ref([
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '驳回',
|
||||
// type: 'danger',
|
||||
// click: (row: any) => {
|
||||
// editRow.value = row;
|
||||
// rejectVisible.value = true;
|
||||
// },
|
||||
// hide: (row: any) => {
|
||||
// return (
|
||||
// enableConfigByTenant([TENANT_ENUM.BASE]) ||
|
||||
// !(
|
||||
// row.exeStatus === TASK_PROCESS_STATUS.NO_STARTED ||
|
||||
// row.exeStatus === TASK_PROCESS_STATUS.IN_PROGRESS
|
||||
// )
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: '删除',
|
||||
// type: 'danger',
|
||||
// needConfirm: true,
|
||||
|
||||
@@ -30,11 +30,12 @@
|
||||
<DemandDetail v-model="formVisible" :demandId="demandId" />
|
||||
</div>
|
||||
<attachments :demandId="demandInfo.uuid" v-model:visible="attachmentsVisible"></attachments>
|
||||
<RejectDia v-model="rejectVisible" title="撤回代办" @submit="rejectFun" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from 'vue';
|
||||
import { deleteDemandApi, demandListApi } from '@/api/project/demand';
|
||||
import { deleteDemandApi, demandListApi, withdrawDemandApi } from '@/api/project/demand';
|
||||
// import { upload } from '@/api/request';
|
||||
import { CommonStore } from '@/stores/common';
|
||||
import attachments from '@/views/task/simulationTask/components/attachments.vue';
|
||||
@@ -45,6 +46,8 @@ import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
|
||||
import { syncDemandList } from '../taskPage';
|
||||
import { getPageStorage } from '@/utils/common';
|
||||
import DemandDetail from './components/detail.vue';
|
||||
import RejectDia from '../components/rejectDia.vue';
|
||||
import { TASK_PROCESS_STATUS } from '@/utils/enum/task';
|
||||
|
||||
// import emitter from '@/utils/eventBus';
|
||||
|
||||
@@ -94,6 +97,9 @@ const showTaskDetailFun = (row: any) => {
|
||||
// visibleDialog(false, row);
|
||||
};
|
||||
const demandId = ref<any>('');
|
||||
const rejectVisible = ref(false);
|
||||
const rejectData = ref<any>({});
|
||||
|
||||
const actionList = ref([
|
||||
{
|
||||
title: '编辑',
|
||||
@@ -112,6 +118,23 @@ const actionList = ref([
|
||||
click: (row: any) => {
|
||||
deleteDemandFun(row.uuid);
|
||||
},
|
||||
hide: () => {
|
||||
return enableConfigByTenant([TENANT_ENUM.LYRIC]);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '撤回',
|
||||
type: 'danger',
|
||||
click: (row: any) => {
|
||||
rejectData.value = row;
|
||||
rejectVisible.value = true;
|
||||
},
|
||||
hide: (row: any) => {
|
||||
return (
|
||||
!enableConfigByTenant([TENANT_ENUM.LYRIC]) ||
|
||||
![TASK_PROCESS_STATUS.NO_STARTED].includes(row.demandStatus)
|
||||
);
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -138,6 +161,20 @@ const deleteDemandFun = async (uuid: number) => {
|
||||
}
|
||||
};
|
||||
|
||||
const rejectFun = (data: any) => {
|
||||
const params = {
|
||||
uuid: rejectData.value.uuid,
|
||||
...data,
|
||||
};
|
||||
withdrawDemandApi(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
rejectVisible.value = false;
|
||||
ElMessage.success('撤回成功');
|
||||
tableRef.value.tableRef.resetFun();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const simulationTypeList = ref(commonStore.getDictData('SIMULATION_TYPE').A);
|
||||
const simulationType = ref(getPageStorage('simulationType') || simulationTypeList.value[0].value);
|
||||
|
||||
|
||||
@@ -68,17 +68,17 @@ export const syncDemandList = async () => {
|
||||
export const changeTaskStatusCommon = async (row: any, status: string, formData?: any) => {
|
||||
const data: any = formData || {};
|
||||
const params: {
|
||||
data: any;
|
||||
taskIds: any[];
|
||||
req: {
|
||||
exeStatus: string;
|
||||
finishTime?: string;
|
||||
data: any;
|
||||
};
|
||||
} = {
|
||||
...data,
|
||||
taskIds: [row.uuid],
|
||||
req: {
|
||||
exeStatus: status,
|
||||
...data,
|
||||
},
|
||||
};
|
||||
if (status === TASK_PROCESS_STATUS.COMPLETED) {
|
||||
|
||||
Reference in New Issue
Block a user