update code
parent
31ff21451f
commit
af0a0131ec
|
@ -69,7 +69,7 @@ table{
|
|||
-webkit-text-fill-color:transparent;
|
||||
}
|
||||
.head-title-tab{
|
||||
width: 40% ;
|
||||
max-width: 40% ;
|
||||
padding-top: 23px;
|
||||
display: flex;
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询流程表单列表
|
||||
const list=(roleId)=> {
|
||||
const list=()=> {
|
||||
return request({
|
||||
url: 'bgscreen/dept/list?roleId='+(roleId||1),
|
||||
url: 'bgscreen/dept/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -4,12 +4,14 @@
|
|||
北跨泾河-产发工程数字管理平台
|
||||
</div>
|
||||
<div class="head-title-tab">
|
||||
<div :class="nav == 1 ? 'head-nav active' : 'head-nav'" @click="pageJump(1, '#/')">项目概况</div>
|
||||
<div v-if="!isTypeBuser" :class="nav == 1 ? 'head-nav active' : 'head-nav'" @click="pageJump(1, '#/')">项目概况
|
||||
</div>
|
||||
<div :class="nav == 2 ? 'head-nav active' : 'head-nav'" @click="pageJump(2, '#/detail')">项目详情</div>
|
||||
<div :class="nav == 3 ? 'head-nav active' : 'head-nav'" @click="pageJump(3, '#/safety')">安全管理</div>
|
||||
<div :class="nav == 4 ? 'head-nav active' : 'head-nav'" @click="pageJump(4, '#/quality')">质量管理</div>
|
||||
<div :class="nav == 5 ? 'head-nav active' : 'head-nav'" @click="pageJump(5, '#/progress')">进度管理</div>
|
||||
<div :class="nav == 61 || nav == 62 ? 'head-nav active' : 'head-nav'" style="position: relative;" class="has-submenu">
|
||||
<div :class="nav == 61 || nav == 62 ? 'head-nav active' : 'head-nav'" style="position: relative;"
|
||||
class="has-submenu">
|
||||
<div>视频管理</div>
|
||||
<div class="header-btn-list">
|
||||
<div class="header-btn-list-arrow"></div>
|
||||
|
@ -25,16 +27,18 @@
|
|||
</div>
|
||||
<div :class="nav == 7 ? 'head-nav active' : 'head-nav'" @click="pageJump(7, '#/engin')">工程管理</div>
|
||||
</div>
|
||||
<div class="head-title-select" @mouseleave="hideScreenUlSel1" v-if="localStorage1">
|
||||
<div class="head-select">
|
||||
<input type="text" :value="dept1" @click="showScreenUlSel1" placeholder="请选择公司" readonly>
|
||||
<template v-if="!isTypeBuser">
|
||||
<div class="head-title-select" @mouseleave="hideScreenUlSel1" v-if="localStorage1">
|
||||
<div class="head-select">
|
||||
<input type="text" :value="dept1" @click="showScreenUlSel1" placeholder="请选择公司" readonly>
|
||||
</div>
|
||||
<el-collapse-transition>
|
||||
<ul class="header-screen-ul" v-show="showSel1" ref="selectUl">
|
||||
<li v-for="item in depts" @click="setScreenLiSel1(item)" :title="item.text">{{ item.text }}</li>
|
||||
</ul>
|
||||
</el-collapse-transition>
|
||||
</div>
|
||||
<el-collapse-transition>
|
||||
<ul class="header-screen-ul" v-show="showSel1" ref="selectUl">
|
||||
<li v-for="item in depts" @click="setScreenLiSel1(item)" :title="item.text">{{ item.text }}</li>
|
||||
</ul>
|
||||
</el-collapse-transition>
|
||||
</div>
|
||||
</template>
|
||||
<div class="head-title-select" @mouseleave="hideScreenUlSel2" v-if="localStorage2">
|
||||
<div class="head-select">
|
||||
<input type="text" :value="dept2" @click="showScreenUlSel2" placeholder="请选择项目" readonly>
|
||||
|
@ -89,6 +93,7 @@
|
|||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import Cookies from 'js-cookie'
|
||||
export default {
|
||||
props: {
|
||||
red: {
|
||||
|
@ -100,6 +105,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
isTypeBuser: false,//监理单位、总包单位、分包单位用户不展示项目概况菜单,二级菜单只展示自已参与的项目
|
||||
nav: 1,
|
||||
dept1: '',
|
||||
dept2: '',
|
||||
|
@ -135,29 +141,68 @@ export default {
|
|||
this.setTitle();
|
||||
this.timerID = setInterval(this.updateTime, 1000);
|
||||
this.updateTime();
|
||||
|
||||
let roleId = +this.$store.getters.roleId;
|
||||
Cookies.remove("__ids__");
|
||||
if ([5, 6, 7, 15, 16, 17, 99].includes(roleId)) {
|
||||
this.isTypeBuser = true;
|
||||
if (this.$route.name == "index") {
|
||||
this.$router.push("/detail");
|
||||
}
|
||||
this.$api.project.findProjectByDept(-1).then(d => {
|
||||
let objs = (d?.data || []).map(it => {
|
||||
it.text = it.projectName;
|
||||
return it;
|
||||
}).filter(it => +it.progressVisible == 0);
|
||||
this.data = [{ id: 0, text: '所有项目' }, ...objs];
|
||||
let dept={id:0,text:''};
|
||||
this.$root.dept=dept;
|
||||
this.$bus.$emit("deptChange", dept)
|
||||
this.$root._prjIds=objs.map(it=>it.id);
|
||||
Cookies.set("__ids__",objs.map(it=>it.id).join(","));
|
||||
this.$bus.$emit("loadProjects", this.data);
|
||||
this.$root.projects = this.data;
|
||||
if (this.data.length > 0) {
|
||||
this.setScreenLiSel2(this.data[0], true);
|
||||
} else {
|
||||
this.setScreenLiSel2(null);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.isTypeBuser = false;
|
||||
this.$api.dept.list().then(d => {
|
||||
this.$root.hasInitHeader = true;
|
||||
if (roleId < 3) {
|
||||
this.depts = [{ text: '产发集团', id: 0 }, ...(d?.data || []).map(it => {
|
||||
it.text = it.deptName;
|
||||
it.id = it.deptId;
|
||||
return it;
|
||||
})]
|
||||
} else {
|
||||
this.depts = [...(d?.data || []).map(it => {
|
||||
it.text = it.deptName;
|
||||
it.id = it.deptId;
|
||||
return it;
|
||||
})]
|
||||
}
|
||||
this.deptChange();
|
||||
});
|
||||
}
|
||||
this.$root.isTypeBuser = this.isTypeBuser;
|
||||
this.init();
|
||||
this.$api.dept.list(this.$store.getters.roleId).then(d => {
|
||||
this.$root.hasInitHeader = true;
|
||||
this.depts = [{ text: '产发集团', id: 0 }, ...(d?.data || []).map(it => {
|
||||
it.text = it.deptName;
|
||||
it.id = it.deptId;
|
||||
return it;
|
||||
})]
|
||||
this.deptChange();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initMe(){
|
||||
return new Promise(resolve=>{
|
||||
let func=()=>{
|
||||
if(!this.$store.getters.roles||this.$store.getters.roles.length==0){
|
||||
setTimeout(func,400);
|
||||
return;
|
||||
}
|
||||
resolve(true);
|
||||
};
|
||||
func();
|
||||
});
|
||||
initMe() {
|
||||
return new Promise(resolve => {
|
||||
let func = () => {
|
||||
if (!this.$store.getters.roles || this.$store.getters.roles.length == 0) {
|
||||
setTimeout(func, 400);
|
||||
return;
|
||||
}
|
||||
resolve(true);
|
||||
};
|
||||
func();
|
||||
});
|
||||
},
|
||||
doLogout() {
|
||||
this.$confirm('确定注销并退出系统吗?', '提示', {
|
||||
|
@ -205,13 +250,28 @@ export default {
|
|||
if (!this.localStorage2) {
|
||||
this.localStorage2 = {}
|
||||
}
|
||||
this.dept1 = this.localStorage1?.text || '';
|
||||
this.dept2 = this.localStorage2?.text || '';
|
||||
let tmp=this.localStorage1?.text || '';
|
||||
if(!tmp || !this.depts.find(d=>d.text==tmp)){
|
||||
if(this.depts.length>0){
|
||||
tmp=this.depts[0].text;
|
||||
}else{
|
||||
tmp="";
|
||||
}
|
||||
}
|
||||
this.dept1 = tmp;
|
||||
this.dept2 = tmp;
|
||||
|
||||
if (this.dept1) {
|
||||
this.loadProject(true);
|
||||
}
|
||||
},
|
||||
deptChange() {
|
||||
if(!this.dept1){
|
||||
if(this.depts.length>0){
|
||||
this.dept1=this.depts[0].text;
|
||||
this.loadProject(true);
|
||||
}
|
||||
}
|
||||
let tmps = this.depts.filter(d => d.text == this.dept1);
|
||||
if (tmps.length > 0) {
|
||||
this.$bus.$emit("deptChange", tmps[0])
|
||||
|
@ -269,7 +329,9 @@ export default {
|
|||
this.loadProject();
|
||||
},
|
||||
loadProject(init) {
|
||||
|
||||
if (this.isTypeBuser) {
|
||||
return;
|
||||
}
|
||||
this.$api.project.findProjectByDept(this.localStorage1.id).then(d => {
|
||||
let objs = (d?.data || []).map(it => {
|
||||
it.text = it.projectName;
|
||||
|
@ -288,7 +350,7 @@ export default {
|
|||
setScreenLiSel2(item, init) {
|
||||
if (item) {
|
||||
this.showSel2 = false;
|
||||
if (!init) {
|
||||
if (!init||!this.dept2) {
|
||||
localStorage.setItem("data2", JSON.stringify(item))
|
||||
this.localStorage2 = JSON.parse(localStorage.getItem("data2"))
|
||||
this.$emit('itemdata', item);
|
||||
|
@ -322,7 +384,8 @@ export default {
|
|||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">.main-header {
|
||||
<style lang="less">
|
||||
.main-header {
|
||||
.head-title-tab {
|
||||
.has-submenu {
|
||||
&:hover {
|
||||
|
|
|
@ -463,7 +463,10 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
window.xapp = this;
|
||||
this.$nextTick(() => {
|
||||
this.$nextTick(() => {
|
||||
if(this.$root.isTypeBuser){
|
||||
this.$router.push("/detail");
|
||||
}
|
||||
this.loading = true;
|
||||
});
|
||||
this.$bus.$on("loadProjects", debounce(prjs => {
|
||||
|
|
|
@ -66,7 +66,7 @@ const user = {
|
|||
// 获取用户信息
|
||||
GetInfo({ commit, state }) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let res=await getInfo()
|
||||
getInfo().then(res=>{
|
||||
const user = res.user
|
||||
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.png") : process.env.VUE_APP_BASE_API + user.avatar;
|
||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
|
@ -85,8 +85,8 @@ const user = {
|
|||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
});
|
||||
},
|
||||
// 退出系统
|
||||
LogOut({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
|
@ -5,7 +5,7 @@ import errorCode from '@/utils/errorCode'
|
|||
import { tansParams, blobValidate } from "@/utils/ruoyi";
|
||||
import cache from '@/plugins/cache'
|
||||
import { saveAs } from 'file-saver'
|
||||
|
||||
import Cookies from 'js-cookie'
|
||||
let downloadLoadingInstance;
|
||||
// 是否显示重新登录
|
||||
export let isRelogin = { show: false };
|
||||
|
@ -20,7 +20,7 @@ const service = axios.create({
|
|||
})
|
||||
|
||||
// request拦截器
|
||||
service.interceptors.request.use(config => {
|
||||
service.interceptors.request.use(config => {
|
||||
// 是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
// 是否需要防止数据重复提交
|
||||
|
@ -35,7 +35,7 @@ service.interceptors.request.use(config => {
|
|||
config.params = {};
|
||||
config.url = url;
|
||||
}
|
||||
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
||||
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
||||
const requestObj = {
|
||||
url: config.url,
|
||||
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
||||
|
|
Loading…
Reference in New Issue