update code

prv
haha 2024-04-05 22:32:27 +08:00
parent b14234d128
commit 2e0f16cb72
4 changed files with 62 additions and 7 deletions

View File

@ -112,6 +112,9 @@ table{
padding-right: 30px;
background: url("../images/head_select.png") no-repeat center/100% 100%;
}
.head-select.head-select-150{
background: url("../images/head_select-150.png") no-repeat center/100% 100%;
}
.head-select input{
height: 100%;
width: 100%;

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -54,8 +54,8 @@
<div :class="nav == 7 ? 'head-nav active' : 'head-nav'" @click="pageJump(7, '#/engin')">工程管理</div>
</div>
<template v-if="!isTypeBuser">
<div class="head-title-select" @mouseleave="hideScreenUlSel1" v-if="localStorage1">
<div class="head-select">
<div class="head-title-select title-select1" @mouseleave="hideScreenUlSel1" v-if="localStorage1">
<div class="head-select head-select-150">
<input type="text" :value="dept1" @click="showScreenUlSel1" placeholder="请选择公司" readonly>
</div>
<el-collapse-transition>
@ -65,7 +65,17 @@
</el-collapse-transition>
</div>
</template>
<div class="head-title-select" @mouseleave="hideScreenUlSel2" v-if="localStorage2">
<div class="head-title-select title-select1" @mouseleave="hideScreenUlSel3" >
<div class="head-select head-select-150">
<input type="text" :value="proType" @click="showScreenUlSel3" placeholder="项目类型" readonly>
</div>
<el-collapse-transition>
<ul class="header-screen-ul" v-show="showSel3">
<li v-for="item in proTypeList" @click="setScreenLiSel3(item)" :title="item.text">{{ item.text }}</li>
</ul>
</el-collapse-transition>
</div>
<div class="head-title-select title-select3" @mouseleave="hideScreenUlSel2" v-if="localStorage2">
<div class="head-select">
<input type="text" :value="dept2" @click="showScreenUlSel2" placeholder="请选择项目" readonly>
</div>
@ -80,11 +90,13 @@
<div class="head-title-date-con">{{ date }}</div>
<div class="head-title-time-con">{{ time }}</div>
</div>
<!--
<div class="head-title-weather">
<img :src="condCode">
<span>{{ condTxt }}</span>
<span>{{ temperature }}</span>
</div>
-->
<div class="header-title-user" style="margin-left:12px;">
{{ getName() }}
<i @click="doLogout" title="退出" style="margin-left:12px;cursor: pointer;">
@ -121,6 +133,7 @@
import { mapGetters } from 'vuex'
import Cookies from 'js-cookie'
import {routes} from '../router/index'
import { tryToJson } from "../utils/tools";
export default {
props: {
red: {
@ -138,6 +151,7 @@ export default {
dept2: '',
showSel1: false,
showSel2: false,
showSel3: false,
data: [],
depts: [],
timerID: undefined,
@ -151,8 +165,30 @@ export default {
temperature: 20,
condTxt: '',
condCode: '',
proType:'全部',
}
},
beforeCreate(){
let obj=localStorage.getItem("project_category");
if(obj &&obj.length>0){
obj=tryToJson(obj,[]);
if(obj.length>0){
this.proTypeList=obj;
return;
}
}
this.$api.dict("project_category").then(d=>{
let tmps=(d||[]).map(it=>{
return {
value:it.dictValue,
text:it.dictLabel,
}
});
tmps=[{value:"0",text:"全部"},...tmps];
this.proTypeList=tmps;
localStorage.setItem("project_category",JSON.stringify(tmps));
});
},
async mounted() {
window.headerApp = this
await this.initMe();
@ -323,23 +359,32 @@ export default {
}
},
},
showScreenUlSel1() {
this.showSel1 = true
},
showScreenUlSel2() {
this.showSel2 = true
},
showScreenUlSel3() {
this.showSel3 = true
},
hideScreenUlSel1() {
this.showSel1 = false
},
hideScreenUlSel2() {
this.showSel2 = false
},
hideScreenUlSel3() {
this.showSel3 = false
},
setScreenLiSel3(item){
localStorage.setItem("proType",item.value);
this.proType=item.text;
this.showSel3=false;
this.loadProject();
},
setScreenLiSel1(item) {
localStorage.setItem("data1", JSON.stringify(item))
this.localStorage1 = JSON.parse(localStorage.getItem("data1"))
@ -440,4 +485,10 @@ export default {
}
}
.title-select1{
width: 150px;
}
.title-select3{
width: 250px;
}
}</style>

View File

@ -28,6 +28,7 @@ service.interceptors.request.use(config => {
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
config.headers["proType"]=localStorage.getItem("proType")||"0";
// get请求映射params参数
if (config.method === 'get' && config.params) {
let url = config.url + '?' + tansParams(config.params);