【fix ESLint】src/views/system/modules
This commit is contained in:
@@ -104,6 +104,7 @@ export default {
|
||||
validator: (rule, value, callback) => {
|
||||
const pattern = /^[a-z|A-Z][a-z|A-Z\d_-]{0,}$/
|
||||
if (!pattern.test(value)) {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('编码必须以字母开头,可包含数字、下划线、横杠')
|
||||
} else {
|
||||
validateDuplicateValue('sys_data_source', 'code', value, this.model.id, callback)
|
||||
@@ -244,12 +245,12 @@ export default {
|
||||
// 获取以上字段的值,并清除校验状态
|
||||
const fieldsValues = this.form.getFieldsValue(keys)
|
||||
const setFields = {}
|
||||
keys.forEach(key => setFields[key] = { value: fieldsValues[key], errors: null })
|
||||
keys.forEach(key => (setFields[key] = { value: fieldsValues[key], errors: null }))
|
||||
// 清除校验状态,目的是可以让错误文字闪烁
|
||||
this.form.setFields(setFields)
|
||||
// 重新校验
|
||||
this.$nextTick(() => {
|
||||
this.form.validateFields(keys, (errors, values) => {
|
||||
this.form.validateFields(keys, (errors/* , values */) => {
|
||||
if (!errors) {
|
||||
const loading = this.$message.loading('连接中……', 0)
|
||||
postAction('/online/cgreport/api/testConnection', fieldsValues).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user