8
0
Ver Fonte

业务字典

ZaiZai há 1 ano atrás
pai
commit
1bc28fd694

+ 28 - 0
src/api/modules/system/dict.js

@@ -33,4 +33,32 @@ export default {
             },
         }, false)
     },
+    async getList(form) {
+        return HcApi({
+            url: '/api/blade-system/dict/list',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    async getChildList(form) {
+        return HcApi({
+            url: '/api/blade-system/dict/child-list',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    async getDictTree() {
+        return HcApi({
+            url: '/api/blade-system/dict/tree?code=DICT',
+            method: 'get',
+            params: {},
+        }, false)
+    },
+    async getDictionary(params) {
+        return HcApi({
+            url: '/api/blade-system/dict/dictionary',
+            method: 'get',
+            params,
+        }, false)
+    },
 }

+ 64 - 0
src/api/modules/system/dictbiz.js

@@ -0,0 +1,64 @@
+import { HcApi } from '../../request/index'
+
+export default {
+    async page(form) {
+        return HcApi({
+            url: '/api/blade-system/dict-biz/parent-list',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    async detail(id) {
+        return HcApi({
+            url: '/api/blade-system/dict-biz/detail',
+            method: 'get',
+            params: {
+                id,
+            },
+        }, false)
+    },
+    async submit(form) {
+        return HcApi({
+            url: '/api/blade-system/dict-biz/submit',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+    async del(ids) {
+        return HcApi({
+            url: '/api/blade-system/dict-biz/remove',
+            method: 'post',
+            params: {
+                ids,
+            },
+        }, false)
+    },
+    async getList(form) {
+        return HcApi({
+            url: '/api/blade-system/dict-biz/list',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    async getChildList(form) {
+        return HcApi({
+            url: '/api/blade-system/dict-biz/child-list',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    async getDictTree() {
+        return HcApi({
+            url: '/api/blade-system/dict-biz/tree?code=DICT',
+            method: 'get',
+            params: {},
+        }, false)
+    },
+    async getDictionary(params) {
+        return HcApi({
+            url: '/api/blade-system/dict-biz/dictionary',
+            method: 'get',
+            params,
+        }, false)
+    },
+}

+ 6 - 0
src/router/modules/base.js

@@ -76,6 +76,12 @@ export default [
                 meta: { title: '系统字典' },
                 component: () => import('~src/views/system/dict.vue'),
             },
+            {
+                path: '/system/dictbiz',
+                name: 'dictbiz',
+                meta: { title: '业务字典' },
+                component: () => import('~src/views/system/dictbiz.vue'),
+            },
         ],
     },
     {

+ 1 - 1
src/views/system/app.vue

@@ -365,7 +365,7 @@ const formUpdateRules = {
 //新增
 const addUpdateClick = () => {
     updateFormTitle.value = '新增 - ' + updateDialogTitle.value
-    formUpdateModel.value = {}
+    formUpdateModel.value = { softwareType: 1, fileType: 0, constraintUpdate: 0, versionId: appRowInfo.value.id }
     //显示表单弹窗
     nextTick(() => {
         isUpdateFormDialog.value = true

+ 29 - 6
src/views/system/dict.vue

@@ -8,7 +8,7 @@
                 </el-select>
             </div>
             <div class="ml-2 w-60">
-                <hc-search-input v-model="searchName" placeholder="请输入参数名称关键词" @search="searchClick" />
+                <hc-search-input v-model="searchName" placeholder="请输入关键词" @search="searchClick" />
             </div>
         </template>
         <template #extra>
@@ -25,7 +25,7 @@
             </template>
             <template #action="{ row }">
                 <el-link type="warning" @click="editRowClick(row)">修改</el-link>
-                <el-link type="primary" @click="editRowClick(row)">配置</el-link>
+                <el-link type="primary" @click="handleRowClick(row)">配置</el-link>
                 <el-link type="danger" @click="delRowClick(row)">删除</el-link>
             </template>
         </hc-table>
@@ -60,13 +60,17 @@
                 <el-button hc-btn type="primary" :loading="submitLoading" @click="dialogSubmit">提交</el-button>
             </template>
         </hc-new-dialog>
+
+        <!-- 字典配置 -->
+        <HcChildDict v-model="isConfigDialog" :info="dictTableRow" @close="dictTableClose" />
     </hc-new-card>
 </template>
 
 <script setup>
 import { nextTick, onActivated, ref } from 'vue'
 import { arrToId, formValidate, getArrValue } from 'js-fast-way'
-import { delMessage, reloadPage } from '~uti/tools'
+import HcChildDict from './modules/dict/dict.vue'
+import { delMessage } from '~uti/tools'
 import mainApi from '~api/system/dict'
 
 //激活
@@ -109,10 +113,14 @@ const tableData = ref([{}])
 const getTableData = async () => {
     tableData.value = []
     tableLoading.value = true
-    const { error, code, data } = await mainApi.page({
+    const form = {
         ...searchForm.value,
         total: null,
-    })
+    }
+    if (searchName.value) {
+        form[searchType.value] = searchName.value
+    }
+    const { error, code, data } = await mainApi.page(form)
     tableLoading.value = false
     if (!error && code === 200) {
         tableData.value = getArrValue(data['records'])
@@ -186,7 +194,7 @@ const delRowClick = (row) => {
         const { code, msg } = await mainApi.del(row.id)
         if (code === 200) {
             window.$message.success('删除成功')
-            reloadPage()
+            getTableData().then()
         } else {
             window.$message.error(msg ?? '删除失败')
         }
@@ -237,4 +245,19 @@ const dialogClose = () => {
     submitLoading.value = false
     formModel.value = {}
 }
+
+//字典配置
+const isConfigDialog = ref(false)
+const dictTableRow = ref({})
+const handleRowClick = (row) => {
+    dictTableRow.value = row
+    nextTick(() => {
+        isConfigDialog.value = true
+    })
+}
+
+//关闭字典配置弹窗
+const dictTableClose = () => {
+    isConfigDialog.value = false
+}
 </script>

+ 263 - 0
src/views/system/dictbiz.vue

@@ -0,0 +1,263 @@
+<template>
+    <hc-new-card>
+        <template #header>
+            <div class="w-32">
+                <el-select v-model="searchType" placeholder="选择搜索类型" filterable block>
+                    <el-option label="字典编号" value="code" />
+                    <el-option label="字典名称" value="dictValue" />
+                </el-select>
+            </div>
+            <div class="ml-2 w-60">
+                <hc-search-input v-model="searchName" placeholder="请输入关键词" @search="searchClick" />
+            </div>
+        </template>
+        <template #extra>
+            <el-button hc-btn type="primary" @click="addClick">新增</el-button>
+            <el-button hc-btn type="danger" @click="delClick">删除</el-button>
+        </template>
+        <hc-table
+            ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
+            is-new is-check :check-style="{ width: 29 }" :index-style="{ width: 60 }"
+            @selection-change="tableCheckChange"
+        >
+            <template #isSealed="{ row }">
+                {{ row.isSealed === 1 ? '是' : '否' }}
+            </template>
+            <template #action="{ row }">
+                <el-link type="warning" @click="editRowClick(row)">修改</el-link>
+                <el-link type="primary" @click="handleRowClick(row)">配置</el-link>
+                <el-link type="danger" @click="delRowClick(row)">删除</el-link>
+            </template>
+        </hc-table>
+        <template #action>
+            <hc-pages :pages="searchForm" @change="pageChange" />
+        </template>
+
+        <!-- 新增/修改 -->
+        <hc-new-dialog v-model="isDialogShow" widths="400px" is-footer-center :title="dialogTitle" @close="dialogClose">
+            <el-form ref="formRef" :model="formModel" :rules="formRules" label-position="top" label-width="auto">
+                <el-form-item label="字典编号:" prop="code">
+                    <el-input v-model="formModel.code" clearable placeholder="请输入字典编号" />
+                </el-form-item>
+                <el-form-item label="字典名称:" prop="dictValue">
+                    <el-input v-model="formModel.dictValue" clearable placeholder="请输入字典名称" />
+                </el-form-item>
+                <el-form-item label="字典备注:">
+                    <el-input v-model="formModel.remark" clearable placeholder="请输入字典备注" />
+                </el-form-item>
+                <el-form-item label="字典排序:" prop="sort">
+                    <el-input-number v-model="formModel.sort" :min="1" block controls-position="right" />
+                </el-form-item>
+                <el-form-item label="字典封存:" prop="isSealed">
+                    <el-radio-group v-model="formModel.isSealed">
+                        <el-radio :label="1">是</el-radio>
+                        <el-radio :label="0">否</el-radio>
+                    </el-radio-group>
+                </el-form-item>
+            </el-form>
+            <template #footer>
+                <el-button hc-btn @click="dialogClose">取消</el-button>
+                <el-button hc-btn type="primary" :loading="submitLoading" @click="dialogSubmit">提交</el-button>
+            </template>
+        </hc-new-dialog>
+
+        <!-- 字典配置 -->
+        <HcChildDictbiz v-model="isConfigDialog" :info="dictTableRow" @close="dictTableClose" />
+    </hc-new-card>
+</template>
+
+<script setup>
+import { nextTick, onActivated, ref } from 'vue'
+import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import HcChildDictbiz from './modules/dictbiz/dictbiz.vue'
+import { delMessage } from '~uti/tools'
+import mainApi from '~api/system/dictbiz'
+
+//激活
+onActivated(() => {
+    searchForm.value.current = 1
+    getTableData()
+})
+
+//搜索表单
+const searchType = ref('code')
+const searchName = ref('')
+const searchForm = ref({ current: 1, size: 30, total: 0 })
+
+//搜索
+const searchClick = () => {
+    searchForm.value.current = 1
+    getTableData()
+}
+
+//分页
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+//表格数据
+const tableRef = ref(null)
+const tableColumn = ref([
+    { key: 'code', name: '字典编号' },
+    { key: 'dictValue', name: '字典名称' },
+    { key: 'isSealed', name: '封存', width: 80 },
+    { key: 'remark', name: '字典备注' },
+    { key: 'action', name: '操作', width: 120, align: 'center' },
+])
+
+//获取表格数据
+const tableLoading = ref(false)
+const tableData = ref([{}])
+const getTableData = async () => {
+    tableData.value = []
+    tableLoading.value = true
+    const form = {
+        ...searchForm.value,
+        total: null,
+    }
+    if (searchName.value) {
+        form[searchType.value] = searchName.value
+    }
+    const { error, code, data } = await mainApi.page(form)
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data['records'])
+        searchForm.value.total = data['total']
+    } else {
+        tableData.value = []
+        searchForm.value.total = 0
+    }
+}
+
+//表格被选择
+const tableCheckKeys = ref([])
+const tableCheckChange = (rows) => {
+    tableCheckKeys.value = rows
+}
+
+//新增/修改 弹窗
+const isDialogShow = ref(false)
+const dialogTitle = ref('')
+
+//菜单表单
+const formRef = ref(null)
+const formModel = ref({})
+const formRules = {
+    code: {
+        required: true,
+        trigger: 'blur',
+        message: '请输入字典编号',
+    },
+    dictValue: {
+        required: true,
+        trigger: 'blur',
+        message: '请输入字典名称',
+    },
+    sort: {
+        required: true,
+        trigger: 'blur',
+        message: '请输入字典排序',
+    },
+    isSealed: {
+        required: true,
+        trigger: 'blur',
+        message: '请选择字典封存',
+    },
+}
+
+//新增
+const addClick = () => {
+    dialogTitle.value = '新增业务字典'
+    formModel.value = { sort: 1, isSealed: 0 }
+    //显示表单弹窗
+    nextTick(() => {
+        isDialogShow.value = true
+    })
+}
+
+//修改菜单
+const editRowClick = (row) => {
+    formModel.value = {}
+    dialogTitle.value = '修改业务字典'
+    formModel.value = { ...row }
+    //显示表单弹窗
+    nextTick(() => {
+        isDialogShow.value = true
+    })
+}
+
+//删除菜单
+const delRowClick = (row) => {
+    delMessage(async () => {
+        const { code, msg } = await mainApi.del(row.id)
+        if (code === 200) {
+            window.$message.success('删除成功')
+            getTableData().then()
+        } else {
+            window.$message.error(msg ?? '删除失败')
+        }
+    })
+}
+
+//批量删除菜单
+const delClick = () => {
+    const rows = tableCheckKeys.value
+    if (rows.length <= 0) {
+        window.$message.warning('请选择要删除的菜单')
+        return false
+    }
+    //确认删除菜单
+    delMessage(async () => {
+        const ids = arrToId(rows)
+        const { code, msg } = await mainApi.del(ids)
+        if (code === 200) {
+            window.$message.success('删除成功')
+            getTableData().then()
+        } else {
+            window.$message.error(msg ?? '删除失败')
+        }
+    })
+}
+
+//提交表单
+const submitLoading = ref(false)
+const dialogSubmit = async () => {
+    const formRes = await formValidate(formRef.value)
+    if (!formRes) return false
+    submitLoading.value = true
+    //发起请求
+    const { error, code, msg } = await mainApi.submit(formModel.value)
+    if (!error && code === 200) {
+        submitLoading.value = false
+        dialogClose()
+        window?.$message?.success('操作成功')
+        getTableData().then()
+    } else {
+        window?.$message?.error(msg ?? '操作失败')
+    }
+}
+
+//关闭弹窗
+const dialogClose = () => {
+    isDialogShow.value = false
+    submitLoading.value = false
+    formModel.value = {}
+}
+
+//字典配置
+const isConfigDialog = ref(false)
+const dictTableRow = ref({})
+const handleRowClick = (row) => {
+    dictTableRow.value = row
+    nextTick(() => {
+        isConfigDialog.value = true
+    })
+}
+
+//关闭字典配置弹窗
+const dictTableClose = () => {
+    isConfigDialog.value = false
+}
+</script>

+ 285 - 0
src/views/system/modules/dict/dict.vue

@@ -0,0 +1,285 @@
+<template>
+    <hc-new-dialog v-model="isShow" widths="800px" is-table :footer="false" :is-close="false">
+        <template #header>
+            <div class="hc-flex">
+                <div class="hc-flex flex-1">
+                    <div class="w-32">
+                        <el-select v-model="searchType" placeholder="选择搜索类型" filterable block>
+                            <el-option label="字典编号" value="code" />
+                            <el-option label="字典名称" value="dictValue" />
+                        </el-select>
+                    </div>
+                    <div class="ml-2 w-60">
+                        <hc-search-input v-model="searchName" placeholder="请输入关键词" @search="getTableData" />
+                    </div>
+                </div>
+                <div class="hc-flex">
+                    <el-button hc-btn type="primary" @click="addClick">新增</el-button>
+                    <el-button hc-btn type="danger" @click="delClick">删除</el-button>
+                    <el-button hc-btn @click="configDialogClose">关闭</el-button>
+                </div>
+            </div>
+        </template>
+        <hc-table
+            ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
+            is-new is-check :check-style="{ width: 29 }" :index-style="{ width: 60 }"
+            @selection-change="tableCheckChange"
+        >
+            <template #isSealed="{ row }">
+                {{ row.isSealed === 1 ? '是' : '否' }}
+            </template>
+            <template #action="{ row }">
+                <el-link type="warning" @click="editRowClick(row)">修改</el-link>
+                <el-link type="danger" @click="delRowClick(row)">删除</el-link>
+            </template>
+        </hc-table>
+    </hc-new-dialog>
+
+    <!-- 新增/修改 -->
+    <hc-new-dialog v-model="isDialogShow" widths="550px" is-footer-center :title="dialogTitle" @close="dialogClose">
+        <el-form ref="formRef" :model="formModel" :rules="formRules" label-position="top" label-width="auto">
+            <el-row :gutter="20">
+                <el-col :span="12">
+                    <el-form-item label="字典编号:">
+                        <el-input v-model="dictInfo.code" disabled />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="上级字典:">
+                        <el-input v-model="dictInfo.dictValue" disabled />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="字典名称:" prop="dictValue">
+                        <el-input v-model="formModel.dictValue" clearable placeholder="请输入字典名称" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="字典键值:" prop="dictKey">
+                        <el-input v-model="formModel.dictKey" clearable placeholder="请输入字典键值" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="字典备注:">
+                        <el-input v-model="formModel.remark" clearable placeholder="请输入字典备注" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="字典排序:" prop="sort">
+                        <el-input-number v-model="formModel.sort" :min="1" block controls-position="right" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="字典封存:" prop="isSealed">
+                        <el-radio-group v-model="formModel.isSealed">
+                            <el-radio :label="1">是</el-radio>
+                            <el-radio :label="0">否</el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+        <template #footer>
+            <el-button hc-btn @click="dialogClose">取消</el-button>
+            <el-button hc-btn type="primary" :loading="submitLoading" @click="dialogSubmit">提交</el-button>
+        </template>
+    </hc-new-dialog>
+</template>
+
+<script setup>
+import { nextTick, ref, watch } from 'vue'
+import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import { delMessage } from '~uti/tools'
+import mainApi from '~api/system/dict'
+
+const props = defineProps({
+    info: {
+        type: Object,
+        default: () => ({}),
+    },
+})
+
+//事件
+const emit = defineEmits(['close'])
+
+//双向绑定
+// eslint-disable-next-line no-undef
+const isShow = defineModel('modelValue', {
+    default: false,
+})
+
+//搜索表单
+const searchType = ref('code')
+const searchName = ref('')
+
+//监听可否编辑
+const dictInfo = ref(props.info)
+watch(() => props.info, (data) => {
+    dictInfo.value = data
+}, { immediate: true, deep: true })
+
+//监听显示
+watch(isShow, (val) => {
+    if (val) {
+        getTableData()
+    }
+})
+
+//表格数据
+const tableRef = ref(null)
+const tableColumn = ref([
+    { key: 'code', name: '字典编号' },
+    { key: 'dictValue', name: '字典名称' },
+    { key: 'dictKey', name: '字典键值' },
+    { key: 'isSealed', name: '封存', width: 80 },
+    { key: 'remark', name: '字典备注' },
+    { key: 'action', name: '操作', width: 100, align: 'center' },
+])
+
+//获取表格数据
+const tableLoading = ref(false)
+const tableData = ref([])
+const getTableData = async () => {
+    tableData.value = []
+    tableLoading.value = true
+    const form = {
+        current: 1,
+        size: 200,
+        parentId: dictInfo.value.id,
+    }
+    if (searchName.value) {
+        form[searchType.value] = searchName.value
+    }
+    const { error, code, data } = await mainApi.getChildList(form)
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data)
+    } else {
+        tableData.value = []
+    }
+}
+
+//表格被选择
+const tableCheckKeys = ref([])
+const tableCheckChange = (rows) => {
+    tableCheckKeys.value = rows
+}
+
+//新增/修改 弹窗
+const isDialogShow = ref(false)
+const dialogTitle = ref('')
+
+//菜单表单
+const formRef = ref(null)
+const formModel = ref({})
+const formRules = {
+    dictValue: {
+        required: true,
+        trigger: 'blur',
+        message: '请输入字典名称',
+    },
+    dictKey: {
+        required: true,
+        trigger: 'blur',
+        message: '请输入字典键值',
+    },
+    sort: {
+        required: true,
+        trigger: 'blur',
+        message: '请输入字典排序',
+    },
+    isSealed: {
+        required: true,
+        trigger: 'blur',
+        message: '请选择字典封存',
+    },
+}
+
+//新增
+const addClick = () => {
+    dialogTitle.value = '新增系统字典配置'
+    const { id, code } = dictInfo.value
+    formModel.value = { sort: 1, isSealed: 0, code: code, parentId: id }
+    //显示表单弹窗
+    nextTick(() => {
+        isDialogShow.value = true
+    })
+}
+
+//修改菜单
+const editRowClick = (row) => {
+    formModel.value = {}
+    dialogTitle.value = '修改系统字典配置'
+    formModel.value = { ...row }
+    //显示表单弹窗
+    nextTick(() => {
+        isDialogShow.value = true
+    })
+}
+
+//删除菜单
+const delRowClick = (row) => {
+    delMessage(async () => {
+        const { code, msg } = await mainApi.del(row.id)
+        if (code === 200) {
+            window.$message.success('删除成功')
+            getTableData().then()
+        } else {
+            window.$message.error(msg ?? '删除失败')
+        }
+    })
+}
+
+//批量删除菜单
+const delClick = () => {
+    const rows = tableCheckKeys.value
+    if (rows.length <= 0) {
+        window.$message.warning('请选择要删除的菜单')
+        return false
+    }
+    //确认删除菜单
+    delMessage(async () => {
+        const ids = arrToId(rows)
+        const { code, msg } = await mainApi.del(ids)
+        if (code === 200) {
+            window.$message.success('删除成功')
+            getTableData().then()
+        } else {
+            window.$message.error(msg ?? '删除失败')
+        }
+    })
+}
+
+//提交表单
+const submitLoading = ref(false)
+const dialogSubmit = async () => {
+    const formRes = await formValidate(formRef.value)
+    if (!formRes) return false
+    submitLoading.value = true
+    //发起请求
+    const { error, code, msg } = await mainApi.submit(formModel.value)
+    if (!error && code === 200) {
+        submitLoading.value = false
+        dialogClose()
+        window?.$message?.success('操作成功')
+        getTableData().then()
+    } else {
+        window?.$message?.error(msg ?? '操作失败')
+    }
+}
+
+//关闭弹窗
+const dialogClose = () => {
+    isDialogShow.value = false
+    submitLoading.value = false
+    formModel.value = {}
+}
+
+//关闭字典配置弹窗
+const configDialogClose = () => {
+    isShow.value = false
+    dictInfo.value = {}
+    tableData.value = []
+    emit('close')
+}
+</script>

+ 285 - 0
src/views/system/modules/dictbiz/dictbiz.vue

@@ -0,0 +1,285 @@
+<template>
+    <hc-new-dialog v-model="isShow" widths="800px" is-table :footer="false" :is-close="false">
+        <template #header>
+            <div class="hc-flex">
+                <div class="hc-flex flex-1">
+                    <div class="w-32">
+                        <el-select v-model="searchType" placeholder="选择搜索类型" filterable block>
+                            <el-option label="字典编号" value="code" />
+                            <el-option label="字典名称" value="dictValue" />
+                        </el-select>
+                    </div>
+                    <div class="ml-2 w-60">
+                        <hc-search-input v-model="searchName" placeholder="请输入关键词" @search="getTableData" />
+                    </div>
+                </div>
+                <div class="hc-flex">
+                    <el-button hc-btn type="primary" @click="addClick">新增</el-button>
+                    <el-button hc-btn type="danger" @click="delClick">删除</el-button>
+                    <el-button hc-btn @click="configDialogClose">关闭</el-button>
+                </div>
+            </div>
+        </template>
+        <hc-table
+            ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
+            is-new is-check :check-style="{ width: 29 }" :index-style="{ width: 60 }"
+            @selection-change="tableCheckChange"
+        >
+            <template #isSealed="{ row }">
+                {{ row.isSealed === 1 ? '是' : '否' }}
+            </template>
+            <template #action="{ row }">
+                <el-link type="warning" @click="editRowClick(row)">修改</el-link>
+                <el-link type="danger" @click="delRowClick(row)">删除</el-link>
+            </template>
+        </hc-table>
+    </hc-new-dialog>
+
+    <!-- 新增/修改 -->
+    <hc-new-dialog v-model="isDialogShow" widths="550px" is-footer-center :title="dialogTitle" @close="dialogClose">
+        <el-form ref="formRef" :model="formModel" :rules="formRules" label-position="top" label-width="auto">
+            <el-row :gutter="20">
+                <el-col :span="12">
+                    <el-form-item label="字典编号:">
+                        <el-input v-model="dictInfo.code" disabled />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="上级字典:">
+                        <el-input v-model="dictInfo.dictValue" disabled />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="字典名称:" prop="dictValue">
+                        <el-input v-model="formModel.dictValue" clearable placeholder="请输入字典名称" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="字典键值:" prop="dictKey">
+                        <el-input v-model="formModel.dictKey" clearable placeholder="请输入字典键值" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="字典备注:">
+                        <el-input v-model="formModel.remark" clearable placeholder="请输入字典备注" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="字典排序:" prop="sort">
+                        <el-input-number v-model="formModel.sort" :min="1" block controls-position="right" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="字典封存:" prop="isSealed">
+                        <el-radio-group v-model="formModel.isSealed">
+                            <el-radio :label="1">是</el-radio>
+                            <el-radio :label="0">否</el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+        <template #footer>
+            <el-button hc-btn @click="dialogClose">取消</el-button>
+            <el-button hc-btn type="primary" :loading="submitLoading" @click="dialogSubmit">提交</el-button>
+        </template>
+    </hc-new-dialog>
+</template>
+
+<script setup>
+import { nextTick, ref, watch } from 'vue'
+import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import { delMessage } from '~uti/tools'
+import mainApi from '~api/system/dictbiz'
+
+const props = defineProps({
+    info: {
+        type: Object,
+        default: () => ({}),
+    },
+})
+
+//事件
+const emit = defineEmits(['close'])
+
+//双向绑定
+// eslint-disable-next-line no-undef
+const isShow = defineModel('modelValue', {
+    default: false,
+})
+
+//搜索表单
+const searchType = ref('code')
+const searchName = ref('')
+
+//监听可否编辑
+const dictInfo = ref(props.info)
+watch(() => props.info, (data) => {
+    dictInfo.value = data
+}, { immediate: true, deep: true })
+
+//监听显示
+watch(isShow, (val) => {
+    if (val) {
+        getTableData()
+    }
+})
+
+//表格数据
+const tableRef = ref(null)
+const tableColumn = ref([
+    { key: 'code', name: '字典编号' },
+    { key: 'dictValue', name: '字典名称' },
+    { key: 'dictKey', name: '字典键值' },
+    { key: 'isSealed', name: '封存', width: 80 },
+    { key: 'remark', name: '字典备注' },
+    { key: 'action', name: '操作', width: 100, align: 'center' },
+])
+
+//获取表格数据
+const tableLoading = ref(false)
+const tableData = ref([])
+const getTableData = async () => {
+    tableData.value = []
+    tableLoading.value = true
+    const form = {
+        current: 1,
+        size: 200,
+        parentId: dictInfo.value.id,
+    }
+    if (searchName.value) {
+        form[searchType.value] = searchName.value
+    }
+    const { error, code, data } = await mainApi.getChildList(form)
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data)
+    } else {
+        tableData.value = []
+    }
+}
+
+//表格被选择
+const tableCheckKeys = ref([])
+const tableCheckChange = (rows) => {
+    tableCheckKeys.value = rows
+}
+
+//新增/修改 弹窗
+const isDialogShow = ref(false)
+const dialogTitle = ref('')
+
+//菜单表单
+const formRef = ref(null)
+const formModel = ref({})
+const formRules = {
+    dictValue: {
+        required: true,
+        trigger: 'blur',
+        message: '请输入字典名称',
+    },
+    dictKey: {
+        required: true,
+        trigger: 'blur',
+        message: '请输入字典键值',
+    },
+    sort: {
+        required: true,
+        trigger: 'blur',
+        message: '请输入字典排序',
+    },
+    isSealed: {
+        required: true,
+        trigger: 'blur',
+        message: '请选择字典封存',
+    },
+}
+
+//新增
+const addClick = () => {
+    dialogTitle.value = '新增业务字典配置'
+    const { id, code } = dictInfo.value
+    formModel.value = { sort: 1, isSealed: 0, code: code, parentId: id }
+    //显示表单弹窗
+    nextTick(() => {
+        isDialogShow.value = true
+    })
+}
+
+//修改菜单
+const editRowClick = (row) => {
+    formModel.value = {}
+    dialogTitle.value = '修改业务字典配置'
+    formModel.value = { ...row }
+    //显示表单弹窗
+    nextTick(() => {
+        isDialogShow.value = true
+    })
+}
+
+//删除菜单
+const delRowClick = (row) => {
+    delMessage(async () => {
+        const { code, msg } = await mainApi.del(row.id)
+        if (code === 200) {
+            window.$message.success('删除成功')
+            getTableData().then()
+        } else {
+            window.$message.error(msg ?? '删除失败')
+        }
+    })
+}
+
+//批量删除菜单
+const delClick = () => {
+    const rows = tableCheckKeys.value
+    if (rows.length <= 0) {
+        window.$message.warning('请选择要删除的菜单')
+        return false
+    }
+    //确认删除菜单
+    delMessage(async () => {
+        const ids = arrToId(rows)
+        const { code, msg } = await mainApi.del(ids)
+        if (code === 200) {
+            window.$message.success('删除成功')
+            getTableData().then()
+        } else {
+            window.$message.error(msg ?? '删除失败')
+        }
+    })
+}
+
+//提交表单
+const submitLoading = ref(false)
+const dialogSubmit = async () => {
+    const formRes = await formValidate(formRef.value)
+    if (!formRes) return false
+    submitLoading.value = true
+    //发起请求
+    const { error, code, msg } = await mainApi.submit(formModel.value)
+    if (!error && code === 200) {
+        submitLoading.value = false
+        dialogClose()
+        window?.$message?.success('操作成功')
+        getTableData().then()
+    } else {
+        window?.$message?.error(msg ?? '操作失败')
+    }
+}
+
+//关闭弹窗
+const dialogClose = () => {
+    isDialogShow.value = false
+    submitLoading.value = false
+    formModel.value = {}
+}
+
+//关闭字典配置弹窗
+const configDialogClose = () => {
+    isShow.value = false
+    dictInfo.value = {}
+    tableData.value = []
+    emit('close')
+}
+</script>