Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
ty_patentSys
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hanxiao
ty_patentSys
Commits
b0dfe3cc
Commit
b0dfe3cc
authored
Aug 08, 2023
by
liudx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联调导出接口
parent
a776e5f0
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
239 additions
and
86 deletions
+239
-86
public/company.docx
+0
-0
src/utils/indexApi.js
+1
-1
src/views/company/companyDetails.vue
+182
-9
src/views/company/technology.vue
+6
-34
src/views/login/forget.vue
+0
-9
src/views/patent/patentDetails.vue
+48
-29
src/views/userset/personalSetting.vue
+2
-4
No files found.
public/company.docx
View file @
b0dfe3cc
No preview for this file type
src/utils/indexApi.js
View file @
b0dfe3cc
...
@@ -6,7 +6,7 @@ export const patentselect = p => post('/api/patent/patents',p);
...
@@ -6,7 +6,7 @@ export const patentselect = p => post('/api/patent/patents',p);
//专利详情页面
//专利详情页面
export
const
patentDetail
=
p
=>
get
(
'/api/patent/patentDetail/'
+
p
.
id
);
export
const
patentDetail
=
p
=>
get
(
'/api/patent/patentDetail/'
+
p
.
id
);
//导出word给后端传递base64
//导出word给后端传递base64
export
const
exportword
=
p
=>
post
(
'/api/
patent/patentDetail/125
'
,
p
);
export
const
exportword
=
p
=>
post
(
'/api/
users/enterprisePatentExport
'
,
p
);
//专利智能推荐
//专利智能推荐
export
const
Recommend
=
p
=>
post
(
'/api/patent/intelligentRecommendation/'
+
p
.
id
,
p
);
export
const
Recommend
=
p
=>
post
(
'/api/patent/intelligentRecommendation/'
+
p
.
id
,
p
);
// 企业搜索接口
// 企业搜索接口
...
...
src/views/company/companyDetails.vue
View file @
b0dfe3cc
...
@@ -74,12 +74,13 @@
...
@@ -74,12 +74,13 @@
@
onCancel=
"closeModal"
@
onCancel=
"closeModal"
>
>
<p>
报告格式
<span
class=
"PDF"
>
PDF
</span></p>
<p>
报告格式
<span
class=
"PDF"
>
PDF
</span></p>
<a-form
:model=
"formState"
>
<a-form
:model=
"formState"
ref=
"form"
>
<a-form-item
<a-form-item
:name=
"'email'"
:name=
"'email'"
label=
"发送给"
label=
"发送给"
:rules=
"[
:rules=
"[
{ type: 'email', required: true, message: '请输入正确的邮箱' },
{ required: true, message: '请输入邮箱' },
{ type: 'email', message: '邮箱不合法' },
]"
]"
>
>
<a-input
<a-input
...
@@ -112,6 +113,8 @@
...
@@ -112,6 +113,8 @@
></EchartsCloud>
></EchartsCloud>
<EchartsCon
:option=
"option7"
:id=
"'apply'"
></EchartsCon>
<EchartsCon
:option=
"option7"
:id=
"'apply'"
></EchartsCon>
<EchartsCon
:option=
"option8"
:id=
"'purchase'"
></EchartsCon>
<EchartsCon
:option=
"option8"
:id=
"'purchase'"
></EchartsCon>
<EchartsCon
:option=
"option9"
:id=
"'radar'"
></EchartsCon>
<EchartsCon
:option=
"option10"
:id=
"'yibiao'"
></EchartsCon>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -131,7 +134,7 @@ import {
...
@@ -131,7 +134,7 @@ import {
}
from
"../../utils/indexApi.js"
;
}
from
"../../utils/indexApi.js"
;
import
overview
from
"./overview.vue"
;
import
overview
from
"./overview.vue"
;
import
{
message
}
from
"ant-design-vue"
;
import
{
message
}
from
"ant-design-vue"
;
import
{
userFollow
,
cancelFollow
}
from
"../../utils/userAPI"
;
import
{
userFollow
,
cancelFollow
}
from
"../../utils/userAPI"
;
import
cooperation
from
"./cooperation.vue"
;
import
cooperation
from
"./cooperation.vue"
;
import
technology
from
"./technology.vue"
;
import
technology
from
"./technology.vue"
;
import
docxtemplater
from
"docxtemplater"
;
import
docxtemplater
from
"docxtemplater"
;
...
@@ -847,9 +850,141 @@ export default {
...
@@ -847,9 +850,141 @@ export default {
},
},
],
],
};
};
this
.
option9
=
{
tooltip
:
{
trigger
:
"item"
,
// formatter: function (params) {
// console.log(params);
// },
},
radar
:
[
{
indicator
:
[
{
name
:
"公司竞争力"
,
max
:
30
},
{
name
:
"技术质量"
,
max
:
30
},
{
name
:
"技术体量"
,
max
:
40
},
],
center
:
[
"50%"
,
"50%"
],
radius
:
120
,
triggerEvent
:
true
,
},
{
indicator
:
[
{
name
:
"公司竞争力"
,
max
:
30
},
{
name
:
"技术质量"
,
max
:
30
},
{
name
:
"技术体量"
,
max
:
40
},
],
center
:
[
"50%"
,
"50%"
],
radius
:
120
,
},
],
series
:
[
{
type
:
"radar"
,
radarIndex
:
0
,
symbol
:
"none"
,
data
:
[
{
value
:
[
20
,
10
,
25
],
name
:
"均值"
,
areaStyle
:
{
color
:
"#F7B46A"
,
},
lineStyle
:
{
color
:
"#F7B46A"
,
},
itemStyle
:
{
color
:
"#F7B46A"
,
},
},
],
},
{
type
:
"radar"
,
radarIndex
:
0
,
symbol
:
"none"
,
data
:
[
{
value
:
[
10
,
20
,
10
],
name
:
"科创能力分值"
,
areaStyle
:
{
color
:
"#5A95F7"
,
},
lineStyle
:
{
color
:
"#5A95F7"
,
},
itemStyle
:
{
color
:
"#5A95F7"
,
},
},
],
},
],
};
var
data
=
[
{
name
:
"技术体量"
,
value
:
30
,
},
{
name
:
"技术质量"
,
value
:
30
,
},
{
name
:
"公司竞争力"
,
value
:
30
,
},
];
//已排序好的数组
var
ydata
=
[];
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
ydata
.
push
(
data
[
i
].
name
);
}
var
datalength
=
[];
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
datalength
.
push
(
0
);
}
this
.
option10
=
{
tooltip
:
{
formatter
:
"{a} <br/>{b} : {c}"
,
},
series
:
[
{
name
:
"总分"
,
startAngle
:
180
,
endAngle
:
0
,
min
:
0
,
max
:
100
,
radius
:
"160"
,
center
:
[
"50%"
,
"60%"
],
type
:
"gauge"
,
progress
:
{
show
:
true
,
},
detail
:
{
valueAnimation
:
true
,
formatter
:
"{value}"
,
},
data
:
[
{
value
:
50
,
name
:
"科创能力总分值"
,
},
],
},
],
};
},
},
//导出.overview
//导出.overview
daochu
()
{
daochu
()
{
this
.
$refs
.
form
.
validate
(
"email"
)
.
then
(()
=>
{
this
.
visible
=
false
;
this
.
visible
=
false
;
var
that
=
this
;
var
that
=
this
;
let
share_holders
=
that
.
baseinfo
.
share_holders
;
let
share_holders
=
that
.
baseinfo
.
share_holders
;
...
@@ -880,6 +1015,8 @@ export default {
...
@@ -880,6 +1015,8 @@ export default {
var
chartDom6
=
document
.
getElementById
(
"TechnicalField1"
);
var
chartDom6
=
document
.
getElementById
(
"TechnicalField1"
);
var
chartDom7
=
document
.
getElementById
(
"apply"
);
var
chartDom7
=
document
.
getElementById
(
"apply"
);
var
chartDom8
=
document
.
getElementById
(
"purchase"
);
var
chartDom8
=
document
.
getElementById
(
"purchase"
);
var
chartDom9
=
document
.
getElementById
(
"radar"
);
var
chartDom10
=
document
.
getElementById
(
"yibiao"
);
let
myChart1
=
null
;
let
myChart1
=
null
;
let
myChart2
=
null
;
let
myChart2
=
null
;
let
myChart3
=
null
;
let
myChart3
=
null
;
...
@@ -888,6 +1025,8 @@ export default {
...
@@ -888,6 +1025,8 @@ export default {
let
myChart6
=
null
;
let
myChart6
=
null
;
let
myChart7
=
null
;
let
myChart7
=
null
;
let
myChart8
=
null
;
let
myChart8
=
null
;
let
myChart9
=
null
;
let
myChart10
=
null
;
myChart1
=
echarts
.
init
(
chartDom1
);
myChart1
=
echarts
.
init
(
chartDom1
);
myChart2
=
echarts
.
init
(
chartDom2
);
myChart2
=
echarts
.
init
(
chartDom2
);
myChart3
=
echarts
.
init
(
chartDom3
);
myChart3
=
echarts
.
init
(
chartDom3
);
...
@@ -896,6 +1035,8 @@ export default {
...
@@ -896,6 +1035,8 @@ export default {
myChart6
=
echarts
.
init
(
chartDom6
);
myChart6
=
echarts
.
init
(
chartDom6
);
myChart7
=
echarts
.
init
(
chartDom7
);
myChart7
=
echarts
.
init
(
chartDom7
);
myChart8
=
echarts
.
init
(
chartDom8
);
myChart8
=
echarts
.
init
(
chartDom8
);
myChart9
=
echarts
.
init
(
chartDom9
);
myChart10
=
echarts
.
init
(
chartDom10
);
// myChart2 = echarts.init(chartDom2);
// myChart2 = echarts.init(chartDom2);
// // 第一个echrts
// // 第一个echrts
...
@@ -906,6 +1047,8 @@ export default {
...
@@ -906,6 +1047,8 @@ export default {
myChart5
.
setOption
(
this
.
option5
);
myChart5
.
setOption
(
this
.
option5
);
myChart7
.
setOption
(
this
.
option7
);
myChart7
.
setOption
(
this
.
option7
);
myChart8
.
setOption
(
this
.
option8
);
myChart8
.
setOption
(
this
.
option8
);
myChart9
.
setOption
(
this
.
option9
);
myChart10
.
setOption
(
this
.
option10
);
//技术领域云图
//技术领域云图
myChart6
.
setOption
({
myChart6
.
setOption
({
...
@@ -944,7 +1087,9 @@ export default {
...
@@ -944,7 +1087,9 @@ export default {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
// 加setTimeout是为了让echarts渲染完成后生成图片
// 加setTimeout是为了让echarts渲染完成后生成图片
JSZipUtils
.
getBinaryContent
(
"company.docx"
,
function
(
error
,
content
)
{
JSZipUtils
.
getBinaryContent
(
"company.docx"
,
function
(
error
,
content
)
{
// 抛出异常
// 抛出异常
if
(
error
)
{
if
(
error
)
{
throw
error
;
throw
error
;
...
@@ -1040,6 +1185,18 @@ export default {
...
@@ -1040,6 +1185,18 @@ export default {
excludeComponents
:
[
"toolbox"
],
//忽略组件的列表
excludeComponents
:
[
"toolbox"
],
//忽略组件的列表
type
:
"png"
,
//图片类型支持png和jpeg
type
:
"png"
,
//图片类型支持png和jpeg
}),
}),
image9
:
myChart9
.
getDataURL
({
pixelRatio
:
5
,
//导出的图片分辨率比率,默认是1
backgroundColor
:
"#fff"
,
//图表背景色
excludeComponents
:
[
"toolbox"
],
//忽略组件的列表
type
:
"png"
,
//图片类型支持png和jpeg
}),
image10
:
myChart10
.
getDataURL
({
pixelRatio
:
5
,
//导出的图片分辨率比率,默认是1
backgroundColor
:
"#fff"
,
//图表背景色
excludeComponents
:
[
"toolbox"
],
//忽略组件的列表
type
:
"png"
,
//图片类型支持png和jpeg
}),
});
});
try
{
try
{
// 用模板变量的值替换所有模板变量
// 用模板变量的值替换所有模板变量
...
@@ -1055,18 +1212,34 @@ export default {
...
@@ -1055,18 +1212,34 @@ export default {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
,
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
,
});
});
//formData文件流
//formData文件流
// that.blobToBase64(out
);
that
.
blobToBase64
(
out
,
that
.
formState
.
email
);
// 将目标文件对象保存为目标类型的文件,并命名
// 将目标文件对象保存为目标类型的文件,并命名
saveAs
(
out
,
`企业科创能力报告.docx`
);
// saveAs(out, `企业科创能力报告.docx`);
});
}
);
},
1000
);
},
1000
);
})
.
catch
((
err
)
=>
{
console
.
log
(
err
);
// return false;
// 处理验证失败的情况
});
},
},
blobToBase64
(
blob
)
{
blobToBase64
(
blob
,
email
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
fileReader
=
new
FileReader
();
const
fileReader
=
new
FileReader
();
fileReader
.
onload
=
(
e
)
=>
{
fileReader
.
onload
=
(
e
)
=>
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
exportword
({
file
:
e
.
target
.
result
}).
then
((
res
)
=>
{});
exportword
({
report_data
:
e
.
target
.
result
,
email
:
email
,
}).
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
message
.
success
(
res
.
msg
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
},
300
);
},
300
);
};
};
// readAsDataURL
// readAsDataURL
...
...
src/views/company/technology.vue
View file @
b0dfe3cc
...
@@ -119,6 +119,7 @@ export default {
...
@@ -119,6 +119,7 @@ export default {
{
{
type
:
"radar"
,
type
:
"radar"
,
radarIndex
:
0
,
radarIndex
:
0
,
symbol
:
'none'
,
data
:
[
data
:
[
{
{
value
:
[
20
,
10
,
25
],
value
:
[
20
,
10
,
25
],
...
@@ -139,6 +140,7 @@ export default {
...
@@ -139,6 +140,7 @@ export default {
{
{
type
:
"radar"
,
type
:
"radar"
,
radarIndex
:
0
,
radarIndex
:
0
,
symbol
:
'none'
,
data
:
[
data
:
[
{
{
value
:
[
10
,
20
,
10
],
value
:
[
10
,
20
,
10
],
...
@@ -159,37 +161,6 @@ export default {
...
@@ -159,37 +161,6 @@ export default {
],
],
};
};
chart
.
setOption
(
option1
);
chart
.
setOption
(
option1
);
//在name上移动
// let that = this;
// chart.on("mousemove", function (params) {
// that.hover = true;
// if (params.name == "技术质量") {
// that.$nextTick(() => {
// that.$refs.hover.style.left = params.event.offsetX + "px";
// that.$refs.hover.style.top = params.event.offsetY + "px";
// });
// that.con =
// "从有效专利占专利申请总量比例、有效发明专利占有效专利比例和风险专利占全部申请专利的比例分析";
// } else if (params.name == "公司竞争力") {
// that.$nextTick(() => {
// that.$refs.hover.style.left = params.event.offsetX + "px";
// that.$refs.hover.style.top = params.event.offsetY + "px";
// });
// that.con = "从公司资质类别、公司规模、对外投资和公司融资分析";
// } else if (params.name == "技术体量") {
// that.$nextTick(() => {
// that.$refs.hover.style.left = params.event.offsetX + "px";
// that.$refs.hover.style.top = params.event.offsetY + "px";
// });
// that.con = "从专利申请总量、有效专利总量和近3年专利申请增速分析";
// } else {
// that.hover = false;
// }
// });
// chart.on("mouseout", function (params) {
// that.hover = false;
// });
},
},
getOption2
()
{
getOption2
()
{
var
data
=
[
var
data
=
[
...
@@ -218,11 +189,11 @@ export default {
...
@@ -218,11 +189,11 @@ export default {
this
.
option2
=
{
this
.
option2
=
{
tooltip
:
{
tooltip
:
{
formatter
:
"{a} <br/>{b} : {c}
%
"
,
formatter
:
"{a} <br/>{b} : {c}"
,
},
},
series
:
[
series
:
[
{
{
name
:
"
Pressure
"
,
name
:
"
总分
"
,
startAngle
:
180
,
startAngle
:
180
,
endAngle
:
0
,
endAngle
:
0
,
min
:
0
,
min
:
0
,
...
@@ -240,7 +211,7 @@ export default {
...
@@ -240,7 +211,7 @@ export default {
data
:
[
data
:
[
{
{
value
:
50
,
value
:
50
,
name
:
"
总分
"
,
name
:
"
科创能力总分值
"
,
},
},
],
],
},
},
...
@@ -254,6 +225,7 @@ export default {
...
@@ -254,6 +225,7 @@ export default {
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.company_con
{
.company_con
{
clear
:
both
;
clear
:
both
;
//
min-height
:
900px
;
position
:
relative
;
position
:
relative
;
display
:
flex
;
display
:
flex
;
justify-content
:
flex-start
;
justify-content
:
flex-start
;
...
...
src/views/login/forget.vue
View file @
b0dfe3cc
...
@@ -35,15 +35,6 @@
...
@@ -35,15 +35,6 @@
:rules=
"formRules"
:rules=
"formRules"
>
>
<a-form-item
name=
"phone"
>
<a-form-item
name=
"phone"
>
<!-- :rules="[
{ required: true, message: '请输入手机号!' },
{
pattern:
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
message: '手机号格式不正确!',
validateTrigger: 'onBlur',
},
]" -->
<a-input
v-model:value=
"formState.phone"
placeholder=
"请输入手机号"
>
<a-input
v-model:value=
"formState.phone"
placeholder=
"请输入手机号"
>
<template
#
prefix
>
<template
#
prefix
>
<img
src=
"../../static/login/icon-user.png"
alt=
""
/>
<img
src=
"../../static/login/icon-user.png"
alt=
""
/>
...
...
src/views/patent/patentDetails.vue
View file @
b0dfe3cc
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
</a-breadcrumb>
</a-breadcrumb>
<div
class=
"back_btn"
@
click=
"backbtn"
>
返回
</div>
<div
class=
"back_btn"
@
click=
"backbtn"
>
返回
</div>
<div
class=
"details_title"
>
<div
class=
"details_title"
>
<div
class=
"patent_num"
>
{{
zlcode
?
zlcode
:
details
.
gkh
}}
</div>
<div
class=
"patent_num"
>
{{
zlcode
?
zlcode
:
details
.
gkh
}}
</div>
<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"
...
@@ -227,7 +227,6 @@
...
@@ -227,7 +227,6 @@
回到顶部
回到顶部
</div>
</div>
</a-back-top>
</a-back-top>
</div>
</div>
</div>
</div>
<div
class=
"patent_con_right"
>
<div
class=
"patent_con_right"
>
...
@@ -336,12 +335,13 @@
...
@@ -336,12 +335,13 @@
@
onCancel=
"closeModal"
@
onCancel=
"closeModal"
>
>
<p>
报告格式
PDF
</p>
<p>
报告格式
PDF
</p>
<a-form
:model=
"formState"
>
<a-form
:model=
"formState"
ref=
"form"
>
<a-form-item
<a-form-item
:name=
"'email'"
:name=
"'email'"
label=
"发送给"
label=
"发送给"
:rules=
"[
:rules=
"[
{ type: 'email', required: true, message: '请输入正确的邮箱' },
{ required: true, message: '请输入邮箱' },
{ type: 'email', message: '邮箱不合法' },
]"
]"
>
>
<a-input
v-model:value=
"formState.email"
/>
<a-input
v-model:value=
"formState.email"
/>
...
@@ -355,7 +355,7 @@ import * as echarts from "echarts";
...
@@ -355,7 +355,7 @@ import * as echarts from "echarts";
import
"echarts-wordcloud"
;
import
"echarts-wordcloud"
;
import
{
DownOutlined
}
from
"@ant-design/icons-vue"
;
import
{
DownOutlined
}
from
"@ant-design/icons-vue"
;
import
{
patentDetail
,
exportword
,
Recommend
}
from
"../../utils/indexApi"
;
import
{
patentDetail
,
exportword
,
Recommend
}
from
"../../utils/indexApi"
;
import
{
userFollow
,
cancelFollow
}
from
"../../utils/userAPI"
;
import
{
userFollow
,
cancelFollow
}
from
"../../utils/userAPI"
;
import
EchartsCloud
from
"../../components/EchartsCloud.vue"
;
import
EchartsCloud
from
"../../components/EchartsCloud.vue"
;
import
docxtemplater
from
"docxtemplater"
;
import
docxtemplater
from
"docxtemplater"
;
import
PizZip
from
"pizzip"
;
import
PizZip
from
"pizzip"
;
...
@@ -418,16 +418,16 @@ export default {
...
@@ -418,16 +418,16 @@ export default {
},
},
methods
:
{
methods
:
{
//取消关注
//取消关注
async
cancelFun
(){
async
cancelFun
()
{
let
cancelRes
=
await
cancelFollow
({
let
cancelRes
=
await
cancelFollow
({
f_type
:
"patent"
,
f_type
:
"patent"
,
ent_or_pat_id
:
this
.
id
ent_or_pat_id
:
this
.
id
,
})
})
;
if
(
cancelRes
.
code
==
0
)
{
if
(
cancelRes
.
code
==
0
)
{
this
.
$router
.
go
(
0
)
this
.
$router
.
go
(
0
)
;
message
.
success
(
cancelRes
.
msg
)
message
.
success
(
cancelRes
.
msg
)
;
}
else
{
}
else
{
message
.
error
(
cancelRes
.
msg
)
message
.
error
(
cancelRes
.
msg
)
;
}
}
},
},
//关注接口
//关注接口
...
@@ -437,11 +437,11 @@ export default {
...
@@ -437,11 +437,11 @@ export default {
ent_or_pat_id
:
this
.
id
,
ent_or_pat_id
:
this
.
id
,
name
:
this
.
details
.
gkh
,
name
:
this
.
details
.
gkh
,
});
});
if
(
Follow
.
code
==
0
)
{
if
(
Follow
.
code
==
0
)
{
this
.
$router
.
go
(
0
)
this
.
$router
.
go
(
0
)
;
message
.
success
(
Follow
.
msg
)
message
.
success
(
Follow
.
msg
)
;
}
else
{
}
else
{
message
.
error
(
Follow
.
msg
)
message
.
error
(
Follow
.
msg
)
;
}
}
},
},
...
@@ -513,6 +513,10 @@ export default {
...
@@ -513,6 +513,10 @@ export default {
},
},
//导出word
//导出word
daochu
(
details
)
{
daochu
(
details
)
{
this
.
$refs
.
form
.
validate
(
"email"
)
.
then
(()
=>
{
// 邮箱号码格式正确,可以发送
var
that
=
this
;
var
that
=
this
;
let
date
=
new
Date
();
let
date
=
new
Date
();
var
year
=
date
.
getFullYear
();
var
year
=
date
.
getFullYear
();
...
@@ -563,7 +567,9 @@ export default {
...
@@ -563,7 +567,9 @@ export default {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
// 加setTimeout是为了让echarts渲染完成后生成图片
// 加setTimeout是为了让echarts渲染完成后生成图片
JSZipUtils
.
getBinaryContent
(
"patent.docx"
,
function
(
error
,
content
)
{
JSZipUtils
.
getBinaryContent
(
"patent.docx"
,
function
(
error
,
content
)
{
// 抛出异常
// 抛出异常
if
(
error
)
{
if
(
error
)
{
throw
error
;
throw
error
;
...
@@ -642,21 +648,35 @@ export default {
...
@@ -642,21 +648,35 @@ export default {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
,
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
,
});
});
//formData文件流
//formData文件流
// that.blobToBase64(out
);
that
.
blobToBase64
(
out
,
that
.
formState
.
email
);
// 将目标文件对象保存为目标类型的文件,并命名
// 将目标文件对象保存为目标类型的文件,并命名
saveAs
(
out
,
`专利成果转移转化智能推荐报告.docx`
);
//
saveAs(out, `专利成果转移转化智能推荐报告.docx`);
that
.
visible
=
false
;
that
.
visible
=
false
;
});
}
);
},
1000
);
},
1000
);
})
.
catch
((
err
)
=>
{
console
.
log
(
err
);
// return false;
// 处理验证失败的情况
});
},
},
blobToBase64
(
blob
)
{
blobToBase64
(
blob
,
email
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
fileReader
=
new
FileReader
();
const
fileReader
=
new
FileReader
();
fileReader
.
onload
=
(
e
)
=>
{
fileReader
.
onload
=
(
e
)
=>
{
console
.
log
(
e
.
target
.
result
);
// resolve(e.target.result);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
exportword
({
file
:
e
.
target
.
result
}).
then
((
res
)
=>
{});
exportword
({
report_data
:
e
.
target
.
result
,
email
:
email
,
}).
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
message
.
success
(
res
.
msg
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
},
300
);
},
300
);
};
};
// readAsDataURL
// readAsDataURL
...
@@ -828,7 +848,6 @@ export default {
...
@@ -828,7 +848,6 @@ export default {
line-height
:
60px
;
line-height
:
60px
;
border-radius
:
8px
;
border-radius
:
8px
;
}
}
}
}
.patent_con_right
{
.patent_con_right
{
...
...
src/views/userset/personalSetting.vue
View file @
b0dfe3cc
...
@@ -195,18 +195,16 @@ export default {
...
@@ -195,18 +195,16 @@ export default {
file
.
type
===
"image/gif"
||
file
.
type
===
"image/gif"
||
file
.
type
===
"image/jpg"
;
file
.
type
===
"image/jpg"
;
if
(
!
isJpgOrPng
)
{
if
(
!
isJpgOrPng
)
{
return
this
.
$
message
.
error
(
"请上传正确的图片格式!"
);
return
message
.
error
(
"请上传正确的图片格式!"
);
}
}
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
if
(
!
isLt2M
)
{
if
(
!
isLt2M
)
{
return
this
.
$
message
.
error
(
"图片大小必须小于2MB!"
);
return
message
.
error
(
"图片大小必须小于2MB!"
);
}
}
},
},
imageUpload
(
file
)
{
imageUpload
(
file
)
{
console
.
log
(
file
);
let
data
=
new
FormData
();
let
data
=
new
FormData
();
data
.
append
(
"head_img"
,
file
.
file
);
data
.
append
(
"head_img"
,
file
.
file
);
console
.
log
(
data
);
uploadFile
(
data
).
then
((
res
)
=>
{
uploadFile
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
message
.
success
(
res
.
msg
);
message
.
success
(
res
.
msg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment