From 9c92f2289fc88117ccb845d545f21f2e5a6a3558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Tue, 3 Sep 2024 15:55:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=BD=E5=8A=9B=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/alitygroup/Alitygroup.api.ts | 72 ++++++ .../src/views/alitygroup/Alitygroup.data.ts | 71 ++++++ .../src/views/alitygroup/AlitygroupList.vue | 235 ++++++++++++++++++ .../alitygroup/Alitygroup_menu_insert.sql | 26 ++ .../alitygroup/components/AlitygroupForm.vue | 147 +++++++++++ .../alitygroup/components/AlitygroupModal.vue | 75 ++++++ 6 files changed, 626 insertions(+) create mode 100644 jeecgboot-vue3-master/src/views/alitygroup/Alitygroup.api.ts create mode 100644 jeecgboot-vue3-master/src/views/alitygroup/Alitygroup.data.ts create mode 100644 jeecgboot-vue3-master/src/views/alitygroup/AlitygroupList.vue create mode 100644 jeecgboot-vue3-master/src/views/alitygroup/Alitygroup_menu_insert.sql create mode 100644 jeecgboot-vue3-master/src/views/alitygroup/components/AlitygroupForm.vue create mode 100644 jeecgboot-vue3-master/src/views/alitygroup/components/AlitygroupModal.vue diff --git a/jeecgboot-vue3-master/src/views/alitygroup/Alitygroup.api.ts b/jeecgboot-vue3-master/src/views/alitygroup/Alitygroup.api.ts new file mode 100644 index 00000000..e43d90c0 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/alitygroup/Alitygroup.api.ts @@ -0,0 +1,72 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/alitygroup/alitygroup/list', + save='/alitygroup/alitygroup/add', + edit='/alitygroup/alitygroup/edit', + deleteOne = '/alitygroup/alitygroup/delete', + deleteBatch = '/alitygroup/alitygroup/deleteBatch', + importExcel = '/alitygroup/alitygroup/importExcel', + exportXls = '/alitygroup/alitygroup/exportXls', +} + +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; + +/** + * 列表接口 + * @param params + */ +export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 删除单个 + * @param params + * @param handleSuccess + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} + +/** + * 批量删除 + * @param params + * @param handleSuccess + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} + +/** + * 保存或者更新 + * @param params + * @param isUpdate + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url: url, params }, { isTransformResponse: false }); +} diff --git a/jeecgboot-vue3-master/src/views/alitygroup/Alitygroup.data.ts b/jeecgboot-vue3-master/src/views/alitygroup/Alitygroup.data.ts new file mode 100644 index 00000000..ad1fab94 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/alitygroup/Alitygroup.data.ts @@ -0,0 +1,71 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '小组名称', + align: "center", + dataIndex: 'groupname' + }, + { + title: '分组类型', + align: "center", + dataIndex: 'grouptype' + }, + { + title: '状态', + align: "center", + dataIndex: 'isopen', + customRender:({text}) => { + return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]); + }, + }, +]; + +//查询数据 +export const searchFormSchema: FormSchema[] = [ + { + label: "小组名称", + field: 'groupname', + component: 'Input', + colProps: {span: 6}, + }, +]; + +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '小组名称', + field: 'groupname', + component: 'Input', + }, + { + label: '分组类型', + field: 'grouptype', + component: 'Input', + }, + { + label: '能力', + field: 'alityid', + component: 'JSelectMultiple', + componentProps:{ + dictCode: "basicsskill,name,id" + }, + }, + { + label: '状态', + field: 'isopen', + component: 'JSwitch', + componentProps:{ + }, + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, +]; diff --git a/jeecgboot-vue3-master/src/views/alitygroup/AlitygroupList.vue b/jeecgboot-vue3-master/src/views/alitygroup/AlitygroupList.vue new file mode 100644 index 00000000..f5e94944 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/alitygroup/AlitygroupList.vue @@ -0,0 +1,235 @@ + + + + + diff --git a/jeecgboot-vue3-master/src/views/alitygroup/Alitygroup_menu_insert.sql b/jeecgboot-vue3-master/src/views/alitygroup/Alitygroup_menu_insert.sql new file mode 100644 index 00000000..0e4f00da --- /dev/null +++ b/jeecgboot-vue3-master/src/views/alitygroup/Alitygroup_menu_insert.sql @@ -0,0 +1,26 @@ +-- 注意:该页面对应的前台目录为views/alitygroup文件夹下 +-- 如果你想更改到其他目录,请修改sql中component字段对应的值 + + +INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) +VALUES ('2024082111595430120', NULL, '能力分组', '/alitygroup/alitygroupList', 'alitygroup/AlitygroupList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-08-21 11:59:12', NULL, NULL, 0); + +-- 权限控制sql +-- 新增 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024082111595430121', '2024082111595430120', '添加能力分组', NULL, NULL, 0, NULL, NULL, 2, 'alitygroup:alitygroup:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-21 11:59:12', NULL, NULL, 0, 0, '1', 0); +-- 编辑 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024082111595430122', '2024082111595430120', '编辑能力分组', NULL, NULL, 0, NULL, NULL, 2, 'alitygroup:alitygroup:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-21 11:59:12', NULL, NULL, 0, 0, '1', 0); +-- 删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024082111595430123', '2024082111595430120', '删除能力分组', NULL, NULL, 0, NULL, NULL, 2, 'alitygroup:alitygroup:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-21 11:59:12', NULL, NULL, 0, 0, '1', 0); +-- 批量删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024082111595430124', '2024082111595430120', '批量删除能力分组', NULL, NULL, 0, NULL, NULL, 2, 'alitygroup:alitygroup:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-21 11:59:12', NULL, NULL, 0, 0, '1', 0); +-- 导出excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024082111595430125', '2024082111595430120', '导出excel_能力分组', NULL, NULL, 0, NULL, NULL, 2, 'alitygroup:alitygroup:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-21 11:59:12', NULL, NULL, 0, 0, '1', 0); +-- 导入excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024082111595430126', '2024082111595430120', '导入excel_能力分组', NULL, NULL, 0, NULL, NULL, 2, 'alitygroup:alitygroup:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-21 11:59:12', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/jeecgboot-vue3-master/src/views/alitygroup/components/AlitygroupForm.vue b/jeecgboot-vue3-master/src/views/alitygroup/components/AlitygroupForm.vue new file mode 100644 index 00000000..ec8da7b8 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/alitygroup/components/AlitygroupForm.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/jeecgboot-vue3-master/src/views/alitygroup/components/AlitygroupModal.vue b/jeecgboot-vue3-master/src/views/alitygroup/components/AlitygroupModal.vue new file mode 100644 index 00000000..dd58fe70 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/alitygroup/components/AlitygroupModal.vue @@ -0,0 +1,75 @@ + + + + +