|
@@ -60,83 +60,89 @@
|
60
|
60
|
:visible.sync="dialogVisible"
|
61
|
61
|
width="550px"
|
62
|
62
|
:before-close="handleClose">
|
63
|
|
- <el-form ref="form" :model="form" label-width="80px">
|
64
|
|
- <el-form-item label="模块标题: ">
|
65
|
|
- <el-input v-model="form.name"></el-input>
|
|
63
|
+ <el-form ref="rotationform" :model="rotationform" label-width="90px" rules="rules" >
|
|
64
|
+ <el-form-item label="模块标题: " required prop="title">
|
|
65
|
+ <el-input v-model="rotationform.title"></el-input>
|
66
|
66
|
</el-form-item>
|
67
|
|
- <el-form-item label="排序值: ">
|
68
|
|
- <el-input v-model="form.name"></el-input>
|
|
67
|
+ <el-form-item label="排序值: " required prop="sort">
|
|
68
|
+ <el-input v-model="rotationform.sort"></el-input>
|
69
|
69
|
<p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
|
70
|
70
|
</el-form-item>
|
71
|
|
- <el-form-item label="添加图片: ">
|
|
71
|
+ <el-form-item label="添加图片: " v-model="rotationform.rotationImages" required prop="rotationImages">
|
72
|
72
|
<el-upload
|
73
|
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
|
73
|
+ limit="2"
|
|
74
|
+ :data="rotationData"
|
|
75
|
+ action="https://upload.qiniup.com"
|
74
|
76
|
list-type="picture-card"
|
75
|
|
- :on-preview="handlePictureCardPreview"
|
76
|
|
- :on-remove="handleRemove">
|
|
77
|
+ :on-success="RotationchartSuccess"
|
|
78
|
+ :before-upload="beforeRotationUpload"
|
|
79
|
+ :file-list="filelist">
|
77
|
80
|
<i class="el-icon-plus"></i>
|
78
|
|
- </el-upload>
|
|
81
|
+ </el-upload>
|
79
|
82
|
</el-form-item>
|
|
83
|
+ <span class="uploadfont">图片已上传0张,最多上传9张图片</span>
|
80
|
84
|
</el-form>
|
81
|
85
|
<span slot="footer" class="dialog-footer">
|
82
|
86
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
83
|
|
- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
87
|
+ <el-button type="primary" @click="AddRotationChart('rotationform')">确 定</el-button>
|
84
|
88
|
</span>
|
85
|
89
|
</el-dialog>
|
|
90
|
+
|
86
|
91
|
<!-- 新增医院介绍 -->
|
87
|
92
|
<el-dialog
|
88
|
93
|
title="新增医院介绍"
|
89
|
94
|
:visible.sync="two"
|
90
|
95
|
width="550px"
|
91
|
96
|
:before-close="handleClose">
|
92
|
|
- <el-form ref="form" :model="form" label-width="80px">
|
93
|
|
- <el-form-item label="模块标题: ">
|
94
|
|
- <el-input v-model="form.name"></el-input>
|
|
97
|
+ <el-form ref="hispitalform" :model="hispitalform" label-width="90px" :rules="rules">
|
|
98
|
+ <el-form-item label="模块标题:" required prop="title">
|
|
99
|
+ <el-input v-model="hispitalform.title"></el-input>
|
95
|
100
|
</el-form-item>
|
96
|
|
- <el-form-item label="排序值: ">
|
97
|
|
- <el-input v-model="form.name"></el-input>
|
|
101
|
+ <el-form-item label="排序值:" required prop="sort">
|
|
102
|
+ <el-input v-model="hispitalform.sort" ></el-input>
|
98
|
103
|
<p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
|
99
|
104
|
</el-form-item>
|
100
|
|
- <el-form-item label="医院介绍: ">
|
|
105
|
+ <el-form-item label="医院介绍:" required prop="introduction">
|
101
|
106
|
<el-input
|
102
|
107
|
type="textarea"
|
103
|
108
|
:rows="6"
|
104
|
109
|
placeholder="请输入内容"
|
105
|
|
- v-model="textarea">
|
|
110
|
+ v-model="hispitalform.introduction">
|
106
|
111
|
</el-input>
|
107
|
112
|
</el-form-item>
|
108
|
113
|
</el-form>
|
109
|
114
|
<span slot="footer" class="dialog-footer">
|
110
|
115
|
<el-button @click="two = false">取 消</el-button>
|
111
|
|
- <el-button type="primary" @click="two = false">确 定</el-button>
|
|
116
|
+ <el-button type="primary" @click="saveHispital('hispitalform');">确 定</el-button>
|
112
|
117
|
</span>
|
113
|
118
|
</el-dialog>
|
|
119
|
+
|
114
|
120
|
<!-- 新增科室介绍 -->
|
115
|
121
|
<el-dialog
|
116
|
122
|
title="新增科室介绍"
|
117
|
123
|
:visible.sync="three"
|
118
|
124
|
width="550px"
|
119
|
125
|
:before-close="handleClose">
|
120
|
|
- <el-form ref="form" :model="form" label-width="80px">
|
121
|
|
- <el-form-item label="模块标题: ">
|
122
|
|
- <el-input v-model="form.name"></el-input>
|
|
126
|
+ <el-form ref="administform" :model="administform" label-width="90px" :rules="rules">
|
|
127
|
+ <el-form-item label="模块标题:" required prop="title">
|
|
128
|
+ <el-input v-model="administform.title"></el-input>
|
123
|
129
|
</el-form-item>
|
124
|
|
- <el-form-item label="排序值: ">
|
125
|
|
- <el-input v-model="form.name"></el-input>
|
|
130
|
+ <el-form-item label="排序值:" required prop="sort">
|
|
131
|
+ <el-input v-model="administform.sort" ></el-input>
|
126
|
132
|
<p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
|
127
|
133
|
</el-form-item>
|
128
|
|
- <el-form-item label="科室介绍: ">
|
|
134
|
+ <el-form-item label="科室介绍:" required prop="introduction">
|
129
|
135
|
<el-input
|
130
|
136
|
type="textarea"
|
131
|
137
|
:rows="6"
|
132
|
138
|
placeholder="请输入内容"
|
133
|
|
- v-model="textarea">
|
|
139
|
+ v-model="administform.introduction">
|
134
|
140
|
</el-input>
|
135
|
141
|
</el-form-item>
|
136
|
142
|
</el-form>
|
137
|
143
|
<span slot="footer" class="dialog-footer">
|
138
|
144
|
<el-button @click="three = false">取 消</el-button>
|
139
|
|
- <el-button type="primary" @click="three = false">确 定</el-button>
|
|
145
|
+ <el-button type="primary" @click="addAdminist('administform');">确 定</el-button>
|
140
|
146
|
</span>
|
141
|
147
|
</el-dialog>
|
142
|
148
|
|
|
@@ -146,51 +152,90 @@
|
146
|
152
|
:visible.sync="four"
|
147
|
153
|
width="550px"
|
148
|
154
|
:before-close="handleClose">
|
149
|
|
- <el-form ref="form" :model="form" label-width="80px">
|
150
|
|
- <el-form-item label="模块标题: ">
|
151
|
|
- <el-input v-model="form.name"></el-input>
|
|
155
|
+ <el-form ref="doctorform" :model="doctorform" label-width="90px" :rules="rules">
|
|
156
|
+ <el-form-item label="模块标题:" required prop="title">
|
|
157
|
+ <el-input v-model="doctorform.title"></el-input>
|
152
|
158
|
</el-form-item>
|
153
|
|
- <el-form-item label="排序值: ">
|
154
|
|
- <el-input v-model="form.name"></el-input>
|
|
159
|
+ <el-form-item label="排序值: " required prop="sort">
|
|
160
|
+ <el-input v-model="doctorform.sort"></el-input>
|
155
|
161
|
<p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
|
156
|
162
|
</el-form-item>
|
157
|
|
- <el-form-item label="新增名医: ">
|
|
163
|
+ <el-form-item label="新增名医:" required prop="image">
|
|
164
|
+ <div class="flex-img">
|
|
165
|
+ <div class="el-upload-list el-upload-list--picture-card" v-show="hideShow">
|
|
166
|
+ <div class="el-upload-list__item is-success">
|
|
167
|
+ <img class="flex-img__image" :src="doctorform.image" v-if="doctorform.image">
|
|
168
|
+ <label class="el-upload-list__item-status-label">
|
|
169
|
+ <i class="el-icon-upload-success el-icon-check"></i>
|
|
170
|
+ </label>
|
|
171
|
+ <span class="el-upload-list__item-actions">
|
|
172
|
+ <span class="el-upload-list__item-delete">
|
|
173
|
+ <i class="el-icon-edit-outline" @click="editDoctor()"></i>
|
|
174
|
+ <i class="el-icon-delete" @click="deleteDoctor"></i>
|
|
175
|
+ </span>
|
|
176
|
+ </span>
|
|
177
|
+ </div>
|
|
178
|
+ </div>
|
158
|
179
|
<el-upload
|
159
|
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
160
|
|
- list-type="picture-card"
|
161
|
|
- :on-preview="handlePictureCardPreview"
|
162
|
|
- :on-remove="handleRemove">
|
163
|
|
- <i class="el-icon-plus"></i>
|
164
|
|
- </el-upload>
|
165
|
|
- </el-form-item>
|
|
180
|
+ class="image-uploader"
|
|
181
|
+ action="https://upload.qiniup.com"
|
|
182
|
+ :show-file-list="false"
|
|
183
|
+ :data="uploadData"
|
|
184
|
+ accept="image/jpeg,image/jpg,image/png"
|
|
185
|
+ :on-success="imageUploadSuccess"
|
|
186
|
+ :before-upload="beforeUpload"
|
|
187
|
+ v-show="!hideShow">
|
|
188
|
+ <i class="el-icon-plus"></i>
|
|
189
|
+ </el-upload>
|
|
190
|
+ </div>
|
|
191
|
+ </el-form-item>
|
166
|
192
|
</el-form>
|
167
|
193
|
<span slot="footer" class="dialog-footer">
|
168
|
194
|
<el-button @click="four = false">取 消</el-button>
|
169
|
|
- <el-button type="primary" @click="four = false">确 定</el-button>
|
|
195
|
+ <el-button type="primary" @click="AddDoctor('doctorform')">确 定</el-button>
|
170
|
196
|
</span>
|
171
|
197
|
</el-dialog>
|
|
198
|
+
|
172
|
199
|
<!-- 新增科室环境 -->
|
173
|
200
|
<el-dialog
|
174
|
201
|
title="新增科室环境"
|
175
|
202
|
:visible.sync="five"
|
176
|
203
|
width="550px"
|
177
|
204
|
:before-close="handleClose">
|
178
|
|
- <el-form ref="form" :model="form" label-width="100px">
|
179
|
|
- <el-form-item label="模块标题: ">
|
180
|
|
- <el-input v-model="form.name"></el-input>
|
|
205
|
+ <el-form ref="keform" :model="keform" label-width="110px" rules="rules">
|
|
206
|
+ <el-form-item label="模块标题: " required prop="title">
|
|
207
|
+ <el-input v-model="keform.title"></el-input>
|
181
|
208
|
</el-form-item>
|
182
|
|
- <el-form-item label="排序值: ">
|
183
|
|
- <el-input v-model="form.name"></el-input>
|
|
209
|
+ <el-form-item label="排序值: " required prop="sort">
|
|
210
|
+ <el-input v-model="keform.sort"></el-input>
|
184
|
211
|
<p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
|
185
|
212
|
</el-form-item>
|
186
|
|
- <el-form-item label="新增科室环境: ">
|
187
|
|
- <el-upload
|
188
|
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
189
|
|
- list-type="picture-card"
|
190
|
|
- :on-preview="handlePictureCardPreview"
|
191
|
|
- :on-remove="handleRemove">
|
192
|
|
- <i class="el-icon-plus"></i>
|
|
213
|
+ <el-form-item label="新增科室环境: " required prop="keimages">
|
|
214
|
+ <div class="flex-img">
|
|
215
|
+ <div class="el-upload-list el-upload-list--picture-card" v-show="keshow">
|
|
216
|
+ <div class="el-upload-list__item is-success">
|
|
217
|
+ <img class="flex-img__image" :src="keform.images">
|
|
218
|
+ <label class="el-upload-list__item-status-label">
|
|
219
|
+ <i class="el-icon-upload-success el-icon-check"></i>
|
|
220
|
+ </label>
|
|
221
|
+ <span class="el-upload-list__item-actions">
|
|
222
|
+ <span class="el-upload-list__item-delete">
|
|
223
|
+ <i class="el-icon-edit-outline" ></i>
|
|
224
|
+ <i class="el-icon-delete"></i>
|
|
225
|
+ </span>
|
|
226
|
+ </span>
|
|
227
|
+ </div>
|
|
228
|
+ </div>
|
|
229
|
+ <el-upload
|
|
230
|
+ :data="keData"
|
|
231
|
+ action="https://upload.qiniup.com"
|
|
232
|
+ list-type="picture-card"
|
|
233
|
+ :on-success="handleSuccess"
|
|
234
|
+ :before-upload="beforehandleUpload"
|
|
235
|
+ v-show="!keshow">
|
|
236
|
+ <i class="el-icon-plus"></i>
|
193
|
237
|
</el-upload>
|
|
238
|
+ </div>
|
194
|
239
|
</el-form-item>
|
195
|
240
|
</el-form>
|
196
|
241
|
<span slot="footer" class="dialog-footer">
|
|
@@ -274,7 +319,8 @@
|
274
|
319
|
action="https://jsonplaceholder.typicode.com/posts/"
|
275
|
320
|
list-type="picture-card"
|
276
|
321
|
:on-preview="handlePictureCardPreview"
|
277
|
|
- :on-remove="handleRemove">
|
|
322
|
+ :on-remove="handleRemove"
|
|
323
|
+ >
|
278
|
324
|
<i class="el-icon-plus"></i>
|
279
|
325
|
</el-upload>
|
280
|
326
|
</el-form-item>
|
|
@@ -284,14 +330,69 @@
|
284
|
330
|
<el-button type="primary" @click="eight = false">确 定</el-button>
|
285
|
331
|
</span>
|
286
|
332
|
</el-dialog>
|
|
333
|
+
|
|
334
|
+ <!-- 编辑名医介绍 -->
|
|
335
|
+ <el-dialog
|
|
336
|
+ title="编辑医生介绍"
|
|
337
|
+ :visible.sync="centerDialogVisible"
|
|
338
|
+ width="30%"
|
|
339
|
+ center>
|
|
340
|
+ <el-form label-width="90px" class="clearfix" :model="eidtDoctorform" ref="eidtDoctorform" :rules="rules">
|
|
341
|
+ <el-row :span=20>
|
|
342
|
+ <el-form-item label="医生姓名:" required prop="docname">
|
|
343
|
+ <el-input v-model="eidtDoctorform.docname">
|
287
|
344
|
|
|
345
|
+ </el-input>
|
|
346
|
+ </el-form-item>
|
|
347
|
+ </el-row>
|
|
348
|
+ <el-row :span=20>
|
|
349
|
+ <el-form-item label="医生头像:" required prop="docHead">
|
|
350
|
+ <el-upload
|
|
351
|
+ :data="doctorData"
|
|
352
|
+ class="avatar-uploader"
|
|
353
|
+ action="https://upload.qiniup.com"
|
|
354
|
+ :show-file-list="false"
|
|
355
|
+ :on-success="handleAvatarSuccess"
|
|
356
|
+ :before-upload="beforeAvatarUpload">
|
|
357
|
+ <img v-if="eidtDoctorform.docHead" :src="eidtDoctorform.docHead" class="avatar">
|
|
358
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
359
|
+ </el-upload>
|
|
360
|
+ </el-form-item>
|
|
361
|
+ </el-row>
|
|
362
|
+ <el-row :span=20>
|
|
363
|
+ <el-form-item label="医生职称:" required prop="docpositional">
|
|
364
|
+ <el-input v-model="eidtDoctorform.docpositional">
|
288
|
365
|
|
|
366
|
+ </el-input>
|
|
367
|
+ </el-form-item>
|
|
368
|
+ </el-row>
|
|
369
|
+ <el-row :span=20>
|
|
370
|
+ <el-form-item label="医生简介:" required prop="docintroduction">
|
|
371
|
+ <div style="margin: 10px 0;"></div>
|
|
372
|
+ <el-input
|
|
373
|
+ type="textarea"
|
|
374
|
+ :autosize="{ minRows: 2, maxRows: 4}"
|
|
375
|
+ v-model="eidtDoctorform.docintroduction">
|
|
376
|
+ </el-input>
|
|
377
|
+ </el-form-item>
|
|
378
|
+ </el-row>
|
|
379
|
+ </el-form>
|
|
380
|
+ <span slot="footer" class="dialog-footer">
|
|
381
|
+ <el-button @click="centerDialogVisible = false">取 消</el-button>
|
|
382
|
+ <el-button type="primary" @click="AddDoctorInfo('eidtDoctorform')">确 定</el-button>
|
|
383
|
+ </span>
|
|
384
|
+ </el-dialog>
|
289
|
385
|
</div>
|
290
|
386
|
</template>
|
291
|
387
|
|
292
|
388
|
<script>
|
|
389
|
+ import { saveHispital,addOffices,AddDoctor,AddDoctorInfo } from '@/api/site/site'
|
|
390
|
+ import { getToken } from '@/api/qiniu'
|
|
391
|
+ import { getFileExtension} from '@/utils/tools'
|
|
392
|
+ import { isIP } from 'net';
|
293
|
393
|
export default {
|
294
|
394
|
name: "newfeature",
|
|
395
|
+ props: ['image', 'clearList'],
|
295
|
396
|
data() {
|
296
|
397
|
return {
|
297
|
398
|
new1: require("../../../assets/preview/new-1.png"),
|
|
@@ -303,27 +404,450 @@ export default {
|
303
|
404
|
six: false,
|
304
|
405
|
seven: false,
|
305
|
406
|
eight: false,
|
|
407
|
+ dialogImageUrl: '',
|
|
408
|
+ disabled: false,
|
|
409
|
+ qiniuDomain: 'https://images.shengws.com/',
|
|
410
|
+ uploadData: { token: '', key: '' },
|
|
411
|
+ doctorData: { token: '' ,key: '' },
|
|
412
|
+ rotationData: { token:'',key: '' },
|
|
413
|
+ keData: { token: '' ,key: ''},
|
|
414
|
+ file: this.image ? this.image : '',
|
|
415
|
+ hideShow:false,
|
|
416
|
+ keshow:false,
|
|
417
|
+ show:false,
|
|
418
|
+ keShow:false,
|
|
419
|
+ centerDialogVisible:false,
|
|
420
|
+ filelist:[],
|
306
|
421
|
form: {
|
307
|
|
- name: ""
|
308
|
|
- }
|
|
422
|
+ name: "",
|
|
423
|
+ sort:"",
|
|
424
|
+ textarea:"",
|
|
425
|
+ image:"",
|
|
426
|
+ },
|
|
427
|
+ hispitalform:{
|
|
428
|
+ title:"",
|
|
429
|
+ sort:"",
|
|
430
|
+ introduction:"",
|
|
431
|
+ },
|
|
432
|
+ administform:{
|
|
433
|
+ title:"",
|
|
434
|
+ sort:"",
|
|
435
|
+ introduction:"",
|
|
436
|
+ },
|
|
437
|
+ doctorform:{
|
|
438
|
+ title:"",
|
|
439
|
+ sort:"",
|
|
440
|
+ image:"",
|
|
441
|
+ },
|
|
442
|
+ eidtDoctorform:{
|
|
443
|
+ docname:"",
|
|
444
|
+ docHead:"",
|
|
445
|
+ docpositional:"",
|
|
446
|
+ docintroduction:"",
|
|
447
|
+ },
|
|
448
|
+ rotationform:{
|
|
449
|
+ title:"",
|
|
450
|
+ sort:"",
|
|
451
|
+ rotationImages:[],
|
|
452
|
+ },
|
|
453
|
+ keform:{
|
|
454
|
+ title:"",
|
|
455
|
+ sort:"",
|
|
456
|
+ keImages:[],
|
|
457
|
+ images:"",
|
|
458
|
+ },
|
|
459
|
+ rules: {
|
|
460
|
+ title: [{required: true, message: "请填写模块标题",},],
|
|
461
|
+ sort: [{required: true,message:"请填写排序值"}],
|
|
462
|
+ introduction: [{required: true,message:"请填写医院介绍"}],
|
|
463
|
+ image: [{required: true,message:"请填写新增名医"}],
|
|
464
|
+ docname: [{required:true,message:"请填写医生姓名"}],
|
|
465
|
+ docHead: [{required: true,message:"请填写医生头像"}],
|
|
466
|
+ docpositional:[{required:true,message:"请填写医生职位"}],
|
|
467
|
+ docintroduction:[{required:true,message:"请填写医生简介"}]
|
|
468
|
+ },
|
309
|
469
|
};
|
310
|
|
- }
|
311
|
|
-};
|
|
470
|
+ },
|
|
471
|
+ // 医院介绍模块
|
|
472
|
+ methods:{
|
|
473
|
+ handleRemove(file) {
|
|
474
|
+ console.log(file);
|
|
475
|
+ },
|
|
476
|
+ handlePictureCardPreview(file,res) {
|
|
477
|
+ // this.dialogImageUrl = this.qiniuDomain + res.url;
|
|
478
|
+ // this.dialogVisible = true;
|
|
479
|
+ },
|
|
480
|
+ handleDownload(file) {
|
|
481
|
+ console.log(file);
|
|
482
|
+ },
|
|
483
|
+ handleClose(done){
|
|
484
|
+ this.$confirm('确认关闭?').then(_ =>{
|
|
485
|
+ done();
|
|
486
|
+ })
|
|
487
|
+ .catch(_ =>{});
|
|
488
|
+ },
|
|
489
|
+
|
|
490
|
+ handleSuccess(res,file){
|
|
491
|
+ this.keform.keImages.push(this.qiniuDomain + res.url);
|
|
492
|
+ this.keform.images = this.qiniuDomain + res.url;
|
|
493
|
+ this.keshow = true;
|
|
494
|
+ },
|
|
495
|
+ beforehandleUpload(file){
|
|
496
|
+ const isJPG = file.type === 'image/jpeg';
|
|
497
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
498
|
+ if (!isJPG) {
|
|
499
|
+ this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
500
|
+ }
|
|
501
|
+ if (!isLt2M) {
|
|
502
|
+ this.$message.error('上传头像图片大小不能超过 2MB!');
|
|
503
|
+ }
|
|
504
|
+ var date = new Date()
|
|
505
|
+ var ext = getFileExtension(file.name)
|
|
506
|
+ var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() +'_o_' + file.uid + '.' + ext;
|
|
507
|
+ this.uploading = true;
|
|
508
|
+ this.loadingText = '封面图片上传中'
|
|
509
|
+
|
|
510
|
+ const _self = this
|
|
511
|
+ return new Promise((resolve, reject) => {
|
|
512
|
+ getToken().then(response => {
|
|
513
|
+ const tokentree = response.data.data.uptoken
|
|
514
|
+ console.log("科室token是什么?",tokentree)
|
|
515
|
+ _self._data.keData.token = tokentree;
|
|
516
|
+ _self._data.keData.key = key;
|
|
517
|
+ resolve(true)
|
|
518
|
+ }).catch(err => {
|
|
519
|
+ reject(false)
|
|
520
|
+ this.uploading = false;
|
|
521
|
+ })
|
|
522
|
+ })
|
|
523
|
+
|
|
524
|
+ },
|
|
525
|
+
|
|
526
|
+ imageUploadSuccess(res,file) {
|
|
527
|
+ this.doctorform.image = this.qiniuDomain + res.url;
|
|
528
|
+ this.hideShow = true;
|
|
529
|
+ console.log("這是啥?",this.qiniuDomain+res.url)
|
|
530
|
+ },
|
|
531
|
+ beforeUpload(file) {
|
|
532
|
+ const isJPG = file.type === 'image/jpeg';
|
|
533
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
534
|
+ if (!isJPG) {
|
|
535
|
+ this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
536
|
+ }
|
|
537
|
+ if (!isLt2M) {
|
|
538
|
+ this.$message.error('上传头像图片大小不能超过 2MB!');
|
|
539
|
+ }
|
|
540
|
+ var date = new Date()
|
|
541
|
+ var ext = getFileExtension(file.name)
|
|
542
|
+ var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() +'_o_' + file.uid + '.' + ext;
|
|
543
|
+ this.uploading = true;
|
|
544
|
+ this.loadingText = '封面图片上传中'
|
|
545
|
+
|
|
546
|
+ const _self = this
|
|
547
|
+ return new Promise((resolve, reject) => {
|
|
548
|
+ getToken().then(response => {
|
|
549
|
+ const tokentree = response.data.data.uptoken
|
|
550
|
+ console.log("token是什么?",tokentree)
|
|
551
|
+ _self._data.uploadData.token = tokentree;
|
|
552
|
+ _self._data.uploadData.key = key;
|
|
553
|
+ resolve(true)
|
|
554
|
+ }).catch(err => {
|
|
555
|
+ reject(false)
|
|
556
|
+ this.uploading = false;
|
|
557
|
+ })
|
|
558
|
+ })
|
|
559
|
+
|
|
560
|
+ },
|
|
561
|
+ handleRemove() {
|
|
562
|
+ this.file = '';
|
|
563
|
+ },
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+ handleAvatarSuccess(res, file) {
|
|
567
|
+ this.eidtDoctorform.docHead = this.qiniuDomain + res.url;
|
|
568
|
+ },
|
|
569
|
+ beforeAvatarUpload(file) {
|
|
570
|
+ console.log("尺寸",file.size)
|
|
571
|
+ const isJPG = file.type === 'image/jpeg';
|
|
572
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
573
|
+
|
|
574
|
+ if (!isJPG) {
|
|
575
|
+ this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
576
|
+ }
|
|
577
|
+ if (!isLt2M) {
|
|
578
|
+ this.$message.error('上传头像图片大小不能超过 2MB!');
|
|
579
|
+ }
|
|
580
|
+
|
|
581
|
+ var date = new Date()
|
|
582
|
+ var ext = getFileExtension(file.name)
|
|
583
|
+ var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() +'_o_' + file.uid + '.' + ext;
|
|
584
|
+ this.uploading = true;
|
|
585
|
+ this.loadingText = '封面图片上传中'
|
|
586
|
+
|
|
587
|
+ const _self = this
|
|
588
|
+ return new Promise((resolve, reject) => {
|
|
589
|
+ getToken().then(response => {
|
|
590
|
+ const token= response.data.data.uptoken
|
|
591
|
+ console.log("医生头像token是什么?",token)
|
|
592
|
+ _self._data.doctorData.token = token;
|
|
593
|
+ _self._data.doctorData.key = key;
|
|
594
|
+ resolve(true)
|
|
595
|
+ }).catch(err => {
|
|
596
|
+ reject(false)
|
|
597
|
+ this.uploading = false;
|
|
598
|
+ })
|
|
599
|
+ })
|
|
600
|
+ return isJPG && isLt2M;
|
|
601
|
+ },
|
|
602
|
+
|
|
603
|
+ //轮播图
|
|
604
|
+ RotationchartSuccess(res,file,filelist){
|
|
605
|
+ this.rotationform.rotationImages.push(this.qiniuDomain + res.url);
|
|
606
|
+ console.log("轮播图地址",this.rotationform.rotationImages);
|
|
607
|
+ },
|
|
608
|
+ beforeRotationUpload(file){
|
|
609
|
+ console.log("尺寸",file.size)
|
|
610
|
+ const isJPG = file.type === 'image/jpeg';
|
|
611
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
612
|
+
|
|
613
|
+ if (!isJPG) {
|
|
614
|
+ this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
615
|
+ }
|
|
616
|
+ if (!isLt2M) {
|
|
617
|
+ this.$message.error('上传头像图片大小不能超过 2MB!');
|
|
618
|
+ }
|
|
619
|
+
|
|
620
|
+ var date = new Date()
|
|
621
|
+ var ext = getFileExtension(file.name)
|
|
622
|
+ var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() +'_o_' + file.uid + '.' + ext;
|
|
623
|
+ this.uploading = true;
|
|
624
|
+ this.loadingText = '封面图片上传中'
|
|
625
|
+
|
|
626
|
+ const _self = this
|
|
627
|
+ return new Promise((resolve, reject) => {
|
|
628
|
+ getToken().then(response => {
|
|
629
|
+ const token= response.data.data.uptoken
|
|
630
|
+ console.log("轮播图token是什么?",token)
|
|
631
|
+ _self._data.rotationData.token = token;
|
|
632
|
+ _self._data.rotationData.key = key;
|
|
633
|
+ resolve(true)
|
|
634
|
+ }).catch(err => {
|
|
635
|
+ reject(false)
|
|
636
|
+ this.uploading = false;
|
|
637
|
+ })
|
|
638
|
+ })
|
|
639
|
+ return isJPG && isLt2M;
|
|
640
|
+ },
|
|
641
|
+
|
|
642
|
+ //新增轮播图
|
|
643
|
+ AddRotationChart(forName){
|
|
644
|
+ this.$refs[formName].validate((valid)=>{
|
|
645
|
+ if(valid){
|
|
646
|
+ AddRotationChart(this.rotationform).then(response=>{
|
|
647
|
+ if(response.data.state==1){
|
|
648
|
+
|
|
649
|
+ }
|
|
650
|
+ })
|
|
651
|
+ }
|
|
652
|
+ })
|
|
653
|
+ },
|
|
654
|
+
|
|
655
|
+ //医院介绍
|
|
656
|
+ saveHispital(formName){
|
|
657
|
+ this.$refs[formName].validate((valid)=>{
|
|
658
|
+ if(valid){
|
|
659
|
+ saveHispital(this.hispitalform).then(response=>{
|
|
660
|
+ if(response.data.state==1){
|
|
661
|
+ var hospital = response.data.data.hospital;
|
|
662
|
+ console.log("返回数据",hospital)
|
|
663
|
+ this.$message.success("添加医院介绍成功");
|
|
664
|
+ this.two = false;
|
|
665
|
+ }
|
|
666
|
+ })
|
|
667
|
+ }
|
|
668
|
+ })
|
|
669
|
+ },
|
|
670
|
+
|
|
671
|
+ //科室介绍
|
|
672
|
+ addAdminist(formName){
|
|
673
|
+ this.$refs[formName].validate((valid)=>{
|
|
674
|
+ if(valid){
|
|
675
|
+ addOffices(this.administform).then(response=>{
|
|
676
|
+ if(response.data.state==1){
|
|
677
|
+ var offices = response.data.data.offices;
|
|
678
|
+ console.log("返回数据",offices);
|
|
679
|
+ this.$message.success("添加科室介绍成功");
|
|
680
|
+ this.three = false;
|
|
681
|
+ }
|
|
682
|
+ })
|
|
683
|
+ }
|
|
684
|
+ })
|
|
685
|
+ },
|
|
686
|
+
|
|
687
|
+ //名医介绍
|
|
688
|
+ AddDoctor(formName){
|
|
689
|
+ this.$refs[formName].validate((valid)=>{
|
|
690
|
+ if(valid){
|
|
691
|
+ AddDoctor(this.doctorform).then(response=>{
|
|
692
|
+ if(response.data.state==1){
|
|
693
|
+ var doctor = response.data.data.doctor;
|
|
694
|
+ console.log("返回数据",doctor);
|
|
695
|
+ this.$message.success("添加名医成功");
|
|
696
|
+ this.four = false;
|
|
697
|
+ }
|
|
698
|
+ })
|
|
699
|
+ }
|
|
700
|
+ })
|
|
701
|
+ },
|
|
702
|
+ editDoctor(){
|
|
703
|
+ this.centerDialogVisible = true;
|
|
704
|
+ },
|
|
705
|
+ deleteDoctor(){
|
|
706
|
+ this.hideShow = false;
|
|
707
|
+ },
|
|
708
|
+
|
|
709
|
+ //编辑医生介绍
|
|
710
|
+ AddDoctorInfo(formName){
|
|
711
|
+ this.$refs[formName].validate((valid)=>{
|
|
712
|
+ if(valid){
|
|
713
|
+ AddDoctorInfo(this.eidtDoctorform).then(response=>{
|
|
714
|
+ if(response.data.state==1){
|
|
715
|
+ var doctor = response.data.data.doctor;
|
|
716
|
+ console.log("返回数据",doctor);
|
|
717
|
+ this.$message.success("编辑名医成功");
|
|
718
|
+ this.centerDialogVisible = false;
|
|
719
|
+ }
|
|
720
|
+ })
|
|
721
|
+ }
|
|
722
|
+ })
|
|
723
|
+ },
|
|
724
|
+ },
|
|
725
|
+ };
|
312
|
726
|
</script>
|
313
|
727
|
|
314
|
728
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
315
|
729
|
|
316
|
|
-.clearfix {
|
317
|
|
- clear: both;
|
318
|
|
-}
|
319
|
|
-
|
320
|
|
-.el-upload--picture-card {
|
321
|
|
- width: 80px !important;
|
322
|
|
- height: 80px !important;
|
323
|
|
- line-height: 80px !important;
|
324
|
|
-}
|
325
|
|
-.tips {
|
326
|
|
- font-size: 12px;
|
327
|
|
- line-height: 18px;
|
328
|
|
-}
|
|
730
|
+ .clearfix {
|
|
731
|
+ clear: both;
|
|
732
|
+ }
|
|
733
|
+
|
|
734
|
+ .el-upload--picture-card {
|
|
735
|
+ width: 80px !important;
|
|
736
|
+ height: 80px !important;
|
|
737
|
+ line-height: 80px !important;
|
|
738
|
+ }
|
|
739
|
+ .tips {
|
|
740
|
+ font-size: 12px;
|
|
741
|
+ line-height: 18px;
|
|
742
|
+ }
|
|
743
|
+
|
|
744
|
+ //上传样式
|
|
745
|
+ .uploadfont{
|
|
746
|
+ font-size: 14px;
|
|
747
|
+ margin-left: 75px;
|
|
748
|
+ }
|
|
749
|
+ // 名医介绍样式
|
|
750
|
+ .flex-img {
|
|
751
|
+ display: flex;
|
|
752
|
+ }
|
|
753
|
+
|
|
754
|
+ .image-uploader {
|
|
755
|
+ background-color: #fbfdff;
|
|
756
|
+ border: 1px dashed #c0ccda;
|
|
757
|
+ width: 148px;
|
|
758
|
+ height: auto;
|
|
759
|
+ cursor: pointer;
|
|
760
|
+ line-height: 146px;
|
|
761
|
+ text-align: center
|
|
762
|
+ }
|
|
763
|
+
|
|
764
|
+ .image-uploader {
|
|
765
|
+ font-size: 28px;
|
|
766
|
+ color: #8c939d;
|
|
767
|
+ }
|
|
768
|
+
|
|
769
|
+ //编辑名医样式
|
|
770
|
+ .avatar-uploader{
|
|
771
|
+ border: 1px dashed #d9d9d9;
|
|
772
|
+ border-radius: 6px;
|
|
773
|
+ cursor: pointer;
|
|
774
|
+ position: relative;
|
|
775
|
+ overflow: hidden;
|
|
776
|
+ width: 148px;
|
|
777
|
+ height: 148px;
|
|
778
|
+ }
|
|
779
|
+ .avatar-uploader{
|
|
780
|
+ border-color: #409EFF;
|
|
781
|
+ }
|
|
782
|
+ .avatar-uploader-icon {
|
|
783
|
+ font-size: 28px;
|
|
784
|
+ color: #8c939d;
|
|
785
|
+ width: 148px;
|
|
786
|
+ height: 148px;
|
|
787
|
+ line-height: 148px;
|
|
788
|
+ text-align: center;
|
|
789
|
+ }
|
|
790
|
+ .avatar {
|
|
791
|
+ width: 178px;
|
|
792
|
+ height: 178px;
|
|
793
|
+ display: block;
|
|
794
|
+ }
|
|
795
|
+</style>
|
|
796
|
+<style /deep/scoped>
|
|
797
|
+ .disabled {
|
|
798
|
+ display: none;
|
|
799
|
+ }
|
|
800
|
+
|
|
801
|
+ .el-upload--picture-card {
|
|
802
|
+ height: auto
|
|
803
|
+ }
|
|
804
|
+
|
|
805
|
+ .el-upload-list--picture-card .el-upload-list__item {
|
|
806
|
+ height: auto;
|
|
807
|
+ }
|
|
808
|
+
|
|
809
|
+ .el-upload-list--picture-card .el-upload-list__item {
|
|
810
|
+ overflow: hidden;
|
|
811
|
+ background-color: #fff;
|
|
812
|
+ border: 1px solid #c0ccda;
|
|
813
|
+ border-radius: 6px;
|
|
814
|
+ -webkit-box-sizing: border-box;
|
|
815
|
+ box-sizing: border-box;
|
|
816
|
+ width: 148px;
|
|
817
|
+ height: auto;
|
|
818
|
+ margin: 0 8px 8px 0;
|
|
819
|
+ display: inline-block;
|
|
820
|
+ }
|
|
821
|
+
|
|
822
|
+ .el-upload-list__item.is-success .el-upload-list__item-status-label {
|
|
823
|
+ display: block;
|
|
824
|
+ position: absolute;
|
|
825
|
+ right: -15px;
|
|
826
|
+ top: -6px;
|
|
827
|
+ width: 40px;
|
|
828
|
+ height: 24px;
|
|
829
|
+ background: #13ce66;
|
|
830
|
+ text-align: center;
|
|
831
|
+ -webkit-transform: rotate(45deg);
|
|
832
|
+ transform: rotate(45deg);
|
|
833
|
+ -webkit-box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
|
834
|
+ box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
|
835
|
+ }
|
|
836
|
+
|
|
837
|
+ .el-upload-list--picture-card .el-upload-list__item-actions {
|
|
838
|
+ position: absolute;
|
|
839
|
+ width: 100%;
|
|
840
|
+ height: 100%;
|
|
841
|
+ left: 0;
|
|
842
|
+ top: 0;
|
|
843
|
+ cursor: default;
|
|
844
|
+ text-align: center;
|
|
845
|
+ color: #fff;
|
|
846
|
+ opacity: 0;
|
|
847
|
+ font-size: 20px;
|
|
848
|
+ background-color: rgba(0, 0, 0, 0.5);
|
|
849
|
+ -webkit-transition: opacity .3s;
|
|
850
|
+ transition: opacity .3s;
|
|
851
|
+ }
|
329
|
852
|
</style>
|
|
853
|
+
|