diff --git a/back/src/views/modules/ability/knowledgeBase.vue b/back/src/views/modules/ability/knowledgeBase.vue
index 6860184a..8e52de71 100644
--- a/back/src/views/modules/ability/knowledgeBase.vue
+++ b/back/src/views/modules/ability/knowledgeBase.vue
@@ -28,14 +28,14 @@
重置
-
+
-
-
+
+
@@ -45,8 +45,7 @@
-
+
{{ $t('update') }}
@@ -392,26 +391,21 @@ export default {
this.submitFrom.infoList = this.submitFrom.infoList.sort(
(a, b) => arr.indexOf(a.attrType) - arr.indexOf(b.attrType)
)
- this.submitFrom.infoList.forEach(v => {
- if (v.attrType == '知识库类型') {
- v.attrValue = v.attrValue || this.radio
+ // 去重
+ const newArr = this.submitFrom.infoList.filter(
+ (element, index, self) => {
+ return (
+ self.findIndex((x) => x.attrType === element.attrType) === index
+ )
}
- })
+ )
+ this.submitFrom.infoList = newArr
console.log('this.submitFrom-----表单提交------->', this.submitFrom.infoList);
this.notFilled = []
if (!this.submitFrom.name) {
this.notFilled.push('标准名称')
this.notFilled.push('模型名称')
}
- // if (this.radio === '智能算法' && !this.submitFrom.apiMethodType) {
- // if ((this.submitFrom.infoList.filter(val => val.attrType === '使用方式')[0].attrValue === '调用接口')) {
- // this.notFilled.push('接口请求方式')
- // }
- // }
- // if (this.radio === '智能算法' && (!this.submitFrom.infoList.filter(val => val.attrType === '算法类别')[0] || !this.submitFrom.infoList.filter(val => val.attrType === '算法类别')[0].attrValue)) {
- // this.notFilled.push('算法类别')
- // }
- // console.log(this.submitFrom, this.notFilled, '表单验证')
if (this.notFilled.length > 0) {
this.$message({
message: '请填写必填字段!',
@@ -426,7 +420,6 @@ export default {
}
})
console.log('编辑===============>', this.submitFrom)
- console.log(this.submitFrom.infoList, '===============abc')
// 去重
const newArr = this.submitFrom.infoList.filter(
(element, index, self) => {