Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aecc9bb8
authored
Dec 03, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
修复 IDEA 在 `v-for="dict in getIntDictOptions(...)"` 时,`el-option` 的 `key` 会告警的问题
parent
3d2d48b6
Show whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
56 additions
and
49 deletions
+56
-49
src/utils/dict.ts
+9
-2
src/views/infra/config/ConfigForm.vue
+1
-1
src/views/system/dept/DeptForm.vue
+1
-1
src/views/system/dept/index.vue
+1
-1
src/views/system/dict/DictTypeForm.vue
+1
-1
src/views/system/dict/data/DictDataForm.vue
+1
-1
src/views/system/dict/data/index.vue
+1
-1
src/views/system/dict/index.vue
+1
-1
src/views/system/errorCode/index.vue
+1
-1
src/views/system/menu/index.vue
+1
-1
src/views/system/notice/index.vue
+1
-1
src/views/system/notify/message/index.vue
+2
-2
src/views/system/notify/my/index.vue
+1
-1
src/views/system/notify/template/NotifyTemplateForm.vue
+3
-3
src/views/system/notify/template/NotifyTemplateSendForm.vue
+2
-2
src/views/system/notify/template/index.vue
+1
-1
src/views/system/oauth2/client/ClientForm.vue
+1
-1
src/views/system/oauth2/client/index.vue
+1
-1
src/views/system/oauth2/token/index.vue
+1
-1
src/views/system/operatelog/index.vue
+1
-1
src/views/system/post/PostForm.vue
+1
-1
src/views/system/post/index.vue
+1
-1
src/views/system/sensitiveWord/SensitiveWordForm.vue
+1
-1
src/views/system/sensitiveWord/index.vue
+1
-1
src/views/system/sms/channel/SmsChannelForm.vue
+2
-2
src/views/system/sms/channel/index.vue
+1
-1
src/views/system/sms/template/SmsTemplateForm.vue
+3
-3
src/views/system/sms/template/index.vue
+2
-2
src/views/system/social/client/SocialClientForm.vue
+2
-2
src/views/system/social/client/index.vue
+3
-3
src/views/system/social/user/index.vue
+1
-1
src/views/system/tenant/TenantForm.vue
+1
-1
src/views/system/tenant/index.vue
+1
-1
src/views/system/tenantPackage/TenantPackageForm.vue
+1
-1
src/views/system/tenantPackage/index.vue
+1
-1
src/views/system/user/UserForm.vue
+1
-1
src/views/system/user/index.vue
+1
-1
No files found.
src/utils/dict.ts
View file @
aecc9bb8
...
...
@@ -20,13 +20,20 @@ export interface DictDataType {
cssClass
:
string
}
export
interface
NumberDictDataType
extends
DictDataType
{
value
:
number
}
export
const
getDictOptions
=
(
dictType
:
string
)
=>
{
return
dictStore
.
getDictByType
(
dictType
)
||
[]
}
export
const
getIntDictOptions
=
(
dictType
:
string
):
DictDataType
[]
=>
{
const
dictOption
:
DictDataType
[]
=
[]
export
const
getIntDictOptions
=
(
dictType
:
string
):
Number
DictDataType
[]
=>
{
// 获得通用的 DictDataType 列表
const
dictOptions
:
DictDataType
[]
=
getDictOptions
(
dictType
)
// 转换成 number 类型的 NumberDictDataType 类型
// why 需要特殊转换:避免 IDEA 在 v-for="dict in getIntDictOptions(...)" 时,el-option 的 key 会告警
const
dictOption
:
NumberDictDataType
[]
=
[]
dictOptions
.
forEach
((
dict
:
DictDataType
)
=>
{
dictOption
.
push
({
...
dict
,
...
...
src/views/infra/config/ConfigForm.vue
View file @
aecc9bb8
...
...
@@ -23,7 +23,7 @@
<el-radio-group
v-model=
"formData.visible"
>
<el-radio
v-for=
"dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
:key=
"dict.value"
:key=
"dict.value
as string
"
:label=
"dict.value"
>
{{
dict
.
label
}}
...
...
src/views/system/dept/DeptForm.vue
View file @
aecc9bb8
...
...
@@ -44,7 +44,7 @@
<el-select
v-model=
"formData.status"
clearable
placeholder=
"请选择状态"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/dept/index.vue
View file @
aecc9bb8
...
...
@@ -25,7 +25,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/dict/DictTypeForm.vue
View file @
aecc9bb8
...
...
@@ -21,7 +21,7 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
...
...
src/views/system/dict/data/DictDataForm.vue
View file @
aecc9bb8
...
...
@@ -27,7 +27,7 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
...
...
src/views/system/dict/data/index.vue
View file @
aecc9bb8
...
...
@@ -30,7 +30,7 @@
<el-select
v-model=
"queryParams.status"
placeholder=
"数据状态"
clearable
class=
"!w-240px"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/dict/index.vue
View file @
aecc9bb8
...
...
@@ -35,7 +35,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/errorCode/index.vue
View file @
aecc9bb8
...
...
@@ -14,7 +14,7 @@
<el-select
v-model=
"queryParams.type"
placeholder=
"请选择错误码类型"
clearable
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_ERROR_CODE_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
class=
"!w-240px"
...
...
src/views/system/menu/index.vue
View file @
aecc9bb8
...
...
@@ -29,7 +29,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/notice/index.vue
View file @
aecc9bb8
...
...
@@ -26,7 +26,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/notify/message/index.vue
View file @
aecc9bb8
...
...
@@ -28,7 +28,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.USER_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
@@ -52,7 +52,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/notify/my/index.vue
View file @
aecc9bb8
...
...
@@ -19,7 +19,7 @@
>
<el-option
v-for=
"dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/notify/template/NotifyTemplateForm.vue
View file @
aecc9bb8
...
...
@@ -23,7 +23,7 @@
<el-select
v-model=
"formData.type"
placeholder=
"请选择类型"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
@@ -33,8 +33,8 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:label=
"dict.value
as string
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
</el-radio>
...
...
src/views/system/notify/template/NotifyTemplateSendForm.vue
View file @
aecc9bb8
...
...
@@ -19,8 +19,8 @@
<el-radio-group
v-model=
"formData.userType"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.USER_TYPE)"
:key=
"dict.value
as number
"
:label=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
</el-radio>
...
...
src/views/system/notify/template/index.vue
View file @
aecc9bb8
...
...
@@ -37,7 +37,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/oauth2/client/ClientForm.vue
View file @
aecc9bb8
...
...
@@ -26,7 +26,7 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
...
...
src/views/system/oauth2/client/index.vue
View file @
aecc9bb8
...
...
@@ -23,7 +23,7 @@
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
clearable
class=
"!w-240px"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/oauth2/token/index.vue
View file @
aecc9bb8
...
...
@@ -28,7 +28,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.USER_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/operatelog/index.vue
View file @
aecc9bb8
...
...
@@ -37,7 +37,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_OPERATE_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/post/PostForm.vue
View file @
aecc9bb8
...
...
@@ -20,7 +20,7 @@
<el-select
v-model=
"formData.status"
clearable
placeholder=
"请选择状态"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/post/index.vue
View file @
aecc9bb8
...
...
@@ -28,7 +28,7 @@
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
clearable
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/sensitiveWord/SensitiveWordForm.vue
View file @
aecc9bb8
...
...
@@ -14,7 +14,7 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
...
...
src/views/system/sensitiveWord/index.vue
View file @
aecc9bb8
...
...
@@ -32,7 +32,7 @@
<el-select
v-model=
"queryParams.status"
clearable
placeholder=
"请选择启用状态"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
class=
"!w-240px"
...
...
src/views/system/sms/channel/SmsChannelForm.vue
View file @
aecc9bb8
...
...
@@ -14,7 +14,7 @@
<el-select
v-model=
"formData.code"
clearable
placeholder=
"请选择渠道编码"
>
<el-option
v-for=
"dict in getStrDictOptions(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
@@ -24,7 +24,7 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
...
...
src/views/system/sms/channel/index.vue
View file @
aecc9bb8
...
...
@@ -21,7 +21,7 @@
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择启用状态"
clearable
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/sms/template/SmsTemplateForm.vue
View file @
aecc9bb8
...
...
@@ -24,7 +24,7 @@
<el-select
v-model=
"formData.type"
placeholder=
"请选择短信类型"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
@@ -43,8 +43,8 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:label=
"
parseInt(dict.value as string)
"
:key=
"dict.value"
:label=
"
dict.value
"
>
{{
dict
.
label
}}
</el-radio>
...
...
src/views/system/sms/template/index.vue
View file @
aecc9bb8
...
...
@@ -19,7 +19,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
@@ -34,7 +34,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/social/client/SocialClientForm.vue
View file @
aecc9bb8
...
...
@@ -14,7 +14,7 @@
<el-radio-group
v-model=
"formData.socialType"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_SOCIAL_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
...
...
@@ -48,7 +48,7 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
...
...
src/views/system/social/client/index.vue
View file @
aecc9bb8
...
...
@@ -28,7 +28,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_SOCIAL_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
@@ -43,7 +43,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.USER_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
@@ -62,7 +62,7 @@
<el-select
v-model=
"queryParams.status"
class=
"!w-240px"
clearable
placeholder=
"请选择状态"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/social/user/index.vue
View file @
aecc9bb8
...
...
@@ -19,7 +19,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_SOCIAL_TYPE)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/tenant/TenantForm.vue
View file @
aecc9bb8
...
...
@@ -61,7 +61,7 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{
dict
.
label
}}
...
...
src/views/system/tenant/index.vue
View file @
aecc9bb8
...
...
@@ -46,7 +46,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/tenantPackage/TenantPackageForm.vue
View file @
aecc9bb8
...
...
@@ -44,7 +44,7 @@
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.value"
>
{{ dict.label }}
...
...
src/views/system/tenantPackage/index.vue
View file @
aecc9bb8
...
...
@@ -23,7 +23,7 @@
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
clearable
class=
"!w-240px"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/user/UserForm.vue
View file @
aecc9bb8
...
...
@@ -61,7 +61,7 @@
<el-select
v-model=
"formData.sex"
placeholder=
"请选择"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_USER_SEX)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
src/views/system/user/index.vue
View file @
aecc9bb8
...
...
@@ -47,7 +47,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value
as number
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment