소스 검색

添加选择语言

gzb
guozhongbo 1 년 전
부모
커밋
7970d23a0e
2개의 변경된 파일49개의 추가작업 그리고 11개의 파일을 삭제
  1. 24
    7
      src/views/school/index.vue
  2. 25
    4
      src/views/service/index.vue

+ 24
- 7
src/views/school/index.vue 파일 보기

@@ -51,6 +51,12 @@
51 51
         :rules="addFormRules"
52 52
         :model="add_form"
53 53
       >
54
+        <FormItem label="语言" prop="ltype">
55
+          <RadioGroup v-model="add_form.ltype">
56
+            <Radio :label="1">中文</Radio>
57
+            <Radio :label="2">英文</Radio>
58
+          </RadioGroup>
59
+        </FormItem>
54 60
         <FormItem label="服务案例" prop="schoolname">
55 61
           <Input v-model="add_form.schoolname" placeholder="请输入学校名称" />
56 62
         </FormItem>
@@ -211,8 +217,8 @@ export default {
211 217
           width: 70,
212 218
           render: (h, params) => {
213 219
             return h(
214
-                "span",
215
-                params.index +
220
+              "span",
221
+              params.index +
216 222
                 (this.form_search.page - 1) * this.form_search.size +
217 223
                 1
218 224
             );
@@ -314,7 +320,8 @@ export default {
314 320
         show: false,
315 321
         schoolname: "",
316 322
         schoollogo: "",
317
-        slorder: 0
323
+        slorder: 0,
324
+        ltype: 1
318 325
       },
319 326
       revise_data: {
320 327
         show: false,
@@ -337,6 +344,14 @@ export default {
337 344
         ]
338 345
       },
339 346
       addFormRules: {
347
+        ltype: [
348
+          {
349
+            required: true,
350
+            type: "number",
351
+            message: "请选择语言",
352
+            trigger: "change"
353
+          }
354
+        ],
340 355
         schoolname: [
341 356
           {
342 357
             required: true,
@@ -379,6 +394,7 @@ export default {
379 394
     add() {
380 395
       this.$refs["AddForm"].resetFields();
381 396
       this.add_form.show = true;
397
+      this.add_form.ltype = JSON.parse(JSON.stringify(this.form_search.ltype));
382 398
       this.add_form.slorder = this.school.total + 1;
383 399
     },
384 400
     revise() {
@@ -392,7 +408,8 @@ export default {
392 408
             schoolname: this.revise_data.data.schoolname,
393 409
             schoollogo: this.revise_data.data.schoollogo,
394 410
             slorder: this.revise_data.data.slorder,
395
-            scid: this.revise_data.data.scid
411
+            slid: this.revise_data.data.slid,
412
+            ltype: this.revise_data.data.ltype
396 413
           }).then((res) => {
397 414
             if (res.code == 0) {
398 415
               this.revise_data.show = false;
@@ -406,7 +423,7 @@ export default {
406 423
       });
407 424
     },
408 425
     del(data) {
409
-      sl_del({ scid: data.scid }).then((res) => {
426
+      sl_del({ slid: data.slid }).then((res) => {
410 427
         if (res.code == 0) {
411 428
           if (this.form_search.page != 1 && this.school.list.length == 1) {
412 429
             this.form_search.page--;
@@ -429,7 +446,7 @@ export default {
429 446
           sl_save({
430 447
             schoolname: this.add_form.schoolname,
431 448
             schoollogo: this.add_form.schoollogo,
432
-            ltype: this.form_search.ltype,
449
+            ltype: this.add_form.ltype,
433 450
             slorder: this.add_form.slorder,
434 451
             createid: this.userInfo.userid
435 452
           }).then((res) => {
@@ -463,7 +480,7 @@ export default {
463 480
       }
464 481
       let formData = new FormData();
465 482
       formData.append("file", file);
466
-      formData.append("savefolder", "servicecase");
483
+      formData.append("savefolder", "schoollogo");
467 484
       let url = that.$api.baseUrl + "file/upload";
468 485
       that.showLoading = true;
469 486
       axios

+ 25
- 4
src/views/service/index.vue 파일 보기

@@ -20,7 +20,12 @@
20 20
     <div>
21 21
       <Table border :data="service.list" :columns="columns">
22 22
         <template slot-scope="{ row }" slot="scpic">
23
-          <img class="img" v-if="row.scpic" :src="$api.showImageUrl +row.scpic" v-viewer />
23
+          <img
24
+            class="img"
25
+            v-if="row.scpic"
26
+            :src="$api.showImageUrl + row.scpic"
27
+            v-viewer
28
+          />
24 29
         </template>
25 30
       </Table>
26 31
       <div class="foot_page" v-if="service.total > 0">
@@ -46,6 +51,12 @@
46 51
         :rules="addFormRules"
47 52
         :model="add_form"
48 53
       >
54
+        <FormItem label="语言" prop="ltype">
55
+          <RadioGroup v-model="add_form.ltype">
56
+            <Radio :label="1">中文</Radio>
57
+            <Radio :label="2">英文</Radio>
58
+          </RadioGroup>
59
+        </FormItem>
49 60
         <FormItem label="服务案例" prop="scname">
50 61
           <Input v-model="add_form.scname" placeholder="请输入服务案例" />
51 62
         </FormItem>
@@ -206,8 +217,8 @@ export default {
206 217
           width: 70,
207 218
           render: (h, params) => {
208 219
             return h(
209
-                "span",
210
-                params.index +
220
+              "span",
221
+              params.index +
211 222
                 (this.form_search.page - 1) * this.form_search.size +
212 223
                 1
213 224
             );
@@ -309,7 +320,8 @@ export default {
309 320
         show: false,
310 321
         scname: "",
311 322
         scpic: "",
312
-        scorder: 0
323
+        scorder: 0,
324
+        ltype: 1
313 325
       },
314 326
       revise_data: {
315 327
         show: false,
@@ -332,6 +344,14 @@ export default {
332 344
         ]
333 345
       },
334 346
       addFormRules: {
347
+        ltype: [
348
+          {
349
+            required: true,
350
+            type: "number",
351
+            message: "请选择语言",
352
+            trigger: "change"
353
+          }
354
+        ],
335 355
         scname: [
336 356
           {
337 357
             required: true,
@@ -374,6 +394,7 @@ export default {
374 394
     add() {
375 395
       this.$refs["AddForm"].resetFields();
376 396
       this.add_form.show = true;
397
+      this.add_form.ltype = JSON.parse(JSON.stringify(this.form_search.ltype));
377 398
       this.add_form.scorder = this.service.total + 1;
378 399
     },
379 400
     revise() {

Loading…
취소
저장