Bläddra i källkod

Merge branch 'dev' of http://1.116.113.26:8088/zhuliu/RMS-FrontEnd into dev

zhuhao 2 år sedan
förälder
incheckning
e04a9f6a86

+ 1 - 0
RMS-FrontEnd/src/config/index.js

@@ -2,4 +2,5 @@ export default {
     baseURL: "/api",
     host: window.location.host,
     staticURL: process.env.NODE_ENV === 'production' ? 'http://139.224.24.90:8084' : (process.env.NODE_ENV === 'test'?'http://139.224.24.90:8083':'http://139.224.24.90:8084'),
+    staticURL2: process.env.NODE_ENV === 'production' ? 'http://139.224.24.90:8081' : 'http://139.224.24.90:8081',
 }

+ 1 - 0
RMS-FrontEnd/src/main.js

@@ -30,6 +30,7 @@ Vue.prototype.$api = api
 // Vue.prototype.$echarts = echarts
 Vue.prototype.$d = formatTableDate
 Vue.prototype.$p = Config.staticURL
+Vue.prototype.$p2 = Config.staticURL2
 Vue.prototype.$c = Config
 Vue.prototype.$s = Storage
 Vue.prototype.$_ = lodash

+ 2 - 2
RMS-FrontEnd/src/views/components/articles/components/mixins.js

@@ -24,13 +24,13 @@ export const commonMixins = {
       if (!url) {
         return ''
       }
-      return this.$p + url
+      return this.$p2 + url
     },
     getImagePath1(patent) {
       if(Object.keys(patent).length==0){
         return ''
       }
-      return this.$p + patent.abstractPath
+      return this.$p2 + patent.abstractPath
       // var cc =  patent.publicNo.substring(0,2)
       // if(cc != 'CN'){
       //   var date = patent.publicDate.replace(/-/g,'')

+ 2 - 1
RMS-FrontEnd/src/views/components/common/mixins.js

@@ -323,11 +323,12 @@ if(index!=-1){
             }
         });
   
-        let pattern = new RegExp(selectObject.text.replace(/[\r\n]/g,"").replace(/\ +/g,""),"g");
+       
         let Indexs =[];
         let i=0
 
         if(selectObject.index <0){
+           let pattern = new RegExp(selectObject.text.replace(/[\r\n]/g,"").replace(/\ +/g,""),"g");
             while((match = pattern.exec(elText)) != null){
                 Indexs[i] = match;
                 // console.log(match);

+ 8 - 14
RMS-FrontEnd/src/views/components/identificationCode/index.vue

@@ -51,30 +51,24 @@ export default {
               this.$store.commit("COORDINATION",this.coordination)
               window.open(a.href,"_blank")
             } else {
-              document.getElementsByClassName("el-input__inner")[0].style.border("1px solid red")
+              document.getElementsByClassName("el-input__inner")[0].style.border="1px solid red"
               this.show = true;
               this.content = "识别码错误"
             }
+          }).catch(error=>{
+            document.getElementsByClassName("el-input__inner")[0].style.border="1px solid red"
+              this.show = true;
+              this.content = "识别码错误"
           })
-              // if (this.code == "111") {
-              //     this.$router.push({
-              //         path: ' http://192.168.1.9:8086/Incomplete?taskId=470&reportId=350&type=3&reportType=3',
-              //         // path: '/customer_review',
-              //     })
-              //   } else {
-              //       document.getElementsByClassName("el-input__inner")[0].style.border("1px solid red")
-              //       this.show = true;
-              //       this.content = "识别码错误"
-              //   }
 
             } else {
-                document.getElementsByClassName("el-input__inner")[0].style.border("1px solid red")
+                document.getElementsByClassName("el-input__inner")[0].style.border="1px solid red"
                 this.show = true;
                 this.content = "请输入识别码"
             }
         },
         change() {
-            document.getElementsByClassName("el-input__inner")[0].style.border("1px solid #DCDFE6")
+            document.getElementsByClassName("el-input__inner")[0].style.border="1px solid #DCDFE6"
             this.show = false;
         },
     }
@@ -87,7 +81,7 @@ export default {
 
 .code span {
     position: absolute;
-    top: calc(100%+10px);
+    top: calc(100% + 10px);
     left: 0px;
     color: red;
     font-size: 12px;

+ 1 - 1
RMS-FrontEnd/src/views/layout/index.vue

@@ -130,7 +130,7 @@ export default {
           }
   },
   getPermissionList(){
-    var code = "6a8d3f4d1d5f11eda41c00163e2f0200;5051395c24e311eda41c00163e2f0200;2ca26abd37e211eda41c00163e2f0200"
+    var code = "6a8d3f4d1d5f11eda41c00163e2f0200;5051395c24e311eda41c00163e2f0200;a97c468b924111ed905500163e2f0200"
    this.$api.getPermissionList({code:code}).then(response=>{
         // localStorage.permission =JSON.stringify(JSON.parse(response.data).data) 
         this.$store.commit('SET_ADMIN_PERMISSION', response.data)

+ 21 - 10
RMS-FrontEnd/src/views/report/FTO/FTOPage/components/ProductMessage.vue

@@ -1,25 +1,29 @@
 <template>
     <div style="">
         <el-container>
-            <el-main  style="border:0;padding:35px 20px 20px;">
+            <el-main  style="border:0;padding:20px 20px 20px;">
                 <div class="header1">
-                    <el-button type="primary" @click="saveProduct" v-if="!noEdit1">保存</el-button>
+                    <el-button  @click="changEdit()" v-if="!noEdit1 && !isEdit">编辑</el-button>
+                    <el-button type="primary" @click="saveProduct" v-if="!noEdit1 && isEdit">保存</el-button>
                 </div>
                 <div class="demo-input-suffix" style="width:800px;margin:0 auto">
                     <div>
                         <el-form ref="form" :model="product" :rules="productRules" label-width="200px">
                             <el-form-item label="标的产品:" prop="productName">
-                                <el-input v-model="product.productName" @change="editChange" @blur="editChange" v-if="isEdit == 'productName' " placeholder="请输入"></el-input>
+                                <!-- <el-input v-model="product.productName" @change="editChange" @blur="editChange" v-if="isEdit == 'productName' " placeholder="请输入"></el-input> -->
+                                <el-input v-model="product.productName" v-if="isEdit " placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('productName')" placeholder="请输入" v-else>{{ product.productName }}</span>
                                 <!-- <span>{{ product.productName }}</span> -->
                             </el-form-item> 
                             <el-form-item label="标的产品说明:" prop="productDescription">
-                                <el-input type="textarea" v-model="product.productDescription" @change="editChange" @blur="editChange" v-if="isEdit == 'productDescription'" placeholder="请输入"></el-input>
+                                <!-- <el-input type="textarea" v-model="product.productDescription" @change="editChange" @blur="editChange" v-if="isEdit == 'productDescription'" placeholder="请输入"></el-input> -->
+                                <el-input type="textarea" v-model="product.productDescription" v-if="isEdit" placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('productDescription')" placeholder="请输入" v-else>{{ product.productDescription }}</span>
                                 <!-- <span>{{ product.productDescription }}</span> -->
                             </el-form-item>
                             <el-form-item label="调查区域:" prop="surveyArea" v-if="reportMessage.type == 3">
-                               <el-input type="textarea"  v-model="product.surveyArea" @change="editChange" @blur="editChange" v-if="isEdit == 'surveyArea'" placeholder="请输入"></el-input>
+                               <!-- <el-input type="textarea"  v-model="product.surveyArea" @change="editChange" @blur="editChange" v-if="isEdit == 'surveyArea'" placeholder="请输入"></el-input> -->
+                               <el-input type="textarea"  v-model="product.surveyArea" v-if="isEdit" placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('surveyArea')" placeholder="请输入" v-else>{{ product.surveyArea}}</span>
                             </el-form-item>
                             <el-form-item label="产品图:">
@@ -43,16 +47,17 @@
                                             </span>
                                             <el-image ref="image" class="img" :src="item" :preview-src-list="imgList"></el-image>
                                         </span>
-                                        <i class="el-icon-plus avatar-uploader-icon" v-if="!noEdit1"></i>
+                                        <i class="el-icon-plus avatar-uploader-icon" v-if="!noEdit1 && isEdit"></i>
                                     </span>
                                 </el-upload>
                             </el-form-item>
                             <el-form-item label="检索策略:" prop="searchPolicy" v-if="reportMessage.type == 3">
-                                <el-input v-model="product.searchPolicy" @change="editChange" @blur="editChange" v-if="isEdit == 'searchPolicy'" placeholder="请输入"></el-input>
+                                <!-- <el-input v-model="product.searchPolicy" @change="editChange" @blur="editChange" v-if="isEdit == 'searchPolicy'" placeholder="请输入"></el-input> -->
+                                <el-input v-model="product.searchPolicy" v-if="isEdit" placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('searchPolicy')" placeholder="请输入" v-else>{{ product.searchPolicy}}</span>
                             </el-form-item>
                             <el-form-item label="检索截止日期:" prop="deadLine">
-                                <span v-if="noEdit1 && product.deadLine">{{ product.deadLine.slice(0,10) }}</span>
+                                <span v-if="noEdit1 || !isEdit">{{product.deadLine? product.deadLine.slice(0,10):'' }}</span>
                                 <el-date-picker
                                     v-else
                                     style="width:100%"
@@ -63,7 +68,8 @@
                                     </el-date-picker>
                             </el-form-item>
                             <el-form-item :label="reportMessage.type==3?'关注企业/发明人/技术方向:':'备注:'">
-                                <el-input type="textarea" v-model="product.focusInformation" @change="editChange" @blur="editChange" v-if="isEdit == 'focusInformation'" placeholder="请输入"></el-input>
+                                <!-- <el-input type="textarea" v-model="product.focusInformation" @change="editChange" @blur="editChange" v-if="isEdit == 'focusInformation'" placeholder="请输入"></el-input> -->
+                                <el-input type="textarea" v-model="product.focusInformation" v-if="isEdit" placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('focusInformation')" placeholder="请输入" v-else>{{ product.focusInformation}}</span>
                                 <!-- <span>{{ product.focusInformation }}</span> -->
                             </el-form-item>
@@ -136,7 +142,10 @@ export default{
             if(this.noEdit1){
                 return false
             }
-            this.isEdit = val
+            if(!val){
+                this.isEdit = true
+            }
+            
       },
       editChange() {
           this.isEdit = ''
@@ -245,6 +254,7 @@ export default{
                             this.dialogImageUrl = []
                             this.file = []
                             this.$message.success('产品信息修改成功')
+                            this.isEdit = false
                             this.getProduct()
                         }
                     })
@@ -254,6 +264,7 @@ export default{
                             this.dialogImageUrl = []
                             this.file = []
                             this.$message.success('产品信息保存成功')
+                            this.isEdit = false
                             this.getProduct()
                         }
                     })

+ 15 - 2
RMS-FrontEnd/src/views/report/components/mixins.js

@@ -39,19 +39,31 @@ export const explain = {
         this.innerhtml = ''
       // }
     },
+    //图片路径转64位编码
+    getBase64Image(img) {
+      console.log(img)
+      var canvas = document.createElement("canvas");
+      canvas.width = img.width;
+      canvas.height = img.height;
+      var ctx = canvas.getContext("2d");
+      ctx.drawImage(img, 0, 0, img.width, img.height);
+      var ext = img.src.substring(img.src.lastIndexOf(".")+1).toLowerCase();
+      var dataURL = canvas.toDataURL("image/"+ext);
+      return dataURL;
+    },
     handlePaste(event, row,name) {//图片的处理(剪切板方法clipboard)//row本行数据,name是传过来的row里面每一个属性
       // console.log("handleP",event,row);
       var e = event || window.event
       e.preventDefault();
       const items = (event.clipboardData || window.clipboardData).items;
-      // console.log((event.clipboardData || window.clipboardData).getData('Html'))
+      console.log(items)
       let file = null;
       if (!items || items.length === 0) {//?
         this.$message.error("当前浏览器不支持本地");
         return;
       }
       for (let i = 0; i < items.length; i++) {
-        // console.log(items[i].type)
+        // console.log(items[i])
         if (items[i].type.indexOf("text") !== -1) {
           var text =  (e.originalEvent || e).clipboardData.getData('text/plain') || prompt('在这里输入文本');
           //清除回车
@@ -78,6 +90,7 @@ export const explain = {
       const reader = new FileReader();
       reader.onload = (event) => {
         var blobUrl = event.target.result
+        console.log(blobUrl)
         var new_img = '<img src="' + blobUrl + '" style="width:80px;height: 80px;border: 1px solid #f9f6f675;vertical-align:middle" >';
         
         let str = row[name]?row[name]:''

+ 19 - 3
RMS-FrontEnd/src/views/report/index.vue

@@ -2,13 +2,13 @@
     <div style="background:white;">
         <div style="height:50px">
             <div style="display:inline-block;margin-left:20px">
-                <el-dropdown size="medium" style="margin-top:10px;margin-right:20px">
+                <el-dropdown size="medium" style="margin-top:10px;margin-right:20px" v-if="$permission('/pcs/report/add')">
                 <el-button type="primary" size="small" >
                     创建报告<i class="el-icon-arrow-down el-icon--right"></i>
                 </el-button>
                    <el-dropdown-menu slot="dropdown" style="margin-top:0px" v-if="dictMessage.REPORT_TYPE">
                     <!-- 遍历按钮 -->
-                      <el-dropdown-item v-for="item in dictMessage.REPORT_TYPE.filter(item=>!['6'].includes(item.dictChildValue))" :key="item.dictChildLabel"  @click.native="handleAnalyse(item.dictChildValue)">{{item.dictChildLabel}}</el-dropdown-item>
+                      <el-dropdown-item v-for="item in dictMessage.REPORT_TYPE.filter(item=>!['6'].includes(item.dictChildValue))" :key="item.dictChildLabel"  @click.native="handleAnalyse(item.dictChildValue)" v-if="$permission('/pcs/report/add/'+item.permission)">{{item.dictChildLabel}}</el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>
 
@@ -114,7 +114,23 @@ export default {
   computed: {
     dictMessage() {
       // console.log(111,this.$store.state.dictMessage.dictMessage);
-      return this.$store.state.dictMessage.dictMessage
+      var a = this.$store.state.dictMessage.dictMessage
+      if(a.REPORT_TYPE){
+        a.REPORT_TYPE.forEach(item=>{
+          if(['0','1','2'].includes(item.dictChildValue)){
+            item.permission = 'invalid'
+          }else if(item.dictChildValue == 3){
+            item.permission = 'FTO'
+          }else if(item.dictChildValue == 4){
+            item.permission = 'tort'
+          }else if(item.dictChildValue == 5){
+            item.permission = 'avoidDesign'
+          }
+        })
+      }
+      
+
+      return a
     },
     state(){
       var a = this.$store.state.dictMessage.dictMessage.REPORT_STATE

+ 1 - 1
RMS-FrontEnd/src/views/report/reportDetails/components/basicMessage.vue

@@ -39,7 +39,7 @@
                 </el-form-item>
                 <el-form-item :label="noEdit1?'附件':'上传附件:'">
                 <div v-if="form.reportFiles" class="upload-file">
-                    <div v-for="item in form.reportFiles" style="margin:0;display:flex;justify-content:space-around;"><p style="margin:0;width:calc(100% - 40px);overflow: hidden;white-space: nowrap;text-overflow:ellipsis;cursor: pointer" @click="checkFile(item)">{{item.name?item.name:item.fileName}}</p> <p style="margin:0;" @click="delFile(item.id)" v-if="!noEdit1"><i class="el-icon-close"></i></p></div>
+                    <div v-for="item in form.reportFiles" style="margin:0;display:flex;justify-content:space-around;"><p style="margin:0;width:calc(100% - 40px);overflow: hidden;white-space: nowrap;text-overflow:ellipsis;cursor: pointer" @click="checkFile(item)">{{item.name?item.name+'.'+item.suffix:item.fileName}}</p> <p style="margin:0;" @click="delFile(item.id)" v-if="!noEdit1"><i class="el-icon-close"></i></p></div>
                 </div>
                 <el-upload v-if="!noEdit1" ref="upload" class="upload-file" drag action="#" :auto-upload="false" :show-file-list="true" :on-change="onChange" multiple   :on-preview="handlePreview" :on-remove="handleRemove">
                     <i :class="!file ? 'el-icon-upload' : 'el-icon-refresh'"></i>