From 5fd5c69347db39f256cc6e433bb6239e7bc7df84 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Wed, 21 Jan 2026 14:38:11 +0800
Subject: [PATCH] feat:字典
---
applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue | 35 ++++++++++++++++++++---------------
1 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue b/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue
index eca4847..345ef80 100644
--- a/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue
+++ b/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue
@@ -14,7 +14,9 @@
clearable
@change="handleSearch"
>
- <el-option v-for="item in appInnovationStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
+ <el-option v-for="item in dictObj.appInnovationStatus" :key="item.dictKey"
+ :label="item.dictValue"
+ :value="item.dictKey"/>
</el-select>
</el-form-item>
@@ -32,12 +34,16 @@
<div class="gd-table-container" v-loading="loading">
<div class="gd-table-content gd-table-content-bg">
<el-table class="gd-table" :data="list" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="46" />
+ <el-table-column label="序号" width="60" align="center">
+ <template #default="{ $index }">
+ {{ formatNumber((searchParams.current - 1) * searchParams.size + $index + 1) }}
+ </template>
+ </el-table-column>
<el-table-column prop="caseName" show-overflow-tooltip label="案例名称" />
<el-table-column prop="belongDomain" show-overflow-tooltip label="所属领域" />
<el-table-column prop="innovationStatus" show-overflow-tooltip label="应用创新状态">
<template v-slot="{ row }">
- {{ getInnovationStatusLabel(row.innovationStatus) }}
+ {{ getDictLabel(row.innovationStatus) }}
</template>
</el-table-column>
<el-table-column prop="applicationScenarioDesc" show-overflow-tooltip label="应用场景描述" />
@@ -75,6 +81,7 @@
import { onMounted, ref, nextTick, provide } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { getDictionaryByCode } from '@/api/system/dictbiz'
+import { getDictLabel } from '@ztzf/utils'
import FormDiaLog from './FormDiaLog.vue'
import {
gdApplicationInnovationPageApi,
@@ -96,23 +103,16 @@
const queryParamsRef = ref(null) // 查询表单实例
const dialogRef = ref(null) // 弹框实例
const dialogVisible = ref(false)
-const appInnovationStatusOptions = ref([]) // 应用创新状态字典
-
-// 注入字典数据到子组件
-provide('appInnovationStatusOptions', appInnovationStatusOptions)
-
+const dictObj = ref({}) // 字典对象
+provide('dictObj', dictObj)
// 获取字典
function getDictList() {
- getDictionaryByCode('appInnovationStatus').then(res => {
- appInnovationStatusOptions.value = res.data.data?.appInnovationStatus || []
+ return getDictionaryByCode('appInnovationStatus').then(res => {
+ dictObj.value = res.data.data
+
})
}
-// 获取应用创新状态标签
-function getInnovationStatusLabel(value) {
- const item = appInnovationStatusOptions.value.find(item => item.value === value)
- return item?.label || value
-}
// 获取列表
async function getList() {
@@ -168,6 +168,11 @@
selectedIds.value = rows.map(item => item.id)
}
+// 格式化数字为两位数
+function formatNumber(num) {
+ return num.toString().padStart(2, '0')
+}
+
onMounted(() => {
getList()
getDictList()
--
Gitblit v1.9.3