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>
<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>