区域翻译修复

lijinlong
许宏杰 2 years ago
parent 07692aa995
commit be947dbf30

@ -4,8 +4,8 @@ ENV = 'development'
# base api # base api
VUE_APP_BASE_API = '/dashboard' VUE_APP_BASE_API = '/dashboard'
VUE_APP_BASE_API2 = 'http://39.101.188.84:9027' VUE_APP_BASE_API2 = 'http://192.168.0.108:9027'
VUE_APP_BASE_API3 = 'http://39.101.188.84:9027' VUE_APP_BASE_API3 = 'http://192.168.0.108:9027'
BASE_API = 'http://10.10.3.35:9070' BASE_API = 'http://10.10.3.35:9070'

@ -15,7 +15,14 @@ export function listTown(query) {
params: query, params: query,
}); });
} }
// 树结构
export function townTree(query) {
return request({
url: "/zongzhi/town/new/tree",
method: "get",
params: query,
});
}
// 查询网评员列表 // 查询网评员列表
export function listCommentator(query) { export function listCommentator(query) {
return request({ return request({
@ -109,7 +116,6 @@ export function dongtaiInfo(id) {
}); });
} }
// 查询等保系统列表 // 查询等保系统列表
export function listSystem(query) { export function listSystem(query) {
return request({ return request({
@ -247,13 +253,12 @@ export function managescreen() {
}); });
} }
// 网评文章录用情况; // 网评文章录用情况;
export function networkArticles() { export function networkArticles() {
return request({ return request({
url: "/zongzhi/network/articles", url: "/zongzhi/network/articles",
method: "get", method: "get",
}); });
} }
//网评员任务完成率(月) //网评员任务完成率(月)

@ -1,25 +1,25 @@
/* /*
* @Descripttion: * @Descripttion:
* @version: * @version:
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-08-21 08:54:24 * @Date: 2023-08-21 08:54:24
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-08-21 15:29:23 * @LastEditTime: 2023-08-21 15:29:23
*/ */
import { getDictList } from '@/api/zongzhi/common.js' import { getDictList } from "@/api/zongzhi/common.js";
import { listTown } from '@/api/zongzhi/st.js' import { listTown, townTree } from "@/api/zongzhi/st.js";
const dict = { const dict = {
state: { state: {
dictObject: {}, dictObject: {},
townList: [] townList: [],
}, },
mutations: { mutations: {
SET_DICT: (state, dict) => { SET_DICT: (state, dict) => {
state.dictObject = dict state.dictObject = dict;
}, },
SET_TOWN: (state, town) => { SET_TOWN: (state, town) => {
state.townList = town state.townList = town;
} },
}, },
actions: { actions: {
getDictType({ commit }) { getDictType({ commit }) {
@ -30,33 +30,30 @@ const dict = {
getDictList(query) getDictList(query)
.then((res) => { .then((res) => {
// console.log(res) // console.log(res)
commit('SET_DICT', res.data) commit("SET_DICT", res.data);
getownList().then((town) => { getownList().then((town) => {
commit('SET_TOWN', town) commit("SET_TOWN", town);
resolve() resolve();
}) });
}) })
.catch((error) => { .catch((error) => {
reject(error) reject(error);
}) });
}) });
} },
} },
} };
// 获取各镇/村 // 获取各镇/村
function getownList() { function getownList() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const lsit = [] const lsit = [];
listTown({ pageNum: 1, pageSize: 200 }) townTree()
.then((res) => { .then((res) => {
res.rows.forEach((item) => { resolve(res.data);
lsit.push({ value: item.id, label: item.name })
})
resolve(lsit)
}) })
.catch((error) => { .catch((error) => {
reject(error) reject(error);
}) });
}) });
} }
export default dict export default dict;

@ -1,26 +1,49 @@
import store from '@/store' import store from "@/store";
export function filterDict(type, value, isTown = false) { export function filterDict(type, value, isTown = false) {
if (!value) return if (!value) return;
if (isTown) { if (isTown) {
return filterTown(value) return filterTown(value);
} else { } else {
const dict = store.getters.dictObject const dict = store.getters.dictObject;
const result = dict[type].filter((item) => item.dictValue == value) const result = dict[type].filter((item) => item.dictValue == value);
if (result.length > 0) { if (result.length > 0) {
return result[0].dictLabel return result[0].dictLabel;
} else { } else {
return '未匹配到' return "未匹配到";
} }
} }
} }
export function filterTown(id) { // export function filterTown(id) {
const townList = store.state.dict.townList // const townList = store.state.dict.townList
const result = townList.filter((item) => item.value == id) // const result = townList.filter((item) => item.value == id)
if (result.length > 0) { // if (result.length > 0) {
return result[0].label // return result[0].label
} else { // } else {
return '未匹配到' // return '未匹配到'
// }
// }
function filterTown(ids) {
ids = JSON.parse(ids);
if (ids && Array.isArray(ids)) {
let data = store.state.dict.townList;
const targetIds = ids;
const results = [];
filterNames(data, targetIds, results);
return results.join(" / ");
} }
} }
function filterNames(data, targetIds, results) {
data.forEach((node, index) => {
if (targetIds.includes(node.id)) {
results.push(node.label);
}
const children = node.children;
if (Array.isArray(children) && children.length > 0) {
filterNames(children, targetIds, results);
}
});
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save