bug 修复
This commit is contained in:
parent
e53c08839f
commit
2fc25ad943
@ -114,6 +114,19 @@ export default {
|
||||
},
|
||||
resetForm () {
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: null,
|
||||
userName: '',
|
||||
password: '',
|
||||
realName: '',
|
||||
role: 1,
|
||||
status: 1,
|
||||
age: '',
|
||||
sex: '',
|
||||
birthDay: null,
|
||||
phone: null,
|
||||
userLevel: null
|
||||
}
|
||||
},
|
||||
...mapActions('tagsView', { delCurrentView: 'delCurrentView' })
|
||||
},
|
||||
|
@ -105,6 +105,18 @@ export default {
|
||||
},
|
||||
resetForm () {
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: null,
|
||||
userName: '',
|
||||
password: '',
|
||||
realName: '',
|
||||
role: 2,
|
||||
status: 1,
|
||||
age: '',
|
||||
sex: '',
|
||||
birthDay: null,
|
||||
phone: null
|
||||
}
|
||||
},
|
||||
...mapActions('tagsView', { delCurrentView: 'delCurrentView' })
|
||||
},
|
||||
|
@ -13,4 +13,4 @@
|
||||
hm.src = 'https://hm.baidu.com/hm.js?cd8218cd51f800ed2b73e5751cb3f4f9'
|
||||
var s = document.getElementsByTagName('script')[0]
|
||||
s.parentNode.insertBefore(hm, s)
|
||||
})()</script><link href="static/css/chunk-0226adbc.0e1403ca.css" rel="prefetch"><link href="static/css/chunk-066bbd34.c306629d.css" rel="prefetch"><link href="static/css/chunk-111f3671.d650a2aa.css" rel="prefetch"><link href="static/css/chunk-157f9069.c306629d.css" rel="prefetch"><link href="static/css/chunk-2e16d177.89936c18.css" rel="prefetch"><link href="static/css/chunk-360c43ba.c306629d.css" rel="prefetch"><link href="static/css/chunk-42236473.c306629d.css" rel="prefetch"><link href="static/css/chunk-5bc3d75d.c306629d.css" rel="prefetch"><link href="static/css/chunk-65f8ca6f.c306629d.css" rel="prefetch"><link href="static/css/chunk-7c62808c.c306629d.css" rel="prefetch"><link href="static/css/chunk-873a42e2.1951fa25.css" rel="prefetch"><link href="static/css/chunk-a85d3c1e.c8588555.css" rel="prefetch"><link href="static/css/chunk-a9d03770.c306629d.css" rel="prefetch"><link href="static/css/chunk-bab2e2c4.c306629d.css" rel="prefetch"><link href="static/js/chunk-0226adbc.3071b86f.js" rel="prefetch"><link href="static/js/chunk-066bbd34.9cc38c25.js" rel="prefetch"><link href="static/js/chunk-111f3671.909e507c.js" rel="prefetch"><link href="static/js/chunk-157f9069.22f98a62.js" rel="prefetch"><link href="static/js/chunk-16f9edc1.5aa4242c.js" rel="prefetch"><link href="static/js/chunk-2d0c138b.ecf39624.js" rel="prefetch"><link href="static/js/chunk-2d221bd2.a1eb130a.js" rel="prefetch"><link href="static/js/chunk-2d2300ef.08e5773b.js" rel="prefetch"><link href="static/js/chunk-2d230fe7.042d38d1.js" rel="prefetch"><link href="static/js/chunk-2e16d177.7b756293.js" rel="prefetch"><link href="static/js/chunk-360c43ba.4938ad3a.js" rel="prefetch"><link href="static/js/chunk-42236473.9d2d4640.js" rel="prefetch"><link href="static/js/chunk-5bc3d75d.2d067f0e.js" rel="prefetch"><link href="static/js/chunk-65f8ca6f.154c4acf.js" rel="prefetch"><link href="static/js/chunk-733c35b2.e438819e.js" rel="prefetch"><link href="static/js/chunk-75f11c77.272c83f2.js" rel="prefetch"><link href="static/js/chunk-78234ca2.91f197ba.js" rel="prefetch"><link href="static/js/chunk-793f0082.f02cd365.js" rel="prefetch"><link href="static/js/chunk-7c62808c.3b00df5a.js" rel="prefetch"><link href="static/js/chunk-873a42e2.e5af46f0.js" rel="prefetch"><link href="static/js/chunk-a85d3c1e.8374380b.js" rel="prefetch"><link href="static/js/chunk-a9d03770.509d1df4.js" rel="prefetch"><link href="static/js/chunk-bab2e2c4.ea2bd5e5.js" rel="prefetch"><link href="static/js/chunk-d0753fda.08ab3a50.js" rel="prefetch"><link href="static/css/chunk-vendors.ee57d822.css" rel="preload" as="style"><link href="static/css/index.a92eac13.css" rel="preload" as="style"><link href="static/js/chunk-vendors.9dd0934b.js" rel="preload" as="script"><link href="static/js/index.1ee63aa8.js" rel="preload" as="script"><link href="static/css/chunk-vendors.ee57d822.css" rel="stylesheet"><link href="static/css/index.a92eac13.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-demo doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.9dd0934b.js"></script><script src="static/js/index.1ee63aa8.js"></script></body></html>
|
||||
})()</script><link href="static/css/chunk-0226adbc.0e1403ca.css" rel="prefetch"><link href="static/css/chunk-066bbd34.c306629d.css" rel="prefetch"><link href="static/css/chunk-111f3671.d650a2aa.css" rel="prefetch"><link href="static/css/chunk-157f9069.c306629d.css" rel="prefetch"><link href="static/css/chunk-2e16d177.89936c18.css" rel="prefetch"><link href="static/css/chunk-360c43ba.c306629d.css" rel="prefetch"><link href="static/css/chunk-42236473.c306629d.css" rel="prefetch"><link href="static/css/chunk-5bc3d75d.c306629d.css" rel="prefetch"><link href="static/css/chunk-65f8ca6f.c306629d.css" rel="prefetch"><link href="static/css/chunk-7c62808c.c306629d.css" rel="prefetch"><link href="static/css/chunk-873a42e2.1951fa25.css" rel="prefetch"><link href="static/css/chunk-a85d3c1e.c8588555.css" rel="prefetch"><link href="static/css/chunk-a9d03770.c306629d.css" rel="prefetch"><link href="static/css/chunk-bab2e2c4.c306629d.css" rel="prefetch"><link href="static/js/chunk-0226adbc.ed97c169.js" rel="prefetch"><link href="static/js/chunk-066bbd34.91030c29.js" rel="prefetch"><link href="static/js/chunk-111f3671.b0721425.js" rel="prefetch"><link href="static/js/chunk-157f9069.b411c825.js" rel="prefetch"><link href="static/js/chunk-16f9edc1.36e9abae.js" rel="prefetch"><link href="static/js/chunk-2d0c138b.6caad011.js" rel="prefetch"><link href="static/js/chunk-2d221bd2.027ca0c1.js" rel="prefetch"><link href="static/js/chunk-2d2300ef.75ffb12d.js" rel="prefetch"><link href="static/js/chunk-2d230fe7.042d38d1.js" rel="prefetch"><link href="static/js/chunk-2e16d177.b807c153.js" rel="prefetch"><link href="static/js/chunk-360c43ba.08a07924.js" rel="prefetch"><link href="static/js/chunk-42236473.afd7551e.js" rel="prefetch"><link href="static/js/chunk-5bc3d75d.96297855.js" rel="prefetch"><link href="static/js/chunk-65f8ca6f.613ad07f.js" rel="prefetch"><link href="static/js/chunk-733c35b2.0cacbacb.js" rel="prefetch"><link href="static/js/chunk-75f11c77.90c8aa97.js" rel="prefetch"><link href="static/js/chunk-78234ca2.8d4ad1f0.js" rel="prefetch"><link href="static/js/chunk-793f0082.b12acfd1.js" rel="prefetch"><link href="static/js/chunk-7c62808c.c9ea7dc2.js" rel="prefetch"><link href="static/js/chunk-873a42e2.6bdf3d29.js" rel="prefetch"><link href="static/js/chunk-a85d3c1e.aab8c085.js" rel="prefetch"><link href="static/js/chunk-a9d03770.df4491e4.js" rel="prefetch"><link href="static/js/chunk-bab2e2c4.8bf6ece2.js" rel="prefetch"><link href="static/js/chunk-d0753fda.5d9490bd.js" rel="prefetch"><link href="static/css/chunk-vendors.ee57d822.css" rel="preload" as="style"><link href="static/css/index.a92eac13.css" rel="preload" as="style"><link href="static/js/chunk-vendors.9dd0934b.js" rel="preload" as="script"><link href="static/js/index.4bb8b1e2.js" rel="preload" as="script"><link href="static/css/chunk-vendors.ee57d822.css" rel="stylesheet"><link href="static/css/index.a92eac13.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-demo doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.9dd0934b.js"></script><script src="static/js/index.4bb8b1e2.js"></script></body></html>
|
@ -1 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d221bd2"],{cc40:function(e,r,t){"use strict";t.r(r);var l=function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"app-container"},[t("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.formLoading,expression:"formLoading"}],ref:"form",attrs:{model:e.form,"label-width":"100px",rules:e.rules}},[t("el-form-item",{attrs:{label:"用户名:",prop:"userName",required:""}},[t("el-input",{model:{value:e.form.userName,callback:function(r){e.$set(e.form,"userName",r)},expression:"form.userName"}})],1),t("el-form-item",{attrs:{label:"密码:",required:""}},[t("el-input",{model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}})],1),t("el-form-item",{attrs:{label:"真实姓名:",prop:"realName",required:""}},[t("el-input",{model:{value:e.form.realName,callback:function(r){e.$set(e.form,"realName",r)},expression:"form.realName"}})],1),t("el-form-item",{attrs:{label:"年龄:"}},[t("el-input",{model:{value:e.form.age,callback:function(r){e.$set(e.form,"age",r)},expression:"form.age"}})],1),t("el-form-item",{attrs:{label:"性别:"}},[t("el-select",{attrs:{placeholder:"性别",clearable:""},model:{value:e.form.sex,callback:function(r){e.$set(e.form,"sex",r)},expression:"form.sex"}},e._l(e.sexEnum,(function(e){return t("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),t("el-form-item",{attrs:{label:"出生日期:"}},[t("el-date-picker",{attrs:{type:"date",placeholder:"选择日期"},model:{value:e.form.birthDay,callback:function(r){e.$set(e.form,"birthDay",r)},expression:"form.birthDay"}})],1),t("el-form-item",{attrs:{label:"手机:"}},[t("el-input",{model:{value:e.form.phone,callback:function(r){e.$set(e.form,"phone",r)},expression:"form.phone"}})],1),t("el-form-item",{attrs:{label:"年级:",prop:"userLevel",required:""}},[t("el-select",{attrs:{placeholder:"年级"},model:{value:e.form.userLevel,callback:function(r){e.$set(e.form,"userLevel",r)},expression:"form.userLevel"}},e._l(e.levelEnum,(function(e){return t("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),t("el-form-item",{attrs:{label:"状态:",required:""}},[t("el-select",{attrs:{placeholder:"状态"},model:{value:e.form.status,callback:function(r){e.$set(e.form,"status",r)},expression:"form.status"}},e._l(e.statusEnum,(function(e){return t("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("提交")]),t("el-button",{on:{click:e.resetForm}},[e._v("重置")])],1)],1)],1)},a=[],o=t("5530"),s=t("2f62"),n=t("c24f"),u={data:function(){return{form:{id:null,userName:"",password:"",realName:"",role:1,status:1,age:"",sex:"",birthDay:null,phone:null,userLevel:null},formLoading:!1,rules:{userName:[{required:!0,message:"请输入用户名",trigger:"blur"}],realName:[{required:!0,message:"请输入真实姓名",trigger:"blur"}],userLevel:[{required:!0,message:"请选择年级",trigger:"change"}]}}},created:function(){var e=this.$route.query.id,r=this;e&&0!==parseInt(e)&&(r.formLoading=!0,n["a"].selectUser(e).then((function(e){r.form=e.response,r.formLoading=!1})))},methods:Object(o["a"])({submitForm:function(){var e=this,r=this;this.$refs.form.validate((function(t){if(!t)return!1;e.formLoading=!0,n["a"].createUser(e.form).then((function(e){1===e.code?(r.$message.success(e.message),r.delCurrentView(r).then((function(){r.$router.push("/user/student/list")}))):(r.$message.error(e.message),r.formLoading=!1)})).catch((function(e){r.formLoading=!1}))}))},resetForm:function(){this.$refs["form"].resetFields()}},Object(s["b"])("tagsView",{delCurrentView:"delCurrentView"})),computed:Object(o["a"])(Object(o["a"])({},Object(s["c"])("enumItem",["enumFormat"])),Object(s["e"])("enumItem",{sexEnum:function(e){return e.user.sexEnum},roleEnum:function(e){return e.user.roleEnum},statusEnum:function(e){return e.user.statusEnum},levelEnum:function(e){return e.user.levelEnum}}))},m=u,i=t("2877"),c=Object(i["a"])(m,l,a,!1,null,null,null);r["default"]=c.exports}}]);
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d221bd2"],{cc40:function(e,r,t){"use strict";t.r(r);var l=function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"app-container"},[t("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.formLoading,expression:"formLoading"}],ref:"form",attrs:{model:e.form,"label-width":"100px",rules:e.rules}},[t("el-form-item",{attrs:{label:"用户名:",prop:"userName",required:""}},[t("el-input",{model:{value:e.form.userName,callback:function(r){e.$set(e.form,"userName",r)},expression:"form.userName"}})],1),t("el-form-item",{attrs:{label:"密码:",required:""}},[t("el-input",{model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}})],1),t("el-form-item",{attrs:{label:"真实姓名:",prop:"realName",required:""}},[t("el-input",{model:{value:e.form.realName,callback:function(r){e.$set(e.form,"realName",r)},expression:"form.realName"}})],1),t("el-form-item",{attrs:{label:"年龄:"}},[t("el-input",{model:{value:e.form.age,callback:function(r){e.$set(e.form,"age",r)},expression:"form.age"}})],1),t("el-form-item",{attrs:{label:"性别:"}},[t("el-select",{attrs:{placeholder:"性别",clearable:""},model:{value:e.form.sex,callback:function(r){e.$set(e.form,"sex",r)},expression:"form.sex"}},e._l(e.sexEnum,(function(e){return t("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),t("el-form-item",{attrs:{label:"出生日期:"}},[t("el-date-picker",{attrs:{type:"date",placeholder:"选择日期"},model:{value:e.form.birthDay,callback:function(r){e.$set(e.form,"birthDay",r)},expression:"form.birthDay"}})],1),t("el-form-item",{attrs:{label:"手机:"}},[t("el-input",{model:{value:e.form.phone,callback:function(r){e.$set(e.form,"phone",r)},expression:"form.phone"}})],1),t("el-form-item",{attrs:{label:"年级:",prop:"userLevel",required:""}},[t("el-select",{attrs:{placeholder:"年级"},model:{value:e.form.userLevel,callback:function(r){e.$set(e.form,"userLevel",r)},expression:"form.userLevel"}},e._l(e.levelEnum,(function(e){return t("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),t("el-form-item",{attrs:{label:"状态:",required:""}},[t("el-select",{attrs:{placeholder:"状态"},model:{value:e.form.status,callback:function(r){e.$set(e.form,"status",r)},expression:"form.status"}},e._l(e.statusEnum,(function(e){return t("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("提交")]),t("el-button",{on:{click:e.resetForm}},[e._v("重置")])],1)],1)],1)},a=[],s=t("5530"),o=t("2f62"),n=t("c24f"),u={data:function(){return{form:{id:null,userName:"",password:"",realName:"",role:1,status:1,age:"",sex:"",birthDay:null,phone:null,userLevel:null},formLoading:!1,rules:{userName:[{required:!0,message:"请输入用户名",trigger:"blur"}],realName:[{required:!0,message:"请输入真实姓名",trigger:"blur"}],userLevel:[{required:!0,message:"请选择年级",trigger:"change"}]}}},created:function(){var e=this.$route.query.id,r=this;e&&0!==parseInt(e)&&(r.formLoading=!0,n["a"].selectUser(e).then((function(e){r.form=e.response,r.formLoading=!1})))},methods:Object(s["a"])({submitForm:function(){var e=this,r=this;this.$refs.form.validate((function(t){if(!t)return!1;e.formLoading=!0,n["a"].createUser(e.form).then((function(e){1===e.code?(r.$message.success(e.message),r.delCurrentView(r).then((function(){r.$router.push("/user/student/list")}))):(r.$message.error(e.message),r.formLoading=!1)})).catch((function(e){r.formLoading=!1}))}))},resetForm:function(){this.$refs["form"].resetFields(),this.form={id:null,userName:"",password:"",realName:"",role:1,status:1,age:"",sex:"",birthDay:null,phone:null,userLevel:null}}},Object(o["b"])("tagsView",{delCurrentView:"delCurrentView"})),computed:Object(s["a"])(Object(s["a"])({},Object(o["c"])("enumItem",["enumFormat"])),Object(o["e"])("enumItem",{sexEnum:function(e){return e.user.sexEnum},roleEnum:function(e){return e.user.roleEnum},statusEnum:function(e){return e.user.statusEnum},levelEnum:function(e){return e.user.levelEnum}}))},m=u,i=t("2877"),f=Object(i["a"])(m,l,a,!1,null,null,null);r["default"]=f.exports}}]);
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user