Commit 8a4f9fc0 authored by levante's avatar levante

finish all features

parent 0d965ac4
......@@ -116,7 +116,7 @@
'path',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
rules: [{validator: pathValidate}]
}
]"
/>
......@@ -239,6 +239,19 @@ export default {
this.getBusinessOptions()
},
methods: {
pathValidate(t, value, callback) {
console.log(t, value, callback)
if (!value || value == undefined) {
callback('请填写此项')
} else {
if (!value.startsWith('/')) {
callback('请输入正确的路径!')
} else{
callback()
}
}
},
onEdit(id) {
this.rowLoop = [{
name: '',
......
......@@ -171,8 +171,8 @@
'callBackPath',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
rules: [{validator: pathValidate}]
},
]"
/>
</a-form-item>
......@@ -290,6 +290,19 @@ export default {
this.getBusinessOptions()
},
methods: {
pathValidate(t, value, callback) {
console.log(t, value, callback)
if (!value || value == undefined) {
callback('请填写此项')
} else {
if (!value.startsWith('/')) {
callback('请输入正确的路径!')
} else{
callback()
}
}
},
cancelModal() {
this.form.resetFields()
this.current = 0
......@@ -419,7 +432,6 @@ export default {
this.form.validateFields((err, values) => {
if (!err) {
let formContent = this.form.getFieldsValue()
// console.log(formContent)
let paramsJson = []
let finalParse = {}
......
......@@ -41,7 +41,7 @@
</a-form-item>
<a-form-item label="系统地址" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input v-decorator="['url', {validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}, {validator: formatValidate}]}]" />
<a-input v-decorator="['url', {validateTrigger:'blur', rules: [{validator: urlValidate}]}]" />
</a-form-item>
</div>
<div v-show="current == 1">
......@@ -52,7 +52,7 @@
</a-form-item>
<a-form-item label="授权路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input v-decorator="['authPath', {validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
<a-input v-decorator="['authPath', {validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}, {validator: pathValidate}]}]" />
</a-form-item>
<a-form-item label="授权方法" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
......@@ -210,12 +210,36 @@ export default {
this.getList()
},
methods: {
formatValidate(type, value, callback) {
console.log(type, value)
urlValidate(type, value, callback) {
const filter = /^[A-Za-z]:[\w]+$/i
if(!filter.test(value)){
const regex = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/|www\.)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/
if (!value || value == undefined) {
callback('请填写此项')
} else {
if (!regex.test(value)) {
callback('请输入正确的地址!')
} else{
callback()
}
}
// if(!value.startsWith('/')) {
// callback('请输入正确的路径!')
// }
},
pathValidate(t, value, callback) {
console.log(t, value, callback)
if (!value || value == undefined) {
callback('请填写此项')
} else {
if (!value.startsWith('/')) {
callback('请输入正确的路径!')
} else{
callback()
}
}
},
cancelModal() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment