Bladeren bron

update: 开放流程指南,子表tooltip调整

cfort 2 jaren geleden
bovenliggende
commit
8f028ba69b

+ 39 - 40
src/business/platform/form/formrender/dynamic-form/dynamic-form-field.vue

@@ -9,25 +9,8 @@
                 </div>
                 </div>
             </template>
             </template>
 
 
-            <!-- <el-dropdown
-                v-else-if="fieldType === 'text' || fieldType === 'textarea'"
-                :style="{ width: width }"
-                size="mini"
-                placement="top-start"
-                trigger="click"
-                @command="handleCommand"
-            > -->
             <div v-else-if="fieldType === 'text' || fieldType === 'textarea'" :style="{ width: width }">
             <div v-else-if="fieldType === 'text' || fieldType === 'textarea'" :style="{ width: width }">
-                <!-- <el-dropdown
-                v-else-if="fieldType==='text'||fieldType==='textarea'"
-                :style="{width:width}"
-                size="mini"
-                @click.native="reqPhrase($store.getters.userInfo.employee.groupID,field)"
-                placement="top-start"
-                trigger="click"
-                @command="handleCommand"
-            > -->
-                <el-tooltip effect="dark" :content="dataModel" placement="top" :disabled="isShowTooltip">
+                <el-tooltip effect="dark" :content="dataModel" placement="top" :disabled="!isShowTooltip">
                     <el-input
                     <el-input
                         v-model="dataModel"
                         v-model="dataModel"
                         :placeholder="placeholder"
                         :placeholder="placeholder"
@@ -45,19 +28,43 @@
                         v-on="$listeners"
                         v-on="$listeners"
                     />
                     />
                 </el-tooltip>
                 </el-tooltip>
-                
-                <!-- <el-button
+            </div>
+            <!-- 配置常用语功能,性能较差 -->
+            <!-- <el-dropdown
+                v-else-if="fieldType==='text'||fieldType==='textarea'"
+                :style="{width:width}"
+                size="mini"
+                placement="top-start"
+                trigger="click"
+                @click.native="reqPhrase($store.getters.userInfo.employee.groupID,field)"
+                @command="handleCommand"
+            >
+                <el-input
+                    v-model="dataModel"
+                    :placeholder="placeholder"
+                    :type="fieldType"
+                    :name="field.name"
+                    :autosize="autosize"
+                    :rows="fieldOptions.rows || 3"
+                    :readonly="readonly"
+                    unselectable="on"
+                    :style="{ width: width }"
+                    :clearable="clearable && hasFocus"
+                    @focus="() => hasFocus = true"
+                    @blur="() => hasFocus = false"
+                    v-on="$listeners"
+                />
+                <el-button
                     v-if="(!fieldOptions.custom_class || fieldOptions.custom_class>=120) && !dataModel"
                     v-if="(!fieldOptions.custom_class || fieldOptions.custom_class>=120) && !dataModel"
                     size="mini"
                     size="mini"
-                    title='添加短语'
+                    title="添加常用语"
                     plain
                     plain
                     icon="el-icon-folder-add"
                     icon="el-icon-folder-add"
                     align="center"
                     align="center"
                     class="elButtonPlace"
                     class="elButtonPlace"
                     @click.stop="addDict($store.getters.userInfo.employee.groupID,field,field.label)"
                     @click.stop="addDict($store.getters.userInfo.employee.groupID,field,field.label)"
-                /> -->
-
-                <!-- <el-dropdown-menu v-show="menuHide" slot="dropdown">
+                />
+                <el-dropdown-menu v-show="menuHide" slot="dropdown">
                     <el-dropdown-item
                     <el-dropdown-item
                         v-for="(item, index) in selectModel"
                         v-for="(item, index) in selectModel"
                         :key="index"
                         :key="index"
@@ -66,9 +73,8 @@
                         {{ index + 1 }}. {{ item.contextName | ellipsis }}
                         {{ index + 1 }}. {{ item.contextName | ellipsis }}
                         <span style="float: right; margin-left: 50px; color: #eb6709;" @click.stop="deleteDicts(item.uuId, field.label)">删</span>
                         <span style="float: right; margin-left: 50px; color: #eb6709;" @click.stop="deleteDicts(item.uuId, field.label)">删</span>
                     </el-dropdown-item>
                     </el-dropdown-item>
-                </el-dropdown-menu> -->
-            <!-- </el-dropdown> -->
-            </div>
+                </el-dropdown-menu>
+            </el-dropdown> -->
 
 
             <el-input
             <el-input
                 v-else
                 v-else
@@ -674,7 +680,7 @@ export default {
             dict_add: false,
             dict_add: false,
             selectDataResult: [],
             selectDataResult: [],
             hasFocus: false,
             hasFocus: false,
-            isShowTooltip:false
+            isShowTooltip: true
         }
         }
     },
     },
     computed: {
     computed: {
@@ -1003,16 +1009,9 @@ export default {
         }
         }
     },
     },
     methods: {
     methods: {
-        inputOnMouseOver(e){
-            const target = e.target;
-            
-            // 判断是否开启tooltip功能
-            if (this.isTable==true&&target.offsetWidth < target.scrollWidth) {
-                this.isShowTooltip = false;
-            } else {
-                this.isShowTooltip = true;
-            }
-            // console.log(e,target,target.offsetWidth , target.scrollWidth,target.offsetWidth < target.scrollWidth,this.isShowTooltip,!this.isTable,!this.isTable&&this.isShowTooltip)
+        inputOnMouseOver (e) {
+            const { offsetWidth, scrollWidth } = e.target || {}
+            this.isShowTooltip = this.isTable && (offsetWidth < scrollWidth)
         },
         },
         handleRadioChange (val) {
         handleRadioChange (val) {
             if (this.dataModel === val && this.fieldOptions.uncheck === true) {
             if (this.dataModel === val && this.fieldOptions.uncheck === true) {
@@ -1178,7 +1177,7 @@ export default {
                     if (response.state === 200) {
                     if (response.state === 200) {
                         this.selectModel = response.variables.page
                         this.selectModel = response.variables.page
                     }
                     }
-                }).catch(error => {
+                }).catch(() => {
                     this.$message.error('系统忙、或数据错误,请稍后再试')
                     this.$message.error('系统忙、或数据错误,请稍后再试')
                 })
                 })
             }
             }
@@ -1217,7 +1216,7 @@ export default {
                             }
                             }
                         })
                         })
                     }
                     }
-                }).catch(error => {
+                }).catch(() => {
                     this.$message.error('系统忙、或数据错误,请稍后再试')
                     this.$message.error('系统忙、或数据错误,请稍后再试')
                 })
                 })
             }).catch(() => {})
             }).catch(() => {})

+ 441 - 438
src/views/platform/bpmn/bpmDef/list.vue

@@ -1,106 +1,107 @@
 <template>
 <template>
-  <ibps-layout ref="layout">
-    <div slot="west">
-      <ibps-type-tree
-        :width="width"
-        :height="height"
-        title="任务分类"
-        category-key="FLOW_TYPE"
-        :has-contextmenu="true"
-        @node-click="handleNodeClick"
-        @expand-collapse="handleExpandCollapse"
-      />
-    </div>
-    <ibps-container :margin-left="width+'px'" class="page">
-      <ibps-crud
-        ref="crud"
-        :height="height"
-        :data="listData"
-        :index-row="false"
-        :toolbars="listConfig.toolbars"
-        :row-handle="listConfig.rowHandle"
-        :search-form="listConfig.searchForm"
-        :pk-key="pkKey"
-        :columns="listConfig.columns"
-        :pagination="pagination"
-        :loading="loading"
-        @action-event="handleAction"
-        @sort-change="handleSortChange"
-        @pagination-change="handlePaginationChange"
-      >
-        <template v-slot:defName="{value,row}">
-          <el-link
-            v-if="(row.authorizeRight && row.authorizeRight.managementSet === 'Y' && row.status !== 'draft')"
-            :underline="false"
-            type="primary"
-            @click="handleSetting(row.defId,row.defKey)"
-          >
-            {{ value }}
-          </el-link>
-          <span v-else>{{ value }}</span>
-        </template></ibps-crud>
-    </ibps-container>
-    <!-- 导入定义 -->
-    <import-def
-      :id="editId"
-      :visible="importFormVisible"
-      @callback="search"
-      @close="visible => importFormVisible = visible"
-    />
-    <!-- 设计 -->
-    <design
-      :id="editId"
-      :type-id="typeId"
-      :visible="designFormVisible"
-      :status="status"
-      title="设计流程建模"
-      @callback="search"
-      @close="visible => designFormVisible = visible"
-    />
-    <!-- 设置分类 -->
-    <setting-type
-      :visible="settingTypeFormVisible"
-      title="设置任务分类"
-      category-key="FLOW_TYPE"
-      @save="saveSettingType"
-      @close="visible => settingTypeFormVisible = visible"
-    />
-    <!-- 流程设置 -->
-    <ibps-bpmn-def-setting
-      :visible="settingFormVisible"
-      :def-id="editId"
-      :def-key="defKey"
-      title="任务设置"
-      @callback="search"
-      @close="visible => settingFormVisible = visible"
-    />
+    <ibps-layout ref="layout">
+        <div slot="west">
+            <ibps-type-tree
+                :width="width"
+                :height="height"
+                title="任务分类"
+                category-key="FLOW_TYPE"
+                :has-contextmenu="true"
+                @node-click="handleNodeClick"
+                @expand-collapse="handleExpandCollapse"
+            />
+        </div>
+        <ibps-container :margin-left="width+'px'" class="page">
+            <ibps-crud
+                ref="crud"
+                :height="height"
+                :data="listData"
+                :index-row="false"
+                :toolbars="listConfig.toolbars"
+                :row-handle="listConfig.rowHandle"
+                :search-form="listConfig.searchForm"
+                :pk-key="pkKey"
+                :columns="listConfig.columns"
+                :pagination="pagination"
+                :loading="loading"
+                @action-event="handleAction"
+                @sort-change="handleSortChange"
+                @pagination-change="handlePaginationChange"
+            >
+                <template v-slot:defName="{value,row}">
+                    <el-link
+                        v-if="(row.authorizeRight && row.authorizeRight.managementSet === 'Y' && row.status !== 'draft')"
+                        :underline="false"
+                        type="primary"
+                        @click="handleSetting(row.defId,row.defKey)"
+                    >
+                        {{ value }}
+                    </el-link>
+                    <span v-else>{{ value }}</span>
+                </template></ibps-crud>
+        </ibps-container>
+        <!-- 导入定义 -->
+        <import-def
+            :id="editId"
+            :visible="importFormVisible"
+            @callback="search"
+            @close="visible => importFormVisible = visible"
+        />
+        <!-- 设计 -->
+        <design
+            :id="editId"
+            :type-id="typeId"
+            :visible="designFormVisible"
+            :status="status"
+            title="设计流程建模"
+            @callback="search"
+            @close="visible => designFormVisible = visible"
+        />
+        <!-- 设置分类 -->
+        <setting-type
+            :visible="settingTypeFormVisible"
+            title="设置任务分类"
+            category-key="FLOW_TYPE"
+            @save="saveSettingType"
+            @close="visible => settingTypeFormVisible = visible"
+        />
+        <!-- 流程设置 -->
+        <ibps-bpmn-def-setting
+            :visible="settingFormVisible"
+            :def-id="editId"
+            :def-key="defKey"
+            title="任务设置"
+            @callback="search"
+            @close="visible => settingFormVisible = visible"
+        />
 
 
-    <!-- 流程启动 -->
-    <bpmn-formrender
-      :visible="startFormVisible"
-      :def-id="editId"
-      :title = "title"
-      @close="visible => startFormVisible = visible"
-    />
-    <!-- 复制流程 -->
-    <copy
-      :id="editId"
-      :data="data"
-      :visible="copyFormVisible"
-      @callback="search"
-      @close="visible => copyFormVisible = visible"
-    />
-    <!-- 编辑指南 -->
-    <!-- <edit-guide
-      :def-id="editId"
-      :data="data"
-      :visible="editGuideFormVisible"
-      :title="title"
-      @callback="search"
-      @close="visible => editGuideFormVisible = visible"
-    /> -->
+        <!-- 流程启动 -->
+        <bpmn-formrender
+            :visible="startFormVisible"
+            :def-id="editId"
+            :title="title"
+            @close="visible => startFormVisible = visible"
+        />
+        <!-- 复制流程 -->
+        <copy
+            :id="editId"
+            :data="data"
+            :visible="copyFormVisible"
+            @callback="search"
+            @close="visible => copyFormVisible = visible"
+        />
+        <!-- 编辑指南 -->
+        <edit-guide
+            :def-id="editId"
+            :data="data"
+            :visible="editGuideFormVisible"
+            :title="title"
+            :readonly="title === '查看指南'"
+            @callback="search"
+            @close="visible => editGuideFormVisible = visible"
+        />
 
 
-  </ibps-layout>
+    </ibps-layout>
 </template>
 </template>
 <script>
 <script>
 import { queryPageList, setCategory } from '@/api/platform/bpmn/bpmDefinition'
 import { queryPageList, setCategory } from '@/api/platform/bpmn/bpmDefinition'
@@ -113,350 +114,352 @@ import Vue from 'vue'
 Vue.component('IbpsBpmnDefSetting', () => import('@/business/platform/bpmn/setting'))
 Vue.component('IbpsBpmnDefSetting', () => import('@/business/platform/bpmn/setting'))
 
 
 export default {
 export default {
-  components: {
-    'ibps-type-tree': () => import('@/business/platform/cat/type/tree'),
-    'setting-type': () => import('@/business/platform/cat/type/setting-type'),
-    'design': () => import('./design'),
-    'import-def': () => import('./import'),
-    'copy': () => import('./copy'),
-    // 'edit-guide': () => import('./edit-guide'),
-    'bpmn-formrender': () => import('@/business/platform/bpmn/form/dialog')
-  },
-  mixins: [
-    Handle,
-    FixHeight
-  ],
-  data() {
-    return {
-      width: 200,
-      height: document.clientHeight,
-      dicFormVisible: false, // 弹窗
-      importFormVisible: false,
-      sortFormVisible: false,
-      designFormVisible: false, // 设计流程弹窗
-      settingFormVisible: false, // 设置弹窗
-      settingTypeFormVisible: false, // 设置分类弹窗
-      startFormVisible: false, // 启动流程表单弹窗
-      copyFormVisible: false, // 复制流程弹窗
-      editGuideFormVisible: false, // 编辑指南弹窗
+    components: {
+        'ibps-type-tree': () => import('@/business/platform/cat/type/tree'),
+        'setting-type': () => import('@/business/platform/cat/type/setting-type'),
+        'design': () => import('./design'),
+        'import-def': () => import('./import'),
+        'copy': () => import('./copy'),
+        'edit-guide': () => import('./edit-guide'),
+        'bpmn-formrender': () => import('@/business/platform/bpmn/form/dialog')
+    },
+    mixins: [
+        Handle,
+        FixHeight
+    ],
+    data () {
+        return {
+            width: 200,
+            height: document.clientHeight,
+            dicFormVisible: false, // 弹窗
+            importFormVisible: false,
+            sortFormVisible: false,
+            designFormVisible: false, // 设计流程弹窗
+            settingFormVisible: false, // 设置弹窗
+            settingTypeFormVisible: false, // 设置分类弹窗
+            startFormVisible: false, // 启动流程表单弹窗
+            copyFormVisible: false, // 复制流程弹窗
+            editGuideFormVisible: false, // 编辑指南弹窗
 
 
-      title: '启动', // 编辑框标题
-      editId: '', // 编辑dialog需要使用
-      defKey: '',
-      data: {},
-      typeId: '',
-      status: '',
-      // 数据字典列表
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      loading: false,
-      listData: [],
-      listConfig: { // 工具栏
-        toolbars: [
-          { key: 'search' },
-          { key: 'design', label: '在线流程建模', icon: 'ibps-icon-share-alt' },
-          { key: 'remove' },
-          { key: 'setCategory', label: '设置分类', icon: 'ibps-icon-cog' },
-          { key: 'export', label: '导出' },
-          { key: 'import', label: '导入' },
-          { key: 'more',
-            label: '更多',
-            mode: 'dropdown',
-            menus: [
-              { key: 'batchSuspend', label: '挂起', icon: 'ibps-icon-ioxhost' },
-              { key: 'batchRecover', label: '恢复', icon: 'ibps-icon-ioxhost' }
-            ] }
-        ],
-        searchForm: { // 查询条件
-          forms: [
-            { prop: 'Q^name_^SL', label: '名称', width: 150 },
-            { prop: 'Q^def_key_^SL', label: '业务主键', width: 150 },
-            {
-              prop: 'Q^status_^S',
-              label: '流程状态',
-              fieldType: 'select',
-              options: statusOptions
-            },
-            {
-              prop: 'Q^test_status_^S',
-              label: '测试状态',
-              fieldType: 'select',
-              options: testStatusOptions
-            },
-            {
-              prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'],
-              label: '创建时间',
-              fieldType: 'daterange'
-            }
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '流程名称', slotName: 'defName', sortable: true, minWidth: 200 },
-          { prop: 'defKey', label: '流程业务主键', width: 120, sortable: true },
-          { prop: 'status', label: '流程状态', tags: statusOptions, width: 90 },
-          { prop: 'testStatus', label: '测试状态', tags: testStatusOptions, width: 90 },
-          { prop: 'createTime', label: '创建时间', width: 140, sortable: true },
-          { prop: 'updateTime', label: '更新时间', width: 140, sortable: true },
-          { prop: 'version', label: '版本号', width: 80, sortable: true }
-        ],
-        rowHandle: {
-          actions: [
-            {
-              key: 'start',
-              label: '启动',
-              icon: 'ibps-icon-send',
-              hidden: (rowData, index) => {
-                return !(rowData.authorizeRight && rowData.authorizeRight.managementStart === 'Y' && rowData.status === 'deploy')
-              }
-            },
-            {
-              key: 'copy',
-              label: '复制',
-              icon: 'ibps-icon-copy'
-            },
-            {
-              key: 'deploy',
-              label: '发布',
-              icon: 'ibps-icon-paper-plane',
-              hidden: (rowData, index) => {
-                return !(rowData.status === 'draft')
-              }
-            },
-            {
-              key: 'suspend',
-              label: '挂起',
-              icon: 'ibps-icon-square',
-              hidden: function(rowData, index) {
-                return !(rowData.authorizeRight && rowData.authorizeRight.managementStart === 'Y' &&
-                rowData.status === 'deploy')
-              }
-            },
-            {
-              key: 'recover',
-              label: '恢复',
-              icon: 'ibps-icon-reply',
-              hidden: function(rowData, index) {
-                return !(rowData.authorizeRight && rowData.authorizeRight.managementStart === 'Y' && rowData.status === 'suspend')
-              }
-            },
-            {
-              key: 'setting',
-              label: '设置',
-              icon: 'ibps-icon-cogs',
-              hidden: function(rowData, index) {
-                return !(rowData.authorizeRight && rowData.authorizeRight.managementSet === 'Y' && rowData.status !== 'draft')
-              }
-            },
-            {
-              key: 'design',
-              label: '设计',
-              icon: 'ibps-icon-share-alt',
-              hidden: function(rowData, index) {
-                return !(rowData.authorizeRight && rowData.authorizeRight.managementEdit === 'Y')
-              }
+            title: '启动', // 编辑框标题
+            editId: '', // 编辑dialog需要使用
+            defKey: '',
+            data: {},
+            typeId: '',
+            status: '',
+            // 数据字典列表
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            loading: false,
+            listData: [],
+            listConfig: { // 工具栏
+                toolbars: [
+                    { key: 'search' },
+                    { key: 'design', label: '在线流程建模', icon: 'ibps-icon-share-alt' },
+                    { key: 'remove' },
+                    { key: 'setCategory', label: '设置分类', icon: 'ibps-icon-cog' },
+                    { key: 'export', label: '导出' },
+                    { key: 'import', label: '导入' },
+                    { key: 'more',
+                        label: '更多',
+                        mode: 'dropdown',
+                        menus: [
+                            { key: 'batchSuspend', label: '挂起', icon: 'ibps-icon-ioxhost' },
+                            { key: 'batchRecover', label: '恢复', icon: 'ibps-icon-ioxhost' }
+                        ] }
+                ],
+                searchForm: { // 查询条件
+                    forms: [
+                        { prop: 'Q^name_^SL', label: '名称', width: 150 },
+                        { prop: 'Q^def_key_^SL', label: '业务主键', width: 150 },
+                        {
+                            prop: 'Q^status_^S',
+                            label: '流程状态',
+                            fieldType: 'select',
+                            options: statusOptions
+                        },
+                        {
+                            prop: 'Q^test_status_^S',
+                            label: '测试状态',
+                            fieldType: 'select',
+                            options: testStatusOptions
+                        },
+                        {
+                            prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'],
+                            label: '创建时间',
+                            fieldType: 'daterange'
+                        }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '流程名称', slotName: 'defName', sortable: true, minWidth: 200 },
+                    { prop: 'defKey', label: '流程业务主键', width: 120, sortable: true },
+                    { prop: 'status', label: '流程状态', tags: statusOptions, width: 90 },
+                    { prop: 'testStatus', label: '测试状态', tags: testStatusOptions, width: 90 },
+                    { prop: 'createTime', label: '创建时间', width: 140, sortable: true },
+                    { prop: 'updateTime', label: '更新时间', width: 140, sortable: true },
+                    { prop: 'version', label: '版本号', width: 80, sortable: true }
+                ],
+                rowHandle: {
+                    actions: [
+                        {
+                            key: 'start',
+                            label: '启动',
+                            icon: 'ibps-icon-send',
+                            hidden: (rowData, index) => {
+                                return !(rowData.authorizeRight && rowData.authorizeRight.managementStart === 'Y' && rowData.status === 'deploy')
+                            }
+                        },
+                        {
+                            key: 'copy',
+                            label: '复制',
+                            icon: 'ibps-icon-copy'
+                        },
+                        {
+                            key: 'deploy',
+                            label: '发布',
+                            icon: 'ibps-icon-paper-plane',
+                            hidden: (rowData, index) => {
+                                return !(rowData.status === 'draft')
+                            }
+                        },
+                        {
+                            key: 'suspend',
+                            label: '挂起',
+                            icon: 'ibps-icon-square',
+                            hidden: function (rowData, index) {
+                                return !(rowData.authorizeRight && rowData.authorizeRight.managementStart === 'Y' && rowData.status === 'deploy')
+                            }
+                        },
+                        {
+                            key: 'recover',
+                            label: '恢复',
+                            icon: 'ibps-icon-reply',
+                            hidden: function (rowData, index) {
+                                return !(rowData.authorizeRight && rowData.authorizeRight.managementStart === 'Y' && rowData.status === 'suspend')
+                            }
+                        },
+                        {
+                            key: 'setting',
+                            label: '设置',
+                            icon: 'ibps-icon-cogs',
+                            hidden: function (rowData, index) {
+                                return !(rowData.authorizeRight && rowData.authorizeRight.managementSet === 'Y' && rowData.status !== 'draft')
+                            }
+                        },
+                        {
+                            key: 'design',
+                            label: '设计',
+                            icon: 'ibps-icon-share-alt',
+                            hidden: function (rowData, index) {
+                                return !(rowData.authorizeRight && rowData.authorizeRight.managementEdit === 'Y')
+                            }
+                        },
+                        {
+                            key: 'remove',
+                            hidden: function (rowData, index) {
+                                return !(rowData.authorizeRight && rowData.authorizeRight.managementDel === 'Y')
+                            }
+                        },
+                        {
+                            key: 'getGuide',
+                            label: '查看指南',
+                            icon: 'ibps-icon-detail',
+                            hidden: function (rowData, index) {
+                                if (rowData.hasGuide === true || rowData.hasGuide === 'true') {
+                                    return false
+                                }
+                                return true
+                            }
+                        },
+                        {
+                            key: 'editGuide',
+                            label: '编辑指南',
+                            icon: 'ibps-icon-edit',
+                            hidden: function (rowData, index) {
+                                return !(rowData.authorizeRight && rowData.authorizeRight.managementClean === 'Y')
+                            }
+                        },
+                        {
+                            key: 'clear',
+                            label: '清除数据',
+                            icon: 'ibps-icon-trash',
+                            hidden: function (rowData, index) {
+                                return !(rowData.authorizeRight && rowData.authorizeRight.managementClean === 'Y')
+                            }
+                        }
+                    ]
+                }
             },
             },
-            {
-              key: 'remove',
-              hidden: function(rowData, index) {
-                return !(rowData.authorizeRight && rowData.authorizeRight.managementDel === 'Y')
-              }
-            },
-            // {
-            //   key: 'getGuide',
-            //   label: '查看指南',
-            //   icon: 'ibps-icon-detail',
-            //   hidden: function(rowData, index) {
-            //     if (rowData.hasGuide === true || rowData.hasGuide === 'true') {
-            //       return false
-            //     }
-            //     return true
-            //   }
-            // },
-            // {
-            //   key: 'editGuide',
-            //   label: '编辑指南',
-            //   icon: 'ibps-icon-edit',
-            //   hidden: function (rowData, index) {
-            //     return !(rowData.authorizeRight && rowData.authorizeRight.managementClean === 'Y')
-            //   }
-            // },
-            {
-              key: 'clear',
-              label: '清除数据',
-              icon: 'ibps-icon-trash',
-              hidden: function(rowData, index) {
-                return !(rowData.authorizeRight && rowData.authorizeRight.managementClean === 'Y')
-              }
-            }
-          ]
-        }
-      },
-      pagination: {},
-      sorts: {}
+            pagination: {},
+            sorts: {}
 
 
-    }
-  },
-  created() {
-    this.loadData()
-  },
-  methods: {
-    /**
-     * 加载数据
-     */
-    loadData() {
-      this.loading = true
-      queryPageList(this.getSearcFormData()).then(response => {
-        ActionUtils.handleListData(this, response.data)
-        this.loading = false
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getSearcFormData() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      if (this.$utils.isNotEmpty(this.typeId)) {
-        params['Q^TYPE_ID_^S'] = this.typeId
-      }
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadData()
-    },
-    search() {
-      this.loadData()
-    },
-    /**
-     * 重置查询条件
-     */
-    reset() {
-      this.$refs['crud'].handleReset()
-    },
-    /**
-     * 前置事件
-     *
-     * @before-action-event="beforeActionEvent"
-     */
-    beforeActionEvent(key, position, data, callback) {
-      const flag = true
-      callback(flag)
-    },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        case 'design':// 设计
-          if (this.$utils.isNotEmpty(data)) {
-            this.status = data.status
-          }
-          this.handleDesign(position === 'toolbar' ? '' : selection)
-          break
-        case 'remove':// 删除
-          ActionUtils.removeRecord(selection).then((ids) => {
-            this.handleRemove(ids)
-          }).catch(() => { })
-          break
-        case 'setCategory':// 设置分类
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleSetCat(ids)
-          }).catch(() => { })
-          break
-        case 'export':// 导出
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleExport(ids)
-          }).catch(() => { })
-          break
-        case 'import': // 导入
-          this.handImport()
-          break
-        case 'batchSuspend':// 挂起
-        case 'suspend':// 挂起
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleBatchSuspend(ids)
-          }).catch(() => { })
-          break
-        case 'batchRecover':// 恢复
-        case 'recover':// 恢复
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleBatchRecover(ids)
-          }).catch(() => { })
-          break
-        case 'start':// 启动
-          this.handleStart(selection)
-          break
-        case 'copy':// 复制
-          this.title = '复制流程'
-          this.data = data
-          this.handleCopy(selection)
-          break
-        case 'deploy':// 发布
-          this.handleDeploy(selection)
-          break
-        case 'setting':// 设置
-          this.handleSetting(selection, data.defKey)
-          break
-        case 'editGuide':// 编辑指南
-          this.handleEditGuide(selection)
-          break
-        case 'clear':// 清除数据
-          this.handleClear(selection)
-          break
-        default:
-          break
-      }
-    },
-    handleCopy(id) {
-      this.copyFormVisible = true
-      this.editId = id
-    },
-    handleNodeClick(typeId) {
-      this.typeId = typeId
-      this.loadData()
+        }
     },
     },
-    handleExpandCollapse(isExpand) {
-      this.width = isExpand ? 200 : 30
+    created () {
+        this.loadData()
     },
     },
-    getSelectedData(id) {
-      const data = this.listData
-      for (let index = 0; index < data.length; index++) {
-        if (data[index].id === id) {
-          return data[index]
+    methods: {
+        /**
+         * 加载数据
+         */
+        loadData () {
+            this.loading = true
+            queryPageList(this.getSearcFormData()).then(response => {
+                ActionUtils.handleListData(this, response.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getSearcFormData () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            if (this.$utils.isNotEmpty(this.typeId)) {
+                params['Q^TYPE_ID_^S'] = this.typeId
+            }
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        search () {
+            this.loadData()
+        },
+        /**
+         * 重置查询条件
+         */
+        reset () {
+            this.$refs['crud'].handleReset()
+        },
+        /**
+         * 前置事件
+         *
+        * @before-action-event="beforeActionEvent"
+        */
+        beforeActionEvent (key, position, data, callback) {
+            const flag = true
+            callback(flag)
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                case 'design':// 设计
+                    if (this.$utils.isNotEmpty(data)) {
+                        this.status = data.status
+                    }
+                    this.handleDesign(position === 'toolbar' ? '' : selection)
+                    break
+                case 'remove':// 删除
+                    ActionUtils.removeRecord(selection).then((ids) => {
+                        this.handleRemove(ids)
+                    }).catch(() => { })
+                    break
+                case 'setCategory':// 设置分类
+                    ActionUtils.selectedMultiRecord(selection).then((ids) => {
+                        this.handleSetCat(ids)
+                    }).catch(() => { })
+                    break
+                case 'export':// 导出
+                    ActionUtils.selectedMultiRecord(selection).then((ids) => {
+                        this.handleExport(ids)
+                    }).catch(() => { })
+                    break
+                case 'import': // 导入
+                    this.handImport()
+                    break
+                case 'batchSuspend':// 挂起
+                case 'suspend':// 挂起
+                    ActionUtils.selectedMultiRecord(selection).then((ids) => {
+                        this.handleBatchSuspend(ids)
+                    }).catch(() => { })
+                    break
+                case 'batchRecover':// 恢复
+                case 'recover':// 恢复
+                    ActionUtils.selectedMultiRecord(selection).then((ids) => {
+                        this.handleBatchRecover(ids)
+                    }).catch(() => { })
+                    break
+                case 'start':// 启动
+                    this.handleStart(selection)
+                    break
+                case 'copy':// 复制
+                    this.title = '复制流程'
+                    this.data = data
+                    this.handleCopy(selection)
+                    break
+                case 'deploy':// 发布
+                    this.handleDeploy(selection)
+                    break
+                case 'setting':// 设置
+                    this.handleSetting(selection, data.defKey)
+                    break
+                case 'getGuide':// 查看指南
+                    this.handleEditGuide(selection, 'look')
+                    break
+                case 'editGuide':// 编辑指南
+                    this.handleEditGuide(selection, 'edit')
+                    break
+                case 'clear':// 清除数据
+                    this.handleClear(selection)
+                    break
+                default:
+                    break
+            }
+        },
+        handleCopy (id) {
+            this.copyFormVisible = true
+            this.editId = id
+        },
+        handleNodeClick (typeId) {
+            this.typeId = typeId
+            this.loadData()
+        },
+        handleExpandCollapse (isExpand) {
+            this.width = isExpand ? 200 : 30
+        },
+        getSelectedData (id) {
+            const data = this.listData
+            for (let index = 0; index < data.length; index++) {
+                if (data[index].id === id) {
+                    return data[index]
+                }
+            }
+        },
+        saveSettingType (typeId) {
+            setCategory({
+                defIds: this.editId,
+                typeId: typeId
+            }).then(response => {
+                ActionUtils.successMessage('保存成功')
+                this.settingTypeFormVisible = false
+                this.search()
+            }).catch((err) => {
+                console.error(err)
+            })
         }
         }
-      }
-    },
-    saveSettingType(typeId) {
-      setCategory({
-        defIds: this.editId,
-        typeId: typeId
-      }).then(response => {
-        ActionUtils.successMessage('保存成功')
-        this.settingTypeFormVisible = false
-        this.search()
-      }).catch((err) => {
-        console.error(err)
-      })
     }
     }
-  }
 }
 }
 </script>
 </script>

+ 124 - 126
src/views/platform/bpmn/bpmDef/mixin/handle.js

@@ -3,133 +3,131 @@ import ActionUtils from '@/utils/action'
 import fecha from '@/utils/fecha'
 import fecha from '@/utils/fecha'
 
 
 export default {
 export default {
-  methods: {
-    /**
-     * 设置分类
-     */
-    handleSetCat(ids) {
-      this.editId = ids
-      this.settingTypeFormVisible = true
-    },
-    /**
-     * 设计流程建模
-     */
-    handleDesign(editId) {
-      this.editId = editId || ''
-      this.designFormVisible = true
-    },
-    /**
-     * 启动流程
-     */
-    handleStart(editId) {
-      this.editId = editId || ''
-      this.startFormVisible = true
-    },
-    /**
-     * 复制流程
-     */
-    handleCopy(data) {
-      this.title = '请输入新流程定义Key(原流程定义Key【' + data.defKey + '】)'
-      this.editId = data.id || ''
-      this.data = data
-      this.copyFormVisible = true
-    },
-    /**
-     * 流程设置
-     */
-    handleSetting(defId, defKey) {
-      this.editId = defId
-      this.defKey = defKey
-      this.settingFormVisible = true
-    },
-    /**
-     * 发布流程
-     */
-    handleDeploy(id) {
-      this.$confirm('确定要发布吗?', '信息').then(() => {
-        deploy({ defId: id }).then(response => {
-          ActionUtils.successMessage('发布成功!')
-          this.search()
-        }).catch(() => {
-        })
-      }).catch(() => {})
-    },
-    /**
-     * 编辑指南
-     */
-    handleEditGuide(editId) {
-      this.editId = editId || ''
-      this.editGuideFormVisible = true
-      this.title = '编辑指南'
-    },
-    /**
-     * 清除数据
-     */
-    handleClear(id) {
-      this.$confirm('确定要清除数据吗?', '提示').then(() => {
-        cleanData({ defId: id }).then(response => {
-          ActionUtils.successMessage('清除数据成功!')
-          this.search()
-        }).catch(() => {
-        })
-      }).catch(() => {})
-    },
-    handleRemove(ids) {
-      remove({ defIds: ids }).then(response => {
-        ActionUtils.removeSuccessMessage()
-        this.search()
-      }).catch(() => {
-      })
-    },
-    handleBatchSuspend(ids, batch = false) {
-      this.$confirm('挂起流程定义,其运行实例将级联挂起', '信息', {
-        confirmButtonText: '是',
-        cancelButtonText: '否'
-      }).then(() => {
-        this.batchSuspend(ids, true)
-      }).catch(() => {
-        this.batchSuspend(ids, false)
-      })
-    },
-    batchSuspend(defIds, cascade) {
-      batchSuspend({ defIds, cascade }).then(response => {
-        ActionUtils.successMessage('成功挂起流程定义')
-        this.search()
-      }).catch(() => {
+    methods: {
+        /**
+         * 设置分类
+         */
+        handleSetCat (ids) {
+            this.editId = ids
+            this.settingTypeFormVisible = true
+        },
+        /**
+         * 设计流程建模
+         */
+        handleDesign (editId) {
+            this.editId = editId || ''
+            this.designFormVisible = true
+        },
+        /**
+         * 启动流程
+         */
+        handleStart (editId) {
+            this.editId = editId || ''
+            this.startFormVisible = true
+        },
+        /**
+         * 复制流程
+         */
+        handleCopy (data) {
+            this.title = '请输入新流程定义Key(原流程定义Key【' + data.defKey + '】)'
+            this.editId = data.id || ''
+            this.data = data
+            this.copyFormVisible = true
+        },
+        /**
+         * 流程设置
+         */
+        handleSetting (defId, defKey) {
+            this.editId = defId
+            this.defKey = defKey
+            this.settingFormVisible = true
+        },
+        /**
+         * 发布流程
+         */
+        handleDeploy (id) {
+            this.$confirm('确定要发布吗?', '信息').then(() => {
+                deploy({ defId: id }).then(response => {
+                    ActionUtils.successMessage('发布成功!')
+                    this.search()
+                }).catch(() => {
+                })
+            }).catch(() => {})
+        },
+        /**
+         * 编辑指南
+         */
+        handleEditGuide (editId, type) {
+            this.editId = editId || ''
+            this.editGuideFormVisible = true
+            this.title = type === 'edit' ? '编辑指南' : '查看指南'
+        },
+        /**
+         * 清除数据
+         */
+        handleClear (id) {
+            this.$confirm('确定要清除数据吗?', '提示').then(() => {
+                cleanData({ defId: id }).then(response => {
+                    ActionUtils.successMessage('清除数据成功!')
+                    this.search()
+                }).catch(() => {
+                })
+            }).catch(() => {})
+        },
+        handleRemove (ids) {
+            remove({ defIds: ids }).then(response => {
+                ActionUtils.removeSuccessMessage()
+                this.search()
+            }).catch(() => {
+            })
+        },
+        handleBatchSuspend (ids, batch = false) {
+            this.$confirm('挂起流程定义,其运行实例将级联挂起', '信息', {
+                confirmButtonText: '是',
+                cancelButtonText: '否'
+            }).then(() => {
+                this.batchSuspend(ids, true)
+            }).catch(() => {
+                this.batchSuspend(ids, false)
+            })
+        },
+        batchSuspend (defIds, cascade) {
+            batchSuspend({ defIds, cascade }).then(response => {
+                ActionUtils.successMessage('成功挂起流程定义')
+                this.search()
+            }).catch(() => {
 
 
-      })
-    },
-    handleBatchRecover(ids, batch = false) {
-      this.$confirm('恢复流程定义,其运行实例将级联恢复', '信息', {
-        confirmButtonText: '是',
-        cancelButtonText: '否'
-      }).then(() => {
-        this.batchRecover(ids, true)
-      }).catch(() => {
-        this.batchRecover(ids, false)
-      })
-    },
-    batchRecover(defIds, cascade) {
-      batchRecover({ defIds, cascade }).then(response => {
-        ActionUtils.successMessage('成功恢复流程定义')
-        this.search()
-      }).catch(() => {})
-    },
-    handImport() {
-      this.importFormVisible = true
-    },
-    handleExport(ids) {
-      exportFile({ ids: ids }).then((response) => {
-        if (!response) {
-          return
+            })
+        },
+        handleBatchRecover (ids, batch = false) {
+            this.$confirm('恢复流程定义,其运行实例将级联恢复', '信息', {
+                confirmButtonText: '是',
+                cancelButtonText: '否'
+            }).then(() => {
+                this.batchRecover(ids, true)
+            }).catch(() => {
+                this.batchRecover(ids, false)
+            })
+        },
+        batchRecover (defIds, cascade) {
+            batchRecover({ defIds, cascade }).then(response => {
+                ActionUtils.successMessage('成功恢复流程定义')
+                this.search()
+            }).catch(() => {})
+        },
+        handImport () {
+            this.importFormVisible = true
+        },
+        handleExport (ids) {
+            exportFile({ ids: ids }).then((response) => {
+                if (!response) {
+                    return
+                }
+                ActionUtils.exportFile(
+                    response.data,
+                    'bpmDef_' + fecha.formatDate('yyyyMMddHHmmss') + '.zip'
+                )
+            }).catch(() => {})
         }
         }
-        ActionUtils.exportFile(
-          response.data,
-          'bpmDef_' + fecha.formatDate('yyyyMMddHHmmss') + '.zip'
-        )
-      }).catch(() => {
-
-      })
     }
     }
-  }
 }
 }