匹配不上使用'/'替换

main
吕天方 2 years ago
parent d4c37c7945
commit 8be9fedb11

@ -2,7 +2,7 @@
# @Author: 张涛 # @Author: 张涛
# @Date: 2023-07-18 13:04:50 # @Date: 2023-07-18 13:04:50
# @LastEditors: JC9527 # @LastEditors: JC9527
# @LastEditTime: 2023-10-10 15:17:22 # @LastEditTime: 2023-10-11 08:53:18
# @FilePath: \Mudu2PC\.env.development # @FilePath: \Mudu2PC\.env.development
### ###
# 页面标题 # 页面标题

@ -4,6 +4,8 @@ import DataDict from '@/utils/dict'
import { getDicts as getDicts } from '@/api/system/dict/data' import { getDicts as getDicts } from '@/api/system/dict/data'
function searchDictByKey(dict, key) { function searchDictByKey(dict, key) {
// console.log(dict,'dict')
// console.log(key,'key')
if (key == null && key == "") { if (key == null && key == "") {
return null return null
} }
@ -31,6 +33,8 @@ function install() {
} else { } else {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getDicts(dictMeta.type).then(res => { getDicts(dictMeta.type).then(res => {
// console.log(res,'字典数据')
// console.log(dictMeta,'dictMeta')
store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data }) store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data })
resolve(res.data) resolve(res.data)
}).catch(error => { }).catch(error => {

@ -61,7 +61,15 @@ export default {
// //
if(!Array.isArray(this.value)){ if(!Array.isArray(this.value)){
if(this.options.some(v=> v.value == this.value )) return false; if(this.options.some(v=> v.value == this.value )) return false;
this.unmatchArray.push(this.value); let str;
this.options.forEach((item)=>{
if(item.label == this.value) {
str = this.value
} else {
str = '/'
}
})
this.unmatchArray.push(str);
return true; return true;
} }
// Array // Array

@ -161,7 +161,7 @@
header-align="center" header-align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ componendDistrict(scope.row.subdistrict) || '/' }}</span> <span>{{ componendDistrict(scope.row.subdistrict)}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -201,7 +201,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.major_hazard_level" :options="dict.type.major_hazard_level"
:value="scope.row.majorHazardLevel" :value="scope.row.majorHazardLevel == 'null' ? '/':scope.row.majorHazardLevel"
> >
</dict-tag> </dict-tag>
</template> </template>
@ -715,7 +715,7 @@ export default {
let arr2 = []; let arr2 = [];
let keyCount = 0; let keyCount = 0;
this.multipleSelection.map((item) => { this.multipleSelection.map((item) => {
arr.push('0' + item.subdistrict); arr.push(item.subdistrict);
arr2.push(item.uscCode); arr2.push(item.uscCode);
if (item.isPoint == "1") { if (item.isPoint == "1") {
keyCount++; keyCount++;

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-09-04 10:20:06 * @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-10-10 10:08:28 * @LastEditTime: 2023-10-10 16:14:06
--> -->
<template> <template>
<div class="plan-management"> <div class="plan-management">
@ -341,7 +341,7 @@
} else { } else {
if(this.form.district.length == 2) { if(this.form.district.length == 2) {
district = this.form.district[1].slice(0, 11); district = this.form.district[1].slice(0, 11);
} else { } else if(this.form.district.length == 1){
district = this.form.district[0].slice(0, 8); district = this.form.district[0].slice(0, 8);
} }
} }

Loading…
Cancel
Save