汪钰 3 лет назад
Родитель
Сommit
037df75ef8

+ 0 - 2
src/components/FormGenerator/DraggableItem.vue

@@ -155,8 +155,6 @@
     props: ['currentItem', 'index', 'drawingList', 'activeId', 'formConf'],
     render(h) {
       const layout = layouts[this.currentItem.__config__.layout];
-      console.log(layout);
-
       if (layout) {
         return layout.call(
           this,

+ 1 - 1
src/components/FormGenerator/components/generator/config.js

@@ -145,7 +145,7 @@ export const inputComponents = [
       regList: [],
       document: 'http://tinymce.ax-z.cn'
     },
-    placeholder: '请输入',
+    placeholder: '',
     height: 300, // 编辑器高度
     branding: false // 隐藏右下角品牌烙印
   }

+ 13 - 11
src/components/FormGenerator/index.vue

@@ -135,14 +135,16 @@
       fullscreen
       center
     >
-      <!-- <vue-ace-editor v-model="JSON.stringify(formData,null,2)"
-                        @init="editorInit"
-                        lang="json"
-                        theme="chrome"
-                        width="100%"
-                        height="calc(100vh - 214px)"
-                        :options="{wrap: true, readOnly: true}">
-        </vue-ace-editor> -->
+      <vue-ace-editor
+        v-model="JSON.stringify(formData, null, 2)"
+        @init="editorInit"
+        lang="json"
+        theme="chrome"
+        width="100%"
+        height="calc(100vh - 214px)"
+        :options="{ wrap: true, readOnly: true }"
+      >
+      </vue-ace-editor>
       <span slot="footer">
         <el-button
           icon="el-icon-document"
@@ -216,7 +218,7 @@
     getFormConf
   } from '@/components/FormGenerator/utils/db';
   import loadBeautifier from '@/components/FormGenerator/utils/loadBeautifier';
-  // import VueAceEditor from 'vue2-ace-editor'
+  import VueAceEditor from 'vue2-ace-editor';
 
   let beautifier;
   const emptyActiveData = { style: {}, autosize: {} };
@@ -236,8 +238,8 @@
       RightPanel,
       CodeTypeDialog,
       DraggableItem,
-      ParserDialog
-      // VueAceEditor
+      ParserDialog,
+      VueAceEditor
     },
     props: ['formDataProp'],
     data() {

+ 108 - 0
src/components/select/SelectOrg/index.vue

@@ -0,0 +1,108 @@
+<template>
+    <el-dialog title="选择机构" :visible.sync="visibleInChild" :append-to-body="appendToBody" :before-close="close">
+        <div class="el-dialog-body-custom-height">
+            <el-input v-model="filterText" placeholder="请输入过滤条件" style="margin:10px 0px 10px 0px"/>
+            <el-tree
+                    ref="_selectOrgTree"
+                    :data="treeData"
+                    node-key="id"
+                    :props="defaultProps"
+                    :filter-node-method="filterNode"
+                    class="filter-tree"
+                    check-strictly
+                    :show-checkbox="multipleSelect"
+            />
+        </div>
+        <div slot="footer" class="dialog-footer">
+            <el-button icon="el-icon-close" @click="visibleInChild = false">取消</el-button>
+            <el-button icon="el-icon-check" type="primary" @click="confirm">确定</el-button>
+        </div>
+    </el-dialog>
+</template>
+
+<script>
+    import {getAction} from '@/api/manage'
+    import {Message} from 'element-ui'
+
+    export default {
+        name: "SelectOrg",
+        props: {
+            visible: {
+                type: Boolean,
+                default: false
+            },
+            multipleSelect: {
+                type: Boolean,
+                default: false
+            },
+            type: {
+                type: String,
+                default: ''
+            },
+            appendToBody: {
+                type: Boolean,
+                default: false
+            }
+        },
+        data() {
+            return {
+                filterText: '',
+                treeData: [],
+                defaultProps: {
+                    children: 'children',
+                    label: 'label',
+                    isLeaf: 'isLeaf',
+                    data: 'data'
+                }
+            }
+        },
+        watch: {
+            filterText(val) {
+                this.$refs._selectOrgTree.filter(val)
+            }
+        },
+        computed: {
+            visibleInChild: {
+                get() {
+                    return this.visible
+                },
+                set(val) {
+                    this.$emit('update:visible', val)
+                }
+            },
+        },
+        methods: {
+            close() {
+                this.visibleInChild = false;
+            },
+            filterNode(value, data) {
+                if (!value) return true
+                return data.label.indexOf(value) !== -1
+            },
+            getTreeData() {
+                getAction('/sys/org/getSelectTreeData', {type: this.type}).then(res => {
+                    const {data} = res
+                    this.treeData = data
+                })
+            },
+            confirm() {
+                if (this.multipleSelect) {
+                    let checkedNodes = this.$refs._selectOrgTree.getCheckedNodes();
+                    if (!checkedNodes || checkedNodes.length == 0) {
+                        Message.error('请先选择机构')
+                        return
+                    }
+                    this.$emit("selectOrgFinished", checkedNodes);
+                } else {
+                    let curNode = this.$refs._selectOrgTree.getCurrentNode();
+                    if (!curNode) {
+                        Message.error('请先选择机构')
+                        return
+                    }
+                    this.$emit("selectOrgFinished", curNode);
+                }
+                this.visibleInChild = false;
+            }
+        }
+    }
+</script>

+ 277 - 0
src/components/select/SelectUser/index.vue

@@ -0,0 +1,277 @@
+<template>
+  <ele-modal
+    width="980px"
+    height="60%"
+    :visible="visibleInChild"
+    :close-on-click-modal="true"
+    custom-class="ele-dialog-form"
+    fullscreen
+    maxable
+    title="选择用户"
+    append-to-body
+    @update:visible="updateVisible"
+  >
+    <div class="el-dialog-body-custom-height">
+      <el-row :gutter="5">
+        <el-col :span="18">
+          <Organization @changeList="changeList" ref="organization" />
+        </el-col>
+        <el-col :span="6">
+          <div>
+            <el-card shadow="never">
+              <clearList @btnRemoveAll="btnRemoveAll" />
+              <ele-pro-table
+                ref="table"
+                :columns="columns"
+                :datasource="datasource"
+                :need-page="false"
+                :toolbar="false"
+                tool-class="ele-toolbar-form"
+                cache-key="systemOrgUserTable"
+              >
+                <template v-slot:action="row">
+                  <el-popconfirm
+                    class="ele-action"
+                    title="确定要删除此用户吗?"
+                    @confirm="remove(row)"
+                  >
+                    <template v-slot:reference>
+                      <el-link
+                        type="danger"
+                        :underline="false"
+                        icon="el-icon-delete"
+                      >
+                        删除
+                      </el-link>
+                    </template>
+                  </el-popconfirm>
+                </template>
+
+                <!-- 角色列 -->
+                <template v-slot:roles="{ row }">
+                  <el-tag
+                    v-for="item in row.roles"
+                    :key="item.roleId"
+                    type="primary"
+                    size="mini"
+                    :disable-transitions="true"
+                  >
+                    {{ item.roleName }}
+                  </el-tag>
+                </template>
+              </ele-pro-table>
+            </el-card>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <div slot="footer" class="dialog-footer">
+      <el-button icon="el-icon-close" @click="visibleInChild = false"
+        >取消</el-button
+      >
+      <el-button icon="el-icon-check" type="primary" @click="confirm"
+        >确定</el-button
+      >
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import Organization from '@/components/select/organization';
+  import { getAction } from '@/api/flowable/manage';
+  import { Message } from 'element-ui';
+  import clearList from './org-user-search.vue';
+
+  export default {
+    name: 'SelectUser',
+    components: { Organization, clearList },
+    props: {
+      visible: {
+        type: Boolean,
+        default: false
+      },
+      multipleSelect: {
+        type: Boolean,
+        default: false
+      },
+
+      type: {
+        type: String,
+        default: ''
+      },
+      appendToBody: {
+        type: Boolean,
+        default: false
+      }
+    },
+    data() {
+      return {
+        filterText: '',
+        treeData: [],
+        defaultProps: {
+          children: 'children',
+          label: 'label',
+          isLeaf: 'isLeaf',
+          data: 'data'
+        },
+        records: [],
+        total: 0,
+        selectedRecords: [],
+        listQuery: {
+          current: 1,
+          size: 10,
+          userId: undefined,
+          userName: undefined,
+          orgId: undefined
+        },
+        currOrgId: '',
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            label: '姓名',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+      
+          },
+
+          {
+            prop: 'loginName',
+            label: '用户账号',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+          
+          },
+          {
+            label: '操作',
+            slot: 'action',
+            showOverflowTooltip: true,
+    
+          }
+        ],
+        statusOptions: [
+          { value: 1, label: '全职' },
+          { value: 2, label: '兼职' },
+          { value: 3, label: '实习' },
+          { value: 4, label: '正式' },
+          { value: 5, label: '试用' },
+          { value: 6, label: '离职' }
+        ]
+      };
+    },
+    watch: {
+      filterText(val) {
+        this.$refs._selectOrgTree.filter(val);
+      }
+    },
+    computed: {
+      visibleInChild: {
+        get() {
+          return this.visible;
+        },
+        set(val) {
+          this.$emit('update:visible', val);
+        }
+      }
+    },
+    methods: {
+      datasource() {
+        return {
+          list: this.selectedRecords
+        };
+      },
+      remove(row) {
+        this.selectedRecords.splice(row.$index, 1);
+        this.$refs.table.reload();
+        this.$refs.organization.$refs.userList.selectedRecords =
+          this.selectedRecords;
+      },
+      changeList(arr) {
+        this.selectedRecords = arr;
+        this.$refs.table.reload();
+        console.log(this.selectedRecords);
+      },
+      /* 更新visible */
+      updateVisible(value) {
+        this.$emit('update:visible', value);
+      },
+      close() {
+        this.visibleInChild = false;
+      },
+      filterNode(value, data) {
+        if (!value) return true;
+        return data.label.indexOf(value) !== -1;
+      },
+      getTreeData() {
+        getAction('/sys/org/getSelectTreeData', { type: this.type }).then(
+          (res) => {
+            const { data } = res;
+            this.treeData = data;
+          }
+        );
+      },
+      handleNodeClick(node) {
+        this.currOrgId = node.id;
+        this.listSysUsers();
+      },
+      listSysUsers() {
+        this.listQuery.orgId = this.currOrgId;
+        getAction('/sys/user/listSelectUser', this.listQuery).then((res) => {
+          const { data } = res;
+          this.records = data.records;
+          this.total = data.total;
+        });
+      },
+      btnQuery() {
+        this.listQuery.current = 1;
+        this.listSysUsers();
+      },
+      btnReset() {
+        this.currOrgId = '';
+        this.listQuery = {
+          current: 1,
+          size: 10,
+          userId: undefined,
+          userName: undefined,
+          orgId: undefined
+        };
+        this.listSysUsers();
+      },
+
+      btnRemoveAll() {
+        this.selectedRecords = [];
+        this.$refs.table.reload();
+        this.$refs.organization.$refs.userList.selectedRecords = [];
+      },
+      btnRemove(row) {
+        let arr = this.selectedRecords;
+        arr.splice(
+          arr.findIndex((item) => item.userId === row.userId),
+          1
+        );
+      },
+      confirm() {
+        if (!this.selectedRecords || this.selectedRecords.length == 0) {
+          Message.error('请先选择用户');
+          return;
+        }
+        if (this.multipleSelect) {
+          this.$emit('selectUserFinished', this.selectedRecords);
+        } else {
+          this.$emit('selectUserFinished', this.selectedRecords[0]);
+        }
+        this.selectedRecords = [];
+        this.$refs.organization.$refs.userList.selectedRecords = [];
+        this.records = [];
+        this.visibleInChild = false;
+      }
+    }
+  };
+</script>

+ 59 - 0
src/components/select/SelectUser/org-user-search.vue

@@ -0,0 +1,59 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    size="small"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
+        <el-form-item>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-remove"
+            class="ele-btn-icon"
+            @click="btnRemoveAll"
+          >
+            清空
+          </el-button>
+          <slot></slot>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        loginName: '',
+        name: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      btnRemoveAll() {
+        this.$emit('btnRemoveAll');
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 146 - 0
src/components/select/organization/components/org-edit.vue

@@ -0,0 +1,146 @@
+<!-- 机构编辑弹窗 -->
+<template>
+  <ele-modal
+    width="680px"
+    :visible="visible"
+    :close-on-click-modal="true"
+    custom-class="ele-dialog-form"
+    :title="isUpdate ? '修改机构' : '添加机构'"
+    @update:visible="updateVisible"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="82px">
+      <el-row :gutter="15">
+        <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+          <el-form-item label="上级机构:">
+            <org-select
+              v-model="form.parentId"
+              :data="organizationList"
+              placeholder="请选择上级机构"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+          <el-form-item label="机构名称:" prop="name">
+            <el-input
+              clearable
+              :maxlength="20"
+              v-model="form.name"
+              placeholder="请输入机构名称"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="updateVisible(false)">取消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">
+        保存
+      </el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import OrgSelect from './org-select.vue';
+  import OrgTypeSelect from './org-type-select.vue';
+  import {
+    addOrganization,
+    updateOrganization
+  } from '@/api/system/organization';
+
+  export default {
+    components: { OrgSelect, OrgTypeSelect },
+    props: {
+      // 弹窗是否打开
+      visible: Boolean,
+      // 修改回显的数据
+      data: Object,
+      // 上级id
+      parentId: [Number, String],
+      // 机构数据
+      organizationList: Array
+    },
+    data() {
+      const defaultForm = {
+        id: null,
+        parentId: null,
+        name: '',
+        type: 1
+      };
+      return {
+        defaultForm,
+        // 表单数据
+        form: { ...defaultForm },
+        // 表单验证规则
+        rules: {
+          name: [{ required: true, message: '请输入机构名称', trigger: 'blur' }]
+        },
+        // 提交状态
+        loading: false,
+        // 是否是修改
+        isUpdate: false
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 保存编辑 */
+      save() {
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
+          }
+          this.loading = true;
+          const data = {
+            ...this.form,
+            parentId: this.form.parentId || 0
+          };
+          if (!this.isUpdate) {
+            delete data.id;
+          }
+          const saveOrUpdate = this.isUpdate
+            ? updateOrganization
+            : addOrganization;
+          saveOrUpdate(data)
+            .then((msg) => {
+              this.loading = false;
+              this.$message.success(msg);
+              this.updateVisible(false);
+              this.$emit('done');
+            })
+            .catch((e) => {
+              this.loading = false;
+              // this.$message.error(e.message);
+            });
+        });
+      },
+      /* 更新visible */
+      updateVisible(value) {
+        this.$emit('update:visible', value);
+      }
+    },
+    watch: {
+      visible(visible) {
+        if (visible) {
+          if (this.data) {
+            this.$util.assignObject(this.form, {
+              ...this.data,
+              parentId: this.data.parentId == 0 ? '' : this.data.parentId ?? ''
+            });
+            this.isUpdate = true;
+          } else {
+            this.form.parentId = this.parentId;
+            this.isUpdate = false;
+          }
+        } else {
+          this.$refs.form.clearValidate();
+          this.form = { ...this.defaultForm };
+        }
+      }
+    }
+  };
+</script>

+ 35 - 0
src/components/select/organization/components/org-select.vue

@@ -0,0 +1,35 @@
+<!-- 机构选择下拉框 -->
+<template>
+  <ele-tree-select
+    clearable
+    :value="value || ''"
+    :data="data"
+    label-key="name"
+    value-key="id"
+    default-expand-all
+    :placeholder="placeholder"
+    @input="updateValue"
+  />
+</template>
+
+<script>
+  export default {
+    props: {
+      // 选中的数据(v-model)
+      value: [Number,String],
+      // 提示信息
+      placeholder: {
+        type: String,
+        default: '请选择机构'
+      },
+      // 机构数据
+      data: Array
+    },
+    methods: {
+      /* 更新选中数据 */
+      updateValue(value) {
+        this.$emit('input', value);
+      }
+    }
+  };
+</script>

+ 57 - 0
src/components/select/organization/components/org-type-select.vue

@@ -0,0 +1,57 @@
+<!-- 机构类型选择下拉框 -->
+<template>
+  <el-select
+    clearable
+    :value="value"
+    class="ele-fluid"
+    :placeholder="placeholder"
+    @input="updateValue"
+  >
+    <el-option
+      v-for="item in data"
+      :key="item.dictDataId"
+      :value="item.dictDataCode"
+      :label="item.dictDataName"
+    />
+  </el-select>
+</template>
+
+<script>
+  import { listDictionaryData } from '@/api/system/dictionary-data';
+
+  export default {
+    props: {
+      // 选中的数据(v-modal)
+      value: String,
+      // 提示信息
+      placeholder: {
+        type: String,
+        default: '请选择机构类型'
+      }
+    },
+    data() {
+      return {
+        // 机构类型数据
+        data: []
+      };
+    },
+    created() {
+      /* 获取机构类型数据 */
+      listDictionaryData({
+        dictCode: 'organization_type'
+      })
+        .then((list) => {
+          this.data = list;
+        })
+        .catch((e) => {
+          // this.$message.error(e.message);
+        });
+    },
+    methods: {
+      /* 更新选中数据 */
+      updateValue(value) {
+        this.$emit('input', value);
+      }
+    }
+  };
+</script>

+ 353 - 0
src/components/select/organization/components/org-user-edit.vue

@@ -0,0 +1,353 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <ele-modal
+    width="800px"
+    :visible="visible"
+    :close-on-click-modal="true"
+    custom-class="ele-dialog-form"
+    :title="isUpdate ? '修改用户' : '添加用户'"
+    @update:visible="updateVisible"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="82px">
+      <el-row :gutter="15">
+        <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+          <el-form-item label="所属机构:">
+            <org-select
+              :data="organizationList"
+              placeholder="请选择所属机构"
+              v-model="form.groupId"
+            />
+          </el-form-item>
+          <el-form-item label="性别:" prop="sex">
+            <el-select
+              clearable
+              class="ele-block"
+              v-model="form.sex"
+              placeholder="请选择性别"
+            >
+              <el-option label="男" :value="1" />
+              <el-option label="女" :value="2" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="员工状态:" prop="status">
+            <el-select
+              clearable
+              class="ele-block"
+              v-model="form.status"
+              placeholder="请选择员工状态"
+            >
+              <el-option
+                v-for="item in statusOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="籍贯:" prop="city">
+            <regions-select
+              style="width: 100%"
+              v-model="city"
+              placeholder="请选择省市区"
+            />
+          </el-form-item>
+          <el-form-item label="生日:" prop="age">
+            <el-date-picker
+              style="width: 100%"
+              clearable
+              v-model="form.birthday"
+              type="date"
+              value-format="yyyy-MM-dd"
+              placeholder="请选择日期"
+            >
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="入职时间:" prop="joinDate">
+            <el-date-picker
+              style="width: 100%"
+              clearable
+              v-model="form.joinDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              placeholder="请选择日期"
+            >
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="毕业院校:" prop="school">
+            <el-input
+              clearable
+              :maxlength="100"
+              v-model="form.school"
+              placeholder="请输入毕业院校"
+            />
+          </el-form-item>
+          <el-form-item label="微信号:" prop="wxId">
+            <el-input
+              clearable
+              :maxlength="100"
+              v-model="form.wxId"
+              placeholder="请输入微信号"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+          <el-form-item label="工号:" prop="jobNumber">
+            <el-input
+              clearable
+              type="text"
+              :maxlength="10"
+              v-model="form.jobNumber"
+              placeholder="请输入工号"
+              onkeyup="value=value.replace(/[^\x00-\xff]/g, '')"
+            />
+          </el-form-item>
+          <el-form-item label="姓名:" prop="name">
+            <el-input
+              clearable
+              :maxlength="20"
+              v-model="form.name"
+              placeholder="请输入姓名"
+            />
+          </el-form-item>
+          <el-form-item label="用户账号:">
+            <el-input
+              :disabled="true"
+              :maxlength="11"
+              v-model="form.loginName"
+              v-if="isUpdate && data.accountId"
+            />
+            <el-select
+              clearable
+              class="ele-block"
+              v-model="form.accountId"
+              placeholder="请选择用户账号"
+              v-else
+            >
+              <el-option
+                v-for="item in accountList"
+                :key="item.id"
+                :label="item.loginName"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="手机号:" prop="phone">
+            <el-input
+              clearable
+              :maxlength="11"
+              v-model="form.phone"
+              placeholder="请输入手机号"
+            />
+          </el-form-item>
+          <el-form-item label="邮箱:" prop="email">
+            <el-input
+              clearable
+              :maxlength="100"
+              v-model="form.email"
+              placeholder="请输入邮箱"
+            />
+          </el-form-item>
+          <el-form-item label="年龄:" prop="age">
+            <el-input
+              type="number"
+              clearable
+              :maxlength="100"
+              v-model="form.age"
+              placeholder="请输入年龄"
+              onkeyup="value=value.replace(/[^\d.]/g,'')"
+            />
+          </el-form-item>
+          <el-form-item label="岗位名称:" prop="postName">
+            <el-input
+              clearable
+              :maxlength="100"
+              v-model="form.postName"
+              placeholder="请输入岗位名称"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="updateVisible(false)">取消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">
+        保存
+      </el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import { emailReg, phoneReg } from 'ele-admin';
+  import OrgSelect from './org-select.vue';
+  import RoleSelect from '@/views/system/user/components/role-select.vue';
+  import RegionsSelect from '@/components/RegionsSelect/index.vue';
+  import { getNotBoundAccount } from '@/api/system/user';
+  import {
+    getUserDetail,
+    saveOrUpdateUser,
+    checkExistence
+  } from '@/api/system/organization';
+  export default {
+    components: { OrgSelect, RoleSelect, RegionsSelect },
+    props: {
+      // 弹窗是否打开
+      visible: Boolean,
+      // 修改回显的数据
+      data: Object,
+      // 全部机构
+      organizationList: Array,
+      // 机构id
+      organizationId: [Number, String]
+    },
+    data() {
+      const defaultForm = {
+        id: null,
+        groupId: null,
+        name: '',
+        sex: null,
+        email: '',
+        phone: '',
+        age: '',
+        accountId: ''
+      };
+      return {
+        defaultForm,
+        // 表单数据
+        form: { ...defaultForm },
+        // 表单验证规则
+        rules: {
+          name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
+          sex: [{ required: true, message: '请选择性别', trigger: 'blur' }],
+          email: [
+            { pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
+          ],
+          phone: [
+            { pattern: phoneReg, message: '手机号格式不正确', trigger: 'blur' }
+          ],
+          jobNumber: [
+            {
+              required: true,
+              trigger: 'blur',
+              validator: (_rule, value, callback) => {
+                if (!value) {
+                  return callback(new Error('请输入工号'));
+                }
+                checkExistence(this.form.jobNumber)
+                  .then((res) => {
+                    if (res != true && res != this.form.id) {
+                      callback(new Error('工号已经存在'));
+                    } else {
+                      callback();
+                    }
+                  })
+                  .catch(() => {
+                    callback();
+                  });
+              }
+            }
+          ],
+          status: [
+            { required: true, message: '请选择员工状态', trigger: 'blur' }
+          ]
+        },
+        // 提交状态
+        loading: false,
+        // 是否是修改
+        isUpdate: false,
+        city: '',
+        statusOptions: [
+          { value: 1, label: '全职' },
+          { value: 2, label: '兼职' },
+          { value: 3, label: '实习' },
+          { value: 4, label: '正式' },
+          { value: 5, label: '试用' },
+          { value: 6, label: '离职' }
+        ],
+        accountList: []
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      getAccountList() {
+        getNotBoundAccount().then((res) => {
+          this.accountList = res;
+        });
+      },
+      /* 保存编辑 */
+      save() {
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
+          }
+          this.loading = true;
+          this.form.addressId = this.city
+            ? this.city[this.city.length - 1]
+            : '';
+          const data = {
+            ...this.form
+          };
+          if (!this.isUpdate) {
+            delete data.id;
+          }
+          saveOrUpdateUser(data)
+            .then((msg) => {
+              this.loading = false;
+              if (this.isUpdate) {
+                this.$message.success('人员信息编辑成功');
+              } else {
+                this.$message.success('人员新增成功');
+              }
+              this.updateVisible(false);
+              this.$emit('done');
+            })
+            .catch((e) => {
+              this.loading = false;
+              // this.$message.error(e.message);
+            });
+        });
+      },
+      /* 更新visible */
+      updateVisible(value) {
+        this.$emit('update:visible', value);
+      }
+    },
+    watch: {
+      visible(visible) {
+        if (visible) {
+          this.getAccountList();
+          if (this.data) {
+            getUserDetail(this.data.id).then((res) => {
+              this.form = { ...res };
+              this.city = res.addressId ? res.addressId.toString() : null;
+              this.isUpdate = true;
+            });
+            // this.$util.assignObject(this.form, {
+            //   ...this.data,
+            //   password: ''
+            // });
+            // this.form = {...this.data}
+            // this.form.address = ["130000","130300","130304"]
+            // this.form.address = "130304"
+            // console.log('this.form',this.form)
+          } else {
+            this.city = null;
+            this.form.groupId = this.organizationId;
+            this.isUpdate = false;
+          }
+        } else {
+          this.city = null;
+          this.$refs.form.clearValidate();
+          this.form = { ...this.defaultForm };
+        }
+      }
+    }
+  };
+</script>

+ 227 - 0
src/components/select/organization/components/org-user-list.vue

@@ -0,0 +1,227 @@
+<template>
+  <div>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      :toolbar="false"
+      @row-click="rowClick"
+      height="calc(100vh - 265px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      cache-key="systemOrgUserTable"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar> </template>
+      <!-- 角色列 -->
+      <template v-slot:roles="{ row }">
+        <el-tag
+          v-for="item in row.roles"
+          :key="item.roleId"
+          type="primary"
+          size="mini"
+          :disable-transitions="true"
+        >
+          {{ item.roleName }}
+        </el-tag>
+      </template>
+    </ele-pro-table>
+    <!-- 编辑弹窗 -->
+    <org-user-edit
+      :data="current"
+      :visible.sync="showEdit"
+      :organization-list="organizationList"
+      :organization-id="organizationId"
+      @done="reload"
+    />
+  </div>
+</template>
+
+<script>
+  import OrgUserSearch from './org-user-search.vue';
+  import OrgUserEdit from './org-user-edit.vue';
+  import {
+    getUserPage,
+    removePersonnel,
+    unbindLoginName
+  } from '@/api/system/organization';
+
+  export default {
+    components: { OrgUserSearch, OrgUserEdit },
+    props: {
+      // 机构id
+      organizationId: [Number, String],
+      // 全部机构
+      organizationList: Array
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            label: '姓名',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'jobNumber',
+            label: '工号',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'loginName',
+            label: '用户账号',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'sex',
+            label: '性别',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 80,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue == 1 ? '男' : cellValue == 2 ? '女' : '';
+            }
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            sortable: 'custom',
+            width: 80,
+            formatter: (_row, _column, cellValue) => {
+              const dom = this.statusOptions.find((item) => {
+                return item.value == cellValue;
+              });
+              return dom ? dom.label : '';
+            }
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          }
+        ],
+        // 当前编辑数据
+        current: null,
+
+        selectedRecords: [],
+        // 是否显示编辑弹窗
+        showEdit: false,
+        statusOptions: [
+          { value: 1, label: '全职' },
+          { value: 2, label: '兼职' },
+          { value: 3, label: '实习' },
+          { value: 4, label: '正式' },
+          { value: 5, label: '试用' },
+          { value: 6, label: '离职' }
+        ]
+      };
+    },
+    methods: {
+      rowClick(row) {
+        // let arr = this.selectedRecords;
+        let index = this.selectedRecords.findIndex(
+          (item) => item.id === row.id
+        );
+        if (index < 0) {
+          console.log('push');
+          this.selectedRecords.push(row);
+        } else {
+          console.log('remove');
+          this.selectedRecords.splice(index, 1);
+        }
+        console.log(this.selectedRecords);
+        this.$emit('changeList', this.selectedRecords);
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getUserPage({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          groupId: this.organizationId
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+      /* 显示编辑 */
+      openEdit(row) {
+        this.current = row;
+        this.showEdit = true;
+      },
+
+      // 解除绑定
+      toUnBind(row) {
+        const loading = this.$loading({ lock: true });
+        unbindLoginName(row.id)
+          .then((res) => {
+            loading.close();
+            this.$message.success('解绑成功');
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            // this.$message.error(e.message);
+          });
+      },
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+        removePersonnel([row.id])
+          .then((msg) => {
+            loading.close();
+            this.$message.success(msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            // this.$message.error(e.message);
+          });
+      },
+      /* 更改状态 */
+      editStatus(row) {
+        const loading = this.$loading({ lock: true });
+        updateUserStatus(row.userId, row.status)
+          .then((msg) => {
+            loading.close();
+            this.$message.success(msg);
+          })
+          .catch((e) => {
+            loading.close();
+            row.status = !row.status ? 1 : 0;
+            // this.$message.error(e.message);
+          });
+      }
+    },
+    watch: {
+      // 监听机构id变化
+      organizationId() {
+        this.reload();
+      }
+    }
+  };
+</script>

+ 79 - 0
src/components/select/organization/components/org-user-search.vue

@@ -0,0 +1,79 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    size="small"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model="where.loginName"
+            placeholder="请输入用户账号"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model="where.name"
+            placeholder="请输入姓名"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
+        <el-form-item>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <slot></slot>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        loginName: '',
+        name: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 166 - 0
src/components/select/organization/index.vue

@@ -0,0 +1,166 @@
+<template>
+  <div>
+    <el-card shadow="never" v-loading="loading">
+      <org-user-search @search="reload" style="margin-left: 280px">
+      </org-user-search>
+
+      <ele-split-layout
+        width="266px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <!-- 操作按钮 -->
+
+          <div class="ele-border-lighter sys-organization-list">
+            <el-tree
+              ref="tree"
+              :data="data"
+              highlight-current
+              node-key="id"
+              :props="{ label: 'name' }"
+              :expand-on-click-node="false"
+              :default-expand-all="true"
+              @node-click="onNodeClick"
+            />
+          </div>
+        </div>
+        <template v-slot:content>
+          <org-user-list
+            ref="userList"
+            v-if="current"
+            :organization-list="data"
+            :organization-id="current.id"
+            @changeList="changeList"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
+    <!-- 编辑弹窗 -->
+    <org-edit
+      :visible.sync="showEdit"
+      :data="editData"
+      :parent-id="parentId"
+      :organization-list="data"
+      @done="query"
+    />
+  </div>
+</template>
+
+<script>
+  import OrgUserSearch from './components/org-user-search.vue';
+
+  import OrgUserList from './components/org-user-list.vue';
+  import OrgEdit from './components/org-edit.vue';
+  import {
+    listOrganizations,
+    removeOrganization
+  } from '@/api/system/organization';
+
+  export default {
+    name: 'SystemOrganization',
+    components: { OrgUserList, OrgEdit, OrgUserSearch },
+    data() {
+      return {
+        // 加载状态
+        loading: true,
+        // 列表数据
+        data: [],
+        // 选中数据
+
+        current: null,
+        // 是否显示表单弹窗
+        showEdit: false,
+        // 编辑回显数据
+        editData: null,
+        // 上级id
+        parentId: null
+      };
+    },
+    created() {
+      this.query();
+    },
+    methods: {
+      changeList(arr) {
+        this.$emit('changeList', arr);
+      },
+      reload(where) {
+        this.$refs.userList.reload(where);
+      },
+      /* 查询 */
+      query() {
+        this.loading = true;
+        listOrganizations()
+          .then((list) => {
+            this.loading = false;
+            this.data = this.$util.toTreeData({
+              data: list,
+              idField: 'id',
+              parentIdField: 'parentId'
+            });
+            this.$nextTick(() => {
+              this.onNodeClick(this.data[0]);
+            });
+          })
+          .catch((e) => {
+            this.loading = false;
+            // this.$message.error(e.message);
+          });
+      },
+      /* 选择数据 */
+      onNodeClick(row) {
+        if (row) {
+          this.current = row;
+          this.parentId = row.id;
+          this.$refs.tree.setCurrentKey(row.id);
+        } else {
+          this.current = null;
+          this.parentId = null;
+        }
+      },
+      /* 显示编辑 */
+      openEdit(item) {
+        this.editData = item;
+        this.showEdit = true;
+      },
+      /* 删除 */
+      remove() {
+        this.$confirm('确定要删除选中的机构吗?', '提示', {
+          type: 'warning'
+        })
+          .then(() => {
+            const loading = this.$loading({ lock: true });
+            removeOrganization([this.current.id])
+              .then((msg) => {
+                loading.close();
+                this.$message.success(msg);
+                this.query();
+              })
+              .catch((e) => {
+                loading.close();
+                // this.$message.error(e.message);
+              });
+          })
+          .catch(() => {});
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

+ 175 - 0
src/views/flowable/components/StartProcess.vue

@@ -0,0 +1,175 @@
+<template>
+  <el-dialog
+    title="发起流程"
+    :visible.sync="dialogStartProcessVisibleInChild"
+    :fullscreen="false"
+  >
+    <div v-if="generateStartFormVisible">
+      <form-parser :data="startFormJson" ref="generateStartForm"> </form-parser>
+    </div>
+    <select-user
+      ref="selectUser"
+      :visible.sync="selectUserVisible"
+      :appendToBody="true"
+      :multipleSelect="true"
+      @selectUserFinished="selectUserFinished"
+    ></select-user>
+    <div slot="footer" class="dialog-footer">
+      <el-form label-width="100px">
+        <el-form-item label="业务主键Key:" v-if="showBusinessKey">
+          <el-input v-model="businessKey" placeholder="请输入业务主键Key" />
+        </el-form-item>
+        <el-form-item label="抄送给:">
+          <el-row align="left">
+            <el-col :span="1" align="left">
+              <i
+                class="el-icon-plus el-icon--left"
+                style="cursor: pointer"
+                @click="doSelectCcTo"
+              ></i>
+            </el-col>
+            <el-col :span="23" align="left">
+              <el-tag
+                v-for="tag in ccToVos"
+                :key="tag.userId"
+                effect="plain"
+                closable
+                @close="handleCcToClose(tag)"
+                style="margin-left: 5px"
+                >{{ tag.name }}
+              </el-tag>
+            </el-col>
+          </el-row>
+        </el-form-item>
+      </el-form>
+      <el-button
+        icon="el-icon-close"
+        @click="dialogStartProcessVisibleInChild = false"
+        >取消</el-button
+      >
+      <el-button icon="el-icon-close" @click="reset">重置</el-button>
+      <el-button icon="el-icon-check" type="primary" @click="doStartInstance"
+        >确定
+      </el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import { getAction, postAction } from '@/api/flowable/manage';
+  import { Message } from 'element-ui';
+  import SelectUser from '@/components/select/SelectUser';
+  //   import FormParser from '@/views/flowable/form/FormParser';
+
+  export default {
+    name: 'StartProcess',
+    components: { SelectUser },
+    props: {
+      visible: {
+        type: Boolean,
+        default: function () {
+          return false;
+        }
+      },
+      processDefinition: {
+        type: Object,
+        default: function () {
+          return {};
+        }
+      }
+    },
+    computed: {
+      dialogStartProcessVisibleInChild: {
+        get() {
+          return this.visible;
+        },
+        set(val) {
+          this.$emit('update:visible', val);
+        }
+      }
+    },
+    data() {
+      return {
+        // fullscreen: true,
+        generateStartFormVisible: false,
+        startFormJson: undefined,
+        variables: undefined,
+        showBusinessKey: false,
+        businessKey: undefined,
+        selectUserVisible: false,
+        ccToVos: []
+      };
+    },
+    created() {
+      this.initData();
+    },
+    methods: {
+      initData() {
+        getAction('/flowable/processDefinition/renderedStartForm', {
+          processDefinitionId: this.processDefinition.id
+        }).then((res) => {
+          const { data } = res;
+          this.showBusinessKey = data.showBusinessKey;
+          if (data.renderedStartForm) {
+            this.startFormJson = JSON.parse(data.renderedStartForm);
+            this.generateStartFormVisible = true;
+          }
+        });
+      },
+      doSelectCcTo() {
+        this.selectUserVisible = true;
+        // if (this.$refs.selectUser.treeData.length == 0) {
+        //   this.$refs.selectUser.getTreeData();
+        // }
+      },
+      selectUserFinished(selectData) {
+        if (!selectData || selectData.length == 0) {
+          Message.error('请先选择用户');
+          return;
+        }
+        this.ccToVos = selectData;
+      },
+      handleCcToClose(tag) {
+        this.ccToVos.splice(this.ccToVos.indexOf(tag), 1);
+      },
+      doStartInstance() {
+        if (this.$refs.generateStartForm) {
+          this.$refs.generateStartForm
+            .getData()
+            .then((values) => {
+              if (values && values != undefined) {
+                let processInstanceFormData = JSON.stringify(values);
+                let realValues = Object.assign(
+                  { processInstanceFormData },
+                  values
+                );
+                return postAction('/flowable/processInstance/start', {
+                  processDefinitionId: this.processDefinition.id,
+                  businessKey: this.businessKey,
+                  values: realValues,
+                  ccToVos: this.ccToVos
+                }).then(({ msg }) => {
+                  Message.success(msg);
+                  this.dialogStartProcessVisibleInChild = false;
+                });
+              }
+            })
+            .catch((e) => {});
+        } else {
+          postAction('/flowable/processInstance/start', {
+            processDefinitionId: this.processDefinition.id,
+            businessKey: this.businessKey,
+            ccToVos: this.ccToVos
+          }).then(({ msg }) => {
+            Message.success(msg);
+            this.dialogStartProcessVisibleInChild = false;
+          });
+        }
+      },
+      reset() {
+        this.$refs.generateStartForm.resetFields();
+        this.ccToVos = [];
+      }
+    }
+  };
+</script>

+ 7 - 6
src/views/flowable/form/edit.vue

@@ -40,7 +40,8 @@
           return;
         }
         getAction('/flowable/form/queryById', { id: this.formKey }).then(
-          ({ data }) => {
+          (res) => {
+            let { data } = res.data;
             this.formData = data;
             let json = this.formData?.formJson;
             setTimeout(
@@ -57,11 +58,11 @@
         this.formData.formJson = JSON.stringify(
           this.$refs.formDesign.getJSON()
         );
-        putAction('/flowable/form/update', this.formData).then(
-          ({ msg, data }) => {
-            Message.success(msg);
-          }
-        );
+        console.log(this.formData, 88888888);
+
+        putAction('/flowable/form/update', this.formData).then(({ data }) => {
+          Message.success(data.message);
+        });
       }
     }
   };

+ 175 - 0
src/views/flowable/startMyProcess/index.vue

@@ -0,0 +1,175 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.processDefinitionName"
+        placeholder="流程定义名称"
+        style="width: 200px"
+        class="filter-item"
+        @keyup.enter.native="btnQuery"
+      />
+
+      <el-dropdown
+        split-button
+        type="primary"
+        @click="btnQuery"
+        class="filter-item"
+      >
+        <i class="el-icon-search el-icon--left"></i>查询
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item icon="el-icon-zoom-out" @click.native="btnReset"
+            >重置</el-dropdown-item
+          >
+        </el-dropdown-menu>
+      </el-dropdown>
+    </div>
+
+    <el-row>
+      <el-col :span="12" v-for="row in records" :key="row.name">
+        <div
+          class="filter-container"
+          style="margin-right: 3px; margin-bottom: 3px"
+        >
+          <el-card>
+            <div slot="header" class="clearfix">
+              <span>{{ row.name }}-v{{ row.version }}</span>
+              <div style="position: relative; text-align: right">
+                <el-button type="primary" size="mini" @click="btnImage(row.id)"
+                  >流程图</el-button
+                >
+                <el-button
+                  type="primary"
+                  size="mini"
+                  @click="btnStartInstance(row)"
+                  >发起流程
+                </el-button>
+              </div>
+            </div>
+            <div class="text item">
+              {{ row.description ? row.description : '无描述' }}
+            </div>
+            <div class="text item">
+              {{ row.category ? row.category : '无命名空间' }}
+            </div>
+          </el-card>
+        </div>
+      </el-col>
+    </el-row>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :current.sync="listQuery.current"
+      :size.sync="listQuery.size"
+      @pagination="list"
+    />
+
+    <el-dialog
+      title="流程图"
+      fullscreen
+      :visible.sync="dialogImageVisible"
+      width="80%"
+    >
+      <img :src="imagePath" alt="流程图" />
+    </el-dialog>
+
+    <start-process
+      v-if="dialogStartInstanceVisible"
+      :visible.sync="dialogStartInstanceVisible"
+      :processDefinition="processDefinition"
+    ></start-process>
+  </div>
+</template>
+
+<script>
+  import Pagination from '@/components/Pagination';
+  import {
+    deleteAction,
+    getAction,
+    postAction,
+    putAction
+  } from '@/api/flowable/manage';
+  import { Message } from 'element-ui';
+  import { getToken } from '@/utils/token-util';
+  import StartProcess from '../components/StartProcess';
+
+  export default {
+    name: 'FlowableStartMyProcess',
+    components: { StartProcess, Pagination },
+    data() {
+      return {
+        dicts: [],
+        records: null,
+        selectedRecords: [],
+        total: 0,
+        listQuery: {
+          current: 1,
+          size: 10,
+          processDefinitionId: undefined,
+          processDefinitionName: undefined,
+          processDefinitionKey: undefined,
+          latestVersion: true,
+          suspended: undefined
+        },
+        dialogFormVisible: false,
+        dialogImportVisible: false,
+        dialogImageVisible: false,
+        imagePath: '',
+        dialogStartInstanceVisible: false,
+        formJson: undefined,
+        dialogProcessDefinitionIdentityLinkVisible: false,
+        selectedProcessDefinitionId: '',
+        selectedProcessDefinitionName: '',
+        processDefinition: undefined
+      };
+    },
+    created() {
+      this.list();
+    },
+    methods: {
+      list() {
+        getAction(
+          '/flowable/processDefinition/listMyself',
+          this.listQuery
+        ).then((res) => {
+          const { data } = res.data;
+          this.records = data.records;
+          this.total = data.total;
+          if (data.total == 0) {
+            Message.info('暂无可发起的流程');
+          }
+        });
+      },
+      btnQuery() {
+        this.listQuery.current = 1;
+        this.list();
+      },
+      btnReset() {
+        this.listQuery = {
+          current: 1,
+          size: 10,
+          processDefinitionId: undefined,
+          processDefinitionName: undefined,
+          processDefinitionKey: undefined,
+          latestVersion: true,
+          suspended: undefined
+        };
+        this.list();
+      },
+      btnImage(processDefinitionId) {
+        this.imagePath =
+          `${process.env.VUE_APP_BASE_API}` +
+          '/flowable/processDefinition/image?processDefinitionId=' +
+          processDefinitionId +
+          '&access_token=' +
+          getToken() +
+          '&time=' +
+          new Date();
+        this.dialogImageVisible = true;
+      },
+      btnStartInstance(row) {
+        this.processDefinition = row;
+        this.dialogStartInstanceVisible = true;
+      }
+    }
+  };
+</script>

+ 0 - 1
src/views/system/role/index.vue

@@ -132,7 +132,6 @@
             prop: 'groupId',
             label: '组织ID',
             align: 'center',
-
             showOverflowTooltip: true,
             minWidth: 110
           },

+ 3 - 3
vue.config.js

@@ -22,10 +22,10 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.3.51:86', // 测试
 
-        // target: 'http://192.168.3.35:8080', // kang杨威
+        target: 'http://192.168.3.35:8080', // kang杨威
         // target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏
-        target: 'http://192.168.3.33:8080', // 谢一平
+        // target: 'http://192.168.3.33:8080', // 谢一平
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
@@ -34,7 +34,7 @@ module.exports = {
       }
     }
   },
-  chainWebpack (config) {
+  chainWebpack(config) {
     config.plugins.delete('prefetch');
     // set svg-sprite-loader
     // config.module.rule('svg').exclude.add(resolve('./src/icons')).end();