| | |
| | | <template> |
| | | <!-- 搜索工作栏 --> |
| | | <ContentWrap> |
| | | <el-form ref="queryFormRef" :inline="true" :model="queryParams" class="-mb-15px" |
| | | label-width="68px"> |
| | | <el-form-item label="指标编码" prop="itemNo"> |
| | | <el-input v-model="queryParams.itemNo" class="!w-200px" clearable placeholder="请输入指标编码" |
| | | @keyup.enter="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="指标名称" prop="itemName"> |
| | | <el-input v-model="queryParams.itemName" class="!w-200px" clearable placeholder="请输入指标名称" |
| | | @keyup.enter="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="指标类型" prop="itemType"> |
| | | <el-select v-model="queryParams.itemType" class="!w-200px" clearable placeholder="请选择指标类型"> |
| | | <el-option |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.IND_ITEM_TYPE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon class="mr-5px" icon="ep:search"/> |
| | | 搜索 |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <Icon class="mr-5px" icon="ep:refresh"/> |
| | | 重置 |
| | | </el-button> |
| | | <el-button |
| | | v-hasPermi="['data:ind-item:create']" |
| | | plain |
| | | type="primary" |
| | | @click="openForm('create')" |
| | | > |
| | | <Icon class="mr-5px" icon="ep:plus"/> |
| | | 新增 |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="3" :xs="24"> |
| | | <ContentWrap class="h-1/1"> |
| | | <el-tree |
| | | style="max-width: 600px" |
| | | :data="dataCategoryList" |
| | | :props="treeProps" |
| | | default-expand-all |
| | | highlight-current |
| | | @node-click="handleNodeClick" |
| | | /> |
| | | </ContentWrap> |
| | | </el-col> |
| | | <el-col :span="21" :xs="24"> |
| | | <!-- 搜索工作栏 --> |
| | | <ContentWrap> |
| | | <el-form ref="queryFormRef" :inline="true" :model="queryParams" class="-mb-15px" |
| | | label-width="68px"> |
| | | <el-form-item label="指标编码" prop="itemNo"> |
| | | <el-input v-model="queryParams.itemNo" class="!w-200px" clearable placeholder="请输入指标编码" |
| | | @keyup.enter="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="指标名称" prop="itemName"> |
| | | <el-input v-model="queryParams.itemName" class="!w-200px" clearable placeholder="请输入指标名称" |
| | | @keyup.enter="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="指标类型" prop="itemType"> |
| | | <el-select v-model="queryParams.itemType" class="!w-200px" clearable placeholder="请选择指标类型"> |
| | | <el-option |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.IND_ITEM_TYPE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon class="mr-5px" icon="ep:search"/> |
| | | 搜索 |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <Icon class="mr-5px" icon="ep:refresh"/> |
| | | 重置 |
| | | </el-button> |
| | | <el-button |
| | | v-hasPermi="['data:ind-item:create']" |
| | | plain |
| | | type="primary" |
| | | @click="openForm('create')" |
| | | > |
| | | <Icon class="mr-5px" icon="ep:plus"/> |
| | | 新增 |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table v-loading="loading" :data="list"> |
| | | <el-table-column prop="itemNo" label="指标编码" header-align="center" align="center" min-width="80"/> |
| | | <el-table-column prop="itemName" label="指标名称" header-align="center" align="center" min-width="120"/> |
| | | <el-table-column prop="itemCategoryName" label="指标分类" header-align="center" align="center" min-width="100"/> |
| | | <el-table-column prop="itemType" label="指标类型" header-align="center" align="center" min-width="60"> |
| | | <template #default="scope"> |
| | | <dict-tag :type="DICT_TYPE.IND_ITEM_TYPE" :value="scope.row.itemType" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="coefficient" label="系数" header-align="center" align="center" min-width="60"/> |
| | | <el-table-column prop="precision" label="指标精度" header-align="center" align="center" min-width="60"/> |
| | | <el-table-column prop="timeGranularity" label="时间粒度" header-align="center" align="center" min-width="40"> |
| | | <template #default="scope"> |
| | | <dict-tag :type="DICT_TYPE.TIME_GRANULARITY" :value="scope.row.timeGranularity" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | :formatter="dateFormatter" |
| | | align="center" |
| | | label="创建时间" |
| | | prop="createTime" |
| | | width="180"/> |
| | | <el-table-column align="center" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | v-hasPermi="['data:ind-item:update']" |
| | | link |
| | | type="primary" |
| | | @click="openForm('update', scope.row)"> |
| | | 修改 |
| | | </el-button> |
| | | <el-button |
| | | v-hasPermi="['data:ind-item:delete']" |
| | | link |
| | | type="danger" |
| | | @click="handleDelete(scope.row.id)"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 分页 --> |
| | | <Pagination |
| | | v-model:limit="queryParams.pageSize" |
| | | v-model:page="queryParams.pageNo" |
| | | :total="total" |
| | | @pagination="getList" |
| | | /> |
| | | </ContentWrap> |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table v-loading="loading" :data="list"> |
| | | <el-table-column prop="itemNo" label="指标编码" header-align="center" align="center" min-width="70"/> |
| | | <el-table-column prop="itemName" label="指标名称" header-align="center" align="center" min-width="150"/> |
| | | <el-table-column prop="itemCategoryName" label="指标分类" header-align="center" align="center" min-width="80"/> |
| | | <el-table-column prop="itemType" label="指标类型" header-align="center" align="center" min-width="60"> |
| | | <template #default="scope"> |
| | | <dict-tag :type="DICT_TYPE.IND_ITEM_TYPE" :value="scope.row.itemType" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="coefficient" label="系数" header-align="center" align="center" min-width="50"/> |
| | | <el-table-column prop="precision" label="指标精度" header-align="center" align="center" min-width="50"/> |
| | | <el-table-column prop="timeGranularity" label="时间粒度" header-align="center" align="center" min-width="50"> |
| | | <template #default="scope"> |
| | | <dict-tag :type="DICT_TYPE.TIME_GRANULARITY" :value="scope.row.timeGranularity" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | :formatter="dateFormatter" |
| | | align="center" |
| | | label="创建时间" |
| | | prop="createTime" |
| | | width="200"/> |
| | | <el-table-column align="center" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | v-hasPermi="['data:ind-item:update']" |
| | | link |
| | | type="primary" |
| | | @click="openForm('update', scope.row)"> |
| | | 修改 |
| | | </el-button> |
| | | <el-button |
| | | v-hasPermi="['data:ind-item:update']" |
| | | link |
| | | type="primary" |
| | | @click="getCurrentData(scope.row.itemNo)"> |
| | | 当前值 |
| | | </el-button> |
| | | <el-button |
| | | v-hasPermi="['data:ind-item:delete']" |
| | | link |
| | | type="danger" |
| | | @click="handleDelete(scope.row.id)"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 分页 --> |
| | | <Pagination |
| | | v-model:limit="queryParams.pageSize" |
| | | v-model:page="queryParams.pageNo" |
| | | :total="total" |
| | | @pagination="getList" |
| | | /> |
| | | </ContentWrap> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <AtomIndDefineForm ref="atomFormRef" @success="getList" /> |
| | | <DerIndDefineForm ref="derFormRef" @success="getList" /> |
| | | <CalIndDefineForm ref="calFormRef" @success="getList" /> |
| | | <SelectItemType ref="itemTypeSel"/> |
| | | <IndCurrentData ref="indCurrentData" /> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | |
| | | import download from '@/utils/download' |
| | | import * as ItemApi from '@/api/data/ind/item/item' |
| | | import * as CategoryApi from "@/api/data/ind/category"; |
| | | import IndCurrentData from './IndCurrentData.vue' |
| | | import {handleTree} from "@/utils/tree"; |
| | | |
| | | |
| | | defineOptions({ name: 'IndItem' }) |
| | | |
| | |
| | | const data = await ItemApi.getItemPage(queryParams) |
| | | list.value = data.list |
| | | total.value = data.total |
| | | dataCategoryList.value = await CategoryApi.getCategoryListAllSimple() |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | const getCategoryTree = async () => { |
| | | dataCategoryList.value = [] |
| | | const res = await CategoryApi.getCategoryListAllSimple() |
| | | let category: Tree = {id: 0, label: '主类目', children: []} |
| | | category.children = handleTree(res, 'id', 'pid') |
| | | dataCategoryList.value.push(category) |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | |
| | | }else { |
| | | itemTypeSel.value.open(type) |
| | | } |
| | | } |
| | | const indCurrentData = ref() |
| | | |
| | | const getCurrentData = (itemNo: string) => { |
| | | indCurrentData.value.open(itemNo) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | |
| | | } catch {} |
| | | } |
| | | |
| | | const handleNodeClick = (data: Tree) => { |
| | | if( data.id !== 0 ){ |
| | | queryParams.itemCategory = String(data.id) |
| | | }else { |
| | | queryParams.itemCategory = '' |
| | | } |
| | | getList() |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | | onMounted(() => { |
| | | getList() |
| | | getCategoryTree() |
| | | }) |
| | | </script> |