fix:知识库类型重复bug
This commit is contained in:
parent
1a300b0ce7
commit
8bbeadbdc8
|
@ -28,14 +28,14 @@
|
|||
<el-button @click="reset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" :key="Math.random()"
|
||||
style="width: 100%" height="650px">
|
||||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle"
|
||||
:key="Math.random()" style="width: 100%" height="650px">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50">
|
||||
</el-table-column>
|
||||
<af-table-column :show-overflow-tooltip="true" width="280" prop="name" label="名称"
|
||||
header-align="center" align="center"></af-table-column>
|
||||
<af-table-column :show-overflow-tooltip="true" prop="description" label="描述"
|
||||
header-align="center" align="center"></af-table-column>
|
||||
<af-table-column :show-overflow-tooltip="true" width="280" prop="name" label="名称" header-align="center"
|
||||
align="center"></af-table-column>
|
||||
<af-table-column :show-overflow-tooltip="true" prop="description" label="描述" header-align="center"
|
||||
align="center"></af-table-column>
|
||||
<template v-if="dataList[0] && dataList[0].infoList2">
|
||||
<af-table-column :show-overflow-tooltip="true" width="280" v-for="(item, index) in dataList[0].infoList2"
|
||||
:key="index" :label="item.attrType" header-align="center" align="center">
|
||||
|
@ -45,8 +45,7 @@
|
|||
</af-table-column>
|
||||
</template>
|
||||
|
||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center"
|
||||
width="150">
|
||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="$hasPermission('ability:knowledgeBase:update')" type="text" size="small"
|
||||
@click="UpdateData(scope.row)">{{ $t('update') }}</el-button>
|
||||
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue