字典管理
This commit is contained in:
139
src/views/govern/manage/basic/dictionary.vue
Normal file
139
src/views/govern/manage/basic/dictionary.vue
Normal file
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<div class='default-main'>
|
||||
<TableHeader>
|
||||
<template #select>
|
||||
<el-form-item label='数据分类'>
|
||||
<el-select
|
||||
v-model='tableStore.table.params.dataType'
|
||||
multiple
|
||||
filterable
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder='请选择数据分类'
|
||||
>
|
||||
<el-option
|
||||
v-for='item in DataTypeSelect'
|
||||
:key='item.id'
|
||||
:label='item.name'
|
||||
:value='item.id'
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='数据存储'>
|
||||
<el-select
|
||||
v-model='tableStore.table.params.classId'
|
||||
multiple
|
||||
filterable
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder='请选择数据存储'
|
||||
>
|
||||
<el-option
|
||||
v-for='item in DataSelect'
|
||||
:key='item.id'
|
||||
:label='item.name'
|
||||
:value='item.id'
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='过滤筛选:'>
|
||||
<el-input v-model='tableStore.table.params.searchValue' placeholder='数据名称、别名、名称'
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button type='primary' @click='addMenu' icon='el-icon-plus'>新增字典</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref='tableRef' />
|
||||
<PopupDictionary ref='popupDictionary'></PopupDictionary>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import PopupDictionary from './popupDictionary.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'govern/manage/basic/dictionary'
|
||||
})
|
||||
const popupDictionary = ref()
|
||||
const dictData = useDictData()
|
||||
const DataSelect = dictData.getBasicData('Data')
|
||||
const DataTypeSelect = dictData.getBasicData('Cs_Data_Type')
|
||||
const tableStore = new TableStore({
|
||||
url: '/system-boot/csDictData/list',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '数据分类', field: 'dataTypeName' },
|
||||
{ title: '数据名称', field: 'name' },
|
||||
{ title: '别名', field: 'otherName' },
|
||||
{ title: '展示名称', field: 'showName' },
|
||||
{ title: '相别', field: 'phaseName' },
|
||||
{ title: '单位', field: 'unit' },
|
||||
{ title: '基础数据类型', field: 'type' },
|
||||
{ title: '数据谐波次数', field: 'harmStart' },
|
||||
{ title: '数据统计方法', field: 'statMethod' },
|
||||
{ title: '数据存储', field: 'classIdName' },
|
||||
{ title: '数据来源', field: 'resourcesId' },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '130',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'tipButton',
|
||||
click: row => {
|
||||
popupDictionary.value.open('编辑字典', row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
loadCallback: () => {
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
item.classIdName = DataSelect.find((child: any) => child.id == item.classId)?.name || '/'
|
||||
item.phaseName = item.phase === 'M' ? '/' : item.phase || '/'
|
||||
for (let key in item) {
|
||||
if (typeof item[key] !== 'number') {
|
||||
item[key] = item[key] || '/'
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchState = ''
|
||||
tableStore.table.params.dataType = ''
|
||||
tableStore.table.params.classId = ''
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const addMenu = () => {
|
||||
popupDictionary.value.open('新增字典')
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user