修复日期选择bug

This commit is contained in:
alvis 2020-12-09 10:02:43 +08:00
parent 16f476e84f
commit 4661a5aa5c
4 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@
</el-select>
</el-form-item>
<el-form-item label="出生日期:">
<el-date-picker v-model="form.birthDay" type="date" placeholder="选择日期"/>
<el-date-picker v-model="form.birthDay" value-format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="手机:">
<el-input v-model="form.phone"></el-input>

View File

@ -14,4 +14,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-099b9c43.1951fa25.css" rel="prefetch"><link href="static/css/chunk-122e80b5.dd8c5d56.css" rel="prefetch"><link href="static/css/chunk-1b8c8b54.b56209ba.css" rel="prefetch"><link href="static/css/chunk-1d601c29.dd8c5d56.css" rel="prefetch"><link href="static/css/chunk-26bf5f94.eec97ea9.css" rel="prefetch"><link href="static/css/chunk-31aa2150.ad364b97.css" rel="prefetch"><link href="static/css/chunk-604488bc.f72e8178.css" rel="prefetch"><link href="static/css/chunk-66bf5956.dd8c5d56.css" rel="prefetch"><link href="static/css/chunk-69a4052e.54efd6ce.css" rel="prefetch"><link href="static/css/chunk-7e275898.4fbbf1ef.css" rel="prefetch"><link href="static/css/chunk-912d804c.dd8c5d56.css" rel="prefetch"><link href="static/js/chunk-099b9c43.4d7210ec.js" rel="prefetch"><link href="static/js/chunk-122e80b5.500f5349.js" rel="prefetch"><link href="static/js/chunk-1b8c8b54.67fd14c2.js" rel="prefetch"><link href="static/js/chunk-1d601c29.67af9a17.js" rel="prefetch"><link href="static/js/chunk-26bf5f94.ed27c2e4.js" rel="prefetch"><link href="static/js/chunk-2d20f362.c8e16fe2.js" rel="prefetch"><link href="static/js/chunk-31aa2150.1c86a23d.js" rel="prefetch"><link href="static/js/chunk-604488bc.5627acb5.js" rel="prefetch"><link href="static/js/chunk-66bf5956.d19ba67a.js" rel="prefetch"><link href="static/js/chunk-69a4052e.c3181827.js" rel="prefetch"><link href="static/js/chunk-7e275898.51525961.js" rel="prefetch"><link href="static/js/chunk-912d804c.d4e349b9.js" rel="prefetch"><link href="static/js/chunk-ce360eb2.4fb55e2e.js" rel="prefetch"><link href="static/css/chunk-vendors.4bd9a591.css" rel="preload" as="style"><link href="static/css/index.f1742efb.css" rel="preload" as="style"><link href="static/js/chunk-vendors.e5484d17.js" rel="preload" as="script"><link href="static/js/index.7c98b514.js" rel="preload" as="script"><link href="static/css/chunk-vendors.4bd9a591.css" rel="stylesheet"><link href="static/css/index.f1742efb.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.e5484d17.js"></script><script src="static/js/index.7c98b514.js"></script></body></html>
})()</script><link href="static/css/chunk-099b9c43.1951fa25.css" rel="prefetch"><link href="static/css/chunk-122e80b5.dd8c5d56.css" rel="prefetch"><link href="static/css/chunk-1b8c8b54.b56209ba.css" rel="prefetch"><link href="static/css/chunk-1d601c29.dd8c5d56.css" rel="prefetch"><link href="static/css/chunk-26bf5f94.eec97ea9.css" rel="prefetch"><link href="static/css/chunk-31aa2150.ad364b97.css" rel="prefetch"><link href="static/css/chunk-604488bc.f72e8178.css" rel="prefetch"><link href="static/css/chunk-66bf5956.dd8c5d56.css" rel="prefetch"><link href="static/css/chunk-69a4052e.54efd6ce.css" rel="prefetch"><link href="static/css/chunk-7e275898.4fbbf1ef.css" rel="prefetch"><link href="static/css/chunk-912d804c.dd8c5d56.css" rel="prefetch"><link href="static/js/chunk-099b9c43.4d7210ec.js" rel="prefetch"><link href="static/js/chunk-122e80b5.500f5349.js" rel="prefetch"><link href="static/js/chunk-1b8c8b54.67fd14c2.js" rel="prefetch"><link href="static/js/chunk-1d601c29.67af9a17.js" rel="prefetch"><link href="static/js/chunk-26bf5f94.ed27c2e4.js" rel="prefetch"><link href="static/js/chunk-2d20f362.38b62898.js" rel="prefetch"><link href="static/js/chunk-31aa2150.1c86a23d.js" rel="prefetch"><link href="static/js/chunk-604488bc.5627acb5.js" rel="prefetch"><link href="static/js/chunk-66bf5956.d19ba67a.js" rel="prefetch"><link href="static/js/chunk-69a4052e.c3181827.js" rel="prefetch"><link href="static/js/chunk-7e275898.51525961.js" rel="prefetch"><link href="static/js/chunk-912d804c.d4e349b9.js" rel="prefetch"><link href="static/js/chunk-ce360eb2.4fb55e2e.js" rel="prefetch"><link href="static/css/chunk-vendors.4bd9a591.css" rel="preload" as="style"><link href="static/css/index.f1742efb.css" rel="preload" as="style"><link href="static/js/chunk-vendors.e5484d17.js" rel="preload" as="script"><link href="static/js/index.f1faa097.js" rel="preload" as="script"><link href="static/css/chunk-vendors.4bd9a591.css" rel="stylesheet"><link href="static/css/index.f1742efb.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.e5484d17.js"></script><script src="static/js/index.f1faa097.js"></script></body></html>

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d20f362"],{b350:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-contain",staticStyle:{"margin-top":"10px"}},[r("el-row",{attrs:{gutter:50}},[r("el-col",{attrs:{span:7}},[r("el-card",[r("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[r("span",[e._v("个人信息")])]),r("el-row",{staticStyle:{"text-align":"center"}},[r("el-upload",{attrs:{action:"/api/student/upload/image",accept:".jpg,.png","show-file-list":!1,"on-success":e.uploadSuccess}},[r("el-avatar",{staticClass:"el-dropdown-avatar",attrs:{size:100,src:null===e.form.imagePath?a("1195"):e.form.imagePath}})],1)],1),r("el-row",{staticClass:"user-info-userName"},[r("label",[e._v(e._s(e.form.userName))])]),r("el-divider"),r("el-row",{staticClass:"user-info-fullInfo"},[r("label",[e._v("姓名:"+e._s(e.form.realName))]),r("br"),r("label",[e._v("年级:"+e._s(e.levelFormatter(e.form.userLevel)))]),r("br"),r("label",[e._v("注册时间:"+e._s(e.form.createTime))]),r("br")])],1)],1),r("el-col",{attrs:{span:17}},[r("el-card",{attrs:{shadow:"hover"}},[r("el-tabs",{attrs:{"active-name":"event",type:"card"}},[r("el-tab-pane",{attrs:{label:"用户动态",name:"event"}},[r("div",{staticClass:"block"},[r("el-timeline",e._l(e.event,(function(t){return r("el-timeline-item",{key:t.id,attrs:{timestamp:t.createTime,placement:"top"}},[r("el-card",[r("p",[e._v(e._s(t.content))])])],1)})),1)],1)]),r("el-tab-pane",{attrs:{label:"个人资料修改",name:"update"}},[r("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}},[r("el-form-item",{attrs:{label:"真实姓名:",prop:"realName",required:""}},[r("el-input",{model:{value:e.form.realName,callback:function(t){e.$set(e.form,"realName",t)},expression:"form.realName"}})],1),r("el-form-item",{attrs:{label:"年龄:"}},[r("el-input",{model:{value:e.form.age,callback:function(t){e.$set(e.form,"age",t)},expression:"form.age"}})],1),r("el-form-item",{attrs:{label:"性别:"}},[r("el-select",{attrs:{placeholder:"性别",clearable:""},model:{value:e.form.sex,callback:function(t){e.$set(e.form,"sex",t)},expression:"form.sex"}},e._l(e.sexEnum,(function(e){return r("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),r("el-form-item",{attrs:{label:"出生日期:"}},[r("el-date-picker",{attrs:{type:"date",placeholder:"选择日期"},model:{value:e.form.birthDay,callback:function(t){e.$set(e.form,"birthDay",t)},expression:"form.birthDay"}})],1),r("el-form-item",{attrs:{label:"手机:"}},[r("el-input",{model:{value:e.form.phone,callback:function(t){e.$set(e.form,"phone",t)},expression:"form.phone"}})],1),r("el-form-item",{attrs:{label:"年级:",prop:"userLevel",required:""}},[r("el-select",{attrs:{placeholder:"年级"},model:{value:e.form.userLevel,callback:function(t){e.$set(e.form,"userLevel",t)},expression:"form.userLevel"}},e._l(e.levelEnum,(function(e){return r("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("更新")])],1)],1)],1)],1)],1)],1)],1)],1)},l=[],s=a("5530"),o=a("c24f"),n=a("2f62"),i={data:function(){return{event:[],form:{userName:"",realName:"",age:"",sex:"",birthDay:null,phone:null,userLevel:null,createTime:null,imagePath:null},formLoading:!1,rules:{realName:[{required:!0,message:"请输入真实姓名",trigger:"blur"}],userLevel:[{required:!0,message:"请选择年级",trigger:"change"}]}}},created:function(){var e=this;o["a"].getUserEvent().then((function(t){e.event=t.response})),o["a"].getCurrentUser().then((function(t){e.form=t.response}))},methods:{uploadSuccess:function(e,t){1===e.code?window.location.reload():this.$message.error(e.message)},submitForm:function(){var e=this,t=this;this.$refs.form.validate((function(a){if(!a)return!1;e.formLoading=!0,o["a"].update(e.form).then((function(e){1===e.code?t.$message.success(e.message):t.$message.error(e.message),t.formLoading=!1})).catch((function(e){t.formLoading=!1}))}))},levelFormatter:function(e){return this.enumFormat(this.levelEnum,e)}},computed:Object(s["a"])(Object(s["a"])({},Object(n["c"])("enumItem",["enumFormat"])),Object(n["e"])("enumItem",{sexEnum:function(e){return e.user.sexEnum},levelEnum:function(e){return e.user.levelEnum}}))},m=i,u=a("2877"),c=Object(u["a"])(m,r,l,!1,null,"3c626c3e",null);t["default"]=c.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d20f362"],{b350:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-contain",staticStyle:{"margin-top":"10px"}},[r("el-row",{attrs:{gutter:50}},[r("el-col",{attrs:{span:7}},[r("el-card",[r("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[r("span",[e._v("个人信息")])]),r("el-row",{staticStyle:{"text-align":"center"}},[r("el-upload",{attrs:{action:"/api/student/upload/image",accept:".jpg,.png","show-file-list":!1,"on-success":e.uploadSuccess}},[r("el-avatar",{staticClass:"el-dropdown-avatar",attrs:{size:100,src:null===e.form.imagePath?a("1195"):e.form.imagePath}})],1)],1),r("el-row",{staticClass:"user-info-userName"},[r("label",[e._v(e._s(e.form.userName))])]),r("el-divider"),r("el-row",{staticClass:"user-info-fullInfo"},[r("label",[e._v("姓名:"+e._s(e.form.realName))]),r("br"),r("label",[e._v("年级:"+e._s(e.levelFormatter(e.form.userLevel)))]),r("br"),r("label",[e._v("注册时间:"+e._s(e.form.createTime))]),r("br")])],1)],1),r("el-col",{attrs:{span:17}},[r("el-card",{attrs:{shadow:"hover"}},[r("el-tabs",{attrs:{"active-name":"event",type:"card"}},[r("el-tab-pane",{attrs:{label:"用户动态",name:"event"}},[r("div",{staticClass:"block"},[r("el-timeline",e._l(e.event,(function(t){return r("el-timeline-item",{key:t.id,attrs:{timestamp:t.createTime,placement:"top"}},[r("el-card",[r("p",[e._v(e._s(t.content))])])],1)})),1)],1)]),r("el-tab-pane",{attrs:{label:"个人资料修改",name:"update"}},[r("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}},[r("el-form-item",{attrs:{label:"真实姓名:",prop:"realName",required:""}},[r("el-input",{model:{value:e.form.realName,callback:function(t){e.$set(e.form,"realName",t)},expression:"form.realName"}})],1),r("el-form-item",{attrs:{label:"年龄:"}},[r("el-input",{model:{value:e.form.age,callback:function(t){e.$set(e.form,"age",t)},expression:"form.age"}})],1),r("el-form-item",{attrs:{label:"性别:"}},[r("el-select",{attrs:{placeholder:"性别",clearable:""},model:{value:e.form.sex,callback:function(t){e.$set(e.form,"sex",t)},expression:"form.sex"}},e._l(e.sexEnum,(function(e){return r("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),r("el-form-item",{attrs:{label:"出生日期:"}},[r("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"选择日期"},model:{value:e.form.birthDay,callback:function(t){e.$set(e.form,"birthDay",t)},expression:"form.birthDay"}})],1),r("el-form-item",{attrs:{label:"手机:"}},[r("el-input",{model:{value:e.form.phone,callback:function(t){e.$set(e.form,"phone",t)},expression:"form.phone"}})],1),r("el-form-item",{attrs:{label:"年级:",prop:"userLevel",required:""}},[r("el-select",{attrs:{placeholder:"年级"},model:{value:e.form.userLevel,callback:function(t){e.$set(e.form,"userLevel",t)},expression:"form.userLevel"}},e._l(e.levelEnum,(function(e){return r("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("更新")])],1)],1)],1)],1)],1)],1)],1)],1)},l=[],s=a("5530"),o=a("c24f"),n=a("2f62"),i={data:function(){return{event:[],form:{userName:"",realName:"",age:"",sex:"",birthDay:null,phone:null,userLevel:null,createTime:null,imagePath:null},formLoading:!1,rules:{realName:[{required:!0,message:"请输入真实姓名",trigger:"blur"}],userLevel:[{required:!0,message:"请选择年级",trigger:"change"}]}}},created:function(){var e=this;o["a"].getUserEvent().then((function(t){e.event=t.response})),o["a"].getCurrentUser().then((function(t){e.form=t.response}))},methods:{uploadSuccess:function(e,t){1===e.code?window.location.reload():this.$message.error(e.message)},submitForm:function(){var e=this,t=this;this.$refs.form.validate((function(a){if(!a)return!1;e.formLoading=!0,o["a"].update(e.form).then((function(e){1===e.code?t.$message.success(e.message):t.$message.error(e.message),t.formLoading=!1})).catch((function(e){t.formLoading=!1}))}))},levelFormatter:function(e){return this.enumFormat(this.levelEnum,e)}},computed:Object(s["a"])(Object(s["a"])({},Object(n["c"])("enumItem",["enumFormat"])),Object(n["e"])("enumItem",{sexEnum:function(e){return e.user.sexEnum},levelEnum:function(e){return e.user.levelEnum}}))},m=i,u=a("2877"),c=Object(u["a"])(m,r,l,!1,null,"eb22e912",null);t["default"]=c.exports}}]);