Commit 2ba19b90 by heshihao

添加placeholder

parent ec6d9188
<template> <template>
<div class="details"> <div class="details">
<a-breadcrumb class="nav_bread"> <a-breadcrumb class="nav_bread">
<a-breadcrumb-item <a-breadcrumb-item><router-link :to="'/home'">首页</router-link></a-breadcrumb-item>
><router-link :to="'/home'">首页</router-link></a-breadcrumb-item <a-breadcrumb-item><router-link :to="'/patent'">专利</router-link></a-breadcrumb-item>
>
<a-breadcrumb-item
><router-link :to="'/patent'">专利</router-link></a-breadcrumb-item
>
<a-breadcrumb-item>专利详情</a-breadcrumb-item> <a-breadcrumb-item>专利详情</a-breadcrumb-item>
</a-breadcrumb> </a-breadcrumb>
<div class="back_btn" @click="backbtn">返回</div> <div class="back_btn" @click="backbtn">返回</div>
...@@ -15,9 +11,7 @@ ...@@ -15,9 +11,7 @@
<div class="patent_title">{{ title ? title : details.title }}</div> <div class="patent_title">{{ title ? title : details.title }}</div>
</div> </div>
<div class="btn_group"> <div class="btn_group">
<span style="cursor: pointer" @click="openModal" <span style="cursor: pointer" @click="openModal"><img src="@/static/patent/icon-dc.png" alt="" />导出</span>
><img src="@/static/patent/icon-dc.png" alt="" />导出</span
>
<span style="cursor: pointer" @click="followFun" v-if="!details.follow" <span style="cursor: pointer" @click="followFun" v-if="!details.follow"
><img src="@/static/patent/icon-gz.png" alt="" />关注</span ><img src="@/static/patent/icon-gz.png" alt="" />关注</span
...@@ -45,11 +39,7 @@ ...@@ -45,11 +39,7 @@
<!-- 技术领域 --> <!-- 技术领域 -->
<div class="patent_con1" id="techAera"> <div class="patent_con1" id="techAera">
<h2 class="title">技术领域</h2> <h2 class="title">技术领域</h2>
<EchartsCloud <EchartsCloud :id="'tech'" :dataArr="techArr" v-if="techArr.length > 0"></EchartsCloud>
:id="'tech'"
:dataArr="techArr"
v-if="techArr.length > 0"
></EchartsCloud>
<a-empty v-else /> <a-empty v-else />
</div> </div>
<!-- 应用领域 --> <!-- 应用领域 -->
...@@ -63,149 +53,69 @@ ...@@ -63,149 +53,69 @@
<!-- 主要录项 --> <!-- 主要录项 -->
<div class="patent_con1" id="mainentries"> <div class="patent_con1" id="mainentries">
<h2 class="title">主著录项</h2> <h2 class="title">主著录项</h2>
<a-descriptions <a-descriptions bordered :column="2" :labelStyle="{ background: '#F2F9FC' }">
bordered <a-descriptions-item style="width: 160px" label="申请号">{{ details.sqh }}</a-descriptions-item>
:column="2" <a-descriptions-item style="width: 160px" label="优先权号">{{ details.yxqh }}</a-descriptions-item>
:labelStyle="{ background: '#F2F9FC' }" <a-descriptions-item label="申请日">{{ details.sqrq }}</a-descriptions-item>
> <a-descriptions-item label="优先权日">{{ details.zlyxqr }}</a-descriptions-item>
<a-descriptions-item style="width: 160px" label="申请号">{{ <a-descriptions-item label="公开号">{{ details.gkh }}</a-descriptions-item>
details.sqh <a-descriptions-item label="授权日">{{ details.sqr }}</a-descriptions-item>
}}</a-descriptions-item> <a-descriptions-item label="公开日">{{ details.gkrq }}</a-descriptions-item>
<a-descriptions-item style="width: 160px" label="优先权号">{{ <a-descriptions-item label="失效日">{{ details.sxr }}</a-descriptions-item>
details.yxqh <a-descriptions-item label="专利类型">{{ details.zl_type }}</a-descriptions-item>
}}</a-descriptions-item> <a-descriptions-item label="专利维持期">{{ details.zlwqq }}</a-descriptions-item>
<a-descriptions-item label="申请日">{{
details.sqrq
}}</a-descriptions-item>
<a-descriptions-item label="优先权日">{{
details.zlyxqr
}}</a-descriptions-item>
<a-descriptions-item label="公开号">{{
details.gkh
}}</a-descriptions-item>
<a-descriptions-item label="授权日">{{
details.sqr
}}</a-descriptions-item>
<a-descriptions-item label="公开日">{{
details.gkrq
}}</a-descriptions-item>
<a-descriptions-item label="失效日">{{
details.sxr
}}</a-descriptions-item>
<a-descriptions-item label="专利类型">{{
details.zl_type
}}</a-descriptions-item>
<a-descriptions-item label="专利维持期">{{
details.zlwqq
}}</a-descriptions-item>
</a-descriptions> </a-descriptions>
</div> </div>
<!-- 相关人 --> <!-- 相关人 -->
<div class="patent_con1" id="relatedper"> <div class="patent_con1" id="relatedper">
<h2 class="title">相关人</h2> <h2 class="title">相关人</h2>
<a-descriptions <a-descriptions bordered :column="2" :labelStyle="{ background: '#F2F9FC' }">
bordered
:column="2"
:labelStyle="{ background: '#F2F9FC' }"
>
<a-descriptions-item style="width: 160px" label="申请人(原始)"> <a-descriptions-item style="width: 160px" label="申请人(原始)">
{{ details.sqrys }} {{ details.sqrys }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item style="width: 160px" label="专利权人(当前)"> <a-descriptions-item style="width: 160px" label="专利权人(当前)">
{{ details.zlqrjgs }} {{ details.zlqrjgs }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="申请人">{{ <a-descriptions-item label="申请人">{{ details.zlr }}</a-descriptions-item>
details.zlr <a-descriptions-item label="专利权人">{{ details.zlqr }}</a-descriptions-item>
}}</a-descriptions-item> <a-descriptions-item label="申请人(工商)">{{ details.sqrgs }}</a-descriptions-item>
<a-descriptions-item label="专利权人">{{ <a-descriptions-item label="专利权人(机构树)">{{ details.zlqrjgs }}</a-descriptions-item>
details.zlqr <a-descriptions-item label="申请人(机构树)">{{ details.sqrjgs }}</a-descriptions-item>
}}</a-descriptions-item> <a-descriptions-item label="代理人">{{ details.dlr }}</a-descriptions-item>
<a-descriptions-item label="申请人(工商)">{{ <a-descriptions-item label="发明人">{{ details.fmr }}</a-descriptions-item>
details.sqrgs <a-descriptions-item label="代理机构">{{ details.dljg }}</a-descriptions-item>
}}</a-descriptions-item>
<a-descriptions-item label="专利权人(机构树)">{{
details.zlqrjgs
}}</a-descriptions-item>
<a-descriptions-item label="申请人(机构树)">{{
details.sqrjgs
}}</a-descriptions-item>
<a-descriptions-item label="代理人">{{
details.dlr
}}</a-descriptions-item>
<a-descriptions-item label="发明人">{{
details.fmr
}}</a-descriptions-item>
<a-descriptions-item label="代理机构">{{
details.dljg
}}</a-descriptions-item>
</a-descriptions> </a-descriptions>
</div> </div>
<!-- 地址 --> <!-- 地址 -->
<div class="patent_con1" id="address"> <div class="patent_con1" id="address">
<h2 class="title">地址</h2> <h2 class="title">地址</h2>
<a-descriptions <a-descriptions bordered :column="2" :labelStyle="{ background: '#F2F9FC' }">
bordered <a-descriptions-item style="width: 160px" label="申请人国">{{ details.sqrg }}</a-descriptions-item>
:column="2" <a-descriptions-item style="width: 160px" label="公开国">{{ details.gkg }}</a-descriptions-item>
:labelStyle="{ background: '#F2F9FC' }" <a-descriptions-item label="申请人地址">{{ details.sqr_address }}</a-descriptions-item>
> <a-descriptions-item label="专利权人地址">{{ details.zlqr_address }}</a-descriptions-item>
<a-descriptions-item style="width: 160px" label="申请人国">{{
details.sqrg
}}</a-descriptions-item>
<a-descriptions-item style="width: 160px" label="公开国">{{
details.gkg
}}</a-descriptions-item>
<a-descriptions-item label="申请人地址">{{
details.sqr_address
}}</a-descriptions-item>
<a-descriptions-item label="专利权人地址">{{
details.zlqr_address
}}</a-descriptions-item>
</a-descriptions> </a-descriptions>
</div> </div>
<!-- 统计信息 --> <!-- 统计信息 -->
<div class="patent_con1" id="statistic"> <div class="patent_con1" id="statistic">
<h2 class="title">统计信息</h2> <h2 class="title">统计信息</h2>
<a-descriptions <a-descriptions bordered :column="2" :labelStyle="{ background: '#F2F9FC' }">
bordered <a-descriptions-item style="width: 160px" label="引用数量">{{ details.yy_num }}</a-descriptions-item>
:column="2" <a-descriptions-item style="width: 160px" label="权利要求数">{{ details.qlyq_num }}</a-descriptions-item>
:labelStyle="{ background: '#F2F9FC' }" <a-descriptions-item label="被引用数量">{{ details.byy_num }}</a-descriptions-item>
> <a-descriptions-item label="同族数量">{{ details.tzzl_num }}</a-descriptions-item>
<a-descriptions-item style="width: 160px" label="引用数量">{{
details.yy_num
}}</a-descriptions-item>
<a-descriptions-item style="width: 160px" label="权利要求数">{{
details.qlyq_num
}}</a-descriptions-item>
<a-descriptions-item label="被引用数量">{{
details.byy_num
}}</a-descriptions-item>
<a-descriptions-item label="同族数量">{{
details.tzzl_num
}}</a-descriptions-item>
</a-descriptions> </a-descriptions>
</div> </div>
<!-- 分类号 --> <!-- 分类号 -->
<div class="patent_con1" id="catenum"> <div class="patent_con1" id="catenum">
<h2 class="title">分类号</h2> <h2 class="title">分类号</h2>
<a-descriptions <a-descriptions bordered :column="2" :labelStyle="{ background: '#F2F9FC' }">
bordered <a-descriptions-item style="width: 160px" label="IPC分类号">{{ details.ipcflh }}</a-descriptions-item>
:column="2" <a-descriptions-item style="width: 160px" label="战略新兴产业分类号">{{
:labelStyle="{ background: '#F2F9FC' }" details.zlxxxcy
>
<a-descriptions-item style="width: 160px" label="IPC分类号">{{
details.ipcflh
}}</a-descriptions-item>
<a-descriptions-item
style="width: 160px"
label="战略新兴产业分类号"
>{{ details.zlxxxcy }}</a-descriptions-item
>
<a-descriptions-item label="国民经济分类号">{{
details.gmjjfl
}}</a-descriptions-item>
<a-descriptions-item label="双十产业集群分类号">{{
details.sscyjqfl
}}</a-descriptions-item> }}</a-descriptions-item>
<a-descriptions-item label="国民经济分类号">{{ details.gmjjfl }}</a-descriptions-item>
<a-descriptions-item label="双十产业集群分类号">{{ details.sscyjqfl }}</a-descriptions-item>
</a-descriptions> </a-descriptions>
</div> </div>
</div> </div>
...@@ -248,66 +158,35 @@ ...@@ -248,66 +158,35 @@
>条相关结果 >条相关结果
</div> </div>
<div class="card" v-for="item in list" :key="item"> <div class="card" v-for="item in list" :key="item">
<div <div class="card_title" @click="openCompany(item.id, item.company_name)">
class="card_title"
@click="openCompany(item.id, item.company_name)"
>
<div v-html="item.company_name"></div> <div v-html="item.company_name"></div>
</div> </div>
<a-tag class="tags" color="#56CA95">{{ item.status }}</a-tag> <a-tag class="tags" color="#56CA95">{{ item.status }}</a-tag>
<a-tag <a-tag class="tags" color="#6096E6" v-if="item.quoted_company == 1">{{ "上市挂牌企业" }}</a-tag>
class="tags" <a-tag class="tags" color="#6096E6" v-if="item.high_new == 1">{{ "高新技术企业" }}</a-tag>
color="#6096E6" <a-tag class="tags" color="#6096E6" v-if="item.zjtg_sjxjr == 1">{{ "专精特新小巨人" }}</a-tag>
v-if="item.quoted_company == 1" <a-tag class="tags" color="#6096E6" v-if="item.zjtg == 1">{{ "专精特新中小企业" }}</a-tag>
>{{ "上市挂牌企业" }}</a-tag
>
<a-tag class="tags" color="#6096E6" v-if="item.high_new == 1">{{
"高新技术企业"
}}</a-tag>
<a-tag class="tags" color="#6096E6" v-if="item.zjtg_sjxjr == 1">{{
"专精特新小巨人"
}}</a-tag>
<a-tag class="tags" color="#6096E6" v-if="item.zjtg == 1">{{
"专精特新中小企业"
}}</a-tag>
<a-divider /> <a-divider />
<div class="card_desc"> <div class="card_desc">
<a-descriptions layout="vertical"> <a-descriptions layout="vertical">
<a-descriptions-item label="法定代表人">{{ <a-descriptions-item label="法定代表人">{{ item.legal }}</a-descriptions-item>
item.legal
}}</a-descriptions-item>
<a-descriptions-item label="注册时间">{{ <a-descriptions-item label="注册时间">{{
item.build_date.substring(0, item.build_date.indexOf("T")) item.build_date.substring(0, item.build_date.indexOf("T"))
}}</a-descriptions-item> }}</a-descriptions-item>
<a-descriptions-item label="注册资本">{{ <a-descriptions-item label="注册资本">{{ item.capital }}</a-descriptions-item>
item.capital
}}</a-descriptions-item>
<a-descriptions-item label="国民经济行业"> <a-descriptions-item label="国民经济行业">
{{ {{ item.company_industry_parent ? item.company_industry_parent + ">" : ""
item.company_industry_parent
? item.company_industry_parent + ">"
: ""
}}{{ item.company_industry }} }}{{ item.company_industry }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item :span="2" label="注册地址">{{ <a-descriptions-item :span="2" label="注册地址">{{ item.address }}</a-descriptions-item>
item.address
}}</a-descriptions-item>
<template v-if="item.patents.length != 0"> <template v-if="item.patents.length != 0">
<a-descriptions-item <a-descriptions-item :span="3" label="专利信息" v-if="item.patents.length > 3">
:span="3"
label="专利信息"
v-if="item.patents.length > 3"
>
<div v-html="item.patents[0]"></div> <div v-html="item.patents[0]"></div>
<div v-html="item.patents[1]"></div> <div v-html="item.patents[1]"></div>
<div v-html="item.patents[2]"></div> <div v-html="item.patents[2]"></div>
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item <a-descriptions-item :span="3" label="专利信息" v-else-if="item.patents.length == 0">
:span="3"
label="专利信息"
v-else-if="item.patents.length == 0"
>
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item :span="3" label="专利信息" v-else> <a-descriptions-item :span="3" label="专利信息" v-else>
...@@ -354,7 +233,7 @@ ...@@ -354,7 +233,7 @@
{ type: 'email', message: '邮箱不合法' }, { type: 'email', message: '邮箱不合法' },
]" ]"
> >
<a-input v-model:value="formState.email" /> <a-input v-model:value="formState.email" placeholder="请输入邮箱地址" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
...@@ -604,121 +483,106 @@ export default { ...@@ -604,121 +483,106 @@ export default {
setTimeout(() => { setTimeout(() => {
// 加setTimeout是为了让echarts渲染完成后生成图片 // 加setTimeout是为了让echarts渲染完成后生成图片
JSZipUtils.getBinaryContent( JSZipUtils.getBinaryContent("patent.docx", function (error, content) {
"patent.docx", // 抛出异常
function (error, content) { if (error) {
// 抛出异常 throw error;
if (error) { }
throw error; const opts = {
centered: false,
fileType: "docx",
};
opts.getImage = function (tagValue) {
if (tagValue.size && tagValue.data) {
return base64DataURLToArrayBuffer(tagValue.data);
}
return base64DataURLToArrayBuffer(tagValue);
};
opts.getSize = function (_, tagValue) {
if (tagValue.size && tagValue.data) {
return tagValue.size;
} }
const opts = { return [600, 200];
centered: false, };
fileType: "docx", // 创建一个JSZip实例,内容为模板的内容
}; const zip = new PizZip(content);
opts.getImage = function (tagValue) { // 创建并加载docxtemplater实例对象
if (tagValue.size && tagValue.data) { const doc = new docxtemplater().loadZip(zip);
return base64DataURLToArrayBuffer(tagValue.data);
}
return base64DataURLToArrayBuffer(tagValue);
};
opts.getSize = function (_, tagValue) {
if (tagValue.size && tagValue.data) {
return tagValue.size;
}
return [600, 200];
};
// 创建一个JSZip实例,内容为模板的内容
const zip = new PizZip(content);
// 创建并加载docxtemplater实例对象
const doc = new docxtemplater().loadZip(zip);
doc.setOptions({ doc.setOptions({
nullGetter: function () { nullGetter: function () {
//设置空值 undefined 为'' //设置空值 undefined 为''
return ""; return "";
}, },
}); });
// 设置图片模块 // 设置图片模块
doc.attachModule(new ImageModule(opts)); doc.attachModule(new ImageModule(opts));
listRecommend.forEach((item, index) => { listRecommend.forEach((item, index) => {
item.index = index + 1; item.index = index + 1;
item.qualif = []; item.qualif = [];
if (item.high_new == 1) { if (item.high_new == 1) {
item.qualif.push("高新技术企业"); item.qualif.push("高新技术企业");
} }
if (item.zjtg == 1) { if (item.zjtg == 1) {
item.qualif.push("专精特新企业"); item.qualif.push("专精特新企业");
} }
if (item.zjtg_sjxjr == 1) { if (item.zjtg_sjxjr == 1) {
item.qualif.push("专精特新小巨人企业"); item.qualif.push("专精特新小巨人企业");
} }
if (item.quoted_company == 1) { if (item.quoted_company == 1) {
item.qualif.push("上市企业"); item.qualif.push("上市企业");
} }
if (item.patents.length > 3) { if (item.patents.length > 3) {
item.patents.splice(2, item.patents.length - 3); item.patents.splice(2, item.patents.length - 3);
} }
if (item.business_scope) { if (item.business_scope) {
item.business_scope_clone = [...item.business_scope]; item.business_scope_clone = [...item.business_scope];
item.business_scope_clone.forEach((it, index) => {
item.business_scope_clone[index] = it.replace(
/<[^<>]+>/g,
""
);
});
}
item.patents_clone = [...item.patents]; item.business_scope_clone.forEach((it, index) => {
item.patents_clone.forEach((it, index) => { item.business_scope_clone[index] = it.replace(/<[^<>]+>/g, "");
item.patents_clone[index] = it.replace(/<[^<>]+>/g, "");
}); });
item.company_name_clone = item.company_name;
item.company_name_clone = item.company_name_clone.replace(
/<[^<>]+>/g,
""
);
});
// 设置模板变量的值
doc.setData({
...details,
today,
listRecommend,
// business_scope,
// patent,
image1: myChart1.getDataURL({
pixelRatio: 5, //导出的图片分辨率比率,默认是1
backgroundColor: "#fff", //图表背景色
excludeComponents: ["toolbox"], //忽略组件的列表
type: "png", //图片类型支持png和jpeg
}),
});
try {
// 用模板变量的值替换所有模板变量
doc.render();
} catch (error) {
console.error("导出报表失败");
throw error;
} }
// 生成一个代表docxtemplater对象的zip文件(不是一个真实的文件,而是在内存中的表示)
let out = doc.getZip().generate({ item.patents_clone = [...item.patents];
type: "blob", item.patents_clone.forEach((it, index) => {
mimeType: item.patents_clone[index] = it.replace(/<[^<>]+>/g, "");
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
}); });
//formData文件流 item.company_name_clone = item.company_name;
that.blobToBase64( item.company_name_clone = item.company_name_clone.replace(/<[^<>]+>/g, "");
out, });
that.formState.email,
that.details.gkh, // 设置模板变量的值
that.id doc.setData({
); ...details,
// 将目标文件对象保存为目标类型的文件,并命名 today,
// saveAs(out, `专利成果转移转化智能推荐报告.docx`); listRecommend,
// business_scope,
// patent,
image1: myChart1.getDataURL({
pixelRatio: 5, //导出的图片分辨率比率,默认是1
backgroundColor: "#fff", //图表背景色
excludeComponents: ["toolbox"], //忽略组件的列表
type: "png", //图片类型支持png和jpeg
}),
});
try {
// 用模板变量的值替换所有模板变量
doc.render();
} catch (error) {
console.error("导出报表失败");
throw error;
} }
); // 生成一个代表docxtemplater对象的zip文件(不是一个真实的文件,而是在内存中的表示)
let out = doc.getZip().generate({
type: "blob",
mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
});
//formData文件流
that.blobToBase64(out, that.formState.email, that.details.gkh, that.id);
// 将目标文件对象保存为目标类型的文件,并命名
// saveAs(out, `专利成果转移转化智能推荐报告.docx`);
});
}, 1000); }, 1000);
}) })
.catch((err) => { .catch((err) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment