add-project.js 4.7 KB

12
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/add-project/add-project"],{259:function(e,t,n){"use strict";(function(e,t){var r=n(4);n(26);r(n(25));var o=r(n(260));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n(1)["default"],n(2)["createPage"])},260:function(e,t,n){"use strict";n.r(t);var r=n(261),o=n(263);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);n(265);var u,a=n(36),c=Object(a["default"])(o["default"],r["render"],r["staticRenderFns"],!1,null,null,null,!1,r["components"],u);c.options.__file="pages/add-project/add-project.vue",t["default"]=c.exports},261:function(e,t,n){"use strict";n.r(t);var r=n(262);n.d(t,"render",(function(){return r["render"]})),n.d(t,"staticRenderFns",(function(){return r["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return r["recyclableRender"]})),n.d(t,"components",(function(){return r["components"]}))},262:function(e,t,n){"use strict";var r;n.r(t),n.d(t,"render",(function(){return o})),n.d(t,"staticRenderFns",(function(){return u})),n.d(t,"recyclableRender",(function(){return i})),n.d(t,"components",(function(){return r}));try{r={"u-Form":function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u--form/u--form")]).then(n.bind(null,453))},uFormItem:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,459))},"u-Input":function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u--input/u--input")]).then(n.bind(null,415))},"u-Textarea":function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u--textarea/u--textarea")]).then(n.bind(null,467))},uButton:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-button/u-button")]).then(n.bind(null,292))}}}catch(a){if(-1===a.message.indexOf("Cannot find module")||-1===a.message.indexOf(".vue"))throw a;console.error(a.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var o=function(){var e=this,t=e.$createElement;e._self._c},i=!1,u=[];o._withStripped=!0},263:function(e,t,n){"use strict";n.r(t);var r=n(264),o=n.n(r);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);t["default"]=o.a},264:function(e,t,n){"use strict";(function(e){var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(30)),i=r(n(32)),u={data:function(){return{type:0,value:"",model1:{addProject:{gatewayDeviceId:"",description:"",userId:e.getStorageSync("userId")}},rules:{"addProject.gatewayDeviceId":{type:"string",required:!0,message:"网关ID不能为空",trigger:["change"]},"addProject.description":{type:"string",min:3,required:!0,message:"不低于3个字",trigger:["change"]}}}},onReady:function(){this.$refs.form1.setRules(this.rules)},onLoad:function(e){if(e.item){this.type=1;var t=JSON.parse(e.item);this.model1.addProject.description=t.description,this.model1.addProject.gatewayDeviceId=t.gatewayDeviceId}else this.type=0},methods:{navigateBack:function(){e.navigateBack()},sexSelect:function(e){this.model1.userInfo.sex=e.name,this.$refs.form1.validateField("userInfo.sex")},submit:function(){var t=this;this.$refs.form1.validate().then(function(){var n=(0,i.default)(o.default.mark((function n(r){var i,u;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(1!=t.type){n.next=4;break}console.log("更改"),n.next=11;break;case 4:return console.log("增加",t.model1.addProject),n.next=7,e.$http.post("/api/v1/test/testProject",t.model1.addProject);case 7:i=n.sent,u=i.data,console.log(u),200===u.code?e.showToast({title:u.data,duration:1500,icon:"none"}):e.showToast({title:u.msg,duration:1500,icon:"none"});case 11:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()).catch((function(e){}))},reset:function(){var t=this,n=["userInfo.name","intro"];this.$refs.form1.resetFields(),this.$refs.form1.clearValidate(),this.model1.addProject={gatewayDeviceId:"",description:"",userId:e.getStorageSync("userId")},setTimeout((function(){t.$refs.form1.clearValidate(n)}),10)}}};t.default=u}).call(this,n(2)["default"])},265:function(e,t,n){"use strict";n.r(t);var r=n(266),o=n.n(r);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);t["default"]=o.a},266:function(e,t,n){}},[[259,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/add-project/add-project.js.map