Browse Source

refactor🎨: 字典key修改

zhangwenjian 4 years ago
parent
commit
55c9e7b017

+ 2 - 2
src/utils/costum.js

@@ -64,8 +64,8 @@ export function addDateRange(params, dateRange) {
 export function selectDictLabel(datas, value) {
   var actions = []
   Object.keys(datas).map((key) => {
-    if (datas[key].dictValue === ('' + value)) {
-      actions.push(datas[key].dictLabel)
+    if (datas[key].value === ('' + value)) {
+      actions.push(datas[key].label)
       return false
     }
   })

+ 6 - 6
src/views/admin/dict/data.vue

@@ -26,9 +26,9 @@
             <el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
               <el-option
                 v-for="dict in statusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>
@@ -130,9 +130,9 @@
               <el-radio-group v-model="form.status">
                 <el-radio
                   v-for="dict in statusOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictValue"
-                >{{ dict.dictLabel }}</el-radio>
+                  :key="dict.value"
+                  :label="dict.value"
+                >{{ dict.label }}</el-radio>
               </el-radio-group>
             </el-form-item>
             <el-form-item label="备注" prop="remark">

+ 6 - 6
src/views/admin/dict/index.vue

@@ -33,9 +33,9 @@
             >
               <el-option
                 v-for="dict in statusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>
@@ -146,9 +146,9 @@
               <el-radio-group v-model="form.status">
                 <el-radio
                   v-for="dict in statusOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictValue"
-                >{{ dict.dictLabel }}</el-radio>
+                  :key="dict.value"
+                  :label="dict.value"
+                >{{ dict.label }}</el-radio>
               </el-radio-group>
             </el-form-item>
             <el-form-item label="备注" prop="remark">

+ 6 - 6
src/views/admin/sys-config/index.vue

@@ -27,9 +27,9 @@
             <el-select v-model="queryParams.configType" placeholder="系统内置" clearable size="small">
               <el-option
                 v-for="dict in typeOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>
@@ -187,9 +187,9 @@
               <el-radio-group v-model="form.configType">
                 <el-radio
                   v-for="dict in typeOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictValue"
-                >{{ dict.dictLabel }}</el-radio>
+                  :key="dict.value"
+                  :label="dict.value"
+                >{{ dict.label }}</el-radio>
               </el-radio-group>
             </el-form-item>
             <el-form-item label="前台显示" prop="isFrontend">

+ 6 - 6
src/views/admin/sys-dept/index.vue

@@ -16,9 +16,9 @@
             <el-select v-model="queryParams.status" placeholder="部门状态" clearable size="small">
               <el-option
                 v-for="dict in statusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>
@@ -138,9 +138,9 @@
                   <el-radio-group v-model="form.status">
                     <el-radio
                       v-for="dict in statusOptions"
-                      :key="dict.dictValue"
-                      :label="dict.dictValue"
-                    >{{ dict.dictLabel }}</el-radio>
+                      :key="dict.value"
+                      :label="dict.value"
+                    >{{ dict.label }}</el-radio>
                   </el-radio-group>
                 </el-form-item>
               </el-col>

+ 3 - 3
src/views/admin/sys-login-log/index.vue

@@ -20,9 +20,9 @@
           >
             <el-option
               v-for="dict in statusOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
             />
           </el-select>
           </el-form-item>

+ 6 - 6
src/views/admin/sys-menu/index.vue

@@ -16,9 +16,9 @@
             <el-select v-model="queryParams.visible" placeholder="菜单状态" clearable size="small">
               <el-option
                 v-for="dict in visibleOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>
@@ -303,9 +303,9 @@
                     <el-radio-group v-model="form.visible">
                       <el-radio
                         v-for="dict in visibleOptions"
-                        :key="dict.dictValue"
-                        :label="dict.dictValue"
-                      >{{ dict.dictLabel }}</el-radio>
+                        :key="dict.value"
+                        :label="dict.value"
+                      >{{ dict.label }}</el-radio>
                     </el-radio-group>
                   </el-form-item>
                 </el-col>

+ 3 - 3
src/views/admin/sys-oper-log/index.vue

@@ -13,9 +13,9 @@
             >
               <el-option
                 v-for="dict in statusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>

+ 6 - 6
src/views/admin/sys-post/index.vue

@@ -25,9 +25,9 @@
             <el-select v-model="queryParams.status" placeholder="岗位状态" clearable size="small">
               <el-option
                 v-for="dict in statusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>
@@ -141,9 +141,9 @@
               <el-radio-group v-model="form.status">
                 <el-radio
                   v-for="dict in statusOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictValue"
-                >{{ dict.dictLabel }}</el-radio>
+                  :key="dict.value"
+                  :label="dict.value"
+                >{{ dict.label }}</el-radio>
               </el-radio-group>
             </el-form-item>
             <el-form-item label="备注" prop="remark">

+ 6 - 6
src/views/admin/sys-role/index.vue

@@ -33,9 +33,9 @@
             >
               <el-option
                 v-for="dict in statusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>
@@ -182,9 +182,9 @@
               <el-radio-group v-model="form.status">
                 <el-radio
                   v-for="dict in statusOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictValue"
-                >{{ dict.dictLabel }}</el-radio>
+                  :key="dict.value"
+                  :label="dict.value"
+                >{{ dict.label }}</el-radio>
               </el-radio-group>
             </el-form-item>
             <el-form-item label="菜单权限">

+ 9 - 9
src/views/admin/sys-user/index.vue

@@ -60,9 +60,9 @@
                 >
                   <el-option
                     v-for="dict in statusOptions"
-                    :key="dict.dictValue"
-                    :label="dict.dictLabel"
-                    :value="dict.dictValue"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
                   />
                 </el-select>
               </el-form-item>
@@ -224,9 +224,9 @@
                 <el-select v-model="form.sex" placeholder="请选择">
                   <el-option
                     v-for="dict in sexOptions"
-                    :key="dict.dictValue"
-                    :label="dict.dictLabel"
-                    :value="dict.dictValue"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
                   />
                 </el-select>
               </el-form-item>
@@ -236,9 +236,9 @@
                 <el-radio-group v-model="form.status">
                   <el-radio
                     v-for="dict in statusOptions"
-                    :key="dict.dictValue"
-                    :label="dict.dictValue"
-                  >{{ dict.dictLabel }}</el-radio>
+                    :key="dict.value"
+                    :label="dict.value"
+                  >{{ dict.label }}</el-radio>
                 </el-radio-group>
               </el-form-item>
             </el-col>

+ 12 - 12
src/views/schedule/index.vue

@@ -23,9 +23,9 @@
               >
                 <el-option
                   v-for="dict in jobGroupOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictLabel"
-                  :value="dict.dictValue"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
                 />
               </el-select>
             </el-form-item>
@@ -38,9 +38,9 @@
               >
                 <el-option
                   v-for="dict in statusOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictLabel"
-                  :value="dict.dictValue"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
                 />
               </el-select>
             </el-form-item>
@@ -213,9 +213,9 @@
                     >
                       <el-option
                         v-for="dict in jobGroupOptions"
-                        :key="dict.dictValue"
-                        :label="dict.dictLabel"
-                        :value="dict.dictValue"
+                        :key="dict.value"
+                        :label="dict.label"
+                        :value="dict.value"
                       />
                     </el-select>
                   </el-form-item>
@@ -298,9 +298,9 @@
                     >
                       <el-option
                         v-for="dict in statusOptions"
-                        :key="dict.dictValue"
-                        :label="dict.dictLabel"
-                        :value="dict.dictValue"
+                        :key="dict.value"
+                        :label="dict.label"
+                        :value="dict.value"
                       />
                     </el-select>
                   </el-form-item>