1 line
4.8 KiB
JSON
1 line
4.8 KiB
JSON
{"ast":null,"code":"import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, vModelText as _vModelText, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\";\nconst _hoisted_1 = {\n class: \"Hypertension_1\"\n};\nconst _hoisted_2 = {\n id: \"result\"\n};\nexport function render(_ctx, _cache, $props, $setup, $data, $options) {\n return _openBlock(), _createElementBlock(\"div\", _hoisted_1, [_createElementVNode(\"div\", _hoisted_2, _toDisplayString($data.result), 1 /* TEXT */), _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n id: \"userName\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => $data.userName = $event),\n placeholder: \"考生姓名\"\n }, null, 512 /* NEED_PATCH */), [[_vModelText, $data.userName]]), _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n id: \"sbp\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = $event => $data.sbp = $event),\n placeholder: \"收缩压\"\n }, null, 512 /* NEED_PATCH */), [[_vModelText, $data.sbp]]), _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n id: \"dbp\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = $event => $data.dbp = $event),\n placeholder: \"舒张压\"\n }, null, 512 /* NEED_PATCH */), [[_vModelText, $data.dbp]]), _createElementVNode(\"button\", {\n id: \"getResult\",\n onClick: _cache[3] || (_cache[3] = (...args) => $options.getResult && $options.getResult(...args))\n }, \"获取结果\")]);\n}","map":{"version":3,"names":["class","id","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_toDisplayString","$data","result","type","userName","$event","placeholder","sbp","dbp","onClick","_cache","args","$options","getResult"],"sources":["C:\\exam_app\\app_vue\\src\\components\\Hypertension_1.vue"],"sourcesContent":["<template>\r\n <div class=\"Hypertension_1\">\r\n <div id=\"result\">{{ result }}</div>\r\n <input type=\"text\" id=\"userName\" v-model=\"userName\" placeholder=\"考生姓名\" />\r\n <input type=\"text\" id=\"sbp\" v-model=\"sbp\" placeholder=\"收缩压\" />\r\n <input type=\"text\" id=\"dbp\" v-model=\"dbp\" placeholder=\"舒张压\" />\r\n <button id=\"getResult\" @click=\"getResult\">获取结果</button>\r\n </div>\r\n</template>\r\n\r\n<script>\r\n export default {\r\n name: 'Hypertension_1',\r\n data() {\r\n return {\r\n proxy: 'http://10.128.128.249:8022/',\r\n url: 'public_api/v1/api_for_vue_exam_hypertension_1',\r\n userName: '考生姓名',\r\n sbp: 0,\r\n dbp: 0,\r\n result: ''\r\n };\r\n },\r\n methods: {\r\n getResult() {\r\n const formData = new FormData();\r\n formData.append(\"sbp\", this.sbp);\r\n formData.append(\"dbp\", this.dbp);\r\n let url = this.proxy + this.url;\r\n let that = this;\r\n\r\n this.axios.post(\r\n url,\r\n formData,\r\n {\r\n headers: {\r\n 'Content-Type': 'multipart/form-data'\r\n }\r\n }\r\n ).then(\r\n function (response) {\r\n that.result = response.data; // 假设服务器返回的数据直接显示\r\n },\r\n function (error) {\r\n that.result = '获取结果失败';\r\n console.error(error);\r\n }\r\n );\r\n }\r\n },\r\n mounted() {\r\n window.myVue = this;\r\n }\r\n };\r\n</script>\r\n\r\n<style scoped>\r\n /* 添加一些简单的样式 */\r\n .Hypertension_1 {\r\n margin: 20px;\r\n }\r\n input, button {\r\n margin: 5px;\r\n }\r\n</style>"],"mappings":";;EACSA,KAAK,EAAC;AAAgB;;EAClBC,EAAE,EAAC;AAAQ;;uBADpBC,mBAAA,CAMM,OANNC,UAMM,GALFC,mBAAA,CAAmC,OAAnCC,UAAmC,EAAAC,gBAAA,CAAfC,KAAA,CAAAC,MAAM,kB,gBAC1BJ,mBAAA,CAAyE;IAAlEK,IAAI,EAAC,MAAM;IAACR,EAAE,EAAC,UAAU;+DAAUM,KAAA,CAAAG,QAAQ,GAAAC,MAAA;IAAEC,WAAW,EAAC;iDAAtBL,KAAA,CAAAG,QAAQ,E,mBAClDN,mBAAA,CAA8D;IAAvDK,IAAI,EAAC,MAAM;IAACR,EAAE,EAAC,KAAK;+DAAUM,KAAA,CAAAM,GAAG,GAAAF,MAAA;IAAEC,WAAW,EAAC;iDAAjBL,KAAA,CAAAM,GAAG,E,mBACxCT,mBAAA,CAA8D;IAAvDK,IAAI,EAAC,MAAM;IAACR,EAAE,EAAC,KAAK;+DAAUM,KAAA,CAAAO,GAAG,GAAAH,MAAA;IAAEC,WAAW,EAAC;iDAAjBL,KAAA,CAAAO,GAAG,E,GACxCV,mBAAA,CAAuD;IAA/CH,EAAE,EAAC,WAAW;IAAEc,OAAK,EAAAC,MAAA,QAAAA,MAAA,UAAAC,IAAA,KAAEC,QAAA,CAAAC,SAAA,IAAAD,QAAA,CAAAC,SAAA,IAAAF,IAAA,CAAS;KAAE,MAAI,E","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]} |