Prechádzať zdrojové kódy

前端页面调整优化

zuohuaijun 4 rokov pred
rodič
commit
513f32a2a2
28 zmenil súbory, kde vykonal 169 pridanie a 76 odobranie
  1. 2 2
      Vben2/src/layouts/default/header/components/user-dropdown/index.vue
  2. 3 3
      Vben2/src/layouts/default/header/index.vue
  3. 1 0
      Vben2/src/views/sys/admin/code/CodeGenerateModal.vue
  4. 9 12
      Vben2/src/views/sys/admin/code/GenerateConfigModal.vue
  5. 5 0
      Vben2/src/views/sys/admin/code/codeGenerate.data.ts
  6. 4 2
      Vben2/src/views/sys/admin/code/fkModal.vue
  7. 8 0
      Vben2/src/views/sys/admin/code/index.vue
  8. 3 1
      Vben2/src/views/sys/admin/code/treeModal.vue
  9. 1 1
      Vben2/src/views/sys/admin/config/index.vue
  10. 4 2
      Vben2/src/views/sys/admin/database/ColumnModal.vue
  11. 3 0
      Vben2/src/views/sys/admin/database/CreateEntityModal.vue
  12. 14 0
      Vben2/src/views/sys/admin/database/TableModal.vue
  13. 3 0
      Vben2/src/views/sys/admin/database/database.data.ts
  14. 23 5
      Vben2/src/views/sys/admin/database/index.vue
  15. 4 0
      Vben2/src/views/sys/admin/dict/DictModal.vue
  16. 2 0
      Vben2/src/views/sys/admin/dict/dict.data.ts
  17. 3 0
      Vben2/src/views/sys/admin/dict/dictdata/DictDataModal.vue
  18. 3 0
      Vben2/src/views/sys/admin/dict/dictdata/dictData.data.ts
  19. 6 0
      Vben2/src/views/sys/admin/dict/dictdata/index.vue
  20. 6 0
      Vben2/src/views/sys/admin/dict/index.vue
  21. 2 2
      Vben2/src/views/sys/admin/menu/index.vue
  22. 6 12
      Vben2/src/views/sys/admin/org/OrgModal.vue
  23. 24 11
      Vben2/src/views/sys/admin/org/index.vue
  24. 1 1
      Vben2/src/views/sys/admin/pos/index.vue
  25. 2 1
      Vben2/src/views/sys/admin/role/index.vue
  26. 1 1
      Vben2/src/views/sys/admin/tenant/index.vue
  27. 20 15
      Vben2/src/views/sys/admin/user/OrgTree.vue
  28. 6 5
      Vben2/src/views/sys/admin/user/index.vue

+ 2 - 2
Vben2/src/layouts/default/header/components/user-dropdown/index.vue

@@ -11,12 +11,12 @@
 
     <template #overlay>
       <Menu @click="handleMenuClick">
-        <MenuItem
+        <!-- <MenuItem
           key="doc"
           :text="t('layout.header.dropdownItemDoc')"
           icon="ion:document-text-outline"
           v-if="getShowDoc"
-        />
+        /> -->
         <MenuDivider v-if="getShowDoc" />
         <MenuItem
           v-if="getUseLockPage"

+ 3 - 3
Vben2/src/layouts/default/header/index.vue

@@ -37,16 +37,16 @@
 
       <ErrorAction v-if="getUseErrorHandle" :class="`${prefixCls}-action__item error-action`" />
 
-      <Notify v-if="getShowNotice" :class="`${prefixCls}-action__item notify-item`" />
+      <!-- <Notify v-if="getShowNotice" :class="`${prefixCls}-action__item notify-item`" /> -->
 
       <FullScreen v-if="getShowFullScreen" :class="`${prefixCls}-action__item fullscreen-item`" />
 
-      <AppLocalePicker
+      <!-- <AppLocalePicker
         v-if="getShowLocalePicker"
         :reload="true"
         :showText="false"
         :class="`${prefixCls}-action__item`"
-      />
+      /> -->
 
       <UserDropDown :theme="getHeaderTheme" />
 

+ 1 - 0
Vben2/src/views/sys/admin/code/CodeGenerateModal.vue

@@ -16,6 +16,7 @@
   import { codeFormSchema } from './codeGenerate.data';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { addGenerate, updateGenerate } from '/@/api/sys/admin';
+
   export default defineComponent({
     components: { BasicModal, BasicForm },
     emits: ['success', 'register'],

+ 9 - 12
Vben2/src/views/sys/admin/code/GenerateConfigModal.vue

@@ -121,9 +121,8 @@
           tbData.value = data;
         });
       });
-      /**
-       * 判断是否(用于是否能选择或输入等)
-       */
+
+      // 判断是否(用于是否能选择或输入等)
       function judgeColumns(data) {
         if (
           data.columnName.indexOf('createdUserName') > -1 ||
@@ -136,9 +135,8 @@
         }
         return false;
       }
-      /**
-       * 控件类型改变
-       */
+
+      // 控件类型改变
       function effectTypeChange(data, value) {
         if (value === 'fk') {
           openFkModal(true, { data });
@@ -151,16 +149,14 @@
         dictDataAll.value = await await getDictTypeList();
         codeGenQueryTypeData.value = await getDictDataDropdown('code_gen_query_type');
       }
-      /**
-       * 外键弹窗回调
-       */
+
+      // 外键弹窗回调
       function fkHandleSuccess(data) {
         let index = tbData.value.findIndex((c) => c.columnName == data.columnName);
         tbData[index] = data;
       }
-      /**
-       * 提交
-       */
+
+      // 提交
       async function handleSubmit() {
         try {
           setModalProps({ confirmLoading: true });
@@ -183,6 +179,7 @@
           setModalProps({ confirmLoading: false });
         }
       }
+
       return {
         registerModal,
         tbData,

+ 5 - 0
Vben2/src/views/sys/admin/code/codeGenerate.data.ts

@@ -1,6 +1,7 @@
 import { BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
 import { getMenuList, getDictDataDropdown, getTableList, getColumnList } from '/@/api/sys/admin';
+
 const apiTableList = async (param: any) => {
   const result = await getTableList(param);
   return result;
@@ -21,6 +22,7 @@ const apiDictTypeDropDown = async () => {
   const result = await getDictDataDropdown('code_gen_create_type');
   return result;
 };
+
 export const codeShowColumns: BasicColumn[] = [
   {
     title: '表名称',
@@ -44,6 +46,7 @@ export const codeShowColumns: BasicColumn[] = [
     slots: { customRender: 'generateType' },
   },
 ];
+
 export const codeFormSchema: FormSchema[] = [
   {
     field: 'id',
@@ -112,6 +115,7 @@ export const codeFormSchema: FormSchema[] = [
     required: true,
   },
 ];
+
 // 表头
 export const columns = [
   {
@@ -195,6 +199,7 @@ export const columns = [
     },
   },
 ];
+
 export const fkFormSchema: FormSchema[] = [
   {
     field: 'tableName',

+ 4 - 2
Vben2/src/views/sys/admin/code/fkModal.vue

@@ -4,7 +4,7 @@
   </BasicModal>
 </template>
 <script lang="ts">
-  import { defineComponent, ref, computed, unref } from 'vue';
+  import { defineComponent } from 'vue';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { fkFormSchema } from './codeGenerate.data';
@@ -14,7 +14,7 @@
     emits: ['success'],
     setup(_, { emit }) {
       var row: any = {};
-      const [registerForm, { resetFields, validate, updateSchema }] = useForm({
+      const [registerForm, { resetFields, validate }] = useForm({
         labelWidth: 100,
         schemas: fkFormSchema,
         showActionButtonGroup: false,
@@ -27,6 +27,7 @@
         row = data.data;
         setModalProps({ confirmLoading: false });
       });
+
       async function handleSubmit() {
         const values = await validate();
         row.fkTableName = values.tableName;
@@ -37,6 +38,7 @@
         setModalProps({ confirmLoading: false });
         closeModal();
       }
+
       return { registerModal, registerForm, handleSubmit };
     },
   });

+ 8 - 0
Vben2/src/views/sys/admin/code/index.vue

@@ -55,6 +55,7 @@
   import CodeGenerateModal from './CodeGenerateModal.vue';
   import GenerateConfigModal from './GenerateConfigModal.vue';
   import { useMessage } from '/@/hooks/web/useMessage';
+
   export default defineComponent({
     components: {
       BasicTable,
@@ -89,33 +90,40 @@
           slots: { customRender: 'action' },
         },
       });
+
       function handleCreate() {
         openCodeGenModal(true, {
           isUpdate: false,
         });
       }
+
       function handleEdit(record: Recordable) {
         openCodeGenModal(true, {
           record,
           isUpdate: true,
         });
       }
+
       function handleConfig(record: Recordable) {
         openCodeGenConfigModal(true, { id: record.id });
       }
+
       async function handleGenerate(record: Recordable) {
         await generateRunLocal(record);
         createMessage.success('生成成功!');
         reload();
       }
+
       async function handleDelete(record: Recordable) {
         await deleGenerate([{ id: record.id }]);
         createMessage.success('删除成功');
         reload();
       }
+
       function handleSuccess() {
         reload();
       }
+
       return {
         registerTable,
         registerCodeGenModal,

+ 3 - 1
Vben2/src/views/sys/admin/code/treeModal.vue

@@ -14,7 +14,7 @@
     emits: ['success'],
     setup(_, { emit }) {
       var row: any = {};
-      const [registerForm, { resetFields, validate, updateSchema }] = useForm({
+      const [registerForm, { resetFields, validate }] = useForm({
         labelWidth: 100,
         schemas: treeFormSchema,
         showActionButtonGroup: false,
@@ -27,6 +27,7 @@
         row = data.data;
         setModalProps({ confirmLoading: false });
       });
+
       async function handleSubmit() {
         const values = await validate();
         row.fkTableName = values.tableName;
@@ -38,6 +39,7 @@
         setModalProps({ confirmLoading: false });
         closeModal();
       }
+
       return { registerModal, registerForm, handleSubmit };
     },
   });

+ 1 - 1
Vben2/src/views/sys/admin/config/index.vue

@@ -65,7 +65,7 @@
         showIndexColumn: false,
         canResize: false,
         actionColumn: {
-          width: 150,
+          width: 140,
           title: '操作',
           dataIndex: 'action',
           slots: { customRender: 'action' },

+ 4 - 2
Vben2/src/views/sys/admin/database/ColumnModal.vue

@@ -14,14 +14,13 @@
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { columnFormSchema } from './database.data';
-  import { useMessage } from '/@/hooks/web/useMessage';
   import { addColumn, updateColumn } from '/@/api/sys/admin';
+
   export default defineComponent({
     components: { BasicModal, BasicForm },
     emits: ['success', 'register'],
     setup(_, { emit }) {
       const isUpdate = ref(true);
-      const { createMessage } = useMessage();
       const [registerForm, { resetFields, setFieldsValue, updateSchema, validate }] = useForm({
         labelWidth: 120,
         schemas: columnFormSchema,
@@ -72,7 +71,9 @@
           });
         }
       });
+
       const getTitle = computed(() => (!unref(isUpdate) ? '新增列' : '编辑列'));
+
       async function handleSubmit() {
         try {
           const values = await validate();
@@ -88,6 +89,7 @@
           setModalProps({ confirmLoading: false });
         }
       }
+
       return {
         getTitle,
         registerModal,

+ 3 - 0
Vben2/src/views/sys/admin/database/CreateEntityModal.vue

@@ -9,6 +9,7 @@
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { createEntityFormSchema } from './database.data';
   import { createEntity } from '/@/api/sys/admin';
+
   export default defineComponent({
     components: { BasicModal, BasicForm },
     emits: ['success', 'register'],
@@ -26,6 +27,7 @@
           tableName: data.tableName,
         });
       });
+
       async function handleSubmit() {
         try {
           const values = await validate();
@@ -37,6 +39,7 @@
           setModalProps({ confirmLoading: false });
         }
       }
+
       return {
         registerModal,
         registerForm,

+ 14 - 0
Vben2/src/views/sys/admin/database/TableModal.vue

@@ -58,6 +58,7 @@
     TableAction,
   } from '/@/components/Table';
   import { addTable, updateTable } from '/@/api/sys/admin';
+
   export default defineComponent({
     name: 'TableModal',
     components: { BasicModal, BasicForm, BasicTable, TableAction },
@@ -88,7 +89,9 @@
           });
         }
       });
+
       const getTitle = computed(() => (!unref(isUpdate) ? '新增表' : '编辑表'));
+
       var colIndex = 0;
       const [registerEditColumn, { getDataSource }] = useTable({
         columns: editColumn,
@@ -103,6 +106,7 @@
           slots: { customRender: 'action' },
         },
       });
+
       function addPrimaryColumn() {
         const data = getDataSource();
         const addRow: EditRecordRow = {
@@ -121,6 +125,7 @@
         data.push(addRow);
         colIndex++;
       }
+
       function addColumn() {
         const data = getDataSource();
         const addRow: EditRecordRow = {
@@ -139,6 +144,7 @@
         data.push(addRow);
         colIndex++;
       }
+
       function addTenantColumn() {
         const data = getDataSource();
         const addRow: EditRecordRow = {
@@ -157,6 +163,7 @@
         data.push(addRow);
         colIndex++;
       }
+
       function addBaseColumn() {
         const fileds = [
           {
@@ -186,6 +193,7 @@
             isNullable: 0,
           },
         ];
+
         const data = getDataSource();
         fileds.forEach((m: any) => {
           data.push({
@@ -204,6 +212,7 @@
           colIndex++;
         });
       }
+
       function createActions(record: EditRecordRow, column: BasicColumn): ActionItem[] {
         return [
           {
@@ -224,6 +233,7 @@
           },
         ];
       }
+
       function handleColDelete(record: EditRecordRow) {
         if (record.isNew) {
           const data = getDataSource();
@@ -231,6 +241,7 @@
           data.splice(index, 1);
         }
       }
+
       function handleColTop(record: EditRecordRow) {
         if (record.isNew) {
           const data = getDataSource();
@@ -239,6 +250,7 @@
           return data1;
         }
       }
+
       function handleColDown(record: EditRecordRow) {
         if (record.isNew) {
           const data = getDataSource();
@@ -246,12 +258,14 @@
           return ChangeExForArray(index, index + 1, data);
         }
       }
+
       function ChangeExForArray(index1, index2, array: EditRecordRow) {
         let temp = array[index1];
         array[index1] = array[index2];
         array[index2] = temp;
         return array;
       }
+
       async function handleSubmit() {
         try {
           const values = await validate();

+ 3 - 0
Vben2/src/views/sys/admin/database/database.data.ts

@@ -113,6 +113,7 @@ export const tableFormSchema: FormSchema[] = [
     colProps: { span: 18 },
   },
 ];
+
 export const columnFormSchema: FormSchema[] = [
   {
     field: 'tableName',
@@ -201,6 +202,7 @@ export const columnFormSchema: FormSchema[] = [
     required: false,
   },
 ];
+
 export const createEntityFormSchema: FormSchema[] = [
   {
     field: 'tableName',
@@ -292,6 +294,7 @@ export const columnShowColumns: BasicColumn[] = [
     dataIndex: 'dataType',
   },
 ];
+
 export const editColumn: BasicColumn[] = [
   {
     dataIndex: 'dbColumnName',

+ 23 - 5
Vben2/src/views/sys/admin/database/index.vue

@@ -9,18 +9,24 @@
           <TableAction
             :actions="[
               {
-                label: '编辑',
+                icon: 'clarity:note-edit-line',
+                label: '',
+                tooltip: '编辑',
                 onClick: handleEdit.bind(null, record),
               },
               {
-                label: '删除',
+                icon: 'ant-design:delete-outlined',
+                label: '',
+                tooltip: '删除',
                 popConfirm: {
                   confirm: handleDelete.bind(null, record),
                   title: '确认删除?',
                 },
               },
               {
-                label: '生成实体',
+                icon: 'ant-design:check-circle-outlined',
+                label: '',
+                tooltip: '生成实体',
                 onClick: handleCreateEntity.bind(null, record),
               },
             ]"
@@ -68,6 +74,7 @@
   import CreateEntityModal from './CreateEntityModal.vue';
   import { getTableInfoList, getColumnInfoList, deleteTable, deleteColumn } from '/@/api/sys/admin';
   import { useMessage } from '/@/hooks/web/useMessage';
+
   export default defineComponent({
     components: {
       BasicTable,
@@ -94,7 +101,7 @@
         pagination: false,
         columns: tableShowColumns,
         actionColumn: {
-          width: 200,
+          width: 120,
           title: '操作',
           dataIndex: 'action',
           slots: { customRender: 'action' },
@@ -107,60 +114,71 @@
         pagination: false,
         columns: columnShowColumns,
         actionColumn: {
-          width: 200,
+          width: 120,
           title: '操作',
           dataIndex: 'action',
           slots: { customRender: 'action' },
         },
       });
+
       function handleCreateTable() {
         openModal(true, {
           isUpdate: false,
         });
       }
+
       function handleEdit(record: Recordable) {
         openModal(true, {
           record,
           isUpdate: true,
         });
       }
+
       async function handleDelete(record: Recordable) {
         await deleteTable(record);
         createMessage.success('删除成功!');
         reload();
         colReload();
       }
+
       function handleCreateEntity(record: Recordable) {
         openCreateEntityModal(true, { tableName: record.name });
       }
+
       function handleCreateColumn() {
         openColumnModal(true, {
           tableName: currentTable.value,
           isUpdate: false,
         });
       }
+
       function handleColumnEdit(record: Recordable) {
         openColumnModal(true, {
           record,
           isUpdate: true,
         });
       }
+
       async function handleColumnDelete(record: Recordable) {
         await deleteColumn(record);
         createMessage.success('删除成功!');
         colReload();
       }
+
       function handleSuccess() {
         reload();
         colReload();
       }
+
       function handleColumnSuccess() {
         colReload();
       }
+
       function onRowClick(record: any) {
         currentTable.value = record.name;
         colReload();
       }
+
       return {
         registerTable,
         registerColumnTable,

+ 4 - 0
Vben2/src/views/sys/admin/dict/DictModal.vue

@@ -9,6 +9,7 @@
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { formSchema } from './dict.data';
   import { addDictType, updateDictType } from '/@/api/sys/admin';
+
   export default defineComponent({
     name: 'DcitModal',
     components: { BasicModal, BasicForm },
@@ -33,7 +34,9 @@
           });
         }
       });
+
       const getTitle = computed(() => (!unref(isUpdate) ? '新增字典类型' : '字典类型编辑'));
+
       async function handleSubmit() {
         try {
           const values = await validate();
@@ -50,6 +53,7 @@
           setModalProps({ confirmLoading: false });
         }
       }
+
       return { registerModal, registerForm, getTitle, handleSubmit };
     },
   });

+ 2 - 0
Vben2/src/views/sys/admin/dict/dict.data.ts

@@ -33,6 +33,7 @@ export const columns: BasicColumn[] = [
     },
   },
 ];
+
 export const searchFormSchema: FormSchema[] = [
   {
     field: 'name',
@@ -47,6 +48,7 @@ export const searchFormSchema: FormSchema[] = [
     colProps: { span: 8 },
   },
 ];
+
 export const formSchema: FormSchema[] = [
   {
     field: 'id',

+ 3 - 0
Vben2/src/views/sys/admin/dict/dictdata/DictDataModal.vue

@@ -9,6 +9,7 @@
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { formSchema } from './dictData.data';
   import { addDictData, updateDictData } from '/@/api/sys/admin';
+
   export default defineComponent({
     name: 'DcitModal',
     components: { BasicModal, BasicForm },
@@ -38,6 +39,7 @@
       });
 
       const getTitle = computed(() => (!unref(isUpdate) ? '新增字典值' : '字典类值编辑'));
+
       async function handleSubmit() {
         try {
           const values = await validate();
@@ -53,6 +55,7 @@
           setModalProps({ confirmLoading: false });
         }
       }
+
       return { registerModal, registerForm, getTitle, handleSubmit };
     },
   });

+ 3 - 0
Vben2/src/views/sys/admin/dict/dictdata/dictData.data.ts

@@ -1,6 +1,7 @@
 import { BasicColumn, FormSchema } from '/@/components/Table';
 import { h } from 'vue';
 import { Tag } from 'ant-design-vue';
+
 export const columns: BasicColumn[] = [
   {
     title: '字典值',
@@ -32,6 +33,7 @@ export const columns: BasicColumn[] = [
     },
   },
 ];
+
 export const searchFormSchema: FormSchema[] = [
   {
     field: 'code',
@@ -46,6 +48,7 @@ export const searchFormSchema: FormSchema[] = [
     colProps: { span: 8 },
   },
 ];
+
 export const formSchema: FormSchema[] = [
   {
     field: 'id',

+ 6 - 0
Vben2/src/views/sys/admin/dict/dictdata/index.vue

@@ -41,6 +41,7 @@
   import DictDataModal from './DictDataModal.vue';
   import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
   import { getDictDataList, deleteDictData } from '/@/api/sys/admin';
+
   export default defineComponent({
     name: 'DcitDataModal',
     components: { BasicModal, BasicTable, TableAction, DictDataModal },
@@ -81,12 +82,14 @@
         typeId.value = data.typeId;
         reload();
       });
+
       function handleCreate() {
         openModal(true, {
           typeId: typeId.value,
           isUpdate: false,
         });
       }
+
       function handleEdit(record: Recordable) {
         openModal(true, {
           record,
@@ -94,13 +97,16 @@
           isUpdate: true,
         });
       }
+
       async function handleDelete(record: Recordable) {
         await deleteDictData(record.id);
         reload();
       }
+
       function handleSuccess() {
         reload();
       }
+
       return {
         registerTable,
         registerDictModal,

+ 6 - 0
Vben2/src/views/sys/admin/dict/index.vue

@@ -42,6 +42,7 @@
   import { useModal } from '/@/components/Modal';
   import DcitModal from './DictModal.vue';
   import DcitDataModal from './dictdata/index.vue';
+
   export default defineComponent({
     components: { BasicTable, TableAction, DcitModal, DcitDataModal },
     setup() {
@@ -71,17 +72,20 @@
           fixed: undefined,
         },
       });
+
       function handleCreate() {
         openDictModal(true, {
           isUpdate: false,
         });
       }
+
       function handleEdit(record: Recordable) {
         openDictModal(true, {
           record,
           isUpdate: true,
         });
       }
+
       function handleDictData(record: Recordable) {
         openDictDataModal(true, {
           typeId: record.id,
@@ -92,9 +96,11 @@
         await deleteDictType(record.id);
         reload();
       }
+
       function handleSuccess() {
         reload();
       }
+
       return {
         registerTable,
         registerModal,

+ 2 - 2
Vben2/src/views/sys/admin/menu/index.vue

@@ -66,9 +66,9 @@
         showTableSetting: true,
         bordered: true,
         showIndexColumn: false,
-        canResize: false,
+        canResize: true,
         actionColumn: {
-          width: 150,
+          width: 140,
           title: '操作',
           dataIndex: 'action',
           slots: { customRender: 'action' },

+ 6 - 12
Vben2/src/views/sys/admin/org/OrgModal.vue

@@ -30,7 +30,7 @@
         setModalProps({ confirmLoading: false });
         isUpdate.value = !!data?.isUpdate;
 
-        const treeData = await getOrgList({id:data.parentId || 0});
+        const treeData = await getOrgList({ id: data.parentId || 0 });
         updateSchema({
           field: 'pid',
           componentProps: { treeData },
@@ -41,23 +41,17 @@
           setFieldsValue({
             ...data.record,
           });
+        } else {
+          setFieldsValue({ pid: data.parentId });
         }
-        else
-        {
-          setFieldsValue(
-            { pid: data.parentId,}
-          );
-        }
-
       });
 
       const getTitle = computed(() => (!unref(isUpdate) ? '新增机构' : '编辑机构'));
 
       async function handleSubmit() {
-
         try {
           const values = await validate();
-          setModalProps({confirmLoading: true});
+          setModalProps({ confirmLoading: true });
 
           if (unref(isUpdate)) {
             values.id = rowId;
@@ -69,10 +63,10 @@
           closeModal();
           emit('success', {
             isUpdate: unref(isUpdate),
-            values: {...values, id: rowId},
+            values: { ...values, id: rowId },
           });
         } finally {
-          setModalProps({confirmLoading: false});
+          setModalProps({ confirmLoading: false });
         }
       }
 

+ 24 - 11
Vben2/src/views/sys/admin/org/index.vue

@@ -1,12 +1,25 @@
 <template>
   <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
-    <OrgTree class="w-1/4 xl:w-1/5" @select="handleSelect" ref="OrgTreeChild"/>
-    <BasicTable @register="registerTable"  class="w-3/4 xl:w-4/5"  :searchInfo="searchInfo">
+    <OrgTree
+      class="w-1/4 xl:w-1/5"
+      style="overflow: auto"
+      @select="handleSelect"
+      ref="OrgTreeChild"
+    />
+    <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
       <template #toolbar>
-        <a-button type="primary" @click="handleCreatebrother" :disabled="!hasPermission('sysOrg:add')">
+        <a-button
+          type="primary"
+          @click="handleCreatebrother"
+          :disabled="!hasPermission('sysOrg:add')"
+        >
           添加同级单位
         </a-button>
-        <a-button type="primary" @click="handleCreatechild()" :disabled="!hasPermission('sysOrg:add')">
+        <a-button
+          type="primary"
+          @click="handleCreatechild()"
+          :disabled="!hasPermission('sysOrg:add')"
+        >
           添加下级单位
         </a-button>
       </template>
@@ -37,7 +50,7 @@
   </PageWrapper>
 </template>
 <script lang="ts">
-  import {defineComponent, onMounted, reactive, ref, unref} from 'vue';
+  import { defineComponent, reactive, ref, unref } from 'vue';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { useModal } from '/@/components/Modal';
   import { usePermission } from '/@/hooks/web/usePermission';
@@ -52,7 +65,7 @@
 
   export default defineComponent({
     name: 'OrgManagement',
-    components: { BasicTable, OrgModal, TableAction , PageWrapper, OrgTree},
+    components: { BasicTable, OrgModal, TableAction, PageWrapper, OrgTree },
     setup() {
       const { hasPermission } = usePermission();
       const OrgTreeChild = ref(null);
@@ -73,7 +86,7 @@
         showTableSetting: true,
         bordered: true,
         showIndexColumn: false,
-        canResize: false,
+        canResize: true,
         actionColumn: {
           width: 150,
           title: '操作',
@@ -86,7 +99,7 @@
       function getTree() {
         const tree = unref(OrgTreeChild);
         if (!tree) {
-          throw new Error('tree is null!');
+          throw new Error('Tree is null!');
         }
         return tree;
       }
@@ -96,7 +109,7 @@
       }
 
       function updateNodeByKey(key, values) {
-        getTree().updateNodeByKey(key,values);      //子组件里的方法
+        getTree().updateNodeByKey(key, values); // 子组件里的方法
       }
 
       function deleteNodeByKey(key) {
@@ -132,14 +145,14 @@
 
       async function handleDelete(record: Recordable) {
         await deleteOrg(record.id);
-        deleteNodeByKey(record.id )
+        deleteNodeByKey(record.id);
         searchInfo.Id = record.pid;
         reload();
       }
 
       function handleSelect(orgId: number, obj) {
         searchInfo.Id = orgId;
-        searchInfo.pId = obj.pid? obj.pid : 0;
+        searchInfo.pId = obj.pid ? obj.pid : 0;
         reload();
       }
 

+ 1 - 1
Vben2/src/views/sys/admin/pos/index.vue

@@ -64,7 +64,7 @@
         showTableSetting: true,
         bordered: true,
         showIndexColumn: false,
-        canResize: false,
+        canResize: true,
         actionColumn: {
           width: 150,
           title: '操作',

+ 2 - 1
Vben2/src/views/sys/admin/role/index.vue

@@ -88,8 +88,9 @@
         showTableSetting: true,
         bordered: true,
         showIndexColumn: false,
+        canResize: false,
         actionColumn: {
-          width: 160,
+          width: 140,
           title: '操作',
           dataIndex: 'action',
           slots: { customRender: 'action' },

+ 1 - 1
Vben2/src/views/sys/admin/tenant/index.vue

@@ -91,7 +91,7 @@
         showTableSetting: true,
         bordered: true,
         actionColumn: {
-          width: 160,
+          width: 140,
           title: '操作',
           dataIndex: 'action',
           slots: { customRender: 'action' },

+ 20 - 15
Vben2/src/views/sys/admin/user/OrgTree.vue

@@ -6,7 +6,7 @@
       search
       :clickRowToExpand="true"
       :treeData="treeData"
-      :fieldNames="{ key: 'id', title: 'name'}"
+      :fieldNames="{ key: 'id', title: 'name' }"
       @select="handleSelect"
       ref="treeAction"
     />
@@ -27,26 +27,24 @@
       const treeData = ref<TreeItem[]>([]);
       const treeAction = ref<Nullable<TreeActionType>>(null);
 
-      const  appendNodeByKey =(parentKey: string, values) =>{
+      const appendNodeByKey = (parentKey: string, values) => {
         unref(treeAction).insertNodeByKey({
           parentKey: parentKey,
-          node:values,
+          node: values,
           // 往后插入
           push: 'push',
           // 往前插入
           // push:'unshift'
         });
-      }
+      };
 
-      const  updateNodeByKey=(key: string,values)=>{
-        unref(treeAction).updateNodeByKey(key,
-          values,
-        );
-      }
+      const updateNodeByKey = (key: string, values) => {
+        unref(treeAction).updateNodeByKey(key, values);
+      };
 
-      const deleteNodeByKey=(key: string)=> {
+      const deleteNodeByKey = (key: string) => {
         unref(treeAction).deleteNodeByKey(key);
-      }
+      };
 
       async function fetch() {
         treeData.value = (await getOrgList()) as unknown as TreeItem[];
@@ -55,15 +53,22 @@
         });
       }
 
-      function handleSelect(keys,obj) {
+      function handleSelect(keys, obj) {
         emit('select', keys[0], obj.selectedNodes[0]);
       }
 
       onMounted(() => {
         fetch();
-       });
-      return { treeData, handleSelect, treeAction,
-        appendNodeByKey,updateNodeByKey,deleteNodeByKey,fetch};
+      });
+      return {
+        treeData,
+        handleSelect,
+        treeAction,
+        appendNodeByKey,
+        updateNodeByKey,
+        deleteNodeByKey,
+        fetch,
+      };
     },
   });
 </script>

+ 6 - 5
Vben2/src/views/sys/admin/user/index.vue

@@ -1,11 +1,11 @@
 <template>
   <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
-    <OrgTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
+    <OrgTree class="w-1/4 xl:w-1/5" style="overflow: auto" @select="handleSelect" />
     <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
       <template #toolbar>
-        <a-button type="primary" @click="handleCreate" :disabled="!hasPermission('sysUser:add')"
-          >新增账号</a-button
-        >
+        <a-button type="primary" @click="handleCreate" :disabled="!hasPermission('sysUser:add')">
+          新增账号
+        </a-button>
       </template>
       <template #avatar="{ record }">
         <Avatar :size="60" :src="record.avatar" />
@@ -109,8 +109,9 @@
         useSearchForm: true,
         showTableSetting: true,
         bordered: true,
+        canResize: true,
         actionColumn: {
-          width: 160,
+          width: 140,
           title: '操作',
           dataIndex: 'action',
           slots: { customRender: 'action' },