2023.11.1修改
This commit is contained in:
		| @@ -2,7 +2,7 @@ ENV = 'development' | ||||
| VITE_CLI_PORT = 8088 | ||||
| VITE_SERVER_PORT = 8888 | ||||
| VITE_BASE_API = /api | ||||
| VITE_BASE_PATH = http://f968894.r2.cpolar.top     | ||||
| VITE_BASE_PATH = http://410fed99.r6.cpolar.top  | ||||
| VITE_EDITOR = vscode | ||||
| // VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm | ||||
| // 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP | ||||
|   | ||||
| @@ -16,7 +16,7 @@ const api = { | ||||
|   }, | ||||
|   editHospital: data => { | ||||
|     return service({ | ||||
|       url: '/article', | ||||
|       url: '/hospital', | ||||
|       method: 'put', | ||||
|       data | ||||
|     }) | ||||
|   | ||||
| @@ -51,6 +51,7 @@ const question_form = ref({ | ||||
|   answer: '', | ||||
|   title: '' | ||||
| }) | ||||
| const apiForm = ref(null) | ||||
| const note_list = ref([ | ||||
|   // { | ||||
|   //   content: '', | ||||
| @@ -96,18 +97,19 @@ const onReset = () => { | ||||
|   } | ||||
| } | ||||
| function openDialog(type) { | ||||
|   dialogFormVisible.value = true | ||||
|   // let params = {} | ||||
|   switch (type) { | ||||
|     case 'add': | ||||
|       dialogTitle.value = '新增医院' | ||||
|       form.value = {} | ||||
|       // form.value = {} | ||||
|       break | ||||
|     case 'edit': | ||||
|       // params.question_id = question_id.value | ||||
|       dialogTitle.value = '编辑医院信息' | ||||
|       break | ||||
|   } | ||||
|   dialogFormVisible.value = true | ||||
|  | ||||
|   // router.push({name:'addCourse',params}) | ||||
| } | ||||
| async function onDelete() { | ||||
| @@ -172,28 +174,28 @@ function closeDialog() { | ||||
|   form.value = {} | ||||
| } | ||||
| async function enterDialog() { // 提交 | ||||
| //   form.value.score = parseInt(form.value.score) | ||||
| //   form.value.teacher_id = 0 | ||||
| //   form.value.question = JSON.stringify(question_form.value) | ||||
|   let func_name = 'addHospital' | ||||
|   if (form.value.ID) { // 编辑 | ||||
|     func_name = 'editHospital' | ||||
|   } | ||||
|   form.value.todos = todo_list.value | ||||
|   form.value.notes = note_list.value | ||||
|   const res = await api[func_name](form.value) | ||||
|   if (res.code === 0) { | ||||
|     ElMessage({ | ||||
|       type: 'success', | ||||
|       message: res.msg | ||||
|     }) | ||||
|     // if (tableData.value.length === ids.length && page.value > 1) { | ||||
|     //   page.value-- | ||||
|     // } | ||||
|     // deleteVisible.value = false | ||||
|     closeDialog() | ||||
|     getHospitalList() | ||||
|   } | ||||
|   await apiForm.value.validate(async(valid, fields) => { | ||||
|     if (valid) { | ||||
|       console.log('submit!') | ||||
|       let func_name = 'addHospital' | ||||
|       if (form.value.ID) { // 编辑 | ||||
|         func_name = 'editHospital' | ||||
|       } | ||||
|       form.value.todos = todo_list.value | ||||
|       form.value.notes = note_list.value | ||||
|       const res = await api[func_name](form.value) | ||||
|       if (res.code === 0) { | ||||
|         ElMessage({ | ||||
|           type: 'success', | ||||
|           message: res.msg | ||||
|         }) | ||||
|         getHospitalList() | ||||
|         closeDialog() | ||||
|       } | ||||
|     } else { | ||||
|       // console.log('error submit!', fields) | ||||
|     } | ||||
|   }) | ||||
| } | ||||
| function addRowFunc(type) { | ||||
|   // { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user