Merge branch 'hi-ucs-dev' of http://192.168.124.50:3000/wuhongjian/hi-ucs into hi-ucs-dev
This commit is contained in:
commit
a8aba6b4f1
|
@ -1,42 +1,36 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-input v-model="showDeptName" :placeholder="placeholder" @focus="deptDialog">
|
<el-input v-model="showDeptName" :placeholder="placeholder" @focus="deptDialog">
|
||||||
<el-button slot="append" icon="el-icon-search" @click="deptDialog"></el-button>
|
<el-button slot="append" icon="el-icon-search" @click="deptDialog"></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-input :value="value" style="display: none"></el-input>
|
<el-input :value="value" style="display: none"></el-input>
|
||||||
<el-dialog :visible.sync="visibleDept" width="30%" :modal="false" :title="placeholder" :close-on-click-modal="false" :close-on-press-escape="false">
|
<el-dialog :visible.sync="visibleDept" width="30%" :modal="false" :title="placeholder" :close-on-click-modal="false"
|
||||||
<el-form size="mini" :inline="true">
|
:close-on-press-escape="false">
|
||||||
<el-form-item :label="$t('keyword')">
|
<el-form size="mini" :inline="true">
|
||||||
<el-input v-model="filterText"></el-input>
|
<el-form-item :label="$t('keyword')">
|
||||||
</el-form-item>
|
<el-input v-model="filterText"></el-input>
|
||||||
<el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-button type="default">{{ $t('query') }}</el-button> -->
|
<el-form-item>
|
||||||
<el-button type="default">{{ $t('query') }}</el-button>
|
<!-- <el-button type="default">{{ $t('query') }}</el-button> -->
|
||||||
</el-form-item>
|
<el-button type="default">{{ $t('query') }}</el-button>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
<el-tree
|
</el-form>
|
||||||
class="filter-tree"
|
<el-tree class="filter-tree" :data="deptList" :default-expanded-keys="expandedKeys"
|
||||||
:data="deptList"
|
:props="{ label: 'name', children: 'children' }" :expand-on-click-node="false" :filter-node-method="filterNode"
|
||||||
:default-expanded-keys="expandedKeys"
|
:highlight-current="true" node-key="id" ref="tree">
|
||||||
:props="{ label: 'name', children: 'children' }"
|
</el-tree>
|
||||||
:expand-on-click-node="false"
|
<template slot="footer">
|
||||||
:filter-node-method="filterNode"
|
<el-button type="default" @click="cancelHandle()" size="mini">{{ $t('cancel') }}</el-button>
|
||||||
:highlight-current="true"
|
<el-button v-if="query" type="info" @click="clearHandle()" size="mini">{{ $t('clear') }}</el-button>
|
||||||
node-key="id"
|
<el-button type="primary" @click="commitHandle()" size="mini">{{ $t('confirm') }}</el-button>
|
||||||
ref="tree">
|
</template>
|
||||||
</el-tree>
|
</el-dialog>
|
||||||
<template slot="footer">
|
|
||||||
<el-button type="default" @click="cancelHandle()" size="mini">{{ $t('cancel') }}</el-button>
|
|
||||||
<el-button v-if="query" type="info" @click="clearHandle()" size="mini">{{ $t('clear') }}</el-button>
|
|
||||||
<el-button type="primary" @click="commitHandle()" size="mini">{{ $t('confirm') }}</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'RenDeptTree',
|
name: 'RenDeptTree',
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
filterText: '',
|
filterText: '',
|
||||||
visibleDept: false,
|
visibleDept: false,
|
||||||
|
@ -56,15 +50,20 @@ export default {
|
||||||
placeholder: String
|
placeholder: String
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
filterText (val) {
|
filterText(val) {
|
||||||
this.$refs.tree.filter(val)
|
this.$refs.tree.filter(val)
|
||||||
},
|
},
|
||||||
deptName (val) {
|
deptName(val) {
|
||||||
this.showDeptName = val
|
this.showDeptName = val
|
||||||
|
},
|
||||||
|
visibleDept(val) {
|
||||||
|
if (!val) {
|
||||||
|
this.filterText = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
deptDialog () {
|
deptDialog() {
|
||||||
this.expandedKeys = null
|
this.expandedKeys = null
|
||||||
if (this.$refs.tree) {
|
if (this.$refs.tree) {
|
||||||
this.$refs.tree.setCurrentKey(null)
|
this.$refs.tree.setCurrentKey(null)
|
||||||
|
@ -72,11 +71,11 @@ export default {
|
||||||
this.visibleDept = true
|
this.visibleDept = true
|
||||||
this.getDeptList(this.value)
|
this.getDeptList(this.value)
|
||||||
},
|
},
|
||||||
filterNode (value, data) {
|
filterNode(value, data) {
|
||||||
if (!value) return true
|
if (!value) return true
|
||||||
return data.name.indexOf(value) !== -1
|
return data.name.indexOf(value) !== -1
|
||||||
},
|
},
|
||||||
getDeptList (id) {
|
getDeptList(id) {
|
||||||
return this.$http.get('/sys/dept/list').then(({ data: res }) => {
|
return this.$http.get('/sys/dept/list').then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg)
|
||||||
|
@ -86,14 +85,14 @@ export default {
|
||||||
this.$refs.tree.setCurrentKey(id)
|
this.$refs.tree.setCurrentKey(id)
|
||||||
this.expandedKeys = [id]
|
this.expandedKeys = [id]
|
||||||
})
|
})
|
||||||
}).catch(() => {})
|
}).catch(() => { })
|
||||||
},
|
},
|
||||||
cancelHandle () {
|
cancelHandle() {
|
||||||
this.visibleDept = false
|
this.visibleDept = false
|
||||||
this.deptList = []
|
this.deptList = []
|
||||||
this.filterText = ''
|
this.filterText = ''
|
||||||
},
|
},
|
||||||
clearHandle () {
|
clearHandle() {
|
||||||
this.$emit('input', '')
|
this.$emit('input', '')
|
||||||
this.$emit('update:deptName', '')
|
this.$emit('update:deptName', '')
|
||||||
this.showDeptName = ''
|
this.showDeptName = ''
|
||||||
|
@ -101,7 +100,7 @@ export default {
|
||||||
this.deptList = []
|
this.deptList = []
|
||||||
this.filterText = ''
|
this.filterText = ''
|
||||||
},
|
},
|
||||||
commitHandle () {
|
commitHandle() {
|
||||||
const node = this.$refs.tree.getCurrentNode()
|
const node = this.$refs.tree.getCurrentNode()
|
||||||
if (!node) {
|
if (!node) {
|
||||||
this.$message.error(this.$t('dept.chooseerror'))
|
this.$message.error(this.$t('dept.chooseerror'))
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
/*
|
/*
|
||||||
* @Author: hisense.wuhongjian
|
* @Author: hisense.wuhongjian
|
||||||
* @Date: 2020-07-07 16:03:23
|
* @Date: 2020-07-07 16:03:23
|
||||||
* @LastEditors: hisense.wuhongjian
|
* @LastEditors: Light
|
||||||
* @LastEditTime: 2022-10-13 21:31:09
|
* @LastEditTime: 2022-10-22 11:08:16
|
||||||
* @Description: 系统静态参数配置
|
* @Description: 系统静态参数配置
|
||||||
*/
|
*/
|
||||||
var _global = {}
|
var _global = {}
|
||||||
var CONFIGITEM = {
|
var CONFIGITEM = {
|
||||||
// version: 'qingdao', //青岛
|
// version: 'qingdao', //青岛
|
||||||
version: 'xihaian', // 西海岸
|
version: 'dev', // 西海岸
|
||||||
// version: 'qingdao', // 开发
|
// version: 'qingdao', // 开发
|
||||||
// version: 'zhanTingDev', // 展厅dev (2022-09-13:姜永超让添加)
|
// version: 'zhanTingDev', // 展厅dev (2022-09-13:姜永超让添加)
|
||||||
// version: 'qingdao', // 测试
|
// version: 'qingdao', // 测试
|
||||||
|
@ -86,8 +86,8 @@ var CONFIGITEM = {
|
||||||
userPwd: '',
|
userPwd: '',
|
||||||
},
|
},
|
||||||
backUrl: 'http://localhost:8001',
|
backUrl: 'http://localhost:8001',
|
||||||
previewUrl: 'http://192.168.124.236:9796/',
|
previewUrl: 'http://192.168.124.243:9796/',
|
||||||
websocketURL: '192.168.124.233:8888/renren-admin',
|
websocketURL: '192.168.124.243:8888/renren-admin',
|
||||||
// websocketURL: '10.18.1.99:8889/renren-admin',
|
// websocketURL: '10.18.1.99:8889/renren-admin',
|
||||||
POI_URL:
|
POI_URL:
|
||||||
'http://15.72.178.129:8090/iserver/services/addressmatch-qingdaoPOI181015/restjsr/v1/address',
|
'http://15.72.178.129:8090/iserver/services/addressmatch-qingdaoPOI181015/restjsr/v1/address',
|
||||||
|
|
|
@ -16,6 +16,7 @@ const state = () => ({
|
||||||
username: '',
|
username: '',
|
||||||
realName: '',
|
realName: '',
|
||||||
deptName: '',
|
deptName: '',
|
||||||
|
deptId: '',
|
||||||
userId: '',
|
userId: '',
|
||||||
avatar: '',
|
avatar: '',
|
||||||
role: 0, // 用户管理员权限
|
role: 0, // 用户管理员权限
|
||||||
|
@ -28,6 +29,7 @@ const getters = {
|
||||||
role: (state) => state.role,
|
role: (state) => state.role,
|
||||||
userId: (state) => state.userId,
|
userId: (state) => state.userId,
|
||||||
deptName: (state) => state.deptName,
|
deptName: (state) => state.deptName,
|
||||||
|
deptId: (state) => state.deptId,
|
||||||
}
|
}
|
||||||
const mutations = {
|
const mutations = {
|
||||||
/**
|
/**
|
||||||
|
@ -70,6 +72,9 @@ const mutations = {
|
||||||
setDeptName(state, name) {
|
setDeptName(state, name) {
|
||||||
state.deptName = name
|
state.deptName = name
|
||||||
},
|
},
|
||||||
|
setDeptId(state, name) {
|
||||||
|
state.deptId = name
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* @author chuzhixin 1204505056@qq.com
|
* @author chuzhixin 1204505056@qq.com
|
||||||
* @description 设置头像
|
* @description 设置头像
|
||||||
|
@ -143,6 +148,7 @@ const actions = {
|
||||||
commit('setRole', res.data.data.roleIdList.length)
|
commit('setRole', res.data.data.roleIdList.length)
|
||||||
commit('setUserId', res.data.data.id)
|
commit('setUserId', res.data.data.id)
|
||||||
commit('setDeptName', res.data.data.deptName)
|
commit('setDeptName', res.data.data.deptName)
|
||||||
|
commit('setDeptId', res.data.data.deptId)
|
||||||
// TODO 获取用户信息,后续执行部分操作
|
// TODO 获取用户信息,后续执行部分操作
|
||||||
// let { username, avatar, roles, ability } = data
|
// let { username, avatar, roles, ability } = data
|
||||||
// if (username && roles && Array.isArray(roles)) {
|
// if (username && roles && Array.isArray(roles)) {
|
||||||
|
@ -175,7 +181,7 @@ const actions = {
|
||||||
* @param {*} { commit, dispatch }
|
* @param {*} { commit, dispatch }
|
||||||
*/
|
*/
|
||||||
async resetAll({ dispatch }) {
|
async resetAll({ dispatch }) {
|
||||||
debugger
|
|
||||||
await dispatch('setAccessToken', '')
|
await dispatch('setAccessToken', '')
|
||||||
await dispatch('acl/setFull', false, {
|
await dispatch('acl/setFull', false, {
|
||||||
root: true,
|
root: true,
|
||||||
|
|
|
@ -45,7 +45,6 @@ router.beforeEach(async (to, from, next) => {
|
||||||
})
|
})
|
||||||
console.log('验证白名单', routesWhiteList)
|
console.log('验证白名单', routesWhiteList)
|
||||||
if (routesWhiteList.indexOf(to.path) !== -1) {
|
if (routesWhiteList.indexOf(to.path) !== -1) {
|
||||||
debugger
|
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
// 这里是一个单点登录的入口
|
// 这里是一个单点登录的入口
|
||||||
|
|
|
@ -117,6 +117,7 @@
|
||||||
import mybus from '@/myplugins/mybus'
|
import mybus from '@/myplugins/mybus'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { UpOutlined, DownOutlined } from '@ant-design/icons-vue'
|
import { UpOutlined, DownOutlined } from '@ant-design/icons-vue'
|
||||||
|
import { useStore } from 'vuex'
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
const selectedKeys = ref([])
|
const selectedKeys = ref([])
|
||||||
|
@ -126,6 +127,12 @@
|
||||||
children: 'children',
|
children: 'children',
|
||||||
title: 'name',
|
title: 'name',
|
||||||
}
|
}
|
||||||
|
const store = useStore()
|
||||||
|
// 用户信息
|
||||||
|
const user = ref({
|
||||||
|
deptName: store.getters['user/deptName'],
|
||||||
|
deptId: store.getters['user/deptId'],
|
||||||
|
})
|
||||||
const showKey = ref(0)
|
const showKey = ref(0)
|
||||||
const treeData = ref([])
|
const treeData = ref([])
|
||||||
const init = () => {
|
const init = () => {
|
||||||
|
@ -138,7 +145,7 @@
|
||||||
if (select === '123') {
|
if (select === '123') {
|
||||||
select = ''
|
select = ''
|
||||||
}
|
}
|
||||||
// debugger
|
|
||||||
console.log(
|
console.log(
|
||||||
'获取url中的select=====================>',
|
'获取url中的select=====================>',
|
||||||
router.currentRoute.value.query.select
|
router.currentRoute.value.query.select
|
||||||
|
@ -178,7 +185,33 @@
|
||||||
treeData.value.sort((a, b) => {
|
treeData.value.sort((a, b) => {
|
||||||
return sortArr.indexOf(a.key) - sortArr.indexOf(b.key)
|
return sortArr.indexOf(a.key) - sortArr.indexOf(b.key)
|
||||||
})
|
})
|
||||||
|
let deptId=user.value.deptId
|
||||||
|
treeData.value.forEach((child) => {
|
||||||
|
let childern=child.children
|
||||||
|
childern.forEach((childs) => {//第一层:市级
|
||||||
|
if(childs.key==deptId ){
|
||||||
|
childs.show=true
|
||||||
|
child.show=true
|
||||||
|
mybus.emit('paramsGetResources', [childs.key])
|
||||||
|
selectId.value =childs.key
|
||||||
|
}
|
||||||
|
if(childs.children && childs.children.length>0){//第二层 区级
|
||||||
|
let qu=childs.children
|
||||||
|
qu.forEach((qu) => {
|
||||||
|
if(qu.key==deptId ){
|
||||||
|
qu.show=true
|
||||||
|
childs.show=true
|
||||||
|
child.show=true
|
||||||
|
mybus.emit('paramsGetResources', [qu.key])
|
||||||
|
selectId.value = qu.key
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
console.log('左侧树结构数据======================>', treeData.value)
|
console.log('左侧树结构数据======================>', treeData.value)
|
||||||
|
|
||||||
showKey.value++
|
showKey.value++
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -188,6 +221,7 @@
|
||||||
})
|
})
|
||||||
// 生成children
|
// 生成children
|
||||||
const generateChildren = (val, obj) => {
|
const generateChildren = (val, obj) => {
|
||||||
|
|
||||||
if (val.dataList.length > 0) {
|
if (val.dataList.length > 0) {
|
||||||
val.dataList.forEach((child) => {
|
val.dataList.forEach((child) => {
|
||||||
let children = {
|
let children = {
|
||||||
|
@ -197,12 +231,14 @@
|
||||||
total: child.deptCount,
|
total: child.deptCount,
|
||||||
key: child.deptId,
|
key: child.deptId,
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.children.push(children)
|
obj.children.push(children)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 区级特殊处理
|
// 区级特殊处理
|
||||||
const generateChildren2 = (val, obj) => {
|
const generateChildren2 = (val, obj) => {
|
||||||
|
|
||||||
if (val.dataList.length > 0) {
|
if (val.dataList.length > 0) {
|
||||||
val.dataList.forEach((dis) => {
|
val.dataList.forEach((dis) => {
|
||||||
let children = {
|
let children = {
|
||||||
|
@ -222,6 +258,7 @@
|
||||||
select: false,
|
select: false,
|
||||||
key: child.deptId,
|
key: child.deptId,
|
||||||
}
|
}
|
||||||
|
|
||||||
children.children.push(children2)
|
children.children.push(children2)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -33,15 +33,16 @@ export default defineComponent({
|
||||||
imgActive: require('@/assets/personalCenter/applyactive.png'),
|
imgActive: require('@/assets/personalCenter/applyactive.png'),
|
||||||
key: 'apply',
|
key: 'apply',
|
||||||
}
|
}
|
||||||
|
const push = {
|
||||||
|
title: '我的发布',
|
||||||
|
img: require('@/assets/personalCenter/push.png'),
|
||||||
|
imgActive: require('@/assets/personalCenter/pushactive.png'),
|
||||||
|
key: 'push',
|
||||||
|
}
|
||||||
let menuList = [
|
let menuList = [
|
||||||
car,
|
car,
|
||||||
{
|
|
||||||
title: '我的发布',
|
|
||||||
img: require('@/assets/personalCenter/push.png'),
|
|
||||||
imgActive: require('@/assets/personalCenter/pushactive.png'),
|
|
||||||
key: 'push',
|
|
||||||
},
|
|
||||||
apply,
|
apply,
|
||||||
|
push,
|
||||||
{
|
{
|
||||||
title: '我的收藏',
|
title: '我的收藏',
|
||||||
img: require('@/assets/personalCenter/collect.png'),
|
img: require('@/assets/personalCenter/collect.png'),
|
||||||
|
@ -69,7 +70,7 @@ export default defineComponent({
|
||||||
]
|
]
|
||||||
// 西海岸
|
// 西海岸
|
||||||
if (itShowXiHaiAn) {
|
if (itShowXiHaiAn) {
|
||||||
menuList = [car, apply]
|
menuList = [car, apply, push]
|
||||||
}
|
}
|
||||||
const selectedKeys = ref(['apply'])
|
const selectedKeys = ref(['apply'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue