...
|
...
|
@@ -21,7 +21,7 @@ enum FormFieldsEnum { |
21
|
21
|
PASSWORD = 'password',
|
22
|
22
|
}
|
23
|
23
|
|
24
|
|
-const createFormSchemas = (title?: string, password?: string): FormSchema[] => {
|
|
24
|
+const createFormSchemas = (title?: string, password?: string, operationPasswordEnable?: boolean): FormSchema[] => {
|
25
|
25
|
const schemas: FormSchema[] = [
|
26
|
26
|
{
|
27
|
27
|
field: FormFieldsEnum.ATTR_VALUE,
|
...
|
...
|
@@ -31,7 +31,7 @@ const createFormSchemas = (title?: string, password?: string): FormSchema[] => { |
31
|
31
|
},
|
32
|
32
|
]
|
33
|
33
|
|
34
|
|
- if (password) {
|
|
34
|
+ if (password && operationPasswordEnable) {
|
35
|
35
|
schemas.unshift({
|
36
|
36
|
field: FormFieldsEnum.PASSWORD,
|
37
|
37
|
label: '操作密码',
|
...
|
...
|
@@ -51,13 +51,13 @@ const createFormSchemas = (title?: string, password?: string): FormSchema[] => { |
51
|
51
|
return schemas
|
52
|
52
|
}
|
53
|
53
|
|
54
|
|
-const open = async ({ title, operationPassword }: Partial<Record<'operationPassword' | 'title', string>>) => {
|
|
54
|
+const open = async ({ title, operationPassword, operationPasswordEnable }: Partial<Record<'operationPassword' | 'title', string>> & { operationPasswordEnable: boolean }) => {
|
55
|
55
|
visible.value = true
|
56
|
56
|
password.value = operationPassword
|
57
|
57
|
return new Promise((resolve) => {
|
58
|
58
|
resolveFn.value = resolve
|
59
|
59
|
nextTick(() => {
|
60
|
|
- setProps({ schemas: createFormSchemas(title, operationPassword) })
|
|
60
|
+ setProps({ schemas: createFormSchemas(title, operationPassword, operationPasswordEnable) })
|
61
|
61
|
})
|
62
|
62
|
})
|
63
|
63
|
}
|
...
|
...
|
|