add-project.js.map 15 KB

1
  1. {"version":3,"sources":["uni-app:///main.js","webpack:////Users/yangxiaohai/Desktop/boyuan/iot-test-app/pages/add-project/add-project.vue?bac1","webpack:////Users/yangxiaohai/Desktop/boyuan/iot-test-app/pages/add-project/add-project.vue?06c8","webpack:////Users/yangxiaohai/Desktop/boyuan/iot-test-app/pages/add-project/add-project.vue?2ec9","webpack:////Users/yangxiaohai/Desktop/boyuan/iot-test-app/pages/add-project/add-project.vue?ac42","uni-app:///pages/add-project/add-project.vue","webpack:////Users/yangxiaohai/Desktop/boyuan/iot-test-app/pages/add-project/add-project.vue?1484"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page","renderjs","component","options","__file","components","uFormItem","uButton","e","message","indexOf","console","error","render","_vm","this","_h","$createElement","_self","_c","recyclableRender","staticRenderFns","_withStripped","data","type","value","model1","addProject","gatewayDeviceId","description","userId","rules","required","trigger","min","onReady","onLoad","methods","navigateBack","uni","sexSelect","submit","result","title","duration","icon","reset","setTimeout"],"mappings":"wJAAA,MAGA,aACA,YAFAA,EAAGC,kCAAoCC,EAGvCC,EAAWC,a,gFCLX,oIACIC,EADJ,QASIC,EAAY,qBACd,aACA,YACA,sBACA,EACA,KACA,KACA,MACA,EACA,gBACAD,GAGFC,EAAUC,QAAQC,OAAS,oCACZ,aAAAF,E,0CCvBf,uQ,iCCAA,IAAIG,EAAJ,0LACA,IACEA,EAAa,CACX,SAAU,WACR,OAAO,mHAITC,UAAW,WACT,OAAO,2HAIT,UAAW,WACT,OAAO,qHAIT,aAAc,WACZ,OAAO,2HAITC,QAAS,WACP,OAAO,sHAKX,MAAOC,GACP,IAC+C,IAA7CA,EAAEC,QAAQC,QAAQ,wBACa,IAA/BF,EAAEC,QAAQC,QAAQ,QAWlB,MAAMF,EATNG,QAAQC,MAAMJ,EAAEC,SAChBE,QAAQC,MAAM,mBACdD,QAAQC,MACN,uFAEFD,QAAQC,MACN,mDAMN,IAAIC,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eACJH,EAAII,MAAMC,IAEjBC,GAAmB,EACnBC,EAAkB,GACtBR,EAAOS,eAAgB,G,iCCrDvB,yHAAy1B,eAAG,G,uJCqB51B,CACAC,gBACA,OAEAC,OACAC,SACAC,QACAC,YACAC,mBACAC,eACAC,oCAIAC,OACA,8BACAP,cACAQ,YACAvB,mBACAwB,oBAGA,0BACAT,cACAU,MACAF,YACAvB,iBACAwB,uBASAE,mBAEA,uCAEAC,mBACA,WACA,YACA,yBAEA,iDACA,8DAGA,aAKAC,SACAC,wBACAC,kBAEAC,sBACA,gCACA,gDAEAC,kBAAA,WAEA,iLAEA,0BACA9B,kBAAA,uBAGA,OADAA,0BACAgB,YAAA,SAGAY,iDACAZ,YAAA,gBAFAe,SAGA/B,eACA,aACA4B,aACAI,aACAC,cACAC,cAGAN,aACAI,YACAC,cACAC,cAEA,4CAEA,mDA1BA,IA0BA,wBAIAC,iBAAA,WACA,4BACA,+BACA,iCACA,wBACAlB,mBACAC,eACAC,mCAEAiB,uBACA,iCAEA,OAIA,c,6DCnIA,yHAAwjD,eAAG,G","file":"pages/add-project/add-project.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pages/add-project/add-project.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./add-project.vue?vue&type=template&id=8eb5ae3c&\"\nvar renderjs\nimport script from \"./add-project.vue?vue&type=script&lang=js&\"\nexport * from \"./add-project.vue?vue&type=script&lang=js&\"\nimport style0 from \"./add-project.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/add-project/add-project.vue\"\nexport default component.exports","export * from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--17-0!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./add-project.vue?vue&type=template&id=8eb5ae3c&\"","var components\ntry {\n components = {\n \"u-Form\": function () {\n return import(\n /* webpackChunkName: \"uni_modules/uview-ui/components/u--form/u--form\" */ \"@/uni_modules/uview-ui/components/u--form/u--form.vue\"\n )\n },\n uFormItem: function () {\n return import(\n /* webpackChunkName: \"uni_modules/uview-ui/components/u-form-item/u-form-item\" */ \"@/uni_modules/uview-ui/components/u-form-item/u-form-item.vue\"\n )\n },\n \"u-Input\": function () {\n return import(\n /* webpackChunkName: \"uni_modules/uview-ui/components/u--input/u--input\" */ \"@/uni_modules/uview-ui/components/u--input/u--input.vue\"\n )\n },\n \"u-Textarea\": function () {\n return import(\n /* webpackChunkName: \"uni_modules/uview-ui/components/u--textarea/u--textarea\" */ \"@/uni_modules/uview-ui/components/u--textarea/u--textarea.vue\"\n )\n },\n uButton: function () {\n return import(\n /* webpackChunkName: \"uni_modules/uview-ui/components/u-button/u-button\" */ \"@/uni_modules/uview-ui/components/u-button/u-button.vue\"\n )\n },\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./add-project.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./add-project.vue?vue&type=script&lang=js&\"","<template>\n\t<view class=\"u-page\">\n\n\t\t<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->\n\t\t<u--form labelPosition=\"left\" :model=\"model1\" ref=\"form1\">\n\t\t\t<u-form-item labelWidth=\"110\" label=\"网关ID\" prop=\"addProject.gatewayDeviceId\" borderBottom ref=\"item1\">\n\t\t\t\t<u--input v-model=\"model1.addProject.gatewayDeviceId\" border=\"none\" placeholder=\"网关ID\"></u--input>\n\t\t\t</u-form-item>\n\t\t\t<u-form-item label=\"测试项目说明\" prop=\"addProject.description\" borderBottom ref=\"item3\" labelWidth=\"110\">\n\t\t\t\t<u--textarea placeholder=\"不低于3个字\" v-model=\"model1.addProject.description\" count></u--textarea>\n\t\t\t</u-form-item>\n\t\t</u--form>\n\t\t<view class=\"\" style=\"display: flex; margin-top: 100rpx;\">\n\t\t\t<u-button type=\"primary\" text=\"提交\" @click=\"submit\"></u-button>\n\t\t\t<u-button type=\"error\" text=\"重置\" @click=\"reset\"></u-button>\n\t\t</view>\n\n\t</view>\n</template>\n\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\n\t\t\t\ttype: 0, //0、增加 1、更改\n\t\t\t\tvalue: '',\n\t\t\t\tmodel1: {\n\t\t\t\t\taddProject: {\n\t\t\t\t\t\tgatewayDeviceId: '',\n\t\t\t\t\t\tdescription: '',\n\t\t\t\t\t\tuserId: uni.getStorageSync('userId')\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\trules: {\n\t\t\t\t\t'addProject.gatewayDeviceId': {\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '网关ID不能为空',\n\t\t\t\t\t\ttrigger: ['change']\n\t\t\t\t\t},\n\n\t\t\t\t\t'addProject.description': {\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tmin: 3,\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '不低于3个字',\n\t\t\t\t\t\ttrigger: ['change']\n\t\t\t\t\t},\n\n\n\t\t\t\t},\n\n\n\t\t\t}\n\t\t},\n\t\tonReady() {\n\t\t\t// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则\n\t\t\tthis.$refs.form1.setRules(this.rules)\n\t\t},\n\t\tonLoad(option) {\n\t\t\tif (option.item) {\n\t\t\t\tthis.type = 1\n\t\t\t\tlet item = JSON.parse(option.item)\n\n\t\t\t\tthis.model1.addProject.description = item.description\n\t\t\t\tthis.model1.addProject.gatewayDeviceId = item.gatewayDeviceId\n\t\t\t\t// this.projectDetail=option.item\n\t\t\t} else {\n\t\t\t\tthis.type = 0\n\t\t\t}\n\n\n\t\t},\n\t\tmethods: {\n\t\t\tnavigateBack() {\n\t\t\t\tuni.navigateBack()\n\t\t\t},\n\t\t\tsexSelect(e) {\n\t\t\t\tthis.model1.userInfo.sex = e.name\n\t\t\t\tthis.$refs.form1.validateField('userInfo.sex')\n\t\t\t},\n\t\t\tsubmit() {\n\t\t\t\t// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true\n\t\t\t\tthis.$refs.form1.validate().then(async res => {\n\n\t\t\t\t\tif (this.type == 1) {\n\t\t\t\t\t\tconsole.log('更改');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('增加', this.model1\n\t\t\t\t\t\t\t.addProject);\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\tdata: result\n\t\t\t\t\t\t} = await uni.$http.post(\"/api/v1/test/testProject\", this.model1\n\t\t\t\t\t\t\t.addProject)\n\t\t\t\t\t\tconsole.log(result);\n\t\t\t\t\t\tif (result.code === 200) {\n\t\t\t\t\t\t\tuni.showToast({\n\t\t\t\t\t\t\t\ttitle: result.data,\n\t\t\t\t\t\t\t\tduration: 1500,\n\t\t\t\t\t\t\t\ticon: 'none'\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuni.showToast({\n\t\t\t\t\t\t\t\ttitle: result.msg,\n\t\t\t\t\t\t\t\tduration: 1500,\n\t\t\t\t\t\t\t\ticon: 'none'\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}).catch(errors => {\n\t\t\t\t\t// uni.$u.toast('校验失败')\n\t\t\t\t})\n\t\t\t},\n\t\t\treset() {\n\t\t\t\tconst validateList = ['userInfo.name', 'intro']\n\t\t\t\tthis.$refs.form1.resetFields()\n\t\t\t\tthis.$refs.form1.clearValidate()\n\t\t\t\tthis.model1.addProject = {\n\t\t\t\t\tgatewayDeviceId: '',\n\t\t\t\t\tdescription: '',\n\t\t\t\t\tuserId: uni.getStorageSync('userId')\n\t\t\t\t}\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.$refs.form1.clearValidate(validateList)\n\t\t\t\t\t// 或者使用 this.$refs.form1.clearValidate()\n\t\t\t\t}, 10)\n\t\t\t},\n\n\t\t},\n\t}\n</script>\n\n<style lang=\"scss\">\n\t.u-page {\n\t\twidth: calc(100vw - 60rpx);\n\t\tmargin: 20rpx 30rpx;\n\n\t}\n</style>","import mod from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./add-project.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./add-project.vue?vue&type=style&index=0&lang=scss&\""],"sourceRoot":""}