|
@@ -7,7 +7,10 @@ export const PatentViewFieldJs = {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getPatentViewField()
|
|
|
+ if(!this.coordination){
|
|
|
+ this.getPatentViewField()
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
// 请求显示栏位管理数据
|
|
@@ -19,16 +22,67 @@ export const PatentViewFieldJs = {
|
|
|
refresh: refresh
|
|
|
}
|
|
|
// console.log(this.reportId,params);
|
|
|
- const { data } = await this.$api.getUserSettingField(params)
|
|
|
- this.patentViewField = data
|
|
|
+ await this.$api.getUserSettingField(params).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.patentViewField = response.data
|
|
|
+ this.handleFields(this.patentViewField)
|
|
|
+ }
|
|
|
+ }).catch(error=>{
|
|
|
+ this.fields = [
|
|
|
+ {
|
|
|
+ "key": "publicNo",
|
|
|
+ "name": "公开号",
|
|
|
+ "type": "list",
|
|
|
+ "order": 0,
|
|
|
+ "hidden": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "key": "name",
|
|
|
+ "name": "标题",
|
|
|
+ "type": "list",
|
|
|
+ "order": 1,
|
|
|
+ "hidden": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "key": "publicDate",
|
|
|
+ "name": "公开日",
|
|
|
+ "type": "list",
|
|
|
+ "order": 0,
|
|
|
+ "hidden": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "key": "simpleStatus",
|
|
|
+ "name": "专利状态",
|
|
|
+ "type": "list",
|
|
|
+ "order": 0,
|
|
|
+ "hidden": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "key": "applicant2",
|
|
|
+ "name": "权利人",
|
|
|
+ "type": "list",
|
|
|
+ "order": 20,
|
|
|
+ "hidden": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "key": "applicant4",
|
|
|
+ "name": "申请人",
|
|
|
+ "type": "list",
|
|
|
+ "order": 22,
|
|
|
+ "hidden": true
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ // const { data } = await this.$api.getUserSettingField(params)
|
|
|
+
|
|
|
// this.patentViewField = data.filter(item => {
|
|
|
// return item.type=='list'
|
|
|
// })
|
|
|
- this.handleFields(this.patentViewField)
|
|
|
+
|
|
|
},
|
|
|
// 显示栏位管理
|
|
|
async handleFieldManage() {
|
|
|
- await this.getPatentViewField()
|
|
|
+ // await this.getPatentViewField()
|
|
|
this.viewSelected =(this.queryParams.taskId + this.signPatentNo)?this.queryParams.taskId + this.signPatentNo:this.reportId
|
|
|
// console.log(this.viewSelected);
|
|
|
this.$refs.patentViewField.open(this.patentViewField,this.viewSelected)
|
|
@@ -92,399 +146,3 @@ export const PatentViewFieldJs = {
|
|
|
},
|
|
|
},
|
|
|
}
|
|
|
-
|
|
|
-export const changeTranslation = {
|
|
|
- methods: {
|
|
|
- getViewDom2(row, key,field) {
|
|
|
- let text = ""
|
|
|
- const change = row.change
|
|
|
- const change2 = row.change2
|
|
|
- switch (key) {
|
|
|
- case "name":
|
|
|
- text = !change ? "name" : "nameOut"
|
|
|
- break
|
|
|
- case "abstractStr":
|
|
|
- text = !change2 ? "abstractStr" : "abstractOut"
|
|
|
- break
|
|
|
- }
|
|
|
- return this.getViewDom(row[text],field)
|
|
|
- },
|
|
|
- handleChange(row, key) {
|
|
|
- switch (key) {
|
|
|
- case "name":
|
|
|
- row.change = !row.change
|
|
|
- break
|
|
|
- case "abstractStr":
|
|
|
- row.change2 = !row.change2
|
|
|
- break
|
|
|
- }
|
|
|
- },
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-export const patentKeywordsHighlight = {
|
|
|
-
|
|
|
- data() {
|
|
|
- return {
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- watch:{
|
|
|
-
|
|
|
- },
|
|
|
- computed: {
|
|
|
- highlight() {
|
|
|
- return this.$store.state.patent.highlight
|
|
|
- },
|
|
|
- contrastList(){
|
|
|
- return this.$store.state.report.contrastList
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- watch:{
|
|
|
- 'contrastList'(val){
|
|
|
- // console.log(val)
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- // window.selectMark = this.selectMark
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getViewDom(text,field) {
|
|
|
- if(this.contrastList){
|
|
|
- for(let i=0;i<this.contrastList.length;i++){
|
|
|
- if(this.contrastList[i].patentNo == this.patent.publicNo){
|
|
|
- if(this.contrastList[i].fields.indexOf(field)!=-1){
|
|
|
- var a = {
|
|
|
- color:"#dff209",
|
|
|
- Type:2,
|
|
|
- Id:this.contrastList[i].id,
|
|
|
- column:this.contrastList[i].fields,
|
|
|
- index:Number(this.contrastList[i].position),
|
|
|
- text:this.contrastList[i].content,
|
|
|
- temNode:text
|
|
|
- }
|
|
|
- if(i==0){
|
|
|
- a.pass = true
|
|
|
- }else{
|
|
|
- a.pass = false
|
|
|
- }
|
|
|
- text = this.AddClass1(a);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!this.highlight.enable || !text) {
|
|
|
- return text
|
|
|
- }
|
|
|
- try {
|
|
|
-
|
|
|
- this.highlight.configs.map(item => {
|
|
|
- const keywords = item.keywords.split(';')
|
|
|
- for (let keyword of keywords) {
|
|
|
- if (!keyword) {
|
|
|
- continue
|
|
|
- }
|
|
|
- let sText = text
|
|
|
- let num = -1
|
|
|
- const rStr = new RegExp(keyword, "g")
|
|
|
- const rHtml = new RegExp("\<.*?\>", "ig")
|
|
|
- const sKey = `<span style="background: ${item.color};color: #fff">${keyword}</span>`
|
|
|
- const aHtml = sText.match(rHtml)
|
|
|
- sText = sText.replace(rHtml, '{~}')
|
|
|
- sText = sText.replace(rStr, sKey)
|
|
|
- sText = sText.replace(/{~}/g, () => {
|
|
|
- num++
|
|
|
- return aHtml[num]
|
|
|
- })
|
|
|
- text = sText
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- } catch (e) {
|
|
|
- }
|
|
|
- return text
|
|
|
- },
|
|
|
- SplitHtmlTag1(el){
|
|
|
- let temInnerHtml = el.trim();
|
|
|
- let pattern = /<[^>]+>/g;
|
|
|
- let Indexs =[];
|
|
|
- let i=0
|
|
|
- var match = null
|
|
|
- while((match = pattern.exec(temInnerHtml)) != null){
|
|
|
- Indexs[i] = match;
|
|
|
- //Indexs[i] =[ match.index,m.value];
|
|
|
- i++;
|
|
|
- }
|
|
|
- //var m = temInnerHtml.match(pattern);
|
|
|
- var splitStrings = new Array();
|
|
|
- i=0;
|
|
|
- var currentIndex =0;
|
|
|
- for(var index=0;index<Indexs.length;index++){
|
|
|
- if(Indexs[index].index >currentIndex){
|
|
|
- splitStrings[i] = {"text": temInnerHtml.substring(currentIndex,Indexs[index].index), "type":"text"};
|
|
|
- i++;
|
|
|
- splitStrings[i] = {"text": Indexs[index][0], "type":"tag"};
|
|
|
- i++;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- splitStrings[i] = {"text": Indexs[index][0], "type":"tag"};;
|
|
|
- i++;
|
|
|
- }
|
|
|
-
|
|
|
- currentIndex = Indexs[index].index + Indexs[index][0].length;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if(currentIndex< temInnerHtml.length){
|
|
|
- splitStrings[i] = {"text": temInnerHtml.substring(currentIndex,temInnerHtml.length), "type":"text"};
|
|
|
- }
|
|
|
-
|
|
|
- return splitStrings;
|
|
|
-
|
|
|
- },
|
|
|
- selectMark(Id){
|
|
|
- // this.selectMarkObjectId = Id;
|
|
|
-// this.showPizhu();
|
|
|
-var index = this.contrastList.findIndex(item=>{
|
|
|
- return item.id == Id
|
|
|
-})
|
|
|
-if(index!=-1){
|
|
|
-
|
|
|
- this.ruleForm = {
|
|
|
- id:this.contrastList[index].id,
|
|
|
- index:this.contrastList[index].position,
|
|
|
- content:this.contrastList[index].content,
|
|
|
- position:this.contrastList[index].fields,
|
|
|
- features:this.contrastList[index].features,
|
|
|
- featureslist:this.contrastList[index].featuresIdList
|
|
|
- }
|
|
|
- this.selectedFeatures = []
|
|
|
- for(var i=0;i<this.contrastList[index].features.length;i++){
|
|
|
- this.selectedFeatures.push({
|
|
|
- id:this.contrastList[index].features[i].id,
|
|
|
- pRightName:this.contrastList[index].features[i].rightName,
|
|
|
- content:this.contrastList[index].features[i].content,
|
|
|
- comResult:this.contrastList[index].assoRecordsFeatures[i].comResult,
|
|
|
- })
|
|
|
- }
|
|
|
- // this.selectedFeaturesId=this.contrastList[index].featuresId
|
|
|
- // this.$set(this.ruleForm,'',a)
|
|
|
- if(this.visible == undefined){
|
|
|
- var a = {
|
|
|
- ruleForm:this.ruleForm,
|
|
|
- selectedFeatures:this.selectedFeatures
|
|
|
- }
|
|
|
- this.$emit('getVisible',a)
|
|
|
- }else{
|
|
|
- this.visible = true
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
- },
|
|
|
- AddClass1(selectObject){
|
|
|
- // let el = this.getColumnNode(selectObject.column);
|
|
|
- let el = selectObject.temNode;
|
|
|
- if(selectObject.pass){
|
|
|
- var splitStrings =[{
|
|
|
- text:selectObject.temNode,
|
|
|
- type:'text'
|
|
|
- }]
|
|
|
-
|
|
|
- }else{
|
|
|
- var splitStrings = this.SplitHtmlTag1(el);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- let bgColor = selectObject.color;
|
|
|
- let startTag ='<span id="' + selectObject.Id +'" style="background-color:' + selectObject.color + '">';
|
|
|
- if(selectObject.Type ==1){
|
|
|
- startTag ='<span onclick="selectMark(\'' + selectObject.Id + '\')" id="' + selectObject.Id +'" style="border-bottom:2px solid ' + selectObject.color + '">';
|
|
|
- }
|
|
|
- let imgTag = '<span onclick="selectMark(\'' + selectObject.Id + '\')" Id="' + selectObject.Id + '"><i class="el-icon-location-outline"></i></span>';
|
|
|
- let endTag ='</span>';
|
|
|
- let elText = '';
|
|
|
-
|
|
|
- splitStrings.forEach(function (item){
|
|
|
- if(item.type =='text'){
|
|
|
- elText = elText + item.text;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- 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);
|
|
|
- //Indexs[i] =[ match.index,m.value];
|
|
|
- i++;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Indexs[i] = [selectObject.text];
|
|
|
- Indexs[i].index =selectObject.index;
|
|
|
- }
|
|
|
- Indexs.forEach(function (match){
|
|
|
- let currentIndex =0;
|
|
|
- let temSplitStrings = new Array();
|
|
|
- splitStrings.forEach(function (item){
|
|
|
- if(item.type =='text'){
|
|
|
- // console.log(item.text.indexOf(match[0]))
|
|
|
- if(item.text){
|
|
|
- // console.log(match.index,currentIndex,item.text,match[0])
|
|
|
- if(match.index >= currentIndex && match.index < (currentIndex + item.text.length) ){
|
|
|
- if(selectObject.column.indexOf('权利要求')!=-1){
|
|
|
- item.text = item.text.replace(/\r/g,' ')
|
|
|
- // console.log(item.text.match(/\r/g))
|
|
|
- if(item.text.match(/\r/g)){
|
|
|
- match.index -=1
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- if(selectObject.column.indexOf('说明书')!=-1){
|
|
|
- var b = selectObject.temNode.replace(/<[^>]+>/g,'')
|
|
|
- if(b.substring(0,match.index).indexOf('\r')==-1){
|
|
|
- var a = b.substring(0,match.index).match(/\n/g)
|
|
|
- if(a){
|
|
|
- match.index -=a.length
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- // console.log(match.index + match[0].length,currentIndex + item.text.length,item.text,item.text.indexOf(match[0]))
|
|
|
- if((match.index + match[0].length) <= (currentIndex + item.text.length) && item.text.indexOf(match[0])!=-1){
|
|
|
- // console.log(2)
|
|
|
- if(match.index > currentIndex){
|
|
|
- // var a =item.text.substring(0,match.index-currentIndex)
|
|
|
- // console.log(a)
|
|
|
- // var num = Number(a.match(/\r\n/g).length)+1+Number(match.index)
|
|
|
- temSplitStrings.push({text:item.text.substring(0,match.index-currentIndex),type:'text'});
|
|
|
- // console.log(temSplitStrings)
|
|
|
- }
|
|
|
- // console.log('进了',1)
|
|
|
- temSplitStrings.push({text:startTag,type:'tag'});
|
|
|
- temSplitStrings.push({text:match[0],type:'text'});
|
|
|
- if(selectObject.Type ==2){
|
|
|
- // console.log(12)
|
|
|
- temSplitStrings.push({text:imgTag,type:'tag'});
|
|
|
- }
|
|
|
- temSplitStrings.push({text:endTag,type:'tag'});
|
|
|
-
|
|
|
- if((match.index + match[0].length) < (currentIndex + item.text.length)){
|
|
|
- temSplitStrings.push({text:item.text.substring((match.index + match[0].length)-currentIndex),type:'text'});
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(item.text.indexOf(match[0])!=-1){
|
|
|
- // console.log('进了',2)
|
|
|
- if(match.index > currentIndex){
|
|
|
- temSplitStrings.push({text:item.text.substring(0,match.index-currentIndex),type:'text'});
|
|
|
- }
|
|
|
- if(temSplitStrings.length>1){
|
|
|
- // console.log(temSplitStrings[temSplitStrings.length-2].text.substr(1,1))
|
|
|
- if(temSplitStrings[temSplitStrings.length-2].text.substr(1,1)!='/'){
|
|
|
- let index = temSplitStrings[temSplitStrings.length-2].text.indexOf('background-color:')
|
|
|
- let colorStr = temSplitStrings[temSplitStrings.length-2].text.substr(index+17,7)
|
|
|
- let index2 = startTag.indexOf('background-color:')
|
|
|
- let colorStr2 = startTag.substr(index2+17,7)
|
|
|
- let acolor = colourBlend(colorStr,colorStr2,0.5)
|
|
|
- let startTag2 = "<span style='background-color:"+acolor+"'>"
|
|
|
- temSplitStrings.push({text:startTag2,type:'tag'});
|
|
|
- }else{
|
|
|
- temSplitStrings.push({text:startTag,type:'tag'});
|
|
|
- }
|
|
|
-
|
|
|
- }else{
|
|
|
- temSplitStrings.push({text:startTag,type:'tag'});
|
|
|
- }
|
|
|
-
|
|
|
- temSplitStrings.push({text:item.text.substring(match.index-currentIndex),type:'text'});
|
|
|
- temSplitStrings.push({text:endTag,type:'tag'});
|
|
|
- }else{
|
|
|
- temSplitStrings.push(item);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
-
|
|
|
- if((match.index + match[0].length) <= (currentIndex + item.text.length) && (match.index + match[0].length)>currentIndex){
|
|
|
- // console.log('进了',3)
|
|
|
- // console.log( temSplitStrings[temSplitStrings.length-1])
|
|
|
- if(temSplitStrings[temSplitStrings.length-1].text.substr(1,1)!='/'){
|
|
|
- let index = temSplitStrings[temSplitStrings.length-1].text.indexOf('background-color:')
|
|
|
- let colorStr = temSplitStrings[temSplitStrings.length-1].text.substr(index+17,7)
|
|
|
- let index2 = startTag.indexOf('background-color:')
|
|
|
- let colorStr2 = startTag.substr(index2+17,7)
|
|
|
- let acolor = colourBlend(colorStr,colorStr2,0.5)
|
|
|
- let startTag2 = "<span style='background-color:"+acolor+"'>"
|
|
|
- temSplitStrings.push({text:startTag2,type:'tag'});
|
|
|
- }else{
|
|
|
- temSplitStrings.push({text:startTag,type:'tag'});
|
|
|
- }
|
|
|
-
|
|
|
- temSplitStrings.push({text:item.text.substring(0,match.index + match[0].length-currentIndex),type:'text'});
|
|
|
- if(selectObject.Type ==2){
|
|
|
- temSplitStrings.push({text:imgTag,type:'tag'});
|
|
|
- }
|
|
|
- temSplitStrings.push({text:endTag,type:'tag'});
|
|
|
- // console.log(3)
|
|
|
- if((match.index + match[0].length) < (currentIndex + item.text.length)){
|
|
|
- temSplitStrings.push({text:item.text.substring((match.index + match[0].length-currentIndex)),type:'text'});
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(match.index < currentIndex && (match.index + match[0].length) >= (currentIndex + item.text.length)){
|
|
|
- // console.log('进了',4)
|
|
|
- temSplitStrings.push({text:startTag,type:'tag'});
|
|
|
- temSplitStrings.push(item);
|
|
|
- temSplitStrings.push({text:endTag,type:'tag'});
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- // console.log('进了',5)
|
|
|
- temSplitStrings.push(item);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- currentIndex = currentIndex + item.text.length;
|
|
|
- }else{
|
|
|
- temSplitStrings.push(item);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- temSplitStrings.push(item);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- splitStrings = temSplitStrings;
|
|
|
- });
|
|
|
-
|
|
|
- let temInnerHtml = '';
|
|
|
- splitStrings.forEach(function (item){
|
|
|
- temInnerHtml = temInnerHtml + item.text;
|
|
|
- });
|
|
|
- return temInnerHtml;
|
|
|
-
|
|
|
- },
|
|
|
- }
|
|
|
-}
|