更改任务状态颜色

This commit is contained in:
renxiangke 2026-07-27 18:54:43 +08:00
parent e9b718ddee
commit d484c8a6a8
2 changed files with 17 additions and 2 deletions

View File

@ -197,6 +197,8 @@ defineExpose({
tableData: props.tableData, // props
});
function getValueStyle(val: any, colorArr: string[]) {
console.log(val,colorArr,"2141414")
if (!colorArr || !Array.isArray(colorArr)) {
return {};
}
@ -257,6 +259,19 @@ function getValueStyle(val: any, colorArr: string[]) {
{{ scope.row[item.prop!].text }}
</div>
</slot>
<slot v-else-if="item.type === 'select' && selectOptions[item.prop!]&&scope.row[item.prop!]==-1&&item.label=='任务状态'" :name="item.prop" :row="scope.row">
<div style="color:red">
{{
getValueById(
selectOptions[item.prop!].list,
scope.row[item.prop!],
selectOptions[item.prop!].valueKey || 'value',
selectOptions[item.prop!].labelKey || 'label',
)
}}
</div>
</slot>
<slot v-else-if="item.type === 'select' && selectOptions[item.prop!]" :name="item.prop" :row="scope.row">
<div :style="getValueStyle(scope.row[item.prop!], item.colorArr)">
{{

View File

@ -271,7 +271,7 @@ function listUpload() {
const columns = ref<TableColumn[]>([
{ prop: 'taskName', label: '任务名称', type: 'text' }, // width: 180
{ prop: 'taskStatus', label: '任务状态', type: 'select', colorArr: ['#8C8C8C', '#FAAD14', '#1677FF', '#52C41A', '#F5222D', '#fff'], width: 90 },
{ prop: 'taskStatus', label: '任务状态', type: 'select', colorArr: ['#8C8C8C', '#FAAD14', '#1677FF', '#52C41A', '#F5222D', 'pink'], width: 120 },
{ prop: 'releaseType', label: '释放类型', type: 'select', width: 90 },
{ prop: 'releaseSourceLocation', label: '释放源位置', type: 'select', width: 100 },
{ prop: 'timeRange', label: '数据时间范围', type: 'text', width: 200 },
@ -932,7 +932,7 @@ onMounted(() => {
/>
</Dialog>
<!-- 任务列表弹窗 -->
<Dialog v-model="dialogVisible" :title="t('taskList')" width="92vw" class="config-dialog" :hide-close="true" @close="dialogVisible = false">
<Dialog v-model="dialogVisible" :title="t('taskList')" width="82vw" class="config-dialog" :hide-close="true" @close="dialogVisible = false">
<ElForm :model="queryForm" label-width="120px" class="queryForm">
<ElRow :gutter="10">
<ElCol :span="4">