dedsudiyu 2 years ago
parent
commit
ab9867f885
3 changed files with 305 additions and 149 deletions
  1. 11 1
      src/App.vue
  2. 158 147
      src/views/codeHtml.vue
  3. 136 1
      src/views/hazardManagement/hazard/addLaboratory.vue

+ 11 - 1
src/App.vue

@@ -1,5 +1,6 @@
 <template>
 <template>
-    <div id="app">
+    <div id="app" :class="$route.path == '/codeHtml'?'codeHtmlPage':''"
+         :style="$route.path == '/codeHtml'?'width:'+innerWidth+'px!important;height:'+innerHeight+'px!important;':''">
       <router-view />
       <router-view />
     </div>
     </div>
 </template>
 </template>
@@ -7,6 +8,12 @@
 <script>
 <script>
   export default  {
   export default  {
     name:  'App',
     name:  'App',
+    data(){
+      return{
+        innerHeight:window.innerHeight,
+        innerWidth:window.innerWidth,
+      }
+    },
     metaInfo() {
     metaInfo() {
       return {
       return {
         title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
         title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
@@ -83,4 +90,7 @@
   .el-drawer__container,.el-dialog__wrapper,.el-message-box__wrapper{
   .el-drawer__container,.el-dialog__wrapper,.el-message-box__wrapper{
     background: rgba(0,0,0,0.4);
     background: rgba(0,0,0,0.4);
   }
   }
+  .codeHtmlPage{
+    transform: scale(1)!important;
+  }
 </style>
 </style>

+ 158 - 147
src/views/codeHtml.vue

@@ -85,147 +85,147 @@
       hazardLookUp(id){
       hazardLookUp(id){
         hazardLookUp(id).then( data => {
         hazardLookUp(id).then( data => {
           this.text = unescape(data.data.content);
           this.text = unescape(data.data.content);
-          let list = this.text.split('font-size:');
-          let newText = "";
-          for (let i=0;i<list.length;i++){
-            if(
-              (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
-              (list[i][1] == 'p')&&
-              (list[i][2] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][0]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(1)
-              newText = newText + 'font-size:'+num+textNew;
-            }else if(
-              (list[i][0] == ' ')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == 'p')&&
-              (list[i][3] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][1]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(2)
-              newText = newText + 'font-size:'+num+textNew;
-            }else if(
-              (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == 'p')&&
-              (list[i][3] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][0]+list[i][1]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(2)
-              newText = newText + 'font-size:'+num+textNew;
-            }else if(
-              (list[i][0] == ' ')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
-              (list[i][3] == 'p')&&
-              (list[i][4] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][1]+list[i][2]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(3)
-              newText = newText + 'font-size:'+num+textNew;
-            }else if(
-              (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
-              (list[i][3] == 'p')&&
-              (list[i][4] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][0]+list[i][1]+list[i][2]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(3)
-              newText = newText + 'font-size:'+num+textNew;
-            }else if(
-              (list[i][0] == ' ')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
-              (list[i][3] == '0' || list[i][3] == '1' || list[i][3] == '2' || list[i][3] == '3' || list[i][3] == '4' || list[i][3] == '5' || list[i][3] == '6' || list[i][3] == '7' || list[i][3] == '8' || list[i][3] == '9')&&
-              (list[i][4] == 'p')&&
-              (list[i][5] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][1]+list[i][2]+list[i][3]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(4)
-              newText = newText + 'font-size:'+num+textNew;
-            }else{
-              newText = newText + list[i]
-            }
-          }
-          list = newText.split('line-height:');
-          newText = "";
-          for (let i=0;i<list.length;i++){
-            if(
-              (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
-              (list[i][1] == 'p')&&
-              (list[i][2] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][0]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(1)
-              newText = newText + 'line-height:'+num+textNew;
-            }else if(
-              (list[i][0] == ' ')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == 'p')&&
-              (list[i][3] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][1]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(2)
-              newText = newText + 'line-height:'+num+textNew;
-            }else if(
-              (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == 'p')&&
-              (list[i][3] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][0]+list[i][1]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(2)
-              newText = newText + 'line-height:'+num+textNew;
-            }else if(
-              (list[i][0] == ' ')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
-              (list[i][3] == 'p')&&
-              (list[i][4] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][1]+list[i][2]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(3)
-              newText = newText + 'line-height:'+num+textNew;
-            }else if(
-              (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
-              (list[i][3] == 'p')&&
-              (list[i][4] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][0]+list[i][1]+list[i][2]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(3)
-              newText = newText + 'line-height:'+num+textNew;
-            }else if(
-              (list[i][0] == ' ')&&
-              (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
-              (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
-              (list[i][3] == '0' || list[i][3] == '1' || list[i][3] == '2' || list[i][3] == '3' || list[i][3] == '4' || list[i][3] == '5' || list[i][3] == '6' || list[i][3] == '7' || list[i][3] == '8' || list[i][3] == '9')&&
-              (list[i][4] == 'p')&&
-              (list[i][5] == 'x')
-            ){
-              let num = this.accMul(parseInt(list[i][1]+list[i][2]+list[i][3]),6);
-              num = num>140?140:num;
-              let textNew = list[i].slice(4)
-              newText = newText + 'line-height:'+num+textNew;
-            }else{
-              newText = newText + list[i]
-            }
-          }
-          this.$set(this,'text',newText);
+          // let list = this.text.split('font-size:');
+          // let newText = "";
+          // for (let i=0;i<list.length;i++){
+          //   if(
+          //     (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
+          //     (list[i][1] == 'p')&&
+          //     (list[i][2] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][0]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(1)
+          //     newText = newText + 'font-size:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == ' ')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == 'p')&&
+          //     (list[i][3] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][1]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(2)
+          //     newText = newText + 'font-size:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == 'p')&&
+          //     (list[i][3] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][0]+list[i][1]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(2)
+          //     newText = newText + 'font-size:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == ' ')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
+          //     (list[i][3] == 'p')&&
+          //     (list[i][4] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][1]+list[i][2]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(3)
+          //     newText = newText + 'font-size:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
+          //     (list[i][3] == 'p')&&
+          //     (list[i][4] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][0]+list[i][1]+list[i][2]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(3)
+          //     newText = newText + 'font-size:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == ' ')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
+          //     (list[i][3] == '0' || list[i][3] == '1' || list[i][3] == '2' || list[i][3] == '3' || list[i][3] == '4' || list[i][3] == '5' || list[i][3] == '6' || list[i][3] == '7' || list[i][3] == '8' || list[i][3] == '9')&&
+          //     (list[i][4] == 'p')&&
+          //     (list[i][5] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][1]+list[i][2]+list[i][3]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(4)
+          //     newText = newText + 'font-size:'+num+textNew;
+          //   }else{
+          //     newText = newText + list[i]
+          //   }
+          // }
+          // list = newText.split('line-height:');
+          // newText = "";
+          // for (let i=0;i<list.length;i++){
+          //   if(
+          //     (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
+          //     (list[i][1] == 'p')&&
+          //     (list[i][2] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][0]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(1)
+          //     newText = newText + 'line-height:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == ' ')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == 'p')&&
+          //     (list[i][3] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][1]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(2)
+          //     newText = newText + 'line-height:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == 'p')&&
+          //     (list[i][3] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][0]+list[i][1]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(2)
+          //     newText = newText + 'line-height:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == ' ')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
+          //     (list[i][3] == 'p')&&
+          //     (list[i][4] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][1]+list[i][2]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(3)
+          //     newText = newText + 'line-height:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == '0' || list[i][0] == '1' || list[i][0] == '2' || list[i][0] == '3' || list[i][0] == '4' || list[i][0] == '5' || list[i][0] == '6' || list[i][0] == '7' || list[i][0] == '8' || list[i][0] == '9')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
+          //     (list[i][3] == 'p')&&
+          //     (list[i][4] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][0]+list[i][1]+list[i][2]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(3)
+          //     newText = newText + 'line-height:'+num+textNew;
+          //   }else if(
+          //     (list[i][0] == ' ')&&
+          //     (list[i][1] == '0' || list[i][1] == '1' || list[i][1] == '2' || list[i][1] == '3' || list[i][1] == '4' || list[i][1] == '5' || list[i][1] == '6' || list[i][1] == '7' || list[i][1] == '8' || list[i][1] == '9')&&
+          //     (list[i][2] == '0' || list[i][2] == '1' || list[i][2] == '2' || list[i][2] == '3' || list[i][2] == '4' || list[i][2] == '5' || list[i][2] == '6' || list[i][2] == '7' || list[i][2] == '8' || list[i][2] == '9')&&
+          //     (list[i][3] == '0' || list[i][3] == '1' || list[i][3] == '2' || list[i][3] == '3' || list[i][3] == '4' || list[i][3] == '5' || list[i][3] == '6' || list[i][3] == '7' || list[i][3] == '8' || list[i][3] == '9')&&
+          //     (list[i][4] == 'p')&&
+          //     (list[i][5] == 'x')
+          //   ){
+          //     let num = this.accMul(parseInt(list[i][1]+list[i][2]+list[i][3]),6);
+          //     num = num>140?140:num;
+          //     let textNew = list[i].slice(4)
+          //     newText = newText + 'line-height:'+num+textNew;
+          //   }else{
+          //     newText = newText + list[i]
+          //   }
+          // }
+          // this.$set(this,'text',newText);
           this.loading = false;
           this.loading = false;
         });
         });
       },
       },
@@ -265,15 +265,17 @@
 </script>
 </script>
 <style lang="scss">
 <style lang="scss">
   #codeHtml{
   #codeHtml{
-    font-size:80px;
     video{
     video{
-      width:1820px;
-      height:1050px;
-      margin:20px;
+      width:100%!important;
+      /*object-fit: fill;*/
+      height:100%!important;
+      /*display: block;*/
     }
     }
     img{
     img{
-      width:1500px;
-      margin:20px 200px;
+      width:100%!important;
+      height:100%!important;
+      /*width:1500px;*/
+      /*margin:20px 200px;*/
     }
     }
   }
   }
 </style>
 </style>
@@ -283,6 +285,11 @@
     overflow:hidden;
     overflow:hidden;
     display: flex;
     display: flex;
     flex-direction: column;
     flex-direction: column;
+    font-size:16px;
+    *{
+      margin:0;
+      padding:0;
+    }
     .pdf-max-box{
     .pdf-max-box{
       flex:1;
       flex:1;
       overflow-y: scroll;
       overflow-y: scroll;
@@ -296,6 +303,10 @@
     }
     }
     .w-e-text{
     .w-e-text{
       flex:1;
       flex:1;
+      overflow-x: hidden;
+      overflow-y: scroll;
+      padding:8px;
+      font-size:16px;
     }
     }
     .w-e-text.table::-webkit-scrollbar{
     .w-e-text.table::-webkit-scrollbar{
       width: 4px;     /*高宽分别对应横竖滚动条的尺寸*/
       width: 4px;     /*高宽分别对应横竖滚动条的尺寸*/

+ 136 - 1
src/views/hazardManagement/hazard/addLaboratory.vue

@@ -32,9 +32,29 @@
       </el-form-item>
       </el-form-item>
       <div class="button-box">
       <div class="button-box">
         <el-button class="color_99" @click="leftButtonClick">取消</el-button>
         <el-button class="color_99" @click="leftButtonClick">取消</el-button>
-        <el-button class="color_ff back_one" @click="rightButtonClick">确定</el-button>
+        <el-button class="color_ff back_one" @click="previewButton">确定</el-button>
       </div>
       </div>
     </el-form>
     </el-form>
+    <el-dialog title="预览" class="richTextDialog" v-if="richTextDialogType" :visible.sync="richTextDialogType" append-to-body>
+      <div class="button-max-box">
+        <el-select v-model="previewKey" placeholder="请选择" style="margin-bottom:20px;">
+          <el-option
+            v-for="item in previewSetList"
+            :key="item.key"
+            :label="item.name"
+            :value="item.key">
+          </el-option>
+        </el-select>
+        <p class="add-button-one-90" style="margin-left:20px;" @click="rightButtonClick">确定</p>
+      </div>
+      <div class="text-max-box" :class="previewKey!=2?'move-text-max-box':''">
+        <p class="text-max-null-p"></p>
+        <div class="text-box scrollbar-box w-e-text" v-html="text"
+             :style="'width:'+previewSetList[previewKey].width+'px;height:'+previewSetList[previewKey].height+'px;'">
+        </div>
+        <p class="text-max-null-p"></p>
+      </div>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -85,6 +105,60 @@ export default {
         UEDITOR_HOME_URL: '/public/ueditor-1.4.3.3/'
         UEDITOR_HOME_URL: '/public/ueditor-1.4.3.3/'
       },
       },
       materialTypeList:[],
       materialTypeList:[],
+      richTextDialogType:false,
+      previewKey:0,
+      previewSetList:[
+        // {
+        //   key:0,
+        //   name:"iphone 12 pro",
+        //   width:390,
+        //   height:884,
+        //   scale:0.203125,
+        // },
+        // {
+        //   key:1,
+        //   name:"iphone XR",
+        //   width:414,
+        //   height:896,
+        //   scale:0.215625,
+        // },
+        {
+          key:0,
+          name:"iphone SE",
+          width:375,
+          height:667,
+          scale:0.195312,
+        },
+        // {
+        //   key:3,
+        //   name:"Samsung Galaxy A51/71",
+        //   width:412,
+        //   height:914,
+        //   scale:0.214583,
+        // },
+        {
+          key:1,
+          name:"Samsung Galaxy S8+",
+          width:360,
+          height:740,
+          scale:0.1875,
+        },
+        // {
+        //   key:5,
+        //   name:"Samsung Galaxy S20",
+        //   width:412,
+        //   height:915,
+        //   scale:0.214583,
+        // },
+        {
+          key:2,
+          name:"化学品终端",
+          width:1041,
+          height:725,
+          scale:0.5421875,
+        },
+      ],
+      text:"",
     }
     }
   },
   },
   created() {
   created() {
@@ -102,6 +176,22 @@ export default {
     })
     })
   },
   },
   methods: {
   methods: {
+    //预览
+    previewButton(){
+
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.$set(this,'text',this.$refs.UEditor.text);
+          this.richTextDialogType = !this.richTextDialogType
+        }
+      });
+      // if(this.$refs.UEditor.text){
+      //   this.$set(this,'text',this.$refs.UEditor.text);
+      //   this.richTextDialogType = !this.richTextDialogType
+      // }else{
+      //   this.msgError('请编辑内容')
+      // }
+    },
     //获取危险源类型
     //获取危险源类型
     dangerList(){
     dangerList(){
       let _this=this;
       let _this=this;
@@ -186,3 +276,48 @@ export default {
   }
   }
 }
 }
 </style>
 </style>
+<style lang="scss">
+  .richTextDialog{
+    .el-dialog{
+      width:1083px;
+      .el-dialog__body{
+        padding:20px;
+      }
+    }
+    .button-max-box{
+      display: flex;
+      .button-null-p{
+        flex:1;
+      }
+    }
+    .text-max-box{
+      display: flex;
+      .text-max-null-p{
+        flex:1;
+      }
+      .text-box{
+        color:#000;
+        font-size:16px;
+        padding:8px;
+        border:1px solid #dedede;
+        font-weight:500;
+      }
+    }
+    .move-text-max-box{
+      video{
+        width:100%!important;
+        /*object-fit: fill;*/
+        height:100%!important;
+        /*display: block;*/
+      }
+      img{
+        width:100%!important;
+        height:100%!important;
+        /*width:1500px;*/
+        /*margin:20px 200px;*/
+      }
+    }
+  }
+  .richTextDemo{
+  }
+</style>