田源
2024-06-26 0f8dc2f32547caa547dea9a7c06edac0192437d5
成员管理 搜索 分页 表格请求 启用停用
已修改3个文件
已重命名1个文件
已添加3个文件
371 ■■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/api/base/startWork/index.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/user/userManageApi.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/startWorkFlow.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/util/basic-option.js 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/util/func.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/user/userManage.js 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/user/userManage.vue 218 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/base/startWork/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
import request from '@/router/axios';
//获取流程模板信息
export const getTemplateByType = (params) => {
  return request({
    url: '/api/processDefineController/getTemplateByType',
    method: 'get',
    params: params,
  });
}
Source/plt-web/plt-web-ui/src/api/user/userManageApi.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
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(data) {
  return request({
    url: "/api/userQueryController/stopUser",
    method: "post",
    data:data
  });
}
Source/plt-web/plt-web-ui/src/components/actions/base/startWorkFlow.vue
@@ -48,7 +48,7 @@
<script>
import {validatenull} from "@/util/validate";
import {getTemplateByType} from "@/api/base/startWork/index"
export default {
  name: "startWorkFlow",
  props: {
@@ -119,10 +119,23 @@
      }
    },
  },
  mounted() {
  created() {
    this.modelNameChange();
    this.getWorkByType();
  },
  mounted() {
  },
  methods: {
    // èŽ·å–æµç¨‹æ¨¡æ¿ä¿¡æ¯
    getWorkByType(){
      let params = {
        type:'文档审签流程',
        filterTemplate:""
      }
      getTemplateByType(params).then(res => {
        console.log(res)
      })
    },
    // å…³é—­å¼¹çª—
    dialogClose() {
      this.visible = false;
@@ -151,7 +164,7 @@
      if (this.paramVOS && this.paramVOS.modelName) {
        this.saveParam.modelName = this.paramVOS.modelName;
      } else if (userInfo.content && userInfo.content.userName) {
        this.saveParam.modelName = userInfo.content.userName + '[启动流程]';
        this.saveParam.modelName = userInfo.content.userName + '启动流程';
      } else {
        this.saveParam.modelName = '';
      }
Source/plt-web/plt-web-ui/src/util/basic-option.js
Source/plt-web/plt-web-ui/src/util/func.js
@@ -39,6 +39,14 @@
  }
  /**
   * åˆ¤æ–­å¯¹è±¡ä¸ºç©º
   */
  static isEmptyObject(obj) {
    return Object.keys(obj).length === 0;
  }
  /**
   * å¼ºè½¬int型
   * @param val
   * @param defaultValue
Source/plt-web/plt-web-ui/src/views/user/userManage.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,92 @@
export const column = [
  {
    label: '姓名',
    prop: 'name',
    align:'center',
    search:true,
    sortable:true
  }, {
    label: '账号',
    prop: 'id',
    align:'center',
    search:true,
    sortable:true
  },
  {
    label: '状态',
    prop: 'status',
    align: 'center',
    display:false,
    sortable:true,
    slot: true,
  },
  {
    label: '密码策略',
    prop: 'pkPasswordStrategyName',
    sortable:true,
    display:false,
  },
  {
    label: '锁定状态',
    prop: 'lockFlag',
    align:'center',
    sortable:true,
    display:false,
  },
  {
    label: '所属部门',
    prop: 'pkDepartmentName',
    align:'center',
    search:true,
    sortable:true,
    searchslot:true,
  },
  {
    label: '专业',
    prop: 'specialties',
    align:'center',
    sortable:true,
  },
  {
    label: '角色',
    prop: 'pkPersonName',
    align:'center',
    type:'select',
    dicUrl: 'api/roleQueryController/refDataGrid',
    props: {
      label: 'name',
      value: 'oid'
    },
    search:true,
    overHidden: true,
    sortable:true,
    display:false,
  },
  {
    label: '电子邮件',
    prop: 'email',
    align:'center',
    sortable:true,
  },
  {
    label: '描述',
    type:'textarea',
    prop: 'description',
    align:'center',
    sortable:true,
  },
  {
    label: '部门领导',
    prop: 'isDeptLeader',
    align:'center',
    sortable:true,
    display:false,
  },
  {
    label: '所属密级',
    prop: 'secretGradeText',
    align:'center',
    sortable:true,
    display:false,
  }
];
Source/plt-web/plt-web-ui/src/views/user/userManage.vue
@@ -1,131 +1,123 @@
<template>
  <basic-container>
    <avue-crud :data="data"
               :option="option">
    <avue-crud
      :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"
    >
      <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 style="color: #fa3434" v-if="row.status === 0"><i class="el-icon-video-pause"></i> åœç”¨</span>
          <span style="color: #55b61d" v-if="row.status === 1"><i class="el-icon-video-pause"></i> å¯ç”¨</span>
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import basicOption from '@/option/user/basic-option'
import basicOption from '@/util/basic-option'
import {getDataUsers, stopUser} from '@/api/user/userManageApi'
import {column} from "./userManage"
import func from '@/util/func'
export default {
  name: "userManage",
  data() {
    return {
      data: [
        {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        },
        {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        },
        {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        }, {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        }
        , {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        }
        , {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        }
        , {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        }
        , {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        }
        , {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        }
        , {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        }
        , {
          id: 1,
          name: '张三',
          sex: '男'
        }, {
          id: 2,
          name: '李四',
          sex: '女'
        }
      ],
      tableLoading: false,
      tableData: [],
      option: {
        ...basicOption,
        column: [
          {
            label: '姓名',
            prop: 'name',
            search:true
          }, {
            label: '性别',
            prop: 'sex',
            search:true
        calcHeight: -60,
        column: column
      },
      page: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
        pageSizes: [10, 30, 50, 100],
      },
      searchParams: {},
    }
  },
  created() {
  },
  methods: {
    // è¡¨æ ¼è¯·æ±‚
    getTableList() {
      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;
      });
    },
    // è¡¨æ ¼å³ä¾§åˆ·æ–°å›¾æ ‡
    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 = {
        idList:row.oid,
        flag: row.status === 0 ? true : false
      }
      stopUser(params).then(res => {
        console.log(res)
      })
    }
  }