mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-10 20:57:10 +08:00
@@ -50,7 +50,7 @@
|
|||||||
<template #extra>
|
<template #extra>
|
||||||
<div v-if="routeName">
|
<div v-if="routeName">
|
||||||
<span>建议组件名称:</span>
|
<span>建议组件名称:</span>
|
||||||
<a-tag>{{ routeName }}</a-tag>
|
<a-tag checkable @check="inputRouteName">{{ routeName }}</a-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -65,18 +65,6 @@
|
|||||||
<a-input v-model.trim="form.permission" placeholder="system:user:add" allow-clear />
|
<a-input v-model.trim="form.permission" placeholder="system:user:add" allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-row :gutter="16" v-if="[1, 2].includes(form.type)">
|
<a-row :gutter="16" v-if="[1, 2].includes(form.type)">
|
||||||
<a-col :xs="12" :sm="12" :md="8" :lg="8" :xl="8" :xxl="8">
|
|
||||||
<a-form-item label="是否外链" field="isExternalUrl" v-if="[1, 2].includes(form.type)">
|
|
||||||
<a-switch
|
|
||||||
v-model="form.isExternal"
|
|
||||||
:checked-value="true"
|
|
||||||
:unchecked-value="false"
|
|
||||||
checked-text="是"
|
|
||||||
unchecked-text="否"
|
|
||||||
type="round"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :xs="12" :sm="12" :md="8" :lg="8" :xl="8" :xxl="8">
|
<a-col :xs="12" :sm="12" :md="8" :lg="8" :xl="8" :xxl="8">
|
||||||
<a-form-item label="是否隐藏" field="hidden">
|
<a-form-item label="是否隐藏" field="hidden">
|
||||||
<a-switch
|
<a-switch
|
||||||
@@ -101,6 +89,18 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :xs="12" :sm="12" :md="8" :lg="8" :xl="8" :xxl="8">
|
||||||
|
<a-form-item label="是否外链" field="isExternalUrl" v-if="form.type === 2">
|
||||||
|
<a-switch
|
||||||
|
v-model="form.isExternal"
|
||||||
|
:checked-value="true"
|
||||||
|
:unchecked-value="false"
|
||||||
|
checked-text="是"
|
||||||
|
unchecked-text="否"
|
||||||
|
type="round"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-form-item label="菜单排序" field="sort">
|
<a-form-item label="菜单排序" field="sort">
|
||||||
<a-input-number v-model="form.sort" placeholder="请输入菜单排序" :min="1" mode="button" style="width: 150px" />
|
<a-input-number v-model="form.sort" placeholder="请输入菜单排序" :min="1" mode="button" style="width: 150px" />
|
||||||
@@ -188,6 +188,10 @@ const formRules = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const inputRouteName = () => {
|
||||||
|
form.name = routeName.value
|
||||||
|
}
|
||||||
|
|
||||||
// 切换类型清除校验
|
// 切换类型清除校验
|
||||||
const onChangeType = () => {
|
const onChangeType = () => {
|
||||||
formRef.value?.clearValidate()
|
formRef.value?.clearValidate()
|
||||||
|
@@ -100,7 +100,6 @@ const { width } = useWindowSize()
|
|||||||
const { storage_type_enum } = useDict('storage_type_enum')
|
const { storage_type_enum } = useDict('storage_type_enum')
|
||||||
|
|
||||||
const dataId = ref('')
|
const dataId = ref('')
|
||||||
const updatedSecretKey = ref(false)
|
|
||||||
const isUpdate = computed(() => !!dataId.value)
|
const isUpdate = computed(() => !!dataId.value)
|
||||||
const title = computed(() => (isUpdate.value ? '修改存储' : '新增存储'))
|
const title = computed(() => (isUpdate.value ? '修改存储' : '新增存储'))
|
||||||
const formRef = ref<FormInstance>()
|
const formRef = ref<FormInstance>()
|
||||||
@@ -120,7 +119,6 @@ const { form, resetForm } = useForm<StorageReq>({
|
|||||||
code: '',
|
code: '',
|
||||||
type: 2,
|
type: 2,
|
||||||
accessKey: undefined,
|
accessKey: undefined,
|
||||||
secretKeyEncrypted: undefined,
|
|
||||||
secretKey: undefined,
|
secretKey: undefined,
|
||||||
endpoint: undefined,
|
endpoint: undefined,
|
||||||
bucketName: undefined,
|
bucketName: undefined,
|
||||||
@@ -154,18 +152,14 @@ const onUpdate = async (id: string) => {
|
|||||||
visible.value = true
|
visible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateSecretKey = () => {
|
|
||||||
updatedSecretKey.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存
|
// 保存
|
||||||
const save = async () => {
|
const save = async () => {
|
||||||
try {
|
try {
|
||||||
const isInvalid = await formRef.value?.validate()
|
const isInvalid = await formRef.value?.validate()
|
||||||
if (isInvalid) return false
|
if (isInvalid) return false
|
||||||
const data = Object.assign({}, form)
|
const data = {
|
||||||
if (data.type === 1) {
|
...form,
|
||||||
data.secretKey = updatedSecretKey.value ? encryptByRsa(form.secretKey) : form.secretKeyEncrypted
|
secretKey: form.type === 1 && !form.secretKey.includes('*') ? encryptByRsa(form.secretKey) : null
|
||||||
}
|
}
|
||||||
if (isUpdate.value) {
|
if (isUpdate.value) {
|
||||||
await updateStorage(data, dataId.value)
|
await updateStorage(data, dataId.value)
|
||||||
|
@@ -4,7 +4,6 @@ export interface StorageReq {
|
|||||||
type: number
|
type: number
|
||||||
accessKey: string
|
accessKey: string
|
||||||
secretKey: string
|
secretKey: string
|
||||||
secretKeyEncrypted: string
|
|
||||||
endpoint: string
|
endpoint: string
|
||||||
bucketName: string
|
bucketName: string
|
||||||
domain: string
|
domain: string
|
||||||
|
Reference in New Issue
Block a user