forked from github/dataease
fix: API 数据集名称校验
This commit is contained in:
parent
8bf60e09a0
commit
f279b673e1
@ -246,7 +246,7 @@
|
|||||||
"
|
"
|
||||||
:label="$t('datasource.extra_params')"
|
:label="$t('datasource.extra_params')"
|
||||||
>
|
>
|
||||||
<el-input :placeholder="$t('fu.search_bar.please_input') + $t('datasource.extra_params')" v-model="form.configuration.extraParams" autocomplete="off" />
|
<el-input v-model="form.configuration.extraParams" :placeholder="$t('fu.search_bar.please_input') + $t('datasource.extra_params')" autocomplete="off" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@ -569,19 +569,19 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<span class="select-svg-icon">
|
<span class="select-svg-icon">
|
||||||
<span v-if="scope.row.deType === 0">
|
<span v-if="scope.row.deType === 0">
|
||||||
<svg-icon
|
<svg-icon
|
||||||
icon-class="field_text"
|
icon-class="field_text"
|
||||||
class="field-icon-text"
|
class="field-icon-text"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="[ 2, 3 ].includes(scope.row.deType)">
|
<span v-if="[ 2, 3 ].includes(scope.row.deType)">
|
||||||
<svg-icon
|
<svg-icon
|
||||||
icon-class="field_value"
|
icon-class="field_value"
|
||||||
class="field-icon-value"
|
class="field-icon-value"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -728,7 +728,8 @@ export default {
|
|||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
validator: this.nameRepeat,
|
validator: this.nameRepeat,
|
||||||
trigger: 'blur'
|
trigger: 'blur',
|
||||||
|
message: i18n.t('commons.input_name')
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
desc: [
|
desc: [
|
||||||
@ -971,20 +972,24 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
nameRepeat(rule, value, callback) {
|
nameRepeat(rule, value, callback) {
|
||||||
|
if (!value) {
|
||||||
|
callback(new Error(i18n.t('commons.input_name')))
|
||||||
|
return
|
||||||
|
}
|
||||||
let hasRepeatName = false
|
let hasRepeatName = false
|
||||||
this.form.apiConfiguration.forEach((item) => {
|
this.form.apiConfiguration.forEach((item) => {
|
||||||
if (
|
if (
|
||||||
item.name === this.apiItem.name &&
|
item.name === this.apiItem.name &&
|
||||||
item.serialNumber !== this.apiItem.serialNumber
|
item.serialNumber !== this.apiItem.serialNumber
|
||||||
) {
|
) {
|
||||||
hasRepeatName = true
|
hasRepeatName = true
|
||||||
}
|
|
||||||
})
|
|
||||||
if (hasRepeatName) {
|
|
||||||
callback(new Error(i18n.t('theme.name_repeat')));
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
callback();
|
})
|
||||||
|
if (hasRepeatName) {
|
||||||
|
callback(new Error(i18n.t('theme.name_repeat')))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback()
|
||||||
},
|
},
|
||||||
next() {
|
next() {
|
||||||
if (this.active === 1) {
|
if (this.active === 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user