Преглед на файлове

合并byll分支
Squashed commit of the following:

commit 1fe1910a2a54e5ece7a2b3ea8162cd9c7827059b
Merge: 7ef08db 3a8f52d
Author: Luolei <16657115156@163.com>
Date: Thu Jul 18 16:39:19 2019 +0800

Merge branch 'dev' into byll

commit 7ef08db55a456528a93b2ca8bb204b67a83daa80
Author: Luolei <16657115156@163.com>
Date: Thu Jul 18 16:38:09 2019 +0800

图片上传数据结构修改

liucf преди 5 години
родител
ревизия
e97b925baf
променени са 4 файла, в които са добавени 57 реда и са изтрити 20 реда
  1. 1 1
      src/common/MultiLineInput.vue
  2. 2 2
      src/components/Preview.vue
  3. 31 16
      src/components/TabPage.vue
  4. 23 1
      src/utils/tools.js

+ 1 - 1
src/common/MultiLineInput.vue

@@ -3,7 +3,7 @@
     <span class="prefix" v-if="content.prefix">{{content.prefix}}</span>
     <div class="sticP" :style="{paddingRight:content.suffix?'1rem':'0'}">
         <div class="iptWrap">
-          <input class="contentVal" :type="content.type" :placeholder="content.placeholder" v-model="txt" @input="changeVal" @blur="blur">
+          <input class="contentVal" :type="content.type" :placeholder="content.placeholder" v-model.number="txt" @input="changeVal" @blur="blur">
         </div>
     </div>
     <span class="suffix" v-if="content.suffix">{{content.suffix}}</span>

+ 2 - 2
src/components/Preview.vue

@@ -112,9 +112,9 @@ export default {
           formData.append('type', imgList[i].type);
         }
         api.uploadImageThums(formData).then((res) => {//获取图片
-          console.log(res)
+          console.log(res.data)
           let result = res.data;
-          if (result.length > 0) {//图片提交成功再保存数据
+          if (result.code == 0) {//图片提交成功再保存数据
             // this.showType = 'success'
             // this.submit = true
             let reportList = []

+ 31 - 16
src/components/TabPage.vue

@@ -3,16 +3,21 @@
     <div class="tab"
       v-if="modlues&&modlues.length>0 && moduleShow">
       <p v-for="(it,index) in modlues"
+        :style="{'width':1/modlues.length*100+'%'}"
         :key="it.id">
         <span :class="{current:index==parseInt(flag)-1,comp:finish[it.type]}"
           v-if="type[it.type]==1">
-          <i>{{it.type}}</i>
+          <!-- <i>{{it.type}}</i> -->
+          <i>{{index+1}}</i>
           {{it.name}}
         </span>
       </p>
     </div>
     <!-- 内容 -->
     <div class="content">
+      <template v-for="(item,idx) in modlues">
+        
+      </template>
       <Symptom
         v-if="flag==1&&moduleShow"
         @next="toNext"
@@ -54,11 +59,14 @@ import AddContent from './AddContent.vue';
 import DiagTreat from './DiagTreat.vue';
 import Others from './Others.vue';
 import Preview from './Preview.vue';
+import {moduleConfig} from '../utils/tools.js';
 export default {
   name: 'TabPage',
   data() {
     let sysConfig = this.$store.state.sysConfig;
-    let allMoudles = this.$store.state.allMoudles;
+    let tmpAllMoudles = this.$store.state.allMoudles;
+    let allMoudles = moduleConfig(sysConfig,tmpAllMoudles);
+    
     return {
       config: sysConfig,
       modlues: allMoudles,
@@ -68,7 +76,7 @@ export default {
         "3": sysConfig.length > 0 && sysConfig.filter(item => item.code == "omhistory_show")[0].value,
         "4": sysConfig.length > 0 && sysConfig.filter(item => item.code == "replenish_show")[0].value,
       },
-      flag: allMoudles.length > 0 && allMoudles[0].type,
+      flag: 1,
       moduleShow:true,
       finish:{ //标识已填
         "1":true,
@@ -90,25 +98,30 @@ export default {
         return
       }
       let flag = parseInt(this.flag);
-      if (this.modlues[flag]) {
-        const type = this.modlues[flag].type;
-        this.flag = type;
-        this.finish[type] = true;
-      }
+      this.finish[flag] = true;
+      this.flag = ++flag;
+      
+      // if (this.modlues[flag]) {
+      //   const type = this.modlues[flag].type;
+      //   this.flag = type;
+      //   this.finish[type] = true;
+      // }
     },
     beBack(preview) {
       if(preview === 'preview'){
         this.moduleShow=true
         return
       }
-      let flag = parseInt(this.flag) - 1;
-      if (this.modlues[flag - 1]) {
-        this.flag = this.modlues[flag - 1].type;
-      }
+      let flag = parseInt(this.flag);
+      this.flag = --flag;
+
+      // if (this.modlues[flag - 1]) {
+      //   this.flag = this.modlues[flag - 1].type;
+      // }
     },
     toggleModule(flg){
       this.moduleShow = flg
-    }
+    },
   },
   components: {
     Symptom,
@@ -132,18 +145,20 @@ export default {
     padding-top: 0.16rem;
     p {
       display: inline-block;
+      padding: 0 0.2rem;
+      box-sizing: border-box;
     }
     span {
       font-size: 0.24rem;
       display: inline-block;
       vertical-align: top;
-      width: 1.48rem;
+      width: 100%;
       height: 0.5rem;
       line-height: 0.5rem;
       color: #7c828e;
       text-align: center;
-      margin-left: 0.2rem;
-      margin-right: 0.19rem;
+      // margin-left: 0.2rem;
+      // margin-right: 0.19rem;
     }
     .current {
       color: #0043e8;

+ 23 - 1
src/utils/tools.js

@@ -59,12 +59,34 @@ const getAllStr = (allData) =>{//获取界面数据,拼接字符串
   return allStr;
 }
 
+const moduleConfig = (config,modules) => {
+  let activeModule = []
+  for(let i = 0;i < config.length;i++){
+    let tmpCode = config[i].code
+    for(let j = 0;j < modules.length;j++){
+      let tmpType = modules[j].type
+      if(tmpCode=="symptoms_show"&&tmpType==1){
+        activeModule.push(modules[j])
+      }else if(tmpCode=="diagnosis_show"&&tmpType==2){
+        activeModule.push(modules[j])
+      }else if(tmpCode=="omhistory_show"&&tmpType==3){
+        activeModule.push(modules[j])
+      }else if(tmpCode=="replenish_show"&&tmpType==4){
+        activeModule.push(modules[j])
+      }
+    }
+  }
+  console.log(activeModule)
+  return activeModule
+}
+
 module.exports =  {
   imageUrlPrefix,
   getUrlArgObject,
   deepClone,
   getModelExpStr,
-  getAllStr
+  getAllStr,
+  moduleConfig
 }