diff --git a/.env.production b/.env.production index f74870f..77ba4c1 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,2 @@ BASE_URL= "https://vue3.go-admin.dev" -VITE_BASE_URL= "http://dev.hospital.admin.api.igandanyiyuan.com" \ No newline at end of file +VITE_BASE_URL= "//prod.hospital.admin.api.igandanyiyuan.com" \ No newline at end of file diff --git a/components.d.ts b/components.d.ts index 2e855c4..9ea7df6 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,6 +10,7 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { DeleteModal: typeof import('./src/components/DeleteModal.vue')['default'] + Loading: typeof import('./src/components/loading/loading.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] Upload: typeof import('./src/components/upload.vue')['default'] diff --git a/package.json b/package.json index 76c6b40..d93e7d8 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "js-cookie": "^3.0.5", "npm": "^9.6.6", "pinia": "^2.0.36", + "spinkit": "^2.0.1", "vue": "^3.2.47", "vue-codemirror": "^6.1.1", "vue-router": "^4.1.6" diff --git a/src/api/doctor/examine.js b/src/api/doctor/examine.js new file mode 100644 index 0000000..151788a --- /dev/null +++ b/src/api/doctor/examine.js @@ -0,0 +1,24 @@ +import request from '../../utils/request' + +const url = '/admin/doctor/pending'; + +export function getDoctorList(params){ + return request({ + url:'/admin/doctor/pending', + method: 'get', + params + }) +} +export function getDoctorDetail(id){ + return request({ + url:'/admin/doctor/pending/'+id, + method: 'get' + }) + } + export function checkDoctor(data,id){ + return request({ + url:'/admin/doctor/pending/'+id, + method: 'put', + data + }) + } \ No newline at end of file diff --git a/src/components/loading/index.js b/src/components/loading/index.js new file mode 100644 index 0000000..726663b --- /dev/null +++ b/src/components/loading/index.js @@ -0,0 +1,28 @@ +import { createApp } from "vue" + +// 导入写好的Loading.vue文件 +import Loading from "./loading.vue" + +export default { + loading: null, + // 每当这个插件被添加到应用程序中时,如果它是一个对象,就会调用 install 方法。如果它是一个 function,则函数本身将被调用。在这两种情况下——它都会收到两个参数:由 Vue 的 createApp 生成的 app 对象和用户传入的选项。 + install(app) { + // if (this.loading) { + // // 防止多次载入 + // app.config.globalProperties.$loading = this.loading + // return + // } + // 创建Loading实例,用于挂载 + let instance = createApp(Loading) + // 创建div元素装载Loading对象 + let div = document.createElement("div") + div.setAttribute("id","maskbox") + let body = document.body + // 导入body中 + body.appendChild(div); + + this.loading = instance.mount(div) + // 挂载vue身上 + app.config.globalProperties.$loading = this.loading; + } +} diff --git a/src/components/loading/loading.vue b/src/components/loading/loading.vue new file mode 100644 index 0000000..9308229 --- /dev/null +++ b/src/components/loading/loading.vue @@ -0,0 +1,196 @@ + + + + + \ No newline at end of file diff --git a/src/components/upload.vue b/src/components/upload.vue index e580c72..66bd2b4 100644 --- a/src/components/upload.vue +++ b/src/components/upload.vue @@ -1,4 +1,5 @@ @@ -20,27 +21,31 @@ default:false } }); + const {fileList,isMultiple,dataType} = toRefs(props); const emits = defineEmits(['changeData']); const beforeUpload = (file) => { + return new Promise((resolve, reject) => { - alert(isMultiple.value); - alert(fileList.value.length) if(!isMultiple.value && fileList.value.length>=1){ - proxy.$notification.error("只能上传一张图片"); + proxy.$notification.error("只能上传一张图片,请先删除原有图片"); reject('cancel') }else if (file.size >= 10 * 1024 * 1024) { proxy.$notification.error("图片大小不能超过10M"); reject('cancel') } else { - resolve(true); - getOssSign(1,file); - } + resolve(true); + + let scene=1; + if(dataType=="license_cert_list" || dataType=="qualification_cert_list" || dataType=="work_cert_list" || dataType=="sign_image_list" || dataType=="id_card_front_list" || dataType=="id_card_back_list"){ + scene=2 + }; + getOssSign(scene,file) + } }); }; const beforeMove=(file)=>{ return new Promise((resolve, reject) => { - console.log(file); emits("changeData",{url:file.url,type:dataType.value,dealType:"remove"}) resolve(true) }); @@ -54,9 +59,9 @@ // //getOssSign(1, fileList[0].file); // console.log(fileList) }; - //const emit = defineEmits(['fileList']) //获取oss签名 const getOssSign = async (scene, File) => { + proxy.$loading.show(); const { data, code, message } = await ossSign({ user_type: 4, scene, @@ -72,11 +77,17 @@ formData.append('key', dir + time + filename); formData.append('file', File, filename); ossUpload(host, formData).then((res) => { + proxy.$loading.hide(); emits("changeData",{url:host+"/"+ dir + time + filename,type:dataType.value,dealType:"add"}) + // if(fileNum.value==fileList.value.length){ + // fileNum.value=0; + // proxy.$loading.hide(); + // } }); } else { proxy.$notification.error(message); } } - \ No newline at end of file + + diff --git a/src/layout/index.vue b/src/layout/index.vue index 54705a5..552df00 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -49,6 +49,8 @@ const onCollapse = () => { } .titletip{ margin-bottom: 15px; + display: flex; + align-items: center; } \ No newline at end of file diff --git a/src/main.js b/src/main.js index 8646924..14b08b7 100644 --- a/src/main.js +++ b/src/main.js @@ -12,6 +12,7 @@ import permission from '@/directive/permission/permission'; // 引入 Arco 图标库 import * as ArcoIconModules from '@arco-design/web-vue/es/icon'; +import Loading from "@/components/loading/index" // Initialize the Pinia instance const pinia = createPinia(); @@ -29,7 +30,7 @@ app.config.globalProperties.parseTime = parseTime; for(const name in ArcoIconModules){ app.component(name,ArcoIconModules[name]) } - +app.use(Loading) app.use(ArcoVue); app.use(router); app.use(pinia); diff --git a/src/views/doctor/doctor-examine/index.vue b/src/views/doctor/doctor-examine/index.vue new file mode 100644 index 0000000..e67643a --- /dev/null +++ b/src/views/doctor/doctor-examine/index.vue @@ -0,0 +1,838 @@ + + + + \ No newline at end of file diff --git a/src/views/doctor/doctor-list/index.vue b/src/views/doctor/doctor-list/index.vue index 39faf46..401f085 100644 --- a/src/views/doctor/doctor-list/index.vue +++ b/src/views/doctor/doctor-list/index.vue @@ -42,16 +42,15 @@
- 新增 - 批量删除 + 新增 +
-