diff --git a/.env.development b/.env.development index ab35fbc..186de05 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ # 变量必须以 VITE_ 为前缀才能暴露给外部读取 NODE_ENV = 'development' -VITE_APP_BASE_API = 'https://ddbs.1024tool.vip/' -VITE_SERVE = "https://ddbs.1024tool.vip/" +VITE_APP_BASE_API = 'http://1.15.53.35:9998/' +VITE_SERVE = "http://1.15.53.35:9998/" # VITE_SERVE = "http://192.168.210.29:18100/" VITE_OSS_ACCESS_KEY_ID = "LTAI5tCpvXC17uuPwWvb5oRo" VITE_OSS_ACCESS_KEY_SECRET = "44EqDghVI0UVF0rVaea7gwOsPkXZ1z" \ No newline at end of file diff --git a/src/api/upload.js b/src/api/upload.js index e9cc6ec..be0af14 100644 --- a/src/api/upload.js +++ b/src/api/upload.js @@ -3,7 +3,7 @@ import request from '@/utils/request' export const getCode = () =>{ return request({ - url: 'admin/policy_token', + url: 'admin/form_policy_token', method: 'post', }) } diff --git a/src/assets/js/heightWeight.js b/src/assets/js/heightWeight.js new file mode 100644 index 0000000..516a5d9 --- /dev/null +++ b/src/assets/js/heightWeight.js @@ -0,0 +1,186 @@ +export const heightList = { + boy: [ + [47.6, 54.8], + [51.3, 59.0], + [54.9, 63.0], + [58.0, 66.4], + [60.5, 69.1], + [62.5, 71.3], + [64.2, 73.2], + [65.7, 74.9], + [67.1, 76.4], + [68.3, 77.8], + [69.5, 79.1], + [70.7, 80.4], + [71.7, 81.6], + [72.8, 82.8], + [73.8, 84.0], + [74.8, 85.1], + [75.8, 86.3], + [76.8, 87.4], + [77.7, 88.5], + [78.6, 89.6], + [79.6, 90.6], + [80.5, 91.7], + [81.4, 92.8], + [82.2, 93.7], + [82.4, 94.0], + [84.8, 96.8], + [87.0, 99.4], + [89.0, 101.9], + [90.9, 104.1], + [92.7, 106.2], + [94.4, 108.3], + [96.0, 110.2], + [97.6, 112.2], + [99.2, 114.1], + [100.8, 116.0], + [102.4, 117.9], + [104.1, 119.9], + [105.7, 121.8], + [107.2, 123.7], + [108.8, 125.5], + [110.3, 127.3], + [111.7, 129.1], + [113.1, 130.9], + [114.5, 132.5] + ], + girl: [ + [46.8, 53.8], + [50.4, 57.8], + [53.8, 61.6], + [56.7, 64.8], + [59.1, 67.4], + [61.0, 69.6], + [62.7, 71.5], + [64.2, 73.5], + [65.6, 74.7], + [66.8, 76.1], + [68.1, 77.5], + [69.2, 78.8], + [70.4, 80.1], + [71.4, 81.4], + [72.5, 82.6], + [73.4, 83.8], + [74.6, 84.9], + [75.5, 86.1], + [76.5, 87.2], + [77.5, 88.3], + [78.4, 89.4], + [79.3, 90.4], + [80.2, 91.5], + [81.1, 92.5], + [81.2, 92.8], + [83.6, 95.5], + [85.7, 98.1], + [87.7, 100.5], + [89.7, 102.7], + [91.5, 104.9], + [93.2, 106.9], + [94.9, 108.9], + [96.5, 110.9], + [98.1, 112.8], + [99.7, 114.7], + [101.3, 116.7], + [103.0, 118.6], + [104.6, 120.6], + [106.1, 122.4], + [107.6, 124.2], + [109.0, 126.0], + [110.4, 127.7], + [111.8, 129.4], + [113.2, 131.0] + ] +} + +export const weightList = { + boy: [ + [2.8, 4.2], + [3.7, 5.6], + [4.7, 7.1], + [5.5, 8.3], + [6.1, 9.2], + [6.6, 9.8], + [6.9, 10.3], + [7.2, 10.8], + [7.5, 11.1], + [7.7, 11.5], + [7.9, 11.8], + [8.1, 12.0], + [8.3, 12.3], + [8.4, 12.5], + [8.6, 12.8], + [8.8, 13.2], + [9.0, 13.5], + [9.1, 13.8], + [9.3, 14.0], + [9.5, 14.3], + [9.7, 14.6], + [9.8, 14.8], + [10.3, 15.5], + [10.7, 16.2], + [11.1, 16.9], + [11.5, 17.7], + [12.0, 18.4], + [12.4, 19.1], + [12.8, 19.8], + [13.1, 20.5], + [13.5, 21.1], + [13.9, 21.9], + [14.3, 22.6], + [14.7, 23.4], + [15.1, 24.3], + [15.5, 25.1], + [15.9, 26.0], + [16.3, 26.8], + [16.7, 27.6], + [17.0, 28.5], + [17.4, 29.3] + ], + girl: [ + [2.7, 4.1], + [3.5, 5.3], + [4.4, 6.6], + [5.1, 7.6], + [5.6, 8.4], + [6.0, 9.1], + [6.4, 9.6], + [6.7, 10.0], + [6.9, 10.4], + [7.2, 10.8], + [7.4, 11.1], + [7.6, 11.4], + [7.7, 11.6], + [7.9, 11.9], + [8.1, 12.2], + [8.3, 12.4], + [8.4, 12.7], + [8.6, 12.9], + [8.8, 13.2], + [9.0, 13.5], + [9.1, 13.8], + [9.3, 14.0], + [9.5, 14.3], + [9.7, 14.6], + [9.8, 14.8], + [10.3, 15.5], + [10.7, 16.2], + [11.1, 16.9], + [11.5, 17.7], + [12.0, 18.4], + [12.4, 19.1], + [12.8, 19.8], + [13.1, 20.5], + [13.5, 21.1], + [13.9, 21.9], + [14.3, 22.6], + [14.7, 23.4], + [15.1, 24.3], + [15.5, 25.1], + [15.9, 26.0], + [16.3, 26.8], + [16.7, 27.6], + [17.0, 28.5], + [17.4, 29.3] + ] +} \ No newline at end of file diff --git a/src/components/myEcahts.vue b/src/components/myEcahts.vue index 452dde6..9bd3d58 100644 --- a/src/components/myEcahts.vue +++ b/src/components/myEcahts.vue @@ -43,7 +43,8 @@ onMounted(() => { data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] }, yAxis: { - type: 'value' + type: 'value', + smooth: true }, series: [ { diff --git a/src/components/myEcahtsSh copy.vue b/src/components/myEcahtsSh copy.vue new file mode 100644 index 0000000..fcb1495 --- /dev/null +++ b/src/components/myEcahtsSh copy.vue @@ -0,0 +1,132 @@ + + + + diff --git a/src/components/myEcahtsSh.vue b/src/components/myEcahtsSh.vue index fcb1495..0bc5b4a 100644 --- a/src/components/myEcahtsSh.vue +++ b/src/components/myEcahtsSh.vue @@ -5,6 +5,8 @@ import { ref, onMounted } from 'vue' import * as echarts from 'echarts' import { useRoute } from 'vue-router' +import { heightList, weightList } from '@/assets/js/heightWeight'; + const route = useRoute() const myEcharts = ref(null) const props = defineProps({ @@ -26,19 +28,35 @@ const props = defineProps({ }, months: { type: Array, - default: () => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] + default: () => ['1岁1个月', '1岁2个月', '1岁3个月', '1岁6个月', '2岁'] }, legendData: { type: Array, default: () => [] }, + sex: { + type: String, + default: '' + }, + label: { + type: String, + default: '' + } }) onMounted(() => { var chartDom = document.getElementById(props.id); var myChart = echarts.init(chartDom); var option; - + let standardList = [] + if(props.sex == 1){ + standardList = props.label ? heightList.boy : weightList.boy + } else { + standardList = props.label ? heightList.girl : weightList.girl + } + const standardLower = standardList.map(item => item[0]); + const standardUpper = standardList.map(item => item[1]); + const standardRange = standardUpper.map((up, i) => up - standardLower[i]); option = { grid: { left: '50', @@ -61,13 +79,15 @@ onMounted(() => { }, xAxis: { type: 'category', - data: props.months + data: props.months, + boundaryGap: false, }, yAxis: { type: 'value', nameTextStyle: { padding: [0, 0, 0, 40] - } + }, + smooth: true }, series: [ { @@ -82,40 +102,27 @@ onMounted(() => { } }, { - name: props.legendData[1], - type: 'custom', - renderItem: function (params, api) { - const points = []; - const xPoints = []; - const minPoints = []; - const maxPoints = []; - - for (let i = 0; i < props.months.length; i++) { - const x = api.coord([i, 0])[0]; - const minY = api.coord([0, props.normalHeightMin[i]])[1]; - const maxY = api.coord([0, props.normalHeightMax[i]])[1]; - - xPoints.push(x); - minPoints.push(minY); - maxPoints.push(maxY); - } - - return { - type: 'group', - children: [{ - type: 'polygon', - shape: { - points: xPoints.map((x, i) => [x, minPoints[i]]).concat( - xPoints.slice().reverse().map((x, i) => [x, maxPoints[maxPoints.length - 1 - i]]) - ) - }, - style: { - fill: 'rgba(144, 238, 144, 0.3)' - } - }] - }; - }, - data: props.months + name: '标准下界', + type: 'line', + symbol: 'none', + data: standardLower, + lineStyle: { opacity: 0 }, + stack: '标准范围', + areaStyle: { opacity: 0 }, + tooltip: { show: false } + }, + { + name: '标准范围', + type: 'line', + symbol: 'none', + data: standardRange, + lineStyle: { opacity: 0 }, + stack: '标准范围', + areaStyle: { color: 'rgba(135,206,250,0.3)' }, + tooltip: { show: false }, + itemStyle: { + color: 'rgba(135,206,250,0.3)' + } } ] }; diff --git a/src/views/news/addNew.vue b/src/views/news/addNew.vue index 9f91d8e..69ece02 100644 --- a/src/views/news/addNew.vue +++ b/src/views/news/addNew.vue @@ -28,7 +28,7 @@ - + @@ -135,62 +135,43 @@ editorConfig.MENU_CONF['uploadImage'] = { // } // 自定义上传 async customUpload(file, insertFn) { - try { - const formData = new FormData() - formData.append('file', file) - const code = await getCode() - const client = new OSS({ - region: "oss-cn-beijing", - // authorizationV4: true, - accessKeyId: import.meta.env.VITE_OSS_ACCESS_KEY_ID, - accessKeySecret: import.meta.env.VITE_OSS_ACCESS_KEY_SECRET, - stsToken: JSON.parse(code.token).security_token, - bucket: "image-fudan", - secure: true, - // endpoint: 'https' - }); - // Generate unique filename with original extension - const fileExt = file.name.split('.').pop() - const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExt}` + const url = await uploadFile(file) + insertFn(url, file.name, url); - const options = { - // meta: { temp: "demo" }, - // mime: file.type, - headers: { "Content-Type": file.type }, - }; - - const result = await client.put(fileName, file, options); - console.log('Upload result:', result); - - // Construct the full URL and call insertFn - const url = `${ossurl}/${fileName}`; - insertFn(url, file.name, url); - } catch (error) { - console.error('Upload failed:', error); - ElNotification.error('图片上传失败,请重试'); - } }, } +editorConfig.MENU_CONF['uploadVideo'] = { + async customUpload(file, insertFn) { + const url = await uploadFile(file) + insertFn(url, file.name, url); + }, +} +const uploadFile = (file) => { + + return new Promise(async (resolve, reject) => { + const code = await getCode() + const res = JSON.parse(code).token + const formData = new FormData() + formData.append('policy', res.policy); + formData.append('OSSAccessKeyId', res.ossAccessKeyId); + formData.append('success_action_status', '200'); + formData.append('signature', res.signature); + formData.append('key', res.dir + file.name); + formData.append('file', file); + fetch('http://image-fudan.oss-cn-beijing.aliyuncs.com', { method: 'POST', body: formData },).then((res) => { + resolve('http://image-fudan.oss-cn-beijing.aliyuncs.com/ddbs-admin/' + file.name) + }).catch((err) => { + reject('上传失败', err) + }); + }) + +} const handleUpload = (e) => { console.log(e.target.files[0]) } -editorConfig.MENU_CONF['uploadVideo'] = { - server: import.meta.env.VITE_API_BASE_URL + '/api/upload', // 使用环境变量中的API基础URL - maxFileSize: 5 * 1024 * 1024, // 5M - onBeforeUpload: (file) => { - console.log('准备上传视频', file) - return file // 返回file继续上传 - }, - onSuccess: (file, res) => { - console.log('视频上传成功', file, res) - }, - onError: (file, err, res) => { - console.log('视频上传失败', file, err, res) - ElNotification.error('视频上传失败,请重试') - }, -} + const handleSaveArticle = () => { diff --git a/src/views/user/userDetail.vue b/src/views/user/userDetail.vue index c7e3c61..33a36ed 100644 --- a/src/views/user/userDetail.vue +++ b/src/views/user/userDetail.vue @@ -3,52 +3,52 @@ {{ userInfo.username }} - 未知 - - + 未知 + + {{ userInfo.age }} {{ userInfo.mobile }} {{ userInfo.operative_date }} {{ userInfo.postoperative_duration }} - 未知 - 低危 - 中危 - 高危 + 未知 + 低危 + 中危 + 高危 - 未知 - 轻度偏高 - 正常 - 重度偏高 + 未知 + 轻度偏离 + 正常 + 重度偏离 - - 未知 - 轻度偏高 - 正常 - 重度偏高 + + 未知 + 轻度偏离 + 正常 + 重度偏离 {{ userInfo.next_follow_date }} {{ userInfo.birth_weight }} (g) {{ userInfo.parity_number }} {{ userInfo.birth_number }} - 未知 - 自认受孕 - 辅助生殖技术 + 未知 + 自认受孕 + 辅助生殖技术 {{ userInfo.gestational_week }} {{ userInfo.prenatal_check_type }} - 未知 - - {{ userInfo.prenatal_check_remark }}(周) + 未知 + + {{ userInfo.prenatal_check_remark }}(周) - 未知 - 顺产 - 剖腹产 + 未知 + 顺产 + 剖腹产 @@ -71,21 +71,19 @@

身高曲线

- + :label="'身高'" />

体重曲线

- + :label="'体重'" />

总胆红素趋势

@@ -202,7 +200,7 @@ const userInfo = ref({}) const isLoading = ref(true) const chatData = ref({ - height: [], + height: [75, 77, 80], weight: [], totalBilirubin: [], directBilirubin: [] @@ -220,14 +218,14 @@ const getTableData = async () => { tableData.value = questionnairesRes.list chatData.value = { - height: [], + height: [75, 77, 80], weight: [], totalBilirubin: [], directBilirubin: [] } chatRes.list.forEach(item => { - chatData.value.height.push(item.height) + // chatData.value.height.push(item.height) chatData.value.weight.push(item.weight) chatData.value.totalBilirubin.push(item.total_bilirubin) chatData.value.directBilirubin.push(item.direct_bilirubin) diff --git a/vite.config.ts b/vite.config.ts index 4a1bd7a..cb39c33 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,7 +13,6 @@ import IconsResolver from 'unplugin-icons/resolver' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' import { viteMockServe } from 'vite-plugin-mock' -import pluginBasicSsl from '@vitejs/plugin-basic-ssl' // 引入 fs 模块 // import fs from 'fs' // const fs = require('fs'); @@ -24,7 +23,6 @@ export default defineConfig(({ command, mode }) => { return { plugins: [ vue(), - pluginBasicSsl(), AutoImport({ resolvers: [ ElementPlusResolver(),