Browse Source

满意度评价下拉框展示父级修改,网格层级不允许点击修改

V1.0
SongZhen 2 years ago
parent
commit
3be54ea307
  1. 1
      .env.development
  2. 31
      src/views/dataBoardMain/main-navbar.vue
  3. 2
      vue.config.js

1
.env.development

@ -1,6 +1,7 @@
NODE_ENV=development NODE_ENV=development
VUE_APP_API_SERVER = http://localhost:9001/api VUE_APP_API_SERVER = http://localhost:9001/api
# VUE_APP_API_SERVER = http://192.168.1.140/api
# VUE_APP_API_SERVER = http://219.146.91.110:30801/api # VUE_APP_API_SERVER = http://219.146.91.110:30801/api
# VUE_APP_API_SERVER = https://epmet-yantai.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-yantai.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api

31
src/views/dataBoardMain/main-navbar.vue

@ -6,7 +6,7 @@
<div class="title">{{ customerName }}数据智能分析平台</div> <div class="title">{{ customerName }}数据智能分析平台</div>
<div class="selectArea" v-if="$route.path == '/dataBoard/satisfactionEval/index'"> <div class="selectArea" v-if="$route.path == '/dataBoard/satisfactionEval/index'">
<el-select @change="setSelectName" v-model="value" popper-class="selectPopClass"> <el-select @change="setSelectName" v-model="value" popper-class="selectPopClass">
<el-option v-for="(item, index) in options" :key="item.value" :label="item.label" :value="index"></el-option> <el-option v-for="(item, index) in options" :disabled="item.agencyLevel === 'grid'" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</div> </div>
<!-- <div class="btn-back" @click="toPage('/')"> <!-- <div class="btn-back" @click="toPage('/')">
@ -206,20 +206,32 @@ export default {
this.getOrgList(); this.getOrgList();
}, },
methods: { methods: {
getChooseLabel(key) {
const name = this.options.filter((item) => item.value === key)[0].level;
return name;
},
getOrgList() { getOrgList() {
let params = {}; let params = {};
if (this.options.length) { if (this.options.length) {
params = { orgId: this.options[this.value].id, level: this.options[this.value].level }; params = { orgId: this.value, level: this.getChooseLabel(this.value) };
} }
console.log(params);
this.$http.post(`/gov/org/agency/maporg`, params).then(async ({ data: { data } }) => { this.$http.post(`/gov/org/agency/maporg`, params).then(async ({ data: { data } }) => {
console.log(data, "data"); console.log(data);
this.value = 0; this.value = data.id;
this.$store.dispatch("chooseArea/chooseName", { this.$store.dispatch("chooseArea/chooseName", {
orgId: data.id, orgId: data.id,
level: data.level, level: data.level,
}); });
let children = await this.dealTreeData(data.children); let children = await this.dealTreeData(data.children);
if (data.parentId) {
this.options = [ this.options = [
{
...data,
value: data.parentId,
label: data.parentName,
},
{ {
...data, ...data,
value: data.id, value: data.id,
@ -227,6 +239,16 @@ export default {
}, },
...children, ...children,
]; ];
} else {
this.options = [
{
...data,
value: data.id,
label: data.name,
},
...children,
];
}
}); });
}, },
dealTreeData(treeData, level = 0) { dealTreeData(treeData, level = 0) {
@ -285,7 +307,6 @@ export default {
city: this.$store.state.user.areaCode, city: this.$store.state.user.areaCode,
}); });
if (code === 0) { if (code === 0) {
console.log("---------------weather", data);
this.weather = data.lives[0]; this.weather = data.lives[0];
} else { } else {
// return this.$message.error(""); // return this.$message.error("");

2
vue.config.js

@ -44,7 +44,7 @@ module.exports = {
target: "http://bipaas.elinkservice.cn", // 我们要代理的真实接口地址 target: "http://bipaas.elinkservice.cn", // 我们要代理的真实接口地址
}, },
"/api": { "/api": {
target: "http://localhost:8080", // 后端接口地址 target: "http://219.146.91.110:30801", // 后端接口地址
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
"^api": "", "^api": "",

Loading…
Cancel
Save