| | |
| | | <basic-container> |
| | | <el-form ref="queryParamsRef" :model="searchParams" class="gd-search-form"> |
| | | <el-form-item label="案例名称" prop="caseName"> |
| | | <el-input class="gd-input" v-model="searchParams.caseName" placeholder="请输入" clearable @clear="handleSearch" /> |
| | | <el-input |
| | | class="gd-input gray" |
| | | v-model="searchParams.caseName" |
| | | placeholder="请输入" |
| | | clearable |
| | | @clear="handleSearch" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="应用创新状态" prop="innovationStatus"> |
| | | <el-select |
| | | class="gd-select" |
| | | class="gd-select gray" |
| | | popper-class="gd-select-popper" |
| | | v-model="searchParams.innovationStatus" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="handleSearch" |
| | | :disabled="permission.yycx_shtg" |
| | | > |
| | | <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> |
| | | |
| | |
| | | <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="70" align="center"> |
| | | <template #default="{ $index }"> |
| | | {{ $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, dictObj.appInnovationStatus) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="applicationScenarioDesc" show-overflow-tooltip label="应用场景描述" /> |
| | |
| | | <el-table-column prop="resourceName" show-overflow-tooltip label="资源名称" /> |
| | | <el-table-column prop="resourceCode" show-overflow-tooltip label="资源编码" /> |
| | | <el-table-column prop="caseDesc" show-overflow-tooltip label="案例描述" /> |
| | | <el-table-column label="操作" class-name="operation-btns"> |
| | | <el-table-column label="操作" class-name="operation-btns" width="150"> |
| | | <template v-slot="{ row }"> |
| | | <el-link @click="openForm('view', row)">查看</el-link> |
| | | <el-link @click="openForm('edit', row)">编辑</el-link> |
| | | <el-link @click="handleDelete(row)">删除</el-link> |
| | | <el-link type="primary" @click="openForm('view', row)">查看</el-link> |
| | | <!-- <el-link type="primary" @click="openForm('edit', row)">编辑</el-link>--> |
| | | <el-link type="primary" @click="handleDelete(row)" v-if="!['1', '2'].includes(row.innovationStatus) && row.isTheSameDepartment">删除</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </template> |
| | | <script setup> |
| | | import { Search, RefreshRight, Plus, Delete } from '@element-plus/icons-vue' |
| | | 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, |
| | | gdApplicationInnovationRemoveApi, |
| | | } from '@/views/orderView/orderDataManage/appInnovation/appInnovationApi' |
| | | |
| | | import { useStore } from 'vuex' |
| | | const store = useStore() |
| | | const userDepartment = store.state.user.userInfo?.dept_id |
| | | const permission = computed(() => store.state.user.permission); |
| | | // 初始化查询参数 |
| | | const initSearchParams = () => ({ |
| | | caseName: '', // 案例名称 |
| | | innovationStatus: '', // 应用创新状态 |
| | | current: 1, // 当前页 |
| | | size: 10, // 每页大小 |
| | | isQueryAll:''//是否查询所有 |
| | | }) |
| | | const searchParams = ref(initSearchParams()) // 查询参数 |
| | | const total = ref(0) // 总条数 |
| | |
| | | const queryParamsRef = ref(null) // 查询表单实例 |
| | | const dialogRef = ref(null) // 弹框实例 |
| | | const dialogVisible = ref(false) |
| | | const appInnovationStatusOptions = ref([]) // 应用创新状态字典 |
| | | |
| | | // 注入字典数据到子组件 |
| | | provide('appInnovationStatusOptions', appInnovationStatusOptions) |
| | | |
| | | const dictObj = ref({}) // 字典对象 |
| | | const innovationDetailsStatus = ref( '') |
| | | provide('dictObj', dictObj) |
| | | provide('innovationDetailsStatus', innovationDetailsStatus) |
| | | // 获取字典 |
| | | 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() { |
| | | loading.value = true |
| | | try { |
| | | const res = await gdApplicationInnovationPageApi(searchParams.value) |
| | | // 根据权限设置查询参数 |
| | | const params = { ...searchParams.value } |
| | | if (permission.value.yycx_shtg) { |
| | | params.innovationStatus = '1' |
| | | params.isQueryAll = true |
| | | } else { |
| | | params.isQueryAll = false |
| | | delete params.innovationStatus |
| | | } |
| | | const res = await gdApplicationInnovationPageApi(params) |
| | | res?.data?.data?.records.forEach(item => { |
| | | item.isTheSameDepartment = String(item.createDept) === String(userDepartment) |
| | | }) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } finally { |
| | |
| | | |
| | | // 新增/编辑/查看 弹框 |
| | | function openForm(mode, row) { |
| | | innovationDetailsStatus.value = row?.innovationStatus |
| | | dialogVisible.value = true |
| | | nextTick(() => { |
| | | dialogRef.value?.open({ mode, row }) |
| | |
| | | selectedIds.value = rows.map(item => item.id) |
| | | } |
| | | |
| | | // 格式化数字为两位数 |
| | | function formatNumber(num) { |
| | | return num.toString().padStart(2, '0') |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList() |
| | | getDictList() |
| | | }) |
| | | </script> |
| | | <style scoped lang="scss"></style> |
| | | |