From 324c9f04910abf36def0b1c435e7266e782bb268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=BA=A2=E4=B8=BD?= <1181930680@qq.com> Date: Sat, 23 Nov 2024 15:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=AE=A1=E7=90=86=E3=80=81?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/data/notice/columns.ts | 67 +++++++++ src/views/data/notice/edit.vue | 157 ++++++++++++++++++++ src/views/data/notice/index.vue | 198 +++++++++++++++++++++++++ src/views/data/notice/querySchemas.ts | 49 +++++++ src/views/data/param/columns.ts | 83 +++++++++++ src/views/data/param/edit.vue | 169 ++++++++++++++++++++++ src/views/data/param/index.vue | 199 ++++++++++++++++++++++++++ src/views/data/param/querySchemas.ts | 49 +++++++ 8 files changed, 971 insertions(+) create mode 100644 src/views/data/notice/columns.ts create mode 100644 src/views/data/notice/edit.vue create mode 100644 src/views/data/notice/index.vue create mode 100644 src/views/data/notice/querySchemas.ts create mode 100644 src/views/data/param/columns.ts create mode 100644 src/views/data/param/edit.vue create mode 100644 src/views/data/param/index.vue create mode 100644 src/views/data/param/querySchemas.ts diff --git a/src/views/data/notice/columns.ts b/src/views/data/notice/columns.ts new file mode 100644 index 0000000..ba61199 --- /dev/null +++ b/src/views/data/notice/columns.ts @@ -0,0 +1,67 @@ +import { h } from 'vue'; +import { NTag } from 'naive-ui'; +export const columns = [ + { + type: 'selection', + width: 50, + fixed: 'left', + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '标题', + key: 'title', + width: 300, + }, + { + title: '类型', + key: 'type', + width: 100, + render(record) { + return h( + NTag, + { + type: record.type == 1 ? 'processing' : 'success', + }, + { + default: () => (record.type == 1 ? '通知' : '公告'), + }, + ); + }, + }, + { + title: '状态', + key: 'status', + width: 100, + render(record) { + return h( + NTag, + { + type: record.status == 1 ? 'success' : 'error', + }, + { + default: () => (record.status == 1 ? '正常' : '禁用'), + }, + ); + }, + }, + { + title: '点击率', + key: 'clickNum', + width: 100, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/data/notice/edit.vue b/src/views/data/notice/edit.vue new file mode 100644 index 0000000..3d25693 --- /dev/null +++ b/src/views/data/notice/edit.vue @@ -0,0 +1,157 @@ + + diff --git a/src/views/data/notice/index.vue b/src/views/data/notice/index.vue new file mode 100644 index 0000000..5d10724 --- /dev/null +++ b/src/views/data/notice/index.vue @@ -0,0 +1,198 @@ + + + + + diff --git a/src/views/data/notice/querySchemas.ts b/src/views/data/notice/querySchemas.ts new file mode 100644 index 0000000..2df570d --- /dev/null +++ b/src/views/data/notice/querySchemas.ts @@ -0,0 +1,49 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'title', + component: 'NInput', + label: '标题', + componentProps: { + placeholder: '请输入标题', + }, + }, + { + field: 'type', + component: 'NSelect', + label: '类型', + componentProps: { + placeholder: '请选择类型', + clearable: true, + options: [ + { + label: '通知', + value: '1', + }, + { + label: '公告', + value: '2', + }, + ], + }, + }, + { + field: 'status', + component: 'NSelect', + label: '状态', + componentProps: { + placeholder: '请选择状态', + clearable: true, + options: [ + { + label: '正常', + value: '1', + }, + { + label: '关闭', + value: '2', + }, + ], + }, + }, +]; diff --git a/src/views/data/param/columns.ts b/src/views/data/param/columns.ts new file mode 100644 index 0000000..5ba3a99 --- /dev/null +++ b/src/views/data/param/columns.ts @@ -0,0 +1,83 @@ +import { h } from 'vue'; +import { NTag } from 'naive-ui'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed: 'left', + }, + { + title: 'ID', + key: 'id', + width: 50, + fixed: 'left', + }, + { + title: '参数名称', + key: 'name', + width: 200, + }, + { + title: '参数编码', + key: 'code', + width: 250, + }, + { + title: '参数值', + key: 'value', + width: 200, + }, + { + title: '参数类型', + key: 'type', + width: 100, + render(record) { + return h( + NTag, + { + type: record.type == 0 ? 'processing' : 'warning', + }, + { + default: () => (record.type == 0 ? '系统' : '业务'), + }, + ); + }, + }, + { + title: '参数状态', + key: 'status', + width: 100, + render(record) { + return h( + NTag, + { + type: record.status == 1 ? 'success' : 'error', + }, + { + default: () => (record.status == 1 ? '正常' : '禁用'), + }, + ); + }, + }, + { + title: '排序', + key: 'sort', + width: 100, + }, + { + title: '备注', + key: 'note', + width: 150, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/data/param/edit.vue b/src/views/data/param/edit.vue new file mode 100644 index 0000000..63c9548 --- /dev/null +++ b/src/views/data/param/edit.vue @@ -0,0 +1,169 @@ + + diff --git a/src/views/data/param/index.vue b/src/views/data/param/index.vue new file mode 100644 index 0000000..e9d223b --- /dev/null +++ b/src/views/data/param/index.vue @@ -0,0 +1,199 @@ + + + + + diff --git a/src/views/data/param/querySchemas.ts b/src/views/data/param/querySchemas.ts new file mode 100644 index 0000000..702cf01 --- /dev/null +++ b/src/views/data/param/querySchemas.ts @@ -0,0 +1,49 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'name', + component: 'NInput', + label: '参数名称', + componentProps: { + placeholder: '请输入参数名称', + }, + }, + { + field: 'type', + component: 'NSelect', + label: '参数类型', + componentProps: { + placeholder: '请选择参数类型', + clearable: true, + options: [ + { + label: '系统', + value: '0', + }, + { + label: '业务', + value: '1', + }, + ], + }, + }, + { + field: 'status', + component: 'NSelect', + label: '参数状态', + componentProps: { + placeholder: '请选择状态', + clearable: true, + options: [ + { + label: '正常', + value: '1', + }, + { + label: '禁用', + value: '2', + }, + ], + }, + }, +];