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 }
import Vue from 'vue'
// 下载,导出
Vue.prototype.$download = function(name, href) {
var a = document.createElement('a') // 创建a标签
var e = document.createEvent('MouseEvents') // 创建鼠标事件对象
e.initEvent('click', false, false) // 初始化事件对象
a.href = href // 设置下载地址
a.download = name // 设置下载文件名
a.dispatchEvent(e) // 给指定的元素,执行事件click事件
}
// 导出json文件
Vue.prototype.$downloadJson = function(data, name) {
// 1 生成文件的 blob 对象
const blobData = new Blob([JSON.stringify(data)], {
type: 'application/octet-stream'
})
// 2 手动生成文件的 url
const url = window.URL.createObjectURL(blobData)
// 3 创建 a 标签,模拟点击事件
const link = document.createElement('a')
link.href = url
// 3.1 重命名下载文件名称
link.download = `${name}.json`
document.body.appendChild(link)
const evt = document.createEvent('MouseEvents')
evt.initEvent('click', false, false)
link.dispatchEvent(evt)
document.body.removeChild(link)
}
const validConfig = [
{
validKey: 'idcard',
validRule: /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/,
message: '请输入正确的身份证号码'
},
{
validKey: 'email',
validRule: /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
message: '请输入正确的邮箱'
},
{
validKey: 'phoneNumber',
validRule: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: '请输入正确的手机号码'
}
]
// 校验手机号
const checkTel = (rule, value, callback) => {
const phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
const rel = /^[0]\d{2,3}-[1-9]\d{7}$/
// if (!value) return callback(new Error("请输入联系电话"));
setTimeout(() => {
if (value && !(phoneReg.test(value) || rel.test(value))) {
callback(new Error('请输入正确的联系电话'))
} else callback()
}, 500)
}
// 检验系统代码
const checkCode = (rule, value, callback) => {
const rel = /^[0-9A-Z]+$/
if (!value) return callback(new Error('请输入代码'))
setTimeout(() => {
if (value && !rel.test(value)) {
callback(new Error('只能为大写字母和数字'))
} else callback()
}, 500)
}
// 校验 idcard身份证号码 email邮箱 phoneNumber手机号码
// Vue.prototype.$validator = function(validName) {
// const findValidConfig = _.find(validConfig, function(v) {
// return v.validKey === validName
// })
// return validMethods
// function validMethods(rule, value, callback) {
// if (value) {
// findValidConfig.validRule.test(value)
// ? callback()
// : callback(findValidConfig.message)
// } else {
// callback()
// }
// }
// }
// 日期格式转换 "yyyy-MM-dd HH:mm:ss"
Vue.prototype.$formdate = function(date) {
if (!date) {
return ""
}
var d = new Date(date);
var YY = d.getFullYear() + '-';
var MM = (d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1) + '-';
var DD = (d.getDate() < 10 ? '0' + (d.getDate()) : d.getDate());
var hh = (d.getHours() < 10 ? '0' + d.getHours() : d.getHours()) + ':';
var mm = (d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()) + ':';
var ss = (d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds());
return YY + MM + DD +" "+hh + mm + ss
}
// 时间格式过滤
Vue.filter('timeFilter', function(timeStr) {
if (timeStr) {
return timeStr.substring(0, 10)
}
})
export function getType(o) {
return Object.prototype.toString.call(o).slice(8, -1)
}
export function isKeyType(o, type) {
return getType(o).toLowerCase() === type.toLowerCase()
}
// 深拷贝全局挂载
Vue.prototype.$deepCopy = function(sth) {
// 深度复制数组
// if (Object.prototype.toString.call(obj) === "[object Array]") {
// const object = [];
// for (let i = 0; i < obj.length; i++) {
// object.push(this.$deepCopy(obj[i]));
// }
// return object;
// }
// 深度复制对象
// if (Object.prototype.toString.call(obj) === "[object Object]") {
// const object = {};
// for (let p in obj) {
// object[p] = obj[p];
// }
// return object;
// }
let copy
if (sth === null || typeof sth !== 'object') return sth
if (isKeyType(sth, 'date')) {
copy = new Date()
copy.setTime(sth.getTime())
return copy
}
if (isKeyType(sth, 'array')) {
copy = []
for (let i = 0, len = sth.length; i < len; i++) {
copy[i] = Vue.prototype.$deepCopy(sth[i])
}
return copy
}
if (isKeyType(sth, 'object')) {
copy = {}
for (const attr in sth) {
if (sth.hasOwnProperty(attr)) {
copy[attr] = Vue.prototype.$deepCopy(sth[attr])
}
}
return copy
}
return null
}
// 递归处理树形数据children为空数组
Vue.prototype.$dealArrChildren = arr => {
if (arr.length) {
for (const i in arr) {
if (arr[i].children && arr[i].children.length) {
Vue.prototype.$dealArrChildren(arr[i].children)
} else {
arr[i].children = null
}
}
}
return arr
}
// 过滤对象中为空的属性
Vue.prototype.$filterNullObj = obj => {
if (!(typeof obj === 'object')) {
return
}
for (var key in obj) {
if (
obj.hasOwnProperty(key) &&
(obj[key] === null || obj[key] === undefined || obj[key] === '')
) {
delete obj[key]
}
}
return obj
}
// 递归处理树形数据可选择项
Vue.prototype.$dealArrNotDisabled = arr => {
if (arr.length) {
for (const i in arr) {
if (arr[i].disabled) {
delete arr[i].disabled
if (arr[i].children) {
nodeDeal(arr[i].children)
}
// return false
}
if (arr[i].children) {
Vue.prototype.$dealArrNotDisabled(arr[i].children)
}
}
}
function nodeDeal(arr) {
arr.forEach(item => {
delete item.disabled
if (item.children) {
nodeDeal(item.children)
}
})
}
return arr
}
// 递归处理树形数据不可选择项
Vue.prototype.$dealArrDisabled = (arr, id) => {
if (arr.length) {
for (const i in arr) {
if (arr[i].id === id) {
arr[i]['disabled'] = true
if (arr[i].children) {
nodeDeal(arr[i].children)
}
// return false
}
if (arr[i].children) {
Vue.prototype.$dealArrDisabled(arr[i].children, id)
}
}
}
function nodeDeal(arr) {
arr.forEach(item => {
item['disabled'] = true
if (item.children) {
nodeDeal(item.children)
}
})
}
return arr
}
// 根据子节点id递归获取子节点路径id数组
Vue.prototype.$getNodeRoute = (val, id) => {
let cid_list = []
val.forEach((item, index) => {
if (item.id === id) {
cid_list = [item.id]
return false
} else {
if (item.children) {
const newCid_list = [item.id]
const list = nodefun(item.children, id, newCid_list)
if (list) {
cid_list = list
}
}
}
})
function nodefun(newVal, newId, newCid_list) {
let flag = false
newVal.forEach(j => {
// console.log(j)
if (j.id === newId) {
newCid_list.push(j.id)
flag = true
} else {
if (j.children) {
const cid_list = JSON.parse(JSON.stringify(newCid_list))
cid_list.push(j.id)
const list = nodefun(j.children, newId, cid_list)
if (list) {
newCid_list = list
flag = true
}
}
}
})
if (flag) {
return newCid_list
}
}
function result(cid_list) {
const arr = cid_list.concat()
arr.pop()
return arr
}
return result(cid_list)
}
// 扁平化树形数组
Vue.prototype.$treeConvertToArr = tree => {
let arrs = []
const result = []
arrs = arrs.concat(tree)
while (arrs.length) {
const first = arrs.shift()
if (first.children) {
// 如果有children
arrs = arrs.concat(first.children)
delete first['children']
}
result.push(first)
}
return result
}
/**
* 递归获取树形数组的所有父节点
* @param {*} list 树形数组
* @param {*} id 当前子节点判断条件parentId
* @returns
*/
Vue.prototype.$findParent = (list, id) => {
for (const i in list) {
if (list[i].id === id) {
return [list[i]]
}
if (list[i].children) {
const node = Vue.prototype.$findParent(list[i].children, id)
if (node !== undefined) {
return node.concat(list[i])
}
}
}
}
/**
* 递归获取树形数组当前点击节点的子节点
* @param {*} list 树形数组
* @param {*} nodeId 当前点击id
* @returns
*/
Vue.prototype.$findChildren = (list, nodeId) => {
let newArray = []
let flag = false
function dealList(list, nodeId) {
if (list.length !== 0) {
list.forEach(item => {
if (!flag) {
if (item.id === nodeId) {
flag = true
newArray = item.children
} else if (item.children !== null) {
newArray = dealList(item.children, nodeId)
}
}
})
}
return newArray
}
return dealList(list, nodeId)
}
/**
* 给子节点添加属性
* @param {*} list 树形数组
* @param {*} findIndex 操作符第几项
* @param {*} flag 属性状态
* @returns
*/
Vue.prototype.$setChildren = (arr, findIndex, flag) => {
if (arr.length) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].children && arr[i].children.length) {
arr[i].checkArr[findIndex].value = flag
Vue.prototype.$setChildren(arr[i].children, findIndex, flag)
} else {
arr[i].checkArr[findIndex].value = flag
}
}
}
return arr
}
/**
* 根据情况联动checkout
* @param {*} arr 数组
* @param {*} id 当前点击的id
* @param {*} checkId 操作符类型
* @param {*} flag 选中状态
* @param {*} items 当前点击子节点同级节点
* @param {*} parentList 父级菜单
* @param {*} childList 子级菜单
*/
Vue.prototype.$setChildArr = (
arr,
id,
checkId,
flag,
items,
parentList,
childList
) => {
if (arr.length) {
for (const i in arr) {
if (arr[i].id === id) {
const wholeArr = Vue.prototype.$deepCopy(items)
const treeConvertArr = Vue.prototype.$treeConvertToArr(wholeArr)
if (arr[i].children && arr[i].children.length !== 0) {
// 勾选父级子级全部勾选 取消父级子级全部取消
// for (let j = 0; j < arr[i].children.length; j++) {
// let findIndex = arr[i].children[j].checkArr.findIndex((item) => item.id === checkId);
// arr[i].children[j].checkArr[findIndex].value = flag
// }
const findIndex = arr[i].checkArr.findIndex(
item => item.id === checkId
)
Vue.prototype.$setChildren(childList, findIndex, flag)
}
if (flag === true && parentList !== undefined) {
// 子级若有一个选中,则父级选中
const isFlagCheck = treeConvertArr.some(val => {
const checkIndex = val.checkArr.findIndex(
item => item.id === checkId
)
return val.checkArr[checkIndex].value === true
})
if (isFlagCheck === true) {
parentList.forEach(parent => {
const checkIndex = parent.checkArr.findIndex(
item => item.id === checkId
)
parent.checkArr[checkIndex].value = true
})
}
} else if (flag === false && parentList !== undefined) {
// 子级若都没选中,则父级不选中
const isFlagFalse = treeConvertArr.every(val => {
const checkIndex = val.checkArr.findIndex(
item => item.id === checkId
)
return val.checkArr[checkIndex].value === false
})
if (isFlagFalse === true) {
parentList.forEach(parent => {
const checkIndex = parent.checkArr.findIndex(
item => item.id === checkId
)
parent.checkArr[checkIndex].value = false
})
}
}
}
if (arr[i].children && arr[i].children.length !== 0) {
Vue.prototype.$setChildArr(
arr[i].children,
id,
checkId,
flag,
items,
parentList,
childList
)
}
}
}
}
// 处理localStorage获取值转换boolean为string问题 json字符串转为json
Vue.prototype.$getLocalStorage = (name, type) => {
let data = localStorage.getItem(name)
if (type === 'boolean') {
if (data === 'false') {
data = false
} else {
data = true
}
return data
}
if (type === 'object') {
data = JSON.parse(data)
return data
}
return data
}
export default {
checkTel,
checkCode
}
<!-- 登簿日志查询 -->
\ 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>
......@@ -11,18 +11,7 @@
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="菜单名称:" prop="name" label-width="124px">
<el-input v-model="form.name" placeholder="菜单名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="图标:" label-width="54px">
<el-input
v-model="form.icon"
placeholder="图标"
:prefix-icon="form.icon"
clearable
@focus="getIconList"
/>
<el-input v-model="form.name" placeholder="请输入菜单名称" />
</el-form-item>
</el-col>
</el-row>
......@@ -34,17 +23,20 @@
v-model="form.parentId"
:options="parentMenuList"
:props="setProps"
placeholder="上级菜单"
placeholder="请选择上级菜单"
clearable
@change="handleChange"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="代码:" prop="code" label-width="54px">
<el-input
v-model="codeComputed"
placeholder="菜单代码"
placeholder="请输入菜单代码"
:disabled="type === 1"
/>
</el-form-item>
......@@ -53,7 +45,7 @@
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="链接路径:" label-width="124px">
<el-input v-model="form.uri" placeholder="链接路径" />
<el-input v-model="form.uri" placeholder="请输入链接路径" />
</el-form-item>
</el-col>
</el-row>
......@@ -62,7 +54,7 @@
<el-form-item label="浏览器跳转模式:" label-width="124px">
<el-select
v-model="form.jumpMode"
placeholder="浏览器跳转模式"
placeholder="请选择浏览器跳转模式"
>
<el-option
v-for="item in jumpModeList"
......@@ -93,7 +85,12 @@
</template>
<template slot="footer">
<el-button class="cancel-button" @click="close()">取消</el-button>
<el-button type="primary" @click="submitForm()">保存</el-button>
<el-button
type="primary"
@click="submitForm()"
>保存</el-button>
</template>
</Dialog>
<!-- 图标列表 -->
......@@ -103,50 +100,56 @@
<script>
import Dialog from "@/components/Dialog/";
// import JsonEditor from '@components/JsonEditors'
import JsonEditor from '../../../components/JsonEditors'
// import IconList from '@components/IconList'
import IconList from '../../../components/IconList'
import { validateCode } from '../../../utils/validate';
import { getParentMenuListAction } from '@/api/quanxianmanagement'
import JsonEditor from '@/components/JsonEditors'
import IconList from '@/components/IconList'
import { validateCode } from '@/utils/validate';
import { api, httpAction } from '@/api/manageApi'
export default {
name: "EditDialog",
name: 'MenuModal',
components: {
Dialog,
JsonEditor,
IconList,
JsonEditor,
Dialog
},
props: {
productId: {
type: String,
default: ''
}
},
data() {
return {
form: {
icon: "",
code: "",
icon: '',
code: ''
},
rules: {
name: [{ required: true, message: "请输入菜单名称", trigger: "blur" }],
name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
code: [
{ required: true, message: "必填", trigger: "blur" },
{ validator: validateCode, trigger: "blur" },
],
{ required: true, message: '必填', trigger: 'blur' },
{ validator: validateCode, trigger: 'blur' }
]
},
title: "",
type: "",
title: '',
type: '',
visible: false,
parentMenuList: [],
menuKey: 0,
jumpModeList: [
{ name: "在当前页面显示", value: 1 },
{ name: "跳转到新页面", value: 2 },
{ name: '在当前页面显示', value: 1 },
{ name: '跳转到新页面', value: 2 }
],
setProps: {
value: "id",
label: "name",
children: "children",
expandTrigger: "hover",
value: 'id',
label: 'name',
children: 'children',
expandTrigger: 'hover',
checkStrictly: true, // 可取消关联,选择任意一级选项
emitPath: false,
emitPath: false
},
// dataUrl: api.menus,
};
dataUrl: api.menus
}
},
computed: {
codeComputed: {
......@@ -161,136 +164,120 @@ export default {
created() {},
mounted() {},
methods: {
getParentMenuList() {
// getParentMenuListAction(id).then((res) => {
// if (res.status === 1) {
// const list = this.$dealArrChildren(res.content)
// if (id) {
// this.parentMenuList = this.$dealArrDisabled(
// this.$deepCopy(list),
// id
// )
// this.menuKey++
// } else {
// this.parentMenuList = list
// }
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
// 获取父级菜单
getParentMenuList(id) {
getParentMenuListAction(id).then((res) => {
if (res.status === 1) {
const list = this.$dealArrChildren(res.content)
if (id) {
this.parentMenuList = this.$dealArrDisabled(
this.$deepCopy(list),
id
)
this.menuKey++
} else {
this.parentMenuList = list
}
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
getIconList() {
this.$refs.iconList.show(true);
this.$refs.iconList.show(true)
},
// 选择图标
getIconName(data) {
this.form.icon = data;
this.form.icon = data
},
// 配置参数
getJsonString(data) {
this.form.metadata = data;
this.form.metadata = data
},
// 新增菜单
add() {
// console.log(this.productId)
// if (!this.productId) {
// this.$message.info({
// message: '请先选择子系统才能添加菜单,如果没有,请先添加子系统!',
// showClose: true
// })
// return
// }
// this.getParentMenuList(this.productId)
this.visible = true;
// this.type = 0
// this.form.jumpMode = 1
this.getParentMenuList(this.productId)
this.visible = true
this.type = 0
this.form.jumpMode = 1
},
// 编辑菜单
edit(record) {
this.type = 1
// 若有id为编辑
if (record.id) {
this.$nextTick(() => {
this.form = Object.assign({}, record)
// this.getParentMenuList(this.productId)
this.getParentMenuList(this.productId)
})
}
this.visible = true;
this.visible = true
},
// 选择上级菜单
handleChange(value) {
// this.form.parentId = value
this.form.parentId = value
},
// 保存
submitForm(submitType) {
// this.$refs.form.validate((valid) => {
// if (valid) {
// let method = "";
// let url = "";
// const formData = this.form;
// formData.productId = this.productId;
// if (!formData.id) {
// method = "post";
// url = this.dataUrl;
// } else {
// 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.$emit("ok");
// // this.type 0新增 1编辑 2添加子
// if (this.type === 0) {
// if (submitType === 1) {
// this.close();
// } else {
// this.resetForm();
// }
// } else if (this.type === 1) {
// this.close();
// } else if (this.type === 2) {
// if (submitType === 1) {
// this.close();
// } else {
// this.resetForm();
// this.form.parentId = formData.parentId;
// }
// }
// this.$emit("ok");
// } else {
// this.$message.error({ message: res.message, showClose: true });
// }
// })
// .catch((err) => {
// console.log(err);
// });
// }
// });
this.$refs.form.validate((valid) => {
if (valid) {
let method = ''
let url = ''
const formData = this.form
formData.productId = this.productId
if (!formData.id) {
method = 'post'
url = this.dataUrl
} else {
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.resetForm()
this.$emit('ok')
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
.catch((err) => {
console.log(err)
})
}
})
},
resetForm() {
this.$refs.form.resetFields();
this.$refs.form.resetFields()
this.form = {
icon: "",
code: "",
};
icon: '',
code: ''
}
},
close() {
this.resetForm();
this.visible = false;
},
},
};
this.resetForm()
this.visible = false
}
}
}
</script>
<style scoped lang="scss">
/deep/.el-input__inner {
background: #07388B;
border-radius: 2px;
border: 1px solid #6BC1FC;
/deep/.el-dialog__header {
text-align: center;
margin-bottom: 10px;
.el-dialog__title {
color: white;
}
/deep/.el-textarea__inner{
background: #07388B;
color: #fff;
}
/deep/.el-form-item__label{
color:#fff;
color: white;
}
/deep/.el-input__inner{
background-color: #07388B;
}
</style>
......
......@@ -14,186 +14,38 @@
</div>
<div class="from-clues-content">
<lb-table
:pagination="false"
:column="tableData.columns"
:data="tabledata"
:data="tablelistData"
row-key="id"
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
</lb-table>
</div>
<edit-dialog ref="dialogForm" />
<authorizationdiglog ref="rolesForm" />
<edit-dialog ref="dialogForm"
:product-id="productId"
:resource-category-id="resourceCategoryId"
@ok="reloadTableData"/>
<!-- <authorizationdiglog ref="rolesForm" /> -->
</div>
</template>
<script>
// 定时任务
import data from "./data";
import { deleteAction, getAction, api } from "@/api/manageApi";
import EditDialog from "./edit-dialog.vue";
import authorizationdiglog from "./authorizationdiglog.vue";
// import authorizationdiglog from "./authorizationdiglog.vue";
export default {
name: "menus",
components: {
EditDialog,
authorizationdiglog,
// authorizationdiglog,
},
data() {
return {
tabledata: [
{
id: "c6221838-187b-4a7a-b173-b0543022f560",
createdAt: "2021-08-26T07:00:07.101+0000",
updatedAt: "2021-08-26T07:00:07.101+0000",
createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 35,
name: "概览",
code: "GL",
description: null,
uri: null,
parentId: null,
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata: null,
children: [
{
id: "abf28772-a719-44bd-b461-f63ab9e0a53d",
createdAt: "2022-03-04T08:08:25.703+0000",
updatedAt: "2022-03-04T09:21:19.578+0000",
createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 197,
name: "资源概览",
code: "ZYGL2",
description: null,
uri: "/admin/#/resource-overview",
parentId: "c6221838-187b-4a7a-b173-b0543022f560",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata:
'{"icon":"resource-overview","iconActive":"resource-overview-active"}',
children: null,
},
{
id: "06a0807e-11f5-4046-b245-3bb7b835b1c5",
createdAt: "2022-03-04T08:09:18.106+0000",
updatedAt: "2022-03-04T09:21:24.292+0000",
createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 196,
name: "访问概览",
code: "FWGL",
description: null,
uri: "/admin/#/access-overview",
parentId: "c6221838-187b-4a7a-b173-b0543022f560",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata:
'{"icon":"access-overview","iconActive":"access-overview-active"}',
children: null,
},
],
},
{
id: "f94c92cb-a032-4b89-8722-79dbcc331894",
createdAt: null,
updatedAt: null,
createdBy: null,
updatedBy: null,
sort: 59,
name: "资源管理",
code: "ZYGL",
description: null,
uri: null,
parentId: null,
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata: null,
children: [
{
id: "065fe2d7-d59a-442c-92d0-c91aa19d7fae",
createdAt: null,
updatedAt: "2021-11-11T09:40:08.951+0000",
createdBy: null,
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 35,
name: "目录管理",
code: "MLGL",
description: null,
uri: "/admin/#/catalog-manage",
parentId: "f94c92cb-a032-4b89-8722-79dbcc331894",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata:
'{"icon":"tubiao_huaban","iconActive":"tubiao_huaban-active"}',
children: [
{
id: "0b5952bc-dc7f-4d4e-8fcc-af9d33908c2a",
createdAt: null,
updatedAt: "2022-03-04T01:46:25.515+0000",
createdBy: null,
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 137,
name: "服务目录",
code: "FWML",
description: null,
uri: "/admin/#/catalog-manage/catalog-service",
parentId: "065fe2d7-d59a-442c-92d0-c91aa19d7fae",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata: null,
children: null,
},
{
id: "2377caf7-22e5-4261-b88a-0fbbbace1452",
createdAt: null,
updatedAt: "2022-03-04T01:47:00.774+0000",
createdBy: null,
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: -3,
name: "应用目录",
code: "YYML",
description: null,
uri: "/admin/#/catalog-manage/catalog-application",
parentId: "065fe2d7-d59a-442c-92d0-c91aa19d7fae",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata: null,
children: null,
},
],
},
],
},
],
tablelistData: [],
resourceCategoryId:"",
taskData: null,
form: {
job_name: "",
......@@ -207,26 +59,7 @@ export default {
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
tableData: [],
sexList: [],
typeOptions: [
{
value: "0",
label: "姓名",
},
{
value: "1",
label: "工号",
},
{
value: "2",
label: "部门",
},
{
value: "3",
label: "机构",
},
],
selectionList: [],
tableData: {
......@@ -247,16 +80,7 @@ export default {
>
修改
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-video-pause"
onClick={() => {
this.authorizationQuery(scope.row);
}}
>
授权
</el-button>
<el-button
type="text"
size="mini"
......@@ -280,12 +104,80 @@ export default {
pageSize: 15,
current: 1,
},
tableUrl: api.menus, // 菜单接口地址
meumurlid: api.subsystem,// 项目id接口地址
productId:""//项目id
};
},
created() {
this.getTableList();
},
methods: {
// 加载表格数据
getTableList() {
const queryOptionsid = {
conditionGroup: {
queryRelation: "AND",
conditions: [
{
property: "code",
value: "BDCJGPT",
operator: "EQ",
},
],
},
};
const params = {
queryOptions: queryOptionsid,
};
// 获取系统id
getAction(this.meumurlid, params)
.then((res) => {
this.productId=res.content[0].id;
let queryOptions = {
conditionGroup: {
conditions: [
{
property: "productId",
value: this.productId,
operator: "EQ",
},
],
queryRelation: "AND",
},
orderBys: [{ property: "sort", direction: "desc" }],
};
if (!this.tableUrl) {
console.log("请设置tableUrl属性为接口地址!");
return;
}
if (this.queryOptions !== "") {
this.queryParam.queryOptions = JSON.stringify(queryOptions);
}
// 查询系统菜单
getAction(this.tableUrl, this.queryParam)
.then((res) => {
if (res.status === 1) {
this.loading = false;
this.tablelistData = res.content;
console.log("this.tablelistData", this.tablelistData);
} else {
this.$message.error({ message: res.message, showClose: true });
this.loading = false;
}
})
.catch((error) => {
console.log("errrrrrorrrrr", error);
this.loading = false;
});
})
.catch((error) => {
console.log("errrrrrorrrrr", error);
});
},
// 新增菜单
handleAdd() {
this.taskData = null;
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "添加";
},
......@@ -295,43 +187,49 @@ export default {
this.$refs.dialogForm.edit(record);
this.$refs.dialogForm.title = "修改";
},
// 授权
authorizationQuery(record) {
this.$refs.rolesForm.authorization(record);
this.$refs.rolesForm.title = "授权查询";
},
// 删除
handleDelete(row, id) {
this.$confirm("此操将进行删除操作, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
handleDelete(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(() => {
// sjsbTask.sjsbTaskRemove(row.id)
// .then((res) => {
// if ((res.code = 200)) {
// this.$message({
// type: 'success',
// message: res.message,
// })
// this.featchData()
// }
// })
// .catch((error) => {
// this.$alert(error, '提示', {
// confirmButtonText: '确定',
// type: 'error'
// })
// })
if (!this.tableUrl) {
this.$message.error({
message: '请设置tableUrl属性为接口地址!',
showClose: true
})
.catch(() => {
this.$message({
type: "info",
message: "已取消",
});
});
return
}
const url = this.tableUrl + '/' + id
deleteAction(url).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.reloadTableData()
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
})
.catch(() => {})
},
// 新增、编辑回显
reloadTableData() {
this.getTableList()
},
},
};
......@@ -339,10 +237,10 @@ export default {
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
.btnColRight{
.btnColRight {
margin-top: 20px;
}
/deep/.el-table__expand-icon{
}
/deep/.el-table__expand-icon {
color: #fff;
}
</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,20 +192,15 @@ 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')
} else {
this.$message.error({ message: res.message, showClose: true })
......@@ -215,9 +219,9 @@ export default {
this.$refs.form.resetFields()
},
close() {
// this.resetForm()
this.visible = false;
},
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";
......@@ -98,8 +104,16 @@ 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);
......@@ -187,81 +191,79 @@ export default {
};
},
created() {
this.featchData();
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,
},
{
"dictid": "e6a5aeb8957b8029fa31586fb30dd5b8",
"children": null,
"TYPEID": "1F460F6E5E354C1AA3C470434D7A67DF",
"PARENTID": "underf",
"DCODE": "2344",
"DNAME": "小田",
"SORT": null,
"index": 13,
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 });
}
]
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,51 +278,6 @@ 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);
......@@ -328,22 +285,28 @@ this.tableData.data=judgeSort(this.tableData.data)
},
// 删除
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()
},
},
};
......