From 3b383cdb3b566afb59ec5d12c97221274f47eca6 Mon Sep 17 00:00:00 2001 From: zjl Date: Wed, 11 Dec 2024 16:53:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AD=97=E5=85=B8=E3=80=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E3=80=81=E5=8F=82=E6=95=B0=E3=80=81=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E3=80=81=E8=A1=8C=E6=94=BF=E5=8C=BA=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/data/city/index.vue | 6 ++--- src/views/data/config/configItem.vue | 4 +++ src/views/data/config/edit.vue | 9 ++++++- src/views/data/config/editItem.vue | 10 ++++++- src/views/data/config/index.vue | 1 - src/views/data/dict/dictItem.vue | 9 +++---- src/views/data/dict/edit.vue | 8 +++++- src/views/data/dict/editItem.vue | 6 +++-- src/views/data/dict/index.vue | 1 - src/views/data/message/columns.ts | 2 +- src/views/data/message/edit.vue | 6 ++++- src/views/data/message/index.vue | 40 +++++++++++++++++++++++----- src/views/data/param/edit.vue | 26 +++++++++++++----- src/views/data/param/index.vue | 40 +++++++++++++++++++++------- 14 files changed, 128 insertions(+), 40 deletions(-) diff --git a/src/views/data/city/index.vue b/src/views/data/city/index.vue index 784da0c..bb9214f 100644 --- a/src/views/data/city/index.vue +++ b/src/views/data/city/index.vue @@ -53,13 +53,13 @@ { title: '城市名称', key: 'name', - width: 100, + width: 250, align: 'left', }, { title: '城市拼音', key: 'pinyin', - width: 100, + width: 150, }, { title: '城市级别', @@ -97,7 +97,7 @@ { title: '行政编码', key: 'areaCode', - width: 100, + width: 150, }, { title: '城市邮编', diff --git a/src/views/data/config/configItem.vue b/src/views/data/config/configItem.vue index f4b4b76..93408ef 100644 --- a/src/views/data/config/configItem.vue +++ b/src/views/data/config/configItem.vue @@ -97,6 +97,10 @@ } }, ); + + /** + * 定义操作栏 + */ const actionColumn = reactive({ width: 200, title: '操作', diff --git a/src/views/data/config/edit.vue b/src/views/data/config/edit.vue index 4915f29..33daefa 100644 --- a/src/views/data/config/edit.vue +++ b/src/views/data/config/edit.vue @@ -88,11 +88,15 @@ }, }); + /** + * 定义模态 + */ const [modalRegister, { openModal, setSubLoading }] = useModal({ title: props.configId ? '编辑配置' : '添加配置', subBtuText: '确定', width: 600, }); + /** * 执行提交表单 */ @@ -139,7 +143,10 @@ setFormData(); } }); - //导出方法 + + /** + * 定义函数 + */ defineExpose({ openModal, }); diff --git a/src/views/data/config/editItem.vue b/src/views/data/config/editItem.vue index 5a2ca0a..f8e67fd 100644 --- a/src/views/data/config/editItem.vue +++ b/src/views/data/config/editItem.vue @@ -270,11 +270,16 @@ }); const fwbHeight = document.body.clientHeight - 400; const optionsData = ref([]); + + /** + * 定义模态 + */ const [modalRegister, { openModal, setProps, setSubLoading }] = useModal({ title: props.configItemId ? '编辑配置项' : '新增配置项', subBtuText: '确定', width: 600, }); + /** * 定义类型数据 */ @@ -544,7 +549,10 @@ setFormData(); } }); - //导出方法 + + /** + * 定义函数 + */ defineExpose({ openModal, }); diff --git a/src/views/data/config/index.vue b/src/views/data/config/index.vue index 9208604..b5c60ef 100644 --- a/src/views/data/config/index.vue +++ b/src/views/data/config/index.vue @@ -101,7 +101,6 @@ import { PlusOutlined, FormOutlined, DeleteOutlined, SearchOutlined } from '@vicons/antd'; import editDialog from './edit.vue'; import configItem from './configItem.vue'; - import { basicModal, useModal } from '@/components/Modal'; import { useMessage, useDialog } from 'naive-ui'; /** diff --git a/src/views/data/dict/dictItem.vue b/src/views/data/dict/dictItem.vue index a765193..e5878ed 100644 --- a/src/views/data/dict/dictItem.vue +++ b/src/views/data/dict/dictItem.vue @@ -18,20 +18,17 @@ /> 查询 新建 删除 diff --git a/src/views/data/dict/edit.vue b/src/views/data/dict/edit.vue index 4049d35..557e7e8 100644 --- a/src/views/data/dict/edit.vue +++ b/src/views/data/dict/edit.vue @@ -88,6 +88,9 @@ }, }); + /** + * 定义模态 + */ const [modalRegister, { openModal, setSubLoading }] = useModal({ title: props.dictId ? '编辑字典' : '添加字典', subBtuText: '确定', @@ -139,7 +142,10 @@ setFormData(); } }); - //导出方法 + + /** + * 定义函数 + */ defineExpose({ openModal, }); diff --git a/src/views/data/dict/editItem.vue b/src/views/data/dict/editItem.vue index 11f0c75..1da7643 100644 --- a/src/views/data/dict/editItem.vue +++ b/src/views/data/dict/editItem.vue @@ -54,7 +54,6 @@ import { onMounted, ref, reactive, nextTick } from 'vue'; import { useMessage } from 'naive-ui'; import { useModal } from '@/components/Modal'; - import { renderIcon } from '@/utils'; /** * 定义接收的参数 @@ -233,7 +232,10 @@ setFormData(); } }); - //导出方法 + + /** + * 定义函数 + */ defineExpose({ openModal, }); diff --git a/src/views/data/dict/index.vue b/src/views/data/dict/index.vue index 1f39d4b..0b04dad 100644 --- a/src/views/data/dict/index.vue +++ b/src/views/data/dict/index.vue @@ -101,7 +101,6 @@ import { PlusOutlined, FormOutlined, DeleteOutlined, SearchOutlined } from '@vicons/antd'; import editDialog from './edit.vue'; import dictItem from './dictItem.vue'; - import { basicModal, useModal } from '@/components/Modal'; import { useMessage, useDialog } from 'naive-ui'; /** diff --git a/src/views/data/message/columns.ts b/src/views/data/message/columns.ts index 15e0aac..446dbe4 100644 --- a/src/views/data/message/columns.ts +++ b/src/views/data/message/columns.ts @@ -15,7 +15,7 @@ export const columns = [ { title: '消息标题', key: 'title', - width: 100, + width: 250, }, { title: '消息类型', diff --git a/src/views/data/message/edit.vue b/src/views/data/message/edit.vue index 5d20e17..b14a4ab 100644 --- a/src/views/data/message/edit.vue +++ b/src/views/data/message/edit.vue @@ -76,6 +76,7 @@ const data = await getMessageDetail(props.messageId); formData.value = data; }; + /** * 获取类型描述 * @param type 类型 @@ -106,7 +107,10 @@ setFormData(); } }); - //导出方法 + + /** + * 定义函数 + */ defineExpose({ openModal, }); diff --git a/src/views/data/message/index.vue b/src/views/data/message/index.vue index 9941fe1..ea5b632 100644 --- a/src/views/data/message/index.vue +++ b/src/views/data/message/index.vue @@ -54,10 +54,12 @@ import { columns } from './columns'; import { DeleteOutlined, EyeOutlined } from '@vicons/antd'; import editDialog from './edit.vue'; - import { basicModal, useModal } from '@/components/Modal'; import { schemas } from './querySchemas'; import { renderIcon } from '@/utils'; + /** + * 定义参数 + */ const message = useMessage(); const dialog = useDialog(); const basicTableRef = ref(); @@ -65,8 +67,11 @@ const editVisible = ref(false); const messageId = ref(0); const rowKeys = ref([]); - const showModal = ref(false); + + /** + * 定义查询参数 + */ const formParams = reactive({ title: '', bizType: '', @@ -74,6 +79,9 @@ status: '', }); + /** + * 定义操作栏 + */ const actionColumn = reactive({ width: 200, title: '操作', @@ -103,24 +111,36 @@ }, }); - function addTable() { - showModal.value = true; - } - + /** + * 加载数据列表 + * @param res 参数 + */ const loadDataTable = async (res) => { rowKeys.value = []; const result = await getMessageList({ ...formParams, ...res }); return result; }; + /** + * 数据行选中事件 + * @param keys 参数 + */ function onCheckedRow(keys) { rowKeys.value = keys; } + /** + * 刷新数据列表 + * @param noRefresh 参数 + */ function reloadTable(noRefresh = '') { basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); } + /** + * 执行提交表单 + * @param values 参数 + */ function handleSubmit(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -131,6 +151,10 @@ reloadTable(); } + /** + * 执行重置 + * @param values 参数 + */ function handleReset(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -141,6 +165,9 @@ reloadTable(); } + /** + * 执行注册 + */ const [register, {}] = useForm({ gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' }, labelWidth: 80, @@ -156,6 +183,7 @@ await nextTick(); createModalRef.value.openModal(); } + /** * 执行删除 * @param id 参数 diff --git a/src/views/data/param/edit.vue b/src/views/data/param/edit.vue index 63c9548..64c0007 100644 --- a/src/views/data/param/edit.vue +++ b/src/views/data/param/edit.vue @@ -83,7 +83,7 @@ const formData = reactive({ id: '', name: '', - type: undefined, + type: 0, code: '', value: '', status: 1, @@ -106,17 +106,26 @@ default: 0, }, }); - const [modalRegister, { openModal, setSubLoading }] = useModal({ - title: props.paramId ? '编辑参数' : '添加参数', - subBtuText: '确定', - width: 600, - }); + + /** + * 定义参数类型选项 + */ const optionData = { typeList: [ { label: '系统', value: 0 }, { label: '业务', value: 1 }, ], }; + + /** + * 定义模态 + */ + const [modalRegister, { openModal, setSubLoading }] = useModal({ + title: props.paramId ? '编辑参数' : '添加参数', + subBtuText: '确定', + width: 600, + }); + /** * 执行提交 */ @@ -162,7 +171,10 @@ setFormData(); } }); - //导出方法 + + /** + * 定义函数 + */ defineExpose({ openModal, }); diff --git a/src/views/data/param/index.vue b/src/views/data/param/index.vue index e9d223b..7f65870 100644 --- a/src/views/data/param/index.vue +++ b/src/views/data/param/index.vue @@ -27,7 +27,6 @@ 新建 - { rowKeys.value = []; const result = await getParamList({ ...formParams, ...res }); @@ -125,14 +126,26 @@ return result; }; + /** + * 数据行选中事件 + * @param keys 参数 + */ function onCheckedRow(keys) { rowKeys.value = keys; } + /** + * 刷新数据列表 + * @param noRefresh 参数 + */ function reloadTable(noRefresh = '') { basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); } + /** + * 执行提交表单 + * @param values 参数 + */ function handleSubmit(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -143,6 +156,10 @@ reloadTable(); } + /** + * 执行重置 + * @param values 参数 + */ function handleReset(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -153,6 +170,9 @@ reloadTable(); } + /** + * 执行注册 + */ const [register, {}] = useForm({ gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' }, labelWidth: 80, @@ -168,6 +188,7 @@ await nextTick(); createModalRef.value.openModal(); }; + /** * 执行编辑 */ @@ -177,6 +198,7 @@ await nextTick(); createModalRef.value.openModal(); } + /** * 执行删除 * @param id 参数