大屏菜单可配置

This commit is contained in:
jiayu 2024-12-30 17:03:11 +08:00
parent 97b593c32a
commit 57f2384a82
13 changed files with 1024 additions and 162 deletions

View File

@ -63,6 +63,7 @@
"vue-seamless-scroll": "^1.1.23",
"vue-simple-uploader": "^0.7.6",
"vue2-scale-box": "^0.1.7",
"vuedraggable": "^2.24.3",
"vuescroll": "^4.16.1",
"vuex": "^3.4.0",
"vuex-persistedstate": "^3.1.0",

View File

@ -98,3 +98,9 @@ export const getDictionaryItemPageApi = (data) => get('/xmgl/dictionaryItem/page
export const getDictionaryItemBackApi = (data) => post('/xmgl/dictionary/back', data)
export const deleteDictionaryItemBackApi = (data) => post('/xmgl/dictionary/deletePhysic', data)
export const batchDeleteDictionaryItemBackApi = (data) => post('/xmgl/dictionary/batch/delete', data)
export const getScreenAuthTreeApi = (data) => post('/xmgl/screenAuth/tree', data)
export const addScreenAuthApi = (data) => post('/xmgl/screenAuth/add', data)
export const getScreenAuthModuleAndMenuTreeApi = (data) => get('/xmgl/screenAuth/moduleAndMenuTree', data)
export const getScreenAuthModuleAndMenuApi = (data) => get('/xmgl/screenAuth/getModuleAndMenu', data)
export const getScreenAuthTypeApi = (data) => post('/xmgl/screenAuth/getType', data)

View File

@ -174,6 +174,18 @@
<img src="@/assets/images/xmht.png" width="15px" height="15px" />
<span>{{ projectFront }}</span>
</div>
<!-- 数据看板 -->
<div
class="width_100"
@click="toOverview()"
v-if="
$route.path.indexOf('/projectList') == -1
"
title="数据看板"
>
<img src="@/assets/images/xmht.png" width="15px" height="15px" />
<span>数据看板</span>
</div>
</div>
<div class="flex2 logout">
@ -204,6 +216,8 @@
import {
getNewUserAllModulePageApi,
} from "@/assets/js/api/jxjadmin.js";
import { getProjectDetail } from "@/assets/js/api/baseInfo.js";
import { getScreenAuthModuleAndMenuApi } from '@/assets/js/api/jxjadmin.js'
export default {
data() {
return {
@ -265,6 +279,57 @@ export default {
// console.log('',this.enterpriseBackground)
},
methods: {
async getAuthModuleAndMenu() {
let bool = false
const res = await getScreenAuthModuleAndMenuApi()
if (res.code === 200) {
bool = res.result.length ? true : false
}
return bool
},
toOverview() {
console.info(this.$store.state.userInfo.accountType,'----')
if(![5, 6, 10].includes(this.$store.state.userInfo.accountType)) {
return this.goProjectBackstage()
}
this.toOverview2()
},
async toOverview2() {
this.$forceUpdate();
await this.getProjectDetail();
if (this.newBigScreen == null || this.newBigScreen == "") {
this.$message({
message: "当前项目没有看板",
type: "warning",
});
} else {
const isPermission = await this.getAuthModuleAndMenu()
if(!isPermission) {
return this.$message({
message: "当前用户没有访问数据看板权限",
type: "warning",
});
}
console.log("当前跳转链接", this.newBigScreen);
//--------------------
this.jumpToken = localStorage.getItem("jumpToken");
let userId = this.$store.state.userInfo.userId;
window.open(this.newBigScreen + "?userId=" + userId + '&sn=' + this.$store.state.projectSn, "_self");
// window.open('http://192.168.34.216:8081/#/large?userId=' + userId + '&sn=' + this.$store.state.projectSn, "_self")//token
}
},
async getProjectDetail() {
let data = {
projectSn: this.$store.state.projectSn,
};
await getProjectDetail(data).then((res) => {
if (res.result) {
this.newBigScreen = res.result.newBigScreen;
console.log("接口获取数据看板地址", this.newBigScreen);
}
});
},
//
updatePw() {
this.$router.push({

View File

@ -212,6 +212,7 @@ import centerChange from "@/components/centerChange.vue";
import { getProjectDetail, getProjectExtendInfoApi } from "@/assets/js/api/baseInfo.js";
import {
getNewUserAllModulePageApi,
getScreenAuthModuleAndMenuApi
} from "@/assets/js/api/jxjadmin.js";
export default {
@ -546,93 +547,51 @@ export default {
window.open(this.newBigScreen + "?token=" + this.jumpToken, "_self");
// window.open('http://192.168.34.138:8081/#/large?token=' + this.jumpToken + '&sn=' + this.$store.state.projectSn, "_self")//token
}
// if (this.newBigScreen != null) {
// console.log("",this.newBigScreen)
// //--------------------
// this.jumpToken = localStorage.getItem('jumpToken')
// window.open(this.newBigScreen + '?token=' + this.jumpToken, '_self')
// // window.open('http://192.168.34.226:8081/#/large?token=' + this.jumpToken, "_self")//token
// } else {
// //--------------------
// //
// let arr = this.$store.state.userInfo.menuAuthority.moduleList
// let arr2 = []
// arr.forEach(element => {
// if (element.moduleType == 4) {
// arr2.push(element)
// return
// }
// })
// // 访
// if (!arr2.length) {
// return this.$message.warning('')
// }
// let routeUrl = this.$router.resolve({
// path: arr2[0].modulePath
// })
// window.location.href = routeUrl.href
// window._paq.push(['trackEvent', '', '', ''])
// }
// if (this.company == 'syhy') {
// //--------------------
// this.jumpToken = localStorage.getItem('jumpToken')
// window.open('http://101.43.164.214:45022/#/large?token=' + this.jumpToken, '_self') //
// // window.open('http://192.168.34.226:8081/#/large?token=' + this.jumpToken, "_self")//token
// } else if (this.company == 'jxwjj') {
// this.jumpToken = localStorage.getItem('jumpToken')
// window.open('http://183.249.224.118:9003/#/large?token=' + this.jumpToken, '_self') //
// } else if (this.company == 'gxbs') {
// this.jumpToken = localStorage.getItem('jumpToken')
// window.open('http://101.43.164.214:11113/#/large?token=' + this.jumpToken, '_self') //广西
// } else {
// //--------------------
// //
// let arr = this.$store.state.userInfo.menuAuthority.moduleList
// let arr2 = []
// arr.forEach(element => {
// if (element.moduleType == 4) {
// arr2.push(element)
// return
// }
// })
// // 访
// if (!arr2.length) {
// return this.$message.warning('')
// }
// let routeUrl = this.$router.resolve({
// path: arr2[0].modulePath
// })
// window.location.href = routeUrl.href
// window._paq.push(['trackEvent', '', '', ''])
// }
},
toOverview2() {
async getAuthModuleAndMenu() {
let bool = false
const res = await getScreenAuthModuleAndMenuApi()
if (res.code === 200) {
bool = res.result.length ? true : false
}
return bool
},
async toOverview2() {
this.$forceUpdate();
this.newBigScreen = this.getNewBigScreen;
if (this.newBigScreen == null || this.newBigScreen == "") {
//--------------------
//
let arr = this.$store.state.userInfo.menuAuthority.moduleList;
let arr2 = [];
arr.forEach((element) => {
if (element.moduleType == 4) {
arr2.push(element);
return;
}
// //--------------------
// //
// let arr = this.$store.state.userInfo.menuAuthority.moduleList;
// let arr2 = [];
// arr.forEach((element) => {
// if (element.moduleType == 4) {
// arr2.push(element);
// return;
// }
// });
// // 访
// if (!arr2.length) {
// return this.$message.warning("");
// }
// let routeUrl = this.$router.resolve({
// path: arr2[0].modulePath,
// });
// window.location.href = routeUrl.href;
// window._paq.push(["trackEvent", "", "", ""]);
this.$message({
message: "当前项目没有看板",
type: "warning",
});
// 访
if (!arr2.length) {
return this.$message.warning("暂无权限");
}
let routeUrl = this.$router.resolve({
path: arr2[0].modulePath,
});
window.location.href = routeUrl.href;
window._paq.push(["trackEvent", "点击", "数据看板", "进入数据看板"]);
} else {
const isPermission = await this.getAuthModuleAndMenu()
if(!isPermission) {
return this.$message({
message: "当前用户没有访问数据看板权限",
type: "warning",
});
}
console.log("当前跳转链接", this.newBigScreen);
//--------------------
this.jumpToken = localStorage.getItem("jumpToken");
@ -640,67 +599,6 @@ export default {
window.open(this.newBigScreen + "?userId=" + userId + '&sn=' + this.$store.state.projectSn, "_self");
// window.open('http://192.168.34.216:8081/#/large?userId=' + userId + '&sn=' + this.$store.state.projectSn, "_self")//token
}
// if (this.newBigScreen != null) {
// console.log("",this.newBigScreen)
// //--------------------
// this.jumpToken = localStorage.getItem('jumpToken')
// window.open(this.newBigScreen + '?token=' + this.jumpToken, '_self')
// // window.open('http://192.168.34.226:8081/#/large?token=' + this.jumpToken, "_self")//token
// } else {
// //--------------------
// //
// let arr = this.$store.state.userInfo.menuAuthority.moduleList
// let arr2 = []
// arr.forEach(element => {
// if (element.moduleType == 4) {
// arr2.push(element)
// return
// }
// })
// // 访
// if (!arr2.length) {
// return this.$message.warning('')
// }
// let routeUrl = this.$router.resolve({
// path: arr2[0].modulePath
// })
// window.location.href = routeUrl.href
// window._paq.push(['trackEvent', '', '', ''])
// }
// if (this.company == 'syhy') {
// //--------------------
// this.jumpToken = localStorage.getItem('jumpToken')
// window.open('http://101.43.164.214:45022/#/large?token=' + this.jumpToken, '_self') //
// // window.open('http://192.168.34.226:8081/#/large?token=' + this.jumpToken, "_self")//token
// } else if (this.company == 'jxwjj') {
// this.jumpToken = localStorage.getItem('jumpToken')
// window.open('http://183.249.224.118:9003/#/large?token=' + this.jumpToken, '_self') //
// } else if (this.company == 'gxbs') {
// this.jumpToken = localStorage.getItem('jumpToken')
// window.open('http://101.43.164.214:11113/#/large?token=' + this.jumpToken, '_self') //广西
// } else {
// //--------------------
// //
// let arr = this.$store.state.userInfo.menuAuthority.moduleList
// let arr2 = []
// arr.forEach(element => {
// if (element.moduleType == 4) {
// arr2.push(element)
// return
// }
// })
// // 访
// if (!arr2.length) {
// return this.$message.warning('')
// }
// let routeUrl = this.$router.resolve({
// path: arr2[0].modulePath
// })
// window.location.href = routeUrl.href
// window._paq.push(['trackEvent', '', '', ''])
// }
},
toOverviewCommand() {
this.$forceUpdate();

View File

@ -0,0 +1,207 @@
<!-- 下拉树单选 -->
<template>
<el-select :value="valueTitle" :clearable="clearable" :placeholder="placeholder" @clear="clearHandle">
<el-option :value="valueTitle" :label="valueTitle" class="options">
<el-tree
id="tree-option"
ref="selectTree"
:accordion="accordion"
:data="options"
:props="props"
highlight-current
default-expand-all
:node-key="props.value"
:filter-node-method="filterNode"
@node-click="handleNodeClick"
:expand-on-click-node="false"
:check-on-click-node="true"
:check-strictly="true"
>
<!-- <span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
</span> -->
</el-tree>
</el-option>
</el-select>
</template>
<script>
export default {
name: 'el-tree-select',
props: {
/* 配置项 */
props: {
type: Object,
default: () => {
return {
value: 'id', // ID
label: 'name', //
children: 'children' //
}
}
},
/* 选项列表数据(树形结构的对象数组) */
options: {
type: Array,
default: () => {
return []
}
},
/* 初始值 */
value: {
type: String,
default: () => {
return ''
}
},
/* 提示文字 */
placeholder: {
type: String,
default: () => {
return '请选择'
}
},
/* 可清空选项 */
clearable: {
type: Boolean,
default: () => {
return true
}
},
/* 自动收起 */
accordion: {
type: Boolean,
default: () => {
return false
}
},
disabledIds: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
filterText: '',
valueId: '', //
valueTitle: ''
}
},
mounted() {
this.initHandle()
},
methods: {
//
initHandle() {
if (this.value) {
const node = this.$refs.selectTree.getNode(this.value)
this.valueTitle = node.data[this.props.label]
this.valueId = node.data[this.props.value]
this.$refs.selectTree.setCurrentKey(this.valueId)
}
this.initScroll()
},
//
initScroll() {
this.$nextTick(() => {
let scrollWrap = document.querySelectorAll('.el-scrollbar .el-select-dropdown__wrap')[0]
let scrollBar = document.querySelectorAll('.el-scrollbar .el-scrollbar__bar')
scrollWrap.style.cssText = 'margin: 0px; max-height: none; overflow: hidden;'
scrollBar.forEach(ele => (ele.style.width = 0))
})
},
//
handleNodeClick(node) {
// if (Array.isArray(node[this.props.children]) && node[this.props.children].length !== 0) {
// return
// } else {
// console.info(this.disabledIds, 'this.disabledIds', node[this.props.value], this.disabledIds.includes(node[this.props.value]))
// if(this.disabledIds.includes(node[this.props.value])){
// return
// }
this.valueTitle = node[this.props.label]
this.valueId = node[this.props.value]
this.$emit('change', node)
this.$emit('getValue', this.valueId)
this.$emit('getLabel', this.valueTitle)
// }
},
//
clearHandle() {
this.valueTitle = ''
this.valueId = ''
this.clearSelected()
this.$emit('change', null)
this.$emit('getValue', null)
this.$emit('getLabel', null)
},
/* 清空选中样式 */
clearSelected() {
let allNode = document.querySelectorAll('#tree-option .el-tree-node')
allNode.forEach(element => element.classList.remove('is-current'))
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
}
},
watch: {
value() {
// this.valueId = this.value;
this.initHandle()
},
filterText(val) {
this.$refs.selectTree.filter(val)
},
// options(val) {
// window.console.log(val)
// }
}
}
</script>
<style scoped>
.el-scrollbar .el-scrollbar__view .el-select-dropdown__item {
height: auto;
max-height: 274px;
padding: 0;
overflow: hidden;
overflow-y: auto;
}
.el-select-dropdown__item.selected {
font-weight: normal;
}
ul li >>> .el-tree .el-tree-node__content {
height: auto;
padding: 0 20px;
}
.el-tree-node__label {
font-weight: normal;
}
.el-tree >>> .is-current .custom-tree-node {
color: #409eff;
font-weight: 700;
}
.el-tree >>> .is-current .el-tree-node__children .custom-tree-node {
color: #606266;
font-weight: normal;
}
.selectInput {
padding: 0 5px;
box-sizing: border-box;
}
/* 开发禁用 */
/*
.el-tree-node:focus>.el-tree-node__content{
background-color:transparent;
background-color: #f5f7fa;
color: #c0c4cc;
cursor: not-allowed;
}
.el-tree-node__content:hover{
background-color: #f5f7fa;
}
*/
</style>

View File

@ -72,17 +72,17 @@ export default new Vuex.Store({
// FILEURL: 'http://8.136.222.164:8808/image/', // 中科安信
// UPLOADURL: 'http://101.43.164.214:11111/upload/image/', // 百色
// FILEURL: 'http://101.43.164.214:11111/image/', // 百色
UPLOADURL: 'http://101.43.164.214:11111/upload/image/', // 百色
FILEURL: 'http://101.43.164.214:11111/image/', // 百色
WORKFLOWURL: "http://101.43.164.214:11129/#/workspace/forms", // 百色
// UPLOADURL: 'http://101.43.164.214:11111/upload/image/', // 百色
// FILEURL: 'http://101.43.164.214:11111/image/', // 百色
// WORKFLOWURL: "http://101.43.164.214:11129/#/workspace/forms", // 百色
// UPLOADURL:'http://182.90.224.237:51234/upload/image/',
// FILEURL:'http://182.90.224.237:51234/image/',
// UPLOADURL: "http://192.168.34.155:19111/upload/image/", // 洁本地
// FILEURL: "http://192.168.34.155:19111/image/", //洁本地
UPLOADURL: "http://192.168.34.155:19111/upload/image/", // 洁本地
FILEURL: "http://192.168.34.155:19111/image/", //洁本地
// UPLOADURL: 'http://192.168.34.221:9111/upload/image/', // 郭圣雄本地
// FILEURL: 'http://192.168.34.221:9111/image/', //郭圣雄本地
// WORKFLOWURL: "http://101.43.164.214:11129/#/workspace/forms", //jiayu工作流地址(本地)
// WORKFLOWURL: "http://192.168.34.216:88/#/workspace/forms", //jiayu工作流地址(本地)
WORKFLOWURL: "http://192.168.34.216:88/#/workspace/forms", //jiayu工作流地址(本地)
// WORKFLOWURL: "http://192.168.34.138:88/#/workspace/forms", //坤工作流地址(本地)
// WORKFLOWURL: "http://192.168.34.129:88/#/workspace/forms", //罗峰工作流地址(本地)
CONTRACTORURL: process.env.NODE_ENV == "development" ? "http://192.168.34.129:5174/#/contractorApply" : `${window.location.protocol}//${window.location.host}/contractorApply/index.html#/contractorApply`, //罗峰承包商入场地址(本地)

View File

@ -103,6 +103,13 @@
v-if="treeSelectData.projectName"
>权限配置</el-button
>
<el-button
type="primary"
size="medium"
@click="handleSettingLarge(2, treeSelectData.projectSn)"
v-if="treeSelectData.projectName"
>大屏配置</el-button
>
<el-table class="tables" :data="level1AccountData">
<el-table-column
prop="realName"
@ -128,6 +135,14 @@
>
<template slot-scope="scope">
<div class="operation-style">
<div
v-if="!treeSelectData.projectName"
@click="handleSettingLarge(3, scope.row.userId)"
class="operationText"
>
<i class="el-icon-setting"></i>
<span>大屏配置</span>
</div>
<div
v-if="!treeSelectData.projectName"
@click="configAccountFn(scope.row, 'yi')"
@ -1105,14 +1120,14 @@
:label="i.moduleId"
>{{ i.moduleName }}</el-checkbox
>
<div class="CheckboxTitle">新项目看板模块</div>
<!-- <div class="CheckboxTitle">新项目看板模块</div>
<el-checkbox
v-if="i.moduleType === 8"
v-for="i in checkArr"
:key="i.moduleId"
:label="i.moduleId"
>{{ i.moduleName }}</el-checkbox
>
> -->
</el-checkbox-group>
<div class="dialog-footer">
<el-button
@ -1335,10 +1350,13 @@
</div>
</div>
</el-dialog>
<largeScreenConfig :uniqueFlag="this.uniqueFlag" :authType="this.authType" v-model="largeVisible" ></largeScreenConfig>
</div>
</template>
<script>
import gdMap from "../../components/map/gd-map";
import largeScreenConfig from '@/views/jxjadmin/largeScreenConfig.vue'
import {
getCompanyProjectListApi,
addCompanyApi,
@ -1385,6 +1403,7 @@ import { checkPhone } from "@/assets/js/util.js";
export default {
components: {
gdMap,
largeScreenConfig
},
data() {
var checkAge = (rule, value, callback) => {
@ -1399,6 +1418,9 @@ export default {
}
};
return {
uniqueFlag: "",
authType: 2,
largeVisible: false,
pagInfo: {
pageNo: 1, //
pageSize: 10, //
@ -2186,6 +2208,11 @@ export default {
this.getDictionaryByStructure();
},
methods: {
handleSettingLarge(authType, uniqueFlag) {
this.authType = authType
this.uniqueFlag = uniqueFlag
this.largeVisible = true
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;

View File

@ -0,0 +1,578 @@
<template>
<el-dialog
title="大屏配置"
@closed="handleCancel"
:modal-append-to-body="false"
:visible.sync="dialogVisible"
:close-on-click-modal="false"
width="1000px"
>
<el-radio-group v-if="authType != 4" v-model="tempType" style="margin-bottom: 24px" @change="handleChangeRadio">
<el-radio :label="1">从模板库中选择</el-radio>
<el-radio :label="2">自定义菜单</el-radio>
</el-radio-group>
<vue-scroll style="height: 500px">
<div v-if="tempType === 1">
<!-- 全选 -->
<el-checkbox v-if="treeData.length" :indeterminate="isIndeterminate" v-model="isCheckedAll" @change="handleCheckAllChange">
全选
</el-checkbox>
<!-- check-strictly -->
<el-tree
ref="tree"
:data="treeData"
default-expand-all
show-checkbox
node-key="authId"
:props="defaultProps"
@check-change="handleCheckTree"
>
</el-tree>
</div>
<div v-if="tempType === 2">
<div class="list">
<draggable v-model="listData" animation="200">
<transition-group>
<div class="item_wrap" v-for="(item, index) in listData" :key="item.key">
<div class="item">
<div class="item__path">
<el-select
v-model="item.authId"
clearable
placeholder="请选择菜单"
@change="
val => {
handleChangeTree(val, item)
}
"
>
<el-option
v-for="val in flatTreeData"
:key="val.authId"
:value="val.authId"
:label="val.label"
:disabled="val.disabled"
></el-option>
</el-select>
<!-- <select-tree
placeholder="请选择菜单"
:options="treeData"
:value="item.authId"
:props="{
value: 'authId', // ID
label: 'name', //
children: 'children' //
}"
:disabledIds="disabledIds"
:clearable="true"
@change="
val => {
handleChangeTree(val, item)
}
"
></select-tree> -->
</div>
<div class="item__name">
<span>菜单名称</span>
<el-input v-model="item.name" placeholder="输入菜单名称"></el-input>
</div>
<div class="item__path">
<span>菜单路径</span>
<el-input v-model="item.routePath" placeholder="输入菜单路径"></el-input>
</div>
<i class="el-icon-circle-plus-outline" @click="handleAddChildren(item)"></i>
<i style="color: #f76c6c" class="el-icon-delete" @click="handleDelete(index)"></i>
</div>
<!-- 第二级 -->
<draggable v-model="item.children" animation="200">
<transition-group>
<div class="item_wrap inner" v-for="(cItem, idx) in item.children" :key="cItem.key">
<div class="item">
<div class="item__path">
<el-select
v-model="cItem.authId"
clearable
placeholder="请选择菜单"
@change="
val => {
handleChangeTree(val, cItem)
}
"
>
<el-option
v-for="val in flatTreeData"
:key="val.authId"
:value="val.authId"
:label="val.label"
:disabled="val.disabled"
></el-option>
</el-select>
<!-- <select-tree
placeholder="请选择菜单"
:options="treeData"
:value="cItem.authId"
:props="{
value: 'authId', // ID
label: 'name', //
children: 'children' //
}"
:disabledIds="disabledIds"
:clearable="true"
@change="
val => {
handleChangeTree(val, cItem)
}
"
></select-tree> -->
</div>
<div class="item__name">
<span>菜单名称</span>
<el-input v-model="cItem.name" placeholder="输入菜单名称"></el-input>
</div>
<div class="item__path">
<span>菜单路径</span>
<el-input v-model="cItem.routePath" placeholder="输入菜单路径"></el-input>
</div>
<i style="color: #f76c6c" class="el-icon-delete" @click="handleDelete(idx, item)"></i>
</div>
</div>
</transition-group>
</draggable>
</div>
</transition-group>
</draggable>
<div class="add" @click="handleAdd">
<i class="el-icon-circle-plus-outline"></i>
<span>新增一级菜单</span>
</div>
</div>
</div>
</vue-scroll>
<span slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="handleSave"> </el-button>
</span>
</el-dialog>
</template>
<script>
import {
getScreenAuthModuleAndMenuApi,
getScreenAuthModuleAndMenuTreeApi,
getScreenAuthTreeApi,
addScreenAuthApi,
getScreenAuthTypeApi
} from '@/assets/js/api/jxjadmin.js'
import SelectTree from '@/components/selectTree/selectTree.vue'
import draggable from 'vuedraggable'
import _ from 'lodash'
export default {
components: {
SelectTree,
draggable
},
props: {
value: {
type: Boolean,
default: false
},
// authType: (1;234)
authType: {
type: Number,
default: 1
},
// uniqueFlag:
uniqueFlag: {
type: String,
default: ''
}
},
data() {
return {
dialogVisible: false,
// (1;2)
tempType: 1,
isIndeterminate: false,
isCheckedAll: false,
defaultProps: {
children: 'children',
label: 'name'
},
treeData: [],
flatTreeData: [],
listData: [],
listBackup: [],
typeBackup: 1,
disabledIds: []
}
},
watch: {
async value(val) {
if (val) {
await this.getModuleMenu()
await this.getScreenAuthType()
await this.getTreeData()
}
this.dialogVisible = val
},
dialogVisible(val) {
this.$emit('input', val)
}
},
methods: {
async getScreenAuthType() {
const res = await getScreenAuthTypeApi({ authType: this.authType, uniqueFlag: this.uniqueFlag })
if (res.code === 200) {
this.tempType = res.result
this.typeBackup = res.result
}
},
//
async getModuleMenu() {
const api = this.authType === 1 ? getScreenAuthModuleAndMenuTreeApi : getScreenAuthModuleAndMenuApi
const res = await api({})
if (res.code == 200) {
this.treeData = res.result || []
// this.handleFlatTreeData(this.treeData, this.flatTreeData)
this.flatTree(this.treeData)
}
},
//
flatTree(list, name) {
list.forEach(item => {
item.label = name ? name + '/' + item.name : item.name
this.flatTreeData.push(item)
if (item.children) {
this.flatTree(item.children, item.name)
}
})
},
//
async getTreeData() {
const res = await getScreenAuthTreeApi({ authType: this.authType, type: this.tempType, uniqueFlag: this.uniqueFlag })
if (res.code === 200) {
let arr = []
this.handleFlatTreeData(res.result, arr)
if (this.tempType === 1) {
if (res.result.length) {
let ids = []
ids = arr.filter(item => item.parentId != '0' || (item.parentId == '0' && !item.children.length)).map(item => item.authId)
console.info(ids, '==========')
setTimeout(() => {
this.$refs.tree.setCheckedKeys(ids)
}, 200)
}
} else {
this.listData = res.result || []
this.setSortIndex(this.listData)
}
this.initTreeDisabled()
//
this.listBackup = arr.map(item => item.authId)
}
},
//
handleCheckAllChange(val) {
this.isIndeterminate = false
this.$refs.tree.setCheckedNodes(val ? this.flatTreeData : [])
},
//
handleCheckTree() {
let res = this.$refs.tree.getCheckedNodes()
this.isCheckedAll = res.length === this.flatTreeData.length
this.isIndeterminate = res.length > 0 && res.length < this.flatTreeData.length
},
//
handleFlatTreeData(data, arr) {
data.forEach(item => {
arr.push(item)
if (item.children) {
this.handleFlatTreeData(item.children, arr)
}
})
},
//
handleAdd() {
if (this.listData.length >= 8) {
this.$message.error('一级菜单最多可以新增八个')
return
}
this.listData.push({
name: '',
routePath: '',
authId: '',
children: [],
sortIndex: this.listData.length + 1,
type: undefined,
key: new Date().getTime(),
level: 1
})
},
//
handleAddChildren(item) {
console.info(item, '------')
if (item.isChildren === 2) {
return this.$message.error('无法为二级菜单添加子模块')
}
item.children = item.children || []
item.children.push({
name: '',
routePath: '',
authId: '',
sortIndex: item.children.length + 1,
type: undefined,
key: new Date().getTime(),
level: 2
})
},
//
handleDelete(index, item) {
if (item) {
item.children.splice(index, 1)
} else {
this.listData.splice(index, 1)
}
this.initTreeDisabled()
},
//
handleSave() {
if (this.tempType === 1) {
let checkedNodes = this.$refs.tree.getCheckedNodes(false, true)
// if (!checkedNodes.length) {
// this.$message.error('')
// return
// }
const childrenNodes = checkedNodes.filter(item => item.parentId !== '0')
const parentNodes = checkedNodes.filter(item => item.parentId === '0')
this.listData = parentNodes.map(item => {
return {
...item,
children: childrenNodes.filter(cItem => cItem.parentId === item.id)
}
})
} else {
this.listData.forEach(item => {
if (!item.name || !item.routePath || !item.authId) {
this.$message.error('请完善菜单信息')
throw new Error()
}
if (item.children && item.children.length) {
item.children.forEach(cItem => {
if (!cItem.name || !cItem.routePath || !cItem.authId) {
this.$message.error('请完善菜单信息')
throw new Error()
}
})
}
})
this.routePathList = this.listData.map(item => item.routePath)
// routePathroutePath
if (new Set(this.routePathList).size !== this.routePathList.length) {
this.$message.error('菜单路径重复')
throw new Error()
}
// routePathroutePath
this.listData.forEach(item => {
item.children?.forEach(cItem => {
if (this.routePathList.includes(cItem.routePath) && cItem.routePath !== item.routePath) {
this.$message.error('菜单路径重复')
throw new Error()
}
})
})
}
//
if (this.typeBackup != this.tempType && this.listBackup.length) {
const msg = `当前使用的是"${this.typeBackup === 1 ? '从模版库中选择' : '自定义菜单'}"的配置方式,如果确认切换为"${
this.tempType === 1 ? '从模版库中选择' : '自定义菜单'
}"则原来所有的配置将会被清空无法恢复请谨慎选择!`
return this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
// this.typeBackup = this.tempType
this.handleSaveData()
})
.catch(() => {})
}
this.setSortIndex(this.listData)
//
let arr = []
this.handleFlatTreeData(this.listData, arr)
let saveIds = arr.map(item => item.authId)
if (!this.areArraysEqual(saveIds, this.listBackup)) {
return this.$confirm(
'您此次的操作将对大屏菜单进行更新,此过程不可逆。为避免不必要的损失,请您在确认前仔细斟酌,谨慎做出选择!',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
.then(() => {
this.handleSaveData()
})
.catch(() => {})
}
this.handleSaveData()
},
handleSaveData() {
addScreenAuthApi({ authType: this.authType, uniqueFlag: this.uniqueFlag, screenAuth: this.listData }).then(res => {
if (res.code == 200) {
this.$message.success('保存成功')
this.dialogVisible = false
this.reset()
}
})
},
//
areArraysEqual(arr1, arr2) {
if (arr1.length !== arr2.length) return false
const frequencyMap = new Map()
for (const item of arr1) {
frequencyMap.set(item, (frequencyMap.get(item) || 0) + 1)
}
for (const item of arr2) {
const count = frequencyMap.get(item)
if (!count) return false
frequencyMap.set(item, count - 1)
}
return Array.from(frequencyMap.values()).every(count => count === 0)
},
//
initTreeDisabled() {
this.disabledIds = []
this.listData.forEach(item => {
this.disabledIds.push(item.authId)
if (item.children && item.children.length) {
item.children.forEach(cItem => {
this.disabledIds.push(cItem.authId)
})
}
})
this.flatTreeData.forEach(item => {
this.$set(item, 'disabled', this.disabledIds.includes(item.authId))
})
},
//
setSortIndex(list) {
list.forEach((item, index) => {
item.sortIndex = index
item.authType = this.authType
item.type = this.tempType
item.uniqueFlag = this.uniqueFlag
item.isChildren = this.flatTreeData.find(val => val.authId === item.authId).level
item.key = new Date().getTime() + index
if (item.children && item.children.length) {
this.setSortIndex(item.children)
}
})
},
handleCancel() {
this.dialogVisible = false
this.reset()
},
//
handleChangeTree(val, item) {
console.info(val, item, '========')
const curItem = this.flatTreeData.find(cItem => cItem.authId === val)
item.authId = curItem?.authId
item.routePath = curItem?.routePath
item.name = curItem?.name
item.sortIndex = curItem?.sortIndex
item.type = curItem?.typesChildren
item.isChildren = curItem?.level
if (item.isChildren === 2) {
item.children = []
}
this.initTreeDisabled()
},
//
handleChangeRadio(val) {
this.listData = []
this.listBackup = []
this.isIndeterminate = false
this.disabledIds = []
this.isCheckedAll = false
this.getTreeData()
},
reset() {
this.listData = []
this.listBackup = []
this.tempType = 1
this.typeBackup = 1
this.$refs.tree.setCheckedKeys([])
this.isIndeterminate = false
this.disabledIds = []
this.isCheckedAll = false
}
}
}
</script>
<style lang="less" scoped>
.list {
width: 100%;
border-radius: 8px;
border: 1px dashed rgba(81, 129, 246, 1);
padding: 16px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
.add {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: #409eff;
height: 40px;
width: 152px;
border-radius: 4px;
font-size: 14px;
border: 1px solid rgba(187, 187, 187, 1);
i {
margin-right: 8px;
}
}
.item_wrap {
border: 1px dashed rgba(81, 129, 246, 0.6);
padding: 12px;
border-radius: 8px;
margin-bottom: 16px;
&.inner {
margin-bottom: 0;
margin-top: 16px;
border: 1px dashed rgba(81, 129, 246, 0.3);
}
}
.item {
display: flex;
align-items: center;
&:last-child {
margin-bottom: 0;
}
&__name,
&__path {
margin-right: 16px;
display: flex;
align-items: center;
flex: 1;
span {
flex-shrink: 0;
}
}
i {
font-size: 24px;
margin-right: 16px;
cursor: pointer;
}
}
}
</style>

View File

@ -37,9 +37,13 @@
<el-table-column prop="diffDay" label="项目数" align="center">
<template slot-scope="scope"> {{ scope.row.createProjectNum }}/{{ scope.row.projectNum }} </template>
</el-table-column>
<el-table-column prop="address" label="操作" align="center" width="300">
<el-table-column prop="address" label="操作" align="center" width="380">
<template slot-scope="scope">
<div class="tableBtns">
<div @click="handleLarge(scope.row)" class="operationText">
<img src="@/assets/images/accredit.png" width="15px" height="15px" />
<span>大屏配置</span>
</div>
<div @click="configuration(scope.row)" class="operationText">
<img src="@/assets/images/accredit.png" width="15px" height="15px" />
<span>授权配置</span>
@ -122,11 +126,7 @@
</el-col>
<el-col :span="13" style="text-align: right">
<span style="margin-right: 15px">是否启用移动考勤</span>
<el-radio-group
v-model="mobileAttendance"
size="medium"
style="width: 220px; text-align: left"
>
<el-radio-group v-model="mobileAttendance" size="medium" style="width: 220px; text-align: left">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
@ -141,7 +141,7 @@
<el-radio :label="1"></el-radio>
</el-radio-group> -->
<span class="firstConlumLabel">选择系统版本</span>
<div style="margin-top:10px"></div>
<div style="margin-top: 10px"></div>
<el-radio-group v-model="styleType" size="medium" @change="getBaseModuleList">
<el-radio v-for="item in styleTypeArr" :label="item.data" :key="item.id">{{ item.name }}</el-radio>
<!-- <el-radio :label="2">星璇版</el-radio>
@ -211,10 +211,10 @@
<el-checkbox v-if="i.moduleType === 7" v-for="i in companyArr" :key="i.moduleId" :label="i.moduleId">{{
i.moduleName
}}</el-checkbox>
<div class="CheckboxTitle">新项目看板模块</div>
<!-- <div class="CheckboxTitle">新项目看板模块</div>
<el-checkbox v-if="i.moduleType === 8" v-for="i in companyArr" :key="i.moduleId" :label="i.moduleId">{{
i.moduleName
}}</el-checkbox>
}}</el-checkbox> -->
</el-checkbox-group>
</el-col>
</el-row>
@ -237,7 +237,7 @@
<el-form-item label="用户账号" prop="account">
<el-input v-model="addEditForm.account" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item style="margin-bottom:30px" label="用户密码" prop="showPassword">
<el-form-item style="margin-bottom: 30px" label="用户密码" prop="showPassword">
<el-input type="password" show-password v-model="addEditForm.showPassword" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="手机号码" prop="companyTel">
@ -251,6 +251,7 @@
</el-form>
</div>
</el-dialog>
<largeScreenConfig :uniqueFlag="this.uniqueFlag" :authType="1" v-model="largeVisible" />
</div>
</template>
<script>
@ -266,10 +267,16 @@ import {
getStyleTypeArr
} from '@/assets/js/api/jxjadmin.js'
import { checkPhone } from '@/assets/js/util.js'
import largeScreenConfig from './largeScreenConfig.vue'
export default {
name: 'registerAudit',
components: {
largeScreenConfig
},
data() {
return {
uniqueFlag: '',
largeVisible: false,
checkAll: false,
isIndeterminate: false,
cityOptions: [],
@ -386,6 +393,11 @@ export default {
this.getStyleTypeArrByCode()
},
methods: {
handleLarge(data) {
console.info(data, 'data')
this.uniqueFlag = data.headquartersSn
this.largeVisible = true
},
getStyleTypeArrByCode() {
getStyleTypeArr({ dictionaryEncoding: 'base_module_style_type' }).then(res => {
if (res.result.length > 0) {
@ -557,7 +569,7 @@ export default {
})
this.brHtm = brHtm
// console.log('',brHtm)
console.log('列表查询所有模块信息',this.companyArr)
console.log('列表查询所有模块信息', this.companyArr)
}
})
},

View File

@ -129,6 +129,11 @@
>
进入衢州版本
</div>
<div
class="operationText"
style="margin-right: 30px"
@click="toOverview(scope.row.projectSn)"
>进入数据看板</div>
<div v-if="($store.state.userInfo.styleType!=2 && $store.state.userInfo.styleType!=3) && $store.state.userInfo.enterProjectBackType === 0"
class="operationText"
style="margin-right: 30px"
@ -165,6 +170,8 @@ import {
import {
getComapnyStatisticsListApi,
} from "@/assets/js/api/company/project";
import { getProjectDetail } from "@/assets/js/api/baseInfo.js";
import { getScreenAuthModuleAndMenuApi } from '@/assets/js/api/jxjadmin.js'
import vhead from "@/components/header";
export default {
name: "projectList",
@ -185,6 +192,7 @@ export default {
institutionList1: [], //
institutionList2: [], //
institutionList3: [], //
newBigScreen: []
};
},
created() {
@ -193,6 +201,50 @@ export default {
this.getLayerCompany();
},
methods: {
async getAuthModuleAndMenu() {
let bool = false
const res = await getScreenAuthModuleAndMenuApi()
if (res.code === 200) {
bool = res.result.length ? true : false
}
return bool
},
async toOverview(projectSn) {
this.$forceUpdate();
await this.getProjectDetail(projectSn);
if (this.newBigScreen == null || this.newBigScreen == "") {
this.$message({
message: "当前项目没有看板",
type: "warning",
});
} else {
const isPermission = await this.getAuthModuleAndMenu()
if(!isPermission) {
return this.$message({
message: "当前用户没有访问数据看板权限",
type: "warning",
});
}
console.log("当前跳转链接", this.newBigScreen);
//--------------------
this.jumpToken = localStorage.getItem("jumpToken");
let userId = this.$store.state.userInfo.userId;
window.open(this.newBigScreen + "?userId=" + userId + '&sn=' + projectSn, "_self");
// window.open('http://192.168.34.216:8081/#/large?userId=' + userId + '&sn=' + this.$store.state.projectSn, "_self")//token
}
},
async getProjectDetail(projectSn) {
let data = {
projectSn: projectSn,
};
await getProjectDetail(data).then((res) => {
if (res.result) {
this.newBigScreen = res.result.newBigScreen;
console.log("接口获取数据看板地址", this.newBigScreen);
}
});
},
//
getLayerCompany() {
let data = {

View File

@ -203,7 +203,7 @@ export default {
console.log("pageinfo", this.pageInfo);
carMeasureSpeedData(this.pageInfo).then(result => {
carMeasureSpeedData({...this.pageInfo, projectSn: this.$store.state.projectSn}).then(result => {
if (result.success) {
this.List = result.result.records;
this.pageInfo.total = Number(result.result.total);

View File

@ -1208,7 +1208,7 @@ export default {
// this.$refs.groupTree.setCurrentKey("");
});
},
edit(obj) {
async edit(obj) {
console.log("编辑", obj);
this.addEditForm = JSON.parse(JSON.stringify(obj));
if (
@ -1219,6 +1219,7 @@ export default {
.split(",")
.map(Number);
}
await this.loadPersonList(this.addEditForm.enterpriseId)
if (this.addEditForm.xzProjectOrgObj) {
this.selectTreeData = JSON.parse(this.addEditForm.xzProjectOrgObj);
this.selectVal = this.selectTreeData.deptName;

View File

@ -63,6 +63,10 @@
<i class="el-icon-s-operation"></i>
<span>{{ $t("message.roleManage.power") }}</span>
</div>
<div v-permission="{key: 'roleManage_largeAuth', menuPath: '/project/configManage/roleManage'}" @click="handleSettingLarge(scope.row.roleId)" class="operationText">
<i class="el-icon-s-operation"></i>
<span>大屏权限</span>
</div>
</div>
</template>
</el-table-column>
@ -203,6 +207,7 @@
</div>
</div>
</el-dialog>
<largeScreenConfig :uniqueFlag="this.uniqueFlag" :authType="4" v-model="largeVisible" />
</div>
</template>
<script>
@ -215,8 +220,12 @@ import {
editBaseRoleMenuApi,
getProjectModuleGroupMenuListApi
} from "@/assets/js/api/configManage";
import largeScreenConfig from '@/views/jxjadmin/largeScreenConfig.vue'
export default {
components: {
largeScreenConfig
},
mounted() {
this.getProjectMenu();
@ -224,6 +233,8 @@ export default {
},
data() {
return {
uniqueFlag: "",
largeVisible: false,
myTree: {
data: [],
dataList:[],
@ -290,6 +301,10 @@ export default {
}
},
methods: {
handleSettingLarge(uniqueFlag) {
this.uniqueFlag = uniqueFlag
this.largeVisible = true
},
//
getRoleMenu() {
console.log(this.addEditForm.roleId);