xy 1 year ago
parent 784b18d6a5
commit 6e0c161835

@ -1005,12 +1005,13 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
click: (_) => { click: (_) => {
this.vanCalendarOption.forFormName = info.name; this.vanCalendarOption.forFormName = info.name;
this.vanCalendarOption.originalObj = row; this.vanCalendarOption.originalObj = row;
this.$set(this.vanCalendarOption, "isShow", true); this.vanCalendarOption.isShow = true;
}, },
}, },
}); });
break; break;
case "datetime": case "datetime":
console.log(3345, this.rules[info.name])
formItem = h("van-field", { formItem = h("van-field", {
props: { props: {
readonly: true, readonly: true,
@ -1027,7 +1028,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
click: (_) => { click: (_) => {
this.vanTimePickerOption.forFormName = info.name; this.vanTimePickerOption.forFormName = info.name;
this.vanTimePickerOption.originalObj = row; this.vanTimePickerOption.originalObj = row;
this.$set(this.vanTimePickerOption, "isShow", true); this.vanTimePickerOption.isShow = true
}, },
}, },
}); });
@ -1054,7 +1055,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
this.vanPopupOption.forFormName = info.name; this.vanPopupOption.forFormName = info.name;
this.vanPopupOption.originalObj = row; this.vanPopupOption.originalObj = row;
this.$set(this.vanPopupOption, "columns", options); this.$set(this.vanPopupOption, "columns", options);
this.$set(this.vanPopupOption, "isShow", true); this.vanPopupOption.isShow = true;
}, },
}, },
}); });
@ -1090,7 +1091,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
value: 'id' value: 'id'
}); });
this.$set(this.multipleSelectOption, "multipleLimit", info.multiple); this.$set(this.multipleSelectOption, "multipleLimit", info.multiple);
this.$set(this.multipleSelectOption, "isShow", true); this.multipleSelectOption.isShow = true;
}, },
}, },
}); });
@ -1256,7 +1257,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
value: 'id' value: 'id'
}); });
this.$set(this.multipleSelectOption, "multipleLimit", info.multiple); this.$set(this.multipleSelectOption, "multipleLimit", info.multiple);
this.$set(this.multipleSelectOption, "isShow", true); this.multipleSelectOption.isShow = true
}, },
}, },
}); });

@ -41,6 +41,7 @@ service.interceptors.request.use(
// do something with request error // do something with request error
console.log(error) // for debug console.log(error) // for debug
Vue.prototype.$nextTick().then(r => loadingInstance?.close()) Vue.prototype.$nextTick().then(r => loadingInstance?.close())
parent?._addError(error, 'axios-request', error.config.params||error.config.data)
return Promise.reject(error) return Promise.reject(error)
} }
) )
@ -85,8 +86,12 @@ service.interceptors.response.use(
store.dispatch('user/resetToken').then(() => { store.dispatch('user/resetToken').then(() => {
location.reload() location.reload()
}) })
if (window._IN_IFRAME) {
parent?._logout()
}
}) })
} }
parent?._addError(res.msg, `axios-response ${response.config.url}`, response.config.params || response.config.data)
return Promise.reject(new Error(res.msg || 'Error')) return Promise.reject(new Error(res.msg || 'Error'))
} else { } else {
return res.data return res.data
@ -100,6 +105,7 @@ service.interceptors.response.use(
type: 'error', type: 'error',
duration: 5 * 1000 duration: 5 * 1000
}) })
parent?._addError(error.toString(), `axios-request ${error.config.url}`, error.config.params || error.config.data)
return Promise.reject(error) return Promise.reject(error)
} }
) )

@ -146,6 +146,7 @@ export default {
return h('div',[ return h('div',[
h('van-form',{ h('van-form',{
props: { props: {
'validate-first': true,
'scroll-to-error': true 'scroll-to-error': true
} }
},authFields.map(field => formBuilder.bind(this)(this.device, field, h))), },authFields.map(field => formBuilder.bind(this)(this.device, field, h))),

Loading…
Cancel
Save