Переглянути джерело

form表单label宽度支持设置,默认去掉一些表单的宽度设置,默认自适应

zhangdaiscott 2 роки тому
батько
коміт
9f755a2308

+ 7 - 1
src/components/Form/src/BasicForm.vue

@@ -81,7 +81,13 @@
 
       // Get the basic configuration of the form
       const getProps = computed((): FormProps => {
-        return { ...props, ...unref(propsRef) } as FormProps;
+        let mergeProps = { ...props, ...unref(propsRef) } as FormProps;
+        //update-begin-author:sunjianlei date:20220923 for: 如果用户设置了labelWidth,则使labelCol失效,解决labelWidth设置无效的问题
+        if (mergeProps.labelWidth) {
+          mergeProps.labelCol = undefined;
+        }
+        //update-end-author:sunjianlei date:20220923 for: 如果用户设置了labelWidth,则使labelCol失效,解决labelWidth设置无效的问题
+        return mergeProps;
       });
 
       const getFormClass = computed(() => {

+ 1 - 1
src/components/Form/src/jeecg/components/modal/RoleSelectModal.vue

@@ -58,7 +58,7 @@
       const searchInfo = ref(props.params);
       //查询form
       const formConfig = {
-        labelWidth: 220,
+        //labelWidth: 220,
         baseColProps: {
           xs: 24,
           sm: 24,

+ 1 - 1
src/components/Form/src/jeecg/components/modal/UserSelectByDepModal.vue

@@ -101,7 +101,7 @@
         bordered: true,
         size: 'small',
         formConfig: {
-          labelWidth: 200,
+          //labelWidth: 200,
           baseColProps: {
             xs: 24,
             sm: 8,

+ 0 - 1
src/components/Form/src/jeecg/components/modal/UserSelectModal.vue

@@ -109,7 +109,6 @@
       const searchInfo = ref(props.params);
       //查询form
       const formConfig = {
-        labelWidth: 200,
         baseColProps: {
           xs: 24,
           sm: 8,

+ 1 - 1
src/hooks/system/useListPage.ts

@@ -206,7 +206,7 @@ export function useListTable(tableProps: TableProps): [
       // 紧凑模式
       compact: true,
       // label默认宽度
-      labelWidth: 120,
+      // labelWidth: 120,
       // 按下回车后自动提交
       autoSubmitOnEnter: true,
       // 默认 row 配置

+ 0 - 1
src/views/system/address/index.vue

@@ -50,7 +50,6 @@
       //update-end---author:wangshuai ---date:20220629  for:[VUEN-1485]进入系统管理--通讯录页面后,网页命令行报错--------------
       showIndexColumn: true,
       formConfig: {
-        labelWidth: 200,
         schemas: searchFormSchema,
       },
       canResize: false,

+ 1 - 0
src/views/system/departUser/components/DepartRoleInfoTab.vue

@@ -70,6 +70,7 @@
       columns: departRoleColumns,
       canResize: false,
       formConfig: {
+        labelWidth: 100,
         schemas: departRoleSearchFormSchema,
         baseColProps: adaptiveColProps,
         labelAlign: 'left',

+ 1 - 1
src/views/system/examples/demo/DemoModal.vue

@@ -14,7 +14,7 @@
   const isUpdate = ref(true);
   //表单配置
   const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
-    labelWidth: 150,
+    //labelWidth: 150,
     schemas: formSchema,
     showActionButtonGroup: false,
   });

+ 4 - 1
src/views/system/examples/demo/index.vue

@@ -60,6 +60,8 @@
         }}</a-button>
         <a-button preIcon="ant-design:import-outlined" type="primary" @click="handleImport">弹窗导入</a-button>
 
+        <super-query :config="superQueryConfig" @search="handleSuperQuery"/>
+
         <a-dropdown v-if="checkedKeys.length > 0">
           <template #overlay>
             <a-menu>
@@ -97,6 +99,7 @@
   import { useGo } from '/@/hooks/web/usePage';
   import { router } from '/@/router';
   import { filterObj } from '/@/utils/common/compUtils';
+  import SuperQuery from '/@/components/jeecg/super/superquery/SuperQuery.vue'
   
   const go = useGo();
   const checkedKeys = ref<Array<string | number>>([]);
@@ -110,7 +113,7 @@
     api: getDemoList,
     columns,
     formConfig: {
-      labelWidth: 120,
+      //labelWidth: 120,
       schemas: searchFormSchema,
       fieldMapToTime: [['birthday', ['birthday_begin', 'birthday_end'], 'YYYY-MM-DD']],
       fieldMapToNumber: [['age', ['age_begin', 'age_end']]],

+ 1 - 1
src/views/system/position/PositionModal.vue

@@ -14,7 +14,7 @@
   const isUpdate = ref(true);
   //表单配置
   const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
-    labelWidth: 150,
+    //labelWidth: 150,
     schemas: formSchema,
     showActionButtonGroup: false,
   });

+ 2 - 2
src/views/system/user/index.vue

@@ -4,7 +4,7 @@
     <BasicTable @register="registerTable" :rowSelection="rowSelection">
       <!--插槽:table标题-->
       <template #tableTitle>
-        <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleCreate"> 新增</a-button>
+        <a-button type="primary" preIcon="ant-design:plus-outlined" v-auth="'system:user:add'" @click="handleCreate"> 新增</a-button>
         <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
         <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
         <a-button type="primary" @click="handleSyncUser" preIcon="ant-design:sync-outlined"> 同步流程</a-button>
@@ -88,7 +88,7 @@
       columns: columns,
       size: 'small',
       formConfig: {
-        labelWidth: 200,
+        // labelWidth: 200,
         schemas: searchFormSchema,
       },
       actionColumn: {