Browse Source

增加请求配置

admin_version1.0_2025_06_26
zq 4 weeks ago
parent
commit
d0f1eedb78
  1. 1
      .env.development
  2. 38
      src/components/GlobalLoading1.vue
  3. 6
      src/components/GuipRadio.vue
  4. 4
      src/style/theme/common.scss
  5. 3
      src/utils/request.js
  6. 6
      src/views/DoctorInformation.vue
  7. 192
      src/views/HomeView.vue
  8. 60
      src/views/HosInformation.vue
  9. 11
      vue.config.js

1
.env.development

@ -0,0 +1 @@
VUE_APP_BASE_API=/api

38
src/components/GlobalLoading1.vue

@ -1,18 +1,19 @@
<template> <template>
<div class="content-loading-overlay" v-if="isLoading"> <div>
<div class="content-loading-overlay" v-show="isLoading">
<div class="loading-content"> <div class="loading-content">
<div ref="animationContainer" class="animation-container"></div> <div ref="animationContainer" class="animation-container"></div>
</div> </div>
</div> </div>
<div v-else style="height: 100%;"> <div v-show="!isLoading">
<slot></slot> <slot></slot>
</div> </div>
</div>
</template> </template>
<script> <script>
import lottie from 'lottie-web' import lottie from 'lottie-web'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import defaultAnimation from '@/assets/loadingAni.json' // JSON import defaultAnimation from '@/assets/loadingAni.json'
export default { export default {
name: 'Loading', name: 'Loading',
@ -26,41 +27,42 @@ export default {
}, },
watch: { watch: {
isLoading(newVal) { isLoading(newVal) {
this.$nextTick(() => {
if (newVal) { if (newVal) {
this.$nextTick(()=>{
this.playAnimation() this.playAnimation()
})
} else { } else {
this.stopAnimation() this.stopAnimation()
} }
})
} }
}, },
mounted() {
if (this.isLoading) {
this.playAnimation()
}
},
beforeDestroy() {
this.stopAnimation()
},
methods: { methods: {
playAnimation() { playAnimation() {
//
if (this.anim) {
this.anim.destroy()
this.anim = null
}
console.log('执行动画')
this.anim = lottie.loadAnimation({ this.anim = lottie.loadAnimation({
container: this.$refs.animationContainer, container: this.$refs.animationContainer,
renderer: 'svg', renderer: 'svg',
loop: true, loop: true,
autoplay: true, autoplay: true,
animationData: defaultAnimation // JSON animationData: defaultAnimation
}) })
if (this.anim) {
this.anim.play()
}
}, },
stopAnimation() { stopAnimation() {
if (this.anim) { if (this.anim) {
this.anim.stop() this.anim.stop()
} }
} }
},
beforeDestroy() {
if (this.anim) {
this.anim.destroy() //
}
} }
} }
</script> </script>

6
src/components/GuipRadio.vue

@ -1,7 +1,7 @@
<template> <template>
<el-form-item <el-form-item
:class="[{'column':column},'form-item']" :class="[{'column':column},'form-item']"
:label="label" :prop="prop" :rules="rules"> :label="label" :prop="prop" :rules="rules" :required="required">
<el-radio-group <el-radio-group
v-model="selectedValue" v-model="selectedValue"
v-bind="$attrs" v-bind="$attrs"
@ -26,6 +26,10 @@
props: { props: {
// //
column:{ column:{
type:String,
default:''
},
required:{
type:Boolean, type:Boolean,
default:false default:false
}, },

4
src/style/theme/common.scss

@ -113,10 +113,10 @@ body {
flex-direction: column; flex-direction: column;
} }
.mb24{ .mb24{
margin-bottom: 24px; margin-bottom: 24px !important;
} }
.mb12{ .mb12{
margin-bottom: 12px; margin-bottom: 12px !important;
} }
.mt24{ .mt24{
margin-top: 24px; margin-top: 24px;

3
src/utils/request.js

@ -1,9 +1,10 @@
// src/utils/request.js // src/utils/request.js
import axios from "axios"; import axios from "axios";
const baseURL = process.env.VUE_APP_BASE_API;
// 创建 axios 实例 // 创建 axios 实例
const service = axios.create({ const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // 从环境变量中读取 API 基础地址 baseURL:baseURL, // 从环境变量中读取 API 基础地址
timeout: 60000, // 请求超时时间 timeout: 60000, // 请求超时时间
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'

6
src/views/DoctorInformation.vue

@ -221,9 +221,9 @@ export default {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid) { if (valid) {
this.$http('POST', '/supernew/ajax_get_type_batch_list', { this.$http('POST', '/supernew/ajax_get_type_batch_list', {
name:form.name, name: form.name,
idCard:form.idCard, idCard: form.idCard,
phone:form.phone phone: form.phone
}).then(response => { }).then(response => {
this.projectTagData = response.data this.projectTagData = response.data

192
src/views/HomeView.vue

@ -120,85 +120,85 @@ export default {
doctorName:'', doctorName:'',
isIndeterminate: false, isIndeterminate: false,
doctorList: [ doctorList: [
{ // {
id: 10, // id: 10,
checked: false, // checked: false,
name: '一二', // name: '',
idcard: '532524198711223615', // idcard: '532524198711223615',
desc: '就哈哈哈哈,嗷跳舞', // desc: '',
detail: '拉开是金德拉克撒娇了大数据连接拉萨。。。', // detail: '',
tag: '专业', // tag: '',
phone: '17785748373', // phone: '17785748373',
avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png', // avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
status: true, // status: true,
list: [ // list: [
{ // {
hos: [ // hos: [
'第三人民医院 针灸科', // ' ',
'第一人民医院 中医科', // ' ',
], // ],
time: '2054 - 10 - 03', // time: '2054 - 10 - 03',
status: true, // status: true,
group: '2', // group: '2',
setMenu: '4', // setMenu: '4',
nums: '88', // nums: '88',
checked: false, // checked: false,
}, // },
] // ]
}, // },
{ // {
id: 10, // id: 10,
checked: false, // checked: false,
name: '一二', // name: '',
idcard: '532524198711223615', // idcard: '532524198711223615',
desc: '就哈哈哈哈,嗷跳舞', // desc: '',
detail: '拉开是金德拉克撒娇了大数据连接拉萨。。。', // detail: '',
tag: '专业', // tag: '',
phone: '17785748373', // phone: '17785748373',
avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png', // avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
status: false, // status: false,
list: [ // list: [
{ // {
hos: [ // hos: [
'第三人民医院 针灸科', // ' ',
'第一人民医院 中医科', // ' ',
], // ],
time: '2054 - 10 - 03', // time: '2054 - 10 - 03',
status: true, // status: true,
group: '2', // group: '2',
setMenu: '4', // setMenu: '4',
nums: '88', // nums: '88',
checked: false, // checked: false,
}, // },
{ // {
hos: [ // hos: [
'第三人民医院 针灸科', // ' ',
'第一人民医院 中医科', // ' ',
], // ],
time: '2054 - 10 - 03', // time: '2054 - 10 - 03',
status: true, // status: true,
group: '2', // group: '2',
setMenu: '4', // setMenu: '4',
nums: '88', // nums: '88',
checked: false, // checked: false,
}, // },
] // ]
}, // },
{ // {
id: 10, // id: 10,
checked: false, // checked: false,
name: '一二', // name: '',
idcard: '532524198711223615', // idcard: '532524198711223615',
desc: '就哈哈哈哈,嗷跳舞', // desc: '',
detail: '拉开是金德拉克撒娇了大数据连接拉萨。。。', // detail: '',
tag: '专业', // tag: '',
phone: '17785748373', // phone: '17785748373',
avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png', // avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
status: false, // status: false,
list: [ // list: [
] // ]
}, // },
], ],
allChecked: false, allChecked: false,
} }
@ -216,19 +216,30 @@ export default {
store.commit('SET_PAGENAME', '医生管理'); // store.commit('SET_PAGENAME', '医生管理'); //
this.calculateTotalNum() this.calculateTotalNum()
}, },
mounted(){
this.getInitData()
},
render() {
console.log("组件重新渲染");
return 'a';
},
computed: { computed: {
}, },
methods: { methods: {
// //
getInitData(){ getInitData(){
this.$store.dispatch('showLoading') this.$store.dispatch('showLoading')
this.$http('POST', '/supernew/ajax_get_type_batch_list', { this.$http('POST', '/api/admin/doctor_depart_list', {
doctorName:this.doctorName // doctorName:this.doctorName
},{
headers:{
'AUTHADMIN' :'b10346e6-5003-4644-8e48-e14f49874338'
}
}).then(response => { }).then(response => {
if (response.code == 0) { if (response.code == 0) {
this.$store.dispatch('hideLoading')
this.doctorList = response.data this.doctorList = response.data
} }
this.$store.dispatch('hideLoading')
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
@ -315,28 +326,11 @@ export default {
row.status = !row.status; row.status = !row.status;
this.$set(this.doctorList, row) this.$set(this.doctorList, row)
}, },
// handleCheckAllChange(val) {
// this.checkedCities = val ? cityOptions : [];
// this.isIndeterminate = false;
// },
// handleCheckAllChange(val) {
// if (val == 'all') {
// console.log(this.allChecked, '-----allchecked');
// var i = 0;
// while (i < this.doctorList.length) {
// this.doctorList[i].checked = this.allChecked;
// this.getPopoverRef(i).$refs.guiptable.toggleAllSelection();
// i++
// }
// } else {
// this.getPopoverRef(val).$refs.guiptable.toggleAllSelection();
// }
// },
batchOperate(type) { batchOperate(type) {
// this.tableSelections // this.tableSelections
if (type == '1') { if (type == '1') {
// //
this.getInitData()
} else { } else {
// //

60
src/views/HosInformation.vue

@ -66,25 +66,36 @@
<GroupFormBtns @cancel="cancelClick" @confirm="submitForm('siteForm')" /> <GroupFormBtns @cancel="cancelClick" @confirm="submitForm('siteForm')" />
</div> </div>
<div class="siteMessage flex-common" id="siteMessage2"> <div class="siteMessage flex-common" id="siteMessage2">
<p class="littleTitle mb32">出诊时间</p> <p class="littleTitle mb32">初诊审批</p>
<el-form :model="siteForm1" :rules="siteFormrules1" ref="siteForm1"> <el-form :model="siteForm2" :rules="siteFormrules2" ref="siteForm2">
<div class="flex-wrap"> <div class="flex-wrap">
<div class="flex-left"> <div class="flex-left">
<GuipRadio v-model="siteForm2.isApprove" class="mb12" column="column" :options="groupOptions"
label="初诊是否审批" required prop="isApprove" @change="radioChange" />
<GuipInput ref="GuipInput" column="column" label="审批人电话" desc="审批人电话、微信,至少填写一项"
v-model="siteForm2.phone" prop="phone" placeholder="请输入" />
</div> </div>
<div class="flex-line"></div> <div class="flex-line"></div>
<div class="flex-right"> <div class="flex-right">
<GuipFormItem column="column" label="每周出诊安排" :required="true"> <GuipFormItem column="column" label="审批人微信" >
<div class="flex weekPlan" slot="formDom"> <span class="desc" slot="formRight">审批人电话微信至少填写一项</span>
<GuipSelect v-for="[key] in Object.entries(weekPlan)" :key="key" v-model="weekPlan[key]" <div class="qqCode-wrap right" slot="formDom">
:options="options_weekPlan" @change="weekChange()" :label="key" placeholder="休息"> <el-upload class="avatar-uploader upload-demo" accept=".jpg,.png" :multiple="false"
</GuipSelect> action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview" :on-remove="handleRemove"
:on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
<hover-button button-text="微信二维码"
:default-icon="require('../assets/upLoad_grey.svg')"
:hover-icon="require('../assets/upLoad_active.svg')"
default-text-color="#23242B" hover-text-color="#006AFF" @click="btnClick" />
<div slot="tip" class="el-upload__tip desc">审批人微信二维码大小2M以内</div>
</el-upload>
</div> </div>
</GuipFormItem> </GuipFormItem>
</div> </div>
</div> </div>
</el-form> </el-form>
<GroupFormBtns @cancel="cancelClick" @confirm="submitForm('siteForm1')" /> <GroupFormBtns @cancel="cancelClick" @confirm="submitForm('siteForm2')" />
</div> </div>
<div class="siteMessage flex-common" id="siteMessage3"> <div class="siteMessage flex-common" id="siteMessage3">
<p class="littleTitle mb32">出诊时间</p> <p class="littleTitle mb32">出诊时间</p>
@ -230,8 +241,8 @@
<div class="selectAllTable-wrap flex-between mt32 mb32"> <div class="selectAllTable-wrap flex-between mt32 mb32">
<div class="left flex"> <div class="left flex">
<div class="checkboxAll"> <div class="checkboxAll">
<el-checkbox @change="handleSelectAllChange1" v-model="selectAll" <el-checkbox @change="handleSelectAllChange1" v-model="selectAll1"
:indeterminate="isIndeterminate">全选</el-checkbox> :indeterminate="isIndeterminate1">全选</el-checkbox>
</div> </div>
<span class="totalCount">{{ courseList.length }}已选{{ selectedCount }}</span> <span class="totalCount">{{ courseList.length }}已选{{ selectedCount }}</span>
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }" <GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }"
@ -297,6 +308,9 @@ import GuipSelect from '@/components/GuipSelect.vue';
import GuipSwitch from '@/components/GuipSwitch.vue'; import GuipSwitch from '@/components/GuipSwitch.vue';
import GuipTable from '@/components/GuipTable.vue'; import GuipTable from '@/components/GuipTable.vue';
import GuipDialog from '@/components/GuipDialog.vue'; import GuipDialog from '@/components/GuipDialog.vue';
import GuipRadio from '@/components/GuipRadio.vue';
import HoverButton from '@/components/HoverButton.vue';
export default { export default {
// //
name: '', name: '',
@ -307,20 +321,22 @@ export default {
BatchProject, BatchProject,
GuipButton, GuipButton,
GuipDialog, GuipDialog,
GuipRadio,
GuipInput, GuipInput,
GuipTable, GuipTable,
GuipSwitch, GuipSwitch,
GuipSelect, GuipSelect,
GuipTextarea, GuipTextarea,
GroupFormBtns GroupFormBtns,
HoverButton
}, },
data() { data() {
return { return {
doctorId:'', doctorId: '',
dialogType: '1', dialogType: '1',
dialogVisible: false, dialogVisible: false,
dialogVisible1: true, dialogVisible1: false,
form1: { form1: {
projectName: '' projectName: ''
}, },
@ -338,6 +354,10 @@ export default {
isIndeterminate1: false, isIndeterminate1: false,
projectSearchId: '', projectSearchId: '',
projectSearchName: '', projectSearchName: '',
groupOptions: [
{ label: '需审批', value: '1' },
{ label: '不需审批', value: '2' },
],
projectList: [ projectList: [
{ {
name: '针灸', name: '针灸',
@ -500,8 +520,13 @@ export default {
domain_source: '平台免费域名', domain_source: '平台免费域名',
}, },
siteForm2: { siteForm2: {
zhifubao_pay: '', isApprove: '',
weixin_pay: '', phone: ''
},
siteFormrules2: {
isApprove: [
{ required: true, message: '请选择初诊审批设置', trigger: ['change','blur' ]}
]
}, },
siteFormrules1: { siteFormrules1: {
domain_source: [ domain_source: [
@ -755,6 +780,9 @@ export default {
domain_radioChange(type) { domain_radioChange(type) {
console.log(type, '--'); console.log(type, '--');
}, },
radioChange(data) {
console.log(data, 'radio--data');
},
onSwitchChange(data) { onSwitchChange(data) {
console.log(data, '---'); console.log(data, '---');
}, },

11
vue.config.js

@ -4,13 +4,12 @@ module.exports = {
// publicPath: '/new/', // publicPath: '/new/',
devServer: { devServer: {
proxy: { proxy: {
'/supernew': { '/api': {
target: 'http://adminnew.pengda.checkcopy.com/', target: 'http://jasonyizherenxin.checkcopy.com',
changeOrigin: true,
},
'/agentnew': {
target: 'http://adminnew.pengda.checkcopy.com/',
changeOrigin: true, changeOrigin: true,
pathRewrite: {
'^/api': ''
}
} }
} }
}, },

Loading…
Cancel
Save