Bläddra i källkod

机构信息,富文本上上传图片到七牛

zhengchengwu 6 år sedan
förälder
incheckning
fc98d9c484

+ 1 - 0
index.html Visa fil

@@ -8,6 +8,7 @@
8 8
     <title>血透管理-酷医云</title>
9 9
   </head>
10 10
   <body>
11
+      <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
11 12
     <script src="<%= htmlWebpackPlugin.options.path %>/tinymce4.7.5/tinymce.min.js"></script>
12 13
     <script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.config.js"></script>
13 14
     <script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.all.min.js"></script>

+ 9 - 1
src/components/Neditor/index.vue Visa fil

@@ -22,7 +22,8 @@ export default {
22 22
             this.ue = UE.getEditor(this.id, {
23 23
                 initialFrameWidth: '100%',
24 24
                 initialFrameHeight: '350',
25
-                scaleEnabled: true,
25
+                topOffset:'110',
26
+                // scaleEnabled: true,
26 27
             })
27 28
             //编辑器准备就绪后会触发该事件
28 29
             this.ue.addListener('ready',()=>{
@@ -70,3 +71,10 @@ export default {
70 71
     }
71 72
 }
72 73
 </script>
74
+
75
+
76
+<style>
77
+  .edui-editor {
78
+      z-index: 60 !important;
79
+  }
80
+</style>

+ 5 - 2
src/router/index.js Visa fil

@@ -15,6 +15,7 @@ import stock from './modules/stock'
15 15
 import weight_sign from './modules/weight_sign'
16 16
 import workforce from './modules/workforce'
17 17
 import service from './modules/service'
18
+import org from './modules/org'
18 19
 
19 20
 /** note: submenu only apppear when children.length>=1
20 21
  *   detail see  https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
@@ -87,7 +88,8 @@ if (is_asy_router) {
87 88
     qcd,
88 89
     data_dict,
89 90
     device,
90
-    role
91
+    role,
92
+    org
91 93
   ]
92 94
 } else {
93 95
   _constant_router_map = _constant_router_map.concat([
@@ -99,7 +101,8 @@ if (is_asy_router) {
99 101
     qcd,
100 102
     data_dict,
101 103
     device,
102
-    role
104
+    role,
105
+    org
103 106
   ])
104 107
 }
105 108
 

+ 26 - 0
src/router/modules/org.js Visa fil

@@ -0,0 +1,26 @@
1
+import Layout from '@/views/layout/Layout'
2
+
3
+export default {
4
+    path: '/orginfo',
5
+    component: Layout,
6
+    hidden: true,
7
+    is_menu: false,
8
+    meta: {
9
+        title: 'orginfo',
10
+        icon: 'shebei'
11
+    },
12
+    children: [
13
+        {
14
+            path: '/orginfo',
15
+            component: () => import('@/xt_pages/org/orginfo'),
16
+            hidden: true,
17
+            is_menu: false,
18
+            name: 'orginfo',
19
+            meta: {
20
+                title: '机构信息',
21
+                icon: 'shebei',
22
+                noCache: true
23
+            }
24
+        }
25
+    ]
26
+}

+ 3 - 1
src/views/layout/components/Navbar.vue Visa fil

@@ -123,7 +123,9 @@
123 123
         window.location.href = process.env.BASE_API + '/logout'
124 124
       },
125 125
       modifyOrgInfoAction() {
126
-        this.$refs.modify_org_info_dialog.show()
126
+        // this.$refs.modify_org_info_dialog.show()
127
+        this.$router.push('/orginfo')
128
+        return false
127 129
       },
128 130
       modifyUserInfoAction() {
129 131
         this.$refs.modify_user_info_dialog.show()

+ 4 - 2
src/xt_pages/home/index.vue Visa fil

@@ -42,7 +42,7 @@
42 42
             <li class="taocan-item">
43 43
               <div class="ng-binding" :title="subscibeBan.desc">{{subscibeBan.desc}}</div>
44 44
             </li>
45
-            <li class="taocan-item">
45
+            <!-- <li class="taocan-item">
46 46
               <div class="ng-binding" :title="subscibeBan.detail">{{subscibeBan.detail}}</div>
47 47
             </li>
48 48
             <li class="taocan-item" v-if="this.subscibe.state==3 || this.subscibe.state==2 || leftTime<0">
@@ -56,7 +56,7 @@
56 56
                 <div class="taocan-use clearfix" :style="subscibeBan.pce"></div>
57 57
               </div>
58 58
                 <a class="btn clearfix" v-if="subscibeBan.pay_status" href="javascript:0" @click="openPay">立即购买</a>
59
-            </li>
59
+            </li> -->
60 60
           </ul>
61 61
         </div>
62 62
      </div>
@@ -173,6 +173,8 @@ export default {
173 173
 
174 174
       var leaveTime = 0
175 175
 
176
+      this.subscibe.state = 2;//强制改为免费版
177
+      
176 178
       switch (this.subscibe.state) {
177 179
         case 9:
178 180
           this.subscibeBan = {

+ 0 - 3
src/xt_pages/home/modifyOrgInfoDialog.vue Visa fil

@@ -618,7 +618,4 @@ export default {
618 618
     height: 178px;
619 619
     display: block;
620 620
   }
621
-  .edui-notadd{
622
-      z-index: 9999 !important;
623
-  }
624 621
 </style>

+ 608 - 0
src/xt_pages/org/orginfo.vue Visa fil

@@ -0,0 +1,608 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div  class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+    <div class="app-container " >
7
+      <el-form ref="form" :model="form" label-width="80px" id="edit-org-info-form" v-loading="formloading" :element-loading-text="loadingText" class="clearfix" :popper-append-to-body="false" >
8
+        <el-row >
9
+          <el-col :span="24"  >
10
+            <el-form-item label="机构名称:" prop="org_name">
11
+                <el-input v-model="form.org_name" placeholder="机构名称" ></el-input>
12
+            </el-form-item>
13
+            <el-form-item label="商家简称:" prop="org_short_name">
14
+                <el-input v-model="form.org_short_name" placeholder="商家简称" ></el-input>
15
+            </el-form-item>
16
+            <el-form-item label="机构介绍:" prop="org_introduction">
17
+                <!-- <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="机构介绍" v-model="form.org_introduction">  </el-input> -->
18
+                <keep-alive>
19
+                <neditor ref="neditor" 
20
+                    id="editor" 
21
+                    v-bind:r_content="form.org_introduction">
22
+                </neditor>
23
+            </keep-alive>
24
+            </el-form-item>
25
+            <el-form-item label="机构头像:" prop="org_logo">
26
+                <el-upload
27
+                    v-loading="uploading"
28
+                    :element-loading-text="loadingText"
29
+                    class="avatar-uploader"
30
+                    :data="uploadData"
31
+                    action="https://upload.qiniup.com"
32
+                    :show-file-list="false"
33
+                    :on-error="handleAvatarError"
34
+                    :on-success="handleAvatarSuccess"
35
+                    :before-upload="beforeAvatarUpload">
36
+                    <img v-if="form.org_logo" :src="form.org_logo" class="avatar">
37
+                    <i v-else class="el-icon-plus avatar-uploader-icon"></i>
38
+                </el-upload>
39
+            </el-form-item>
40
+            <el-form-item label="机构地区:" prop="org_area">
41
+                <el-select v-model="form.province" clearable filterable placeholder="请选择" @change="changeProvince">
42
+                    <el-option
43
+                    v-for="item in provinces"
44
+                    :key="item.id"
45
+                    :label="item.name"
46
+                    :value="item.id">
47
+                    </el-option>
48
+                </el-select>
49
+                <el-select v-model="form.city" v-show="form.province&&citys.length>0" clearable filterable placeholder="请选择" @change="changeCity">
50
+                    <el-option
51
+                    v-for="item in citys"
52
+                    :key="item.id"
53
+                    :label="item.name"
54
+                    :value="item.id">
55
+                    </el-option>
56
+                </el-select>
57
+                <el-select v-model="form.district" v-show="form.city&&districts.length>0" clearable filterable placeholder="请选择">
58
+                    <el-option
59
+                    v-for="item in districts"
60
+                    :key="item.id"
61
+                    :label="item.name"
62
+                    :value="item.id">
63
+                    </el-option>
64
+                </el-select>
65
+            </el-form-item>
66
+            <el-form-item label="机构地址:" prop="address">
67
+                <el-input v-model="form.address" placeholder="机构地址" ></el-input>
68
+            </el-form-item>
69
+            <el-form-item label="机构类型:" prop="org_type">
70
+                <el-select v-model="form.parent_type" clearable placeholder="请选择" @change="changeParentType" >
71
+                    <el-option
72
+                    v-for="item in orgtypes"
73
+                    :key="item.id"
74
+                    :label="item.name"
75
+                    :value="item.id">
76
+                    </el-option>
77
+                </el-select>
78
+                <el-select v-model="form.child_type" v-show="form.parent_type&&childtypes.length>0" clearable placeholder="请选择" @change="changeChildType">
79
+                    <el-option
80
+                    v-for="item in childtypes"
81
+                    :key="item.id"
82
+                    :label="item.name"
83
+                    :value="item.id">
84
+                    </el-option>
85
+                </el-select>
86
+            </el-form-item>
87
+            <el-form-item label="机构电话:" prop="telephone">
88
+                <el-input v-model="form.telephone" placeholder="机构电话" ></el-input>
89
+            </el-form-item>
90
+            <el-form-item label="营业状态:" prop="operating_state">
91
+                <el-radio-group v-model="form.operating_state" >
92
+                    <el-radio v-for="item in operatingStateOptions" :key="item.value" :label="item.value" :value="item.value" >{{item.label}}</el-radio>
93
+                </el-radio-group>
94
+            </el-form-item>
95
+            <el-form-item label="营业时间:" prop="business_time">
96
+                <el-input v-model="form.business_week" placeholder="营业时间" style="width:48%"></el-input> 
97
+                <el-input v-model="form.business_time" placeholder="营业时间" style="width:48%"></el-input>
98
+            </el-form-item>
99
+            <el-form-item label="" prop="business_time">
100
+                <el-checkbox-group v-model="form.business_week_select"   @change="handleChangeWeek">
101
+                    <el-checkbox v-for="(item, index) in weekOptions" :label="item" :key="index" :value="item" >{{item}}</el-checkbox>
102
+                </el-checkbox-group>
103
+            </el-form-item>
104
+            
105
+            <el-form-item label="上午:" prop="business_time">
106
+                <el-radio-group v-model="form.business_time_shange" @change="handleChangeTime">
107
+                    <el-radio v-for="(item, index)  in shangOptions" :key="index" :label="item" :value="item" >{{item}}</el-radio>
108
+                </el-radio-group>
109
+            </el-form-item>
110
+            
111
+            <el-form-item label="下午:" prop="business_time_xia">
112
+                <el-radio-group v-model="form.business_time_xia" @change="handleChangeTime">
113
+                    <el-radio v-for="(item, index)  in xiaOptions" :key="index" :label="item" :value="item" >{{item}}</el-radio>
114
+                </el-radio-group>
115
+            </el-form-item>
116
+
117
+            <el-form-item label="服务病种:" prop="illness">
118
+                <el-checkbox-group v-model="form.illness_list"  @change="handleChangeIllness">
119
+                    <el-checkbox v-for="item in illnessOptions" :label="item.id" :key="item.id" :value="item.id" >{{item.illness_name}}</el-checkbox>
120
+                </el-checkbox-group>
121
+            </el-form-item>
122
+            <el-form-item label="机构图册:" prop="gallery">
123
+                <el-upload
124
+                    v-loading="guploading"
125
+                    :data="uploadData"
126
+                    action="https://upload.qiniup.com"
127
+                    list-type="picture-card"
128
+                    :file-list="fileList"
129
+                    :on-remove="handleRemove"
130
+                    :on-error="handleGalleryError"
131
+                    :on-success="handleGallerySuccess"
132
+                    :before-upload="beforeGalleryUpload">
133
+                    <i class="el-icon-plus"></i>
134
+                </el-upload>
135
+            </el-form-item>
136
+          </el-col>
137
+        </el-row>
138
+
139
+        <el-row :span="24">
140
+          <el-col :span="24" align="right" >
141
+            <el-form-item>
142
+                <el-button @click="$router.back(-1)" icon="el-icon-refresh" size="small">取消</el-button>
143
+                <el-button  @click="submitForm"  size="small" type="primary" icon="el-icon-setting" >保存</el-button>
144
+            </el-form-item>
145
+          </el-col>
146
+        </el-row>
147
+
148
+      </el-form>
149
+
150
+    </div>
151
+  </div>
152
+
153
+</template>
154
+
155
+<script>
156
+import { getToken } from '@/api/qiniu'
157
+import {GetOrgInfo,SaveOrgGallery,DeleteOrgGallery,EditOrgInfo} from '@/api/org/orginfo';
158
+import {GetDistrictsByUpid} from '@/api/district';
159
+import { getFileExtension} from '@/utils/tools'
160
+import Neditor from '@/components/Neditor'
161
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
162
+  export default {
163
+    name: 'orginfo',
164
+    data() {
165
+      return {
166
+        crumbs: [
167
+          { path: false, name: '机构信息' },
168
+        ],
169
+        qiniuDomain: 'https://images.shengws.com/',
170
+        formloading:false,
171
+        uploading:false,
172
+        guploading:false,
173
+        formsubmit:false,
174
+        loadingText:'',
175
+        illnessList:[],
176
+        fileList:[],
177
+        provinces:[],
178
+        citys:[],
179
+        districts:[],
180
+        orgtypes:[],
181
+        orgtypesMap:{},
182
+        childtypes:[],
183
+        uploadData: { token: '', key: '' },
184
+        operatingStateOptions: [{ value: 1, label: '正常营业' }, { value: 2, label: '暂未营业' }],
185
+        weekOptions:["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"],
186
+        shangOptions:['1:00','2:00','3:00','4:00','5:00','6:00','7:00','8:00','9:00','10:00','11:00','12:00'],
187
+        xiaOptions:['13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00','24:00'],
188
+        illnessOptions:[],
189
+        form:{
190
+            org_name:'',
191
+            org_short_name:'',
192
+            org_introduction:'',
193
+            org_logo:'',
194
+            province:'',
195
+            city:'',
196
+            district:'',
197
+            address:'',
198
+            parent_type:'',
199
+            child_type:'',
200
+            org_type:'',
201
+            telephone:'',
202
+            operating_state:'',
203
+            business_week:'',
204
+            business_week_select:[],
205
+            business_time_shange:'',
206
+            business_time_xia:'',
207
+            business_time:'',
208
+            illness:'',
209
+            illness_list:[],
210
+            org_gallery:[],
211
+        },
212
+            myConfig: {
213
+            // 如果需要上传功能,找后端小伙伴要服务器接口地址
214
+            serverUrl: '/api/web/upload/ueditor',
215
+            // 你的UEditor资源存放的路径,相对于打包后的index.html
216
+            UEDITOR_HOME_URL: '/NEditor/',
217
+            // 编辑器不自动被内容撑高
218
+            autoHeightEnabled: false,
219
+            // 初始容器高度
220
+            initialFrameHeight: 240,
221
+            // 初始容器宽度
222
+            initialFrameWidth: '100%',
223
+            // 关闭自动保存
224
+            enableAutoSave: false
225
+        },
226
+        
227
+      }
228
+    },
229
+    components: {
230
+        Neditor,
231
+      BreadCrumb
232
+    },
233
+    computed: {
234
+      
235
+    },
236
+    created() {
237
+        this.formloading = true;
238
+        this.loadingText = '加载中...';
239
+        this.GetOrgInfo();
240
+    },
241
+    methods: {
242
+        
243
+        handleChangeIllness(values){
244
+            this.form.illness = values.join(',');
245
+        },
246
+        handleChangeWeek(values) {
247
+            var selectweek = [];
248
+            for (const index in values) {
249
+                var item = {id:this.weekOptions.indexOf(values[index]), name:values[index]};
250
+                selectweek.push(item);
251
+            }
252
+            
253
+            if(selectweek.length==0) {
254
+                this.form.business_week = '';
255
+            }else if(selectweek.length==1) {
256
+                this.form.business_week = selectweek[0];
257
+            }else {
258
+                selectweek = selectweek.sort(function (a,b) {
259
+                    return a.id-b.id;
260
+                });
261
+                var blen = selectweek.length;
262
+                if (blen == (selectweek[blen-1].id - selectweek[0].id + 1)) {
263
+                    this.form.business_week = selectweek[0]["name"] + ' — ' + selectweek[blen-1]["name"];
264
+                }else {
265
+                    var tem = [];
266
+                    for (const index in selectweek) {
267
+                        tem.push(selectweek[index].name);
268
+                    }
269
+                    this.form.business_week = tem.join("、")
270
+                }
271
+               
272
+            }
273
+        },
274
+        handleChangeTime(t){
275
+            if(this.form.business_time_shange.length>0 && this.form.business_time_xia.length>0) {
276
+                this.form.business_time = '上午'+this.form.business_time_shange+"—下午"+this.form.business_time_xia;
277
+            }else if (this.form.business_time_shange.length>0) {
278
+                this.form.business_time = '上午'+this.form.business_time_shange;
279
+            }else if (this.form.business_time_xia.length>0) {
280
+                this.form.business_time = "下午"+this.form.business_time_xia;
281
+            }else {
282
+                this.form.business_time = '';
283
+            }
284
+        },
285
+        handleAvatarError(err, file, fileList) {
286
+            this.$message.error(err);
287
+            this.uploading = false;
288
+            return false
289
+        },
290
+        handleAvatarSuccess(res, file) {
291
+            this.form.org_logo = this.qiniuDomain + res.url;
292
+            this.uploading = false;
293
+        },
294
+        beforeAvatarUpload(file) {
295
+            var fileType = file.type
296
+            const isJPG = fileType.indexOf('image') > -1
297
+            const isLt2M = file.size / 1024 / 1024 < 2
298
+
299
+            if (!isJPG) {
300
+                this.$message.error('只能上传图片')
301
+                return false
302
+            }
303
+            if (!isLt2M) {
304
+                this.$message.error('上传头像图片大小不能超过 2MB!')
305
+                return false
306
+            }
307
+
308
+            var date = new Date()
309
+            var ext = getFileExtension(file.name)
310
+            var key = "" + date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
311
+            this.uploading = true;
312
+            this.loadingText = '机构头像上传中'
313
+
314
+            const _self = this
315
+            return new Promise((resolve, reject) => {
316
+                getToken().then(response => {
317
+                    const token = response.data.data.uptoken
318
+                    _self._data.uploadData.token = token
319
+                    _self._data.uploadData.key = key
320
+                    resolve(true)
321
+                }).catch(err => {
322
+                    reject(false)
323
+                    this.uploading = false;
324
+                })
325
+            })
326
+        },
327
+        handleGalleryError(err, file, fileList) {
328
+            this.$message.error(err);
329
+            this.guploading = false;
330
+            return false
331
+        },
332
+        handleGallerySuccess(res, file) {
333
+            var data = {type:1, url: this.qiniuDomain + res.url};
334
+            SaveOrgGallery(data).then(response=>{
335
+                var res = response.data;
336
+                if (res.state==1) {
337
+                    this.$message.success('上传成功');
338
+                }else {
339
+                    this.$message.error('上传失败');
340
+                }
341
+            }).catch(e=>{});
342
+            this.guploading = false;
343
+        },
344
+        beforeGalleryUpload(file) {
345
+            var fileType = file.type
346
+            const isJPG = fileType.indexOf('image') > -1
347
+            const isLt100M = file.size / 1024 / 1024 < 100
348
+
349
+            if (!isJPG) {
350
+                this.$message.error('只能上传图片')
351
+                return false
352
+            }
353
+            if (!isLt100M) {
354
+                this.$message.error('上传图片大小不能超过 100MB!')
355
+                return false
356
+            }
357
+
358
+            var date = new Date()
359
+            var ext = getFileExtension(file.name)
360
+            var key = ""+date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_g_' + file.uid + '.' + ext;
361
+            this.guploading = true;
362
+            this.loadingText = '机构图册上传中'
363
+
364
+            const _self = this
365
+            return new Promise((resolve, reject) => {
366
+                getToken().then(response => {
367
+                    const token = response.data.data.uptoken
368
+                    _self._data.uploadData.token = token
369
+                    _self._data.uploadData.key = key
370
+                    resolve(true)
371
+                }).catch(err => {
372
+                    reject(false)
373
+                    this.guploading = false;
374
+                })
375
+            })
376
+        },
377
+
378
+        handleRemove(file, fileList) {
379
+            DeleteOrgGallery(file.id).then(response=>{
380
+                var res = response.data;
381
+                if(res.state==1) {
382
+                    this.$message.success('删除成功');
383
+                }else {
384
+                    this.$message.error('删除失败');
385
+                }
386
+            }).catch(e=>{});
387
+            console.log("handleRemove",file, fileList);
388
+        },
389
+        GetOrgInfo(){
390
+            GetOrgInfo().then(response=>{
391
+                var res = response.data;
392
+                if (res.state === 1) {
393
+                    this.form.org_name = res.data.orginfo.org_name;
394
+                    this.form.org_short_name = res.data.orginfo.org_short_name;
395
+                    this.form.org_introduction = res.data.orginfo.org_introduction;
396
+                    this.form.org_logo = res.data.orginfo.org_logo;
397
+                    this.form.province = res.data.orginfo.province;
398
+                    this.form.city = res.data.orginfo.city;
399
+                    this.form.district = res.data.orginfo.district;
400
+                    this.form.address = res.data.orginfo.address;
401
+                    this.form.org_type = res.data.orginfo.org_type;
402
+                    this.form.telephone = res.data.orginfo.telephone;
403
+                    this.form.operating_state = res.data.orginfo.operating_state;
404
+                    this.form.business_week = res.data.orginfo.business_week;
405
+                    this.form.business_week_select = [];
406
+                    this.form.business_time = res.data.orginfo.business_time;
407
+                    this.form.business_time_shange = '';
408
+                    this.form.business_time_xia = '';
409
+                    this.form.illness = res.data.orginfo.illness;
410
+                    this.form.illness_list = [];
411
+                    this.form.org_gallery = res.data.orginfo.org_gallery;
412
+                    this.fileList = [];
413
+                    for (const index in this.form.org_gallery) {
414
+                        var image = {id:this.form.org_gallery[index].id, name:this.form.org_gallery[index].id, url: this.form.org_gallery[index].type==1?this.form.org_gallery[index].url:this.form.org_gallery[index].url+'?vframe/jpg/offset/0/w/100/h/100'};
415
+                        this.fileList.push(image);
416
+                    }
417
+
418
+                    var illness = res.data.orginfo.illness.split(',');
419
+                    for (const index in illness) {
420
+                        var iid = parseInt(illness[index]);
421
+                        if (isNaN(iid) || iid<=0) {
422
+                            continue;
423
+                        }
424
+                        this.form.illness_list.push(iid);
425
+                    }
426
+                    var business_week = this.form.business_week;
427
+                    var business_week_tem = business_week.split(" — ");
428
+                    if(business_week_tem.length==2) {
429
+                        var fromIndex = this.weekOptions.indexOf(business_week_tem[0]);
430
+                        var toIndex = this.weekOptions.indexOf(business_week_tem[1]);
431
+                        if(fromIndex>=0 && toIndex>=0) {
432
+                            for (const index in this.weekOptions) {
433
+                                if(index>=fromIndex && index <= toIndex) {
434
+                                    this.form.business_week_select.push(this.weekOptions[index]);
435
+                                }
436
+                            }
437
+                        }
438
+                    }else {
439
+                        business_week_tem = business_week.split("、");
440
+                        for (const index in business_week_tem) {
441
+                            if(business_week_tem[index].length>0) {
442
+                                this.form.business_week_select.push(business_week_tem[index]);
443
+                            }
444
+                        }
445
+                    }
446
+                    var business_time = this.form.business_time;
447
+                    var business_time_tem = business_time.split("—");
448
+                    if(business_time_tem.length==2) {
449
+                        this.form.business_time_shange = business_time_tem[0].substring(2);
450
+                        this.form.business_time_xia = business_time_tem[1].substring(2);
451
+                    }else {
452
+                        var selectTime = business_time_tem[0].substring(2);
453
+                        if(this.shangOptions.indexOf(selectTime)>-1) {
454
+                            this.form.business_time_shange = selectTime;
455
+                        }else if(this.xiaOptions.indexOf(selectTime)>-1) {
456
+                            this.form.business_time_xia = selectTime;
457
+                        }
458
+                    }
459
+
460
+                    this.provinces = res.data.provinces;
461
+                    this.citys = res.data.citys?res.data.citys:[];
462
+                    this.districts = res.data.districts?res.data.districts:[];
463
+
464
+                    this.orgtypes = [];
465
+                    this.orgtypesMap ={},
466
+                    this.childtypes = [];
467
+                    var orgtypes = res.data.orgtypes;
468
+                    for (const index in orgtypes) {
469
+                        if(orgtypes[index].pid>0) {
470
+                            if(!(orgtypes[index].pid in this.orgtypesMap)) {
471
+                                this.orgtypesMap[orgtypes[index].pid] = [];
472
+                            }
473
+                            this.orgtypesMap[orgtypes[index].pid].push(orgtypes[index]);
474
+                            if(orgtypes[index].id == this.form.org_type) {
475
+                                this.form.child_type = orgtypes[index].id;
476
+                                this.form.parent_type = orgtypes[index].pid;
477
+                            }
478
+                        }else {
479
+                            this.orgtypes.push(orgtypes[index]);
480
+                            if(orgtypes[index].id == this.form.org_type) {
481
+                                this.form.parent_type = orgtypes[index].id;
482
+                            }
483
+                        }
484
+                    }
485
+                    if (this.form.parent_type in this.orgtypesMap) {
486
+                        this.childtypes = this.orgtypesMap[this.form.parent_type];
487
+                    }else {
488
+                        this.childtypes = [];
489
+                    }
490
+                    this.illnessOptions = res.data.illness?res.data.illness:[];
491
+                    this.formloading = false;
492
+                } else {
493
+                    this.$message.error(resp.msg)
494
+                }
495
+            }).catch(e=>{
496
+
497
+            })
498
+        },
499
+         myTrim(x) {
500
+            return x.replace(/^\s+|\s+$/gm,'');
501
+        },
502
+        changeProvince(id) {
503
+            this.citys = [];
504
+            this.districts = [];
505
+            this.form.city = '';
506
+            this.form.district = '';
507
+            var upid = parseInt(id);
508
+            if (isNaN(upid) || upid<=0) {
509
+                return false;
510
+            }
511
+            GetDistrictsByUpid({id:upid}).then(response=>{
512
+                var res = response.data;
513
+                if(res.state===1) {
514
+                    this.citys = res.data.citys?res.data.citys:[];
515
+                }
516
+            }).catch(e=>{
517
+
518
+            })
519
+        },
520
+        changeCity(id) {
521
+            this.districts = [];
522
+            this.form.district = '';
523
+            var upid = parseInt(id);
524
+            if (isNaN(upid) || upid<=0) {
525
+                return false;
526
+            }
527
+            GetDistrictsByUpid({id:upid}).then(response=>{
528
+                var res = response.data;
529
+                if(res.state===1) {
530
+                    this.districts = res.data.citys?res.data.citys:[];
531
+                }
532
+            }).catch(e=>{
533
+
534
+            })
535
+        },
536
+        changeParentType(id) {
537
+            id = parseInt(id);
538
+            this.childtypes = [];
539
+            this.form.child_type = '';
540
+            this.form.org_type = 0;
541
+
542
+            if (isNaN(id) || id<=0) {
543
+                return false;
544
+            }
545
+            if(id in this.orgtypesMap) {
546
+                this.childtypes = this.orgtypesMap[id];
547
+            }else{
548
+                this.childtypes = [];
549
+            }
550
+            
551
+            this.form.org_type = id;
552
+
553
+        },
554
+        changeChildType(id) {
555
+            this.form.org_type = id;
556
+        },
557
+        submitForm(){
558
+            this.form.org_introduction = this.$refs.neditor.content;
559
+            this.formloading = true;
560
+            this.formsubmit = true;
561
+            this.loadingText = '正在保存...';
562
+            EditOrgInfo(this.form).then(response=>{
563
+                var res = response.data;
564
+                if(res.state==1) {
565
+                    this.$message.success("修改成功");
566
+                }else {
567
+                    this.$message.error(res.msg);
568
+                }
569
+                
570
+                this.formloading = false;
571
+                this.formsubmit = false;
572
+            }).catch(e=>{
573
+
574
+                this.formloading = false;
575
+                this.formsubmit = false;
576
+            })
577
+        },
578
+    }
579
+  }
580
+</script>
581
+
582
+<style rel="stylesheet/scss" >
583
+
584
+  #edit-org-info-form .avatar-uploader .el-upload {
585
+    border: 1px dashed #d9d9d9;
586
+    border-radius: 6px;
587
+    cursor: pointer;
588
+    position: relative;
589
+    overflow: hidden;
590
+  }
591
+  #edit-org-info-form .avatar-uploader .el-upload:hover {
592
+    border-color: #409EFF;
593
+  }
594
+  #edit-org-info-form .avatar-uploader-icon {
595
+    font-size: 28px;
596
+    color: #8c939d;
597
+    width: 178px;
598
+    height: 178px;
599
+    line-height: 178px;
600
+    text-align: center;
601
+  }
602
+  #edit-org-info-form .avatar {
603
+    width: 178px;
604
+    height: 178px;
605
+    display: block;
606
+  }
607
+</style>
608
+

+ 1 - 1
static/neditor/dialogs/image/image.html Visa fil

@@ -23,7 +23,7 @@
23 23
             <span class="tab" data-content-id="remote"><var id="lang_tab_remote"></var></span>
24 24
             <span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></var></span>
25 25
             <!-- <span class="tab" data-content-id="online"><var id="lang_tab_online"></var></span> -->
26
-            <span class="tab" data-content-id="search"><var id="lang_tab_search"></var></span>
26
+            <!-- <span class="tab" data-content-id="search"><var id="lang_tab_search"></var></span> -->
27 27
         </div>
28 28
         <div class="alignBar">
29 29
             <label class="algnLabel"><var id="lang_input_align"></var></label>

+ 0 - 1
static/neditor/dialogs/image/image.js Visa fil

@@ -687,7 +687,6 @@
687 687
             });
688 688
 
689 689
             uploader.on('uploadBeforeSend', function (object, data, headers) {
690
-                //这里可以通过data对象添加POST参数
691 690
                 editor.getOpt("imageUploadService")(_this, editor).setFormData(object, data, headers);
692 691
             });
693 692
 

+ 12 - 11
static/neditor/neditor.config.js Visa fil

@@ -36,10 +36,11 @@
36 36
         fileActionName: "uploadfile",
37 37
         imageFieldName: "file", // 提交的图片表单名称
38 38
         imageMaxSize: 2048000, // 上传大小限制,单位B
39
-        imageUrlPrefix: "",
40
-        scrawlUrlPrefix: "",
41
-        videoUrlPrefix: "",
42
-        fileUrlPrefix: "",
39
+        imageUrlPrefix: "https://images.shengws.com/",
40
+        scrawlUrlPrefix: "https://images.shengws.com/",
41
+        videoUrlPrefix: "https://images.shengws.com/",
42
+        fileUrlPrefix: "https://images.shengws.com/",
43
+        uptokenUrl:"http://api.xt.test.sgjyun.com/api/qiniu/uptoken",
43 44
         catcherLocalDomain: "",
44 45
         //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义
45 46
         toolbars: [
@@ -103,10 +104,10 @@
103 104
                     // "simpleupload",
104 105
                     "insertimage",
105 106
                     "emotion",
106
-                    "scrawl",
107
+                    // "scrawl",
107 108
                     "insertvideo",
108 109
                     "music",
109
-                    "attachment",
110
+                    // "attachment",
110 111
                     "map",
111 112
                     "gmap",
112 113
                     "insertframe",
@@ -115,13 +116,13 @@
115 116
                     "template",
116 117
                     "background",
117 118
                     "|",
118
-                    "insertcode",
119
+                    // "insertcode",
119 120
                     "horizontal",
120 121
                     "date",
121 122
                     "time",
122 123
                     "spechars",
123
-                    "snapscreen",
124
-                    "wordimage",
124
+                    // "snapscreen",
125
+                    // "wordimage",
125 126
                     "|",
126 127
                     "inserttable",
127 128
                     "deletetable",
@@ -141,8 +142,8 @@
141 142
                     "print",
142 143
                     "preview",
143 144
                     "searchreplace",
144
-                    "drafts",
145
-                    "help"
145
+                    // "drafts",
146
+                    // "help"
146 147
                 ]
147 148
             ]
148 149
             //当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准

+ 50 - 4
static/neditor/neditor.service.js Visa fil

@@ -8,9 +8,9 @@ UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
8 8
 UE.Editor.prototype.getActionUrl = function(action) {
9 9
     /* 按config中的xxxActionName返回对应的接口地址 */
10 10
     if (action == 'uploadimage' || action == 'uploadscrawl') {
11
-        return 'http://a.b.com/upload.php';
11
+        return 'https://upload.qiniup.com';
12 12
     } else if (action == 'uploadvideo') {
13
-        return 'http://a.b.com/video.php';
13
+        return 'https://upload.qiniup.com';
14 14
     } else {
15 15
         return this._bkGetActionUrl.call(this, action);
16 16
     }
@@ -41,6 +41,31 @@ window.UEDITOR_CONFIG['imageUploadService'] = function(context, editor) {
41 41
          * @returns 上传参数对象
42 42
          */
43 43
         setFormData: function(object, data, headers) {
44
+            
45
+            var date = new Date()
46
+            var ext = object.file.source.ext;
47
+            var uid = object.file.source.uid;
48
+            var key = "" + date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_oi_' + uid + '.' + ext;
49
+
50
+            //这里可以通过data对象添加POST参数
51
+            $.ajax({
52
+                url: editor.getOpt('uptokenUrl'),
53
+                type: 'get',
54
+                async:false,
55
+            }).done(function(res) {
56
+                if (res.state == 1) {
57
+                    data['token'] = res.data.uptoken;
58
+                    data['key'] = key;
59
+                } 
60
+                
61
+            }).fail(function(err) {
62
+                /* 上传失败 */
63
+            });
64
+
65
+            console.log(object, data, headers)
66
+
67
+            
68
+            
44 69
             return data;
45 70
         },
46 71
         /**
@@ -59,7 +84,7 @@ window.UEDITOR_CONFIG['imageUploadService'] = function(context, editor) {
59 84
          * @returns {Boolean} 上传接口返回的response成功状态条件 (比如: res.code == 200)
60 85
          */
61 86
         getResponseSuccess: function(res) {
62
-            return res.code == 200;
87
+            return res.state == "SUCCESS";
63 88
         },
64 89
         /* 指定上传接口返回的response中图片路径的字段,默认为 url
65 90
          * 如果图片路径字段不是res的属性,可以写成 对象.属性 的方式,例如:data.url 
@@ -93,6 +118,26 @@ window.UEDITOR_CONFIG['videoUploadService'] = function(context, editor) {
93 118
          * @returns 上传参数对象
94 119
          */
95 120
         setFormData: function(object, data, headers) {
121
+            var date = new Date()
122
+            var ext = object.file.source.ext;
123
+            var uid = object.file.source.uid;
124
+            var key = "" + date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_oi_' + uid + '.' + ext;
125
+
126
+            //这里可以通过data对象添加POST参数
127
+            $.ajax({
128
+                url: editor.getOpt('uptokenUrl'),
129
+                type: 'get',
130
+                async:false,
131
+            }).done(function(res) {
132
+                if (res.state == 1) {
133
+                    data['token'] = res.data.uptoken;
134
+                    data['key'] = key;
135
+                } 
136
+                
137
+            }).fail(function(err) {
138
+                /* 上传失败 */
139
+            });
140
+
96 141
             return data;
97 142
         },
98 143
         /**
@@ -111,7 +156,8 @@ window.UEDITOR_CONFIG['videoUploadService'] = function(context, editor) {
111 156
          * @returns {Boolean} 上传接口返回的response成功状态条件 (比如: res.code == 200)
112 157
          */
113 158
         getResponseSuccess: function(res) {
114
-            return res.code == 200;
159
+            return res.state == "SUCCESS";
160
+            // return res.code == 200;
115 161
         },
116 162
         /* 指定上传接口返回的response中视频路径的字段,默认为 url
117 163
          * 如果视频路径字段不是res的属性,可以写成 对象.属性 的方式,例如:data.url