From e7e1f33985bd0654caa9820d9d42f6b77d9aed1c Mon Sep 17 00:00:00 2001
From: odjbin <1042039504@qq.com>
Date: Fri, 11 Oct 2024 15:40:28 +0800
Subject: [PATCH 1/2] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8DpointTag?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/PointTag.vue | 52 +++++++++++++++++++++----------------
1 file changed, 29 insertions(+), 23 deletions(-)
diff --git a/src/components/PointTag.vue b/src/components/PointTag.vue
index 5c873a4..f4858b2 100644
--- a/src/components/PointTag.vue
+++ b/src/components/PointTag.vue
@@ -1,7 +1,7 @@
- {{tag.label}}
+ {{tagConfig.label}}
{{ filterDict(cacheStore.getDict(dictType), value) }}
@@ -21,37 +21,43 @@ const props = defineProps({
default: null
}
});
-const tag = reactive({
+const tagConfig = reactive({
listClass: "green",
isType: true,
label: ""
});
-// const dictList = cacheStore.getDict(props.dictType);
-// const dictFormat = () => {
-// if(dictList===undefined) return;
-// for (let i = 0; i < dictList.length; i++) {
-// if(dictList[i].value=== props.value){
-// tag.label = dictList[i].label;
-// tag.listClass=changeParams(dictList[i].listClass)
-// tag.isType = dictList[i].isType;
-// }
-// }
-// };
-const filterDictClass = (data, value) => {
- if(!data) return
- if(data instanceof Array) {
- tag.value = data.find(item => item.value == value)
+const filterDictClass = (data, value) => {
+ if (!data|| value == null) return 'gray'
+ if (data instanceof Array) {
+ tagConfig.value = data.find(item => item.value == value)
+ if (!tagConfig.value) {
+ return '#409EFF'
+ } else {
+ if (tagConfig.value?.isType) {
+ return changeParams(tagConfig.value.listClass)
+ } else {
+ return tagConfig.value.listClass
+ }
+ }
}
- return changeParams(tag.value.listClass)
}
const filterDict = (data, value) => {
- if(!data) return
-
- if(data instanceof Array) {
- tag.value = data.find(item => item.value == value)
+ if (!data || value == null) return '未知'
+ if (data instanceof Array) {
+ if (value == true || value == false) {
+ tagConfig.value = data.find(item => item.value == value.toString())
+ } else if (typeof value === "object") {
+ if (value !== null) {
+ tagConfig.value = data.find(item => item.value == value[0])
+ } else {
+ tagConfig.value = {}
+ }
+ } else {
+ tagConfig.value = data.find(item => item.value == value)
+ }
}
- return tag.value.label
+ return tagConfig.value?.label || '未知'
}
/**
* 根据接口返回的listClass切换成对应的颜色
From c6d8b455376c8d9c9f8a7dade7178d5ae34c1e85 Mon Sep 17 00:00:00 2001
From: odjbin <1042039504@qq.com>
Date: Fri, 11 Oct 2024 16:07:35 +0800
Subject: [PATCH 2/2] =?UTF-8?q?fix=20:=20=E4=BC=98=E5=8C=96=E8=B4=B9?=
=?UTF-8?q?=E7=94=A8=E5=8F=B0=E8=B4=A6-=E5=AF=BC=E5=87=BA=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E4=BD=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/fvcomponents/fvTable/index.vue | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/fvcomponents/fvTable/index.vue b/src/fvcomponents/fvTable/index.vue
index f5cd626..41baf4e 100644
--- a/src/fvcomponents/fvTable/index.vue
+++ b/src/fvcomponents/fvTable/index.vue
@@ -15,11 +15,11 @@
+ 导出
+
- 导出
-