Browse Source

add:在数据模板管理配置启动流程

liujiayin 2 years ago
parent
commit
7036ff1424

+ 6 - 0
src/business/platform/data/constants/buttons.js

@@ -84,6 +84,12 @@ const buttons = {
     icon: 'ibps-icon-export',
     scope: ['toolbar'],
   },
+  'bianZhi': {
+    label: '编制',
+    type: 'primary',
+    icon: 'ibps-icon-export',
+    scope: ['toolbar'],
+  },
   'close': {
     label: '关闭',
     type: 'default',

+ 1 - 1
src/business/platform/data/templatebuilder/right-aside/constants/default-value.js

@@ -89,7 +89,7 @@ export const fucntionButtonDefaultValue = {
   position: 'all'
 }
 
-export const functionListButtonTypes = ['search', 'resetSearch', 'add', 'remove', 'edit', 'detail', 'print', 'import', 'export', 'sefStartFlow', 'custom', 'exportMuBan']
+export const functionListButtonTypes = ['search', 'resetSearch', 'add', 'remove', 'edit', 'detail', 'print', 'import', 'export', 'sefStartFlow', 'custom', 'exportMuBan','bianZhi']
 // export const functionListButtonTypes = ['search', 'resetSearch', 'add', 'remove', 'edit', 'detail', 'sefStartFlow', 'custom']
 
 // export const functionTreeButtonTypes = ['refresh', 'expand', 'compress', 'custom']

+ 103 - 57
src/business/platform/data/templatebuilder/right-aside/editors/editor-button.vue

@@ -1,77 +1,101 @@
 <template>
-  <el-form
-    ref="form"
-    :model="formData"
-    :rules="rules"
-    label-width="120px"
-    size="mini"
-    @submit.native.prevent
-  >
-    <el-form-item label="按钮名称" required prop="label">
-      <el-input v-model="formData.label" placeholder="按钮名称" />
+  <el-form ref="form"
+           :model="formData"
+           :rules="rules"
+           label-width="120px"
+           size="mini"
+           @submit.native.prevent>
+    <el-form-item label="按钮名称"
+                  required
+                  prop="label">
+      <el-input v-model="formData.label"
+                placeholder="按钮名称" />
     </el-form-item>
-    <el-form-item
-      v-if="formData && (formData.button_type === 'custom' || formData.button_type === 'sefStartFlow') "
-      label="按钮编码"
-      prop="code"
-      required
-    >
-      <el-input v-model="formData.code" placeholder="按钮编码" />
+    <el-form-item v-if="formData && (formData.button_type === 'custom' || formData.button_type === 'sefStartFlow') "
+                  label="按钮编码"
+                  prop="code"
+                  required>
+      <el-input v-model="formData.code"
+                placeholder="按钮编码" />
     </el-form-item>
-    <el-form-item label="权限" prop="rights">
+    <el-form-item label="权限"
+                  prop="rights">
       <rights-selector v-model="formData.rights" />
     </el-form-item>
-    <el-form-item v-if="type==='function'" label="按钮位置" prop="position">
+    <el-form-item v-if="type==='function'"
+                  label="按钮位置"
+                  prop="position">
       <el-radio-group v-model="formData.position">
-        <el-radio-button
-          v-for="t in positionType"
-          :key="t.value"
-          :label="t.value"
-        >{{ t.label }}</el-radio-button>
+        <el-radio-button v-for="t in positionType"
+                         :key="t.value"
+                         :label="t.value">{{ t.label }}</el-radio-button>
       </el-radio-group>
     </el-form-item>
-    <el-form-item label="按钮颜色" prop="style">
-      <el-select v-model="formData.style" placeholder="按钮颜色">
-        <el-option
-          v-for="item in colors"
-          :key="item.type"
-          :label="item.label"
-          :value="item.type"
-        >
-          <el-link :underline="false" :type="item.type " style="float: left">{{ item.label }}</el-link>
+    <el-form-item label="按钮颜色"
+                  prop="style">
+      <el-select v-model="formData.style"
+                 placeholder="按钮颜色">
+        <el-option v-for="item in colors"
+                   :key="item.type"
+                   :label="item.label"
+                   :value="item.type">
+          <el-link :underline="false"
+                   :type="item.type "
+                   style="float: left">{{ item.label }}</el-link>
         </el-option>
       </el-select>
     </el-form-item>
-    <el-form-item label="按钮图标" prop="icon">
-      <ibps-icon-select v-model="formData.icon" icon="el-icon-search" />
+    <el-form-item label="按钮图标"
+                  prop="icon">
+      <ibps-icon-select v-model="formData.icon"
+                        icon="el-icon-search" />
     </el-form-item>
-    <el-form-item v-if="formData && formData.button_type === 'export'" label="导出字段" prop="icon">
-      <el-button size="small" type="primary" @click="handleExportFields">设置导出字段</el-button>
+    <el-form-item v-if="formData && formData.button_type === 'export'"
+                  label="导出字段"
+                  prop="icon">
+      <el-button size="small"
+                 type="primary"
+                 @click="handleExportFields">设置导出字段</el-button>
     </el-form-item>
-
-    <el-form-item v-if="formData && formData.button_type === 'sefStartFlow'" prop="deflow">
+    <el-form-item v-if="formData && formData.button_type === 'bianZhi'"
+                  label="编制流程设置"
+                  prop="icon">
+      <el-button size="small"
+                 type="primary"
+                 @click="handleBianZhi">编制流程设置</el-button>
+      <p>流程id:{{formData.defId}}</p>
+      <p>流程key:{{formData.defKey}}</p>
+      <p>流程名称:{{formData.defName}}</p>
+    </el-form-item>
+    <el-form-item v-if="formData && formData.button_type === 'sefStartFlow'"
+                  prop="deflow">
       <label slot="label">
         绑定流程
-        <el-tooltip class="item" effect="light" placement="bottom">
-          <div slot="content" style="line-height:1.5;">
+        <el-tooltip class="item"
+                    effect="light"
+                    placement="bottom">
+          <div slot="content"
+               style="line-height:1.5;">
             先在模板属性绑定表单,此流程定义数据才有!
           </div>
           <i class="ibps-icon-help" />:
         </el-tooltip>
       </label>
-      <bpm-def-selector
-        v-model="formData.deflow"
-        value-key="defKey"
-        :form-key="formKey"
-        :is-data-template-use="true"
-      />
+      <bpm-def-selector v-model="formData.deflow"
+                        value-key="defKey"
+                        :form-key="formKey"
+                        :is-data-template-use="true" />
     </el-form-item>
-    <export-column
-      :visible="exportFieldDialogVisible"
-      :data="template"
-      @callback="handleExportColumn"
-      @close="(visible)=>exportFieldDialogVisible=visible"
-    />
+    <export-column :visible="exportFieldDialogVisible"
+                   :data="template"
+                   @callback="handleExportColumn"
+                   @close="(visible)=>exportFieldDialogVisible=visible" />
+    <!-- 流程定义选择器 -->
+    <bpm-def-dialog :visible="dialogVisible"
+                    :form-key="formKey"
+                    :isDataTemplateUse="dialogVisible"
+                    @close="(visible) => (dialogVisible = visible)"
+                    @action-event="handleDialogActionEvent" />
   </el-form>
 </template>
 <script>
@@ -80,12 +104,14 @@ import BpmDefSelector from '@/business/platform/bpmn/definition/selector'
 import RightsSelector from '@/business/platform/rights/config/selector'
 
 import ExportColumn from '../components/export-column'
+import BpmDefDialog from '@/business/platform/bpmn/definition/dialog'
 
 export default {
   components: {
     RightsSelector,
     BpmDefSelector,
-    ExportColumn
+    ExportColumn,
+    BpmDefDialog
   },
   props: {
     data: {
@@ -111,10 +137,14 @@ export default {
         { type: 'danger', label: '危险' }
       ],
       exportFieldDialogVisible: false,
+      dialogVisible: false,
       formName: 'form',
       formData: {
-        style: 'primary'
+        style: 'primary',
       },
+      defId: '',
+      defName: '',
+      defKey: '',
       rules: {
         label: [{ required: true, message: this.$t('validate.required') }]
       }
@@ -174,7 +204,7 @@ export default {
     }
   },
   methods: {
-  // 获取表单数据
+    // 获取表单数据
     getFormData(callback) {
       this.$refs[this.formName].validate((valid) => {
         if (valid) {
@@ -187,12 +217,28 @@ export default {
     handleExportFields() {
       this.exportFieldDialogVisible = true
     },
+    handleBianZhi() {
+      this.dialogVisible = true
+    },
+
     handleExportColumn(data) {
       this.handleData('export_columns', data)
     },
     handleData(key, value) {
       this.$emit('callback', key, value)
-    }
+    },
+    handleDialogActionEvent(key, data) {
+      if (key === 'clean') {
+        this.dialogValue = {}
+      }
+      if (key === 'confirm') {
+        this.formData.defId = data.defId
+        this.formData.defName = data.name
+        this.formData.defKey = data.defKey
+        this.dialogVisible = false
+      }
+
+    },
   }
 }
 </script>

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

@@ -221,7 +221,8 @@ export default {
             scanVisible: false,
             scanName: '',
             obj: '',
-
+            defid:'',
+            runQianPah:'',
             initialization: false,
             tableHeight: document.body.clientHeight,
             listIdentity: '',
@@ -778,6 +779,10 @@ export default {
                         break
                     case 'custom': // 自定义按钮
                         break
+                    case 'bianZhi': // 编制
+                        this.npmDialogFormVisible =true
+                        this.defId = this.defId
+                    break
                     case 'print': // 打印
                         ActionUtils.selectedRecord(selection)
                             .then((id) => {
@@ -985,6 +990,11 @@ export default {
             // this.template.attrs ? this.$utils.toBoolean(this.template.attrs.manage_effect) : false
 
             const functionButtons = this.template.buttons ? this.template.buttons.function_buttons || [] : []
+            for(var i of functionButtons){
+                if(i.button_type=='bianZhi'){
+                    this.defId=i.defId
+                }
+            }
             // 工具栏
             const toolbarButtons = []
             // 管理列

+ 297 - 295
src/components/ibps-crud/mixin/base.js

@@ -1,305 +1,307 @@
 import { debounce } from 'lodash'
 
 export default {
-  props: {
-    isTree: {
-      type: Boolean,
-      default: false
-    },
-    /**
-     *  尺寸
-     */
-    size: {
-      type: String
-    },
-    /**
-     * @description 工具栏
-     */
-    toolbars: {
-      type: [Array, Boolean]
-    },
-    /**
-     * @description 查询表单
-     */
-    searchForm: {
-      type: Object
-    },
-    /**
-     *  @description 表格标题
-     */
-    title: {
-      type: String,
-      default: ''
-    },
-    /**
-     * @description 主键
-     */
-    pkKey: {
-      type: String
-    },
-    /**
-     * @description 表头数据
-     */
-    columns: {
-      type: Array,
-      required: true
-    },
-    /**
-     * @description 表格加载
-     */
-    loading: {
-      type: Boolean,
-      default: false
-    },
-    /**
-     * @description 表格加载配置
-     */
-    loadingOptions: {
-      type: Object,
-      default: null
-    },
-    /**
-     * @description 表格配置
-     */
-    options: {
-      type: Object,
-      default: () => {
-        return {
-          border: true,
-          stripe: true
+    props: {
+        isTree: {
+            type: Boolean,
+            default: false
+        },
+        /**
+         *  尺寸
+         */
+        size: {
+            type: String
+        },
+        /**
+         * @description 工具栏
+         */
+        toolbars: {
+            type: [Array, Boolean]
+        },
+        /**
+         * @description 查询表单
+         */
+        searchForm: {
+            type: Object
+        },
+        /**
+         *  @description 表格标题
+         */
+        title: {
+            type: String,
+            default: ''
+        },
+        /**
+         * @description 主键
+         */
+        pkKey: {
+            type: String
+        },
+        /**
+         * @description 表头数据
+         */
+        columns: {
+            type: Array,
+            required: true
+        },
+        /**
+         * @description 表格加载
+         */
+        loading: {
+            type: Boolean,
+            default: false
+        },
+        /**
+         * @description 表格加载配置
+         */
+        loadingOptions: {
+            type: Object,
+            default: null
+        },
+        /**
+         * @description 表格配置
+         */
+        options: {
+            type: Object,
+            default: () => {
+                return {
+                    border: true,
+                    stripe: true
+                }
+            }
+        },
+        /**
+         * @description 索引
+         */
+        indexRow: {
+            type: [Object, Boolean],
+            default: true
+        },
+        /**
+         * @description 多选
+         */
+        selectionRow: {
+            type: [Object, Boolean],
+            default: true
+        },
+        /* 自定义表单名称*/
+        formName: {
+            type: String
+        },
+        /**
+         * @description 类型
+         * [可选值] radio/checkbox
+         */
+        selectionType: {
+            type: String,
+            default: 'checkbox'
         }
-      }
-    },
-    /**
-     * @description 索引
-     */
-    indexRow: {
-      type: [Object, Boolean],
-      default: true
-    },
-    /**
-     * @description 多选
-     */
-    selectionRow: {
-      type: [Object, Boolean],
-      default: true
-    },
-    /* 自定义表单名称*/
-    formName:{
-      type: String
-    },
-    /**
-     * @description 类型
-     * [可选值] radio/checkbox
-     */
-    selectionType: {
-      type: String,
-      default: 'checkbox'
-    }
-  },
-  methods: {
-    /* 表格換颜色*/
-    tableRowClassName({row, rowIndex}) {
-      if (rowIndex % 2 === 1) return "warning-row"
-      return 'success-row'
-          },
-    setSelectionRadio(row) {
-      const radio = row ? this.getPkValue(row) : ''
-      if (radio !== this.selectionRadio) {
-        this.$set(this, 'selectionRadio', radio)
-      }
-    },
-    clearSelection() {
-      if (this.selectionType === 'radio') {
-        this.setSelectionRadio()
-      } else {
-        this.$refs.elTable.clearSelection()
-      }
-    },
-    toggleRowSelection(row, selected) {
-      if (this.selectionType !== 'radio') {
-        this.$refs.elTable.toggleRowSelection(row, selected)
-      }
-    },
-    toggleAllSelection() {
-      this.$refs.elTable.toggleAllSelection()
-    },
-    toggleSelectionRow(row, selected) {
-      const pkValue = this.getPkValue(row)
-      for (var i = 0; i < this.ibpsData.length; i++) {
-        const data = this.ibpsData[i]
-        if (this.getPkValue(data) === pkValue) {
-          this.$refs.elTable.toggleRowSelection(data, selected)
-        }
-      }
-    },
-    /**
-     * @description 处理工具栏收缩/展开
-     */
-    handleCollapseExpandToolbar() {
-      this.showToolbar = !this.showToolbar
-      this.handleTableHeight(true)
-      this.$emit('collapse-expand-toolbar', this.showToolbar)
-    },
-    /**
-     * @description 行选中状态
-     */
-    handleCurrentChange(currentRow, oldCurrentRow) {
-      this.$emit('current-change', currentRow, oldCurrentRow)
-    },
-    /**
-     * @description 勾选数据时触发的事件
-     */
-    handleSelect(selection, row) {
-      this.$emit('select', selection, row)
-    },
-    /**
-     * @description 勾选全选时触发的事件
-     */
-    handleSelectAll(selection) {
-      this.$emit('select-all', selection)
-    },
-    /**
-     * @description 复选框选择项发生变化时触发的事件
-     */
-    handleSelectionChange(selection) {
-      this.$selections = selection
-      this.$emit('selection-change', selection)
-    },
-    /**
-     * @description 单元格 hover 进入时触发的事件
-     */
-    handleCellMouseEnter(row, column, cell, event) {
-      this.$emit('cell-mouse-enter', row, column, cell, event)
-    },
-    /**
-     * @description 单元格 hover 退出时触发的事件
-     */
-    handleCellMouseLeave(row, column, cell, event) {
-      this.$emit('cell-mouse-leave', row, column, cell, event)
-    },
-    /**
-     * @description 单元格点击时触发的事件
-     */
-    handleCellClick(row, column, cell, event) {
-      this.$emit('cell-click', row, column, cell, event)
-    },
-    /**
-     * @description 单元格双击时触发的事件
-     */
-    handleCellDblclick(row, column, cell, event) {
-      this.$emit('cell-dblclick', row, column, cell, event)
-    },
-    /**
-     * @description 行点击时触发的事件
-     */
-    handleRowClick(row, event, column) {
-      if (this.selectionType === 'radio') {
-        this.setSelectionRadio(row)
-        this.$emit('selection-change', row)
-      } else {
-        this.$refs.elTable.toggleRowSelection(row)
-      }
-      this.$emit('row-click', row, event, column)
-    },
-    /**
-     * @description 行右键点击时触发的事件
-     */
-    handleRowContextmenu(row, event) {
-      this.$emit('row-contextmenu', row, event)
-    },
-    /**
-     * @description 行双击时触发的事件
-     */
-    handleRowDblclick(row, event) {
-      this.$emit('row-dblclick', row, event)
-    },
-    /**
-     * @description 表头点击时触发的事件
-     */
-    handleHeaderClick(column, event) {
-      this.$emit('header-click', column, event)
-    },
-    /**
-     * @description 当拖动表头改变了列的宽度的时候会触发该事件
-     */
-    handleHeaderDragend(newWidth, oldWidth, column, event) {
-      debounce(this.handleTableHeight, 100)()
-      this.$emit('header-dragend', newWidth, oldWidth, column, event)
     },
+    methods: {
+        /* 表格換颜色*/
+        tableRowClassName({ row, rowIndex }) {
+            if (rowIndex % 2 === 1) return "warning-row"
+            return 'success-row'
+        },
+        setSelectionRadio(row) {
+            const radio = row ? this.getPkValue(row) : ''
+            if (radio !== this.selectionRadio) {
+                this.$set(this, 'selectionRadio', radio)
+            }
+        },
+        clearSelection() {
+            if (this.selectionType === 'radio') {
+                this.setSelectionRadio()
+            } else {
+                this.$refs.elTable.clearSelection()
+            }
+        },
+        toggleRowSelection(row, selected) {
+            if (this.selectionType !== 'radio') {
+                this.$refs.elTable.toggleRowSelection(row, selected)
+            }
+        },
+        toggleAllSelection() {
+            this.$refs.elTable.toggleAllSelection()
+        },
+        toggleSelectionRow(row, selected) {
+            const pkValue = this.getPkValue(row)
+            for (var i = 0; i < this.ibpsData.length; i++) {
+                const data = this.ibpsData[i]
+                if (this.getPkValue(data) === pkValue) {
+                    this.$refs.elTable.toggleRowSelection(data, selected)
+                }
+            }
+        },
+        /**
+         * @description 处理工具栏收缩/展开
+         */
+        handleCollapseExpandToolbar() {
+            this.showToolbar = !this.showToolbar
+            this.handleTableHeight(true)
+            this.$emit('collapse-expand-toolbar', this.showToolbar)
+        },
+        /**
+         * @description 行选中状态
+         */
+        handleCurrentChange(currentRow, oldCurrentRow) {
+            this.$emit('current-change', currentRow, oldCurrentRow)
+        },
+        /**
+         * @description 勾选数据时触发的事件
+         */
+        handleSelect(selection, row) {
+            this.$emit('select', selection, row)
+        },
+        /**
+         * @description 勾选全选时触发的事件
+         */
+        handleSelectAll(selection) {
+            this.$emit('select-all', selection)
+        },
+        /**
+         * @description 复选框选择项发生变化时触发的事件
+         */
+        handleSelectionChange(selection) {
+            this.$selections = selection
+            this.$emit('selection-change', selection)
+        },
+        /**
+         * @description 单元格 hover 进入时触发的事件
+         */
+        handleCellMouseEnter(row, column, cell, event) {
+            this.$emit('cell-mouse-enter', row, column, cell, event)
+        },
+        /**
+         * @description 单元格 hover 退出时触发的事件
+         */
+        handleCellMouseLeave(row, column, cell, event) {
+            this.$emit('cell-mouse-leave', row, column, cell, event)
+        },
+        /**
+         * @description 单元格点击时触发的事件
+         */
+        handleCellClick(row, column, cell, event) {
+            this.$emit('cell-click', row, column, cell, event)
+        },
+        /**
+         * @description 单元格双击时触发的事件
+         */
+        handleCellDblclick(row, column, cell, event) {
+            this.$emit('cell-dblclick', row, column, cell, event)
+        },
+        /**
+         * @description 行点击时触发的事件
+         */
+        handleRowClick(row, event, column) {
+            if (this.selectionType === 'radio') {
+                this.setSelectionRadio(row)
+                this.$emit('selection-change', row)
+            } else {
+                this.$refs.elTable.toggleRowSelection(row)
+            }
+            this.$emit('row-click', row, event, column)
+        },
+        /**
+         * @description 行右键点击时触发的事件
+         */
+        handleRowContextmenu(row, event) {
+            this.$emit('row-contextmenu', row, event)
+        },
+        /**
+         * @description 行双击时触发的事件
+         */
+        handleRowDblclick(row, event) {
+            this.$emit('row-dblclick', row, event)
+        },
+        /**
+         * @description 表头点击时触发的事件
+         */
+        handleHeaderClick(column, event) {
+            this.$emit('header-click', column, event)
+        },
+        /**
+         * @description 当拖动表头改变了列的宽度的时候会触发该事件
+         */
+        handleHeaderDragend(newWidth, oldWidth, column, event) {
+            debounce(this.handleTableHeight, 100)()
+            this.$emit('header-dragend', newWidth, oldWidth, column, event)
+        },
 
-    /**
-     * @description 表头右键点击时触发的事件
-     */
-    handleHeaderContextmenu(column, event) {
-      this.$emit('header-contextmenu', column, event)
-    },
-    /**
-     * @description 处理按钮的事件 【包含增删改查】
-     * @param {*} button
-     * @param {*} position
-     * @param {*} data
-     */
-    handleActionEvent(action, position, data, index) {
-      if (position === 'toolbar') {
-        data = this.$selections
-      }
-      if (action.emit) {
-        this.$emit(action.emit, {
-          key: action.key,
-          index: index,
-          row: data,
-          position: position,
-          action: action })
-      }
-      const buttonKey = action.key
-      let selection = null// 选中数据
-      if (position === 'toolbar') { // 工具栏
-        selection = this.getSelectedIds()
-      } else { // 管理列
-        selection = data ? this.getPkValue(data) : null
-      }
-      this.$emit('action-event', buttonKey, position, selection, data, index, action)
-    },
+        /**
+         * @description 表头右键点击时触发的事件
+         */
+        handleHeaderContextmenu(column, event) {
+            this.$emit('header-contextmenu', column, event)
+        },
+        /**
+         * @description 处理按钮的事件 【包含增删改查】
+         * @param {*} button
+         * @param {*} position
+         * @param {*} data
+         */
+        handleActionEvent(action, position, data, index) {
+            if (position === 'toolbar') {
+                data = this.$selections
+            }
+            if (action.emit) {
+                this.$emit(action.emit, {
+                    key: action.key,
+                    index: index,
+                    row: data,
+                    position: position,
+                    action: action
+                })
+            }
+            const buttonKey = action.key
+            let selection = null// 选中数据
+            if (position === 'toolbar') { // 工具栏
+                selection = this.getSelectedIds()
+            } else { // 管理列
+                selection = data ? this.getPkValue(data) : null
+            }
 
-    /**
-     * 根据key获取对象的值
-     * 用于解决key值大小写不同的问题
-     * @param {Object} data 需要从中获取值的对象
-     */
-    getPkValue(data, defaultValue = '') {
-      const pkKey = this.pkKey || 'id'
-      // 创建一个忽略大小写的正则对象
-      const regx = new RegExp(`^${pkKey}$`, 'gi')
-      // 循环正则匹配
-      for (const key in data) {
-        // 匹配成功返回值
-        if (regx.test(key)) {
-          return data[key]
-        }
-      }
-      return defaultValue
-    },
-    /**
-     * @description 获取选中的值
-     */
-    getSelectedIds() {
-      if (this.selectionType === 'radio') {
-        if (this.selectionRadio === null || this.selectionRadio === undefined) {
-          return
-        }
-        return this.selectionRadio
-      } else {
-        if (this.$selections === null || this.$selections === undefined) {
-          return
+            this.$emit('action-event', buttonKey, position, selection, data, index, action)
+        },
+
+        /**
+         * 根据key获取对象的值
+         * 用于解决key值大小写不同的问题
+         * @param {Object} data 需要从中获取值的对象
+         */
+        getPkValue(data, defaultValue = '') {
+            const pkKey = this.pkKey || 'id'
+            // 创建一个忽略大小写的正则对象
+            const regx = new RegExp(`^${pkKey}$`, 'gi')
+            // 循环正则匹配
+            for (const key in data) {
+                // 匹配成功返回值
+                if (regx.test(key)) {
+                    return data[key]
+                }
+            }
+            return defaultValue
+        },
+        /**
+         * @description 获取选中的值
+         */
+        getSelectedIds() {
+            if (this.selectionType === 'radio') {
+                if (this.selectionRadio === null || this.selectionRadio === undefined) {
+                    return
+                }
+                return this.selectionRadio
+            } else {
+                if (this.$selections === null || this.$selections === undefined) {
+                    return
+                }
+                const ids = []
+                this.$selections.map((item) => {
+                    ids.push(this.getPkValue(item))
+                })
+                return ids
+            }
         }
-        const ids = []
-        this.$selections.map((item) => {
-          ids.push(this.getPkValue(item))
-        })
-        return ids
-      }
-    }
 
-  }
+    }
 }