From 94333929e82ce127565bbdb07aced4ce3a96695d Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Thu, 29 Aug 2024 11:03:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=AD=97=E5=85=B8=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8B=E6=8B=89=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/illegalmining/util.ts | 58 ++++------------------------ src/utils/global.ts | 13 +++++++ 2 files changed, 20 insertions(+), 51 deletions(-) diff --git a/src/components/illegalmining/util.ts b/src/components/illegalmining/util.ts index 4038650c..3c35c564 100644 --- a/src/components/illegalmining/util.ts +++ b/src/components/illegalmining/util.ts @@ -11,61 +11,17 @@ */ // 图斑来源 import { getChildrenTree } from '@/api/demo/system'; +import { asyncGetOptions } from '@/utils/global'; + const counties = await getChildrenTree({ parentId: 371300 }) -console.log(counties,'counties') -export const polygonSourceOptions= [ - { label: '群众举报', value: '群众举报'}, - { label: '舆情', value: '舆情'}, - { label: '12345', value: '12345'}, - { label: '矿产卫片', value: '矿产卫片'}, - { label: '无人机巡查', value: '无人机巡查'}, - { label: '其他部门移交', value: '其他部门移交'}, - { label: '上级领导交班', value: '上级领导交班'}, - { label: '县级自查上报', value: '县级自查上报'}, -] + +export const polygonSourceOptions= await asyncGetOptions('tubanlaiyuan') // 图斑类型 -export const polygonTypeOptions= [ - { label: '开采', value: '开采'}, - { label: '加工', value: '加工'}, -] +export const polygonTypeOptions= await asyncGetOptions('kctubanleixing') // 当前状态 -export const statusOptions = [ - { label: '待填报', value: '1'}, - { label: '待整改', value: '2'}, - { label: '待县级审核', value: '3'}, - { label: '待市级审核', value: '4'}, - { label: '待查处', value: '5'}, - { label: '查处待县级审核', value: '6'}, - { label: '查处待市级审核', value: '7'}, - { label: '查处后待整改', value: '8'}, - { label: '整改后待县级审核', value: '9'}, - { label: '整改后待市级审核', value: '10'}, - { label: '已归档', value: '99'}, -] -// 整改类型 -export const rectifyTypeOptions = [ - { label: '取缔', value: '取缔'}, - { label: '保留', value: '保留'}, -] -// 违法类型(开采) -export const mineIllegalTypeOptions = [ - { label: '无证开采类', value: '无证开采类'}, - { label: '越界开采类', value: '越界开采类'}, - { label: '持证矿山类', value: '持证矿山类'}, - { label: '以项目名义类', value: '以项目名义类'}, - { label: '其他', value: '其他'}, -] -// 违法类型(加工) -export const processIllegalTypeOptions = [ - { label: '违法占地', value: '违法占地'}, - { label: '购销非法开采矿产品', value: '购销非法开采矿产品'}, - { label: '其他', value: '其他'}, -] +export const statusOptions = await asyncGetOptions('kcdangqianzhuangtai') // 是否立案 -export const registerOptions = [ - { label: '是', value: 1}, - { label: '否', value: 0}, -] +export const registerOptions =await asyncGetOptions('kcregister') export const countiesOptions = counties.map(item => { return { label: item.name, diff --git a/src/utils/global.ts b/src/utils/global.ts index 96853d84..57777f61 100644 --- a/src/utils/global.ts +++ b/src/utils/global.ts @@ -191,3 +191,16 @@ export const getOptions = (code: string) => { }); return arry; }; +// 根据字典async获取对应的筛选数据 +export const asyncGetOptions = async (code: string) => { + let arry: any = []; + await getLoad({ code: code }).then((res) => { + res.forEach((item: any) => { + arry.push({ + label: item.itemName, + value: item.itemValue, + }); + }); + }); + return arry; +};