|
@@ -90,15 +90,22 @@ export default {
|
|
|
...mapActions(['setlan', 'landown', 'lanup', 'lanquery']),
|
|
|
// 提交数据
|
|
|
async onSubmit () {
|
|
|
+ const doSubmit = async () => {
|
|
|
+ const res = await this.setlan(this.ruleForm)
|
|
|
+ if (res && res.errcode === 0) {
|
|
|
+ this.$message.success('设置成功')
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
if (!valid) return false
|
|
|
- this.$refs.range.validate(async (valid) => {
|
|
|
- if (!valid) return false
|
|
|
- const res = await this.setlan(this.ruleForm)
|
|
|
- if (res && res.errcode === 0) {
|
|
|
- this.$message.success('设置成功')
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.ruleForm.type === '0') {
|
|
|
+ this.$refs.range.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ await doSubmit()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ await doSubmit()
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
// 重启网卡 (先调用停止,在调用启动)
|