refactor: 重构优化

This commit is contained in:
xiaojunnuo
2021-02-05 14:30:31 +08:00
parent 305824ff1a
commit 5cde165f0b
9 changed files with 26 additions and 17 deletions
+6 -5
View File
@@ -9,18 +9,19 @@ function handleInputs (inputs) {
if (item.component == null) {
item.component = {}
}
if (item.component.rules == null) {
item.component.rules = []
let rules = item.component.rules
if (rules == null) {
item.component.rules = rules = []
}
if (item.component.rules.length > 0) {
const hasRequired = item.rules.filter(rule => {
if (rules.length > 0) {
const hasRequired = rules.filter(rule => {
return rule.required === true
})
if (hasRequired.length > 0) {
return
}
}
item.component.rules.push({ required: true, message: '该项必填' })
rules.push({ required: true, message: '该项必填' })
delete item.required
}
})
@@ -3,13 +3,14 @@
<a-select
:value="value"
@update:value="valueUpdate"
placeholder="没有可选时请点右边按钮添加"
>
<a-select-option v-for="item of getProviders()" :key="item.key" :value="item.key" :disabled="isDisabled(item)">
{{ item.name }}
</a-select-option>
</a-select>
<a-button class="suffix" @click="providerManagerOpen">
管理授权
添加授权
</a-button>
</div>
<access-provider-manager ref="providerManagerRef"
@@ -26,7 +26,8 @@ export default {
attrs[key] = eval(value)
}
})
return () => h(resolveComponent(props.name), context.$attrs, props.children)
const comp = resolveComponent(props.name)
return () => h(comp, context.$attrs, props.children)
}
}
</script>
@@ -3,7 +3,7 @@
title="证书申请配置"
placement="right"
:closable="true"
width="500px"
width="600px"
v-model:visible="visible"
:after-visible-change="afterVisibleChange"
>
+1 -1
View File
@@ -155,7 +155,7 @@
<div><a-button @click="exportsToZip">导出可执行项目</a-button></div>
<br/>
<div> <a-button>仅导出配置</a-button></div>
<div> <a-button @click="exportsToJson">仅导出配置</a-button></div>
</div>
</div>
</div>