Procházet zdrojové kódy

增加管理列按钮类型设置

cfort před 2 roky
rodič
revize
77291a285d

+ 5 - 5
src/business/platform/data/templatebuilder/right-aside/components/attr-list.vue

@@ -78,22 +78,22 @@
                 </el-form-item>
 
                 <el-form-item>
-                    <template slot="label">管理列主题:</template>
-                    <!-- <el-switch
+                    <template slot="label">管理列主题:</template>
+                    <el-switch
                         v-model="attrs.manage_effect"
                         active-value="Y"
                         inactive-value="N"
                         active-text="按钮"
                         inactive-text="默认"
                         @change="(value)=>handleData('manage_effect',value)"
-                    /> -->
-                    <el-input
+                    />
+                    <!-- <el-input
                         v-model="attrs.manage_effect"
                         placeholder="输入管理主题"
                         size="mini"
                         clearable
                         @change="(value)=>handleData('manage_effect',value)"
-                    />
+                    /> -->
                 </el-form-item>
                 <el-form-item>
                     <template slot="label">管理列宽:</template>

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

@@ -1256,8 +1256,7 @@ export default {
             // 打印模版
             this.printTemplateId = this.getPrintTemplateId()
             // 管理主题
-            this.manageEffect = true
-            // this.template.attrs ? this.$utils.toBoolean(this.template.attrs.manage_effect) : false
+            this.manageEffect = this.template.attrs ? this.$utils.toBoolean(this.template.attrs.manage_effect) : false
 
             const functionButtons = this.template.buttons ? this.template.buttons.function_buttons || [] : []
             // 工具栏
@@ -1306,7 +1305,8 @@ export default {
 
             if (this.$utils.isNotEmpty(manageButtons)) {
                 rowHandle = {
-                    effect: this.manageEffect ? 'display' : 'default',
+                    // effect: this.manageEffect ? 'display' : 'default',
+                    effect: this.template.attrs.manage_effect === 'Y' ? 'display' : 'default',
                     actions: manageButtons,
                     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

+ 0 - 2
src/components/ibps-crud/index.vue

@@ -162,7 +162,6 @@
                 />
                 <slot name="prepend-column" />
                 <template v-for="(column, index) in tableColumns">
-
                     <el-table-column
                         v-if="showColumn(column)"
                         :key="index"
@@ -174,7 +173,6 @@
                         v-bind="column"
                         show-overflow-tooltip
                     >
-
                         <template slot="header">
                             <slot :name="column.headerName" :column="column" />
                         </template>

+ 56 - 56
src/components/ibps-crud/mixin/handleRow.js

@@ -1,67 +1,67 @@
 
 export default {
-  props: {
+    props: {
     /**
      * @description 管理列
      */
-    rowHandle: {
-      /* type: Object,
+        rowHandle: {
+            /* type: Object,
       default: null */
-    }
-  },
-  computed: {
-    rowHandleDisplayButtonnumber() {
-      if (!this.rowHandle) return 2
-      return this.rowHandle.buttonNumber || 2
-    },
-    rowHandleDisplay() {
-      return this.rowHandle.effect === 'display'
-    },
-    rowHandleActions() {
-      if (!this.rowHandle || !this.rowHandle.actions) return null
-      if (this.rowHandleDisplay) {
-        return this.rowHandle.actions.length >= this.rowHandleDisplayButtonnumber ? this.rowHandle.actions.slice(0, this.rowHandleDisplayButtonnumber) : this.rowHandle.actions
-      } else {
-        return this.rowHandle.actions
-      }
-    },
-    rowHandleMoreActions() {
-      return this.rowHandle && this.rowHandle.actions.length >= this.rowHandleDisplayButtonnumber ? this.rowHandle.actions.slice(this.rowHandleDisplayButtonnumber, this.rowHandle.actions.length) : null
+        }
     },
-    rowHandleDefaultWidth() {
-      if (this.rowHandleDisplay) {
-        return this.rowHandleDisplayButtonnumber * 70 + 50
-      } else {
-        return this.$i18n.locale === 'en' ? 75 : 50
-      }
-    }
-  },
-  methods: {
-    /**
-     * 是否有按钮
-     * @param {*} row  行的数据
-     * @param {*} data
-     */
-    hasRowHandleActions(row, data) {
-      if (!this.rowHandleActions) return false
-      for (let i = 0; i < this.rowHandleActions.length; i++) {
-        if (this.handleActionHidden(this.rowHandleActions[i].hidden, row, data)) {
-          return true
+    computed: {
+        rowHandleDisplayButtonnumber () {
+            if (!this.rowHandle) return 2
+            return this.rowHandle.buttonNumber || 2
+        },
+        rowHandleDisplay () {
+            return this.rowHandle.effect === 'display'
+        },
+        rowHandleActions () {
+            if (!this.rowHandle || !this.rowHandle.actions) return null
+            if (this.rowHandleDisplay) {
+                return this.rowHandle.actions.length >= this.rowHandleDisplayButtonnumber ? this.rowHandle.actions.slice(0, this.rowHandleDisplayButtonnumber) : this.rowHandle.actions
+            } else {
+                return this.rowHandle.actions
+            }
+        },
+        rowHandleMoreActions () {
+            return this.rowHandle && this.rowHandle.actions.length >= this.rowHandleDisplayButtonnumber ? this.rowHandle.actions.slice(this.rowHandleDisplayButtonnumber, this.rowHandle.actions.length) : null
+        },
+        rowHandleDefaultWidth () {
+            if (this.rowHandleDisplay) {
+                return this.rowHandleDisplayButtonnumber * 70 + 50
+            } else {
+                return this.$i18n.locale === 'en' ? 75 : 50
+            }
         }
-      }
-      return false
     },
-    /**
-     * 处理按钮隐藏,显示
-     */
-    handleActionHidden(hidden = false, row, data) {
-      let isHidden = !hidden
-      if (typeof hidden === 'boolean') {
-        isHidden = !hidden
-      } else if (typeof hidden === 'function') {
-        isHidden = !hidden.call(this, row, data)
-      }
-      return isHidden
+    methods: {
+        /**
+         * 是否有按钮
+         * @param {*} row  行的数据
+         * @param {*} data
+         */
+        hasRowHandleActions (row, data) {
+            if (!this.rowHandleActions) return false
+            for (let i = 0; i < this.rowHandleActions.length; i++) {
+                if (this.handleActionHidden(this.rowHandleActions[i].hidden, row, data)) {
+                    return true
+                }
+            }
+            return false
+        },
+        /**
+         * 处理按钮隐藏,显示
+         */
+        handleActionHidden (hidden = false, row, data) {
+            let isHidden = !hidden
+            if (typeof hidden === 'boolean') {
+                isHidden = !hidden
+            } else if (typeof hidden === 'function') {
+                isHidden = !hidden.call(this, row, data)
+            }
+            return isHidden
+        }
     }
-  }
 }