فهرست منبع

merge 数据模板、表单子表操作列宽自定义

cfort 2 سال پیش
والد
کامیت
45c3cdb578

+ 3 - 3
src/business/platform/data/templaterender/templates/list.vue

@@ -990,7 +990,7 @@ export default {
                         break
                     case 'consult': // 查阅
                         this.snapshotFile = ''
-                        if (0 && data.kuai_zhao_) {
+                        if (data.kuai_zhao_) {
                             this.snapshotFile = data.kuai_zhao_
                             setTimeout(() => {
                                 this.$refs.snapshot.handleActionEvent('preview', 0)
@@ -1260,7 +1260,8 @@ export default {
                 rowHandle = {
                     effect: this.manageEffect ? 'display' : 'default',
                     actions: manageButtons,
-                    columnHeader: this.template.attrs.manage_effect == 'Y' || this.template.attrs.manage_effect == 'N' ? null : this.template.attrs.manage_effect
+                    columnHeader: this.template.attrs.manage_effect === 'Y' || this.template.attrs.manage_effect === 'N' ? null : this.template.attrs.manage_effect,
+                    colWidth: this.template.attrs.col_width
                 }
             }
             // 查询字段
@@ -1313,7 +1314,6 @@ export default {
                 if (field.common === 'N') return
                 columns.push(this.buildSearchForm(field))
             })
-
             return columns
         },
         /**

+ 0 - 1
src/business/platform/form/formbuilder/index.vue

@@ -438,7 +438,6 @@ export default {
         },
         previewForm () {
             this.widgetFormData = JSON.parse(JSON.stringify(this.widgetForm))
-            console.log('FormData', this.widgetFormData)
             this.formrenderDialogVisible = true
         },
         /**

+ 9 - 5
src/business/platform/form/formbuilder/right-aside/editors/editor-layout.vue

@@ -71,7 +71,7 @@
                 <template slot="label">行数<help-tip prop="rows" /></template>
                 <el-input v-model="fieldOptions.rows" />
             </el-form-item>
-            <el-form-item v-if="types.includes('autosize')" label-width="110px">
+            <el-form-item v-if="types.includes('autosize')">
                 <template slot="label">自适应高度<help-tip prop="autosize" /></template>
                 <el-switch v-model="fieldOptions.autosize" />
                 <div v-if="fieldOptions.autosize">
@@ -128,11 +128,15 @@
                     />
                 </el-select>
             </el-form-item>
+            <el-form-item v-if="types.includes('colWidth')">
+                <template slot="label">操作列宽<help-tip prop="colWidth" /></template>
+                <el-input v-model="fieldOptions.colWidth" />
+            </el-form-item>
             <el-form-item v-if="types.includes('index')">
                 <template slot="label">显示序号<help-tip prop="index" /></template>
                 <el-switch v-model="fieldOptions.index" />
             </el-form-item>
-            <el-form-item v-if="types.includes('summary')" label-width="110px">
+            <el-form-item v-if="types.includes('summary')">
                 <template slot="label">表尾合计行<help-tip prop="summary" /></template>
                 <el-row>
                     <el-col :span="5">
@@ -171,10 +175,10 @@
             </el-form-item>
 
             <el-form-item v-if="types.includes('customClass')" label-width="110px">
-                <template slot="label">自定义Class(用于子表单宽度,输入数字)<help-tip prop="customClass" /></template>
-                <el-input v-model="fieldOptions.custom_class" />
+                <template slot="label">自定义Class<help-tip prop="customClass" /></template>
+                <el-input v-model="fieldOptions.custom_class" placeholder="输入数字,用于控制子表单列宽" />
             </el-form-item>
-            <el-form-item v-if="types.includes('mobile')" label-width="110px">
+            <el-form-item v-if="types.includes('mobile')">
                 <template slot="label">移动端显示<help-tip prop="mobile" /></template>
                 <el-switch v-model="isMobile" />
             </el-form-item>

+ 1 - 1
src/business/platform/form/formbuilder/right-aside/field-types/ibps-field-table.vue

@@ -27,7 +27,7 @@
             <!-- 布局设置 -->
             <editor-layout
                 :field-item="fieldItem"
-                types="mode,page,index,summary,summaryMethod,customClass"
+                types="mode,page,index,summary,summaryMethod,customClass,colWidth"
             />
         </el-form>
     </div>

+ 3 - 2
src/business/platform/form/formrender/dynamic-form/dynamic-form-table.vue

@@ -80,7 +80,7 @@
                             fixed="right"
                             class-name="hidden-print"
                             label="操作栏目"
-                            :width="manageButtons.length == 1 ? '85' : '160'"
+                            :width="colWidth ? colWidth : (manageButtons.length == 1 ? '85' : '160')"
                         >
                             <template slot-scope="scope">
                                 <el-dropdown v-if="manageButtons.length > 3">
@@ -268,7 +268,7 @@ export default {
         }
     },
     data () {
-        const { page, pageSize = defaultPageSize, mode = 'inner' } = this.field.field_options || {}
+        const { page, pageSize = defaultPageSize, mode = 'inner', colWidth } = this.field.field_options || {}
         let initData = []
         if (page === 'N' || mode === 'block' || !this.value) {
             initData = this.value || []
@@ -277,6 +277,7 @@ export default {
         }
         return {
             pageSize,
+            colWidth,
             pageSizeOptions,
             editFromType: '', // 列表编辑弹出框类型
             npmDialogFormVisible: false, // 弹窗

+ 1 - 1
src/components/ibps-crud/index.vue

@@ -317,7 +317,7 @@
                     v-if="rowHandle"
                     v-bind="rowHandle"
                     :label=" handleAttribute(rowHandle.columnHeader,'操作') "
-                    :width="handleAttribute(rowHandle.width, rowHandleDefaultWidth) < 80 ? '80' : rowHandle.actions.length !== 0 && rowHandle.actions.length <= 3 ? 90 + 60 * (rowHandle.actions.length - 1) : 90"
+                    :width="rowHandle.colWidth ? rowHandle.colWidth : (handleAttribute(rowHandle.width, rowHandleDefaultWidth) < 80 ? '80' : rowHandle.actions.length !== 0 && rowHandle.actions.length <= 3 ? 90 + 60 * (rowHandle.actions.length - 1) : 90)"
                     :fixed="handleAttribute(rowHandle.fixed, 'right')"
                     :align="handleAttribute(rowHandle.align, 'center')"
                 >