田源
2024-06-27 56bdc677d717f8f1d8ff6ff4c87e733d1206e8be
用户停用启用 分配角色穿梭框功能 创建其他人员组织菜单 表格优化
已修改3个文件
已删除2个文件
已重命名1个文件
已添加7个文件
664 ■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/api/base/startWork/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/system/user/api.js 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/user/userManageApi.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/transfer.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/startWorkFlow.vue 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/system/department.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/main.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/department/index.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/password/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/role/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/user/index.vue 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/user/option.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/user/userManage.vue 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/base/startWork/index.js
@@ -9,3 +9,12 @@
    params: params,
  });
}
//获取流程模板中的所有任务节点信息
export const getAllProcessNode = (params) => {
  return request({
    url: '/api/processDefineController/getAllProcessNode',
    method: 'get',
    params: params,
  });
}
Source/plt-web/plt-web-ui/src/api/system/user/api.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,81 @@
import request from '@/router/axios';
// åˆ—表查询
export function getDataUsers(page,limit,params) {
  return request({
    url: "/api/userQueryController/getDataGridUsers",
    method: "get",
    params:{
      page,
      limit,
      ...params
    }
  });
}
// åœç”¨å¯ç”¨
export function stopUser(params) {
  return request({
    url: "/api/userQueryController/stopUsers",
    method: "post",
    params
  });
}
// è§’色全查询
export function gridRoles(page,limit) {
  return request({
    url: "/api/roleQueryController/gridRoles",
    method: "get",
    params:{
      page,limit
    }
  });
}
// æŸ¥è¯¢å½“前用户已拥有的角色
export function listRoleByUserOid(userOid) {
  return request({
    url: "/api/roleQueryController/listRoleByUserOid",
    method: "get",
    params:{
      userOid
    }
  });
}
// ä¿å­˜è§’色
export function saveRights(params) {
  return request({
    url: "/api/roleQueryController/saveRights",
    method: "post",
    params
  });
}
// æ–°å¢žæˆå‘˜
export function addUser(data) {
  return request({
    url: "/api/roleQueryController/addUser",
    method: "post",
    data:data
  });
}
// ä¿®æ”¹æˆå‘˜
export function updateUser(data) {
  return request({
    url: "/api/roleQueryController/updateUser",
    method: "post",
    data:data
  });
}
// åˆ é™¤æˆå‘˜
export function deleteUser(params) {
  return request({
    url: "/api/roleQueryController/deleteUser",
    method: "delete",
    params
  });
}
Source/plt-web/plt-web-ui/src/api/user/userManageApi.js
ÎļþÒÑɾ³ý
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/transfer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,92 @@
<template>
    <el-dialog
      v-dialogDrag
      :close-on-click-modal="false"
      :destroy-on-close="true"
      :title="title"
      :visible.sync="visible"
      append-to-body="true"
      class="avue-dialog"
      style="text-align: center"
      width="40%"
      @close="dialogClose">
      <el-transfer
        v-model="rightRoleData"
        v-loading="loading"
        :data="data"
        :filter-method="filterMethod"
        :render-content="renderFunc"
        :titles="['现有角色', '拥有角色']"
        filter-placeholder="角色名称搜索"
        filterable
        style="text-align: left; display: inline-block;">
      </el-transfer>
      <span slot="footer" class="dialog-footer">
    <el-button @click="visible = false">取 æ¶ˆ</el-button>
    <el-button type="primary" @click="sendHandler">ç¡® å®š</el-button>
  </span>
    </el-dialog>
</template>
<script>
export default {
  name: "transfer",
  props: ['title', 'leftRoleData', 'rightRoleData'],
  data() {
    return {
      visible: false, // é€šè¿‡ this.$refs.transfer.visible = true; å¼€å¯å­ç»„件对话框
      data: [],
      value: [],
      loading: false,
      filterMethod(query, item) {
        return item.label.indexOf(query) > -1;
      },
      renderFunc(h, option) {
        return <span><i class="el-icon-s-custom"></i> { option.label }</span>;
      }
    }
  },
  watch: {
    //渲染穿梭框
    leftRoleData: {
      handler(newval, oldval) {
        if (newval) {
          // æ¸…空data数组
          this.data = [];
          newval.forEach((city, index) => {
            this.data.push({
              label: city.name,
              key: city.oid,
            });
          });
          this.loading = false;
        }
      }
    },
  },
  created() {
    this.loading = true;
  },
  methods: {
    dialogClose() {
      this.visible = false;
      this.data = [];
      this.leftRoleData = [];
    },
    sendHandler() {
      this.$emit('transferSend', this.rightRoleData);
      this.visible = false;
    },
  }
}
</script>
<style lang="scss" scoped>
/deep/ .el-transfer-panel{ /* å·¦å³ä¸¤ä¸ªç©¿æ¢­æ¡†çš„高度和宽度 */
  height: 450px;
}
/deep/ .el-transfer-panel__list.is-filterable {
  height: 323px; /* ç©¿æ¢­æ¡†åˆ—表高度 */
}
</style>
Source/plt-web/plt-web-ui/src/components/actions/base/startWorkFlow.vue
@@ -1,14 +1,14 @@
<template>
  <el-dialog v-dialogDrag
             append-to-body="true"
             :close-on-click-modal="false"
             :destroy-on-close="true"
             :visible.sync="visible"
             :width="width"
             append-to-body="true"
             class="avue-dialog"
             style="margin-top: -10% !important;"
             title="启动流程"
             top="0"
             style="margin-top: -10% !important;"
             @close="dialogClose">
    <el-form :model="saveParam" :rules="rules" class="demo-form-inline" label-position="left" label-width="auto">
@@ -26,15 +26,15 @@
    </el-form>
    <el-divider></el-divider>
<!--    <div class="btns-icon">-->
<!--      <el-button circle icon="el-icon-star-off" @click="handleCollect"></el-button>-->
<!--    </div>-->
    <!--    <div class="btns-icon">-->
    <!--      <el-button circle icon="el-icon-star-off" @click="handleCollect"></el-button>-->
    <!--    </div>-->
    <el-form :model="collectParam" class="demo-form-inline" label-position="left" label-width="auto">
      <el-form-item v-for="(item, index) in initFrom" :key="index" :label="item.taskName">
        <el-select v-model="collectParam.flowTaskUsers[index]['userId']" :placeholder="item.taskName" filterable
                   style="width: 100%;" @change="handleSelect($event, index)">
          <el-option v-for="(key, keyi) in typeName" :key="keyi" :label="key.userNames"
                     :value="key.userId"></el-option>
      <el-form-item v-for="(item, index) in initFrom" :key="index" :label="`节点${index + 1}`">
        <el-select style="width: 100%;" filterable v-model="collectParam.flowTaskUsers[index]['userId']"
                   :placeholder="item.value" @change="handleSelect($event, index)">
          <el-option :label="key.name" :value="key.name" v-for="(key, keyi) in item.processNodes"
                     :key="keyi"></el-option>
        </el-select>
      </el-form-item>
    </el-form>
@@ -48,7 +48,8 @@
<script>
import {validatenull} from "@/util/validate";
import {getTemplateByType} from "@/api/base/startWork/index"
import {getTemplateByType, getAllProcessNode} from "@/api/base/startWork/index"
export default {
  name: "startWorkFlow",
  props: {
@@ -76,8 +77,8 @@
      typeName: [], // æµç¨‹èŠ‚ç‚¹option循环选项
      rules: {
        processName: [
          { required: true, message: '流程名称不能为空', trigger: 'blur' },
          { min: 3, max: 50, message: '长度在 3 åˆ° 50 ä¸ªå­—符', trigger: 'blur' }
          {required: true, message: '流程名称不能为空', trigger: 'blur'},
          {min: 3, max: 50, message: '长度在 3 åˆ° 50 ä¸ªå­—符', trigger: 'blur'}
        ]
      }
    }
@@ -92,7 +93,7 @@
    },
    parameter: {
      handler(newval, oldval) {
        this.saveParam = Object.assign({processName: '', processDesc: '' , }, newval);
        this.saveParam = Object.assign({processName: '', processDesc: '',}, newval);
      },
      deep: true,
      immediate: true
@@ -127,15 +128,36 @@
  },
  methods: {
    // èŽ·å–æµç¨‹æ¨¡æ¿ä¿¡æ¯
    getWorkByType(){
    getWorkByType() {
      let params = {
        type:'文档审签流程',
        filterTemplate:""
        type: '文档审签流程',
        filterTemplate: ""
      }
      getTemplateByType(params).then(res => {
        console.log(res)
        const data = res.data.data;
        data.forEach(item => {
          this.getProcessNode(item);
        })
        this.initFrom = data;
      }).catch(error => {
        console.log(error);
      })
    },
    // è¯·æ±‚流程节点
    getProcessNode(item) {
      let params = {
        processOid: item.attributes.oid,
        maxSecret: -1
      }
      getAllProcessNode(params).then(res => {
        const nodes = res.data.data;
        item.processNodes = nodes;
      }).catch(error => {
        console.log(error);
      })
    },
    // å…³é—­å¼¹çª—
    dialogClose() {
      this.visible = false;
@@ -154,11 +176,11 @@
    },
    handleConfirm() {
      console.log(this.paramVOS)
      console.log(this.initFrom);
    },
  //  æµç¨‹åç§°åˆå§‹åŒ–绑定
    modelNameChange(){
    //  æµç¨‹åç§°åˆå§‹åŒ–绑定
    modelNameChange() {
      var userInfo = JSON.parse(localStorage.getItem('saber-userInfo'));
      if (this.paramVOS && this.paramVOS.modelName) {
@@ -173,6 +195,6 @@
}
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
</style>
Source/plt-web/plt-web-ui/src/components/system/department.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "department"
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/main.js
@@ -42,6 +42,8 @@
import UploadFiles from  '@/components/PLT-basic-component/Upload-files'
// è¡¨å•上传文件组件
import formUpload from "@/components/PLT-basic-component/formUpload";
// ç©¿æ¢­æ¡†ç»„ä»¶
import transfer from "@/components/PLT-basic-component/transfer";
// æ³¨å†Œå…¨å±€å®¹å™¨
Vue.component('basicContainer', basicContainer);
Vue.component('basicBlock', basicBlock);
@@ -57,6 +59,7 @@
Vue.component('UploadFiles', UploadFiles);
Vue.component('formUpload', formUpload);
Vue.component('Divider', Divider);
Vue.component('transfer', transfer);
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
Source/plt-web/plt-web-ui/src/views/system/department/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
<template>
  <basic-container>
  </basic-container>
</template>
<script>
export default {
  name: "departmentManage",
  data() {
    return {
    }
  },
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/views/system/password/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
  name: "index"
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/views/system/role/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "index"
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/views/system/user/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,202 @@
<template>
  <basic-container>
    <avue-crud
      ref="userCrud"
      :data="tableData"
      :option="option"
      :page.sync="page"
      :table-loading="tableLoading"
      @on-load="getTableList"
      @refresh-change="handleRefresh"
      @search-change="handleSearch"
      @search-reset="handleReset"
      @size-change="sizeChange"
      @current-change="currentChange"
      @selection-change="selectChange"
      @row-click="rowClickHandler"
    >
      <template slot="status" slot-scope="{row}">
        <el-tag v-if="row.status === 0" type="success">启用</el-tag>
        <el-tag v-if="row.status === 1" type="danger">停用</el-tag>
      </template>
      <template slot="lockFlag" slot-scope="{row}">
        <el-tag v-if="!row.lockFlag" type="success">未锁定</el-tag>
        <el-tag v-if="row.lockFlag" type="danger">锁定</el-tag>
      </template>
      <template #menu="{row,index,size}">
        <el-button size="small" type="text" @click="stopUserHandler(row)">
          <span v-if="row.status === 0" style="color: #fa3434"><i class="el-icon-video-pause"></i> åœç”¨</span>
          <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-pause"></i> å¯ç”¨</span>
        </el-button>
      </template>
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-delete" plain size="small" type="danger">删除</el-button>
        <el-button icon="el-icon-user" plain size="small" type="primary" @click="roleHandler">分配角色</el-button>
        <el-button icon="el-icon-school" plain size="small" type="primary">分配部门</el-button>
        <el-button icon="el-icon-key" plain size="small" type="success">设置密码策略</el-button>
        <el-button icon="el-icon-upload2" plain size="small" type="primary">导入人员</el-button>
        <el-button icon="el-icon-download" plain size="small" type="primary">下载导入模板</el-button>
      </template>
    </avue-crud>
    <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData" title="分配角色"
              @transferSend="roleSendHandler"></transfer>
  </basic-container>
</template>
<script>
import basicOption from '@/util/basic-option'
import {getDataUsers, stopUser, gridRoles, listRoleByUserOid, saveRights, addUser, updateUser, deleteUser} from '@/api/system/user/api'
import {column} from "./option"
import func from '@/util/func'
export default {
  name: "userManage",
  data() {
    return {
      tableLoading: false,
      tableData: [],
      option: {
        ...basicOption,
        calcHeight: -60,
        column: column
      },
      page: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
        pageSizes: [10, 30, 50, 100],
      },
      searchParams: {},
      selectList: [],
      leftRoleData: [],  // åˆ†é…è§’色穿梭框左侧默认数据
      rightRoleData: [], // åˆ†é…è§’色穿梭框右侧默认数据
    }
  },
  created() {
  },
  methods: {
    // è¡¨æ ¼è¯·æ±‚
    getTableList() {
      this.tableLoading = true;
      getDataUsers(this.page.currentPage, this.page.pageSize, this.searchParams).then(res => {
        const data = res.data.data;
        this.tableData = data;
        this.page.total = res.data.total;
        this.tableLoading = false;
      }).catch(err => {
        this.$message.error(err)
      });
    },
    // è¡¨æ ¼å³ä¾§åˆ·æ–°å›¾æ ‡
    handleRefresh() {
      this.getTableList();
    },
    // æœç´¢æŸ¥è¯¢
    handleSearch(params, done) {
      if (!func.isEmptyObject(params)) {
        for (let key in params) {
          if (params.hasOwnProperty(key)) {
            // åˆ¤æ–­å¦‚æžœ key æ˜¯ 'pkPersonName',则改为 'pkPerson' åˆ†åˆ«ä¸ºæ˜¾ç¤ºå€¼å’Œä¿å­˜å€¼
            let newKey = key === 'pkPersonName' ? 'pkPerson' : key;
            this.searchParams[`conditionMap["${newKey}"]`] = params[key];
          }
        }
      } else {
        this.searchParams = {};
      }
      this.getTableList();
      done();
    },
    // é‡ç½®æœç´¢æ¡ä»¶
    handleReset() {
      this.searchParams = {};
      this.getTableList();
    },
    // æ¡æ•°
    sizeChange(val) {
      this.page.pageSize = val;
    },
    // é¡µç 
    currentChange(val) {
      this.page.currentPage = val;
    },
    // åœç”¨å¯ç”¨
    stopUserHandler(row) {
      let params = {};
      params = {
        ids: row.oid,
        flag: row.status === 0 ? true : false
      }
      stopUser(params).then(res => {
        this.$message.success(res.data.obj);
        this.getTableList();
      }).catch(err => {
        this.$message.error(err)
      })
    },
    // é€‰æ‹©æ¡†
    selectChange(row) {
      this.selectList = row;
    },
    // ç‚¹å‡»è¡Œ
    rowClickHandler(row) {
      this.$refs.userCrud.toggleRowSelection(row);
    },
    // åˆ†é…è§’色
    roleHandler() {
      if (this.selectList.length > 1) {
        this.$message.warning('只能选择一条数据进行分配!');
        return;
      }
      if (this.selectList.length < 1) {
        this.$message.warning('至少选择一条数据进行分配!');
        return;
      }
      this.leftRoleData = [];
      this.rightRoleData = [];
      const userOid = this.selectList[0].oid;
      gridRoles(1, -1).then(res => {
        this.leftRoleData = res.data.data;
        listRoleByUserOid(userOid).then(res => {
          this.rightRoleData = res.data.data.map(item => item.oid);
        })
      }).catch(err => {
        this.$message.error(err)
      })
      this.$refs.transfer.visible = true;
    },
    // ç©¿æ¢­æ¡†ç»„件回填
    roleSendHandler(row) {
      let params = {
        userOid: this.selectList[0].oid,
        roleIds: row.join(',')
      }
      saveRights(params).then(res => {
        this.$message.success(res.data.obj);
        this.getTableList();
      }).catch(err => {
        this.$message.error(err)
      })
    }
  }
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/views/system/user/option.js
ÎļþÃû´Ó Source/plt-web/plt-web-ui/src/views/user/userManage.js ÐÞ¸Ä
@@ -52,7 +52,7 @@
    prop: 'pkPersonName',
    align:'center',
    type:'select',
    dicUrl: 'api/roleQueryController/refDataGrid',
    dicUrl: 'api/roleQueryController/gridRoles',
    props: {
      label: 'name',
      value: 'oid'
Source/plt-web/plt-web-ui/src/views/user/userManage.vue
ÎļþÒÑɾ³ý