@@ -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(),