Explorar o código

Merge branch 'dev-qd' into 'dev'

feat: 修改字典管理字典项输入限制

See merge request product-group-fe/sfy-safety-group/sfy-safety!45
楼航飞 hai 10 meses
pai
achega
2df5749525

+ 11 - 27
src/views/system/dictionary/components/AddDict.vue

@@ -49,32 +49,25 @@
                 :prop="`sysDictDataList.${index}.itemValue`"
                 :rules="[{ required: true, message: '请输入字典项值', trigger: 'blur' }]"
               >
-                <el-input v-model="item.itemValue" placeholder="请输入字典项值" />
+                <el-input
+                  v-model="item.itemValue"
+                  W
+                  placeholder="请输入"
+                  type="textarea"
+                  show-word-limit
+                  maxlength="500"
+                />
               </el-form-item>
               <el-form-item
                 :label="`字典项编码`"
                 :prop="`sysDictDataList.${index}.itemCode`"
                 :rules="[{ required: true, message: '请输入字典项编码', trigger: 'blur' }]"
               >
-                <el-input v-model="item.itemCode" placeholder="请输入字典项编码" />
+                <el-input v-model="item.itemCode" placeholder="请输入字典项编码" type="textarea" show-word-limit
+                maxlength="500"
               </el-form-item>
               <el-form-item label="图标">
                 <!-- // 在模板部分修改上传组件的ref绑定 -->
-                <!-- <el-upload
-                  :ref="(el) => setUploadRef(index, el)"
-                  v-model:file-list="item.fileList"
-                  :auto-upload="false"
-                  list-type="picture-card"
-                  :limit="1"
-                  :on-preview="(file) => handlePictureCardPreview(file)"
-                  :on-remove="() => handleRemove(index)"
-                  :on-change="(file) => handleChange(file, index)"
-                  :on-exceed="(files) => handleExceed(files, index)"
-                >
-                  <el-icon>
-                    <Plus />
-                  </el-icon>
-                </el-upload> -->
                 <el-upload
                   :ref="(el) => setUploadRef(index, el)"
                   v-model:file-list="item.fileList"
@@ -170,7 +163,7 @@
     genFileId,
     ElMessage,
   } from 'element-plus';
-  import { Plus, Delete, CirclePlus, ZoomIn } from '@element-plus/icons-vue';
+  import { Plus, Delete, CirclePlus } from '@element-plus/icons-vue';
   import { dictionaryTypeOptions, DictionaryStatus, dictionaryStatusOptions } from '../constants';
   import { queryDictTypeDetail } from '@/api/dict';
   import { uploadFileApi, UPLOAD_BIZ_TYPE } from '@/api/minio';
@@ -364,15 +357,6 @@
     });
   };
 
-  const hoverState = reactive({
-    up: false,
-    down: false,
-  });
-
-  const handleHover = (event: Event, type: 'up' | 'down', isEnter = true) => {
-    hoverState[type] = isEnter;
-  };
-
   // 移动方法
   const moveDictItem = (index: number, direction: 'up' | 'down') => {
     const items = formData.sysDictDataList;

+ 9 - 9
src/views/system/dictionary/constants.ts

@@ -1,25 +1,25 @@
 export const dictionaryTypeOptions = [
   {
     value: 1,
-    label: '灾害防护'
+    label: '灾害防范',
   },
   {
     value: 2,
-    label: '应急管理'
+    label: '应急管理',
   },
   {
     value: 3,
-    label: '交通安全'
+    label: '交通安全',
   },
   {
     value: 4,
-    label: '保卫保密'
+    label: '保卫保密',
   },
   {
     value: 5,
-    label: '生产安全'
+    label: '生产安全',
   },
-] 
+];
 
 export enum DictionaryStatus {
   disabled = 0,
@@ -29,10 +29,10 @@ export enum DictionaryStatus {
 export const dictionaryStatusOptions = [
   {
     value: DictionaryStatus.disabled,
-    label: '禁用'
+    label: '禁用',
   },
   {
     value: DictionaryStatus.enabled,
-    label: '启用'
+    label: '启用',
   },
-]
+];