Przeglądaj źródła

增加流程拖拽功能,首页周期性任务提醒

cfort 2 lat temu
rodzic
commit
f7ca0cf6f4

+ 136 - 136
src/business/platform/bo/def/external-panel.vue

@@ -1,31 +1,31 @@
 <template>
-  <ibps-layout ref="layout">
-    <ibps-crud
-      ref="crud"
-      :height="tableHeight"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :loading="loading"
-      :show-pagination="false"
-      :selection-type="multiple?'checkbox':'radio'"
-      @selection-change="handleSelectionChange"
-      @action-event="handleAction"
-    >
-      <template slot="dsAliasSelect">
-        <el-select v-model="targetDsAlias" clearable placeholder="请选择">
-          <el-option
-            v-for="item in dsAliasOptions"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-      </template>
-    </ibps-crud>
-  </ibps-layout>
+    <ibps-layout ref="layout">
+        <ibps-crud
+            ref="crud"
+            :height="tableHeight"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :loading="loading"
+            :show-pagination="false"
+            :selection-type="multiple?'checkbox':'radio'"
+            @selection-change="handleSelectionChange"
+            @action-event="handleAction"
+        >
+            <template slot="dsAliasSelect">
+                <el-select v-model="targetDsAlias" clearable placeholder="请选择">
+                    <el-option
+                        v-for="item in dsAliasOptions"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value"
+                    />
+                </el-select>
+            </template>
+        </ibps-crud>
+    </ibps-layout>
 </template>
 <script>
 import { queryTable } from '@/api/platform/bo/boDef'
@@ -34,119 +34,119 @@ import ActionUtils from '@/utils/action'
 import SelectionMixin from '@/components/ibps-selector/mixins/selection'
 
 export default {
-  mixins: [SelectionMixin],
-  props: {
-    value: [Object, Array],
-    multiple: Boolean,
-    height: {
-      type: String,
-      default: '400px'
-    }
-  },
-  data() {
-    return {
-      pkKey: 'name', // 主键  如果主键不是pk需要传主键
-      loading: false,
-      listData: [],
-      dsAliasOptions: [],
-      targetDsAlias: '',
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' }
-        ],
-        // 查询条件
-        searchForm: {
-          labelWidth: 100,
-          forms: [
-            { prop: 'tableName', label: '表名', itemWidth: '200' },
-            { prop: 'dsAlias', label: '数据源', fieldType: 'slot', slotName: 'dsAliasSelect' }
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '表名' },
-          { prop: 'comment', label: '描述' }
-        ]
-      }
-    }
-  },
-  computed: {
-    tableHeight() {
-      const h = this.height.substr(0, this.height.length - 2)
-      return parseInt(h) - 10
-    }
-  },
-  watch: {
-    dsAliasOptions: {
-      handler: function(val, oldVal) {
-        this.targetDsAlias = val[0].label
-        this.$emit('callback', val[0])
-      },
-      deer: true
-    }
-  },
-  created() {
-    this.dataSource()
-    this.loadData()
-  },
-  methods: {
-    // 数据源
-    dataSource() {
-      queryDataSource().then(response => {
-        const data = response.data['dataResult']
-        this.dsAliasOptions = data.map(item => {
-          return {
-            label: item.name,
-            value: item.alias
-          }
-        })
-      })
+    mixins: [SelectionMixin],
+    props: {
+        value: [Object, Array],
+        multiple: Boolean,
+        height: {
+            type: String,
+            default: '400px'
+        }
     },
-    /**
-     * 加载数据
-     */
-    loadData() {
-      this.loading = true
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      this.dsAliasOptions.forEach(item => {
-        params.dsAlias = item.label === this.targetDsAlias ? item.value : this.targetDsAlias
-      })
-      queryTable({
-        dsAlias: params.dsAlias,
-        tableName: params.tableName
-      }).then(response => {
-        this.loading = false
-        ActionUtils.handleListData(this, response.data)
-        this.setSelectRow()
-      }).catch(() => {
-        this.loading = false
-      })
+    data () {
+        return {
+            pkKey: 'name', // 主键  如果主键不是pk需要传主键
+            loading: false,
+            listData: [],
+            dsAliasOptions: [],
+            targetDsAlias: '',
+            listConfig: {
+                // 工具栏
+                toolbars: [
+                    { key: 'search' }
+                ],
+                // 查询条件
+                searchForm: {
+                    labelWidth: 100,
+                    forms: [
+                        { prop: 'tableName', label: '表名', itemWidth: '150' },
+                        { prop: 'dsAlias', label: '数据源', fieldType: 'slot', slotName: 'dsAliasSelect' }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '表名' },
+                    { prop: 'comment', label: '描述' }
+                ]
+            }
+        }
     },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadData()
+    computed: {
+        tableHeight () {
+            const h = this.height.substr(0, this.height.length - 2)
+            return parseInt(h) - 10
+        }
     },
-    /**
-     * 重置查询条件
-     */
-    reset() {
-      this.$refs['crud'].handleReset()
+    watch: {
+        dsAliasOptions: {
+            handler: function (val, oldVal) {
+                this.targetDsAlias = val[0].label
+                this.$emit('callback', val[0])
+            },
+            deer: true
+        }
     },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          this.search()
-          break
-        default:
-          break
-      }
+    created () {
+        this.dataSource()
+        this.loadData()
+    },
+    methods: {
+        // 数据源
+        dataSource () {
+            queryDataSource().then(response => {
+                const data = response.data['dataResult']
+                this.dsAliasOptions = data.map(item => {
+                    return {
+                        label: item.name,
+                        value: item.alias
+                    }
+                })
+            })
+        },
+        /**
+         * 加载数据
+         */
+        loadData () {
+            this.loading = true
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            this.dsAliasOptions.forEach(item => {
+                params.dsAlias = item.label === this.targetDsAlias ? item.value : this.targetDsAlias
+            })
+            queryTable({
+                dsAlias: params.dsAlias,
+                tableName: params.tableName
+            }).then(response => {
+                this.loading = false
+                ActionUtils.handleListData(this, response.data)
+                this.setSelectRow()
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadData()
+        },
+        /**
+         * 重置查询条件
+         */
+        reset () {
+            this.$refs['crud'].handleReset()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    this.search()
+                    break
+                default:
+                    break
+            }
+        }
     }
-  }
 }
 </script>

+ 232 - 125
src/business/platform/bpmn/setting/bpmn-setting/settings/button-setting.vue

@@ -1,144 +1,251 @@
 <template>
-  <div class="panel-default">
-    <div class="panel-body">
-      <div class="buttons ibps-pb-5 ibps-tr">
-        <el-button type="success" size="mini" plain icon="el-icon-circle-plus-outline" @click="editButton()">添加按钮</el-button>
-        <el-button type="primary" size="mini" plain icon="el-icon-refresh-left" @click="initButton">初始化按钮</el-button>
-        <el-button size="mini" plain icon="el-icon-circle-close" type="danger" @click="cleanButton">清空按钮</el-button>
-      </div>
-      <el-table ref="elTable" :data="buttons" border style="width: 100%">
-        <el-table-column align="center" prop="name" label="按钮名称" />
-        <el-table-column align="center" prop="aliasName" label="操作类型" width="180" />
-        <el-table-column align="center" label="管理" width="100">
-          <template slot-scope="scope">
-            <el-button type="text" size="small" @click="editButton(scope.$index)">编辑</el-button>
-            <el-button type="text" size="small" @click="removeButton(scope.$index)">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
+    <div class="panel-default">
+        <div class="panel-body">
+            <div class="buttons ibps-pb-5 ibps-tr">
+                <el-button type="success" size="mini" plain icon="el-icon-circle-plus-outline" @click="editButton()">添加按钮</el-button>
+                <el-button type="primary" size="mini" plain icon="el-icon-refresh-left" @click="initButton">初始化按钮</el-button>
+                <el-button size="mini" plain icon="el-icon-circle-close" type="danger" @click="cleanButton">清空按钮</el-button>
+            </div>
+            <div class="button-table-header">
+                <div class="name">按钮名称</div>
+                <div class="type">操作类型</div>
+                <div class="operate">管理</div>
+            </div>
+            <vue-draggable
+                v-if="buttons && buttons.length"
+                v-model="buttons"
+                v-bind="draggableOptions"
+                class="list-group"
+                @start="isDragging = true"
+                @end="()=>{isDragging= false}"
+            >
+                <!-- 原代码,使用table渲染,不可拖拽排序 -->
+                <!-- <el-table ref="elTable" :data="buttons" border style="width: 100%">
+                    <el-table-column align="center" prop="name" label="按钮名称" />
+                    <el-table-column align="center" prop="aliasName" label="操作类型" width="180" />
+                    <el-table-column align="center" label="管理" width="100">
+                        <template slot-scope="scope">
+                            <el-button type="text" size="small" @click="editButton(scope.$index)">编辑</el-button>
+                            <el-button type="text" size="small" @click="removeButton(scope.$index)">删除</el-button>
+                        </template>
+                    </el-table-column>
+                </el-table> -->
+                <!-- div布局,可拖拽排序 -->
+                <div v-for="(button,i) in buttons" :key="i" class="button-table-item">
+                    <div class="name">
+                        {{ button.name }}
+                    </div>
+                    <div class="type">
+                        {{ button.aliasName }}
+                    </div>
+                    <el-button-group class="operate">
+                        <el-button size="small" type="text" title="编辑" icon="ibps-icon-cog" @click="editButton(i)" />
+                        <el-button size="small" type="text" title="删除" icon="el-icon-delete" @click="removeButton(i)" />
+                        <el-button class="draggable" title="拖动排序" data-role="sort_choice" size="small" type="text" icon="ibps-icon-arrows" />
+                    </el-button-group>
+                </div>
+            </vue-draggable>
+            <div v-else class="no-data">
+                暂无数据
+            </div>
+        </div>
+        <edit-button
+            :visible="dialogFormVisible"
+            :title="title"
+            :data="editData"
+            :button-type-map="buttonTypeMap"
+            :buttons="buttons"
+            @callback="handleData"
+            @close="visible => dialogFormVisible = false"
+        />
     </div>
-    <edit-button
-      :visible="dialogFormVisible"
-      :title="title"
-      :data="editData"
-      :button-type-map="buttonTypeMap"
-      :buttons="buttons"
-      @callback="handleData"
-      @close="visible => dialogFormVisible = false"
-    />
-  </div>
 </template>
 <script>
 import { initButton, getButton } from '@/api/platform/bpmn/bpmDefinition'
 import ActionUtils from '@/utils/action'
 import { defaultsDeep } from 'lodash'
 import EditButton from './../components/edit-button'
+import VueDraggable from 'vuedraggable'
 
 export default {
-  components: {
-    EditButton
-  },
-  props: {
-    data: Array,
-    nodeType: {
-      type: String,
-      default: 'userTask'
-    }
-  },
-  data() {
-    return {
-      defaultValue: {
-        alias: '',
-        aliasName: '',
-        name: '',
-        code: '',
-        afterScript: '',
-        beforeScript: ''
-      },
-      buttonTypeMap: {},
-      editData: {},
-      editIndex: -1,
-      dialogFormVisible: false,
-      title: '添加按钮'
-    }
-  },
-  computed: {
-    buttons() {
-      return this.data
-    }
-  },
-  watch: {
-    nodeType: {
-      handler: function(val, oldVal) {
-        if (val !== oldVal) {
-          this.loadButtonTypes()
-          this.$nextTick(() => {
-            this.$refs.elTable.doLayout()
-          })
+    components: {
+        EditButton,
+        VueDraggable
+    },
+    props: {
+        data: Array,
+        nodeType: {
+            type: String,
+            default: 'userTask'
         }
-      },
-      immediate: true
-    }
-  },
-  beforeDestroy() {
-    this.editData = null
-  },
-  methods: {
-    // 新增、编辑变量
-    editButton(index) {
-      const data = this.$utils.isNotEmpty(index) ? this.buttons[index] : {}
-      this.editData = defaultsDeep(JSON.parse(JSON.stringify(data)), this.defaultValue)
-      this.editIndex = this.$utils.isNotEmpty(index) ? index : -1
-      this.title = this.$utils.isNotEmpty(index) ? '编辑按钮' : '添加按钮'
-      this.dialogFormVisible = true
     },
-    // 删除变量
-    removeButton(index) {
-      this.buttons.splice(index, 1)
+    data () {
+        return {
+            defaultValue: {
+                alias: '',
+                aliasName: '',
+                name: '',
+                code: '',
+                afterScript: '',
+                beforeScript: ''
+            },
+            buttonTypeMap: {},
+            editData: {},
+            editIndex: -1,
+            dialogFormVisible: false,
+            title: '添加按钮',
+            isDragging: false,
+            draggableOptions: {
+                handle: '.draggable',
+                ghostClass: 'sortable-ghost',
+                distance: 1,
+                disabled: false,
+                animation: 200,
+                axis: 'y'
+            }
+        }
     },
-    // 清空变量
-    cleanButton() {
-      this.$confirm('是否清空按钮?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.buttons.splice(0, this.buttons.length)
-      })
+    computed: {
+        // buttons () {
+        //     console.log(this.data)
+        //     return this.data
+        // }
+        buttons: {
+            get (v) {
+                console.log(this.data)
+                return this.data || []
+            },
+            set (value) {
+                this.$emit('update', value)
+            }
+        }
     },
-    /**
-     * 处理数据
-     */
-    handleData(data) {
-      if (this.editIndex > -1) {
-        this.buttons.splice(this.editIndex, 1, data)
-      } else {
-        this.buttons.push(data)
-      }
+    watch: {
+        nodeType: {
+            handler: function (val, oldVal) {
+                if (val !== oldVal) {
+                    this.loadButtonTypes()
+                    // this.$nextTick(() => {
+                    //     this.$refs.elTable.doLayout()
+                    // })
+                }
+            },
+            immediate: true
+        }
     },
-    initButton() {
-      initButton({
-        nodeType: this.nodeType
-      }).then(response => {
-        this.buttons.splice(0, this.buttons.length)
-        const buttons = response.data
-        buttons.forEach(button => {
-          this.buttons.push(button)
-        })
-        ActionUtils.success('初始化按钮成功')
-      })
+    beforeDestroy () {
+        this.editData = null
     },
-    loadButtonTypes() {
-      getButton({
-        nodeType: this.nodeType
-      }).then(response => {
-        const buttonTypeMap = {}
-        response.data.forEach(buttonType => {
-          buttonTypeMap[buttonType.alias] = buttonType
-        })
-        this.buttonTypeMap = buttonTypeMap
-      })
+    methods: {
+        test (v) {
+            this.buttons = v
+        },
+        // 新增、编辑变量
+        editButton (index) {
+            const data = this.$utils.isNotEmpty(index) ? this.buttons[index] : {}
+            this.editData = defaultsDeep(JSON.parse(JSON.stringify(data)), this.defaultValue)
+            this.editIndex = this.$utils.isNotEmpty(index) ? index : -1
+            this.title = this.$utils.isNotEmpty(index) ? '编辑按钮' : '添加按钮'
+            this.dialogFormVisible = true
+        },
+        // 删除变量
+        removeButton (index) {
+            this.buttons.splice(index, 1)
+        },
+        // 清空变量
+        cleanButton () {
+            this.$confirm('是否清空按钮?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.buttons.splice(0, this.buttons.length)
+            })
+        },
+        /**
+         * 处理数据
+         */
+        handleData (data) {
+            console.log(this.editIndex, data)
+            this.editIndex
+            if (this.editIndex > -1) {
+                this.buttons.splice(this.editIndex, 1, data)
+            } else {
+                this.buttons.push(data)
+            }
+        },
+        initButton () {
+            initButton({
+                nodeType: this.nodeType
+            }).then(response => {
+                this.buttons.splice(0, this.buttons.length)
+                const buttons = response.data
+                buttons.forEach(button => {
+                    this.buttons.push(button)
+                })
+                ActionUtils.success('初始化按钮成功')
+            })
+        },
+        loadButtonTypes () {
+            getButton({
+                nodeType: this.nodeType
+            }).then(response => {
+                const buttonTypeMap = {}
+                response.data.forEach(buttonType => {
+                    buttonTypeMap[buttonType.alias] = buttonType
+                })
+                this.buttonTypeMap = buttonTypeMap
+            })
+        }
     }
-  }
 }
 </script>
+<style lang="scss" scoped>
+    .button-table-header, .button-table-item{
+        display: flex;
+        align-items: center;
+        font-size: 12px;
+        border-bottom: 1px solid #ebeef5;
+        height: 40px;
+        > div {
+            padding: 8px 10px;
+            text-align: center;
+        }
+        .name {
+            width: 45%;
+        }
+        .type {
+            width: 35%;
+            border-left: 1px solid #ebeef5;
+            border-right: 1px solid #ebeef5;
+        }
+        .operate {
+            width: 20%;
+        }
+    }
+    .button-table-header {
+        font-weight: bolder;
+        background-color: #84d5cf;
+    }
+    .button-table-item {
+        border-left: 1px solid #ebeef5;
+        border-right: 1px solid #ebeef5;
+        .operate {
+            display: flex;
+            > button {
+                flex: 1;
+            }
+        }
+    }
+    .no-data {
+        width: 510px;
+        height: 60px;
+        text-align: center;
+        line-height: 60px;
+        color: #909399;
+        font-size: 12px;
+        border-style: solid;
+        border-color: #ebeef5;
+        border-width: 0 1px 1px 1px;
+    }
+</style>

+ 128 - 115
src/business/platform/bpmn/setting/bpmn-setting/types/user-task.vue

@@ -1,127 +1,140 @@
 <template>
-  <div>
-    <div v-sticky class="setting-title" @click="onTitle">
-      用户任务设置<template v-if="$utils.isNotEmpty(data.node_name )">--【{{ data.node_name }}】</template>
-    </div>
-    <el-collapse v-model="activeNames">
-      <el-collapse-item title="用户设置" name="userSetting">
-        <user-setting :data="users" />
-      </el-collapse-item>
-      <el-collapse-item title="表单设置" name="fromSetting">
-        <form-setting
-          :data="formData"
-          :attributes="attributes"
-          :bo-data="boData"
-          :def-key="defKey"
-          :node-id="data.id"
-          form-type="node"
-        />
-      </el-collapse-item>
-      <el-collapse-item v-if="nodeType==='signTask'" title="会签规则" name="signRule">
-        <sign-rule :data="signRule" />
-      </el-collapse-item>
-      <el-collapse-item v-if="nodeType==='signTask'" title="会签特权" name="signPrivileges">
-        <sign-privileges :data.sync="signPrivileges" />
-      </el-collapse-item>
-      <el-collapse-item title="事件设置" name="eventScript">
-        <event-script :data="scripts" :node-type="nodeType" :node-id="data.id" />
-      </el-collapse-item>
-      <el-collapse-item title="按钮设置" name="buttonSetting">
-        <button-setting :data="buttons" :node-type="nodeType" />
-      </el-collapse-item>
-      <el-collapse-item title="跳转规则设置" name="jumpRuleSetting">
-        <jump-rule :data="jumpRules" />
-      </el-collapse-item>
-      <el-collapse-item title="催办设置" name="reminder">
-        <reminder-setting :data="reminders" :def-id="defId" :cur-node="data" />
-      </el-collapse-item>
-      <el-collapse-item title="触发流程设置" name="triggerFlow">
-        <trigger-flow :data="trigerFlows" :def-id="defId" :cur-node="data" :bo-data="boData" />
-      </el-collapse-item>
-      <el-collapse-item name="endNotify">
-        <template slot="title">
-          办理抄送设置
-          <el-tooltip class="item" effect="light" content="进行设置节点结束时抄送给某批人!" placement="bottom">
-            <i class="header-icon el-icon-info" />
-          </el-tooltip>
-        </template>
-        <notify-setting :data="procNotify" type="userTask" />
-      </el-collapse-item>
+    <div>
+        <div v-sticky class="setting-title" @click="onTitle">
+            用户任务设置<template v-if="$utils.isNotEmpty(data.node_name )">--【{{ data.node_name }}】</template>
+        </div>
+        <el-collapse v-model="activeNames">
+            <el-collapse-item title="用户设置" name="userSetting">
+                <user-setting :data="users" />
+            </el-collapse-item>
+            <el-collapse-item title="表单设置" name="fromSetting">
+                <form-setting
+                    :data="formData"
+                    :attributes="attributes"
+                    :bo-data="boData"
+                    :def-key="defKey"
+                    :node-id="data.id"
+                    form-type="node"
+                />
+            </el-collapse-item>
+            <el-collapse-item v-if="nodeType==='signTask'" title="会签规则" name="signRule">
+                <sign-rule :data="signRule" />
+            </el-collapse-item>
+            <el-collapse-item v-if="nodeType==='signTask'" title="会签特权" name="signPrivileges">
+                <sign-privileges :data.sync="signPrivileges" />
+            </el-collapse-item>
+            <el-collapse-item title="事件设置" name="eventScript">
+                <event-script :data="scripts" :node-type="nodeType" :node-id="data.id" />
+            </el-collapse-item>
+            <el-collapse-item title="按钮设置" name="buttonSetting">
+                <button-setting :data="buttons" :node-type="nodeType" @update="updateButton" />
+            </el-collapse-item>
+            <el-collapse-item title="跳转规则设置" name="jumpRuleSetting">
+                <jump-rule :data="jumpRules" />
+            </el-collapse-item>
+            <el-collapse-item title="催办设置" name="reminder">
+                <reminder-setting :data="reminders" :def-id="defId" :cur-node="data" />
+            </el-collapse-item>
+            <el-collapse-item title="触发流程设置" name="triggerFlow">
+                <trigger-flow :data="trigerFlows" :def-id="defId" :cur-node="data" :bo-data="boData" />
+            </el-collapse-item>
+            <el-collapse-item name="endNotify">
+                <template slot="title">
+                    办理抄送设置
+                    <el-tooltip class="item" effect="light" content="进行设置节点结束时抄送给某批人!" placement="bottom">
+                        <i class="header-icon el-icon-info" />
+                    </el-tooltip>
+                </template>
+                <notify-setting :data="procNotify" type="userTask" />
+            </el-collapse-item>
 
-      <el-collapse-item title="其他设置" name="otherOttribute">
-        <other-attribute-node :data="attributes" :cur-node="data" />
-      </el-collapse-item>
-    </el-collapse>
-  </div>
+            <el-collapse-item title="其他设置" name="otherOttribute">
+                <other-attribute-node :data="attributes" :cur-node="data" />
+            </el-collapse-item>
+        </el-collapse>
+    </div>
 </template>
 <script>
 import mixins from '../mixins/type'
 export default {
-  mixins: [mixins],
-  props: {
-    data: Object,
-    defId: String,
-    defKey: String,
-    boData: Object
-  },
-  data() {
-    return {
-      activeNames: ['userSetting', 'fromSetting', 'signRule', 'signPrivileges', 'eventScript', 'buttonSetting', 'jumpRuleSetting', 'reminder', 'triggerFlow', 'endNotify', 'otherOttribute']
-    }
-  },
-  computed: {
-    nodeType() {
-      return this.data ? this.data.node_type || 'userTask' : 'userTask'
-    },
-    // 用户人员
-    users() {
-      return this.data ? this.data.users || [] : []
-    },
-    // 表单
-    formData() {
-      return this.data ? this.data.form || {} : {}
-    },
-    // 会签设置
-    signRule() {
-      return this.data ? this.data.signRule || {} : {}
-    },
-    // 会签特权
-    signPrivileges: {
-      get() {
-        return this.data ? this.data.privileges || {} : {}
-      },
-      set(value) {
-        this.data.privileges = value || {}
-      }
-    },
-    // 脚本
-    scripts() {
-      return this.data ? this.data.scripts || {} : {}
-    },
-    // 按钮
-    buttons() {
-      return this.data ? this.data.buttons || [] : []
-    },
-    // 跳转规则
-    jumpRules() {
-      return this.data ? this.data.jumpRules || [] : []
-    },
-    // 催办
-    reminders() {
-      return this.data ? this.data.reminders || [] : []
+    mixins: [mixins],
+    props: {
+        data: Object,
+        defId: String,
+        defKey: String,
+        boData: Object
     },
-    // 触发流程
-    trigerFlows() {
-      return this.data ? this.data.trigerFlows || [] : []
+    data () {
+        return {
+            activeNames: ['userSetting', 'fromSetting', 'signRule', 'signPrivileges', 'eventScript', 'buttonSetting', 'jumpRuleSetting', 'reminder', 'triggerFlow', 'endNotify', 'otherOttribute']
+        }
     },
-    // 抄送
-    procNotify() {
-      return this.data ? this.data.procNotify || [] : []
+    computed: {
+        nodeType () {
+            return this.data ? this.data.node_type || 'userTask' : 'userTask'
+        },
+        // 用户人员
+        users () {
+            return this.data ? this.data.users || [] : []
+        },
+        // 表单
+        formData () {
+            return this.data ? this.data.form || {} : {}
+        },
+        // 会签设置
+        signRule () {
+            return this.data ? this.data.signRule || {} : {}
+        },
+        // 会签特权
+        signPrivileges: {
+            get () {
+                return this.data ? this.data.privileges || {} : {}
+            },
+            set (value) {
+                this.data.privileges = value || {}
+            }
+        },
+        // 脚本
+        scripts () {
+            return this.data ? this.data.scripts || {} : {}
+        },
+        // 按钮
+        // buttons () {
+        //     return this.data ? this.data.buttons || [] : []
+        // },
+        buttons: {
+            get () {
+                return this.data ? this.data.buttons || [] : []
+            },
+            set (value) {
+                this.data.buttons = value
+            }
+        },
+        // 跳转规则
+        jumpRules () {
+            return this.data ? this.data.jumpRules || [] : []
+        },
+        // 催办
+        reminders () {
+            return this.data ? this.data.reminders || [] : []
+        },
+        // 触发流程
+        trigerFlows () {
+            return this.data ? this.data.trigerFlows || [] : []
+        },
+        // 抄送
+        procNotify () {
+            return this.data ? this.data.procNotify || [] : []
+        },
+        // 其它设置
+        attributes () {
+            return this.data ? this.data.attributes || {} : {}
+        }
     },
-    // 其它设置
-    attributes() {
-      return this.data ? this.data.attributes || {} : {}
+    methods: {
+        updateButton (newValue) {
+            this.buttons = newValue
+        }
     }
-  }
 }
 </script>

+ 319 - 321
src/business/platform/data/templatebuilder/right-aside/components/button.vue

@@ -1,113 +1,113 @@
 <template>
-  <div class="panel panel-default">
-    <div class="panel-heading">
-      <span>{{ title }}</span>
-      <div class="ibps-fr ibps-pr-10">
-        <el-dropdown :hide-on-click="false" trigger="click" @command="addButton">
-          <el-tooltip :content="'添加按钮'" placement="top">
-            <span class="el-dropdown-link">
-              <i class="el-icon-circle-plus el-icon--right" />
-            </span>
-          </el-tooltip>
-          <el-dropdown-menu slot="dropdown">
-            <el-scrollbar
-              tag="div"
-              wrap-class="el-select-dropdown__wrap"
-              view-class="el-select-dropdown__list"
-            >
-              <el-dropdown-item
-                v-for="(button,index) in functionButtons"
-                :key="button[buttonKey]+index"
-                :disabled="isDisabled(button[buttonKey])"
-                :command="button"
-              >
-                {{ button.label }}
-              </el-dropdown-item>
-            </el-scrollbar>
-          </el-dropdown-menu>
-        </el-dropdown>
-        <el-divider direction="vertical" />
-        <!-- 快捷权限设置-->
-        <el-dropdown trigger="click" @command="settingRights">
-          <el-tooltip content="快捷权限设置" placement="top">
-            <span class="el-dropdown-link">
-              <i class="ibps-icon ibps-icon-shield" />
-            </span>
-          </el-tooltip>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item
-              v-for="(rightsType,index) in rightsTypes"
-              :key="rightsType.value+index"
-              :command="rightsType.value"
+    <div class="panel panel-default">
+        <div class="panel-heading">
+            <span>{{ title }}</span>
+            <div class="ibps-fr ibps-pr-10">
+                <el-dropdown :hide-on-click="false" trigger="click" @command="addButton">
+                    <el-tooltip :content="'添加按钮'" placement="top">
+                        <span class="el-dropdown-link">
+                            <i class="el-icon-circle-plus el-icon--right" />
+                        </span>
+                    </el-tooltip>
+                    <el-dropdown-menu slot="dropdown">
+                        <el-scrollbar
+                            tag="div"
+                            wrap-class="el-select-dropdown__wrap"
+                            view-class="el-select-dropdown__list"
+                        >
+                            <el-dropdown-item
+                                v-for="(button,index) in functionButtons"
+                                :key="button[buttonKey]+index"
+                                :disabled="isDisabled(button[buttonKey])"
+                                :command="button"
+                            >
+                                {{ button.label }}
+                            </el-dropdown-item>
+                        </el-scrollbar>
+                    </el-dropdown-menu>
+                </el-dropdown>
+                <el-divider direction="vertical" />
+                <!-- 快捷权限设置-->
+                <el-dropdown trigger="click" @command="settingRights">
+                    <el-tooltip content="快捷权限设置" placement="top">
+                        <span class="el-dropdown-link">
+                            <i class="ibps-icon ibps-icon-shield" />
+                        </span>
+                    </el-tooltip>
+                    <el-dropdown-menu slot="dropdown">
+                        <el-dropdown-item
+                            v-for="(rightsType,index) in rightsTypes"
+                            :key="rightsType.value+index"
+                            :command="rightsType.value"
+                        >
+                            {{ rightsType.label }}
+                        </el-dropdown-item>
+                    </el-dropdown-menu>
+                </el-dropdown>
+            </div>
+        </div>
+        <div class="panel-body">
+            <vue-draggable
+                v-if="buttons && buttons.length >0"
+                v-model="buttons"
+                v-bind="draggableOptions"
+                class="list-group"
+                @start="isDragging = true"
+                @end="()=>{isDragging= false}"
             >
-              {{ rightsType.label }}
-            </el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-      </div>
-    </div>
-    <div class="panel-body">
-      <vue-draggable
-        v-if="buttons && buttons.length >0"
-        v-model="buttons"
-        v-bind="draggableOptions"
-        class="list-group"
-        @start="isDragging = true"
-        @end="()=>{isDragging= false}"
-      >
-        <div v-for="(button,i) in buttons" :key="button[buttonKey]+i" class="list-group-item">
-          <div class="actions-left">
-            {{ button.label }}
-          </div>
-          <el-button-group class="actions">
-            <el-button size="small" type="text" title="设置" icon="ibps-icon-cog" @click="settingButton(i)" />
-            <el-button size="small" type="text" title="删除" icon="el-icon-delete" @click="removeButton(i)" />
-            <el-button class="draggable" title="拖动排序" data-role="sort_choice" size="small" type="text" icon="ibps-icon-arrows" />
-          </el-button-group>
+                <div v-for="(button,i) in buttons" :key="button[buttonKey]+i" class="list-group-item">
+                    <div class="actions-left">
+                        {{ button.label }}
+                    </div>
+                    <el-button-group class="actions">
+                        <el-button size="small" type="text" title="设置" icon="ibps-icon-cog" @click="settingButton(i)" />
+                        <el-button size="small" type="text" title="删除" icon="el-icon-delete" @click="removeButton(i)" />
+                        <el-button class="draggable" title="拖动排序" data-role="sort_choice" size="small" type="text" icon="ibps-icon-arrows" />
+                    </el-button-group>
+                </div>
+            </vue-draggable>
+            <div v-else>
+                <el-alert
+                    :closable="false"
+                    :title="'未设置'+title"
+                    type="info"
+                    center
+                />
+            </div>
         </div>
-      </vue-draggable>
-      <div v-else>
-        <el-alert
-          :closable="false"
-          :title="'未设置'+title"
-          type="info"
-          center
+        <el-dialog
+            ref="editFormDialog"
+            :visible.sync="dialogVisible"
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
+            :title="title"
+            class="edit-dialog"
+            top="5vh"
+            width="60%"
+            append-to-body
+            @close="closeDialog"
+        >
+            <slot v-if="dialogVisible" :data.sync="editData" name="edit" />
+            <div slot="footer" class="el-dialog--center">
+                <ibps-toolbar
+                    :actions="toolbars"
+                    @action-event="handleActionEvent"
+                />
+            </div>
+        </el-dialog>
+        <rights-config
+            :visible="dialogRightsVisible"
+            title="权限配置"
+            @callback="handleRightsConfirm"
+            @close="visible => dialogRightsVisible = visible"
         />
-      </div>
-    </div>
-    <el-dialog
-      ref="editFormDialog"
-      :visible.sync="dialogVisible"
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-      :title="title"
-      class="edit-dialog"
-      top="5vh"
-      width="60%"
-      append-to-body
-      @close="closeDialog"
-    >
-      <slot v-if="dialogVisible" :data.sync="editData" name="edit" />
-      <div slot="footer" class="el-dialog--center">
-        <ibps-toolbar
-          :actions="toolbars"
-          @action-event="handleActionEvent"
+        <export-column
+            :visible="exportFieldDialogVisible"
+            :data="data"
+            @callback="handleExportColumn"
+            @close="(visible)=>exportFieldDialogVisible=visible"
         />
-      </div>
-    </el-dialog>
-    <rights-config
-      :visible="dialogRightsVisible"
-      title="权限配置"
-      @callback="handleRightsConfirm"
-      @close="visible => dialogRightsVisible = visible"
-    />
-    <export-column
-      :visible="exportFieldDialogVisible"
-      :data="data"
-      @callback="handleExportColumn"
-      @close="(visible)=>exportFieldDialogVisible=visible"
-    />
-  </div>
+    </div>
 </template>
 <script>
 import ActionUtils from '@/utils/action'
@@ -119,235 +119,233 @@ import ButtonsConstants from '@/business/platform/data/constants/buttons'
 import ExportColumn from './export-column'
 
 export default {
-  components: {
-    VueDraggable,
-    RightsConfig,
-    ExportColumn
-  },
-  props: {
-    title: {
-      type: String
-    },
-    prop: {
-      type: String
-    },
-    data: {
-      type: Object
-    },
-    callModule: {
-      type: String
-    },
-    template: { // 模版
-      type: Object,
-      default: () => {}
+    components: {
+        VueDraggable,
+        RightsConfig,
+        ExportColumn
     },
-    types: {
-      type: Array
+    props: {
+        title: {
+            type: String
+        },
+        prop: {
+            type: String
+        },
+        data: {
+            type: Object
+        },
+        callModule: {
+            type: String
+        },
+        template: { // 模版
+            type: Object,
+            default: () => {}
+        },
+        types: {
+            type: Array
+        },
+        defaultValue: { // 默认值
+            type: Object,
+            default: () => {
+                return {
+                    rights: [{ type: 'all' }]
+                }
+            }
+        }
     },
-    defaultValue: { // 默认值
-      type: Object,
-      default: () => {
+    data () {
         return {
-          rights: [{ type: 'all' }]
+            isDragging: false,
+            exportFieldDialogVisible: false,
+            draggableOptions: {
+                handle: '.draggable',
+                ghostClass: 'sortable-ghost',
+                distance: 1,
+                disabled: false,
+                animation: 200,
+                axis: 'y'
+            },
+            rightsTypes: rightsTypes,
+            buttonKey: 'button_type',
+            dialogVisible: false,
+            editData: {},
+            editIndex: -1,
+            dialogRightsVisible: false,
+            toolbars: [
+                { key: 'confirm' },
+                { key: 'cancel' }
+            ]
         }
-      }
-    }
-  },
-  data() {
-    return {
-      isDragging: false,
-      exportFieldDialogVisible: false,
-      draggableOptions: {
-        handle: '.draggable',
-        ghostClass: 'sortable-ghost',
-        distance: 1,
-        disabled: false,
-        animation: 200,
-        axis: 'y'
-      },
-      rightsTypes: rightsTypes,
-      buttonKey: 'button_type',
-      dialogVisible: false,
-      editData: {},
-      editIndex: -1,
-      dialogRightsVisible: false,
-      toolbars: [
-        { key: 'confirm' },
-        { key: 'cancel' }
-      ]
-    }
-  },
-  computed: {
-    buttons: {
-      get() {
-        return this.template[this.prop] || []
-      },
-      set(value) {
-        this.handleInput(value)
-      }
     },
-    functionButtons() {
-      const buttons = []
-      this.types.forEach(type => {
-        const button = ButtonsConstants[type]
-        if (!button) {
-          console.error('Undefined type:' + type)
-          return false
+    computed: {
+        buttons: {
+            get () {
+                return this.template[this.prop] || []
+            },
+            set (value) {
+                this.handleInput(value)
+            }
+        },
+        functionButtons () {
+            const buttons = []
+            this.types.forEach(type => {
+                const button = ButtonsConstants[type]
+                if (!button) {
+                    console.error('Undefined type:' + type)
+                    return false
+                }
+                button[this.buttonKey] = type
+                buttons.push(button)
+            })
+            return buttons
         }
-        button[this.buttonKey] = type
-        buttons.push(button)
-      })
-      return buttons
-    }
-  },
-  methods: {
-    handleActionEvent({ key }) {
-      switch (key) {
-        case 'confirm':
-          this.handleConfirm()
-          break
-        case 'cancel':
-          this.closeDialog()
-          break
-        default:
-          break
-      }
-    },
-    // 添加按钮
-    addButton(button) {
-      if (button.button_type === 'export') {
-        this.exportFieldDialogVisible = true
-      }
-      const buttons = this.buttons
-      buttons.push({
-        label: button.label,
-        [this.buttonKey]: button[this.buttonKey]
-      })
-      this.handleInput(buttons)
-    },
-    // 设置按钮
-    settingButton(i) {
-      this.editData = defaultsDeep(JSON.parse(JSON.stringify(this.buttons[i])), this.defaultValue)
-      this.editIndex = i
-      this.dialogVisible = true
-    },
-    // 删除按钮
-    removeButton(i) {
-      this.buttons.splice(i, 1)
-      this.handleInput(this.buttons)
-    },
-    settingRights(type) {
-      if (this.buttons.length === 0) { return }
-      if (type === 'none' || type === 'all') {
-        const data = [{ type: type }]
-        this.setRightsData(data)
-      } else {
-        this.dialogRightsVisible = true
-      }
     },
-    handleRightsConfirm(data) {
-      if (data.length === 0) {
-        data = [{ type: 'none' }]
-      }
-      this.setRightsData(data)
-    },
-    setRightsData(data) {
-      const buttons = this.buttons.map((button) => {
-        button.rights = data
-        return button
-      })
-      this.handleInput(buttons)
-      ActionUtils.success('设置权限成功')
-    },
-    // 是否禁用
-    isDisabled(key) {
-      if (key === 'custom' || key === 'sefStartFlow' || !this.buttons) {
-        return
-      }
-      return !!this.buttons.find((button) => {
-        return button[this.buttonKey] === key
-      })
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      this.dialogVisible = false
-    },
-    handleConfirm() {
-      const componentInstance = this.callModule === 'list' || this.callModule === 'dialog' || this.callModule === 'tree-edit' ? this.$refs.editFormDialog.$slots.default[0].componentInstance : this.$refs.editFormDialog.$slots.default[0].children[0].componentInstance
-      componentInstance.getFormData((data) => {
-        if (!data) {
-          ActionUtils.saveErrorMessage()
-          return
+    methods: {
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'confirm':
+                    this.handleConfirm()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        // 添加按钮
+        addButton (button) {
+            if (button.button_type === 'export') {
+                this.exportFieldDialogVisible = true
+            }
+            const buttons = this.buttons
+            buttons.push({
+                label: button.label,
+                [this.buttonKey]: button[this.buttonKey]
+            })
+            this.handleInput(buttons)
+        },
+        // 设置按钮
+        settingButton (i) {
+            this.editData = defaultsDeep(JSON.parse(JSON.stringify(this.buttons[i])), this.defaultValue)
+            this.editIndex = i
+            this.dialogVisible = true
+        },
+        // 删除按钮
+        removeButton (i) {
+            this.buttons.splice(i, 1)
+            this.handleInput(this.buttons)
+        },
+        settingRights (type) {
+            if (this.buttons.length === 0) { return }
+            if (type === 'none' || type === 'all') {
+                const data = [{ type: type }]
+                this.setRightsData(data)
+            } else {
+                this.dialogRightsVisible = true
+            }
+        },
+        handleRightsConfirm (data) {
+            if (data.length === 0) {
+                data = [{ type: 'none' }]
+            }
+            this.setRightsData(data)
+        },
+        setRightsData (data) {
+            const buttons = this.buttons.map((button) => {
+                button.rights = data
+                return button
+            })
+            this.handleInput(buttons)
+            ActionUtils.success('设置权限成功')
+        },
+        // 是否禁用
+        isDisabled (key) {
+            if (key === 'custom' || key === 'sefStartFlow' || !this.buttons) {
+                return
+            }
+            return !!this.buttons.find((button) => {
+                return button[this.buttonKey] === key
+            })
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.dialogVisible = false
+        },
+        handleConfirm () {
+            const componentInstance = this.callModule === 'list' || this.callModule === 'dialog' || this.callModule === 'tree-edit' ? this.$refs.editFormDialog.$slots.default[0].componentInstance : this.$refs.editFormDialog.$slots.default[0].children[0].componentInstance
+            componentInstance.getFormData((data) => {
+                if (!data) {
+                    ActionUtils.saveErrorMessage()
+                    return
+                }
+                this.buttons.splice(this.editIndex, 1, data)
+                this.handleInput(this.buttons)
+                this.closeDialog()
+            })
+        },
+        handleInput (value) {
+            this.$emit('input', this.prop, value)
+        },
+        handleExportColumn (data) {
+            this.$emit('callbackField', 'export_columns', data)
         }
-        this.buttons.splice(this.editIndex, 1, data)
-        this.handleInput(this.buttons)
-        this.closeDialog()
-      })
-    },
-    handleInput(value) {
-      this.$emit('input', this.prop, value)
-    },
-    handleExportColumn(data) {
-      this.$emit('callbackField', 'export_columns', data)
     }
-  }
 }
 </script>
-
 <style lang="scss" scoped>
-  .list-group {
-    display: flex;
-    flex-direction: column;
-    padding-left: 0;
-    margin-bottom: 0;
-  .list-group-item {
-    position: relative;
-    display: block;
-    padding: 5px;
-    margin: 5px;
-    border: 1px solid #ddd;
-    .actions-left{
-      height: 24px;
-      line-height: 24px;
-      margin-left: 5px;
-    }
+    .list-group {
+        display: flex;
+        flex-direction: column;
+        padding-left: 0;
+        margin-bottom: 0;
+        .list-group-item {
+            position: relative;
+            display: block;
+            padding: 5px;
+            margin: 5px;
+            border: 1px solid #ddd;
+            .actions-left{
+                height: 24px;
+                line-height: 24px;
+                margin-left: 5px;
+            }
 
-    .actions {
-      position: absolute;
-      width: 60px;
-      top: 2px;
-      right: 0;
-      line-height: 20px;
-      padding-left: 1px;
-      .el-button {
-        padding-right: 4px;
-        // margin-right: 2px;
-      }
-      [data-role="sort_choice"]{
-          cursor: move
-      }
-    }
-  }
+            .actions {
+                position: absolute;
+                width: 60px;
+                top: 2px;
+                right: 0;
+                line-height: 20px;
+                padding-left: 1px;
+                .el-button {
+                    padding-right: 4px;
+                    // margin-right: 2px;
+                }
+                [data-role="sort_choice"]{
+                    cursor: move
+                }
+            }
+        }
 
-  .flip-list-move {
-    transition: transform 0.5s;
-  }
-  .no-move {
-    transition: transform 0s;
-  }
-  .sortable-ghost {
-    opacity: 0.5;
-    background: #c8ebfb;
-  }
-}
-  .more-actions {
-    text-align: right;
-    margin-top: 5px;
-    margin-right:10px;
-    .el-button {
-      padding-right: 0;
-      margin-right: 0;
+        .flip-list-move {
+            transition: transform 0.5s;
+        }
+        .no-move {
+            transition: transform 0s;
+        }
+        .sortable-ghost {
+            opacity: 0.5;
+            background: #c8ebfb;
+        }
+    }
+    .more-actions {
+        text-align: right;
+        margin-top: 5px;
+        margin-right:10px;
+        .el-button {
+            padding-right: 0;
+            margin-right: 0;
+        }
     }
-  }
-
 </style>

+ 399 - 399
src/business/platform/org/employee/mixins/panelTree.js

@@ -6,410 +6,410 @@ import { getTreeData as getGroupTreeData } from '@/api/platform/org/group'
 import TreeUtils from '@/utils/tree'
 import { findAllSubsystem } from '@/api/platform/auth/subsystem'
 export default {
-  methods: {
-    checkTreeId(treeData) {
-      const arr = []
-      const filter = function(datas) {
-        datas.find(item => {
-          if (item.children && item.children !== []) {
-            item.children.forEach(i => {
-              arr.push(i.id)
+    methods: {
+        checkTreeId (treeData) {
+            const arr = []
+            const filter = function (datas) {
+                datas.find(item => {
+                    if (item.children && item.children !== []) {
+                        item.children.forEach(i => {
+                            arr.push(i.id)
+                        })
+                        filter(item.children)
+                    }
+                })
+                return arr
+            }
+            filter(treeData)
+            this.treeIds = arr
+            this.loadListData()
+        },
+        loadTreeData (init = false, resetParams = false) {
+            if (!this.showTree) return
+            this.hiddenTree = false
+            this.loadingTree = true
+            this.partyId = ''
+            this.treeData = []
+            if (this.partyType === 'org') {
+                this.lazyTree = true
+                this.defaultExpandedKeys = ['0']
+                this.defaultExpandAll = false
+                this.loadOrgTreeData(init, resetParams)
+            } else if (this.partyType === 'position') {
+                this.lazyTree = true
+                this.defaultExpandedKeys = ['0']
+                this.defaultExpandAll = false
+                this.loadPositionTreeData(init, resetParams)
+            } else {
+                this.lazyTree = false
+                this.defaultExpandedKeys = null
+                this.defaultExpandAll = true
+                if (this.partyType === 'role') {
+                    this.loadRoleTreeData()
+                } else if (this.partyType === 'group') {
+                    this.loadGroupTreeData()
+                }
+            }
+            this.loadListData()
+        },
+        toTree (data) {
+            return TreeUtils.transformToTreeFormat(data, {
+                idKey: 'id',
+                pIdKey: 'parentId',
+                childrenKey: 'children'
             })
-            filter(item.children)
-          }
-        })
-        return arr
-      }
-      filter(treeData)
-      this.treeIds = arr
-      this.loadListData()
-    },
-    loadTreeData(init = false, resetParams = false) {
-      if (!this.showTree) return
-      this.hiddenTree = false
-      this.loadingTree = true
-      this.partyId = ''
-      this.treeData = []
-      if (this.partyType === 'org') {
-        this.lazyTree = true
-        this.defaultExpandedKeys = ['0']
-        this.defaultExpandAll = false
-        this.loadOrgTreeData(init, resetParams)
-      } else if (this.partyType === 'position') {
-        this.lazyTree = true
-        this.defaultExpandedKeys = ['0']
-        this.defaultExpandAll = false
-        this.loadPositionTreeData(init, resetParams)
-      } else {
-        this.lazyTree = false
-        this.defaultExpandedKeys = null
-        this.defaultExpandAll = true
-        if (this.partyType === 'role') {
-          this.loadRoleTreeData()
-        } else if (this.partyType === 'group') {
-          this.loadGroupTreeData()
-        }
-      }
-      this.loadListData()
-    },
-    toTree(data) {
-      return TreeUtils.transformToTreeFormat(data, {
-        idKey: 'id',
-        pIdKey: 'parentId',
-        childrenKey: 'children'
-      })
-    },
-    // 根据渲染的数据范围类型,筛选目标节点
-    filterPositionTreeChildren(treeData, treeScope, nodeId) {
-      const data = []
-      // 返回设置的范围节点
-      if (treeScope === 'root') {
-        const currentOrgIds = this.currentOrgId.split(',')
-        treeData.forEach(f => {
-          if (currentOrgIds.includes(f.id)) {
-            f.leaf = true
-            data.push(f)
-          }
-        })
-      }
-      return data
-    },
-    setTree(lazy, data) {
-      const ref = this.$refs.elTree
-      ref.store.lazy = lazy
-      ref.store.defaultExpandAll = !lazy
-      ref.store.defaultExpandedKeys = lazy ? ['0'] : null
-      ref.store.setData(data)
-      if (lazy && !this.isUseScope && (this.partyType !== 'org' || (this.partyType === 'org' && this.partyTypeId !== '3'))) {
-        // 普通模式懒加载函数调用
-        ref.store.load = this.loadOrgTreeNode
-      } else if (lazy && this.isUseScope) {
-        if (this.partyType === 'org') {
-          ref.store.load = this.partyTypeId === '3' ? this.loadOrgTreeNode3 : this.loadOrgTreeNode
-        } else if (this.partyType === 'position') {
-          ref.store.load = this.partyTypeId === '3' ? this.loadPosTreeNode3 : this.loadPosTreeNode
-        }
-      }
-    },
-    handleTreeAction(command, position, selection, data) {
-      if (position === 'toolbar' && command.key === 'refresh') {
-        this.loadTreeData()
-      }
-      if (command.key === 'expand') {
-        this.expandCompressTree(true)
-      } else if (command.key === 'compress') {
-        this.expandCompressTree(false)
-      }
-    },
-    expandCompressTree(expanded) {
-      for (let i = 0; i < this.$refs.elTree.store._getAllNodes().length; i++) {
-        this.$refs.elTree.store._getAllNodes()[i].expanded = expanded
-      }
-    },
-    // 点击节点
-    handleNodeClick(data) {
-      const ids = []
-      this.getChildrenIds(data, ids)
-      if (data.id === '0') return
-      this.partyId = data.id
-      this.loadListData()
-    },
+        },
+        // 根据渲染的数据范围类型,筛选目标节点
+        filterPositionTreeChildren (treeData, treeScope, nodeId) {
+            const data = []
+            // 返回设置的范围节点
+            if (treeScope === 'root') {
+                const currentOrgIds = this.currentOrgId.split(',')
+                treeData.forEach(f => {
+                    if (currentOrgIds.includes(f.id)) {
+                        f.leaf = true
+                        data.push(f)
+                    }
+                })
+            }
+            return data
+        },
+        setTree (lazy, data) {
+            const ref = this.$refs.elTree
+            ref.store.lazy = lazy
+            ref.store.defaultExpandAll = !lazy
+            ref.store.defaultExpandedKeys = lazy ? ['0'] : null
+            ref.store.setData(data)
+            if (lazy && !this.isUseScope && (this.partyType !== 'org' || (this.partyType === 'org' && this.partyTypeId !== '3'))) {
+                // 普通模式懒加载函数调用
+                ref.store.load = this.loadOrgTreeNode
+            } else if (lazy && this.isUseScope) {
+                if (this.partyType === 'org') {
+                    ref.store.load = this.partyTypeId === '3' ? this.loadOrgTreeNode3 : this.loadOrgTreeNode
+                } else if (this.partyType === 'position') {
+                    ref.store.load = this.partyTypeId === '3' ? this.loadPosTreeNode3 : this.loadPosTreeNode
+                }
+            }
+        },
+        handleTreeAction (command, position, selection, data) {
+            if (position === 'toolbar' && command.key === 'refresh') {
+                this.loadTreeData()
+            }
+            if (command.key === 'expand') {
+                this.expandCompressTree(true)
+            } else if (command.key === 'compress') {
+                this.expandCompressTree(false)
+            }
+        },
+        expandCompressTree (expanded) {
+            for (let i = 0; i < this.$refs.elTree.store._getAllNodes().length; i++) {
+                this.$refs.elTree.store._getAllNodes()[i].expanded = expanded
+            }
+        },
+        // 点击节点
+        handleNodeClick (data) {
+            const ids = []
+            this.getChildrenIds(data, ids)
+            if (data.id === '0') return
+            this.partyId = data.id
+            this.loadListData()
+        },
 
-    // 加载机构树
-    loadOrgTreeData(init, resetParams = false) {
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      this.loadingTree = true
-      this.hiddenTree = true
-      if (type === 'script') {
-        this.getScriptData(this.scriptValue)
-        this.loadingTree = false
-        return
-      }
-      const params = {}
-      params.type = type
-      if (resetParams && this.isUseScope) {
-        params.partyId = this.currentOrgIdValue
-        params.includeSub = false
-      }
-      getOrgTreeData(params).then(response => {
-        this.loadingTree = false
-        this.hiddenTree = false
-        // 普通模式
-        if (!this.isUseScope) {
-          if (!init) {
-            const data = response.data
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(true, this.treeData)
-          }
-          this.treeDatas = response.data
-        } else {
-        // 选择器范围模式
-          if (resetParams) {
-            const data = response.data
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(true, this.treeData)
-          } else {
-            if (!init) {
-              const data = response.data
-              this.treeData = TreeUtils.transformToTreeFormat(data)
-              this.setTree(true, this.treeData)
+        // 加载机构树
+        loadOrgTreeData (init, resetParams = false) {
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            this.loadingTree = true
+            this.hiddenTree = true
+            if (type === 'script') {
+                this.getScriptData(this.scriptValue)
+                this.loadingTree = false
+                return
             }
-            this.treeDatas = response.data
-          }
-        }
-      }).catch(() => {
-        this.loadingTree = false
-      })
-    },
-    // 机构数节点函数【懒加载】
-    loadOrgTreeNode(node, resolve) {
-      this.loadingTree = true
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      const check = this.$utils.isNotEmpty(this.currentOrgIdValue) && node.data.id === '0' && !this.$store.getters.isSuper
-      const params = {}
-      params.type = type
-      if (type === 'script') {
-        if (this.$utils.isEmpty(node.data) || node.data.id === '0') {
-          this.getScriptData(this.scriptValue, true)
-          this.loadingTree = false
-          return
-        } else {
-          params.type = '2'
-        }
-      }
-      params.orgId = node.level === 0 ? null : check ? this.currentOrgIdValue : node.data.id
-      if (type === '5') {
-        params.includeSub = true
-      }
-      getOrgTreeData(params).then(res => {
-        this.loadingTree = false
-        let arr = JSON.parse(JSON.stringify(res.data))
-        //筛选客户 不要了
-        if(arr[0].id != '0' && this.orgAddIndex == 'qita'){
-            arr = arr.filter(item => item.id !== '1041786072788369408')
-        }
-        let treeData
-        if (this.$utils.isNotEmpty(this.isSuperInitTree)) {
-          if (!this.isSuperInitTree.initNode && node.level !== 0) {
-            const nodeData = this.filterTreeChildren(this.toTree(arr), 'node', node.data.id)
-            resolve(this.toTree(nodeData))
-          } else {
-            resolve(this.toTree(arr))
-          }
-        } else if (this.isUseScope && (this.$utils.isEmpty(node.data) || node.data.id === '0')) {
-          // 初始化和查询全部时得数据加载
-          if (this.$utils.isEmpty(node.data) || type === '1') {
-            treeData = arr
-            resolve(this.toTree(treeData))
-          } else {
-            // 类型2,3得初始化数据节点筛选
-            treeData = this.filterTreeChildren(arr, 'root')
-            resolve(this.toTree(treeData))
-          }
-        } else if (this.isUseScope && (this.$utils.isArray(node.data) && node.data[0].id === '0')) {
-          // 节点数据为数组时得初始化处理
-          treeData = arr
-          resolve(this.toTree(treeData))
-        } else if (this.isUseScope && type === '1' && node.data.id !== '0') {
-          resolve(this.toTree(arr))
-        }
-        if (!this.isUseScope && this.$utils.isEmpty(this.isSuperInitTree)) {
-          resolve(this.toTree(arr))
-        }
-      }).catch(res => {
-        this.loadingTree = false
-        resolve([])
-      })
-    },
-    // 加载岗位树
-    loadPositionTreeData(init, resetParams = false) {
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      this.loadingTree = true
-      this.hiddenTree = true
-      if (type === 'script') {
-        this.getScriptData(this.scriptValue)
-        this.loadingTree = false
-        return
-      }
-      const params = {}
-      params.type = type
-      if (resetParams && this.isUseScope) {
-        params.partyId = this.currentOrgIdValue
-        params.includeSub = false
-      }
-      getPositionTreeData(params).then(response => {
-        this.loadingTree = false
-        this.hiddenTree = false
-        // 普通模式
-        if (!this.isUseScope) {
-          if (!init) {
-            const data = response.data
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(true, this.treeData)
-          }
-          this.treeDatas = response.data
-        } else {
-        // 选择器范围模式
-          if (resetParams) {
-            const data = response.data
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(true, this.treeData)
-          } else {
-            if (!init) {
-              const data = response.data
-              this.treeData = TreeUtils.transformToTreeFormat(data)
-              this.setTree(true, this.treeData)
+            const params = {}
+            params.type = type
+            if (resetParams && this.isUseScope) {
+                params.partyId = this.currentOrgIdValue
+                params.includeSub = false
             }
-            this.treeDatas = response.data
-          }
-        }
-      }).catch(() => {
-        this.loadingTree = false
-      })
-    },
-    // 岗位树节点函数
-    loadPosTreeNode(node, resolve) {
-      let params = {}
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      if (this.isUseScope) {
-        // 选择器范围模式参数
-        params.type = type
-        params.includeSub = type === '1'
-        if (type === '2') {
-          params.partyId = node.level === 0 ? null : node.data.id
-        }
-        if (type === '3') {
-          params.partyId = this.currentOrgIdValue
-        }
-        if (type === '1') {
-          params.posId = node.level === 0 ? null : node.data.id
-        }
-        if (type === 'script') {
-          this.getScriptData(this.scriptValue)
-          this.loadingTree = false
-          return
-        }
-      } else {
-        params.type = '1'
-        params.posId = node.level === 0 ? null : node.data.id
-      }
-      if (this.moreSearchParams) {
-        Object.assign(params, this.moreSearchParams)
-      }
-      if (this.$utils.isEmpty(node.data) || node.data.id === '0') {
-        getPositionTreeData(params).then(res => {
-          this.loadingTree = false
-          const arr = JSON.parse(JSON.stringify(res.data))
-          let treeData
-          if (this.$utils.isEmpty(node.data)) {
-            treeData = arr
-            resolve(this.toTree(treeData))
-          } else {
-            treeData = type !== '2' ? arr : this.filterPositionTreeChildren(arr, 'root')
-            resolve(this.toTree(treeData))
-          }
-        }).catch(res => {
-          this.loadingTree = false
-          resolve([])
-        })
-      } else if (node.data.id !== '0') {
-        if (type === '2') {
-          params = {}
-          params.type = '1'
-          params.posId = node.data.id
-        }
-        getPositionTreeData(params).then(res => {
-          this.loadingTree = false
-          const arr = JSON.parse(JSON.stringify(res.data))
-          resolve(this.toTree(arr))
-        }).catch(res => {
-          this.loadingTree = false
-          resolve([])
-        })
-      }
-    },
-    // 加载角色树
-    loadRoleTreeData() {
-      if (this.isUseScope) {
-        // 选择器范围模式参数
-        const params = { parameters: [], requestPage: {}, sorts: [] }
-        const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-        params.parameters.push({ key: 'type', value: type })
-        if (this.isUseScope) {
-          params.parameters.push({ key: 'includeSub', value: this.partyTypeIdValue === '1' })
-          if (type === '3') {
-            params.parameters.push({ key: 'partyId', value: this.currentOrgIdValue })
-          }
-          if (type === 'script') {
-            this.getScriptData(this.scriptValue)
-            this.loadingTree = false
-            return
-          }
-        }
-        getUseScopeRoleTreeData(params).then(response => {
-          this.loadingTree = false
-          const data = response.data
-          this.treeData = TreeUtils.transformToTreeFormat(data)
-          this.setTree(false, this.treeData)
-          this.checkTreeId(this.treeData)
-        }).catch(() => {
-          this.loadingTree = false
-        })
-      } else {
-        getRoleTreeData().then(response => {
-          const data = response.data
-          data.unshift({
-            id: 0,
-            name: '角色树',
-            parentId: null
-          })
-          findAllSubsystem().then(response => {
-            this.loadingTree = false
-            const subSystemList = response.data
-            subSystemList.forEach(subSystem => {
-              data.push({
-                id: subSystem.id,
-                name: subSystem.name,
-                parentId: 0
-              })
+            getOrgTreeData(params).then(response => {
+                this.loadingTree = false
+                this.hiddenTree = false
+                // 普通模式
+                if (!this.isUseScope) {
+                    if (!init) {
+                        const data = response.data
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(true, this.treeData)
+                    }
+                    this.treeDatas = response.data
+                } else {
+                    // 选择器范围模式
+                    if (resetParams) {
+                        const data = response.data
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(true, this.treeData)
+                    } else {
+                        if (!init) {
+                            const data = response.data
+                            this.treeData = TreeUtils.transformToTreeFormat(data)
+                            this.setTree(true, this.treeData)
+                        }
+                        this.treeDatas = response.data
+                    }
+                }
+            }).catch(() => {
+                this.loadingTree = false
+            })
+        },
+        // 机构数节点函数【懒加载】
+        loadOrgTreeNode (node, resolve) {
+            this.loadingTree = true
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            const check = this.$utils.isNotEmpty(this.currentOrgIdValue) && node.data.id === '0' && !this.$store.getters.isSuper
+            const params = {}
+            params.type = type
+            if (type === 'script') {
+                if (this.$utils.isEmpty(node.data) || node.data.id === '0') {
+                    this.getScriptData(this.scriptValue, true)
+                    this.loadingTree = false
+                    return
+                } else {
+                    params.type = '2'
+                }
+            }
+            params.orgId = node.level === 0 ? null : check ? this.currentOrgIdValue : node.data.id
+            if (type === '5') {
+                params.includeSub = true
+            }
+            getOrgTreeData(params).then(res => {
+                this.loadingTree = false
+                let arr = JSON.parse(JSON.stringify(res.data))
+                //筛选客户 不要了
+                if (arr[0].id != '0' && this.orgAddIndex == 'qita') {
+                    arr = arr.filter(item => item.id !== '1041786072788369408')
+                }
+                let treeData
+                if (this.$utils.isNotEmpty(this.isSuperInitTree)) {
+                    if (!this.isSuperInitTree.initNode && node.level !== 0) {
+                        const nodeData = this.filterTreeChildren(this.toTree(arr), 'node', node.data.id)
+                        resolve(this.toTree(nodeData))
+                    } else {
+                        resolve(this.toTree(arr))
+                    }
+                } else if (this.isUseScope && (this.$utils.isEmpty(node.data) || node.data.id === '0')) {
+                    // 初始化和查询全部时得数据加载
+                    if (this.$utils.isEmpty(node.data) || type === '1') {
+                        treeData = arr
+                        resolve(this.toTree(treeData))
+                    } else {
+                        // 类型2,3得初始化数据节点筛选
+                        treeData = this.filterTreeChildren(arr, 'root')
+                        resolve(this.toTree(treeData))
+                    }
+                } else if (this.isUseScope && (this.$utils.isArray(node.data) && node.data[0].id === '0')) {
+                    // 节点数据为数组时得初始化处理
+                    treeData = arr
+                    resolve(this.toTree(treeData))
+                } else if (this.isUseScope && type === '1' && node.data.id !== '0') {
+                    resolve(this.toTree(arr))
+                }
+                if (!this.isUseScope && this.$utils.isEmpty(this.isSuperInitTree)) {
+                    resolve(this.toTree(arr))
+                }
+            }).catch(res => {
+                this.loadingTree = false
+                resolve([])
+            })
+        },
+        // 加载岗位树
+        loadPositionTreeData (init, resetParams = false) {
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            this.loadingTree = true
+            this.hiddenTree = true
+            if (type === 'script') {
+                this.getScriptData(this.scriptValue)
+                this.loadingTree = false
+                return
+            }
+            const params = {}
+            params.type = type
+            if (resetParams && this.isUseScope) {
+                params.partyId = this.currentOrgIdValue
+                params.includeSub = false
+            }
+            getPositionTreeData(params).then(response => {
+                this.loadingTree = false
+                this.hiddenTree = false
+                // 普通模式
+                if (!this.isUseScope) {
+                    if (!init) {
+                        const data = response.data
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(true, this.treeData)
+                    }
+                    this.treeDatas = response.data
+                } else {
+                    // 选择器范围模式
+                    if (resetParams) {
+                        const data = response.data
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(true, this.treeData)
+                    } else {
+                        if (!init) {
+                            const data = response.data
+                            this.treeData = TreeUtils.transformToTreeFormat(data)
+                            this.setTree(true, this.treeData)
+                        }
+                        this.treeDatas = response.data
+                    }
+                }
+            }).catch(() => {
+                this.loadingTree = false
+            })
+        },
+        // 岗位树节点函数
+        loadPosTreeNode (node, resolve) {
+            let params = {}
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            if (this.isUseScope) {
+                // 选择器范围模式参数
+                params.type = type
+                params.includeSub = type === '1'
+                if (type === '2') {
+                    params.partyId = node.level === 0 ? null : node.data.id
+                }
+                if (type === '3') {
+                    params.partyId = this.currentOrgIdValue
+                }
+                if (type === '1') {
+                    params.posId = node.level === 0 ? null : node.data.id
+                }
+                if (type === 'script') {
+                    this.getScriptData(this.scriptValue)
+                    this.loadingTree = false
+                    return
+                }
+            } else {
+                params.type = '1'
+                params.posId = node.level === 0 ? null : node.data.id
+            }
+            if (this.moreSearchParams) {
+                Object.assign(params, this.moreSearchParams)
+            }
+            if (this.$utils.isEmpty(node.data) || node.data.id === '0') {
+                getPositionTreeData(params).then(res => {
+                    this.loadingTree = false
+                    const arr = JSON.parse(JSON.stringify(res.data))
+                    let treeData
+                    if (this.$utils.isEmpty(node.data)) {
+                        treeData = arr
+                        resolve(this.toTree(treeData))
+                    } else {
+                        treeData = type !== '2' ? arr : this.filterPositionTreeChildren(arr, 'root')
+                        resolve(this.toTree(treeData))
+                    }
+                }).catch(res => {
+                    this.loadingTree = false
+                    resolve([])
+                })
+            } else if (node.data.id !== '0') {
+                if (type === '2') {
+                    params = {}
+                    params.type = '1'
+                    params.posId = node.data.id
+                }
+                getPositionTreeData(params).then(res => {
+                    this.loadingTree = false
+                    const arr = JSON.parse(JSON.stringify(res.data))
+                    resolve(this.toTree(arr))
+                }).catch(res => {
+                    this.loadingTree = false
+                    resolve([])
+                })
+            }
+        },
+        // 加载角色树
+        loadRoleTreeData () {
+            if (this.isUseScope) {
+                // 选择器范围模式参数
+                const params = { parameters: [], requestPage: {}, sorts: [] }
+                const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+                params.parameters.push({ key: 'type', value: type })
+                if (this.isUseScope) {
+                    params.parameters.push({ key: 'includeSub', value: this.partyTypeIdValue === '1' })
+                    if (type === '3') {
+                        params.parameters.push({ key: 'partyId', value: this.currentOrgIdValue })
+                    }
+                    if (type === 'script') {
+                        this.getScriptData(this.scriptValue)
+                        this.loadingTree = false
+                        return
+                    }
+                }
+                getUseScopeRoleTreeData(params).then(response => {
+                    this.loadingTree = false
+                    const data = response.data
+                    this.treeData = TreeUtils.transformToTreeFormat(data)
+                    this.setTree(false, this.treeData)
+                    this.checkTreeId(this.treeData)
+                }).catch(() => {
+                    this.loadingTree = false
+                })
+            } else {
+                getRoleTreeData().then(response => {
+                    const data = response.data
+                    data.unshift({
+                        id: 0,
+                        name: '角色树',
+                        parentId: null
+                    })
+                    findAllSubsystem().then(response => {
+                        this.loadingTree = false
+                        const subSystemList = response.data
+                        subSystemList.forEach(subSystem => {
+                            data.push({
+                                id: subSystem.id,
+                                name: subSystem.name,
+                                parentId: 0
+                            })
+                        })
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(false, this.treeData)
+                        this.checkTreeId(this.treeData)
+                    }).catch(() => {
+                        this.loadingTree = false
+                    })
+                }).catch(() => {
+                    this.loadingTree = false
+                })
+            }
+        },
+        // 加载用户组树
+        loadGroupTreeData () {
+            const params = {}
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            params.type = type
+            if (this.isUseScope) {
+                // 选择器范围模式参数
+                params.includeSub = type === '1'
+                if (type === '3') {
+                    params.partyId = this.currentOrgIdValue
+                }
+                if (type === 'script') {
+                    this.getScriptData(this.scriptValue)
+                    this.loadingTree = false
+                    return
+                }
+            }
+            getGroupTreeData(params).then(response => {
+                this.loadingTree = false
+                const data = response.data
+                this.treeData = TreeUtils.transformToTreeFormat(data)
+                this.setTree(false, this.treeData)
+                this.checkTreeId(this.treeData)
+            }).catch(() => {
+                this.loadingTree = false
             })
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(false, this.treeData)
-            this.checkTreeId(this.treeData)
-          }).catch(() => {
-            this.loadingTree = false
-          })
-        }).catch(() => {
-          this.loadingTree = false
-        })
-      }
-    },
-    // 加载用户组树
-    loadGroupTreeData() {
-      const params = {}
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      params.type = type
-      if (this.isUseScope) {
-        // 选择器范围模式参数
-        params.includeSub = type === '1'
-        if (type === '3') {
-          params.partyId = this.currentOrgIdValue
-        }
-        if (type === 'script') {
-          this.getScriptData(this.scriptValue)
-          this.loadingTree = false
-          return
         }
-      }
-      getGroupTreeData(params).then(response => {
-        this.loadingTree = false
-        const data = response.data
-        this.treeData = TreeUtils.transformToTreeFormat(data)
-        this.setTree(false, this.treeData)
-        this.checkTreeId(this.treeData)
-      }).catch(() => {
-        this.loadingTree = false
-      })
     }
-  }
 }

+ 16 - 20
src/business/platform/org/employee/panel.vue

@@ -332,8 +332,8 @@ export default {
             })
         },
         /**
-       * 获取查询条件格式化参数
-       */
+         * 获取查询条件格式化参数
+         */
         getFormatParams () {
             const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
             const key = this.partyType === 'org' ? 'orgId' : this.partyType === 'position' ? 'positionId' : this.partyType === 'role' ? 'roleId' : this.partyType === 'group' ? 'groupId' : ''
@@ -355,45 +355,41 @@ export default {
             // if (this.$utils.isNotEmpty(this.currentOrgId)) {
             //   params['orgId'] = this.partyId || this.currentOrgId
             // }
-            // 筛选客户不要了
-            if (this.orgAddIndex == 'qita' && this.partyId == '' && this.partyType == 'org') {
-                params['orgId'] = this.orgAddId
-            }
             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':// 查询
@@ -408,16 +404,16 @@ export default {
             }
         },
         /**
-       * 处理按钮事件
-       */
+         * 处理按钮事件
+         */
         handleMoreSearchAction (data) {
             ActionUtils.setFirstPagination(this.pagination)
             this.moreSearchParams = data
             this.loadListData()
         },
         /**
-       * 处理更多
-       */
+         * 处理更多
+         */
         handleMoreSearch () {
             this.dialogFormVisible = true
         },

+ 8 - 2
src/views/system/dashboard/components/new-home.vue

@@ -281,6 +281,12 @@
     export default {
         components: { BpmnFormrender, homeCalendar, IbpsTypeTree },
         name: 'calendar',
+        props: {
+            plan: {
+                type: Array,
+                default: () => []
+            }
+        },
         filters: {
             getWorkInfo (v, type) {
                 let hasDesc = v.includes('#')
@@ -453,7 +459,7 @@
                                 data.forEach((item, index) => {
                                     dataResult[index].submitBy = item.name_
                                     dataResult[index].workName = dataResult[index].subject.includes('#') ? dataResult[index].subject.split('#')[0] : dataResult[index].subject.split('(')[0]
-                                    dataResult[index].workType = dataResult[index].workName.includes('计划') ? 'plan' : 'normal'
+                                    dataResult[index].workType = this.plan.includes(dataResult[index].procDefKey) ? 'plan' : 'normal'
                                     dataResult[index].state = this.judgeExpire(dataResult[index].createTime, currentTime, dataResult[index].workType, '1')
                                 })
                                 this.dataList = dataResult.sort((a, b) => b.createTime.localeCompare(a.createTime))
@@ -618,7 +624,7 @@
                 workList.forEach(item => {
                     // 截取流程名
                     item.workName = item.subject.includes('#') ? item.subject.split('#')[0] : item.subject.split('(')[0]
-                    item.workType = item.workName.includes('计划') ? 'plan' : 'normal'
+                    item.workType = this.plan.includes(item.procDefKey) ? 'plan' : 'normal'
                     let isExpire = this.judgeExpire(item.createTime, currentTime, item.workType)
                     if (isExpire) {
                         result.expire.push(item)

+ 160 - 34
src/views/system/dashboard/page.vue

@@ -8,7 +8,7 @@
         class="ibps-desktop-page"
         @scroll="({ x, y }) => { scrollTop = y }"
     >
-        <newHome @handleApprove="handleApprove" @handleUnreadMessage="handleUnreadMessage">
+        <newHome v-if="cronTask" :plan="cronTask" @handleApprove="handleApprove" @handleUnreadMessage="handleUnreadMessage">
             <template slot="myslot">
                 <el-upload
                     style="display: inline-block"
@@ -165,13 +165,11 @@
     import { StatisticsData } from '@/api/platform/system/jbdHome'
     import { StatisticsSign } from '@/api/platform/system/jbdHome'
     import { getToken } from '@/utils/auth'
-
     import newHome from './components/new-home'
-
     import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
 
     const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-
+    let cronTask = null
     export default {
         components: {
             'ibps-news-dialog': IbpsNewsDialog,
@@ -185,6 +183,7 @@
         },
         data () {
             return {
+                cronTask,
                 infoMessage: [],
                 uloadPath: BASE_API() + BUSINESS_BASE_URL() + '/ck/task/importExcel',
                 reportPath: BASE_API() + BUSINESS_BASE_URL() + '/sys/SysDataContext/replaceReportFile',
@@ -239,6 +238,17 @@
                 return this.system.isLocal
             }
         },
+        beforeRouteEnter(to, from, next){
+            const sql = `select * from t_jhswpzb`
+            curdPost('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                cronTask = data.map(i => i.liu_cheng_key_)
+                next()
+            }).catch(error => {
+                alert('获取计划事务配置表信息失败,请刷新页面重试!')
+                console.log(error)
+            })
+        },
         mounted () {
             if (localStorage.getItem('statistic') === 'isNormal') {
                 this.showRepost = false
@@ -248,38 +258,43 @@
         },
         created () {
             this.getUsersList()
+            const today = new Date().toLocaleDateString()
+            const savedDate = localStorage.getItem('doNotShowToday')
+            if (savedDate !== today) {
+                this.getPeriodTask()
+            }
             StatisticsData().then(data => {
                 // 将参数替换成对应参数
-                if (data.state === 200 && data.variables.data.length > 0) {
-                    const h = this.$createElement
-                    const cont = data.variables.data
-                    for (let i = 0; i < cont.length; i++) {
-                        window.setTimeout(() => {
-                            this.infoMessage[i] = this.$notify.info({
-                                title: '定时任务:' + cont[i].ren_wu_biao_ti_,
-                                message: h('p', null, [
-                                    h('span', null, '任务时间: ' + cont[i].ren_wu_shi_jian_),
-                                    h('br'),
-                                    h('span', null, '任务内容: '),
-                                    h('span', { style: 'color: #FF8C00;font-size:12px;' }, cont[i].ding_shi_ren_wu_n),
-                                    h('br'),
-                                    h('el-button', {
-                                        attrs: {
-                                            size: 'mini',
-                                            plain: true
-                                        },
-                                        on: {
-                                            click: () => {
-                                                this.infoMessage[i].close()
-                                            } // 路由加载之后,调用关闭消息弹窗的方法
-                                        }
-                                    }, '忽略关闭')
-                                ]),
-                                duration: 0
-                            })
-                        }, 0)
-                    }
-                }
+                // if (data.state === 200 && data.variables.data.length > 0) {
+                //     const h = this.$createElement
+                //     const cont = data.variables.data
+                //     for (let i = 0; i < cont.length; i++) {
+                //         window.setTimeout(() => {
+                //             this.infoMessage[i] = this.$notify.info({
+                //                 title: '定时任务:' + cont[i].ren_wu_biao_ti_,
+                //                 message: h('p', null, [
+                //                     h('span', null, '任务时间: ' + cont[i].ren_wu_shi_jian_),
+                //                     h('br'),
+                //                     h('span', null, '任务内容: '),
+                //                     h('span', { style: 'color: #FF8C00;font-size:12px;' }, cont[i].ding_shi_ren_wu_n),
+                //                     h('br'),
+                //                     h('el-button', {
+                //                         attrs: {
+                //                             size: 'mini',
+                //                             plain: true
+                //                         },
+                //                         on: {
+                //                             click: () => {
+                //                                 this.infoMessage[i].close()
+                //                             } // 路由加载之后,调用关闭消息弹窗的方法
+                //                         }
+                //                     }, '忽略关闭')
+                //                 ]),
+                //                 duration: 0
+                //             })
+                //         }, 0)
+                //     }
+                // }
             })
         },
         beforeDestroy () {
@@ -518,6 +533,117 @@
                         console.log(error)
                     })
                 }
+            },
+            getPeriodTask () {
+                const { userId } = this.$store.getters
+                const sql = `select * from t_zqswtxb where shi_fou_ti_xing_ = '是' and zhi_xing_ren_yuan like '%${userId}%' order by field(zhi_xing_zhou_qi_, '1次/天', '1次/周', '1次/月', '1次/季度', '1次/半年', '1次/年')`
+                curdPost('sql', sql).then(res => {
+                    const { data = [] } = res.variables || {}
+                    if (data.length) {
+                        this.showMsg(data)
+                    }
+                }).catch(error => {
+                    this.$message.error('获取周期事务信息失败!')
+                    console.log(error)
+                })
+            },
+            showMsg (data) {
+                const h = this.$createElement
+                const text = {
+                    '1次/天': '本日',
+                    '1次/周': '本周',
+                    '1次/月': '本月',
+                    '1次/季度': '本季度',
+                    '1次/半年': '近半年',
+                    '1次/年': '本年度'
+                }
+                const result = data.reduce((acc, item) => {
+                    const key = item.zhi_xing_zhou_qi_
+                    if (!acc[key]) {
+                        acc[key] = []
+                    }
+                    acc[key].push({
+                        name: item.shi_wu_ming_cheng,
+                        path: item.ye_mian_lu_jing_
+                    })
+                    return acc
+                }, {})
+                let msg = []
+                const doNotShowBtn = h('el-button', {
+                    attrs: {
+                        size: 'mini',
+                        type: 'primary',
+                        plain: true,
+                    },
+                    on: {
+                        click: () => {
+                            this.doNotShowToday()
+                        }
+                    }
+                }, '今日不再提示');
+                const confirmBtn = h('el-button', {
+                    attrs: {
+                        size: 'mini',
+                        type: 'success',
+                        plain: true,
+                    },
+                    on: {
+                        click: () => {
+                            this.infoMessage.close()
+                        }
+                    }
+                }, '确认');
+                Object.keys(result).forEach(key => {
+                    // msg.push(h('p', {style: {
+                    //     'font-weight': 'bold',
+                    //     'color': '#666',
+                    //     'font-size': '16px'
+                    // }}, key))
+                    // result[key].forEach(i => {
+                    //     msg.push(h('span', null, i))
+                    //     msg.push(h('br'))
+                    // })
+                    let ul = [text[key]]
+                    result[key].forEach(i => {
+                        ul.push(h('li', {
+                            style: {
+                                'font-weight': 'normal',
+                                'color': '#666',
+                                'font-size': '14px',
+                                'cursor': 'pointer'
+                            },
+                            on: {
+                                click: () => {
+                                    this.infoMessage.close()
+                                    this.$router.push(i.path)
+                                }
+                            }
+                        }, i.name))
+                    })
+                    msg.push(h('ul', {style: {
+                        'font-weight': 'bold',
+                        'color': '#000',
+                        'font-size': '16px',
+                        'margin': '0',
+                        'padding': '0',
+                        'margin-bottom': '5px'
+                    }}, ul))
+                })
+                msg.push(doNotShowBtn, confirmBtn)
+                window.setTimeout(() => {
+                    this.infoMessage = this.$notify({
+                        title: '以下是您的周期性事务提示',
+                        message: h('div', null, msg),
+                        duration: 0,
+                        iconClass: 'el-icon-bell',
+                        showClose: false
+                    })
+                }, 0)
+            },
+            doNotShowToday () {
+                const today = new Date().toLocaleDateString()
+                localStorage.setItem('doNotShowToday', today)
+                this.infoMessage.close()
             }
         }
     }