Merge branch 'dev'
Showing
15 changed files
with
0 additions
and
1734 deletions
| ... | @@ -26,7 +26,6 @@ | ... | @@ -26,7 +26,6 @@ |
| 26 | "AREARMAP": "610702", // {"610702","632701"} | 26 | "AREARMAP": "610702", // {"610702","632701"} |
| 27 | "calcHeight": 200, {上报:160 监管:200} | 27 | "calcHeight": 200, {上报:160 监管:200} |
| 28 | "echartTextColor": "#FFFFFF", {上报:"#4A4A4A" 监管:"#FFFFFF"} | 28 | "echartTextColor": "#FFFFFF", {上报:"#4A4A4A" 监管:"#FFFFFF"} |
| 29 | "MANAGEMENTAPI": "http://192.168.2.38:8090/management" | ||
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | ## 行政区编码 | 31 | ## 行政区编码 | ... | ... |
| ... | @@ -4,6 +4,5 @@ | ... | @@ -4,6 +4,5 @@ |
| 4 | "AREARMAP": "610702", | 4 | "AREARMAP": "610702", |
| 5 | "XZQ": "汉中市", | 5 | "XZQ": "汉中市", |
| 6 | "SERVERAPI": "/bdcsjsb", | 6 | "SERVERAPI": "/bdcsjsb", |
| 7 | "MANAGEMENTAPI": "http://192.168.2.38:8090/management", | ||
| 8 | "ip": "http://192.168.2.38" | 7 | "ip": "http://192.168.2.38" |
| 9 | } | 8 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
src/api/authorityManage.js
deleted
100644 → 0
| 1 | /* | ||
| 2 | * @Author: yangwei | ||
| 3 | * @Date: 2023-02-24 15:12:45 | ||
| 4 | * @LastEditors: yangwei | ||
| 5 | * @LastEditTime: 2023-03-14 10:45:11 | ||
| 6 | * @FilePath: \bdcjg-web\src\api\authorityManage.js | ||
| 7 | * @Description: | ||
| 8 | * | ||
| 9 | * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. | ||
| 10 | */ | ||
| 11 | |||
| 12 | import { getParams } from './util' | ||
| 13 | import { | ||
| 14 | api, | ||
| 15 | getAction, | ||
| 16 | deleteAction, | ||
| 17 | putAction | ||
| 18 | } from './manageApi' | ||
| 19 | /** 角色管理开始 */ | ||
| 20 | // 获取角色列表 by categoryId | ||
| 21 | export const getRolesById = categoryIdList => { | ||
| 22 | const conditionGroup = { | ||
| 23 | conditions: [ | ||
| 24 | { | ||
| 25 | property: 'category', | ||
| 26 | value: categoryIdList, | ||
| 27 | operator: 'IN' | ||
| 28 | } | ||
| 29 | ], | ||
| 30 | queryRelation: 'AND', | ||
| 31 | } | ||
| 32 | const params = getParams(conditionGroup) | ||
| 33 | return getAction(api.roles, params) | ||
| 34 | } | ||
| 35 | /** 角色管理结束 */ | ||
| 36 | /** 授权管理开始 */ | ||
| 37 | // 获取权限列表 | ||
| 38 | export const getAuthorityListAction = (productId, subsystemCode) => { | ||
| 39 | const conditionGroup = { | ||
| 40 | conditions: [ | ||
| 41 | { | ||
| 42 | property: 'productId', | ||
| 43 | value: productId, | ||
| 44 | operator: 'EQ' | ||
| 45 | }, | ||
| 46 | { | ||
| 47 | property: 'code', | ||
| 48 | value: subsystemCode + '_MENU', | ||
| 49 | operator: 'EQ' | ||
| 50 | } | ||
| 51 | ], | ||
| 52 | queryRelation: 'AND' | ||
| 53 | } | ||
| 54 | const params = getParams(conditionGroup) | ||
| 55 | return getAction(api.resourceCategory, params) | ||
| 56 | } | ||
| 57 | |||
| 58 | /** | ||
| 59 | * 获取角色的权限 id operationCodes resourceCategoryCode | ||
| 60 | * id 授权id | ||
| 61 | * operationCodes 操作符集合 | ||
| 62 | * resourceCategoryCode 菜单默认MENU | ||
| 63 | */ | ||
| 64 | export const getRoleAuthorityList = ( | ||
| 65 | id, | ||
| 66 | operationCodes, | ||
| 67 | resourceCategoryCode | ||
| 68 | ) => { | ||
| 69 | return getAction(`${api.rolePermissions}/${id}`, { | ||
| 70 | operationCodes: operationCodes, | ||
| 71 | resourceCategoryCode: resourceCategoryCode | ||
| 72 | }) | ||
| 73 | } | ||
| 74 | // 角色授权 | ||
| 75 | export const roleAuthority = (id, permissionDtos) => { | ||
| 76 | return putAction(`${api.rolePermissions}/${id}`, permissionDtos) | ||
| 77 | } | ||
| 78 | |||
| 79 | |||
| 80 | |||
| 81 | // 获取父级菜单 | ||
| 82 | // id是系统id | ||
| 83 | export const getParentMenuListAction = (id) => { | ||
| 84 | let conditionGroup = {} | ||
| 85 | if (id && id !== '') { | ||
| 86 | conditionGroup = { | ||
| 87 | conditions: [ | ||
| 88 | { | ||
| 89 | property: 'productId', | ||
| 90 | value: id, | ||
| 91 | operator: 'EQ' | ||
| 92 | } | ||
| 93 | ], | ||
| 94 | queryRelation: 'AND' | ||
| 95 | } | ||
| 96 | } | ||
| 97 | const params = getParams(conditionGroup) | ||
| 98 | return getAction(api.menus, params) | ||
| 99 | } | ||
| 100 |
src/api/login.js
deleted
100644 → 0
| 1 | /* | ||
| 2 | * @Description: | ||
| 3 | * @Autor: renchao | ||
| 4 | * @LastEditTime: 2023-05-08 15:03:10 | ||
| 5 | */ | ||
| 6 | import request from "@/utils/request"; | ||
| 7 | let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl')) | ||
| 8 | export function loginIn (username, password) { | ||
| 9 | return request({ | ||
| 10 | url: `${SERVER.MANAGEMENTAPI}/login?username=${username}&password=${password}`, | ||
| 11 | method: "post", | ||
| 12 | }); | ||
| 13 | } | ||
| 14 | export function logout () { | ||
| 15 | return request({ | ||
| 16 | url: `${SERVER.MANAGEMENTAPI}/logout`, | ||
| 17 | method: "post", | ||
| 18 | }); | ||
| 19 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/api/manageApi.js
deleted
100644 → 0
| 1 | /* | ||
| 2 | * @Description :公共方法api文件 | ||
| 3 | * @Autor : miaofang | ||
| 4 | * @LastEditTime : 2023-05-17 10:41:47 | ||
| 5 | */ | ||
| 6 | import request from '@/utils/request' | ||
| 7 | // let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl')) | ||
| 8 | let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl')) | ||
| 9 | const workflow = '/workflow' | ||
| 10 | const log = '/log' | ||
| 11 | const crud = '/crud' | ||
| 12 | export const api = { | ||
| 13 | userInfo: SERVER.MANAGEMENTAPI + '/rest/user-info', // 登录用户信息 | ||
| 14 | permissionsUser: SERVER.MANAGEMENTAPI + '/rest/user-permissions', // 用户权限 | ||
| 15 | baseDataCategory: SERVER.MANAGEMENTAPI + '/rest/base-data-category', // 数据字典类别 | ||
| 16 | baseData: SERVER.MANAGEMENTAPI + '/rest/base-data', // 数据字典 | ||
| 17 | districts: SERVER.MANAGEMENTAPI + '/rest/districts', // 行政区划 | ||
| 18 | districtsAll: SERVER.MANAGEMENTAPI + '/rest/districts/parent-tree', // 条件查询所有行政区划 | ||
| 19 | organizations: SERVER.MANAGEMENTAPI + '/rest/organizations', // 组织机构 | ||
| 20 | departments: SERVER.MANAGEMENTAPI + '/rest/departments', // 部门 | ||
| 21 | users: SERVER.MANAGEMENTAPI + '/rest/users', // 人员用户 | ||
| 22 | roles: SERVER.MANAGEMENTAPI + '/rest/roles', // 角色 | ||
| 23 | userRoles: SERVER.MANAGEMENTAPI + '/rest/user-roles', // 角色对应人员关系 | ||
| 24 | productCategory: SERVER.MANAGEMENTAPI + '/rest/product-category', // 业务分类 | ||
| 25 | resourceCategory: SERVER.MANAGEMENTAPI + '/rest/resource-category', // 资源分类 | ||
| 26 | resources: SERVER.MANAGEMENTAPI + '/rest/resources', // 资源详情列表 | ||
| 27 | subsystem: SERVER.MANAGEMENTAPI + '/rest/products', // 子系统管理 | ||
| 28 | operations: SERVER.MANAGEMENTAPI + '/rest/operations', // 操作 | ||
| 29 | menus: SERVER.MANAGEMENTAPI + '/rest/menus', // 菜单 | ||
| 30 | organizationPermissions: SERVER.MANAGEMENTAPI + '/rest/organization-permissions', // 机构授权 | ||
| 31 | departmentPermissions: SERVER.MANAGEMENTAPI + '/rest/department-permissions', // 部门授权 | ||
| 32 | rolePermissions: SERVER.MANAGEMENTAPI + '/rest/role-permissions', // 角色授权 | ||
| 33 | peoPermissions: SERVER.MANAGEMENTAPI + '/rest/user-permissions', // 用户授权 | ||
| 34 | resourcePermissions: SERVER.MANAGEMENTAPI + '/rest/resource-permissions', // 资源授权查询 | ||
| 35 | menuPermissions: SERVER.MANAGEMENTAPI + '/rest/menu-permissions', // 菜单授权查询 | ||
| 36 | serviceCategory: SERVER.MANAGEMENTAPI + '/rest/service-category', // 服务分类 | ||
| 37 | service: SERVER.MANAGEMENTAPI + '/rest/service', // 服务详情列表 | ||
| 38 | databaseServer: workflow + '/rest/database-server', // 数据库服务器 | ||
| 39 | materialCategory: workflow + '/rest/material-category', // 材料分类 | ||
| 40 | material: workflow + '/rest/material', // 材料 | ||
| 41 | function: workflow + '/rest/function', // 功能属性 | ||
| 42 | eventCategory: workflow + '/rest/event-category', // 服务事件分类 | ||
| 43 | event: workflow + '/rest/event', // 服务事件 | ||
| 44 | formCategorys: workflow + '/rest/forms-category', // 表单分类 | ||
| 45 | forms: workflow + '/rest/forms', // 表单 | ||
| 46 | metadata: workflow + '/rest/metadata', // 元数据 | ||
| 47 | dataObjectCategory: workflow + '/rest/data-object-category', // 对象管理类别 | ||
| 48 | dataObject: workflow + '/rest/data-object', // 对象管理 | ||
| 49 | workflowBusiness: workflow + '/rest/businesses', // 业务流程 | ||
| 50 | // workflowModel: workflow+'/rest/workflow/model',//流程模型 | ||
| 51 | modelcategorys: workflow + '/rest/model-categories', // 模型分类 | ||
| 52 | models: workflow + '/rest/models', // 工作流模型表 | ||
| 53 | businessesModels: workflow + '/rest/businesses-models', // 业务流程关系 | ||
| 54 | pluginCategory: workflow + '/rest/plugin-category', // 流程插件分类管理 | ||
| 55 | plugin: workflow + '/rest/plugins', // 流程插件分类管理 | ||
| 56 | groups: workflow + '/rest/groups', // 用户组分类 | ||
| 57 | groupUsers: workflow + '/rest/group-users', // 用户组人员 | ||
| 58 | saveWorkflowGroupUser: workflow + '/rest/groups/sug', // 工作流设计器增加用户组 | ||
| 59 | validate: workflow + '/rest/models/validate', // 流程验证 | ||
| 60 | tokens: SERVER.MANAGEMENTAPI + '/rest/tokens', // token | ||
| 61 | session: '/rest/session', // session | ||
| 62 | pwdSetting: SERVER.MANAGEMENTAPI + '/rest/password-setting', // | ||
| 63 | singleSign: '/cas/rest/services', // 单点登录管理 | ||
| 64 | attachments: SERVER.MANAGEMENTAPI + '/rest/attachments', // 文件上传服务 | ||
| 65 | instances: workflow + '/rest/workflow/instances', // 实例 | ||
| 66 | workflowTask: workflow + '/rest/workflow-task', // 任务 | ||
| 67 | definitions: workflow + '/rest/workflow/definitions', // 流程实例 | ||
| 68 | systemAccessLogs: log + '/rest/system-access-logs', // 系统访问日志 | ||
| 69 | errorLogs: log + '/rest/common-log-statistics', // 错误日志 | ||
| 70 | appAccess: log + '/rest/system-access-logs/count-app-access', // 系统访问数 | ||
| 71 | userAccess: log + '/rest/system-access-logs/count-user-access', // 用户访问数 | ||
| 72 | statisticMenus: log + '/rest/system-access-logs/statistic-menus', // 统计菜单访问数 | ||
| 73 | statisticUsers: log + '/rest/system-access-logs/statistic-users', // 统计用户访问数 | ||
| 74 | abnormal: log + '/rest/abnormal', // 统计平台报警 | ||
| 75 | monitorConfig: log + '/rest/monitor-alert-config', // 监控预警配置 | ||
| 76 | statisticTimes: log + '/rest/system-access-logs/statistic-times', // 监控预警配置 | ||
| 77 | server: log + '/rest/server', // 服务器监控 | ||
| 78 | serverStatistics: log + '/rest/server-statistics', // 服务器监控信息统计 | ||
| 79 | avgTimes: log + '/rest/services-statistics/avg-times', // 根据时间查响应时间和访问次数 | ||
| 80 | statisticDepts: log + '/rest/system-access-logs/statistic-depts', // 访问部门统计 | ||
| 81 | crudHead: crud + '/rest/head', // crudhead | ||
| 82 | crudGet: crud + '/rest/get', // crudget | ||
| 83 | crudPost: crud + '/rest/post', // crudPost | ||
| 84 | crudPut: crud + '/rest/put', // crudPut | ||
| 85 | crudDel: crud + '/rest/delete', // crudDel | ||
| 86 | crudMetadata: crud + '/rest/metadata', //crudMetadata | ||
| 87 | crudBusiness: crud + '/rest/business', // crudBusiness | ||
| 88 | crudDatasources: crud + '/rest/datasources', // crudDatasources | ||
| 89 | } | ||
| 90 | |||
| 91 | // 根据code获取字典 params={isTree:true}) | ||
| 92 | export function getDictItems (code, params = {}) { | ||
| 93 | return request({ | ||
| 94 | url: `${api.baseDataCategory}/${code}/base-datas`, | ||
| 95 | method: 'get', | ||
| 96 | params | ||
| 97 | }) | ||
| 98 | } | ||
| 99 | // 获取一级字典值下级接口 | ||
| 100 | export function getDictItemsChild (id) { | ||
| 101 | return request({ | ||
| 102 | url: `${api.baseData}/dict/${id}`, | ||
| 103 | method: 'get' | ||
| 104 | }) | ||
| 105 | } | ||
| 106 | // 获取传入字段的所有级别字典值 | ||
| 107 | export function getAllDictItems (name) { | ||
| 108 | return request({ | ||
| 109 | url: `${api.baseDataCategory}/${name}/base-datas`, | ||
| 110 | method: 'get' | ||
| 111 | }) | ||
| 112 | } | ||
| 113 | // get | ||
| 114 | export function getAction (url, params = {}) { | ||
| 115 | return request({ | ||
| 116 | url, | ||
| 117 | method: 'get', | ||
| 118 | params | ||
| 119 | }) | ||
| 120 | } | ||
| 121 | // post公共方法 | ||
| 122 | export function postAction (url, data = null) { | ||
| 123 | return request({ | ||
| 124 | url, | ||
| 125 | method: 'post', | ||
| 126 | data | ||
| 127 | }) | ||
| 128 | } | ||
| 129 | // method= {post | put} | ||
| 130 | export function httpAction (url, data, method) { | ||
| 131 | return request({ | ||
| 132 | url, | ||
| 133 | method, | ||
| 134 | data | ||
| 135 | }) | ||
| 136 | } | ||
| 137 | // put公共方法 | ||
| 138 | export function putAction (url, data = null) { | ||
| 139 | return request({ | ||
| 140 | url, | ||
| 141 | method: 'put', | ||
| 142 | data | ||
| 143 | }) | ||
| 144 | } | ||
| 145 | // delete | ||
| 146 | export function deleteAction (url, data = null) { | ||
| 147 | return request({ | ||
| 148 | url, | ||
| 149 | method: 'delete', | ||
| 150 | data | ||
| 151 | }) | ||
| 152 | } | ||
| 153 | |||
| 154 | // 批量删除 | ||
| 155 | export function deleteBranch (url, data) { | ||
| 156 | return request({ | ||
| 157 | url, | ||
| 158 | method: 'delete', | ||
| 159 | data | ||
| 160 | }) | ||
| 161 | } | ||
| 162 | |||
| 163 | |||
| 164 | |||
| 165 | |||
| 166 | |||
| 167 | |||
| 168 | |||
| 169 |
src/api/orders.js
deleted
100644 → 0
| 1 | /* | ||
| 2 | * @Description :更新排序api文件 | ||
| 3 | * @Autor : miaofang | ||
| 4 | * @LastEditTime : 2023-05-17 10:41:30 | ||
| 5 | */ | ||
| 6 | import request from '@/utils/request' | ||
| 7 | let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl')) | ||
| 8 | |||
| 9 | /* | ||
| 10 | 更新排序 | ||
| 11 | record-排序整条数据 | ||
| 12 | operate-BOTTOM(置底), DOWN(向下), TOP(置顶), UP(向上) | ||
| 13 | */ | ||
| 14 | export function updateOrder (url, record, operate, swapId) { | ||
| 15 | return request({ | ||
| 16 | url: SERVER.MANAGEMENTAPI + url + "/" + record.id + "/orders", | ||
| 17 | method: "put", | ||
| 18 | params: { | ||
| 19 | operate: operate, | ||
| 20 | swapId: swapId, | ||
| 21 | }, | ||
| 22 | }); | ||
| 23 | } |
src/api/personnelManage.js
deleted
100644 → 0
| 1 | /* | ||
| 2 | * @Author: xiaomiao 1158771342@qq.com | ||
| 3 | * @Date: 2023-03-09 15:24:53 | ||
| 4 | * @LastEditors: xiaomiao 1158771342@qq.com | ||
| 5 | * @LastEditTime: 2023-04-19 13:49:03 | ||
| 6 | * @FilePath: \上报\bdcjg-web\src\api\personnelManage.js | ||
| 7 | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||
| 8 | */ | ||
| 9 | |||
| 10 | import { | ||
| 11 | api, | ||
| 12 | getAction, | ||
| 13 | deleteAction, | ||
| 14 | putAction | ||
| 15 | } from './manageApi' | ||
| 16 | import { getParams } from './util' | ||
| 17 | |||
| 18 | export const updateUserPassword = (data) => { | ||
| 19 | return putAction(`${api.users}/update-password`, data) | ||
| 20 | } | ||
| 21 | |||
| 22 | // 根据条件获取用户 | ||
| 23 | export const getUserList = (params) => { | ||
| 24 | return getAction(api.users, params) | ||
| 25 | } | ||
| 26 | export const getUserLists = (queryParam) => { | ||
| 27 | const conditionGroup = { | ||
| 28 | conditions: [], | ||
| 29 | queryRelation: 'AND', | ||
| 30 | } | ||
| 31 | for (let key in queryParam) { | ||
| 32 | if (queryParam[key]) { | ||
| 33 | conditionGroup.conditions.push({ | ||
| 34 | property: key, | ||
| 35 | value: queryParam[key], | ||
| 36 | operator: 'LIKE' | ||
| 37 | }) | ||
| 38 | } | ||
| 39 | |||
| 40 | } | ||
| 41 | const params = getParams(conditionGroup) | ||
| 42 | return getAction(api.users, params) | ||
| 43 | } | ||
| 44 | // 重置用户密码 | ||
| 45 | // export const resetPassword = id => { | ||
| 46 | // return putAction(`${api.users}/${id}/reset-password`) | ||
| 47 | // } | ||
| 48 | |||
| 49 | // 重置用户密码 | ||
| 50 | export const resetPassword = (ids) => { | ||
| 51 | return putAction(`${api.users}/reset-passwords?ids=${ids}`) | ||
| 52 | } | ||
| 53 | |||
| 54 | // 人员列表 | ||
| 55 | export const getUserRoles = (id) => { | ||
| 56 | return getAction(`${api.userRoles}/${id}/users`) | ||
| 57 | } | ||
| 58 | // 更新人员 | ||
| 59 | export const updateUser = (id, data) => { | ||
| 60 | return putAction(`${api.userRoles}/${id}/users`, data) | ||
| 61 | } | ||
| 62 |
src/mixins/TableListMixin.js
deleted
100644 → 0
| 1 | /** | ||
| 2 | * 新增修改完成调用 dialogFormOk方法重置表单,修改新增弹框组件ref定义为dialogForm | ||
| 3 | * 弹框组件中新增方法add 编辑方法 edit | ||
| 4 | * 表格页面的data中tableUrl定义为接口地址 | ||
| 5 | * 弹窗页面定义初始this.init()方法,获取弹窗需要的数据 | ||
| 6 | * 表格ref=xTree | ||
| 7 | */ | ||
| 8 | import { deleteAction, getAction } from '@/api/manageApi' | ||
| 9 | |||
| 10 | export const TableListMixin = { | ||
| 11 | data() { | ||
| 12 | return { | ||
| 13 | // 查询拼接json字符串 | ||
| 14 | queryOptions: '', | ||
| 15 | queryParam: {}, // 查询条件 | ||
| 16 | /* 数据源 */ | ||
| 17 | tableData: [], | ||
| 18 | /* 分页参数*/ | ||
| 19 | ipagination: { | ||
| 20 | pageNumber: 0, | ||
| 21 | pageSize: 10 | ||
| 22 | }, | ||
| 23 | /* table选中行*/ | ||
| 24 | selectionRows: [], | ||
| 25 | loading: false // 表格加载状态 | ||
| 26 | } | ||
| 27 | }, | ||
| 28 | created() { | ||
| 29 | // console.log(' -- mixin created -- ') | ||
| 30 | // 初始化字典配置 在需要页面调用字典值获取方法 | ||
| 31 | this.initDictConfig() | ||
| 32 | }, | ||
| 33 | methods: { | ||
| 34 | // 加载表格数据 | ||
| 35 | loadData(arg) { | ||
| 36 | if (!this.tableUrl) { | ||
| 37 | console.log('请设置tableUrl属性为接口地址!') | ||
| 38 | return | ||
| 39 | } | ||
| 40 | // 加载数据 若传入参数1则加载第一页的内容 | ||
| 41 | // if (arg === 1) { | ||
| 42 | // } | ||
| 43 | const params = this.getQueryParams() // 查询条件 | ||
| 44 | this.loading = true | ||
| 45 | getAction(this.tableUrl, params) | ||
| 46 | .then(res => { | ||
| 47 | if (res.status === 1) { | ||
| 48 | this.loading = false | ||
| 49 | this.tableData = res.content | ||
| 50 | this.$nextTick(() => { | ||
| 51 | if (this.tableData.length !== 0) { | ||
| 52 | this.$refs.xTree && this.$refs.xTree.setAllTreeExpand(true) | ||
| 53 | } | ||
| 54 | }) | ||
| 55 | } else { | ||
| 56 | this.$message.error({ message: res.message, showClose: true }) | ||
| 57 | this.loading = false | ||
| 58 | } | ||
| 59 | }) | ||
| 60 | .catch(error => { | ||
| 61 | console.log('error', error) | ||
| 62 | this.loading = false | ||
| 63 | }) | ||
| 64 | }, | ||
| 65 | // 字典值配置 | ||
| 66 | initDictConfig() { | ||
| 67 | // console.log('假初始化字典值方法!') | ||
| 68 | }, | ||
| 69 | // 选择所有和取消所有 | ||
| 70 | selectAllEvent({ checked, records }) { | ||
| 71 | this.selectionRows = records | ||
| 72 | }, | ||
| 73 | // 选中节点 | ||
| 74 | selectChangeEvent({ records }) { | ||
| 75 | this.selectionRows = records | ||
| 76 | }, | ||
| 77 | // 使用查询条件查询 | ||
| 78 | searchQuery() { | ||
| 79 | this.loadData() | ||
| 80 | }, | ||
| 81 | // 获取查询条件 | ||
| 82 | getQueryParams() { | ||
| 83 | if (this.queryOptions !== '') { | ||
| 84 | this.queryParam.queryOptions = JSON.stringify(this.queryOptions) | ||
| 85 | } | ||
| 86 | return this.$filterNullObj(this.queryParam) | ||
| 87 | }, | ||
| 88 | // 新增 | ||
| 89 | handleAdd: function() { | ||
| 90 | this.$refs.dialogForm.add() | ||
| 91 | this.$refs.dialogForm.title = '新增' | ||
| 92 | }, | ||
| 93 | // 修改 | ||
| 94 | handleEdit: function(record) { | ||
| 95 | localStorage.setItem('record', JSON.stringify(record)) | ||
| 96 | this.$refs.dialogForm.edit(record) | ||
| 97 | this.$refs.dialogForm.title = '修改' | ||
| 98 | }, | ||
| 99 | // 删除 | ||
| 100 | handleDelete: function(id, content = '') { | ||
| 101 | this.$confirm( | ||
| 102 | `<div class="customer-message-wrapper"> | ||
| 103 | <h5 class="title">您确认要执行该操作用于以下信息:</h5> | ||
| 104 | <p class="content" aria-controls="${content}">${content} | ||
| 105 | </p> | ||
| 106 | <p class="result">执行后,数据将 | ||
| 107 | <span >无法恢复</span> | ||
| 108 | </p> | ||
| 109 | </div>`, | ||
| 110 | '执行确认', | ||
| 111 | { | ||
| 112 | dangerouslyUseHTMLString: true, | ||
| 113 | customClass: 'customer-delete', | ||
| 114 | confirmButtonText: '确定', | ||
| 115 | cancelButtonText: '取消', | ||
| 116 | type: 'warning' | ||
| 117 | } | ||
| 118 | ) | ||
| 119 | .then(() => { | ||
| 120 | if (!this.tableUrl) { | ||
| 121 | this.$message.error({ | ||
| 122 | message: '请设置tableUrl属性为接口地址!', | ||
| 123 | showClose: true | ||
| 124 | }) | ||
| 125 | return | ||
| 126 | } | ||
| 127 | const url = this.tableUrl + '/' + id | ||
| 128 | deleteAction(url).then(res => { | ||
| 129 | if (res.status === 1) { | ||
| 130 | this.$message.success({ message: res.message, showClose: true }) | ||
| 131 | this.loadDataS(this.subcode) | ||
| 132 | } else { | ||
| 133 | this.$message.error({ message: res.message, showClose: true }) | ||
| 134 | } | ||
| 135 | }) | ||
| 136 | }) | ||
| 137 | .catch(() => {}) | ||
| 138 | }, | ||
| 139 | // 批量删除 | ||
| 140 | batchDel: function() { | ||
| 141 | if (!this.tableUrl) { | ||
| 142 | this.$message.error({ | ||
| 143 | message: '请设置tableUrl属性为接口地址!', | ||
| 144 | showClose: true | ||
| 145 | }) | ||
| 146 | return | ||
| 147 | } | ||
| 148 | if (this.selectionRows.length === 0) { | ||
| 149 | this.$message.error({ | ||
| 150 | message: '请选择删除项!', | ||
| 151 | showClose: true | ||
| 152 | }) | ||
| 153 | return | ||
| 154 | } | ||
| 155 | this.$confirm('确定要删除吗?', '提示', { | ||
| 156 | confirmButtonText: '确定', | ||
| 157 | cancelButtonText: '取消', | ||
| 158 | type: 'warning' | ||
| 159 | }) | ||
| 160 | .then(() => { | ||
| 161 | const ids = [] | ||
| 162 | this.selectionRows.forEach(element => { | ||
| 163 | ids.push(element.id) | ||
| 164 | }) | ||
| 165 | deleteAction(this.tableUrl, ids).then(res => { | ||
| 166 | if (res.status === 1) { | ||
| 167 | this.$message.success({ message: res.message, showClose: true }) | ||
| 168 | this.loadData() | ||
| 169 | } else { | ||
| 170 | this.$message.error({ message: res.message, showClose: true }) | ||
| 171 | } | ||
| 172 | }) | ||
| 173 | }) | ||
| 174 | .catch(() => {}) | ||
| 175 | }, | ||
| 176 | // 新增或修改成功时,重载列表 | ||
| 177 | dialogFormOk() { | ||
| 178 | this.loadData() | ||
| 179 | }, | ||
| 180 | // 导出 | ||
| 181 | handleExportXls(data, name) { | ||
| 182 | if (name === '菜单' || name === '部门' || name === '机构' || | ||
| 183 | name === '资源' || name === '资源分类' || name === '数据字典' || name === '行政区划') { | ||
| 184 | const params = this.getQueryParams() // 查询条件 | ||
| 185 | getAction(this.tableUrl + '/export', params) | ||
| 186 | .then(res => { | ||
| 187 | if (res.status === 1) { | ||
| 188 | data = res.content | ||
| 189 | this.$downloadJson(data, name) | ||
| 190 | } else { | ||
| 191 | this.$message.error({ message: '导出失败', showClose: true }) | ||
| 192 | } | ||
| 193 | }) | ||
| 194 | } else if (name === '人员') { | ||
| 195 | exportUserList(this.queryParam).then((res) => { | ||
| 196 | if (res.status === 1) { | ||
| 197 | data = res.content | ||
| 198 | this.$downloadJson(data, name) | ||
| 199 | } else { | ||
| 200 | this.$message.error({ message: '导出失败', showClose: true }) | ||
| 201 | } | ||
| 202 | }) | ||
| 203 | } else { | ||
| 204 | this.$downloadJson(data, name) | ||
| 205 | } | ||
| 206 | }, | ||
| 207 | /* 导入 */ | ||
| 208 | handleImportExcel(info) {} | ||
| 209 | } | ||
| 210 | } |
src/views/sthj/ywjr/data/index.js
deleted
100644 → 0
| 1 | import filter from '@/utils/filter.js' | ||
| 2 | class data extends filter { | ||
| 3 | constructor() { | ||
| 4 | super() | ||
| 5 | } | ||
| 6 | columns () { | ||
| 7 | return [ | ||
| 8 | { | ||
| 9 | prop: "name", | ||
| 10 | label: "区县代码", | ||
| 11 | width: 130 | ||
| 12 | }, | ||
| 13 | { | ||
| 14 | prop: "description", | ||
| 15 | label: "业务号" | ||
| 16 | }, | ||
| 17 | { | ||
| 18 | prop: "description", | ||
| 19 | label: "受理业务名称" | ||
| 20 | }, | ||
| 21 | { | ||
| 22 | prop: "description", | ||
| 23 | label: "受理业务编码" | ||
| 24 | }, | ||
| 25 | { | ||
| 26 | prop: "description", | ||
| 27 | label: "受理时间" | ||
| 28 | }, | ||
| 29 | { | ||
| 30 | prop: "description", | ||
| 31 | label: "登记时间" | ||
| 32 | }, | ||
| 33 | { | ||
| 34 | prop: "description", | ||
| 35 | label: "接收时间" | ||
| 36 | }, | ||
| 37 | { | ||
| 38 | prop: "description", | ||
| 39 | label: "读取时间" | ||
| 40 | } | ||
| 41 | ] | ||
| 42 | } | ||
| 43 | } | ||
| 44 | export default new data() |
src/views/sthj/ywjr/edit-dialog.vue
deleted
100644 → 0
| 1 | <!-- 新增 & 修改角色 --> | ||
| 2 | <template> | ||
| 3 | <dialogBox | ||
| 4 | class="PersonnelDialog" | ||
| 5 | :title="title" | ||
| 6 | :width="'567px'" | ||
| 7 | :isMain="true" | ||
| 8 | @closeDialog="close" | ||
| 9 | @submitForm="submitForm" | ||
| 10 | v-model="myValue"> | ||
| 11 | <div class="dialogCon"> | ||
| 12 | <el-form ref="form" :model="dialogForm" :rules="rules" label-width="82px"> | ||
| 13 | <el-row :gutter="24"> | ||
| 14 | <el-col :span="23"> | ||
| 15 | <el-form-item label="角色名称:" prop="roleName"> | ||
| 16 | <el-input | ||
| 17 | v-model="dialogForm.roleName" | ||
| 18 | clearable | ||
| 19 | placeholder="角色名称" /> | ||
| 20 | </el-form-item> | ||
| 21 | </el-col> | ||
| 22 | </el-row> | ||
| 23 | <el-row> | ||
| 24 | <el-col :span="23"> | ||
| 25 | <el-form-item label="备注:" class="form-item-mb0"> | ||
| 26 | <el-input | ||
| 27 | v-model="dialogForm.roleTextArea" | ||
| 28 | clearable | ||
| 29 | :rows="10" | ||
| 30 | type="textarea" | ||
| 31 | placeholder="备注" /> | ||
| 32 | </el-form-item> | ||
| 33 | </el-col> | ||
| 34 | </el-row> | ||
| 35 | </el-form> | ||
| 36 | </div> | ||
| 37 | <!-- <template slot="footer"> | ||
| 38 | <el-button | ||
| 39 | class="cancel-button" | ||
| 40 | @click="handleCloseDialog">取消</el-button> | ||
| 41 | |||
| 42 | <el-button | ||
| 43 | type="primary" | ||
| 44 | @click="handleSaveRole()">保存</el-button> | ||
| 45 | </template> --> | ||
| 46 | </dialogBox> | ||
| 47 | </template> | ||
| 48 | |||
| 49 | <script> | ||
| 50 | import Dialog from "@/components/Dialog/"; | ||
| 51 | import { api, httpAction } from '@/api/manageApi' | ||
| 52 | export default { | ||
| 53 | components: { | ||
| 54 | Dialog | ||
| 55 | }, | ||
| 56 | props: { | ||
| 57 | value: { type: Boolean, default: false }, | ||
| 58 | }, | ||
| 59 | data () { | ||
| 60 | return { | ||
| 61 | myValue: this.value, | ||
| 62 | title: '', | ||
| 63 | showAddEditDialog: false, | ||
| 64 | menuType: '', | ||
| 65 | roleId: '', | ||
| 66 | sort: 0, | ||
| 67 | dialogForm: { | ||
| 68 | roleName: '', | ||
| 69 | roleType: '', | ||
| 70 | roleTextArea: '' | ||
| 71 | }, | ||
| 72 | rules: { | ||
| 73 | roleName: [ | ||
| 74 | { required: true, message: '请输入角色名称', trigger: 'blur' } | ||
| 75 | ], | ||
| 76 | }, | ||
| 77 | roleTypeOptions: [ | ||
| 78 | { name: '定制', value: '定制' }, | ||
| 79 | { name: '其他', value: '其他' } | ||
| 80 | ] | ||
| 81 | } | ||
| 82 | }, | ||
| 83 | watch: { | ||
| 84 | value (val) { | ||
| 85 | this.myValue = val | ||
| 86 | } | ||
| 87 | }, | ||
| 88 | methods: { | ||
| 89 | // 保存新增或关闭事件 | ||
| 90 | submitForm () { | ||
| 91 | this.$refs.form.validate((valid) => { | ||
| 92 | if (valid) { | ||
| 93 | try { | ||
| 94 | const params = { | ||
| 95 | category: 2, | ||
| 96 | description: this.dialogForm.roleTextArea, | ||
| 97 | name: this.dialogForm.roleName, | ||
| 98 | sort: this.sort, | ||
| 99 | type: this.dialogForm.roleType | ||
| 100 | } | ||
| 101 | if (this.roleId) { | ||
| 102 | params.id = this.roleId | ||
| 103 | httpAction(`${api.roles}/${params.id}`, params, 'post').then( | ||
| 104 | (res) => { | ||
| 105 | if (res.status === 1) { | ||
| 106 | this.$message.success({ | ||
| 107 | message: '修改成功', | ||
| 108 | showClose: true | ||
| 109 | }) | ||
| 110 | this.dialogForm = { | ||
| 111 | roleName: '', | ||
| 112 | } | ||
| 113 | // this.showAddEditDialog = val | ||
| 114 | this.$emit('ok') | ||
| 115 | } else { | ||
| 116 | this.$message.error({ | ||
| 117 | message: res.message, | ||
| 118 | showClose: true | ||
| 119 | }) | ||
| 120 | } | ||
| 121 | } | ||
| 122 | ) | ||
| 123 | } else { | ||
| 124 | httpAction(api.roles, params, 'post').then((res) => { | ||
| 125 | if (res.status === 1) { | ||
| 126 | this.$message.success({ | ||
| 127 | message: '新增成功', | ||
| 128 | showClose: true | ||
| 129 | }) | ||
| 130 | this.close() | ||
| 131 | |||
| 132 | this.$emit('ok') | ||
| 133 | // this.showAddEditDialog = val | ||
| 134 | this.$emit('ok', this.menuType) | ||
| 135 | } else { | ||
| 136 | this.$message.error({ | ||
| 137 | message: res.message, | ||
| 138 | showClose: true | ||
| 139 | }) | ||
| 140 | } | ||
| 141 | }) | ||
| 142 | } | ||
| 143 | } catch (e) { | ||
| 144 | console.error(e) | ||
| 145 | } | ||
| 146 | } | ||
| 147 | }) | ||
| 148 | }, | ||
| 149 | // 重置 | ||
| 150 | resetForm () { | ||
| 151 | this.dialogForm = { | ||
| 152 | roleName: '', | ||
| 153 | } | ||
| 154 | this.$refs.form.resetFields() | ||
| 155 | }, | ||
| 156 | // 关闭 | ||
| 157 | close () { | ||
| 158 | this.resetForm() | ||
| 159 | this.$emit('input', false) | ||
| 160 | } | ||
| 161 | } | ||
| 162 | } | ||
| 163 | </script> | ||
| 164 | <style scoped lang="scss"> | ||
| 165 | </style> |
src/views/sthj/ywjr/index.vue
deleted
100644 → 0
| 1 | <template> | ||
| 2 | <div class="from-clues"> | ||
| 3 | <div class="from-clues-header"> | ||
| 4 | <el-form ref="ruleForm" :model="form" label-width="100px"> | ||
| 5 | <!-- 判断进入监管还是上报系统 --> | ||
| 6 | <el-form-item v-if="BASE_API.THEME=='jg'"> | ||
| 7 | <Breadcrumb /> | ||
| 8 | </el-form-item> | ||
| 9 | <el-row class="mb-5"> | ||
| 10 | <el-col :span="4"> | ||
| 11 | <el-form-item label="业务号:" prop="ywh"> | ||
| 12 | <el-input v-model="form.ywh" class="width100" clearable placeholder="业务号"></el-input> | ||
| 13 | </el-form-item> | ||
| 14 | </el-col> | ||
| 15 | <el-col :span="4"> | ||
| 16 | <el-form-item label="业务名称" prop="ywmc"> | ||
| 17 | <el-input v-model.trim="form.rolesName" class="width100" clearable placeholder="业务名称"></el-input> | ||
| 18 | </el-form-item> | ||
| 19 | </el-col> | ||
| 20 | <el-col :span="6"> | ||
| 21 | <el-form-item label="开始日期" prop="startTime"> | ||
| 22 | <el-date-picker type="date" class="width100" placeholder="开始日期" :picker-options="pickerOptionsStart" | ||
| 23 | clearable v-model="form.startTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> | ||
| 24 | </el-form-item> | ||
| 25 | </el-col> | ||
| 26 | <el-col :span="6"> | ||
| 27 | <el-form-item label="结束日期" prop="endTime"> | ||
| 28 | <el-date-picker type="date" class="width100" placeholder="结束日期" :picker-options="pickerOptionsEnd" clearable | ||
| 29 | v-model="form.endTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> | ||
| 30 | </el-form-item> | ||
| 31 | </el-col> | ||
| 32 | <!-- 操作按钮 --> | ||
| 33 | <el-col :span="4" class="btnColRight"> | ||
| 34 | <btn nativeType="cz" @click="resetForm">重置</btn> | ||
| 35 | <btn nativeType="cx" @click="handleSearch">查询</btn> | ||
| 36 | </el-col> | ||
| 37 | </el-row> | ||
| 38 | </el-form> | ||
| 39 | </div> | ||
| 40 | <div class="from-clues-content"> | ||
| 41 | <lb-table :pagination="false" @size-change="handleSizeChange" :calcHeight="160" | ||
| 42 | @p-current-change="handleCurrentChange" :column="tableData.columns" :data="listdata" | ||
| 43 | row-key="dictid"> | ||
| 44 | </lb-table> | ||
| 45 | </div> | ||
| 46 | </div> | ||
| 47 | </template> | ||
| 48 | <script> | ||
| 49 | import { | ||
| 50 | getUuid, | ||
| 51 | judgeSort, | ||
| 52 | realMove, | ||
| 53 | findParents, | ||
| 54 | removeTreeListItem, | ||
| 55 | } from "@/utils/operation"; | ||
| 56 | import { getRolesById, getAuthorityListAction } from "@/api/authorityManage"; | ||
| 57 | import { getUserRoles } from "@/api/personnelManage"; | ||
| 58 | import data from "./data"; | ||
| 59 | import { getMenuInfo } from "@/api/user"; | ||
| 60 | import { api, getAction, deleteAction } from "@/api/manageApi"; | ||
| 61 | import tableMixin from "@/mixins/tableMixin.js"; | ||
| 62 | import EditDialog from "./edit-dialog.vue"; | ||
| 63 | import Roleslistdiglog from "./roleslistdiglog.vue"; | ||
| 64 | import { mapGetters } from "vuex"; | ||
| 65 | import { updateOrder } from "@/api/orders" | ||
| 66 | export default { | ||
| 67 | name: "menus", | ||
| 68 | mixins: [tableMixin], | ||
| 69 | components: { | ||
| 70 | EditDialog, | ||
| 71 | Roleslistdiglog, | ||
| 72 | }, | ||
| 73 | data () { | ||
| 74 | return { | ||
| 75 | // 开始结束日期限制 | ||
| 76 | pickerOptionsStart: { | ||
| 77 | disabledDate: (time) => { | ||
| 78 | if (this.form.endTime) { | ||
| 79 | return time.getTime() >= new Date(this.form.endTime).getTime() | ||
| 80 | } | ||
| 81 | } | ||
| 82 | }, | ||
| 83 | // 结束日期限制 | ||
| 84 | pickerOptionsEnd: { | ||
| 85 | disabledDate: (time) => { | ||
| 86 | if (this.form.startTime) { | ||
| 87 | return time.getTime() < new Date(this.form.startTime).getTime() | ||
| 88 | } | ||
| 89 | } | ||
| 90 | }, | ||
| 91 | listdata: [], | ||
| 92 | setlistdata: [], | ||
| 93 | // 表单 | ||
| 94 | form: { | ||
| 95 | ywh: '', | ||
| 96 | ywmc: '', | ||
| 97 | startTime: '', | ||
| 98 | endTime: '', | ||
| 99 | currentPage: 1 | ||
| 100 | }, | ||
| 101 | // 表格数据 | ||
| 102 | tableData: { | ||
| 103 | columns: [ | ||
| 104 | { | ||
| 105 | label: "序号", | ||
| 106 | type: "index", | ||
| 107 | width: "50", | ||
| 108 | index: this.indexMethod, | ||
| 109 | }, | ||
| 110 | ] | ||
| 111 | .concat(data.columns()) | ||
| 112 | .concat({ | ||
| 113 | prop: "state", | ||
| 114 | label: "状态", | ||
| 115 | width: '120', | ||
| 116 | render: (h, scope) => { | ||
| 117 | return ( | ||
| 118 | <div> | ||
| 119 | <span class='adopt' v-show={scope.row.state == 3}>上报失败</span> | ||
| 120 | <span class='adopt' v-show={scope.row.state == 2}>上报成功</span> | ||
| 121 | <span class='warehousing' v-show={scope.row.state == 1}>接入上报异常</span> | ||
| 122 | </div> | ||
| 123 | ) | ||
| 124 | } | ||
| 125 | }) | ||
| 126 | .concat([]), | ||
| 127 | }, | ||
| 128 | data: [], | ||
| 129 | } | ||
| 130 | }, | ||
| 131 | created () { | ||
| 132 | this.getTableData(); | ||
| 133 | }, | ||
| 134 | mounted () { }, | ||
| 135 | methods: { | ||
| 136 | //查询 | ||
| 137 | searchQuery () { | ||
| 138 | if (this.form.rolesName) { | ||
| 139 | this.listdata = this.childrenFn(this.setlistdata, this.form.rolesName); | ||
| 140 | } else { | ||
| 141 | this.getTableData() | ||
| 142 | } | ||
| 143 | }, | ||
| 144 | childrenFn (arr, key) { | ||
| 145 | let searchTree = []; | ||
| 146 | arr.forEach((item, index) => { | ||
| 147 | if (item.name.indexOf(key) != -1) { | ||
| 148 | |||
| 149 | searchTree.push(item); | ||
| 150 | } | ||
| 151 | }); | ||
| 152 | if (searchTree != undefined && searchTree.length != 0) { | ||
| 153 | return judgeSort(searchTree); | ||
| 154 | } | ||
| 155 | }, | ||
| 156 | // 获取角色列表 | ||
| 157 | getTableData () { | ||
| 158 | getRolesById([1, 2]) | ||
| 159 | .then((res) => { | ||
| 160 | this.listdata = res.content; | ||
| 161 | this.listdata = judgeSort(this.listdata); | ||
| 162 | this.setlistdata = res.content; | ||
| 163 | }) | ||
| 164 | .catch((e) => console.error(e)); | ||
| 165 | }, | ||
| 166 | |||
| 167 | |||
| 168 | }, | ||
| 169 | }; | ||
| 170 | </script> | ||
| 171 | <style scoped lang="scss"> | ||
| 172 | @import "~@/styles/mixin.scss"; | ||
| 173 | // @import "~@/styles/public.scss"; | ||
| 174 | |||
| 175 | /deep/.el-button.is-disabled.el-button--text { | ||
| 176 | width: 64px; | ||
| 177 | height: 28px; | ||
| 178 | background: rgba(255, 255, 255, 0.1); | ||
| 179 | border-radius: 16px; | ||
| 180 | } | ||
| 181 | </style> |
| 1 | <template> | ||
| 2 | <el-dialog | ||
| 3 | :close-on-click-modal="false" | ||
| 4 | top="0" | ||
| 5 | @click="close()" | ||
| 6 | class="roleconfiguration" | ||
| 7 | custom-class="dialogBox editDialogBox mainCenter" | ||
| 8 | :visible.sync="visible" | ||
| 9 | width="85%"> | ||
| 10 | <div slot="title" class="dialog_title" ref="dialogTitle"> | ||
| 11 | {{ title || "标题" }} | ||
| 12 | </div> | ||
| 13 | <div class="editDialogBox-box"> | ||
| 14 | <el-tabs v-model="activeName" type="card" @tab-click="handleClick"> | ||
| 15 | <el-tab-pane label="人员配置" name="first"></el-tab-pane> | ||
| 16 | <el-tab-pane label="菜单配置" name="second"></el-tab-pane> | ||
| 17 | </el-tabs> | ||
| 18 | <lb-table | ||
| 19 | v-if="activeName == 'first'" | ||
| 20 | ref="multipleTable" | ||
| 21 | :pagination="false" | ||
| 22 | :column="usertableData.column" | ||
| 23 | :data="lastuserList" | ||
| 24 | @selection-change="handleSelectionChange" | ||
| 25 | @row-click="handleClickTableRow"> | ||
| 26 | > | ||
| 27 | </lb-table> | ||
| 28 | <lb-table | ||
| 29 | :key="menukey" | ||
| 30 | v-if="activeName == 'second'" | ||
| 31 | :pagination="false" | ||
| 32 | :column="menutableData.column" | ||
| 33 | :data="lastMenuList" | ||
| 34 | row-key="id" | ||
| 35 | default-expand-all | ||
| 36 | :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> | ||
| 37 | </lb-table> | ||
| 38 | </div> | ||
| 39 | <template slot="footer"> | ||
| 40 | <btn nativeType="cx" type="primary" @click="handleSaveMember()">保存</btn> | ||
| 41 | <btn nativeType="cz" @click="close()">取消</btn> | ||
| 42 | </template> | ||
| 43 | </el-dialog> | ||
| 44 | </template> | ||
| 45 | |||
| 46 | <script> | ||
| 47 | import { api } from "@/api/manageApi"; | ||
| 48 | import { getRoleAuthorityList, roleAuthority } from "@/api/authorityManage"; | ||
| 49 | import { updateUser } from "@/api/personnelManage"; | ||
| 50 | export default { | ||
| 51 | name: "", | ||
| 52 | data () { | ||
| 53 | return { | ||
| 54 | title: "人员配置", | ||
| 55 | visible: false, | ||
| 56 | menutableData: { | ||
| 57 | column: [ | ||
| 58 | { | ||
| 59 | prop: "name", | ||
| 60 | width: 830, | ||
| 61 | label: "菜单名称", | ||
| 62 | } | ||
| 63 | ].concat([ | ||
| 64 | { | ||
| 65 | label: "权限", | ||
| 66 | render: (h, scope) => { | ||
| 67 | return ( | ||
| 68 | <div> | ||
| 69 | <el-checkbox v-model={scope.row.checkArr[0].value} | ||
| 70 | disabled={scope.row.checkArr[0].disabled} | ||
| 71 | label={scope.row.checkArr[0].name} onChange={(checked) => { | ||
| 72 | this.changeCheck(checked, scope.row.checkArr[0].id, scope); | ||
| 73 | }} /> | ||
| 74 | <el-checkbox v-model={scope.row.checkArr[1].value} | ||
| 75 | disabled={scope.row.checkArr[0].disabled} | ||
| 76 | label={scope.row.checkArr[1].name} | ||
| 77 | onChange={(checked) => { | ||
| 78 | this.changeCheck(checked, scope.row.checkArr[1].id, scope); | ||
| 79 | }} /> | ||
| 80 | </div> | ||
| 81 | ); | ||
| 82 | }, | ||
| 83 | }, | ||
| 84 | ]), | ||
| 85 | }, | ||
| 86 | usertableData: { | ||
| 87 | column: [ | ||
| 88 | { | ||
| 89 | type: "selection", | ||
| 90 | width: 330, | ||
| 91 | }, | ||
| 92 | { | ||
| 93 | prop: "name", | ||
| 94 | width: 330, | ||
| 95 | label: "姓名", | ||
| 96 | }, | ||
| 97 | { | ||
| 98 | prop: "loginName", | ||
| 99 | label: "用户名", | ||
| 100 | }, | ||
| 101 | ], | ||
| 102 | }, | ||
| 103 | // 角色id | ||
| 104 | roleId: "", | ||
| 105 | menuList: [], // 菜单列表 | ||
| 106 | menukey: 0, | ||
| 107 | activeName: "first", | ||
| 108 | lastuserList: [], // 人员表格数据 | ||
| 109 | lastMenuList: [], // 重构完成的菜单表格数据 | ||
| 110 | usermultipleSelection: [], | ||
| 111 | // 选中菜单列表 | ||
| 112 | checkArr: [], // 重构操作符列表 | ||
| 113 | authorityList: [], // 授权回显数组 | ||
| 114 | checklistbor: [], | ||
| 115 | // 授权对象数据 | ||
| 116 | menuprams: {}, | ||
| 117 | // 系统code | ||
| 118 | selectedSubsystemCode: "" | ||
| 119 | }; | ||
| 120 | }, | ||
| 121 | computed: {}, | ||
| 122 | |||
| 123 | created () { | ||
| 124 | }, | ||
| 125 | mounted () { | ||
| 126 | }, | ||
| 127 | methods: { | ||
| 128 | |||
| 129 | // 人员配置点击行勾选数据 | ||
| 130 | handleClickTableRow (row, event) { | ||
| 131 | this.checkNum = 0; | ||
| 132 | this.isCheck = false; | ||
| 133 | if (event.label == "操作") { | ||
| 134 | return; | ||
| 135 | } else { | ||
| 136 | if (row.status == "0") { | ||
| 137 | return; | ||
| 138 | } else { | ||
| 139 | if (this.usermultipleSelection.length > 0) { | ||
| 140 | if ( | ||
| 141 | JSON.stringify(this.usermultipleSelection).indexOf( | ||
| 142 | JSON.stringify(row) | ||
| 143 | ) == -1 | ||
| 144 | ) { | ||
| 145 | this.usermultipleSelection.push(row); | ||
| 146 | this.$refs.multipleTable.toggleRowSelection(row, true); | ||
| 147 | } else { | ||
| 148 | this.usermultipleSelection.map((item, index) => { | ||
| 149 | if (item.id == row.id) { | ||
| 150 | this.usermultipleSelection.splice(index, 1); | ||
| 151 | this.$refs.multipleTable.toggleRowSelection(row, false); | ||
| 152 | } | ||
| 153 | }); | ||
| 154 | } | ||
| 155 | } else { | ||
| 156 | this.usermultipleSelection.push(row); | ||
| 157 | this.$refs.multipleTable.toggleRowSelection(row, true); | ||
| 158 | } | ||
| 159 | } | ||
| 160 | } | ||
| 161 | if (this.usermultipleSelection.length > 0) { | ||
| 162 | this.checkNum = this.usermultipleSelection.length; | ||
| 163 | this.isCheck = true; | ||
| 164 | } else { | ||
| 165 | this.isCheck = false; | ||
| 166 | } | ||
| 167 | }, | ||
| 168 | // 获取授权主体的菜单权限 | ||
| 169 | // getMenuAuthorityList | ||
| 170 | menulist (operationList, id, Code, menutablelistData, operationCodes) { | ||
| 171 | this.selectedSubsystemCode = Code | ||
| 172 | this.menuList = menutablelistData; | ||
| 173 | getRoleAuthorityList( | ||
| 174 | id, | ||
| 175 | operationList.toString(), | ||
| 176 | Code + '_MENU' | ||
| 177 | ).then(res => { | ||
| 178 | if (res.status === 1) { | ||
| 179 | this.authorityList = res.content | ||
| 180 | this.getRecursionTreeData(this.menuList, this.authorityList, operationCodes) | ||
| 181 | this.getAuthorizedInfo() | ||
| 182 | // this.setCheckAllArr() | ||
| 183 | // this.getAuthorizedInfo() | ||
| 184 | } else { | ||
| 185 | this.$message.error({ message: res.message, showClose: true }) | ||
| 186 | } | ||
| 187 | }) | ||
| 188 | |||
| 189 | |||
| 190 | }, | ||
| 191 | /** | ||
| 192 | * 递归渲染列表数据 | ||
| 193 | * list:原始数组 | ||
| 194 | * authorityList:已授权数组 | ||
| 195 | */ | ||
| 196 | getRecursionTreeData (list, authorityList, operationCodes) { | ||
| 197 | ++this.menukey | ||
| 198 | this.checkArr = [] | ||
| 199 | for (const k in operationCodes) { | ||
| 200 | const obj = {} | ||
| 201 | obj.name = operationCodes[k] | ||
| 202 | obj.id = k | ||
| 203 | obj.value = false | ||
| 204 | obj.disabled = false | ||
| 205 | // obj.isAll = false; | ||
| 206 | this.checkArr.push(obj) | ||
| 207 | } | ||
| 208 | for (const [index, item] of Object.entries(list)) { | ||
| 209 | this.setAuthorizedConditions( | ||
| 210 | authorityList, | ||
| 211 | this.$deepCopy(this.checkArr), | ||
| 212 | item | ||
| 213 | ) | ||
| 214 | if ( | ||
| 215 | item.children && | ||
| 216 | item.children !== null && | ||
| 217 | item.children.length !== 0 | ||
| 218 | ) { | ||
| 219 | item.children.forEach((child, j) => { | ||
| 220 | this.setAuthorizedConditions( | ||
| 221 | authorityList, | ||
| 222 | this.$deepCopy(this.checkArr), | ||
| 223 | child | ||
| 224 | ) | ||
| 225 | }) | ||
| 226 | this.getRecursionTreeData(item.children, authorityList, operationCodes) | ||
| 227 | } | ||
| 228 | } | ||
| 229 | this.lastMenuList = list | ||
| 230 | // this.setCheckAllArr(list) | ||
| 231 | }, | ||
| 232 | // 授权条件 | ||
| 233 | setAuthorizedConditions (authorityList, checkArr, item) { | ||
| 234 | if (this.roleId === '') { | ||
| 235 | checkArr.forEach(ele => { | ||
| 236 | ele.disabled = true | ||
| 237 | ele.value = false | ||
| 238 | }) | ||
| 239 | } else { | ||
| 240 | if (authorityList.length !== 0) { | ||
| 241 | if (authorityList[0].superPermission === true) { | ||
| 242 | checkArr.forEach(ele => { | ||
| 243 | ele.value = true | ||
| 244 | ele.disabled = true | ||
| 245 | }) | ||
| 246 | } else { | ||
| 247 | const repeatArr = authorityList.filter(authorityItem => { | ||
| 248 | return authorityItem.resourceUri === item.id | ||
| 249 | }) | ||
| 250 | repeatArr.forEach(element => { | ||
| 251 | checkArr.forEach(ele => { | ||
| 252 | if (element.operationCode === ele.id) { | ||
| 253 | ele.value = true | ||
| 254 | if (this.roleId !== element.subjectId) { | ||
| 255 | ele.disabled = true | ||
| 256 | } | ||
| 257 | } | ||
| 258 | }) | ||
| 259 | }) | ||
| 260 | } | ||
| 261 | } | ||
| 262 | } | ||
| 263 | this.$set(item, 'checkArr', this.$deepCopy(checkArr)) | ||
| 264 | }, | ||
| 265 | // 获取拼接授权信息 | ||
| 266 | getAuthorizedInfo () { | ||
| 267 | const lastArr = [] | ||
| 268 | const authorizedList = [] | ||
| 269 | const wholeArr = this.$deepCopy(this.lastMenuList) | ||
| 270 | const arr = this.$treeConvertToArr(wholeArr) | ||
| 271 | arr.forEach(ele => { | ||
| 272 | ele.checkArr.forEach(val => { | ||
| 273 | if (val.value === true && val.disabled === false) { | ||
| 274 | const obj = { | ||
| 275 | operationCode: val.id, | ||
| 276 | name: ele.name, | ||
| 277 | id: ele.id | ||
| 278 | } | ||
| 279 | lastArr.push(obj) | ||
| 280 | } | ||
| 281 | }) | ||
| 282 | }) | ||
| 283 | lastArr.forEach(element => { | ||
| 284 | authorizedList.push({ | ||
| 285 | operationCode: element.operationCode, // 标识符 | ||
| 286 | productCode: this.selectedSubsystemCode, // 子系统code | ||
| 287 | resourceCategoryCode: this.selectedSubsystemCode + '_MENU', // 资源类别code默认为MENU | ||
| 288 | resourceName: element.name, | ||
| 289 | resourceUri: element.id, // 授权菜单id | ||
| 290 | subjectId: this.roleId, // 授权对象id | ||
| 291 | subjectType: 'ROLE' // 授权对象类别 | ||
| 292 | }) | ||
| 293 | }) | ||
| 294 | this.menuprams = { | ||
| 295 | subjectId: this.roleId, | ||
| 296 | authorizedList: authorizedList | ||
| 297 | } | ||
| 298 | }, | ||
| 299 | // 获取人员列表做筛选 | ||
| 300 | personlist (a, rid) { | ||
| 301 | this.roleId = rid; | ||
| 302 | this.visible = true; | ||
| 303 | this.lastuserList = a; | ||
| 304 | this.lastuserList.forEach((item, index) => { | ||
| 305 | if (item.selectStatus === 0) { | ||
| 306 | this.$nextTick(async () => { | ||
| 307 | await this.$refs.multipleTable | ||
| 308 | if (this.$refs.multipleTable) { | ||
| 309 | this.$refs.multipleTable.toggleRowSelection( | ||
| 310 | this.lastuserList[index], | ||
| 311 | true | ||
| 312 | ); | ||
| 313 | } | ||
| 314 | |||
| 315 | }); | ||
| 316 | } | ||
| 317 | }); | ||
| 318 | }, | ||
| 319 | // 关闭事件 | ||
| 320 | close () { | ||
| 321 | this.visible = false; | ||
| 322 | }, | ||
| 323 | // 保存事件 | ||
| 324 | handleSaveMember () { | ||
| 325 | // 人员授权 | ||
| 326 | const idList = this.usermultipleSelection.map((item) => { | ||
| 327 | return item.id; | ||
| 328 | }) | ||
| 329 | updateUser(this.roleId, idList).then((res) => { | ||
| 330 | if (res.status === 1) { | ||
| 331 | this.$message.success({ message: "保存成功", showClose: true }); | ||
| 332 | this.visible = false; | ||
| 333 | } else this.$message.error({ message: res.message, showClose: true }); | ||
| 334 | }); | ||
| 335 | // 菜单授权 | ||
| 336 | roleAuthority( | ||
| 337 | this.menuprams.subjectId, | ||
| 338 | this.menuprams.authorizedList | ||
| 339 | ).then((res) => { | ||
| 340 | if (res.status === 1) { | ||
| 341 | this.$message.success({ | ||
| 342 | message: res.message, | ||
| 343 | }) | ||
| 344 | // this.authorizedContChange() | ||
| 345 | } else { | ||
| 346 | this.$message.error({ message: res.message, showClose: true }) | ||
| 347 | } | ||
| 348 | }) | ||
| 349 | }, | ||
| 350 | // 勾选人员事件 | ||
| 351 | handleSelectionChange (val) { | ||
| 352 | this.lastuserList.forEach((element, index) => { | ||
| 353 | delete this.lastuserList[index].selectStatus | ||
| 354 | }); | ||
| 355 | this.usermultipleSelection = val; | ||
| 356 | this.lastuserList.forEach((element, index) => { | ||
| 357 | this.usermultipleSelection.forEach(element1 => { | ||
| 358 | if (element.id == element1.id) { | ||
| 359 | this.lastuserList[index].selectStatus = 0 | ||
| 360 | } | ||
| 361 | }); | ||
| 362 | }); | ||
| 363 | }, | ||
| 364 | // 数据筛选 | ||
| 365 | setarrdata (scope, arr) { | ||
| 366 | |||
| 367 | arr.forEach((item, index, arr) => { | ||
| 368 | if (item.id == scope.row.id) { | ||
| 369 | this.checklistbor = [...arr] | ||
| 370 | } else if (item.id !== scope.row.id && item.children) { | ||
| 371 | this.setarrdata(scope, item.children) | ||
| 372 | } | ||
| 373 | |||
| 374 | }) | ||
| 375 | |||
| 376 | }, | ||
| 377 | // 勾选菜单事件 | ||
| 378 | changeCheck (flag, checkId, scope) { | ||
| 379 | this.checklistbor = [] | ||
| 380 | this.setarrdata(scope, this.lastMenuList) | ||
| 381 | const parents = this.$findParent(this.lastMenuList, scope.row.parentId) | ||
| 382 | const childs = this.$findChildren(this.lastMenuList, scope.row.id) | ||
| 383 | this.$setChildArr( | ||
| 384 | this.lastMenuList, | ||
| 385 | scope.row.id, | ||
| 386 | checkId, | ||
| 387 | flag, | ||
| 388 | this.checklistbor, | ||
| 389 | parents, | ||
| 390 | childs | ||
| 391 | ) | ||
| 392 | this.getAuthorizedInfo() | ||
| 393 | }, | ||
| 394 | handleClick (tab, event) { | ||
| 395 | this.lastuserList.forEach((item, index) => { | ||
| 396 | if (item.selectStatus === 0) { | ||
| 397 | this.$nextTick(async () => { | ||
| 398 | await this.$refs.multipleTable | ||
| 399 | if (this.$refs.multipleTable) { | ||
| 400 | this.$refs.multipleTable.toggleRowSelection( | ||
| 401 | this.lastuserList[index], | ||
| 402 | true | ||
| 403 | ); | ||
| 404 | } | ||
| 405 | |||
| 406 | }); | ||
| 407 | } | ||
| 408 | }); | ||
| 409 | } | ||
| 410 | |||
| 411 | }, | ||
| 412 | }; | ||
| 413 | </script> | ||
| 414 | <style scoped lang="scss"> | ||
| 415 | /deep/.dialogBox .el-dialog__header { | ||
| 416 | height: 59px !important; | ||
| 417 | } | ||
| 418 | </style> |
| 1 | <template> | ||
| 2 | <div class="informationbase"> | ||
| 3 | <el-form | ||
| 4 | ref="form" | ||
| 5 | label-width="100px" | ||
| 6 | :model="form" | ||
| 7 | class="form-wrapper" | ||
| 8 | :rules="rules"> | ||
| 9 | <el-form-item label="用户名:" required> | ||
| 10 | <el-input v-model="form.loginName" clearable disabled /> | ||
| 11 | </el-form-item> | ||
| 12 | <el-form-item label="姓名:"> | ||
| 13 | <el-input v-model="form.name" clearable /> | ||
| 14 | </el-form-item> | ||
| 15 | <el-form-item label="性别:"> | ||
| 16 | <el-radio-group v-model="form.sex"> | ||
| 17 | <el-radio | ||
| 18 | v-for="(item, index) in sexList" | ||
| 19 | :key="index" | ||
| 20 | :label="item.value">{{ item.name }}</el-radio> | ||
| 21 | </el-radio-group> | ||
| 22 | </el-form-item> | ||
| 23 | <el-form-item label="身份证号:" prop="idCard"> | ||
| 24 | <el-input v-model="form.idCard" clearable /> | ||
| 25 | </el-form-item> | ||
| 26 | <el-form-item label="手机号码:" prop="mobilePhone"> | ||
| 27 | <el-input v-model="form.mobilePhone" clearable /> | ||
| 28 | </el-form-item> | ||
| 29 | <el-form-item label="办公电话:"> | ||
| 30 | <el-input v-model="form.telephone" clearable /> | ||
| 31 | </el-form-item> | ||
| 32 | <el-form-item label="办公地址:"> | ||
| 33 | <el-input v-model="form.address" clearable /> | ||
| 34 | </el-form-item> | ||
| 35 | </el-form> | ||
| 36 | <div class="bottom-wrapper"> | ||
| 37 | <btn nativeType="cx" type="primary" @click="updateInfo">更新信息</btn> | ||
| 38 | </div> | ||
| 39 | </div> | ||
| 40 | </template> | ||
| 41 | |||
| 42 | <script> | ||
| 43 | import { api, getAction, putAction, getDictItems } from '@/api/manageApi' | ||
| 44 | export default { | ||
| 45 | props: { | ||
| 46 | userInfo: { | ||
| 47 | type: Object, | ||
| 48 | default: null | ||
| 49 | } | ||
| 50 | }, | ||
| 51 | data () { | ||
| 52 | return { | ||
| 53 | form: {}, | ||
| 54 | sexList: [], | ||
| 55 | rules: { | ||
| 56 | mobilePhone: [ | ||
| 57 | { | ||
| 58 | pattern: | ||
| 59 | /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, | ||
| 60 | message: '手机号码格式有误', | ||
| 61 | trigger: 'blur' | ||
| 62 | } | ||
| 63 | ], | ||
| 64 | idCard: [ | ||
| 65 | { | ||
| 66 | pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, | ||
| 67 | message: '身份证号格式有误', | ||
| 68 | trigger: 'blur' | ||
| 69 | } | ||
| 70 | ] | ||
| 71 | } | ||
| 72 | } | ||
| 73 | }, | ||
| 74 | watch: { | ||
| 75 | userInfo: { | ||
| 76 | handler: function (val) { | ||
| 77 | if (val) { | ||
| 78 | this.getUserdata(val.id) | ||
| 79 | } | ||
| 80 | } | ||
| 81 | } | ||
| 82 | }, | ||
| 83 | mounted () { | ||
| 84 | if (this.userInfo) { | ||
| 85 | this.getUserdata(this.userInfo.id) | ||
| 86 | } | ||
| 87 | this.sexList = [ | ||
| 88 | { | ||
| 89 | "name": "男", | ||
| 90 | "value": "0", | ||
| 91 | }, | ||
| 92 | { | ||
| 93 | |||
| 94 | "name": "女", | ||
| 95 | "value": "1", | ||
| 96 | }, | ||
| 97 | |||
| 98 | { | ||
| 99 | "name": "保密", | ||
| 100 | "value": "2", | ||
| 101 | |||
| 102 | } | ||
| 103 | ] | ||
| 104 | }, | ||
| 105 | methods: { | ||
| 106 | getUserdata (id) { | ||
| 107 | getAction(`${api.users}/${id}`).then((res) => { | ||
| 108 | if (res.status === 1) { | ||
| 109 | this.form = res.content | ||
| 110 | } else { | ||
| 111 | this.$message.error({ message: res.message, showClose: true }) | ||
| 112 | } | ||
| 113 | }) | ||
| 114 | }, | ||
| 115 | updateInfo () { | ||
| 116 | this.$refs.form.validate((valid) => { | ||
| 117 | if (valid) { | ||
| 118 | putAction(`${api.users}/${this.form.id}`, this.form).then((res) => { | ||
| 119 | if (res.status === 1) { | ||
| 120 | this.$message.success({ message: res.message, showClose: true }) | ||
| 121 | this.getUserdata(this.form.id) | ||
| 122 | } else { | ||
| 123 | this.$message.error({ message: res.message, showClose: true }) | ||
| 124 | } | ||
| 125 | }) | ||
| 126 | } | ||
| 127 | }) | ||
| 128 | } | ||
| 129 | } | ||
| 130 | } | ||
| 131 | </script> | ||
| 132 | |||
| 133 | <style scoped lang="scss"> | ||
| 134 | .user-info { | ||
| 135 | margin: 0.1875rem 1.0417rem; | ||
| 136 | overflow-y: auto; | ||
| 137 | .form-wrapper { | ||
| 138 | padding: 0px 120px 0px; | ||
| 139 | .el-form-item { | ||
| 140 | /deep/.el-form-item__label { | ||
| 141 | color: #ffffff; | ||
| 142 | } | ||
| 143 | ::v-deep .el-input .el-input__inner { | ||
| 144 | padding: 0 8px; | ||
| 145 | height: 40px; | ||
| 146 | line-height: 40px; | ||
| 147 | border: 1px solid #6bc1fc; | ||
| 148 | } | ||
| 149 | } | ||
| 150 | .el-form-item--small.el-form-item { | ||
| 151 | margin-bottom: 16px; | ||
| 152 | } | ||
| 153 | } | ||
| 154 | .bottom-wrapper { | ||
| 155 | padding: 0px 120px 0px; | ||
| 156 | text-align: center; | ||
| 157 | } | ||
| 158 | } | ||
| 159 | </style> |
| 1 | <!-- | ||
| 2 | * @Author: xiaomiao 1158771342@qq.com | ||
| 3 | * @Date: 2023-03-09 20:54:28 | ||
| 4 | * @LastEditors: Please set LastEditors | ||
| 5 | * @LastEditTime: 2023-03-30 11:21:49 | ||
| 6 | * @FilePath: \上报\bdcjg-web\src\views\system\information\index.vue | ||
| 7 | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||
| 8 | --> | ||
| 9 | <template> | ||
| 10 | <div class="information from-clues"> | ||
| 11 | <div class="from-clues-header"> | ||
| 12 | <el-form ref="ruleForm" label-width="100px"> | ||
| 13 | <el-form-item v-if="BASE_API.THEME == 'jg'"> | ||
| 14 | <Breadcrumb /> | ||
| 15 | </el-form-item> | ||
| 16 | <el-row class="mb-5"> | ||
| 17 | <el-col class="btnColRight"> | ||
| 18 | <btn nativeType="cx" @click="information"> | ||
| 19 | 基本信息 | ||
| 20 | </btn> | ||
| 21 | <btn nativeType="cx" @click="password"> | ||
| 22 | 修改密码 | ||
| 23 | </btn> | ||
| 24 | </el-col> | ||
| 25 | </el-row> | ||
| 26 | </el-form> | ||
| 27 | </div> | ||
| 28 | <div class="from-clues-content"> | ||
| 29 | <div class="contentbox"> | ||
| 30 | <base-set v-if="isshow" :userInfo="userData" /> | ||
| 31 | <password-edit v-if="!isshow" :userInfo="userData" /> | ||
| 32 | </div> | ||
| 33 | </div> | ||
| 34 | </div> | ||
| 35 | </template> | ||
| 36 | <script> | ||
| 37 | import "@/utils/flexible.js"; | ||
| 38 | import BaseSet from "./base-set.vue"; | ||
| 39 | import PasswordEdit from "./password-edit.vue"; | ||
| 40 | export default { | ||
| 41 | components: { | ||
| 42 | BaseSet, | ||
| 43 | PasswordEdit, | ||
| 44 | }, | ||
| 45 | data () { | ||
| 46 | return { | ||
| 47 | isshow: true, | ||
| 48 | }; | ||
| 49 | }, | ||
| 50 | computed: { | ||
| 51 | userData () { | ||
| 52 | return this.$store.state.user.userInfo; | ||
| 53 | }, | ||
| 54 | }, | ||
| 55 | watch: {}, | ||
| 56 | created () { }, | ||
| 57 | mounted () { }, | ||
| 58 | methods: { | ||
| 59 | information () { | ||
| 60 | this.isshow = true; | ||
| 61 | }, | ||
| 62 | password () { | ||
| 63 | this.isshow = false; | ||
| 64 | }, | ||
| 65 | }, | ||
| 66 | }; | ||
| 67 | </script> | ||
| 68 | |||
| 69 | <style scoped lang="scss"> | ||
| 70 | @import "~@/styles/mixin.scss"; | ||
| 71 | </style> |
| 1 | <template> | ||
| 2 | <div class="informationpassword"> | ||
| 3 | <el-form | ||
| 4 | ref="form" | ||
| 5 | label-width="100px" | ||
| 6 | :model="form" | ||
| 7 | class="form-wrapper" | ||
| 8 | :rules="rules"> | ||
| 9 | <el-form-item label="旧密码:" prop="oldPassword"> | ||
| 10 | <el-input | ||
| 11 | v-model="form.oldPassword" | ||
| 12 | clearable | ||
| 13 | type="password" | ||
| 14 | show-password /> | ||
| 15 | </el-form-item> | ||
| 16 | <el-form-item label="新密码:" prop="newPassword"> | ||
| 17 | <el-input | ||
| 18 | v-model="form.newPassword" | ||
| 19 | clearable | ||
| 20 | type="password" | ||
| 21 | show-password /> | ||
| 22 | </el-form-item> | ||
| 23 | <el-form-item label="确认密码:" prop="confirmPassword"> | ||
| 24 | <el-input | ||
| 25 | v-model="form.confirmPassword" | ||
| 26 | clearable | ||
| 27 | type="password" | ||
| 28 | show-password /> | ||
| 29 | </el-form-item> | ||
| 30 | </el-form> | ||
| 31 | <div class="bottom-wrapper"> | ||
| 32 | <btn nativeType="cx" type="primary" @click="updatePassword">确认修改</btn> | ||
| 33 | </div> | ||
| 34 | </div> | ||
| 35 | </template> | ||
| 36 | |||
| 37 | <script> | ||
| 38 | import { updateUserPassword } from "@/api/personnelManage"; | ||
| 39 | export default { | ||
| 40 | props: { | ||
| 41 | userInfo: { | ||
| 42 | type: Object, | ||
| 43 | default: null, | ||
| 44 | }, | ||
| 45 | }, | ||
| 46 | data () { | ||
| 47 | return { | ||
| 48 | form: {}, | ||
| 49 | sexList: [], | ||
| 50 | userId: "", | ||
| 51 | rules: { | ||
| 52 | oldPassword: [ | ||
| 53 | { required: true, message: "旧密码不能为空", trigger: "blur" }, | ||
| 54 | ], | ||
| 55 | newPassword: [ | ||
| 56 | { required: true, message: "新密码不能为空", trigger: "blur" }, | ||
| 57 | ], | ||
| 58 | confirmPassword: [ | ||
| 59 | { required: true, message: "确认密码不能为空", trigger: "blur" }, | ||
| 60 | { validator: this.validatorConfirmPassword, trigger: "blur" }, | ||
| 61 | ], | ||
| 62 | }, | ||
| 63 | }; | ||
| 64 | }, | ||
| 65 | computed: {}, | ||
| 66 | watch: { | ||
| 67 | userInfo: { | ||
| 68 | handler: function (val) { | ||
| 69 | if (val) { | ||
| 70 | this.getid(val); | ||
| 71 | } | ||
| 72 | }, | ||
| 73 | }, | ||
| 74 | }, | ||
| 75 | mounted () { | ||
| 76 | if (this.userInfo) { | ||
| 77 | this.getid(this.userInfo); | ||
| 78 | } | ||
| 79 | }, | ||
| 80 | methods: { | ||
| 81 | getid (val) { | ||
| 82 | this.userId = val.id; | ||
| 83 | }, | ||
| 84 | validatorConfirmPassword (rule, value, callback) { | ||
| 85 | const { newPassword } = this.form; | ||
| 86 | if (value !== newPassword) { | ||
| 87 | callback("两次输入密码不一致"); | ||
| 88 | } else { | ||
| 89 | callback(); | ||
| 90 | } | ||
| 91 | }, | ||
| 92 | updatePassword () { | ||
| 93 | this.$refs.form.validate((valid) => { | ||
| 94 | if (valid) { | ||
| 95 | const params = Object.assign({}, this.form, { id: this.userId }); | ||
| 96 | updateUserPassword(params).then((res) => { | ||
| 97 | if (res.status === 1) { | ||
| 98 | this.$message.success({ message: res.message, showClose: true }); | ||
| 99 | } else { | ||
| 100 | this.$message.error({ message: res.message, showClose: true }); | ||
| 101 | } | ||
| 102 | }); | ||
| 103 | } | ||
| 104 | }); | ||
| 105 | }, | ||
| 106 | }, | ||
| 107 | }; | ||
| 108 | </script> | ||
| 109 | |||
| 110 | <style scoped lang="scss"> | ||
| 111 | </style> |
-
Please register or sign in to post a comment