Sfoglia il codice sorgente

图表分析修改

zhuliu 1 anno fa
parent
commit
6e577fc56a

+ 89 - 2
src/store/modules/chart.js

@@ -85,7 +85,7 @@ export default {
         // }
         var count = []
         var obj = form.schema[dimension]
-        if(obj.filedKind == 0){
+        if(obj.fieldKind == 0){
           count.push(
             {
               field:'field',
@@ -124,9 +124,96 @@ export default {
           countVOS:count
         }
         try {
+          
+          if(obj.fieldKind == 0){
+            let Custom = {
+              customFieldId: obj.field,
+            }
+           const customResponse = await Api.queryCustomOption(Custom)
+           if(customResponse.code == 200){
+            var customData = customResponse.data.data
+           }else{
+            var customData = []
+           }
+          }
+          form.source[dimension] = []
           const response = await Api.esCountAnalysis(params)
           if(response.code == 200){
-            form.source[dimension] = response.data.detailDTOS
+            var detailDTOS = response.data.detailDTOS
+            if(obj.fieldKind == 0){
+              var sourceData = []
+              if(customData.length>0){
+                for(var i = 0;i<customData.length;i++){
+                  var index = detailDTOS.findIndex(item=>{
+                    return item.name == customData[i].id
+                  })
+                  if(index!=-1){
+                    var num = detailDTOS[index]
+                    detailDTOS.splice(index,1)
+                  }else{
+                    var num = {
+                      name:customData[i].id,
+                      number:0,
+                      field:'field',
+                    }
+                  }
+                  var a = {
+                    ...num,
+                    label:customData[i].name,
+                    fieldKind:0,
+                    child:[]
+                  }
+                  sourceData.push(a)
+                  setChild(a,customData[i])
+                  function setChild(a,data){
+                    if(data.child && data.child.length>0){
+                      for(var j = 0;j<data.child.length;j++){
+                        var index = detailDTOS.findIndex(item=>{
+                          return item.name == data.child[j].id
+                        })
+                        if(index!=-1){
+                          var num = detailDTOS[index]
+                          detailDTOS.splice(index,1)
+                        }else{
+                          var num = {
+                            name:data.child[j].id,
+                            number:0,
+                            field:'field',
+                          }
+                        }
+                        var b = {
+                          ...num,
+                          label:data.child[j].name,
+                          fieldKind:0,
+                          child:[]
+                        }
+                        a.child.push(b)
+                        setChild(a,data.child[j])
+                      }
+                    }
+                  }
+                }
+              }
+              var noChoose = detailDTOS.find(item=>{
+                return item.name == '未选择'
+              })
+              if(noChoose && noChoose.number!=0){
+                sourceData.push(
+                  {
+                    label: "未选择",
+                    name: "未选择",
+                    fieldKind:0,
+                    child:[],
+                    number:0,
+                    field:'field'
+                  }
+                )
+              }
+              form.source[dimension] = sourceData
+            }else{
+              form.source[dimension] = detailDTOS
+            }
+            
           }else{
             form.source[dimension] = []
           }

+ 16 - 0
src/utils/common.js

@@ -37,6 +37,22 @@ export default {
       }, delay)
     }
   },
+
+  /**
+   * 树形数据转成扁平数据
+   * @param {Array} data 树形数据
+   * @param {Object} prop 配置
+   * @returns 
+   */
+treeToArray(data,prop={children:children}){
+  let res = []
+  data.forEach(el=>{
+    res.push(el)
+    el[prop.children] && res.push(...this.treeToArray(el[prop.children])) 
+  })
+  return res
+},
+  
   //对象转数组
   objectToArray(val){
     var data = []

+ 2 - 2
src/views/analyse/custom/components/Tabs/DataItem.vue

@@ -5,7 +5,7 @@
       <el-option v-for="item in expandField[dimension]" :value="item.id" :key="item.id" :label="item.name"></el-option>
     </el-select>
     <div>
-      <div style="text-align: right;height: 40px;">
+      <div style="text-align: right;height: 40px;" v-if="form.schema[dimension].fieldKind != 0">
         <template v-if="form.schema[dimension].type !== 6">
           <el-button v-if="form.schema[dimension].ptype === 3 || form.schema[dimension].ptype === 4" type="text" @click="handleEdit">编辑</el-button>
           <template v-else>
@@ -33,7 +33,7 @@
             <template v-if="form.schema[dimension].type !== 6">
               <el-checkbox-group v-model="selected[dimension]">
                 <el-row v-for="item in form.source[dimension]">
-                  <el-checkbox :label="item.name">{{ item.name }}<span v-if="item.number == 0 || item.number">({{ item.number }})</span></el-checkbox>
+                  <el-checkbox :label="item.name">{{ item.fieldKind == 0?item.label:item.name }}<span v-if="item.number == 0 || item.number">({{ item.number }})</span></el-checkbox>
                 </el-row>
               </el-checkbox-group>
             </template>

+ 14 - 1
src/views/analyse/custom/components/Tabs/Style.vue

@@ -103,7 +103,7 @@
               <template v-if="!getShow([15, 30])">
                 <div v-for="item in form.setting.config.color" class="color-config-content">
                   <el-color-picker size="small" v-model="item.color"></el-color-picker>
-                  <span class="name">{{ item.name }}</span>
+                  <span class="name">{{ getColorName(item.name) }}</span>
                 </div>
                 <div v-if="form.setting.config.line.enable" class="color-config-content">
                   <el-color-picker size="small" v-model="form.setting.config.line.color"></el-color-picker>
@@ -296,6 +296,19 @@ export default {
     this.getPositionList()
   },
   methods: {
+    getColorName(name){
+      if(this.form.schema['y'].fieldKind == 0){
+        var data = this.form.source['y']
+        var obj = data.find(item=>{
+          return item.name == name
+        })
+        if(obj){
+          return obj.label
+        }
+        return name
+      }
+      return name
+    },
     getShow(arr) {
       return arr.indexOf(this.form.setting.type) !== -1
     },

+ 86 - 5
src/views/analyse/custom/index.vue

@@ -94,6 +94,7 @@ export default {
         loadingBtn:false,
         id:null,
         loading:false,
+        patentNum:0
     };
   },
   watch: {},
@@ -109,16 +110,61 @@ export default {
     projectId(){
         return this.$route.query.projectId
     },
-    patentNum(){
-        return this.$route.query.patentNum || 0
+    patentNums(){
+         return this.$route.query.patentNum || 0
     },
+    searchPatentNum(){
+      return this.$route.query.searchPatentNum
+    }
   },
   created() {},
   mounted() {
+    this.getPatentNum()
     this.getData()
     window.addEventListener('resize',this.refreshChart)
   },
   methods: {
+    getPatentNum(){
+      if(!this.searchPatentNum){
+        this.patentNum = this.patentNums
+        return
+      }
+      let params1 = {
+        projectId: this.projectId,
+      }
+      this.$api.getAllCountColumns(params1).then(res => {
+        if (res.code == 200) {
+          var data = []
+          res.data.data.forEach(item => {
+            if (item.filedKind == -1) {
+              item.value = item.field
+            }
+            if (item.filedKind == 0 && (item.type == 'tree')) {
+
+            } else {
+              data.push(item)
+            }
+          })
+          
+          this.$store.commit('SET_SYSTEM_FIELD',data)
+        }
+      })
+      let params = {
+        current: 1,
+        size: 1,
+        projectId: this.projectId,
+        searchQuery: '',//检索条件
+        customFields: [],
+        orderDTOList: [],//排序信息
+      }
+      this.$api.QueryPatent(params).then(res => {
+        if (res.code == 200) {
+          this.patentNum = res.data.total
+        }
+      }).catch(error=>{
+        this.patentNum = 0
+      })
+    },
     openDrawer(type){
         var components = {
             1:'tabData',
@@ -439,7 +485,7 @@ export default {
             var form = this.form
             var obj = form.schema[dimension]
             this.loading = true
-            if(obj.filedKind == 0){
+            if(obj.fieldKind == 0){
                 count.push(
                     {
                         field:'field',
@@ -484,6 +530,21 @@ export default {
             countVOS:count
         }
         try{
+          // var haveCustom = count.find(item=>{
+          //   return item.field == 'field' && item.fieldId
+          // })
+          // if(haveCustom){
+          //   let Custom = {
+          //     customFieldId: haveCustom.fieldId,
+          //   }
+          //  const customResponse = await this.$api.queryCustomOption(Custom)
+          //  if(customResponse.code == 200){
+          //   // var customData =this.$commonJS.treeToArray(customResponse.data.data,{children:child}) 
+          //   var customData =customResponse.data.data
+          //  }else{
+          //   var customData = []
+          //  }
+          // }
             const response = await this.$api.esCountAnalysis(params)
             if(sign){
                 var res = Object.keys(response.data.analyseMap)
@@ -498,11 +559,31 @@ export default {
                     for(var j =0 ;j<analyseMapData.length;j++){
                         obj[analyseMapData[j].name] = analyseMapData[j].number
                     }
-                    data[res[i]] = obj
+                    var key = res[i]
+                    // if(haveCustom){
+                    //   var index = customData.findIndex(item=>{
+                    //     return item.id == key
+                    //   })
+                    //   if(index!=-1){
+                    //     key = customData[index].name
+                    //     customData.splice(index,1)
+                    //   }
+                    // }
+                    data[key] = obj
                 }
             }else{
                 for(var i = 0;i<response.data.detailDTOS.length;i++){
-                    data[response.data.detailDTOS[i].name] = response.data.detailDTOS[i].number
+                  var key = response.data.detailDTOS[i].name
+                  // if(haveCustom){
+                  //   var index = customData.findIndex(item=>{
+                  //     return item.id == key
+                  //   })
+                  //   if(index!=-1){
+                  //     key = customData[index].name
+                  //     customData.splice(index,1)
+                  //   }
+                  // }
+                    data[key] = response.data.detailDTOS[i].number
                 }
             }
             

+ 21 - 4
src/views/analyse/custom/mixins.js

@@ -100,6 +100,22 @@ export const chartOption = {
       return this.form.setting[dimension]
     },
     getAxisData(dimension) {
+      if(this.form.schema[dimension].fieldKind == 0){
+        var data = this.form.source[dimension]
+        var data2 = this.selected[dimension]
+        var arr = []
+        for(var i = 0;i<data2.length;i++){
+          var item = data2[i]
+          for(var j = 0;j<data.length;j++){
+            var item2 = data[j]
+            if(item == item2.name){
+              arr.push(item2.label)
+              continue;
+            }
+          }
+        }
+        return arr
+      }
       return this.selected[dimension]
     },
     getColor(name) {
@@ -316,9 +332,10 @@ export const chartOption = {
       }
       const enable = this.form.setting.config.line.enable
       const operator = this.form.setting.config.line.operator
-      let series = this.selected.y.map(y => {
+      var data = this.getAxisData('y')
+      let series = this.selected.y.map((y,index) => {
         return {
-          name: y,
+          name: data[index],
           type: type,
           stack: stack,
           itemStyle: {
@@ -334,7 +351,7 @@ export const chartOption = {
         nameTextStyle: this.getNameTextStyle('x'),
         type: 'category',
         nameLocation: this.form.setting.nameLocation,
-        data: this.selected.x,
+        data: this.getAxisData('x'),
         splitLine: {
           show: this.form.setting.splitLine
         },
@@ -353,7 +370,7 @@ export const chartOption = {
         },
         axisLabel: this.getAxisLabel('value', 'y')
       }]
-      let legend = [...this.selected.y]
+      let legend = [...this.getAxisData('y')]
       if (enable && ([5, 6].indexOf(this.form.setting.type) !== -1)) {
         let name = this.form.setting.config.line.name
         series.push({

+ 1 - 1
src/views/components/drawer/Field.vue

@@ -25,7 +25,7 @@
             </el-table-column>
             <el-table-column label="状态" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
-                <span>{{ statusObj.find(item=>item.value == scope.row.status).label }}</span>
+                <span v-if="scope.row.status">{{ statusObj.find(item=>item.value == scope.row.status).label }}</span>
               </template>
             </el-table-column>
             <el-table-column prop="createName" label="创建人" align="center" show-overflow-tooltip></el-table-column>

+ 1 - 1
src/views/project/index.vue

@@ -501,7 +501,7 @@ export default {
         query: {
           projectId: row.id,
           search:JSON.stringify(params),
-          
+          searchPatentNum:true
         }
       })
       window.open(router.href, '_blank');

+ 27 - 2
src/views/report/InvalidResponse/components/reasonsAndEvidence/reasonsAndEvidence.vue

@@ -613,13 +613,34 @@ export default {
             return item.operateType == 1
         })
     },
+    //检验特征是否有修改
+    featureIsChange(row,type){
+        var data = this.tableData.filter(item=>{
+            return item.proofGroupId == row.proofGroupId
+        })
+        if(data.length>0){
+            var data2 = data.filter(item=>{
+                return item.featureHistories && item.featureHistories.length>0 && item.featureHistories.findIndex(i=>{
+                    return i.featureGen == (type==1?'1':'2')
+                }) !=-1
+            })
+            if(data2.length>0){
+                return true
+            }
+        }
+        return false
+    },
     //获取修改说明
     getFeatureCommon(row,type){
         var obj = this.claims.find(item=>{
             return item.id == row.claimId
         })
         if(!obj || !obj.patentClaimHistoryList){
-            
+           var sign = this.featureIsChange(row,type)
+           console.log(row.proofGroupId,sign)
+           if(!sign){
+            return ''
+           }
         }else{
             var obj2 = obj.patentClaimHistoryList.find(item=>{
                 if(type == 1){
@@ -629,7 +650,11 @@ export default {
                 }
             })
             if(!obj2){
-                return ''
+                var sign = this.featureIsChange(row,type)
+                console.log(sign)
+                if(!sign){
+                    return ''
+                }
             }
         }