Эх сурвалжийг харах

fix:修复数据模板脚本里selection的赋值

liujiayin 2 жил өмнө
parent
commit
20176f720e

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

@@ -21,7 +21,7 @@
             :dynamic-params="dynamicParams"
             :form-name="template ? template.attrs.form_name : ''"
             :class="{ 'ibps-data-template-list__preview': preview }"
-            :selection_all="selectionAll"
+            :selection-all="selectionAll"
             @display-field-change="handleDisplayField"
             @header-dragend="handleHeaderDragend"
             @selection-change="handleSelectionChange"

+ 2 - 2
src/components/ibps-crud/mixin/base.js

@@ -101,7 +101,7 @@ export default {
      * 
      */
     selectionAll: {
-      type: Object,
+      type: [Object, Array],
       default: null
   }
   },
@@ -263,7 +263,7 @@ export default {
       const buttonKey = action.key
       let selection = null// 选中数据
       if (position === 'toolbar') { // 工具栏
-        if (this.selectionAll) {
+        if (this.$utils.isArray(this.selectionAll) && this.selectionAll.length) {
           selection = this.selectionAll.map(i => i.id_) // 默认给所有已选择的数据id
       } else {
           selection = this.getSelectedIds()