42045f44 by renchao@pashanhoo.com

Merge branch 'dev'

2 parents 1cda2e6f 9ec6679c
......@@ -26,7 +26,6 @@
"AREARMAP": "610702", // {"610702","632701"}
"calcHeight": 200, {上报:160 监管:200}
"echartTextColor": "#FFFFFF", {上报:"#4A4A4A" 监管:"#FFFFFF"}
"MANAGEMENTAPI": "http://192.168.2.38:8090/management"
}
## 行政区编码
......
......@@ -4,6 +4,5 @@
"AREARMAP": "610702",
"XZQ": "汉中市",
"SERVERAPI": "/bdcsjsb",
"MANAGEMENTAPI": "http://192.168.2.38:8090/management",
"ip": "http://192.168.2.38"
}
\ No newline at end of file
......
/*
* @Author: yangwei
* @Date: 2023-02-24 15:12:45
* @LastEditors: yangwei
* @LastEditTime: 2023-03-14 10:45:11
* @FilePath: \bdcjg-web\src\api\authorityManage.js
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
import { getParams } from './util'
import {
api,
getAction,
deleteAction,
putAction
} from './manageApi'
/** 角色管理开始 */
// 获取角色列表 by categoryId
export const getRolesById = categoryIdList => {
const conditionGroup = {
conditions: [
{
property: 'category',
value: categoryIdList,
operator: 'IN'
}
],
queryRelation: 'AND',
}
const params = getParams(conditionGroup)
return getAction(api.roles, params)
}
/** 角色管理结束 */
/** 授权管理开始 */
// 获取权限列表
export const getAuthorityListAction = (productId, subsystemCode) => {
const conditionGroup = {
conditions: [
{
property: 'productId',
value: productId,
operator: 'EQ'
},
{
property: 'code',
value: subsystemCode + '_MENU',
operator: 'EQ'
}
],
queryRelation: 'AND'
}
const params = getParams(conditionGroup)
return getAction(api.resourceCategory, params)
}
/**
* 获取角色的权限 id operationCodes resourceCategoryCode
* id 授权id
* operationCodes 操作符集合
* resourceCategoryCode 菜单默认MENU
*/
export const getRoleAuthorityList = (
id,
operationCodes,
resourceCategoryCode
) => {
return getAction(`${api.rolePermissions}/${id}`, {
operationCodes: operationCodes,
resourceCategoryCode: resourceCategoryCode
})
}
// 角色授权
export const roleAuthority = (id, permissionDtos) => {
return putAction(`${api.rolePermissions}/${id}`, permissionDtos)
}
// 获取父级菜单
// id是系统id
export const getParentMenuListAction = (id) => {
let conditionGroup = {}
if (id && id !== '') {
conditionGroup = {
conditions: [
{
property: 'productId',
value: id,
operator: 'EQ'
}
],
queryRelation: 'AND'
}
}
const params = getParams(conditionGroup)
return getAction(api.menus, params)
}
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-05-08 15:03:10
*/
import request from "@/utils/request";
let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl'))
export function loginIn (username, password) {
return request({
url: `${SERVER.MANAGEMENTAPI}/login?username=${username}&password=${password}`,
method: "post",
});
}
export function logout () {
return request({
url: `${SERVER.MANAGEMENTAPI}/logout`,
method: "post",
});
}
\ No newline at end of file
/*
* @Description :公共方法api文件
* @Autor : miaofang
* @LastEditTime : 2023-05-17 10:41:47
*/
import request from '@/utils/request'
// let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl'))
let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl'))
const workflow = '/workflow'
const log = '/log'
const crud = '/crud'
export const api = {
userInfo: SERVER.MANAGEMENTAPI + '/rest/user-info', // 登录用户信息
permissionsUser: SERVER.MANAGEMENTAPI + '/rest/user-permissions', // 用户权限
baseDataCategory: SERVER.MANAGEMENTAPI + '/rest/base-data-category', // 数据字典类别
baseData: SERVER.MANAGEMENTAPI + '/rest/base-data', // 数据字典
districts: SERVER.MANAGEMENTAPI + '/rest/districts', // 行政区划
districtsAll: SERVER.MANAGEMENTAPI + '/rest/districts/parent-tree', // 条件查询所有行政区划
organizations: SERVER.MANAGEMENTAPI + '/rest/organizations', // 组织机构
departments: SERVER.MANAGEMENTAPI + '/rest/departments', // 部门
users: SERVER.MANAGEMENTAPI + '/rest/users', // 人员用户
roles: SERVER.MANAGEMENTAPI + '/rest/roles', // 角色
userRoles: SERVER.MANAGEMENTAPI + '/rest/user-roles', // 角色对应人员关系
productCategory: SERVER.MANAGEMENTAPI + '/rest/product-category', // 业务分类
resourceCategory: SERVER.MANAGEMENTAPI + '/rest/resource-category', // 资源分类
resources: SERVER.MANAGEMENTAPI + '/rest/resources', // 资源详情列表
subsystem: SERVER.MANAGEMENTAPI + '/rest/products', // 子系统管理
operations: SERVER.MANAGEMENTAPI + '/rest/operations', // 操作
menus: SERVER.MANAGEMENTAPI + '/rest/menus', // 菜单
organizationPermissions: SERVER.MANAGEMENTAPI + '/rest/organization-permissions', // 机构授权
departmentPermissions: SERVER.MANAGEMENTAPI + '/rest/department-permissions', // 部门授权
rolePermissions: SERVER.MANAGEMENTAPI + '/rest/role-permissions', // 角色授权
peoPermissions: SERVER.MANAGEMENTAPI + '/rest/user-permissions', // 用户授权
resourcePermissions: SERVER.MANAGEMENTAPI + '/rest/resource-permissions', // 资源授权查询
menuPermissions: SERVER.MANAGEMENTAPI + '/rest/menu-permissions', // 菜单授权查询
serviceCategory: SERVER.MANAGEMENTAPI + '/rest/service-category', // 服务分类
service: SERVER.MANAGEMENTAPI + '/rest/service', // 服务详情列表
databaseServer: workflow + '/rest/database-server', // 数据库服务器
materialCategory: workflow + '/rest/material-category', // 材料分类
material: workflow + '/rest/material', // 材料
function: workflow + '/rest/function', // 功能属性
eventCategory: workflow + '/rest/event-category', // 服务事件分类
event: workflow + '/rest/event', // 服务事件
formCategorys: workflow + '/rest/forms-category', // 表单分类
forms: workflow + '/rest/forms', // 表单
metadata: workflow + '/rest/metadata', // 元数据
dataObjectCategory: workflow + '/rest/data-object-category', // 对象管理类别
dataObject: workflow + '/rest/data-object', // 对象管理
workflowBusiness: workflow + '/rest/businesses', // 业务流程
// workflowModel: workflow+'/rest/workflow/model',//流程模型
modelcategorys: workflow + '/rest/model-categories', // 模型分类
models: workflow + '/rest/models', // 工作流模型表
businessesModels: workflow + '/rest/businesses-models', // 业务流程关系
pluginCategory: workflow + '/rest/plugin-category', // 流程插件分类管理
plugin: workflow + '/rest/plugins', // 流程插件分类管理
groups: workflow + '/rest/groups', // 用户组分类
groupUsers: workflow + '/rest/group-users', // 用户组人员
saveWorkflowGroupUser: workflow + '/rest/groups/sug', // 工作流设计器增加用户组
validate: workflow + '/rest/models/validate', // 流程验证
tokens: SERVER.MANAGEMENTAPI + '/rest/tokens', // token
session: '/rest/session', // session
pwdSetting: SERVER.MANAGEMENTAPI + '/rest/password-setting', //
singleSign: '/cas/rest/services', // 单点登录管理
attachments: SERVER.MANAGEMENTAPI + '/rest/attachments', // 文件上传服务
instances: workflow + '/rest/workflow/instances', // 实例
workflowTask: workflow + '/rest/workflow-task', // 任务
definitions: workflow + '/rest/workflow/definitions', // 流程实例
systemAccessLogs: log + '/rest/system-access-logs', // 系统访问日志
errorLogs: log + '/rest/common-log-statistics', // 错误日志
appAccess: log + '/rest/system-access-logs/count-app-access', // 系统访问数
userAccess: log + '/rest/system-access-logs/count-user-access', // 用户访问数
statisticMenus: log + '/rest/system-access-logs/statistic-menus', // 统计菜单访问数
statisticUsers: log + '/rest/system-access-logs/statistic-users', // 统计用户访问数
abnormal: log + '/rest/abnormal', // 统计平台报警
monitorConfig: log + '/rest/monitor-alert-config', // 监控预警配置
statisticTimes: log + '/rest/system-access-logs/statistic-times', // 监控预警配置
server: log + '/rest/server', // 服务器监控
serverStatistics: log + '/rest/server-statistics', // 服务器监控信息统计
avgTimes: log + '/rest/services-statistics/avg-times', // 根据时间查响应时间和访问次数
statisticDepts: log + '/rest/system-access-logs/statistic-depts', // 访问部门统计
crudHead: crud + '/rest/head', // crudhead
crudGet: crud + '/rest/get', // crudget
crudPost: crud + '/rest/post', // crudPost
crudPut: crud + '/rest/put', // crudPut
crudDel: crud + '/rest/delete', // crudDel
crudMetadata: crud + '/rest/metadata', //crudMetadata
crudBusiness: crud + '/rest/business', // crudBusiness
crudDatasources: crud + '/rest/datasources', // crudDatasources
}
// 根据code获取字典 params={isTree:true})
export function getDictItems (code, params = {}) {
return request({
url: `${api.baseDataCategory}/${code}/base-datas`,
method: 'get',
params
})
}
// 获取一级字典值下级接口
export function getDictItemsChild (id) {
return request({
url: `${api.baseData}/dict/${id}`,
method: 'get'
})
}
// 获取传入字段的所有级别字典值
export function getAllDictItems (name) {
return request({
url: `${api.baseDataCategory}/${name}/base-datas`,
method: 'get'
})
}
// get
export function getAction (url, params = {}) {
return request({
url,
method: 'get',
params
})
}
// post公共方法
export function postAction (url, data = null) {
return request({
url,
method: 'post',
data
})
}
// method= {post | put}
export function httpAction (url, data, method) {
return request({
url,
method,
data
})
}
// put公共方法
export function putAction (url, data = null) {
return request({
url,
method: 'put',
data
})
}
// delete
export function deleteAction (url, data = null) {
return request({
url,
method: 'delete',
data
})
}
// 批量删除
export function deleteBranch (url, data) {
return request({
url,
method: 'delete',
data
})
}
/*
* @Description :更新排序api文件
* @Autor : miaofang
* @LastEditTime : 2023-05-17 10:41:30
*/
import request from '@/utils/request'
let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl'))
/*
更新排序
record-排序整条数据
operate-BOTTOM(置底), DOWN(向下), TOP(置顶), UP(向上)
*/
export function updateOrder (url, record, operate, swapId) {
return request({
url: SERVER.MANAGEMENTAPI + url + "/" + record.id + "/orders",
method: "put",
params: {
operate: operate,
swapId: swapId,
},
});
}
/*
* @Author: xiaomiao 1158771342@qq.com
* @Date: 2023-03-09 15:24:53
* @LastEditors: xiaomiao 1158771342@qq.com
* @LastEditTime: 2023-04-19 13:49:03
* @FilePath: \上报\bdcjg-web\src\api\personnelManage.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import {
api,
getAction,
deleteAction,
putAction
} from './manageApi'
import { getParams } from './util'
export const updateUserPassword = (data) => {
return putAction(`${api.users}/update-password`, data)
}
// 根据条件获取用户
export const getUserList = (params) => {
return getAction(api.users, params)
}
export const getUserLists = (queryParam) => {
const conditionGroup = {
conditions: [],
queryRelation: 'AND',
}
for (let key in queryParam) {
if (queryParam[key]) {
conditionGroup.conditions.push({
property: key,
value: queryParam[key],
operator: 'LIKE'
})
}
}
const params = getParams(conditionGroup)
return getAction(api.users, params)
}
// 重置用户密码
// export const resetPassword = id => {
// return putAction(`${api.users}/${id}/reset-password`)
// }
// 重置用户密码
export const resetPassword = (ids) => {
return putAction(`${api.users}/reset-passwords?ids=${ids}`)
}
// 人员列表
export const getUserRoles = (id) => {
return getAction(`${api.userRoles}/${id}/users`)
}
// 更新人员
export const updateUser = (id, data) => {
return putAction(`${api.userRoles}/${id}/users`, data)
}
/**
* 新增修改完成调用 dialogFormOk方法重置表单,修改新增弹框组件ref定义为dialogForm
* 弹框组件中新增方法add 编辑方法 edit
* 表格页面的data中tableUrl定义为接口地址
* 弹窗页面定义初始this.init()方法,获取弹窗需要的数据
* 表格ref=xTree
*/
import { deleteAction, getAction } from '@/api/manageApi'
export const TableListMixin = {
data() {
return {
// 查询拼接json字符串
queryOptions: '',
queryParam: {}, // 查询条件
/* 数据源 */
tableData: [],
/* 分页参数*/
ipagination: {
pageNumber: 0,
pageSize: 10
},
/* table选中行*/
selectionRows: [],
loading: false // 表格加载状态
}
},
created() {
// console.log(' -- mixin created -- ')
// 初始化字典配置 在需要页面调用字典值获取方法
this.initDictConfig()
},
methods: {
// 加载表格数据
loadData(arg) {
if (!this.tableUrl) {
console.log('请设置tableUrl属性为接口地址!')
return
}
// 加载数据 若传入参数1则加载第一页的内容
// if (arg === 1) {
// }
const params = this.getQueryParams() // 查询条件
this.loading = true
getAction(this.tableUrl, params)
.then(res => {
if (res.status === 1) {
this.loading = false
this.tableData = res.content
this.$nextTick(() => {
if (this.tableData.length !== 0) {
this.$refs.xTree && this.$refs.xTree.setAllTreeExpand(true)
}
})
} else {
this.$message.error({ message: res.message, showClose: true })
this.loading = false
}
})
.catch(error => {
console.log('error', error)
this.loading = false
})
},
// 字典值配置
initDictConfig() {
// console.log('假初始化字典值方法!')
},
// 选择所有和取消所有
selectAllEvent({ checked, records }) {
this.selectionRows = records
},
// 选中节点
selectChangeEvent({ records }) {
this.selectionRows = records
},
// 使用查询条件查询
searchQuery() {
this.loadData()
},
// 获取查询条件
getQueryParams() {
if (this.queryOptions !== '') {
this.queryParam.queryOptions = JSON.stringify(this.queryOptions)
}
return this.$filterNullObj(this.queryParam)
},
// 新增
handleAdd: function() {
this.$refs.dialogForm.add()
this.$refs.dialogForm.title = '新增'
},
// 修改
handleEdit: function(record) {
localStorage.setItem('record', JSON.stringify(record))
this.$refs.dialogForm.edit(record)
this.$refs.dialogForm.title = '修改'
},
// 删除
handleDelete: function(id, content = '') {
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">您确认要执行该操作用于以下信息:</h5>
<p class="content" aria-controls="${content}">${content}
</p>
<p class="result">执行后,数据将
<span >无法恢复</span>
</p>
</div>`,
'执行确认',
{
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
.then(() => {
if (!this.tableUrl) {
this.$message.error({
message: '请设置tableUrl属性为接口地址!',
showClose: true
})
return
}
const url = this.tableUrl + '/' + id
deleteAction(url).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.loadDataS(this.subcode)
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
})
.catch(() => {})
},
// 批量删除
batchDel: function() {
if (!this.tableUrl) {
this.$message.error({
message: '请设置tableUrl属性为接口地址!',
showClose: true
})
return
}
if (this.selectionRows.length === 0) {
this.$message.error({
message: '请选择删除项!',
showClose: true
})
return
}
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const ids = []
this.selectionRows.forEach(element => {
ids.push(element.id)
})
deleteAction(this.tableUrl, ids).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.loadData()
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
})
.catch(() => {})
},
// 新增或修改成功时,重载列表
dialogFormOk() {
this.loadData()
},
// 导出
handleExportXls(data, name) {
if (name === '菜单' || name === '部门' || name === '机构' ||
name === '资源' || name === '资源分类' || name === '数据字典' || name === '行政区划') {
const params = this.getQueryParams() // 查询条件
getAction(this.tableUrl + '/export', params)
.then(res => {
if (res.status === 1) {
data = res.content
this.$downloadJson(data, name)
} else {
this.$message.error({ message: '导出失败', showClose: true })
}
})
} else if (name === '人员') {
exportUserList(this.queryParam).then((res) => {
if (res.status === 1) {
data = res.content
this.$downloadJson(data, name)
} else {
this.$message.error({ message: '导出失败', showClose: true })
}
})
} else {
this.$downloadJson(data, name)
}
},
/* 导入 */
handleImportExcel(info) {}
}
}
import filter from '@/utils/filter.js'
class data extends filter {
constructor() {
super()
}
columns () {
return [
{
prop: "name",
label: "区县代码",
width: 130
},
{
prop: "description",
label: "业务号"
},
{
prop: "description",
label: "受理业务名称"
},
{
prop: "description",
label: "受理业务编码"
},
{
prop: "description",
label: "受理时间"
},
{
prop: "description",
label: "登记时间"
},
{
prop: "description",
label: "接收时间"
},
{
prop: "description",
label: "读取时间"
}
]
}
}
export default new data()
<!-- 新增 & 修改角色 -->
<template>
<dialogBox
class="PersonnelDialog"
:title="title"
:width="'567px'"
:isMain="true"
@closeDialog="close"
@submitForm="submitForm"
v-model="myValue">
<div class="dialogCon">
<el-form ref="form" :model="dialogForm" :rules="rules" label-width="82px">
<el-row :gutter="24">
<el-col :span="23">
<el-form-item label="角色名称:" prop="roleName">
<el-input
v-model="dialogForm.roleName"
clearable
placeholder="角色名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="备注:" class="form-item-mb0">
<el-input
v-model="dialogForm.roleTextArea"
clearable
:rows="10"
type="textarea"
placeholder="备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- <template slot="footer">
<el-button
class="cancel-button"
@click="handleCloseDialog">取消</el-button>
<el-button
type="primary"
@click="handleSaveRole()">保存</el-button>
</template> -->
</dialogBox>
</template>
<script>
import Dialog from "@/components/Dialog/";
import { api, httpAction } from '@/api/manageApi'
export default {
components: {
Dialog
},
props: {
value: { type: Boolean, default: false },
},
data () {
return {
myValue: this.value,
title: '',
showAddEditDialog: false,
menuType: '',
roleId: '',
sort: 0,
dialogForm: {
roleName: '',
roleType: '',
roleTextArea: ''
},
rules: {
roleName: [
{ required: true, message: '请输入角色名称', trigger: 'blur' }
],
},
roleTypeOptions: [
{ name: '定制', value: '定制' },
{ name: '其他', value: '其他' }
]
}
},
watch: {
value (val) {
this.myValue = val
}
},
methods: {
// 保存新增或关闭事件
submitForm () {
this.$refs.form.validate((valid) => {
if (valid) {
try {
const params = {
category: 2,
description: this.dialogForm.roleTextArea,
name: this.dialogForm.roleName,
sort: this.sort,
type: this.dialogForm.roleType
}
if (this.roleId) {
params.id = this.roleId
httpAction(`${api.roles}/${params.id}`, params, 'post').then(
(res) => {
if (res.status === 1) {
this.$message.success({
message: '修改成功',
showClose: true
})
this.dialogForm = {
roleName: '',
}
// this.showAddEditDialog = val
this.$emit('ok')
} else {
this.$message.error({
message: res.message,
showClose: true
})
}
}
)
} else {
httpAction(api.roles, params, 'post').then((res) => {
if (res.status === 1) {
this.$message.success({
message: '新增成功',
showClose: true
})
this.close()
this.$emit('ok')
// this.showAddEditDialog = val
this.$emit('ok', this.menuType)
} else {
this.$message.error({
message: res.message,
showClose: true
})
}
})
}
} catch (e) {
console.error(e)
}
}
})
},
// 重置
resetForm () {
this.dialogForm = {
roleName: '',
}
this.$refs.form.resetFields()
},
// 关闭
close () {
this.resetForm()
this.$emit('input', false)
}
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div class="from-clues">
<div class="from-clues-header">
<el-form ref="ruleForm" :model="form" label-width="100px">
<!-- 判断进入监管还是上报系统 -->
<el-form-item v-if="BASE_API.THEME=='jg'">
<Breadcrumb />
</el-form-item>
<el-row class="mb-5">
<el-col :span="4">
<el-form-item label="业务号:" prop="ywh">
<el-input v-model="form.ywh" class="width100" clearable placeholder="业务号"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="业务名称" prop="ywmc">
<el-input v-model.trim="form.rolesName" class="width100" clearable placeholder="业务名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="开始日期" prop="startTime">
<el-date-picker type="date" class="width100" placeholder="开始日期" :picker-options="pickerOptionsStart"
clearable v-model="form.startTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="结束日期" prop="endTime">
<el-date-picker type="date" class="width100" placeholder="结束日期" :picker-options="pickerOptionsEnd" clearable
v-model="form.endTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-col>
<!-- 操作按钮 -->
<el-col :span="4" class="btnColRight">
<btn nativeType="cz" @click="resetForm">重置</btn>
<btn nativeType="cx" @click="handleSearch">查询</btn>
</el-col>
</el-row>
</el-form>
</div>
<div class="from-clues-content">
<lb-table :pagination="false" @size-change="handleSizeChange" :calcHeight="160"
@p-current-change="handleCurrentChange" :column="tableData.columns" :data="listdata"
row-key="dictid">
</lb-table>
</div>
</div>
</template>
<script>
import {
getUuid,
judgeSort,
realMove,
findParents,
removeTreeListItem,
} from "@/utils/operation";
import { getRolesById, getAuthorityListAction } from "@/api/authorityManage";
import { getUserRoles } from "@/api/personnelManage";
import data from "./data";
import { getMenuInfo } from "@/api/user";
import { api, getAction, deleteAction } from "@/api/manageApi";
import tableMixin from "@/mixins/tableMixin.js";
import EditDialog from "./edit-dialog.vue";
import Roleslistdiglog from "./roleslistdiglog.vue";
import { mapGetters } from "vuex";
import { updateOrder } from "@/api/orders"
export default {
name: "menus",
mixins: [tableMixin],
components: {
EditDialog,
Roleslistdiglog,
},
data () {
return {
// 开始结束日期限制
pickerOptionsStart: {
disabledDate: (time) => {
if (this.form.endTime) {
return time.getTime() >= new Date(this.form.endTime).getTime()
}
}
},
// 结束日期限制
pickerOptionsEnd: {
disabledDate: (time) => {
if (this.form.startTime) {
return time.getTime() < new Date(this.form.startTime).getTime()
}
}
},
listdata: [],
setlistdata: [],
// 表单
form: {
ywh: '',
ywmc: '',
startTime: '',
endTime: '',
currentPage: 1
},
// 表格数据
tableData: {
columns: [
{
label: "序号",
type: "index",
width: "50",
index: this.indexMethod,
},
]
.concat(data.columns())
.concat({
prop: "state",
label: "状态",
width: '120',
render: (h, scope) => {
return (
<div>
<span class='adopt' v-show={scope.row.state == 3}>上报失败</span>
<span class='adopt' v-show={scope.row.state == 2}>上报成功</span>
<span class='warehousing' v-show={scope.row.state == 1}>接入上报异常</span>
</div>
)
}
})
.concat([]),
},
data: [],
}
},
created () {
this.getTableData();
},
mounted () { },
methods: {
//查询
searchQuery () {
if (this.form.rolesName) {
this.listdata = this.childrenFn(this.setlistdata, this.form.rolesName);
} else {
this.getTableData()
}
},
childrenFn (arr, key) {
let searchTree = [];
arr.forEach((item, index) => {
if (item.name.indexOf(key) != -1) {
searchTree.push(item);
}
});
if (searchTree != undefined && searchTree.length != 0) {
return judgeSort(searchTree);
}
},
// 获取角色列表
getTableData () {
getRolesById([1, 2])
.then((res) => {
this.listdata = res.content;
this.listdata = judgeSort(this.listdata);
this.setlistdata = res.content;
})
.catch((e) => console.error(e));
},
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
// @import "~@/styles/public.scss";
/deep/.el-button.is-disabled.el-button--text {
width: 64px;
height: 28px;
background: rgba(255, 255, 255, 0.1);
border-radius: 16px;
}
</style>
<template>
<el-dialog
:close-on-click-modal="false"
top="0"
@click="close()"
class="roleconfiguration"
custom-class="dialogBox editDialogBox mainCenter"
:visible.sync="visible"
width="85%">
<div slot="title" class="dialog_title" ref="dialogTitle">
{{ title || "标题" }}
</div>
<div class="editDialogBox-box">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="人员配置" name="first"></el-tab-pane>
<el-tab-pane label="菜单配置" name="second"></el-tab-pane>
</el-tabs>
<lb-table
v-if="activeName == 'first'"
ref="multipleTable"
:pagination="false"
:column="usertableData.column"
:data="lastuserList"
@selection-change="handleSelectionChange"
@row-click="handleClickTableRow">
>
</lb-table>
<lb-table
:key="menukey"
v-if="activeName == 'second'"
:pagination="false"
:column="menutableData.column"
:data="lastMenuList"
row-key="id"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
</lb-table>
</div>
<template slot="footer">
<btn nativeType="cx" type="primary" @click="handleSaveMember()">保存</btn>
<btn nativeType="cz" @click="close()">取消</btn>
</template>
</el-dialog>
</template>
<script>
import { api } from "@/api/manageApi";
import { getRoleAuthorityList, roleAuthority } from "@/api/authorityManage";
import { updateUser } from "@/api/personnelManage";
export default {
name: "",
data () {
return {
title: "人员配置",
visible: false,
menutableData: {
column: [
{
prop: "name",
width: 830,
label: "菜单名称",
}
].concat([
{
label: "权限",
render: (h, scope) => {
return (
<div>
<el-checkbox v-model={scope.row.checkArr[0].value}
disabled={scope.row.checkArr[0].disabled}
label={scope.row.checkArr[0].name} onChange={(checked) => {
this.changeCheck(checked, scope.row.checkArr[0].id, scope);
}} />
<el-checkbox v-model={scope.row.checkArr[1].value}
disabled={scope.row.checkArr[0].disabled}
label={scope.row.checkArr[1].name}
onChange={(checked) => {
this.changeCheck(checked, scope.row.checkArr[1].id, scope);
}} />
</div>
);
},
},
]),
},
usertableData: {
column: [
{
type: "selection",
width: 330,
},
{
prop: "name",
width: 330,
label: "姓名",
},
{
prop: "loginName",
label: "用户名",
},
],
},
// 角色id
roleId: "",
menuList: [], // 菜单列表
menukey: 0,
activeName: "first",
lastuserList: [], // 人员表格数据
lastMenuList: [], // 重构完成的菜单表格数据
usermultipleSelection: [],
// 选中菜单列表
checkArr: [], // 重构操作符列表
authorityList: [], // 授权回显数组
checklistbor: [],
// 授权对象数据
menuprams: {},
// 系统code
selectedSubsystemCode: ""
};
},
computed: {},
created () {
},
mounted () {
},
methods: {
// 人员配置点击行勾选数据
handleClickTableRow (row, event) {
this.checkNum = 0;
this.isCheck = false;
if (event.label == "操作") {
return;
} else {
if (row.status == "0") {
return;
} else {
if (this.usermultipleSelection.length > 0) {
if (
JSON.stringify(this.usermultipleSelection).indexOf(
JSON.stringify(row)
) == -1
) {
this.usermultipleSelection.push(row);
this.$refs.multipleTable.toggleRowSelection(row, true);
} else {
this.usermultipleSelection.map((item, index) => {
if (item.id == row.id) {
this.usermultipleSelection.splice(index, 1);
this.$refs.multipleTable.toggleRowSelection(row, false);
}
});
}
} else {
this.usermultipleSelection.push(row);
this.$refs.multipleTable.toggleRowSelection(row, true);
}
}
}
if (this.usermultipleSelection.length > 0) {
this.checkNum = this.usermultipleSelection.length;
this.isCheck = true;
} else {
this.isCheck = false;
}
},
// 获取授权主体的菜单权限
// getMenuAuthorityList
menulist (operationList, id, Code, menutablelistData, operationCodes) {
this.selectedSubsystemCode = Code
this.menuList = menutablelistData;
getRoleAuthorityList(
id,
operationList.toString(),
Code + '_MENU'
).then(res => {
if (res.status === 1) {
this.authorityList = res.content
this.getRecursionTreeData(this.menuList, this.authorityList, operationCodes)
this.getAuthorizedInfo()
// this.setCheckAllArr()
// this.getAuthorizedInfo()
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
/**
* 递归渲染列表数据
* list:原始数组
* authorityList:已授权数组
*/
getRecursionTreeData (list, authorityList, operationCodes) {
++this.menukey
this.checkArr = []
for (const k in operationCodes) {
const obj = {}
obj.name = operationCodes[k]
obj.id = k
obj.value = false
obj.disabled = false
// obj.isAll = false;
this.checkArr.push(obj)
}
for (const [index, item] of Object.entries(list)) {
this.setAuthorizedConditions(
authorityList,
this.$deepCopy(this.checkArr),
item
)
if (
item.children &&
item.children !== null &&
item.children.length !== 0
) {
item.children.forEach((child, j) => {
this.setAuthorizedConditions(
authorityList,
this.$deepCopy(this.checkArr),
child
)
})
this.getRecursionTreeData(item.children, authorityList, operationCodes)
}
}
this.lastMenuList = list
// this.setCheckAllArr(list)
},
// 授权条件
setAuthorizedConditions (authorityList, checkArr, item) {
if (this.roleId === '') {
checkArr.forEach(ele => {
ele.disabled = true
ele.value = false
})
} else {
if (authorityList.length !== 0) {
if (authorityList[0].superPermission === true) {
checkArr.forEach(ele => {
ele.value = true
ele.disabled = true
})
} else {
const repeatArr = authorityList.filter(authorityItem => {
return authorityItem.resourceUri === item.id
})
repeatArr.forEach(element => {
checkArr.forEach(ele => {
if (element.operationCode === ele.id) {
ele.value = true
if (this.roleId !== element.subjectId) {
ele.disabled = true
}
}
})
})
}
}
}
this.$set(item, 'checkArr', this.$deepCopy(checkArr))
},
// 获取拼接授权信息
getAuthorizedInfo () {
const lastArr = []
const authorizedList = []
const wholeArr = this.$deepCopy(this.lastMenuList)
const arr = this.$treeConvertToArr(wholeArr)
arr.forEach(ele => {
ele.checkArr.forEach(val => {
if (val.value === true && val.disabled === false) {
const obj = {
operationCode: val.id,
name: ele.name,
id: ele.id
}
lastArr.push(obj)
}
})
})
lastArr.forEach(element => {
authorizedList.push({
operationCode: element.operationCode, // 标识符
productCode: this.selectedSubsystemCode, // 子系统code
resourceCategoryCode: this.selectedSubsystemCode + '_MENU', // 资源类别code默认为MENU
resourceName: element.name,
resourceUri: element.id, // 授权菜单id
subjectId: this.roleId, // 授权对象id
subjectType: 'ROLE' // 授权对象类别
})
})
this.menuprams = {
subjectId: this.roleId,
authorizedList: authorizedList
}
},
// 获取人员列表做筛选
personlist (a, rid) {
this.roleId = rid;
this.visible = true;
this.lastuserList = a;
this.lastuserList.forEach((item, index) => {
if (item.selectStatus === 0) {
this.$nextTick(async () => {
await this.$refs.multipleTable
if (this.$refs.multipleTable) {
this.$refs.multipleTable.toggleRowSelection(
this.lastuserList[index],
true
);
}
});
}
});
},
// 关闭事件
close () {
this.visible = false;
},
// 保存事件
handleSaveMember () {
// 人员授权
const idList = this.usermultipleSelection.map((item) => {
return item.id;
})
updateUser(this.roleId, idList).then((res) => {
if (res.status === 1) {
this.$message.success({ message: "保存成功", showClose: true });
this.visible = false;
} else this.$message.error({ message: res.message, showClose: true });
});
// 菜单授权
roleAuthority(
this.menuprams.subjectId,
this.menuprams.authorizedList
).then((res) => {
if (res.status === 1) {
this.$message.success({
message: res.message,
})
// this.authorizedContChange()
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
// 勾选人员事件
handleSelectionChange (val) {
this.lastuserList.forEach((element, index) => {
delete this.lastuserList[index].selectStatus
});
this.usermultipleSelection = val;
this.lastuserList.forEach((element, index) => {
this.usermultipleSelection.forEach(element1 => {
if (element.id == element1.id) {
this.lastuserList[index].selectStatus = 0
}
});
});
},
// 数据筛选
setarrdata (scope, arr) {
arr.forEach((item, index, arr) => {
if (item.id == scope.row.id) {
this.checklistbor = [...arr]
} else if (item.id !== scope.row.id && item.children) {
this.setarrdata(scope, item.children)
}
})
},
// 勾选菜单事件
changeCheck (flag, checkId, scope) {
this.checklistbor = []
this.setarrdata(scope, this.lastMenuList)
const parents = this.$findParent(this.lastMenuList, scope.row.parentId)
const childs = this.$findChildren(this.lastMenuList, scope.row.id)
this.$setChildArr(
this.lastMenuList,
scope.row.id,
checkId,
flag,
this.checklistbor,
parents,
childs
)
this.getAuthorizedInfo()
},
handleClick (tab, event) {
this.lastuserList.forEach((item, index) => {
if (item.selectStatus === 0) {
this.$nextTick(async () => {
await this.$refs.multipleTable
if (this.$refs.multipleTable) {
this.$refs.multipleTable.toggleRowSelection(
this.lastuserList[index],
true
);
}
});
}
});
}
},
};
</script>
<style scoped lang="scss">
/deep/.dialogBox .el-dialog__header {
height: 59px !important;
}
</style>
<template>
<div class="informationbase">
<el-form
ref="form"
label-width="100px"
:model="form"
class="form-wrapper"
:rules="rules">
<el-form-item label="用户名:" required>
<el-input v-model="form.loginName" clearable disabled />
</el-form-item>
<el-form-item label="姓名:">
<el-input v-model="form.name" clearable />
</el-form-item>
<el-form-item label="性别:">
<el-radio-group v-model="form.sex">
<el-radio
v-for="(item, index) in sexList"
:key="index"
:label="item.value">{{ item.name }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="身份证号:" prop="idCard">
<el-input v-model="form.idCard" clearable />
</el-form-item>
<el-form-item label="手机号码:" prop="mobilePhone">
<el-input v-model="form.mobilePhone" clearable />
</el-form-item>
<el-form-item label="办公电话:">
<el-input v-model="form.telephone" clearable />
</el-form-item>
<el-form-item label="办公地址:">
<el-input v-model="form.address" clearable />
</el-form-item>
</el-form>
<div class="bottom-wrapper">
<btn nativeType="cx" type="primary" @click="updateInfo">更新信息</btn>
</div>
</div>
</template>
<script>
import { api, getAction, putAction, getDictItems } from '@/api/manageApi'
export default {
props: {
userInfo: {
type: Object,
default: null
}
},
data () {
return {
form: {},
sexList: [],
rules: {
mobilePhone: [
{
pattern:
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
message: '手机号码格式有误',
trigger: 'blur'
}
],
idCard: [
{
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
message: '身份证号格式有误',
trigger: 'blur'
}
]
}
}
},
watch: {
userInfo: {
handler: function (val) {
if (val) {
this.getUserdata(val.id)
}
}
}
},
mounted () {
if (this.userInfo) {
this.getUserdata(this.userInfo.id)
}
this.sexList = [
{
"name": "男",
"value": "0",
},
{
"name": "女",
"value": "1",
},
{
"name": "保密",
"value": "2",
}
]
},
methods: {
getUserdata (id) {
getAction(`${api.users}/${id}`).then((res) => {
if (res.status === 1) {
this.form = res.content
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
updateInfo () {
this.$refs.form.validate((valid) => {
if (valid) {
putAction(`${api.users}/${this.form.id}`, this.form).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.getUserdata(this.form.id)
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.user-info {
margin: 0.1875rem 1.0417rem;
overflow-y: auto;
.form-wrapper {
padding: 0px 120px 0px;
.el-form-item {
/deep/.el-form-item__label {
color: #ffffff;
}
::v-deep .el-input .el-input__inner {
padding: 0 8px;
height: 40px;
line-height: 40px;
border: 1px solid #6bc1fc;
}
}
.el-form-item--small.el-form-item {
margin-bottom: 16px;
}
}
.bottom-wrapper {
padding: 0px 120px 0px;
text-align: center;
}
}
</style>
<!--
* @Author: xiaomiao 1158771342@qq.com
* @Date: 2023-03-09 20:54:28
* @LastEditors: Please set LastEditors
* @LastEditTime: 2023-03-30 11:21:49
* @FilePath: \上报\bdcjg-web\src\views\system\information\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="information from-clues">
<div class="from-clues-header">
<el-form ref="ruleForm" label-width="100px">
<el-form-item v-if="BASE_API.THEME == 'jg'">
<Breadcrumb />
</el-form-item>
<el-row class="mb-5">
<el-col class="btnColRight">
<btn nativeType="cx" @click="information">
基本信息
</btn>
<btn nativeType="cx" @click="password">
修改密码
</btn>
</el-col>
</el-row>
</el-form>
</div>
<div class="from-clues-content">
<div class="contentbox">
<base-set v-if="isshow" :userInfo="userData" />
<password-edit v-if="!isshow" :userInfo="userData" />
</div>
</div>
</div>
</template>
<script>
import "@/utils/flexible.js";
import BaseSet from "./base-set.vue";
import PasswordEdit from "./password-edit.vue";
export default {
components: {
BaseSet,
PasswordEdit,
},
data () {
return {
isshow: true,
};
},
computed: {
userData () {
return this.$store.state.user.userInfo;
},
},
watch: {},
created () { },
mounted () { },
methods: {
information () {
this.isshow = true;
},
password () {
this.isshow = false;
},
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
</style>
<template>
<div class="informationpassword">
<el-form
ref="form"
label-width="100px"
:model="form"
class="form-wrapper"
:rules="rules">
<el-form-item label="旧密码:" prop="oldPassword">
<el-input
v-model="form.oldPassword"
clearable
type="password"
show-password />
</el-form-item>
<el-form-item label="新密码:" prop="newPassword">
<el-input
v-model="form.newPassword"
clearable
type="password"
show-password />
</el-form-item>
<el-form-item label="确认密码:" prop="confirmPassword">
<el-input
v-model="form.confirmPassword"
clearable
type="password"
show-password />
</el-form-item>
</el-form>
<div class="bottom-wrapper">
<btn nativeType="cx" type="primary" @click="updatePassword">确认修改</btn>
</div>
</div>
</template>
<script>
import { updateUserPassword } from "@/api/personnelManage";
export default {
props: {
userInfo: {
type: Object,
default: null,
},
},
data () {
return {
form: {},
sexList: [],
userId: "",
rules: {
oldPassword: [
{ required: true, message: "旧密码不能为空", trigger: "blur" },
],
newPassword: [
{ required: true, message: "新密码不能为空", trigger: "blur" },
],
confirmPassword: [
{ required: true, message: "确认密码不能为空", trigger: "blur" },
{ validator: this.validatorConfirmPassword, trigger: "blur" },
],
},
};
},
computed: {},
watch: {
userInfo: {
handler: function (val) {
if (val) {
this.getid(val);
}
},
},
},
mounted () {
if (this.userInfo) {
this.getid(this.userInfo);
}
},
methods: {
getid (val) {
this.userId = val.id;
},
validatorConfirmPassword (rule, value, callback) {
const { newPassword } = this.form;
if (value !== newPassword) {
callback("两次输入密码不一致");
} else {
callback();
}
},
updatePassword () {
this.$refs.form.validate((valid) => {
if (valid) {
const params = Object.assign({}, this.form, { id: this.userId });
updateUserPassword(params).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true });
} else {
this.$message.error({ message: res.message, showClose: true });
}
});
}
});
},
},
};
</script>
<style scoped lang="scss">
</style>