Bläddra i källkod

数据模板按钮调整

cfort 2 år sedan
förälder
incheckning
8a599bb50e

BIN
src/assets/images/login/bgImg.png


BIN
src/assets/images/login/company.png


+ 150 - 135
src/business/platform/bpmn/definition/dialog.vue

@@ -1,140 +1,155 @@
 <template>
-  <ibps-selector-dialog
-    :value="selectedValue"
-    :visible="selectorVisible"
-    v-bind="$props"
-    @input="value => selectedValue = value"
-    @remove-select="setSelectRow"
-    @close="handleClose"
-    @action-event="handleActionEvent"
-  >
-    <template slot-scope="scope">
-      <ibps-selector-panel
-        ref="panel"
-        v-bind="scope"
-        :form-key="formKey"
-        :is-super="isSuper"
-        :is-data-template-use="isDataTemplateUse"
-        @selected="value => selectedValue = value"
-      />
-    </template>
-  </ibps-selector-dialog>
+    <ibps-selector-dialog
+        :value="selectedValue"
+        :visible="selectorVisible"
+        v-bind="$props"
+        @input="value => selectedValue = value"
+        @remove-select="setSelectRow"
+        @close="handleClose"
+        @action-event="handleActionEvent"
+    >
+        <template slot-scope="scope">
+            <ibps-selector-panel
+                ref="panel"
+                v-bind="scope"
+                :form-key="formKey"
+                :is-super="isSuper"
+                :is-data-template-use="isDataTemplateUse"
+                @selected="value => selectedValue = value"
+            />
+        </template>
+    </ibps-selector-dialog>
 </template>
 <script>
-import IbpsSelectorDialog from '@/components/ibps-selector/dialog'
-import IbpsSelectorPanel from './panel'
-export default {
-  components: {
-    IbpsSelectorDialog,
-    IbpsSelectorPanel
-  },
-  props: {
-    visible: Boolean, // 是否可见
-    title: { // 标题
-      type: String,
-      default: '流程定义选择器'
-    },
-    // 是否查询所有
-    isSuper: {
-      type: Boolean,
-      default: false
-    },
-    marginTop: { // Dialog CSS 中的 margin-top 值
-      type: String,
-      default: '5vh'
-    },
-    width: { // 宽
-      type: String,
-      default: '60%'
-    },
-    height: { // 高
-      type: String,
-      default: '415px'
-    },
-    closeOnClickModal: { // 是否可以通过点击 modal 关闭 Dialog
-      type: Boolean,
-      default: false
-    },
-    closeOnPressEscape: { // 是否可以通过按下 ESC 关闭 Dialog
-      type: Boolean,
-      default: false
-    },
-    showClose: { // 是否显示关闭按钮
-      type: Boolean,
-      default: true
-    },
-    isDataTemplateUse: {
-      type: Boolean,
-      default: false
-    },
-    beforeClose: { // 关闭前的回调,会暂停 Dialog 的关闭
-      type: Function
-    },
-    fullscreen: { // 是否为全屏 Dialog
-      type: Boolean,
-      default: false
-    },
-    labelKey: { // 展示的值
-      type: String,
-      default: 'name'
-    },
-    valueKey: { // 唯一存储的值
-      type: String,
-      default: 'id'
-    },
-    formKey: String,
-    value: { // value
-      type: [Object, Array],
-      default() { return this.multiple ? [] : {} }
-    },
-    cleanClose: { // 按钮清空并关闭
-      type: Boolean,
-      default: false
-    },
-    buttons: { // 按钮组
-      type: Array
-    },
-    confirmButtonText: {
-      type: String,
-      default: '选择'
-    },
-    cleanButtonText: String,
-    cancelButtonText: String,
-    multiple: { // 是否多选
-      type: Boolean,
-      default: false
+    import IbpsSelectorDialog from '@/components/ibps-selector/dialog'
+    import IbpsSelectorPanel from './panel'
+    export default {
+        components: {
+            IbpsSelectorDialog,
+            IbpsSelectorPanel
+        },
+        props: {
+            // 是否可见
+            visible: Boolean,
+            // 标题
+            title: {
+                type: String,
+                default: '流程定义选择器'
+            },
+            // 是否查询所有
+            isSuper: {
+                type: Boolean,
+                default: false
+            },
+            // Dialog CSS 中的 margin-top 值
+            marginTop: {
+                type: String,
+                default: '5vh'
+            },
+            width: {
+                type: String,
+                default: '60%'
+            },
+            height: {
+                type: String,
+                default: '415px'
+            },
+            // 是否可以通过点击 modal 关闭 Dialog
+            closeOnClickModal: {
+                type: Boolean,
+                default: false
+            },
+            // 是否可以通过按下 ESC 关闭 Dialog
+            closeOnPressEscape: {
+                type: Boolean,
+                default: false
+            },
+            // 是否显示关闭按钮
+            showClose: {
+                type: Boolean,
+                default: true
+            },
+            isDataTemplateUse: {
+                type: Boolean,
+                default: false
+            },
+            // 关闭前的回调,会暂停 Dialog 的关闭
+            beforeClose: {
+                type: Function
+            },
+            // 是否为全屏 Dialog
+            fullscreen: {
+                type: Boolean,
+                default: false
+            },
+            // 展示的值
+            labelKey: {
+                type: String,
+                default: 'name'
+            },
+            // 唯一存储的值
+            valueKey: {
+                type: String,
+                default: 'id'
+            },
+            formKey: String,
+            value: {
+                type: [Object, Array],
+                default() {
+                    return this.multiple ? [] : {}
+                }
+            },
+            // 按钮清空并关闭
+            cleanClose: {
+                type: Boolean,
+                default: false
+            },
+            // 按钮组
+            buttons: {
+                type: Array
+            },
+            confirmButtonText: {
+                type: String,
+                default: '选择'
+            },
+            cleanButtonText: String,
+            cancelButtonText: String,
+            // 是否多选
+            multiple: {
+                type: Boolean,
+                default: false
+            }
+        },
+        data() {
+            return {
+                selectorVisible: false,
+                selectedValue: this.multiple ? [] : {}
+            }
+        },
+        watch: {
+            visible: {
+                handler: function (val, oldVal) {
+                    this.selectorVisible = this.visible
+                },
+                immediate: true
+            },
+            value() {
+                this.selectedValue = this.value
+            }
+        },
+        methods: {
+            setSelectRow() {
+                this.$refs['panel'].setSelectRow()
+            },
+            handleClose(visible) {
+                this.$emit('close', visible)
+            },
+            handleActionEvent(key, data) {
+                if (key === 'clean') {
+                    this.setSelectRow()
+                }
+                this.$emit('action-event', key, data)
+            }
+        }
     }
-  },
-  data() {
-    return {
-      selectorVisible: false,
-      selectedValue: this.multiple ? [] : {}
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.selectorVisible = this.visible
-      },
-      immediate: true
-    },
-    value() {
-      this.selectedValue = this.value
-    }
-  },
-  methods: {
-    setSelectRow() {
-      this.$refs['panel'].setSelectRow()
-    },
-    handleClose(visible) {
-      this.$emit('close', visible)
-    },
-    handleActionEvent(key, data) {
-      if (key === 'clean') {
-        this.setSelectRow()
-      }
-      this.$emit('action-event', key, data)
-    }
-  }
-}
 </script>

+ 179 - 171
src/business/platform/bpmn/definition/panel.vue

@@ -1,181 +1,189 @@
 <template>
-  <ibps-crud
-    ref="crud"
-    :height="tableHeight"
-    :data="listData"
-    :inde-row="false"
-    :toolbars="listConfig.toolbars"
-    :search-form="listConfig.searchForm"
-    :pk-key="pkKey"
-    :columns="listConfig.columns"
-    :pagination="pagination"
-    :loading="loading"
-    :selection-type="multiple?'checkbox':'radio'"
-    @selection-change="handleSelectionChange"
-    @action-event="handleAction"
-    @sort-change="handleSortChange"
-    @pagination-change="handlePaginationChange"
-  />
+    <ibps-crud
+        ref="crud"
+        :height="tableHeight"
+        :data="listData"
+        :inde-row="false"
+        :toolbars="listConfig.toolbars"
+        :search-form="listConfig.searchForm"
+        :pk-key="pkKey"
+        :columns="listConfig.columns"
+        :pagination="pagination"
+        :loading="loading"
+        :selection-type="multiple ? 'checkbox' : 'radio'"
+        @selection-change="handleSelectionChange"
+        @action-event="handleAction"
+        @sort-change="handleSortChange"
+        @pagination-change="handlePaginationChange"
+    />
 </template>
 <script>
-import { queryPageList, queryByFormKey } from '@/api/platform/bpmn/bpmDefinition'
-import ActionUtils from '@/utils/action'
-import SelectionMixin from '@/components/ibps-selector/mixins/selection'
+    import { queryPageList, queryByFormKey } from '@/api/platform/bpmn/bpmDefinition'
+    import ActionUtils from '@/utils/action'
+    import SelectionMixin from '@/components/ibps-selector/mixins/selection'
 
-export default {
-  mixins: [SelectionMixin],
-  props: {
-    value: [Object, Array],
-    // 是否查询所有
-    isSuper: {
-      type: Boolean,
-      default: false
-    },
-    button: {
-      type: Boolean,
-      default: false
-    },
-    isDataTemplateUse: {
-      type: Boolean,
-      default: false
-    },
-    formKey: String,
-    multiple: Boolean,
-    height: {
-      type: String,
-      default: '400px'
-    }
-  },
-  data() {
-    return {
-      width: 200,
-      dialogFormVisible: false, // 弹窗
-      editId: '',
+    export default {
+        mixins: [SelectionMixin],
+        props: {
+            value: [Object, Array],
+            // 是否查询所有
+            isSuper: {
+                type: Boolean,
+                default: false
+            },
+            button: {
+                type: Boolean,
+                default: false
+            },
+            isDataTemplateUse: {
+                type: Boolean,
+                default: false
+            },
+            formKey: String,
+            multiple: Boolean,
+            height: {
+                type: String,
+                default: '400px'
+            }
+        },
+        data() {
+            return {
+                width: 200,
+                // 弹窗
+                dialogFormVisible: false,
+                editId: '',
 
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      loading: false,
-      listData: [],
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' }
-        ],
-        // 查询条件
-        searchForm: {
-          labelWidth: 50,
-          forms: [
-            { prop: 'Q^name_^SL', label: '名称', itemWidth: '200' },
-            {
-              prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'],
-              label: '创建时间',
-              fieldType: 'daterange',
-              labelWidth: 80,
-              itemWidth: 220
+                // 主键  如果主键不是pk需要传主键
+                pkKey: 'id',
+                loading: false,
+                listData: [],
+                listConfig: {
+                    // 工具栏
+                    toolbars: [{ key: 'search' }],
+                    // 查询条件
+                    searchForm: {
+                        labelWidth: 50,
+                        forms: [
+                            {
+                                prop: 'Q^name_^SL',
+                                label: '名称',
+                                itemWidth: '200'
+                            },
+                            {
+                                prop: [
+                                    'Q^CREATE_TIME_^DL',
+                                    'Q^CREATE_TIME_^DG'
+                                ],
+                                label: '创建时间',
+                                fieldType: 'daterange',
+                                labelWidth: 80,
+                                itemWidth: 220
+                            }
+                            // { prop: 'Q^desc_^SL', label: '描述', itemWidth: '200' }
+                        ]
+                    },
+                    // 表格字段配置
+                    columns: [
+                        { prop: 'name', label: '流程名称' },
+                        { prop: 'defKey', label: '流程业务主键' },
+                        { prop: 'createTime', label: '创建时间' }
+                    ]
+                },
+                pagination: {},
+                sorts: {},
+                moreSearchParams: {}
             }
-            // { prop: 'Q^desc_^SL', label: '描述', itemWidth: '200' }
-          ]
         },
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '流程名称' },
-          { prop: 'defKey', label: '流程业务主键' },
-          { prop: 'createTime', label: '创建时间' }
-        ]
-      },
-      pagination: {},
-      sorts: {},
-      moreSearchParams: {}
-    }
-  },
-  computed: {
-    tableHeight() {
-      const h = this.height.substr(0, this.height.length - 2)
-      return parseInt(h)
-    }
-  },
-  created() {
-    this.loadListData()
-  },
-  methods: {
-    /**
-     * 加载数据
-     */
-    loadListData() {
-      this.loading = true
-      if (this.isDataTemplateUse && this.$utils.isEmpty(this.formKey)) {
-        this.$message.error('错误原因:模板未绑定表单!')
-        this.loading = false
-        return
-      }
+        computed: {
+            tableHeight() {
+                const h = this.height.substr(0, this.height.length - 2)
+                return parseInt(h)
+            }
+        },
+        created() {
+            this.loadListData()
+        },
+        methods: {
+            /**
+             * 加载数据
+             */
+            loadListData() {
+                this.loading = true
+                if (this.isDataTemplateUse && this.$utils.isEmpty(this.formKey)) {
+                    this.$message.error('错误原因:模板未绑定表单!')
+                    this.loading = false
+                    return
+                }
 
-      const requestMethod = this.isDataTemplateUse ? queryByFormKey : queryPageList
-      requestMethod(this.getFormatParams()).then(response => {
-        this.loading = false
-        ActionUtils.handleListData(this, response.data)
-        this.setSelectRow()
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getFormatParams() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      if (this.isDataTemplateUse) {
-        params['Q^status_^S'] = 'deploy'
-        params['formKey'] = this.formKey
-      } else {
-        params['Q^status_^S'] = 'deploy'
-      }
-      if (this.isSuper) {
-        params['isSuper'] = this.isSuper
-      }
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      this.changePageCoreRecordData()
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadListData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadListData()
-    },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadListData()
-    },
-    /**
-     * 重置查询条件
-     */
-    reset() {
-      this.$refs['crud'].handleReset()
-    },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        default:
-          break
-      }
+                const requestMethod = this.isDataTemplateUse ? queryByFormKey : queryPageList
+                requestMethod(this.getFormatParams()).then((response) => {
+                    this.loading = false
+                    ActionUtils.handleListData(this, response.data)
+                    this.setSelectRow()
+                }).catch(() => {
+                    this.loading = false
+                })
+            },
+            /**
+             * 获取格式化参数
+             */
+            getFormatParams() {
+                const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+                if (this.isDataTemplateUse) {
+                    params['Q^status_^S'] = 'deploy'
+                    params['formKey'] = this.formKey
+                } else {
+                    params['Q^status_^S'] = 'deploy'
+                }
+                if (this.isSuper) {
+                    params['isSuper'] = this.isSuper
+                }
+                return ActionUtils.formatParams(
+                    params,
+                    this.pagination,
+                    this.sorts
+                )
+            },
+            /**
+             * 处理分页事件
+             */
+            handlePaginationChange(page) {
+                this.changePageCoreRecordData()
+                ActionUtils.setPagination(this.pagination, page)
+                this.loadListData()
+            },
+            /**
+             * 处理排序
+             */
+            handleSortChange(sort) {
+                ActionUtils.setSorts(this.sorts, sort)
+                this.loadListData()
+            },
+            /**
+             * 查询
+             */
+            search() {
+                this.loadListData()
+            },
+            /**
+             * 重置查询条件
+             */
+            reset() {
+                this.$refs['crud'].handleReset()
+            },
+            /**
+             * 处理按钮事件
+             */
+            handleAction(command, position, selection, data) {
+                switch (command) {
+                    case 'search': // 查询
+                        ActionUtils.setFirstPagination(this.pagination)
+                        this.search()
+                        break
+                    default:
+                        break
+                }
+            }
+        }
     }
-  }
-}
 </script>

+ 328 - 322
src/business/platform/bpmn/definition/selector.vue

@@ -1,328 +1,334 @@
 <template>
-  <span>
-    <!-- 选择器样式 -->
-    <ibps-selector
-      v-if="!button"
-      v-bind="$props"
-      :items="items"
-      @click="handleSelectorClick"
-      @remove="handleSelectorRemove"
-    />
-    <!-- 按钮样式 -->
-    <el-button
-      v-else
-      :type="buttonType"
-      :class="buttonClass"
-      @click="() => selectorVisible = true"
-    >
-      {{ buttonLabel }}
-    </el-button>
-    <!-- 选择器 -->
-    <bpmn-definition-selector-dialog
-      :visible="selectorVisible"
-      :value="selectorValue"
-      :multiple="multiple"
-      :form-key="formKey"
-      :is-super="isSuper"
-      :is-data-template-use="isDataTemplateUse"
-      @close="visible => selectorVisible = visible"
-      @action-event="handleSelectorActionEvent"
-    />
-  </span>
+    <span>
+        <!-- 选择器样式 -->
+        <ibps-selector
+            v-if="!button"
+            v-bind="$props"
+            :items="items"
+            @click="handleSelectorClick"
+            @remove="handleSelectorRemove"
+        />
+        <!-- 按钮样式 -->
+        <el-button
+            v-else
+            :type="buttonType"
+            :class="buttonClass"
+            @click="() => selectorVisible = true"
+        >
+            {{ buttonLabel }}
+        </el-button>
+        <!-- 选择器 -->
+        <bpmn-definition-selector-dialog
+            :visible="selectorVisible"
+            :value="selectorValue"
+            :multiple="multiple"
+            :form-key="formKey"
+            :is-super="isSuper"
+            :is-data-template-use="isDataTemplateUse"
+            @close="visible => selectorVisible = visible"
+            @action-event="handleSelectorActionEvent"
+        />
+    </span>
 </template>
 <script>
-import { get, getByDefKey } from '@/api/platform/bpmn/bpmDefinition'
-import { valueEquals } from '@/plugins/element-ui/src/utils/util'
-import emitter from '@/plugins/element-ui/src/mixins/emitter'
-import IbpsSelector from '@/components/ibps-selector/selector'
-import BpmnDefinitionSelectorDialog from './dialog'
-export default {
-  components: {
-    IbpsSelector,
-    BpmnDefinitionSelectorDialog
-  },
-  inject: {
-    elForm: {
-      default: ''
-    },
-    elFormItem: {
-      default: ''
-    }
-  },
-  mixins: [emitter],
-  props: {
-    value: {
-      type: [String, Number, Array]
-    },
-    // 存储类型 ,
-    // ①、id:只存储id 字符串,
-    // ②、json: json字符串,
-    // ③、 array:存储数组数据(完整数据,包含key和value)。
-    // ④、 bind:绑定ID,需要回调和返回
-    store: {
-      type: String,
-      default: 'id',
-      validator: function(value) {
-        return ['id', 'json', 'array', 'arrayId', 'bind'].indexOf(value) !== -1
-      }
-    },
-    // 是否查询所有
-    isSuper: {
-      type: Boolean,
-      default: false
-    },
-    storeSeparator: { // 存储值分割符,对应[多选]有效,对于设置字符串类型的分隔符
-      type: String,
-      default: ','
-    },
-    placeholder: { // 输入框占位文本
-      type: String,
-      default: '请选择流程'
-    },
-    multiple: { // 是否多选
-      type: Boolean,
-      default: false
-    },
-    formKey: String,
-    labelKey: { // 展示的值
-      type: String,
-      default: 'name'
-    },
-    valueKey: { // 存储唯一值
-      type: String,
-      default: 'id'
-    },
-    disabled: { // 禁用
-      type: Boolean,
-      default: false
-    },
-    isDataTemplateUse: {
-      type: Boolean,
-      default: false
-    },
-    // 按钮模式参数
-    button: {
-      type: Boolean,
-      default: false
-    },
-    buttonLabel: { // 按钮文字
-      type: String,
-      default: '添加'
-    },
-    buttonType: {
-      type: String,
-      default: 'primary'
-    },
-    buttonClass: {
-      type: String,
-      default: 'ibps-icon-add'
-    }
-  },
-  data() {
-    return {
-      selectorVisible: false,
-      selectorValue: this.multiple ? [] : {},
-      cacheData: {},
-      bindIdValue: ''
-    }
-  },
-  computed: {
-    items() {
-      if (this.$utils.isEmpty(this.selectorValue)) return []
-      if (this.multiple) {
-        return this.selectorValue.map(data => {
-          return data[this.labelKey]
-        })
-      } else {
-        return [this.selectorValue[this.labelKey]]
-      }
-    }
-  },
-  watch: {
-    value: {
-      handler(val, oldVal) {
-        this.initData()
-        if (!valueEquals(val, oldVal)) {
-          this.dispatch('ElFormItem', 'el.form.change', val)
-        }
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    /**
-     * 初始化数据
-     */
-    initData() {
-      const data = this.getArrayValue(this.value)
-      this.selectorValue = this.multiple ? [] : {}
-      if (this.$utils.isEmpty(data)) {
-        return
-      }
-      data.forEach(v => {
-        if (this.cacheData[v]) {
-          this.setSelectorValue(v)
-        } else {
-          this.getDataInfo(v)
-        }
-      })
-    },
-    setCacheData() {
-      if (this.$utils.isEmpty(this.selectorValue)) return
-      const data = this.multiple ? this.selectorValue : [this.selectorValue]
-      data.forEach(v => {
-        this.cacheData[v[this.valueKey]] = v
-      })
-    },
-    setSelectorValue(v) {
-      if (this.multiple) {
-        this.selectorValue.push(this.cacheData[v])
-      } else {
-        this.selectorValue = JSON.parse(JSON.stringify(this.cacheData[v]))
-      }
-    },
+    import { get, getByDefKey } from '@/api/platform/bpmn/bpmDefinition'
+    import { valueEquals } from '@/plugins/element-ui/src/utils/util'
+    import emitter from '@/plugins/element-ui/src/mixins/emitter'
+    import IbpsSelector from '@/components/ibps-selector/selector'
+    import BpmnDefinitionSelectorDialog from './dialog'
+    export default {
+        components: {
+            IbpsSelector,
+            BpmnDefinitionSelectorDialog
+        },
+        inject: {
+            elForm: {
+                default: ''
+            },
+            elFormItem: {
+                default: ''
+            }
+        },
+        mixins: [emitter],
+        props: {
+            value: {
+                type: [String, Number, Array]
+            },
+            // 存储类型:
+            // ① id:只存储id 字符串
+            // ② json:json字符串
+            // ③ array:存储数组数据(完整数据,包含key和value)
+            // ④ bind:绑定ID,需要回调和返回
+            store: {
+                type: String,
+                default: 'id',
+                validator: function (value) {
+                    return (['id', 'json', 'array', 'arrayId', 'bind'].indexOf(value) !== -1)
+                }
+            },
+            // 是否查询所有
+            isSuper: {
+                type: Boolean,
+                default: false
+            },
+            // 存储值分割符,对应[多选]有效,对于设置字符串类型的分隔符
+            storeSeparator: {
+                type: String,
+                default: ','
+            },
+            // 输入框占位文本
+            placeholder: {
+                type: String,
+                default: '请选择流程'
+            },
+            // 是否多选
+            multiple: {
+                type: Boolean,
+                default: false
+            },
+            formKey: String,
+            // 展示的值
+            labelKey: {
+                type: String,
+                default: 'name'
+            },
+            // 存储唯一值
+            valueKey: {
+                type: String,
+                default: 'id'
+            },
+            // 禁用
+            disabled: {
+                type: Boolean,
+                default: false
+            },
+            isDataTemplateUse: {
+                type: Boolean,
+                default: false
+            },
+            // 按钮模式参数
+            button: {
+                type: Boolean,
+                default: false
+            },
+            // 按钮文字
+            buttonLabel: {
+                type: String,
+                default: '添加'
+            },
+            buttonType: {
+                type: String,
+                default: 'primary'
+            },
+            buttonClass: {
+                type: String,
+                default: 'ibps-icon-add'
+            }
+        },
+        data() {
+            return {
+                selectorVisible: false,
+                selectorValue: this.multiple ? [] : {},
+                cacheData: {},
+                bindIdValue: ''
+            }
+        },
+        computed: {
+            items() {
+                if (this.$utils.isEmpty(this.selectorValue)) return []
+                if (this.multiple) {
+                    return this.selectorValue.map((data) => {
+                        return data[this.labelKey]
+                    })
+                } else {
+                    return [this.selectorValue[this.labelKey]]
+                }
+            }
+        },
+        watch: {
+            value: {
+                handler(val, oldVal) {
+                    this.initData()
+                    if (!valueEquals(val, oldVal)) {
+                        this.dispatch('ElFormItem', 'el.form.change', val)
+                    }
+                },
+                immediate: true
+            }
+        },
+        methods: {
+            /**
+             * 初始化数据
+             */
+            initData() {
+                const data = this.getArrayValue(this.value)
+                this.selectorValue = this.multiple ? [] : {}
+                if (this.$utils.isEmpty(data)) {
+                    return
+                }
+                data.forEach((v) => {
+                    if (this.cacheData[v]) {
+                        this.setSelectorValue(v)
+                    } else {
+                        this.getDataInfo(v)
+                    }
+                })
+            },
+            setCacheData() {
+                if (this.$utils.isEmpty(this.selectorValue)) return
+                const data = this.multiple ? this.selectorValue : [this.selectorValue]
+                data.forEach((v) => {
+                    this.cacheData[v[this.valueKey]] = v
+                })
+            },
+            setSelectorValue(v) {
+                if (this.multiple) {
+                    this.selectorValue.push(this.cacheData[v])
+                } else {
+                    this.selectorValue = JSON.parse(
+                        JSON.stringify(this.cacheData[v])
+                    )
+                }
+            },
+            /**
+             * 获得数组数据
+             */
+            getArrayValue(value, bindId) {
+                if (this.$utils.isEmpty(value)) {
+                    return []
+                }
+                if (this.store === 'json') {
+                    // json
+                    try {
+                        const data = this.$utils.parseData(value)
+                        return data.map((d) => {
+                            return d[this.valueKey]
+                        })
+                    } catch (error) {
+                        console.warn(error)
+                        return []
+                    }
+                } else if (this.store === 'id') {
+                    // id
+                    return value.split(this.storeSeparator)
+                } else if (this.store === 'bind') {
+                    // 绑定id
+                    if (this.$utils.isEmpty(bindId)) {
+                        return []
+                    }
+                    return bindId.split(this.storeSeparator)
+                } else {
+                    // array
+                    return value.map((d) => {
+                        return d[this.valueKey]
+                    })
+                }
+            },
+            getStoreValue(value) {
+                const res = []
+                if (this.store === 'json') {
+                    // json
+                    if (this.$utils.isEmpty(value)) {
+                        return ''
+                    }
+                    if (this.multiple) {
+                        value.forEach((v) => {
+                            const o = {}
+                            o[this.valueKey] = v[this.valueKey]
+                            o[this.labelKey] = v[this.labelKey]
+                            res.push(o)
+                        })
+                        return JSON.stringify(res)
+                    } else {
+                        const o = {}
+                        o[this.valueKey] = value[this.valueKey]
+                        o[this.labelKey] = value[this.labelKey]
+                        return JSON.stringify(o)
+                    }
+                } else if (this.store === 'id') {
+                    // id
+                    if (this.$utils.isEmpty(value)) {
+                        return ''
+                    }
+                    if (this.multiple) {
+                        value.forEach((v) => {
+                            res.push(v[this.valueKey])
+                        })
+                    } else {
+                        res.push(value[this.valueKey])
+                    }
+                    return res.join(this.storeSeparator)
+                } else if (this.store === 'bind') {
+                    // 绑定id
+                    const res = []
+                    const bindIdValue = []
+                    value.forEach((v) => {
+                        bindIdValue.push(v[this.valueKey])
+                        res.push(v[this.labelKey])
+                    })
+                    this.bindIdValue = bindIdValue.join(this.storeSeparator)
+                    return res.join(this.storeSeparator)
+                } else {
+                    // 数组 array
+                    return value || []
+                }
+            },
+            getValue() {
+                return this.getStoreValue(this.selectorValue)
+            },
+            /**
+             * 通过ID获取数据
+             */
+            getDataInfo(id) {
+                if (this.valueKey === 'id') {
+                    get({ defId: id }).then((response) => {
+                        const data = response.data
+                        this.cacheData[data[this.valueKey]] = data
+                        this.setSelectorValue(data[this.valueKey])
+                    }).catch(() => {})
+                } else if (this.valueKey === 'defKey') {
+                    getByDefKey({ defKey: id }).then((response) => {
+                        const data = response.data
+                        this.cacheData[data[this.valueKey]] = data
+                        this.setSelectorValue(data[this.valueKey])
+                    }).catch(() => {})
+                }
+            },
+            // ===================事件处理=========
+            handleSelectorClick() {
+                if (this.isDataTemplateUse && this.$utils.isEmpty(this.formKey)) {
+                    this.$message.closeAll()
+                    this.$message.error('该模板未绑定表单!')
+                    return
+                }
+                this.selectorVisible = true
+                this.initData()
+            },
+            handleSelectorRemove(index) {
+                if (this.multiple) {
+                    this.selectorValue.splice(index, 1)
+                } else {
+                    this.selectorValue = {}
+                }
+                this.handleInput()
+            },
 
-    /**
-     * 获得数组数据
-     */
-    getArrayValue(value, bindId) {
-      if (this.$utils.isEmpty(value)) {
-        return []
-      }
-      if (this.store === 'json') { // json
-        try {
-          const data = this.$utils.parseData(value)
-          return data.map((d) => {
-            return d[this.valueKey]
-          })
-        } catch (error) {
-          console.warn(error)
-          return []
-        }
-      } else if (this.store === 'id') { // id
-        return value.split(this.storeSeparator)
-      } else if (this.store === 'bind') { // 绑定id
-        if (this.$utils.isEmpty(bindId)) {
-          return []
-        }
-        return bindId.split(this.storeSeparator)
-      } else { // array
-        return value.map((d) => {
-          return d[this.valueKey]
-        })
-      }
-    },
-    getStoreValue(value) {
-      const res = []
-      if (this.store === 'json') { // json
-        if (this.$utils.isEmpty(value)) {
-          return ''
+            handleSelectorActionEvent(buttonKey, data) {
+                switch (buttonKey) {
+                    case 'confirm': // 确定
+                        this.selectorVisible = false
+                        this.selectorValue = data
+                        this.setCacheData() // 设置缓存数据
+                        this.handleInput()
+                        break
+                }
+            },
+            handleInput() {
+                this.$emit('input', this.getValue())
+                // 提供一个返回实体,提供调用
+                this.$emit('callback', this.selectorValue)
+                this.selectorValue = this.multiple ? [] : {}
+            }
         }
-        if (this.multiple) {
-          value.forEach(v => {
-            const o = {}
-            o[this.valueKey] = v[this.valueKey]
-            o[this.labelKey] = v[this.labelKey]
-            res.push(o)
-          })
-          return JSON.stringify(res)
-        } else {
-          const o = {}
-          o[this.valueKey] = value[this.valueKey]
-          o[this.labelKey] = value[this.labelKey]
-          return JSON.stringify(o)
-        }
-      } else if (this.store === 'id') { // id
-        if (this.$utils.isEmpty(value)) {
-          return ''
-        }
-        if (this.multiple) {
-          value.forEach(v => {
-            res.push(v[this.valueKey])
-          })
-        } else {
-          res.push(value[this.valueKey])
-        }
-        return res.join(this.storeSeparator)
-      } else if (this.store === 'bind') { // 绑定id
-        const res = []
-        const bindIdValue = []
-        value.forEach(v => {
-          bindIdValue.push(v[this.valueKey])
-          res.push(v[this.labelKey])
-        })
-        this.bindIdValue = bindIdValue.join(this.storeSeparator)
-
-        return res.join(this.storeSeparator)
-      } else { // 数组 array
-        return value || []
-      }
-    },
-    getValue() {
-      return this.getStoreValue(this.selectorValue)
-    },
-    /**
-     * 通过ID获取数据
-     */
-    getDataInfo(id) {
-      if (this.valueKey === 'id') {
-        get({
-          defId: id
-        }).then(response => {
-          const data = response.data
-          this.cacheData[data[this.valueKey]] = data
-          this.setSelectorValue(data[this.valueKey])
-        }).catch(() => {
-        })
-      } else if (this.valueKey === 'defKey') {
-        getByDefKey({
-          defKey: id
-        }).then(response => {
-          const data = response.data
-          this.cacheData[data[this.valueKey]] = data
-          this.setSelectorValue(data[this.valueKey])
-        }).catch(() => {
-        })
-      }
-    },
-
-    // ===================事件处理=========
-
-    handleSelectorClick() {
-      if (this.isDataTemplateUse && this.$utils.isEmpty(this.formKey)) {
-        this.$message.closeAll()
-        this.$message.error('该模板未绑定表单!')
-        return
-      }
-      this.selectorVisible = true
-      this.initData()
-    },
-    handleSelectorRemove(index) {
-      if (this.multiple) {
-        this.selectorValue.splice(index, 1)
-      } else {
-        this.selectorValue = {}
-      }
-      this.handleInput()
-    },
-
-    handleSelectorActionEvent(buttonKey, data) {
-      switch (buttonKey) {
-        case 'confirm':// 确定
-          this.selectorVisible = false
-          this.selectorValue = data
-          this.setCacheData() // 设置缓存数据
-          this.handleInput()
-          break
-      }
-    },
-    handleInput() {
-      this.$emit('input', this.getValue())
-      // 提供一个返回实体,提供调用
-      this.$emit('callback', this.selectorValue)
-      this.selectorValue = this.multiple ? [] : {}
     }
-
-  }
-}
-</script>
+</script>

+ 16 - 13
src/business/platform/data/constants/buttons.js

@@ -22,14 +22,14 @@ const buttons = {
   },
   'add': {
     label: '添加',
-    type: 'primary',
+    type: 'success',
     icon: 'ibps-icon-add',
     scope: ['toolbar', 'contextmenu'],
     contextmenu: 'all'
   },
   'remove': {
     label: '删除',
-    type: 'primary',
+    type: 'danger',
     icon: 'ibps-icon-remove',
     scope: ['toolbar', 'manage'],
     contextmenu: 'sub'
@@ -38,14 +38,14 @@ const buttons = {
     label: '编辑',
     type: 'primary',
     icon: 'ibps-icon-edit',
-    scope: ['toolbar', 'manage'],
+    scope: ['manage'],
     contextmenu: 'sub'
   },
   'detail': {
     label: '明细',
     type: 'primary',
     icon: 'ibps-icon-detail',
-    scope: ['toolbar', 'manage'],
+    scope: ['manage'],
     contextmenu: 'sub'
   },
   'batchModify': {
@@ -84,23 +84,26 @@ const buttons = {
     icon: 'ibps-icon-export',
     scope: ['toolbar'],
   },
-  'bianZhi': {
+  'openTask': {
     label: '编制',
-    type: 'primary',
-    icon: 'ibps-icon-export',
+    type: 'success',
+    icon: 'ibps-icon-add',
     scope: ['toolbar'],
+    contextmenu: 'all'
   },
-  'runQianPDF': {
+  'consult': {
     label: '查阅',
     type: 'primary',
-    icon: 'ibps-icon-export',
-    scope: ['toolbar', 'manage'],
+    icon: 'ibps-icon-eye',
+    scope: ['manage'],
+    contextmenu: 'sub'
   },
-  'runQianOther': {
+  'download': {
     label: '下载记录',
     type: 'primary',
-    icon: 'ibps-icon-export',
-    scope: ['toolbar', 'manage'],
+    icon: 'ibps-icon-download',
+    scope: ['manage'],
+    contextmenu: 'sub'
   },
   'close': {
     label: '关闭',

+ 2 - 2
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','bianZhi','runQianPDF','runQianOther']
+export const functionListButtonTypes = ['search', 'resetSearch', 'add', 'remove', 'edit', 'detail', 'print', 'import', 'export', 'exportMuBan','openTask', 'consult', 'download', 'sefStartFlow', 'custom']
 // export const functionListButtonTypes = ['search', 'resetSearch', 'add', 'remove', 'edit', 'detail', 'sefStartFlow', 'custom']
 
 // export const functionTreeButtonTypes = ['refresh', 'expand', 'compress', 'custom']
@@ -97,5 +97,5 @@ export const functionTreeButtonTypes = ['refresh', 'expand', 'compress']
 
 export const contextmenuButtonTypes = ['add', 'remove', 'edit', 'detail']
 
-export const editButtonTypes = ['close', 'save', 'print', 'sefStartFlow', 'custom']
+export const editButtonTypes = ['close', 'save', 'print', 'sefStartFlow', 'custom', 'openTask', 'consult', 'download',]
 // ['close', 'save', 'print', 'sefStartFlow']

+ 222 - 244
src/business/platform/data/templatebuilder/right-aside/editors/editor-button.vue

@@ -1,251 +1,229 @@
 <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-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>
-    <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-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-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-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>
-    <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 === '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 === 'runQianPDF'|| formData.button_type === 'runQianOther')" 
-                  label="润乾路径"
-                  required
-                  prop="label">
-      <el-input v-model="formData.runQianPah"
-                placeholder="润乾路径" />
-    </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;">
-            先在模板属性绑定表单,此流程定义数据才有!
-          </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" />
-    </el-form-item>
-    <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>
+    <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>
+        <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-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-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-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>
+        <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 === 'consult' || formData.button_type === 'download')"
+            label="报表路径"
+            required
+            prop="label"
+        >
+            <el-input v-model="formData.reportPath" placeholder="请填写润乾报表完整路径" />
+        </el-form-item>
+        <el-form-item
+            v-if="formData && ['sefStartFlow', 'openTask'].includes(formData.button_type)"
+            prop="deflow"
+        >
+            <label slot="label">
+                绑定流程
+                <el-tooltip v-if="formData.button_type === 'sefStartFlow'" 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="formData.button_type === 'sefStartFlow' ? 'defKey' : 'defId'"
+                :form-key="formKey"
+                :is-data-template-use="formData.button_type === 'sefStartFlow'"
+            />
+        </el-form-item>
+        <export-column
+            :visible="exportFieldDialogVisible"
+            :data="template"
+            @callback="handleExportColumn"
+            @close="visible => exportFieldDialogVisible = visible"
+        />
+    </el-form>
 </template>
 <script>
-import { hasPermission } from '@/business/platform/data/constants/buttons'
-import BpmDefSelector from '@/business/platform/bpmn/definition/selector'
-import RightsSelector from '@/business/platform/rights/config/selector'
+    import { hasPermission } from '@/business/platform/data/constants/buttons'
+    import BpmDefSelector from '@/business/platform/bpmn/definition/selector'
+    import RightsSelector from '@/business/platform/rights/config/selector'
+    import ExportColumn from '../components/export-column'
 
-import ExportColumn from '../components/export-column'
-import BpmDefDialog from '@/business/platform/bpmn/definition/dialog'
-
-export default {
-  components: {
-    RightsSelector,
-    BpmDefSelector,
-    ExportColumn,
-    BpmDefDialog
-  },
-  props: {
-    data: {
-      type: Object
-    },
-    template: {
-      type: Object
-    },
-    formKey: String,
-    type: {
-      type: String,
-      default: 'function'
-    }
-  },
-  data() {
-    return {
-      colors: [
-        { type: 'default', label: '默认' },
-        { type: 'primary', label: '主要' },
-        { type: 'success', label: '成功' },
-        { type: 'info', label: '信息' },
-        { type: 'warning', label: '警告' },
-        { type: 'danger', label: '危险' }
-      ],
-      exportFieldDialogVisible: false,
-      dialogVisible: false,
-      formName: 'form',
-      formData: {
-        style: 'primary',
-      },
-      defId: '',
-      defName: '',
-      defKey: '',
-      rules: {
-        label: [{ required: true, message: this.$t('validate.required') }]
-      }
-    }
-  },
-  computed: {
-    positionType() {
-      const positionType = []
-      positionType.push({
-        value: 'all',
-        label: '所有'
-      })
-      const buttonType = this.formData.button_type || ''
-      if (hasPermission(buttonType, 'toolbar') && this.type === 'function') {
-        positionType.push({
-          value: 'toolbar',
-          label: '仅顶部'
-        })
-      }
-
-      if (hasPermission(buttonType, 'manage') && this.type === 'function') {
-        positionType.push({
-          value: 'manage',
-          label: '仅管理列'
-        })
-      }
-      // if (hasPermission(buttonType, 'search') && this.type === 'function') {
-      //   positionType.push({
-      //     value: 'search',
-      //     label: '仅查询列'
-      //   })
-      // }
-
-      if (hasPermission(buttonType, 'edit') && this.type === 'edit') {
-        positionType.push({
-          value: 'edit',
-          label: '仅编辑'
-        })
-      }
-
-      return positionType
-    }
-  },
-  watch: {
-    data: {
-      handler(val) {
-        if (val) {
-          this.formData = val
-          if (this.formData.button_type === 'custom' || this.formData.button_type === 'sefStartFlow') {
-            this.rules['code'] = [{ required: true, message: this.$t('validate.required') }]
-          } else {
-            this.rules['code'] = null
-          }
+    export default {
+        components: {
+            RightsSelector,
+            BpmDefSelector,
+            ExportColumn
+        },
+        props: {
+            data: {
+                type: Object
+            },
+            template: {
+                type: Object
+            },
+            formKey: String,
+            type: {
+                type: String,
+                default: 'function'
+            }
+        },
+        data() {
+            return {
+                colors: [
+                    { type: 'default', label: '默认' },
+                    { type: 'primary', label: '主要' },
+                    { type: 'success', label: '成功' },
+                    { type: 'info', label: '信息' },
+                    { type: 'warning', label: '警告' },
+                    { type: 'danger', label: '危险' }
+                ],
+                exportFieldDialogVisible: false,
+                formName: 'form',
+                formData: {
+                    style: 'primary'
+                },
+                rules: {
+                    label: [
+                        {
+                            required: true,
+                            message: this.$t('validate.required')
+                        }
+                    ]
+                }
+            }
+        },
+        computed: {
+            positionType() {
+                const positionType = []
+                positionType.push({
+                    value: 'all',
+                    label: '所有'
+                })
+                const buttonType = this.formData.button_type || ''
+                if (hasPermission(buttonType, 'toolbar') && this.type === 'function') {
+                    positionType.push({
+                        value: 'toolbar',
+                        label: '仅顶部'
+                    })
+                }
+                if (hasPermission(buttonType, 'manage') && this.type === 'function') {
+                    positionType.push({
+                        value: 'manage',
+                        label: '仅管理列'
+                    })
+                }
+                // if (hasPermission(buttonType, 'search') && this.type === 'function') {
+                //   positionType.push({
+                //     value: 'search',
+                //     label: '仅查询列'
+                //   })
+                // }
+                if (hasPermission(buttonType, 'edit') && this.type === 'edit') {
+                    positionType.push({
+                        value: 'edit',
+                        label: '仅编辑'
+                    })
+                }
+                return positionType
+            }
+        },
+        watch: {
+            data: {
+                handler(val) {
+                    if (val) {
+                        this.formData = val
+                        const spicialType = ['custom', 'sefStartFlow', 'openTask']
+                        if (spicialType.includes(this.formData.button_type)) {
+                            this.rules['code'] = [
+                                {
+                                    required: true,
+                                    message: this.$t('validate.required')
+                                }
+                            ]
+                        } else {
+                            this.rules['code'] = null
+                        }
+                    }
+                },
+                immediate: true
+            }
+        },
+        methods: {
+            // 获取表单数据
+            getFormData(callback) {
+                this.$refs[this.formName].validate((valid) => {
+                    if (valid) {
+                        callback(this.formData)
+                    } else {
+                        callback()
+                    }
+                })
+            },
+            handleExportFields() {
+                this.exportFieldDialogVisible = true
+            },
+            handleExportColumn(data) {
+                this.handleData('export_columns', data)
+            },
+            handleData(key, value) {
+                this.$emit('callback', key, value)
+            }
         }
-      },
-      immediate: true
     }
-  },
-  methods: {
-    // 获取表单数据
-    getFormData(callback) {
-      this.$refs[this.formName].validate((valid) => {
-        if (valid) {
-          callback(this.formData)
-        } else {
-          callback()
-        }
-      })
-    },
-    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>

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

@@ -227,8 +227,8 @@ export default {
             scanVisible: false,
             scanName: '',
             obj: '',
-            runQianPathPDF:'',
-            runQianPathOther:'',
+            previewPath:'',
+            downloadPath:'',
             initialization: false,
             tableHeight: document.body.clientHeight,
             listIdentity: '',
@@ -732,7 +732,7 @@ export default {
 
             // 前置事件
             this.beforeScript(command, position, selection, data, () => {
-                let srcUrl =''
+                let src = ''
                 this.readonly = false
                 switch (buttonType) {
                     case 'search': // 查询
@@ -763,54 +763,50 @@ export default {
                             .catch(() => {})
                         break
                     case 'sefStartFlow': // 启动自定义流程
-                        ActionUtils.selectedMultiRecord(selection)
-                            .then((ids) => {
-                                if (button.deflow) {
-                                    this.$confirm('确定启动流程吗?', '消息', {
-                                        confirmButtonText: '确定',
-                                        cancelButtonText: '取消',
-                                        type: 'warning'
-                                    })
-                                        .then(() => {
-                                            this.$message.success('流程任务正在[异步操作]启动中...(期间可做其它操作!)')
-                                            this.handleStartFlowFromList(ids, button.deflow, this.getFormKey())
-                                        })
-                                        .catch(() => {})
-                                } else {
-                                    this.dialogVisible = true
-                                    this.dialogValue = {}
-                                    this.sefStartFlowId = ids
-                                }
-                            })
-                            .catch(() => {})
+                        ActionUtils.selectedMultiRecord(selection).then((ids) => {
+                            if (button.deflow) {
+                                this.$confirm('确定启动流程吗?', '消息', {
+                                    confirmButtonText: '确定',
+                                    cancelButtonText: '取消',
+                                    type: 'warning'
+                                }).then(() => {
+                                    this.$message.success('流程任务正在[异步操作]启动中...(期间可做其它操作!)')
+                                    this.handleStartFlowFromList(ids, button.deflow, this.getFormKey())
+                                }).catch(() => {})
+                            } else {
+                                this.dialogVisible = true
+                                this.dialogValue = {}
+                                this.sefStartFlowId = ids
+                            }
+                        }).catch(() => {})
                         break
                     case 'custom': // 自定义按钮
                         break
-                    case 'bianZhi': // 编制
+                    case 'openTask': // 编制,开启对应流程
+                        // console.log(button)
+                        if (!button.deflow) {
+                            this.$message.warning('请先配置对应流程!')
+                            return
+                        }
+                        this.defId = button.deflow
                         this.npmDialogFormVisible =true
-                        this.defId = this.defId
                     break
-                    case 'runQianPDF': // 查阅
-                        if(!selection){
-                            this.$message({
-                                message: '请选择一条数据',
-                                type: 'warning'
-                            })
+                    case 'consult': // 查阅
+                        console.log(button)
+                        if (!button.reportPath) {
+                            this.$message.warning('请先配置对应报表路径!')
                             return
                         }
-                         srcUrl =this.$reportPash.replace("show","pdf")+this.runQianPathPDF+'.rpx&id_='+selection
-                        pintText(this,srcUrl)
+                        src = `${this.$reportPash.replace('show', 'pdf')}${this.previewPath}&id_=${selection}`
+                        pintText(this, src)
                     break
-                    case 'runQianOther': // 下载记录
-                        if(!selection){
-                            this.$message({
-                                message: '请选择一条数据',
-                                type: 'warning'
-                            })
+                    case 'download': // 下载记录
+                        if (!button.reportPath) {
+                            this.$message.warning('请先配置对应报表路径!')
                             return
                         }
-                        srcUrl =this.$reportPash+this.runQianPathOther+'.rpx&id_='+selection
-                        pintText(this,srcUrl)
+                        src = `${this.$reportPash}${this.downloadPath}&id_=${selection}`
+                        pintText(this, src)
                     break
                     case 'print': // 打印
                         ActionUtils.selectedRecord(selection)
@@ -1020,14 +1016,14 @@ export default {
 
             const functionButtons = this.template.buttons ? this.template.buttons.function_buttons || [] : []
             for(var i of functionButtons){
-                if(i.button_type=='bianZhi'){
-                    this.defId=i.defId
+                if(i.button_type=='openTask'){
+                    this.defId = i.deflow
                 }
-                if(i.button_type=='runQianPDF'){
-                    this.runQianPathPDF=i.runQianPah
+                if(i.button_type === 'consult'){
+                    this.previewPath = i.reportPath
                 }
-                if(i.button_type=='runQianOther'){
-                    this.runQianPathOther=i.runQianPah
+                if(i.button_type === 'download'){
+                    this.downloadPath = i.reportPath
                 }
             }
             // 工具栏
@@ -1161,6 +1157,7 @@ export default {
                 icon: rf.icon ? 'ibps-icon-' + rf.icon : defaultButton.icon,
                 type: rf.style || defaultButton.type,
                 deflow: rf.deflow || null,
+                reportPath: rf.reportPath,
                 mode: mode,
                 rightIcon: rightIcon,
                 menus: menus,

+ 175 - 156
src/business/platform/form/formbuilder/dialog.vue

@@ -1,166 +1,185 @@
 <template>
-  <el-dialog
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    class="formbuilder-dialog"
-    fullscreen
-    append-to-body
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <formbuilder
-      v-if="dialogVisible"
-      :id="id"
-      v-loading.fullscreen.lock="dialogLoading"
-      :element-loading-text="$t('common.loading')"
-      :data="formDef"
-      :bo="boData"
-      :loading="dialogLoading"
-      @callback="handleCallback"
-      @close="closeDialog"
-    />
-  </el-dialog>
+    <el-dialog
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        class="formbuilder-dialog"
+        :class="$style.content"
+        fullscreen
+        append-to-body
+        @open="getFormData"
+        @close="closeDialog"
+    >
+        <formbuilder
+            v-if="dialogVisible"
+            :id="id"
+            v-loading.fullscreen.lock="dialogLoading"
+            :element-loading-text="$t('common.loading')"
+            :data="formDef"
+            :bo="boData"
+            :loading="dialogLoading"
+            @callback="handleCallback"
+            @close="closeDialog"
+        />
+    </el-dialog>
 </template>
 <script>
-import { getFormDataByFormDefId, design, buildTree } from '@/api/platform/form/formDef'
-import { defaultsDeep } from 'lodash'
+    import { getFormDataByFormDefId, design, buildTree } from '@/api/platform/form/formDef'
+    import { defaultsDeep } from 'lodash'
+    import Formbuilder from './index'
 
-import Formbuilder from './index'
-
-export default {
-  components: {
-    Formbuilder
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    id: String,
-    data: {
-      type: Object
-    }
-  },
-  data() {
-    return {
-      dialogVisible: this.visible,
-      dialogLoading: false,
-      defaultForm: {
-        attrs: {
-          inline: false, // 是否使用inline排版
-          labelPosition: 'right', // 标签对齐方式
-          labelWidth: '100', // 标签宽度
-          labelWidthUnit: 'px', // 标签宽度单位
-          size: 'mini', // 尺寸
-          statusIcon: false, // 显示验证图标
-          descPosition: 'inline',
-          verifys: [], // 表单提交校验
-          script: '', // 表单脚本
-          read_style: 'text',
-          colon: false,
-          labelSuffix: ':',
-          title_position: 'center'
+    export default {
+        components: {
+            Formbuilder
         },
-        fields: [] // 字段列表
-      },
-      formDef: null,
-      boData: []
-    }
-  },
-  computed: {
-    formId() {
-      return this.id
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  created() {
-    this.formDef = JSON.parse(JSON.stringify(this.defaultForm))
-  },
-  methods: {
-    // 关闭当前窗口
-    closeDialog() {
-      this.formDef = JSON.parse(JSON.stringify(this.defaultForm))
-      this.$emit('close', false)
-    },
-    handleCallback() {
-      this.$emit('callback')
-    },
-    /**
-     * 获取表单数据
-     */
-    getFormData() {
-      const defaultForm = JSON.parse(JSON.stringify(this.defaultForm))
-      this.dialogLoading = true
-      if (this.$utils.isEmpty(this.formId)) {
-        if (this.$utils.isNotEmpty(this.data)) {
-          design({
-            mode: this.data.mode || 'bo',
-            boCode: this.data.code,
-            buildMode: this.data.buildMode || 'default',
-            template: this.data.template || ''
-          }).then(response => {
-            const data = this.$utils.parseData(response.data)
-            // 从后台获取数据
-            const formDef = defaultsDeep({}, data, defaultForm)
-            Object.assign(formDef, this.data)
-
-            this.formDef = formDef
-            this.buildTree(this.formDef)
-            this.dialogLoading = false
-          }).catch((err) => {
-            console.error(err)
-            this.formDef = defaultsDeep({}, defaultForm)
-            this.dialogLoading = false
-          })
+        props: {
+            visible: {
+                type: Boolean,
+                default: false
+            },
+            id: String,
+            data: {
+                type: Object
+            }
+        },
+        data() {
+            return {
+                dialogVisible: this.visible,
+                dialogLoading: false,
+                defaultForm: {
+                    attrs: {
+                        inline: false, // 是否使用inline排版
+                        labelPosition: 'left', // 标签对齐方式
+                        labelWidth: '110', // 标签宽度
+                        labelWidthUnit: 'px', // 标签宽度单位
+                        size: 'mini', // 尺寸
+                        statusIcon: false, // 显示验证图标
+                        descPosition: 'inline',
+                        verifys: [], // 表单提交校验
+                        script: '', // 表单脚本
+                        read_style: 'text',
+                        colon: false,
+                        labelSuffix: ':',
+                        title_position: 'center'
+                    },
+                    fields: [] // 字段列表
+                },
+                formDef: null,
+                boData: []
+            }
+        },
+        computed: {
+            formId() {
+                return this.id
+            }
+        },
+        watch: {
+            visible: {
+                handler: function (val, oldVal) {
+                    this.dialogVisible = this.visible
+                },
+                immediate: true
+            }
+        },
+        created() {
+            this.formDef = JSON.parse(JSON.stringify(this.defaultForm))
+        },
+        methods: {
+            // 关闭当前窗口
+            closeDialog() {
+                this.formDef = JSON.parse(JSON.stringify(this.defaultForm))
+                this.$emit('close', false)
+            },
+            handleCallback() {
+                this.$emit('callback')
+            },
+            /**
+             * 获取表单数据
+             */
+            getFormData() {
+                const defaultForm = JSON.parse(JSON.stringify(this.defaultForm))
+                this.dialogLoading = true
+                if (this.$utils.isEmpty(this.formId)) {
+                    if (this.$utils.isNotEmpty(this.data)) {
+                        design({
+                            mode: this.data.mode || 'bo',
+                            boCode: this.data.code,
+                            buildMode: this.data.buildMode || 'default',
+                            template: this.data.template || ''
+                        }).then((response) => {
+                            const data = this.$utils.parseData(
+                                response.data
+                            )
+                            // 从后台获取数据
+                            const formDef = defaultsDeep(
+                                {},
+                                data,
+                                defaultForm
+                            )
+                            Object.assign(formDef, this.data)
+                            this.formDef = formDef
+                            this.buildTree(this.formDef)
+                            this.dialogLoading = false
+                        }).catch((err) => {
+                            console.error(err)
+                            this.formDef = defaultsDeep({}, defaultForm)
+                            this.dialogLoading = false
+                        })
+                    }
+                } else {
+                    getFormDataByFormDefId({ formDefId: this.formId }).then((response) => {
+                        const data = response.data
+                        // 从后台获取数据
+                        this.formDef = defaultsDeep(
+                            {},
+                            this.$utils.parseJSON(data),
+                            defaultForm
+                        )
+                        this.buildTree(this.formDef)
+                        this.dialogLoading = false
+                    }).catch(() => {
+                        this.formDef = defaultsDeep({}, defaultForm)
+                        this.dialogLoading = false
+                    })
+                }
+            },
+            buildTree({ code, busId, mode }) {
+                buildTree({
+                    boCode: code,
+                    boDefId: busId,
+                    mode: mode || ''
+                }).then((response) => {
+                    this.boData = response.data
+                }).catch((e) => {
+                    //  loading.close()
+                })
+            }
         }
-      } else {
-        getFormDataByFormDefId({
-          formDefId: this.formId
-        }).then(response => {
-          const data = response.data
-          // 从后台获取数据
-          this.formDef = defaultsDeep({}, this.$utils.parseJSON(data), defaultForm)
-          this.buildTree(this.formDef)
-          this.dialogLoading = false
-        }).catch(() => {
-          this.formDef = defaultsDeep({}, defaultForm)
-          this.dialogLoading = false
-        })
-      }
-    },
-    buildTree({ code, busId, mode }) {
-      buildTree({
-        boCode: code,
-        boDefId: busId,
-        mode: mode || ''
-      }).then(response => {
-        this.boData = response.data
-      }).catch((e) => {
-        //  loading.close()
-      })
     }
-  }
-}
 </script>
-<style lang="scss" >
-  .formbuilder-dialog{
-    .el-dialog__header{
-      padding: 0;
-      border-bottom:0;
-    }
-    .el-dialog__body {
-     padding: 0;
-    }
-    .is-fullscreen{
-      overflow: hidden;
+<style lang="scss" module>
+    .content {
+        :global {
+            .form-main .widget-form-container {
+                .el-dialog__header {
+                    padding: 0;
+                    border-bottom: 0;
+                }
+                .el-dialog__body {
+                    padding: 0;
+                }
+                .is-fullscreen {
+                    overflow: hidden;
+                }
+                .el-form-item__label {
+                    padding-left: 30px;
+                    position: relative;
+                    &:before {
+                        position: absolute;
+                        left: 24px;
+                    }
+                }
+            }
+        }
     }
-  }
 </style>

+ 90 - 75
src/business/platform/form/formrender/index.vue

@@ -1,66 +1,68 @@
 <template>
     <div v-if="formPage">
         <ibps-watermark :disabled="!enableWatermark" :text="watermarkText">
-            <!--顶部按钮-->
-            <template v-if="hasActions">
-                <div v-sticky="{ stickyTop: marginTop }" class="form-toolbar hidden-print">
-                    <div :class="['ibps-toolbar--' + $ELEMENT.size]" class="ibps-toolbar">
-                        <panle />
-                        <div class="header" style="height: 30px">
-                            <div class="buttons" style="float: right; margin-right: 8%">
-                                <ibps-toolbar
-                                    ref="toolbar"
-                                    :actions="actions.reverse()"
-                                    @action-event="handleButtonEvent"
-                                />
-                            </div>
-                            <!--步骤条按钮-->
-                            <div v-if="hasStepButton" class="buttons ibps-pr-10 ibps-fr-important">
-                                <el-button
-                                    v-for="button in stepButtons"
-                                    :key="button.key"
-                                    :size="button.size || $ELEMENT.size"
-                                    :icon="'ibps-icon-' + button.icon"
-                                    :autofocus="false"
-                                    :disabled="disabledStepButton(button.key)"
-                                    :loading="stepLoading"
-                                    @click="() => { handleStepButtonEvent(button) }"
-                                >
-                                    {{ button.label }}
-                                </el-button>
+            <div class="table-content">
+                <!--顶部按钮-->
+                <template v-if="hasActions">
+                    <div v-sticky="{ stickyTop: marginTop }" class="form-toolbar hidden-print">
+                        <div :class="['ibps-toolbar--' + $ELEMENT.size]" class="ibps-toolbar">
+                            <panle />
+                            <div class="header" style="height: 30px">
+                                <div class="buttons" style="float: right; margin-right: 8%">
+                                    <ibps-toolbar
+                                        ref="toolbar"
+                                        :actions="actions.reverse()"
+                                        @action-event="handleButtonEvent"
+                                    />
+                                </div>
+                                <!--步骤条按钮-->
+                                <div v-if="hasStepButton" class="buttons ibps-pr-10 ibps-fr-important">
+                                    <el-button
+                                        v-for="button in stepButtons"
+                                        :key="button.key"
+                                        :size="button.size || $ELEMENT.size"
+                                        :icon="'ibps-icon-' + button.icon"
+                                        :autofocus="false"
+                                        :disabled="disabledStepButton(button.key)"
+                                        :loading="stepLoading"
+                                        @click="() => { handleStepButtonEvent(button) }"
+                                    >
+                                        {{ button.label }}
+                                    </el-button>
+                                </div>
                             </div>
                         </div>
                     </div>
-                </div>
-            </template>
-            <!--表单-->
-            <dynamic-form
-                ref="dynamicForm"
-                v-model="formData"
-                :form-def="formDefData"
-                :form="this"
-                :permissions="permissions"
-                :readonly="readonly"
-                :params="params"
-                :dynamicParams="dynamicParams"
-                :initialization="initialization"
-                :cur-active-step.sync="curActiveStep"
-                :isDialog="isDialog"
-                class="form-container"
-                :style="{ marginTop: hasActions ? marginTop + 'px' : '0' }"
-            />
-            <component
-                :is="dialogTemplate"
-                v-if="dialogTemplate"
-                ref="dialogTemplate"
-                v-bind="dialogTemplateAtts"
-            />
-            <component
-                :is="customComponent"
-                v-if="customComponent"
-                ref="customComponent"
-                v-bind="customComponentAtts"
-            />
+                </template>
+                <!--表单-->
+                <dynamic-form
+                    ref="dynamicForm"
+                    v-model="formData"
+                    :form-def="formDefData"
+                    :form="this"
+                    :permissions="permissions"
+                    :readonly="readonly"
+                    :params="params"
+                    :dynamicParams="dynamicParams"
+                    :initialization="initialization"
+                    :cur-active-step.sync="curActiveStep"
+                    :isDialog="isDialog"
+                    class="form-container"
+                    :style="{ marginTop: hasActions ? marginTop + 'px' : '0' }"
+                />
+                <component
+                    :is="dialogTemplate"
+                    v-if="dialogTemplate"
+                    ref="dialogTemplate"
+                    v-bind="dialogTemplateAtts"
+                />
+                <component
+                    :is="customComponent"
+                    v-if="customComponent"
+                    ref="customComponent"
+                    v-bind="customComponentAtts"
+                />
+            </div>
         </ibps-watermark>
     </div>
 </template>
@@ -560,26 +562,39 @@
     }
 </script>
 <style lang="scss" scoped>
-    .form-toolbar {
-        position: fixed;
-        width: 100%;
-        margin-top: -50px;
-    }
-    .form-container {
-        margin: 0 10px 10px 10px;
-    }
-    @media print {
-        .dynamic-form {
-            margin-top: 0 !important;
+    .table-content {
+        .form-toolbar {
+            position: fixed;
+            width: 100%;
+            margin-top: -50px;
         }
-        .el-dialog__headerbtn {
-            display: none !important;
-            padding: 0;
-            margin: 0;
+        .form-container {
+            margin: 0 10px 10px 10px;
+            ::v-deep .el-form--label-left {
+                font-size: 18px;
+                .el-form-item__label {
+                    padding-left: 30px;
+                    position: relative;
+                    &:before {
+                        position: absolute;
+                        left: 24px;
+                    }
+                }
+            }
         }
-        .hidden-print {
-            padding: 0;
-            margin: 0;
+        @media print {
+            .dynamic-form {
+                margin-top: 0 !important;
+            }
+            .el-dialog__headerbtn {
+                display: none !important;
+                padding: 0;
+                margin: 0;
+            }
+            .hidden-print {
+                padding: 0;
+                margin: 0;
+            }
         }
     }
 </style>