Ver Fonte

控制字段值新增按钮

dengrui há 1 mês atrás
pai
commit
49e674a7ec
1 ficheiros alterados com 7 adições e 2 exclusões
  1. 7 2
      src/views/system/dict/components/dict-item.vue

+ 7 - 2
src/views/system/dict/components/dict-item.vue

@@ -38,7 +38,11 @@ watch?.(
     resetQuery();
   }
 );
-
+// 控制该数组里面的值不能新增
+const noAddTypeCode = ["device_type"];
+const addValStatus = computed(() => {
+  return noAddTypeCode.includes(props.typeCode);
+});
 const queryFormRef = ref(ElForm);
 const dataFormRef = ref(ElForm);
 
@@ -117,7 +121,7 @@ function openDialog(form?: any) {
     dataFormRef.value.label = "";
     dataFormRef.value = "";
     formData.dictLabel = "";
-    formData.dictValue = ""
+    formData.dictValue = "";
   }
 }
 
@@ -222,6 +226,7 @@ onMounted?.(() => {
     <el-card shadow="never">
       <template #header>
         <el-button
+          v-if="!addValStatus"
           v-hasPerm="[ButtonPermKeys.SYSTEM.BTNS.dict_add]"
           type="primary"
           @click="openDialog()"