c2fa73e1 by yangwei
2 parents 271e4f0d f4869b05
......@@ -5,4 +5,4 @@ NODE_ENV=development
VUE_APP_BASE_API = '/api'
# 开发环境
VUE_APP_API_BASE_URL = 'http://192.168.2.38:8027'
VUE_APP_API_BASE_URL = 'http://192.168.2.44:8027'
......
......@@ -11,6 +11,7 @@
"@jiaminghi/data-view": "^2.10.0",
"axios": "^0.21.1",
"clipboard": "^2.0.11",
"jsoneditor": "^9.9.2",
"core-js": "^3.6.5",
"echarts": "^4.6.0",
"js-cookie": "2.2.0",
......
......@@ -81,6 +81,29 @@ export const api = {
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({
......
......@@ -23,7 +23,6 @@ export const getRolesById = categoryId => {
queryRelation: 'AND'
}
const params = getParams(conditionGroup);
console.log(api.roles,params);
return getAction(api.roles, params)
}
// 人员列表
......@@ -34,3 +33,51 @@ export const getUserRoles = (id) => {
export const updateUser = (id, data) => {
return putAction(`${api.userRoles}/${id}/users`, data)
}
// 根据条件获取用户
export const getUserList = (params) => {
return getAction(api.users, params)
}
// 导出用户列表
export const exportUserList = (params) => {
return getAction(api.users + '/export', params)
}
// 更新用户状态
export const updateStatus = (id, status) => {
return putAction(`${api.users}/${id}/${status}/status`)
}
// 更新用户解锁状态
export const updateLock = (id) => {
return putAction(`${api.users}/${id}/lock`)
}
// 重置用户密码
// 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 delUser = (id, data) => {
return deleteAction(`${api.userRoles}/${id}/users`, data)
}
// 获取父级菜单
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)
}
......
......@@ -23,6 +23,7 @@ export default {
try {
let { result: res } = await work.mapViews("A20");
res.map((item) => {
return (
this.cdata.push({ "name": item.areaName, "value": item.ywtotal })
)
......
<template>
<div>
<i class="icon-tubiao-242 iconfont" :title="title" @click="openDialog" />
<el-dialog :key="key" :title="title" :inner-dialog="true" :visible.sync="dialogVisible" width="600px"
:close-on-click-modal="false" append-to-body @cancel="cancel">
<vue-json-editor id="minejson" v-model="resultInfo" :mode="'code'" lang="zh" @json-change="onJsonChange"
@json-save="onJsonSave" @has-error="onError" />
<el-tooltip content="全屏缩放" effect="dark" placement="bottom" fullscreen class="fullScreen">
<i class="el-icon-s-management icon" :title="title" @click="openDialog" />
<el-dialog
:key="key"
:title="title"
:inner-dialog="true"
:visible.sync="dialogVisible"
width="600px"
:close-on-click-modal="false"
append-to-body
@cancel="cancel"
>
<vue-json-editor
id="minejson"
v-model="resultInfo"
:mode="'code'"
lang="zh"
@json-change="onJsonChange"
@json-save="onJsonSave"
@has-error="onError"
/>
<el-tooltip
content="全屏缩放"
effect="dark"
placement="bottom"
fullscreen
class="fullScreen"
>
<i class="el-icon-full-screen" @click="enLarge" />
</el-tooltip>
<template slot="footer">
<div class="dialog-footer flex flex-pack-center">
<el-button type="primary" class="confirmBtn" @click="onJsonSave">保存</el-button>
<el-button type="primary" class="cancelBtn" @click="cancel">关闭</el-button>
<el-button
type="primary"
class="confirmBtn"
@click="onJsonSave"
>保存</el-button>
<el-button
type="primary"
class="cancelBtn"
@click="cancel"
>关闭</el-button>
</div>
</template>
</el-dialog>
......@@ -33,7 +62,7 @@ export default {
default: ''
}
},
data () {
data() {
return {
activeNames: [],
resultInfo: {},
......@@ -46,7 +75,7 @@ export default {
},
watch: {
resultInfos: {
handler: function (val) {
handler: function(val) {
++this.key
this.resultInfo =
this.resultInfos === '' ? {} : JSON.parse(this.resultInfos)
......@@ -57,18 +86,19 @@ export default {
}
},
mounted () {
mounted() {
this.resultInfo =
this.resultInfos === '' ? {} : JSON.parse(this.resultInfos)
},
methods: {
onJsonChange (value) {
onJsonChange(value) {
// 只有在格式正确的时候进入此事件
this.hasJsonFlag = true
},
onJsonSave () {
onJsonSave() {
const value = this.resultInfo
console.log(this.resultInfo, 'resultInfo')
if (this.hasJsonFlag === false) {
this.$message.error({ message: 'json格式验证失败', showClose: true })
// alert("json验证失败")
......@@ -79,18 +109,19 @@ export default {
return true
}
},
onError (value) {
onError(value) {
this.hasJsonFlag = false
},
openDialog () {
openDialog() {
this.dialogVisible = true
},
cancel () {
cancel() {
console.log(this.tmpResultInfo, 'tmpResultInfo')
this.resultInfo = this.tmpResultInfo
this.dialogVisible = false
},
// 放大
enLarge () {
enLarge() {
const fullarea = document.getElementById('minejson')
if (fullarea.requestFullscreen) {
fullarea.requestFullscreen()
......@@ -109,17 +140,12 @@ export default {
<style scoped lang="scss">
/* jsoneditor右上角默认有一个链接,加css去掉了 */
.iconfont {
cursor: pointer;
position: relative;
top: 1px;
.icon {
color: #349af3;
}
::v-deep .jsoneditor-vue {
/deep/ .jsoneditor-vue {
height: 100%;
}
.fullScreen {
position: absolute;
right: 5%;
......@@ -127,28 +153,22 @@ export default {
cursor: pointer;
color: #fff;
}
::v-deep .jsoneditor-modes {
/deep/ .jsoneditor-modes {
display: none !important;
}
.jsoneditor-poweredBy {
display: none !important;
}
.jsoneditor-menu {
background-color: #9c9e9f !important;
border-bottom: 1px solid #9c9e9f !important;
}
.jsoneditor {
border: 1px solid #9c9e9f !important;
}
.el-collapse {
border: 0;
}
.el-collapse-item__header {
height: 44px;
}
......
......@@ -25,6 +25,51 @@ VXETable.setup({
i18n: (key, args) => XEUtils.toFormatString(XEUtils.get(zhCNLocat, key), args)
})
import $deepCopy from '../utils/tool'
Vue.use($deepCopy)
import $dealArrChildren from '../utils/tool'
Vue.use($dealArrChildren)
import $filterNullObj from '../utils/tool'
Vue.use($filterNullObj)
import $getNodeRoute from '../utils/tool'
Vue.use($getNodeRoute)
import $dealArrDisabled from '../utils/tool'
Vue.use($dealArrDisabled)
import $dealArrNotDisabled from '../utils/tool'
Vue.use($dealArrNotDisabled)
import $treeConvertToArr from '../utils/tool'
Vue.use($treeConvertToArr)
import $setChildArr from '../utils/tool'
Vue.use($setChildArr)
import $findParent from '../utils/tool'
Vue.use($findParent)
import $findChildren from '../utils/tool'
Vue.use($findChildren)
import $getLocalStorage from '../utils/tool'
Vue.use($getLocalStorage)
Vue.use(Icon)
Vue.use(Header)
......
......@@ -2,13 +2,12 @@
<div class="navbar-con">
<div class="navbar">
<div class="title">
{{ dicData["sysCode"] && dicData["sysCode"][0].DNAME }}
{{ logoName[0].DNAME }}
</div>
<div class="user">
欢迎进入系统 {{ userInfo.name }}
<span @click="onCancel">
<svg-icon icon-class="close" class="closeStyle" />退出系统</span
>
<svg-icon icon-class="close" class="closeStyle" />退出系统</span>
</div>
<div class="sidebarLeft">
<sidebarLeft />
......@@ -17,7 +16,7 @@
<sidebarRight />
</div>
</div>
</div>
</div>
</template>
<script>
import sidebarLeft from "./Sidebar/sidebarLeft";
......@@ -31,9 +30,14 @@ export default {
},
computed: {
...mapGetters(["sidebar", "dicData", "userInfo"]),
logoName: function () {
return this.dicData['sysCode'] && this.dicData['sysCode'].filter(item =>
item.DCODE == "systemTitle"
)
}
},
methods: {
onCancel() {
onCancel () {
logout()
.then((res) => {
sessionStorage.removeItem("token");
......
......@@ -6,6 +6,7 @@ import '@/styles/element-variables.scss'
import '@/styles/index.scss'
import Base from './base' // 全局组件引入
import mixin from '@/utils/mixin/theme.js'
import dataV from '@jiaminghi/data-view';
import echarts from "echarts"
import { startLoadingAddCount, endLoadingSubCount } from './utils/requestLoading'
......
/**
* 新增修改完成调用 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('errrrrrorrrrr', 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)
}
// console.log(this.$filterNullObj(this.queryParam), '查询条件')
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) {}
}
}
......@@ -108,16 +108,20 @@
height: 7px;
}
::-webkit-scrollbar-corner {
display: none;
}
::-webkit-scrollbar-track {
width: 7px;
background-color: #29409D;
background-color: rgba(0, 0, 0, 0);
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
::-webkit-scrollbar-thumb {
background-color: #355194;
background: #458ACF;
background-clip: padding-box;
min-height: 28px;
-webkit-border-radius: 6px;
......@@ -126,7 +130,7 @@
}
::-webkit-scrollbar-thumb:hover {
background-color: rgb(162, 164, 167);
background: #458ACF;
}
// element 样式补丁
......
const deleteDomStr = content => {
return `<div class="customer-message-wrapper"><h5 class="title">您确认要执行该操作用于以下信息:</h5><p class="content">${content}</p><p class="result">执行后,数据将<span >无法恢复</span></p></div>`
}
export { deleteDomStr }
<!-- 登簿日志查询 -->
\ No newline at end of file
<!-- 上报报文查询 -->
<template>
<!-- 上报报文查询 -->
<div class="from-clues">
<!-- 头部搜索 -->
<div class="from-clues-header">
......@@ -25,8 +25,8 @@
</el-col>
<el-col :span="6">
<el-form-item label="至" prop="exchangeStartTime" label-width="35px">
<el-date-picker type="date" class="width100" placeholder="结束日期" clearable
:picker-options="pickerOptionsEnd" v-model="form.exchangeEndTime" value-format="yyyy-MM-dd HH:mm:ss"
<el-date-picker type="date" class="width100" placeholder="结束日期" clearable :picker-options="pickerOptionsEnd"
v-model="form.exchangeEndTime" value-format="yyyy-MM-dd HH:mm:ss"
@change="endTimeChange"></el-date-picker>
</el-form-item>
</el-col>
......@@ -78,8 +78,8 @@
</div>
<!-- 引入详情组件 -->
<!-- 编辑 -->
<dataDetails ref="editLog" :title="title" />
</div>
<dataDetails ref="editLog" :title="title" :visiableXml="true" />
</div>
</template>
<script>
// 上报报文查询
......
......@@ -5,7 +5,7 @@
<div class="editDialogBox-box ">
<el-form :model="ruleForm" ref="ruleForm" label-width="100px">
<el-row :gutter="20">
<el-col :span="4">
<el-col :span="5">
<el-form-item label="字典类型编码">
{{ ruleForm.DCODE }}
</el-form-item>
......@@ -291,7 +291,7 @@ export default {
handleSubmit () {
editDictNode({
dictid: this.details.rowData.dictid,
typeid: this.details.rowData.typeid,
typeid: this.details.rowData.TYPEID,
children: this.tableData,
}).then((res) => {
if (res.code === 200) {
......
<template>
<div class="content">
<div class="user-info">
<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="办公电话:" prop="telephone">
<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">
<el-button type="primary" @click="updateInfo">更新信息</el-button>
</div>
</div>
</div>
</template>
<script>
// import { api, getAction, putAction, getDictItems } from '@api/manageApi'
export default {
props: {
// userInfo: {
// type: Object,
// default: null
// }
},
data() {
return {
form: {
id: "3127e455-43ba-45ff-9326-0e02ef89485e",
name: "超级管理员",
sort: 1,
loginName: "admin",
email: null,
lastLoginTime: null,
mobilePhone: "18291003568",
isLocked: false,
status: "ACTIVE",
passwordChangeTime: "2021-12-10T08:01:01.569+0000",
idCard: "612725202111021521",
departmentId: "2eae5304-544f-4f5b-b354-8f5d47433c9b",
departmentName: null,
organizationId: "0bca67ae-1d9e-4b41-b057-f165586d24aa",
sex: "0",
isDuty: true,
code: "123324",
jobLevel: null,
telephone: "028-87720898",
address: "办公地点修改测试",
},
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",
},
],
telephone: [
{
pattern: /\d{3}-\d{8}|\d{4}-\d{7}/,
message: "办公电话格式有误",
trigger: "blur",
},
],
},
};
},
watch: {
// userInfo: {
// handler: function(val) {
// if (val) {
// this.getUserInfo(val.id)
// }
// }
// }
},
mounted() {
// getDictItems('XB').then((res) => {
// if (res.status === 1) {
this.sexList = [
{
id: "079c72b2-f3de-4a4f-b2a1-e5c8f085cc5f",
createdAt: "2021-06-11T02:42:02.000+0000",
updatedAt: "2021-09-03T09:21:46.000+0000",
createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 2,
name: "男",
description: "",
code: "N362",
value: "0",
parentId: null,
baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019",
version: 1,
valid: true,
standard: false,
standardName: null,
standardValue: null,
children: [],
commonName: "男(N362)",
},
{
id: "4d6f845d-6f6a-4848-8fc2-a3760764c196",
createdAt: "2021-06-11T02:42:12.000+0000",
updatedAt: "2021-09-03T09:21:46.000+0000",
createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 1,
name: "女",
description: "",
code: "N922",
value: "1",
parentId: null,
baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019",
version: 1,
valid: true,
standard: false,
standardName: null,
standardValue: null,
children: [],
commonName: "女(N922)",
},
{
id: "637c360b-d4e2-4afb-aa18-33624cf3abcb",
createdAt: "2021-06-11T02:42:29.000+0000",
updatedAt: "2021-09-03T09:21:43.000+0000",
createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 0,
name: "保密",
description: "",
code: "BM816",
value: "2",
parentId: null,
baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019",
version: 1,
valid: true,
standard: false,
standardName: null,
standardValue: null,
children: [],
commonName: "保密(BM816)",
},
];
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
},
methods: {
// getUserInfo(id) {
// getAction(`${api.users}/${id}`).then((res) => {
// if (res.status === 1) {
// } 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.getUserInfo(this.form.id)
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
// }
// })
},
},
};
</script>
<style scoped lang="scss">
.user-info {
margin: 0.1875rem 1.0417rem;
background: #ffffff;
max-height: 90%;
overflow-y: auto;
.form-wrapper {
padding: 24px 120px 0px;
.el-form-item {
margin-bottom: 24px;
.el-form-item__label {
color: #747e8c;
}
::v-deep .el-input .el-input__inner {
padding: 0 8px;
height: 40px;
line-height: 40px;
border: 1px solid #6BC1FC;
}
}
}
.bottom-wrapper {
padding: 32px 120px 24px;
text-align: right;
}
}
</style>
<template>
<div class="information from-clues">
<div class="from-clues-header">
<el-form ref="ruleForm" label-width="100px">
<el-form-item>
<Breadcrumb />
</el-form-item>
<el-row class="mb-5">
<el-col :span="3" 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-show="isshow" />
<password-edit v-show="!isshow" />
</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 {
active: "baseSet",
isshow: true,
};
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
information() {
this.isshow = true;
},
password() {
this.isshow = false;
},
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
.information{
.btnColRight{
margin-top: 20px;
}
/deep/.content {
.el-input__inner{
background: none;
}
.user-info {
background: none;
}
}
/deep/.el-tabs {
.el-tabs__content {
height: 100%;
width: 100%;
}
}
.contentbox{
height: 3.0854rem;
}
}
</style>
<template>
<div class="content">
<div class="user-info">
<el-form
ref="form"
label-width="100px"
:model="form"
class="form-wrapper"
:rules="rules"
>
<el-form-item label="旧密码:" required prop="oldPassword">
<el-input
v-model="form.oldPassword"
clearable
type="password"
show-password
/>
</el-form-item>
<el-form-item label="新密码:" required prop="newPassword">
<el-input
v-model="form.newPassword"
clearable
type="password"
show-password
/>
</el-form-item>
<el-form-item label="确认密码:" required prop="confirmPassword">
<el-input
v-model="form.confirmPassword"
clearable
type="password"
show-password
/>
</el-form-item>
</el-form>
<div class="bottom-wrapper">
<el-button type="primary" @click="updatePassword">确认修改</el-button>
</div>
</div>
</div>
</template>
<script>
// import { updateUserPassword } from '@api/organizationManage'
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.userId = val.id
// }
// }
// }
},
mounted() {},
methods: {
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">
.user-info {
margin: 36px 200px;
background: #ffffff;
max-height: 90%;
overflow-y: auto;
.form-wrapper {
padding: 24px 120px 0px;
.el-form-item {
margin-bottom: 24px;
.el-form-item__label {
color: #747e8c;
}
::v-deep .el-input .el-input__inner {
padding: 0 8px;
height: 40px;
line-height: 40px;
border: 1px solid #6BC1FC;
}
}
}
.bottom-wrapper {
padding: 32px 120px 24px;
text-align: right;
}
}
</style>
......@@ -26,7 +26,7 @@
>
</lb-table>
</div>
<EditDialog ref="addEditDialog" />
<EditDialog ref="addEditDialog" @ok="reloadTableData" />
<Roleslistdiglog ref="rolesForm" />
</div>
</template>
......@@ -38,7 +38,7 @@ import {
findParents,
removeTreeListItem,
} from "@/utils/operation";
import { getRolesById, getUserRoles } from "@/api/Rolemanagement";
import { getRolesById, getUserRoles } from "@/api/quanxianmanagement";
import data from "./data";
import sjsbTask from "@/api/sjsbTask.js";
import { api, getAction,deleteAction } from "@/api/manageApi";
......@@ -213,11 +213,9 @@ export default {
getRolesById(1)
.then((res) => {
console.log("res.content", res.content);
Builtinrole = res.content;
getRolesById(2)
.then((res) => {
console.log("res.content", res.content);
Publicrole = res.content;
this.listdata = Builtinrole.concat(Publicrole);
......@@ -336,7 +334,7 @@ export default {
deleteAction(url).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.loadDataS(this.subcode)
this.getTableData()
} else {
this.$message.error({ message: res.message, showClose: true })
}
......@@ -344,6 +342,10 @@ export default {
})
.catch(() => {})
},
// 新增回显
reloadTableData() {
this.getTableData()
},
},
};
</script>
......
......@@ -27,7 +27,7 @@
<script>
import Dialog from "@/components/Dialog/";
import { updateUser } from "@/api/Rolemanagement";
import { updateUser } from "@/api/quanxianmanagement";
export default {
name: "",
components: { Dialog },
......@@ -87,7 +87,6 @@ export default {
adds(a, rid) {
this.roleId = rid;
this.visible = true;
console.log("a", a);
this.tableData.data = a;
this.tableData.data.forEach((item, index) => {
if (item.selectStatus === 0) {
......@@ -108,9 +107,7 @@ export default {
const idList = this.multipleSelection.map((item) => {
return item.id;
});
console.log("this.roleId",this.roleId,idList);
updateUser(this.roleId, idList).then((res) => {
console.log("res",res);
if (res.status === 1) {
this.$message.success({ message: "保存成功", showClose: true });
this.visible = false;
......@@ -120,7 +117,6 @@ export default {
});
},
handleSelectionChange(val) {
console.log("val", val);
this.multipleSelection = val;
},
},
......
......@@ -6,25 +6,20 @@ class data extends filter {
columns () {
return [
{
prop: "DCODE",
prop: "code",
label: "工号",
width: 130
},
{
prop: "DNAME",
prop: "name",
label: "姓名",
width: 300
},
{
prop: "PARENTID",
prop: "loginName",
label: "用户名"
},
{
prop: "TYPEID",
width: 260,
label: "负责人"
},
{
prop: "departmentName",
label: "所属部门"
},
......
......@@ -103,6 +103,7 @@
</template>
<script>
import { api, httpAction } from '@/api/manageApi'
import Dialog from "@/components/Dialog/";
export default {
name: "",
......@@ -126,11 +127,14 @@ export default {
showLoginName: false,
sexList: [{lable:"0",value:"0",name:"男"},{lable:"1",value:"1",name:"女"}],
levelList: [{lable:"0",value:"0",name:"干事"},{lable:"1",value:"1",name:"经理"}],
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
dataUrl: api.users
};
},
computed: {},
computed: {
departmentid() {
return this.$store.state.user.userInfo;
},
},
watch: {},
created() {},
mounted() {},
......@@ -151,11 +155,13 @@ export default {
// }
// })
// },
// 添加人员
add() {
this.visible = true;
// this.type = 0
this.showLoginName = false
},
// 编辑
edit(record) {
// this.initDictConfig()
this.showLoginName = true
......@@ -170,11 +176,14 @@ export default {
handleChange(value) {
this.form.departmentId = value;
},
// 保存
submitForm(submitType) {
this.$refs.form.validate((valid) => {
if (valid) {
let method = ''
let url = ''
this.form.organizationId=this.departmentid.organizationId;
this.form.departmentId=this.departmentid.departmentId;
const formData = this.form
if (!formData.id) {
method = 'post'
......@@ -183,21 +192,16 @@ export default {
method = 'put'
url = `${this.dataUrl}/${formData.id}`
}
httpAction(url, formData, method).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
// this.type 0新增 1编辑
if (this.type === 0) {
// submitType 1需要关闭页面 0保存&新增暂不关闭页面
if (submitType === 1) {
this.close()
} else {
this.resetForm()
}
} else if (this.type === 1) {
this.close()
}
this.$emit('ok')
this.$emit('ok')
} else {
this.$message.error({ message: res.message, showClose: true })
}
......@@ -208,16 +212,16 @@ export default {
}
})
},
resetForm() {
this.form = {
sex: '0'
}
this.$refs.form.resetFields()
},
close() {
// this.resetForm()
this.visible = false;
resetForm() {
this.form = {
sex: '0'
}
this.$refs.form.resetFields()
},
close() {
this.resetForm()
this.visible = false
}
},
};
</script>
......
......@@ -29,7 +29,7 @@
>
</lb-table>
</div>
<edit-dialog ref="dialogForm" />
<edit-dialog ref="dialogForm" @ok="reloadTableData"/>
</div>
</template>
<script>
......@@ -40,7 +40,13 @@ import {
findParents,
removeTreeListItem,
} from "@/utils/operation";
import {
resetPassword,
getUserList,
} from "@/api/quanxianmanagement";
import { api, deleteAction } from '@/api/manageApi'
import data from "./data";
import { deleteDomStr } from '@/utils/proDomStr'
import sjsbTask from "@/api/sjsbTask.js";
import tableMixin from "@/mixins/tableMixin.js";
import EditDialog from "./edit-dialog.vue";
......@@ -53,7 +59,7 @@ export default {
data() {
return {
taskData: null,
keyList: [],
keyList: [],
form: {
job_name: "",
currentPage: 1,
......@@ -97,9 +103,17 @@ export default {
]
.concat(data.columns())
.concat([
{
label: "负责人",
render: (h, scope) => {
return (
<i v-show={scope.row.isDuty!==null} class="el-icon-check" />
)
}
},
{
label: "排序",
width: 380,
width: 280,
render: (h, scope) => {
return (
<div>
......@@ -134,16 +148,6 @@ export default {
<el-button
type="text"
size="mini"
icon="el-icon-edit"
onClick={() => {
this.updateLock(scope.row, scope.row.name);
}}
>
解锁
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-video-pause"
onClick={() => {
this.resetPassword(scope.row.id);
......@@ -186,82 +190,80 @@ export default {
},
};
},
created() {
this.featchData();
created() {
this.getTableList();
},
computed: {
departmentid() {
return this.$store.state.user.userInfo;
},
},
methods: {
handleAdd() {
this.taskData = null;
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "添加";
},
featchData() {
this.tableData.data = [
{
"dictid": "51b9f487861671f77782c5a23b5fe52e",
"children": null,
"TYPEID": "1F460F6E5E354C1AA3C470434D7A67DF",
"PARENTID": "ouyds",
"DCODE": "1223",
"DNAME": "小红",
"SORT": null,
"index": 1,
},
{
"dictid": "2291d9e298274c1ea1f40df63fbcff47",
"children": null,
"TYPEID": "1F460F6E5E354C1AA3C470434D7A67DF",
"PARENTID": "wer",
"DCODE": "124334",
"DNAME": "小李",
"SORT": null,
"index": 2,
getTableList() {
this.loading = true;
this.queryParam = {
organizationId: this.departmentid.organizationId,
departmentId: this.departmentid.departmentId,
};
getUserList(this.queryParam).then((res) => {
if (res.status === 1) {
this.loading = false;
this.tableData.data = res.content;
this.tableData.data = judgeSort(this.tableData.data);
} else {
this.$message.error({ message: res.message, showClose: true });
}
});
},
{
"dictid": "e6a5aeb8957b8029fa31586fb30dd5b8",
"children": null,
"TYPEID": "1F460F6E5E354C1AA3C470434D7A67DF",
"PARENTID": "underf",
"DCODE": "2344",
"DNAME": "小田",
"SORT": null,
"index": 13,
}
]
this.tableData.data=judgeSort(this.tableData.data)
},
// 更新用户解锁状态
updateLock(id, name) {
// 重置用户密码
resetPassword(data) {
const ids = []
if (data instanceof Array) {
data.forEach((item) => {
ids.push(item.id)
})
} else {
ids.push(data)
}
if (ids.length === 0) {
this.$message({
message: '请选择需要重置密码的用户!',
showClose: true
})
return
}
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">确定要更新用户解锁状态吗</h5>
<h5 class="title">确定要重置密码吗</h5>
<p class="result">执行后,数据将
<span >无法恢复</span>
</p>
</div>`,
"执行确认",
'执行确认',
{
dangerouslyUseHTMLString: true,
customClass: "customer-delete",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
.then(() => {
// updateLock(id).then((res) => {
// if (res.status === 1) {
// this.$message.success({ message: res.message, showClose: true })
// this.getTableList()
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
resetPassword(ids).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.getTableList()
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
})
.catch(() => {});
.catch(() => {})
},
// 上移下移
moveUpward(index, row) {
......@@ -276,74 +278,35 @@ this.tableData.data=judgeSort(this.tableData.data)
let id = findParents(this.tableData.data, row.dictid);
this.keyList = id;
},
// 重置用户密码
resetPassword(data) {
const ids = [];
if (data instanceof Array) {
data.forEach((item) => {
ids.push(item.id);
});
} else {
ids.push(data);
}
if (ids.length === 0) {
this.$message({
message: "请选择需要重置密码的用户!",
showClose: true,
});
return;
}
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">确定要重置密码吗</h5>
<p class="result">执行后,数据将
<span >无法恢复</span>
</p>
</div>`,
"执行确认",
{
dangerouslyUseHTMLString: true,
customClass: "customer-delete",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
// resetPassword(ids).then((res) => {
// if (res.status === 1) {
// this.$message.success({ message: res.message, showClose: true })
// this.getTableList()
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
})
.catch(() => {});
},
// 修改人员信息
handleEdit(row) {
this.$refs.dialogForm.edit(row);
this.$refs.dialogForm.title = "修改";
},
// 删除
// 删除
handleDelete(id, content) {
this.$confirm("此操将进行删除操作, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
this.$confirm(deleteDomStr(content), '执行确认', {
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
// deleteAction(`${api.users}/${id}`).then((res) => {
// if (res.status === 1) {
// this.$message.success({ message: res.message, showClose: true })
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// this.getTableList()
// })
deleteAction(`${api.users}/${id}`).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
} else {
this.$message.error({ message: res.message, showClose: true })
}
this.getTableList()
})
})
.catch(() => {});
.catch(() => {})
},
// 新增回显
reloadTableData() {
this.getTableList()
},
},
};
......