前台必填字段

This commit is contained in:
gaoyuanwei 2022-07-26 10:18:34 +08:00
parent 837641ba79
commit 14d684bdfd
2 changed files with 114 additions and 69 deletions

View File

@ -301,6 +301,9 @@
if (!dataFrom.value.name) {
notFilled.value.push('应用名称')
}
if (!dataFrom.value.shareCondition) {
notFilled.value.push('共享条件')
}
if (!dataFrom.value.description) {
notFilled.value.push('应用描述')
}
@ -337,15 +340,15 @@
) {
notFilled.value.push('应用类型')
}
if (
!dataFrom.value.infoList.filter(
(val) => val.attrType === '共享条件'
)[0] ||
!dataFrom.value.infoList.filter((val) => val.attrType === '共享条件')[0]
.attrValue
) {
notFilled.value.push('共享条件')
}
// if (
// !dataFrom.value.infoList.filter(
// (val) => val.attrType === ''
// )[0] ||
// !dataFrom.value.infoList.filter((val) => val.attrType === '')[0]
// .attrValue
// ) {
// notFilled.value.push('')
// }
if (notFilled.value.length > 0) {
message.warning('请填写必填字段')
console.log(notFilled.value)

View File

@ -14,7 +14,6 @@
<div></div>
</div>
<template v-if="title.isConfigure">
<a-form ref="formRef" :model="data" name="basic">
<div class="bottom">
<!-- <div class="items" v-if="data[title.name].length > 0">
<div
@ -77,7 +76,6 @@
:key="'key2' + attr.name + index2"
>
<span>{{ attr.name }}</span>
<a-input
disabled
v-model:value="val[attr.field]"
@ -438,7 +436,51 @@
请选择{{ item.name }}
</div>
</div>
</a-form>
<!-- 来源应用 -->
<div class="AssociatedApplication">
<a-modal
v-model:visible="visibleAssociatedApplication"
:title="titleName"
@ok="handleOk"
@cancel="handleCancel"
style="width: 9.6rem"
>
<div>
<a-transfer
v-model:target-keys="targetKeys"
v-model:selected-keys="selectedKeys"
:data-source="mockData"
:titles="titles"
:render="(item) => item.title"
@change="handleChange"
@selectChange="handleSelectChange"
/>
</div>
</a-modal>
</div>
<!-- 关联组件 -->
<div class="AssociatedApplication">
<a-modal
v-model:visible="visibleAssociatedApplicationOther"
:title="titleName"
@ok="handleOk"
@cancel="handleCancel"
style="width: 960px"
>
<div>
<a-transfer
v-model:target-keys="targetKeysOther"
v-model:selected-keys="selectedKeysOther"
:data-source="mockDataOther"
:titles="titles"
:render="(item) => item.title"
@change="handleChangeOther"
@selectChange="handleSelectChangeOther"
/>
</div>
</a-modal>
</div>
</div>
</template>
</div>
</div>