Explorar o código

fix: 三大模块修复及常量

Tong %!s(int64=2) %!d(string=hai) anos
pai
achega
54015d82b4

+ 9 - 0
src/api/monitor/LogApi.ts

@@ -7,6 +7,7 @@ enum Api {
   LogAdd = '/sys/log/add',
   LogEdit = '/sys/log/edit',
   LogRemove = '/sys/log/removeByIds',
+  LogExport = '/sys/log/removeByIds',
 }
 
 /**
@@ -128,3 +129,11 @@ export const LogEdit = (params?: object) => {
 export const LogRemove = (params: Array<string | number>) => {
   return defHttp.post({ url: Api.LogRemove, params: params });
 };
+
+/**
+ * @description: 导出,权限 - sys:log:export
+ * @method: POST
+ */
+export const LogExport = (params: Array<string | number>) => {
+  return defHttp.post({ url: Api.LogExport, params: params });
+};

+ 96 - 0
src/api/sys/sysConstantConfig.ts

@@ -0,0 +1,96 @@
+import { defHttp } from '/@/utils/http/axios';
+import { setParams } from '/@/utils/index';
+
+enum Api {
+  sysConfigQueryPage = '/sys/constant/config/query/page',
+  sysConfigDetail = '/sys/constant/config/detail',
+  sysConfigAdd = '/sys/constant/config/add',
+  sysConfigEdit = '/sys/constant/config/edit',
+  sysConfigRemove = '/sys/constant/config/removeByIds',
+}
+
+/**
+ *
+ * @author zsl
+ * @date  2023/05/17 15:41
+ * @description: 根据条件查询常量配置列表,权限 - constant:config:query
+ * @method: POST
+ * @param:
+ *       {String}  name  like   常量名称
+ *       {String}  code  eq   常量编码
+ * @return:
+ *       {String}  name  常量名称
+ *       {Integer}  type  常量类型
+ *       {String}  remark  备注
+ *       {String}  code  常量编码
+ *       {String}  cateid  目录id
+ */
+
+export const sysConfigQueryPage = (params?: object) => {
+  return defHttp.post({ url: Api.sysConfigQueryPage, params: setParams(params) });
+};
+/**
+ *
+ * @author zsl
+ * @date  2023/05/17 15:41
+ * @description: 根据id查询常量配置详细信息,权限 - constant:config:query
+ * @method: GET
+ * @param:  id 常量配置主键id
+ * @return:
+ *       {String}  name  常量名称
+ *       {Integer}  type  常量类型
+ *       {String}  remark  备注
+ *       {String}  code  常量编码
+ *       {String}  cateid  目录id
+ */
+export const sysConfigDetail = (id: string) => {
+  return defHttp.get({ url: Api.sysConfigDetail + '/' + id });
+};
+
+/**
+ *
+ * @author zsl
+ * @date  2023/05/17 15:41
+ * @description: 添加常量配置,权限 - constant:config:add
+ * @method: POST
+ * @param:
+ *       {String}  name  常量名称
+ *       {Integer}  type  常量类型
+ *       {String}  remark  备注
+ *       {String}  code  常量编码
+ *       {String}  cateid  目录id
+ * @return:
+ *       0 添加失败
+ *       1 添加成功
+ */
+export const sysConfigAdd = (params?: object) => {
+  return defHttp.post({ url: Api.sysConfigAdd, params: params });
+};
+
+/**
+ *
+ * @author zsl
+ * @date  2023/05/17 15:41
+ * @description: 通过主键id编辑常量配置,权限 - constant:config:edit
+ * @method: POST
+ * @param:
+ *       {String}  name  常量名称
+ *       {Integer}  type  常量类型
+ *       {String}  remark  备注
+ *       {String}  code  常量编码
+ *       {String}  cateid  目录id
+ * @return:
+ *       0 编辑失败
+ *       1 编辑成功
+ */
+export const sysConfigEdit = (params?: object) => {
+  return defHttp.post({ url: Api.sysConfigEdit, params: params });
+};
+
+/**
+ * @description: 删除,权限 - constant:config:remove
+ * @method: POST
+ */
+export const sysConfigRemove = (params: Array<string | number>) => {
+  return defHttp.post({ url: Api.sysConfigRemove, params: params });
+};

+ 18 - 0
src/views/infra/numStrategy/data.ts

@@ -1,6 +1,7 @@
 import { listDictModel } from '/@/api/common';
 import { DescItem } from '/@/components/Description';
 import { BasicColumn, FormSchema } from '/@/components/Table';
+import { validateStr } from '/@/utils/validate';
 
 export const columns: BasicColumn[] = [
   {
@@ -58,6 +59,22 @@ export const dataFormSchema: FormSchema[] = [
     componentProps: {
       placeholder: '请输入策略编码',
     },
+    dynamicRules: () => {
+      return [
+        {
+          required: true,
+          validator: async (_, value) => {
+            if (!value) {
+              return Promise.reject('字典项编码不能为空');
+            }
+            if (validateStr(value)) {
+              return Promise.reject('字典项编码为字母或数字组成');
+            }
+            return Promise.resolve();
+          },
+        },
+      ];
+    },
   },
   {
     label: '策略名称',
@@ -107,6 +124,7 @@ export const dataFormSchema: FormSchema[] = [
     label: '生成模式',
     field: 'type',
     component: 'ApiSelect',
+    required: true,
     componentProps: {
       api: listDictModel,
       params: {

+ 1 - 1
src/views/infra/numStrategy/formDrawer.vue

@@ -27,7 +27,7 @@
   const emit = defineEmits(['success', 'register']);
 
   const getTitle = computed(() => (!unref(isUpdate) ? '新增编号策略' : '编辑编号策略'));
-  const width = '30%';
+  const width = '45%';
   const isUpdate = ref(false);
   const rowId = ref();
 

+ 7 - 24
src/views/monitor/operLog/index.vue

@@ -45,14 +45,6 @@
         </template>
       </template>
       <template #toolbar>
-        <!-- <Button
-          v-auth="['sys:log:add']"
-          type="primary"
-          @click="handleCreate"
-          preIcon="icon-plus|iconfont"
-        >
-          新增
-        </Button> -->
         <Button
           v-auth="['sys:log:remove']"
           type="primary"
@@ -73,15 +65,15 @@
   import { Tag } from 'ant-design-vue';
   import { Button } from '/@/components/Button';
 
-  import { BasicTable, useTable, TableAction } from '/@/components/Table';
+  import { BasicTable, useTable, TableAction } from '/@/components/TableCard';
 
   // import { useModal } from '/@/components/Modal';
   import { useMessage } from '/@/hooks/web/useMessage';
   import FormDrawer from './formDrawer.vue';
   import ViewDrawer from './viewDrawer.vue';
-  import { columns, searchFormSchema } from './data';
+  import { columns } from './data';
 
-  import { LogQueryPage, LogRemove } from '/@/api/monitor/LogApi';
+  import { LogQueryPage, LogRemove, LogExport } from '/@/api/monitor/LogApi';
   import { listDictModel } from '/@/api/common';
   import { formatDictColor, formatDictValue } from '/@/utils'; //
   import { useDrawer } from '/@/components/Drawer';
@@ -109,23 +101,14 @@
 
   const [registerTable, { reload, getSelectRowKeys }] = useTable({
     api: LogQueryPage,
+    batchDelApi: LogRemove,
+    batchExportApi: LogExport, // 目前调用的是删除接口
+    exportAuthList: ['sys:log:export'],
+    delAuthList: ['sys:log:remove'],
     rowKey: 'id',
     columns,
     showIndexColumn: true,
     rowSelection: { type: 'checkbox' },
-    formConfig: {
-      labelWidth: 120,
-      schemas: searchFormSchema,
-      autoSubmitOnEnter: true,
-      baseColProps: { xs: 24, sm: 12, md: 12, lg: 8 },
-      resetButtonOptions: {
-        preIcon: 'icon-delete|iconfont',
-      },
-      submitButtonOptions: {
-        preIcon: 'icon-search|iconfont',
-      },
-    },
-    useSearchForm: true,
     bordered: true,
     actionColumn: {
       width: 200,

+ 1 - 1
src/views/sys/sysPortal/FormModalPortalMenu.vue

@@ -100,6 +100,6 @@
 
   // 查询树数据
   async function getTreeData() {
-    treeData.value = await sysMenuQueryTree({});
+    treeData.value = await sysMenuQueryTree({ menuType: ['menu', 'dir'] });
   }
 </script>

+ 17 - 32
src/views/sys/sysPortal/data.ts

@@ -1,6 +1,6 @@
-import { listDictModel } from '/@/api/common';
 import { DescItem } from '/@/components/Description';
 import { BasicColumn, FormSchema } from '/@/components/Table';
+import { validateStr } from '/@/utils/validate';
 
 export const columns: BasicColumn[] = [
   {
@@ -11,12 +11,6 @@ export const columns: BasicColumn[] = [
     title: '门户名称',
     dataIndex: 'name',
   },
-  {
-    title: '排序',
-    dataIndex: 'sort',
-    width: 100,
-    sorter: true,
-  },
   {
     title: '门户类型',
     dataIndex: 'type',
@@ -47,11 +41,26 @@ export const dataFormSchema: FormSchema[] = [
   {
     label: '门户编码',
     field: 'code',
-    required: true,
     component: 'Input',
     componentProps: {
       placeholder: '请输入门户编码',
     },
+    dynamicRules: () => {
+      return [
+        {
+          required: true,
+          validator: async (_, value) => {
+            if (!value) {
+              return Promise.reject('门户编码不能为空');
+            }
+            if (validateStr(value)) {
+              return Promise.reject('门户编码为字母或数字组成');
+            }
+            return Promise.resolve();
+          },
+        },
+      ];
+    },
   },
   {
     label: '门户名称',
@@ -62,26 +71,6 @@ export const dataFormSchema: FormSchema[] = [
       placeholder: '请输入门户名称',
     },
   },
-  {
-    label: '门户类型',
-    field: 'type',
-    component: 'ApiRadioGroup',
-    componentProps: {
-      api: listDictModel,
-      params: {
-        dictCode: 'sys_create_type',
-      },
-    },
-    defaultValue: 'sys',
-  },
-  {
-    label: '排序',
-    field: 'sort',
-    component: 'Input',
-    componentProps: {
-      placeholder: '请输入排序',
-    },
-  },
   {
     label: '备注',
     field: 'remark',
@@ -105,10 +94,6 @@ export const viewSchema: DescItem[] = [
     label: '门户类型',
     field: 'type',
   },
-  {
-    label: '排序',
-    field: 'sort',
-  },
   {
     label: '备注',
     field: 'remark',

+ 0 - 4
src/views/sys/sysPortal/index.vue

@@ -106,10 +106,6 @@
   const [registerModalPortalMenu, { openModal: openModalPortalMenu }] = useModal();
 
   const tableSort = ref([
-    {
-      field: 'sort',
-      direction: 'ASC',
-    },
     {
       field: 'create_time',
       direction: 'DESC',

+ 28 - 15
src/views/sys/sysPos/data.ts

@@ -1,6 +1,7 @@
 import { listDictModel } from '/@/api/common';
 import { DescItem } from '/@/components/Description';
 import { BasicColumn, FormSchema } from '/@/components/Table';
+import { validateStr } from '/@/utils/validate';
 
 export const columns: BasicColumn[] = [
   {
@@ -15,10 +16,6 @@ export const columns: BasicColumn[] = [
     title: '排序码',
     dataIndex: 'sort',
   },
-  {
-    title: '备注',
-    dataIndex: 'remark',
-  },
   {
     title: '状态',
     dataIndex: 'disable',
@@ -61,11 +58,26 @@ export const dataFormSchema: FormSchema[] = [
   {
     label: '岗位编码',
     field: 'posCode',
-    required: true,
     component: 'Input',
     componentProps: {
       placeholder: '请输入岗位编码',
     },
+    dynamicRules: () => {
+      return [
+        {
+          required: true,
+          validator: async (_, value) => {
+            if (!value) {
+              return Promise.reject('岗位编码不能为空');
+            }
+            if (validateStr(value)) {
+              return Promise.reject('岗位编码为字母或数字组成');
+            }
+            return Promise.resolve();
+          },
+        },
+      ];
+    },
   },
   {
     label: '排序码',
@@ -76,25 +88,26 @@ export const dataFormSchema: FormSchema[] = [
       placeholder: '请输入排序码',
     },
   },
-  {
-    label: '备注',
-    field: 'remark',
-    required: true,
-    component: 'Input',
-    componentProps: {
-      placeholder: '请输入备注',
-    },
-  },
   {
     label: '状态',
     field: 'disable',
-    component: 'ApiSelect',
+    required: true,
+    component: 'ApiRadioGroup',
     componentProps: {
       api: listDictModel,
       params: {
         dictCode: 'sys_disable_type',
       },
     },
+    defaultValue: '0',
+  },
+  {
+    label: '备注',
+    field: 'remark',
+    component: 'Input',
+    componentProps: {
+      placeholder: '请输入备注',
+    },
   },
 ];
 // 表单详情查看

+ 1 - 0
src/views/sys/sysPos/formDrawer.vue

@@ -46,6 +46,7 @@
       rowId.value = resData.id;
       await setFieldsValue({
         ...resData,
+        disable: String(resData.disable),
       });
     }
   });

+ 5 - 5
src/views/sys/sysPos/index.vue

@@ -11,21 +11,21 @@
           <TableAction
             :actions="[
               {
-                auth: 'sys:position:query',
+                auth: 'sys:pos:query',
                 icon: 'icon-eye|iconfont',
                 tooltip: '查看',
                 label: '查看',
                 onClick: handleView.bind(null, record),
               },
               {
-                auth: 'sys:position:edit',
+                auth: 'sys:pos:edit',
                 icon: 'icon-edit|iconfont',
                 tooltip: '编辑',
                 label: '编辑',
                 onClick: handleEdit.bind(null, record),
               },
               {
-                auth: 'sys:position:remove',
+                auth: 'sys:pos:remove',
                 icon: 'icon-delete|iconfont',
                 tooltip: '删除',
                 label: '删除',
@@ -42,7 +42,7 @@
       </template>
       <template #toolbar>
         <Button
-          v-auth="['sys:position:add']"
+          v-auth="['sys:pos:add']"
           type="primary"
           @click="handleCreate"
           preIcon="icon-plus|iconfont"
@@ -50,7 +50,7 @@
           新增
         </Button>
         <Button
-          v-auth="['sys:position:remove']"
+          v-auth="['sys:pos:remove']"
           type="primary"
           danger
           @click="handleDelete(null)"

+ 9 - 0
src/views/sys/sysSms/channel/data.ts

@@ -92,6 +92,7 @@ export const dataFormSchema: FormSchema[] = [
         dictCode: 'sys_sms_channel',
       },
     },
+    defaultValue: 'ALIYUN',
   },
   {
     label: '短信API账号',
@@ -119,6 +120,14 @@ export const dataFormSchema: FormSchema[] = [
     componentProps: {
       placeholder: '请输入短信发送回调URL',
     },
+    helpMessage: ({ values }) => {
+      switch (values.type) {
+        case 'ALIYUN':
+          return '阿里云回调地址:https://host:ip+/sms/callback/aliyun';
+        case 'TENCENT':
+          return '腾讯云回调地址: https://host:ip+/sms/callback/tencent';
+      }
+    },
   },
   {
     label: '是否启用',

+ 1 - 1
src/views/sys/sysSms/channel/formDrawer.vue

@@ -29,7 +29,7 @@
 
   const { createMessage } = useMessage();
   const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
-    labelWidth: 100,
+    labelWidth: 120,
     schemas: dataFormSchema,
     showActionButtonGroup: false,
     actionColOptions: {

+ 20 - 3
src/views/sys/sysSms/temp/data.ts

@@ -2,6 +2,7 @@ import { listDictModel } from '/@/api/common';
 import { smsChannelQueryPage } from '/@/api/sys/smsChannelApi';
 import { DescItem } from '/@/components/Description';
 import { BasicColumn, FormSchema } from '/@/components/Table';
+import { validateStr } from '/@/utils/validate';
 
 export const columns: BasicColumn[] = [
   {
@@ -26,7 +27,7 @@ export const columns: BasicColumn[] = [
   },
 
   {
-    title: '短信API模板编号',
+    title: 'API模板编号',
     dataIndex: 'apiTempCode',
   },
   // {
@@ -59,6 +60,22 @@ export const dataFormSchema: FormSchema[] = [
     componentProps: {
       placeholder: '请输入模板编码',
     },
+    dynamicRules: () => {
+      return [
+        {
+          required: true,
+          validator: async (_, value) => {
+            if (!value) {
+              return Promise.reject('模板编码不能为空');
+            }
+            if (validateStr(value)) {
+              return Promise.reject('模板编码为字母或数字组成');
+            }
+            return Promise.resolve();
+          },
+        },
+      ];
+    },
   },
   {
     label: '模板名称',
@@ -111,7 +128,7 @@ export const dataFormSchema: FormSchema[] = [
     },
   },
   {
-    label: '短信API模板编号',
+    label: 'API模板编号',
     field: 'apiTempCode',
     required: true,
     component: 'Input',
@@ -169,7 +186,7 @@ export const viewSchema: DescItem[] = [
     field: 'content',
   },
   {
-    label: '短信API模板编号',
+    label: 'API模板编号',
     field: 'apiTempCode',
   },
   // {

+ 9 - 0
src/views/sys/sysUser/sysUserTable/FormModal.vue

@@ -46,6 +46,15 @@
       const resData = await sysUserDetail(data.record.id);
       resData.sex = String(resData.sex || '3');
       resData.orgId = String(resData.orgId);
+      await updateSchema([
+        {
+          field: 'username',
+          componentProps: {
+            disabled: true,
+          },
+          dynamicRules: false,
+        },
+      ]);
       await setFieldsValue({
         ...resData,
       });

+ 3 - 2
src/views/sys/sysUser/sysUserTable/data.ts

@@ -192,9 +192,10 @@ export const dataFormSchema: FormSchema[] = [
         params: {
           pageNum: 1,
           pageSize: 999,
+          disable: 0,
         },
-        mode: 'single',
-        labelField: 'name',
+        mode: 'multiple',
+        labelField: 'posName',
         valueField: 'id',
         resultField: 'data',
       };