Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
dsk-cr20g
Commits
0e4673ac
Commit
0e4673ac
authored
Oct 20, 2023
by
danfuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
2dae0abe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
19 deletions
+61
-19
common.js
dsk-operate-ui/src/assets/js/common.js
+41
-1
details.vue
dsk-operate-ui/src/views/radar/Tender/details.vue
+20
-18
No files found.
dsk-operate-ui/src/assets/js/common.js
View file @
0e4673ac
...
...
@@ -54,8 +54,48 @@ function saveFixed(field, num=2){
return
parseFloat
(
field
.
toFixed
(
num
))
}
//移除字符串中指定标签
let
removeTag
=
function
(
str
,
external
,
implant
,
row
)
{
//str字符串, external外部引用方式的标签组[一个标签], implant嵌入引用的标签组[包含首尾标签], row行内标签组
let
newHtml
=
str
if
(
external
){
let
externalArr
=
external
.
split
(
","
)
for
(
let
item
of
externalArr
){
newHtml
=
newHtml
.
replace
(
new
RegExp
(
"<"
+
item
+
"([^>]+)>"
,
"img"
),
""
)
}
}
if
(
implant
){
let
implantArr
=
implant
.
split
(
","
)
for
(
let
item
of
implantArr
){
newHtml
=
newHtml
.
replace
(
new
RegExp
(
"<"
+
item
+
"[^>]*>([
\\
S
\\
s]*?)<
\
/"
+
item
+
">"
,
"img"
),
""
)
}
}
if
(
row
){
let
rowArr
=
row
.
split
(
","
)
for
(
let
item
of
rowArr
){
newHtml
=
newHtml
.
replace
(
new
RegExp
(
""
+
item
+
"
\\
s*?=
\\
s*?(['`
\"
])[
\\
s
\\
S]*?
\\
1"
,
"img"
),
""
)
}
}
return
newHtml
}
//替换字符串中指定标签
let
checkTag
=
function
(
str
,
oldTag
,
newTag
)
{
//str字符串, oldTag当前标签数组, newTag替换后的新标签数组
let
newHtml
=
str
if
(
oldTag
&&
newTag
){
let
oldArr
=
oldTag
.
split
(
","
)
let
newArr
=
newTag
.
split
(
","
)
if
(
oldArr
.
length
==
newArr
.
length
){
for
(
let
i
=
0
;
i
<
oldArr
.
length
;
i
++
){
newHtml
=
newHtml
.
replace
(
new
RegExp
(
"<"
+
oldArr
[
i
]
+
"
\\
b[^>]*>([
\\
S
\\
s]*?)<
\\
/"
+
oldArr
[
i
]
+
">"
,
"img"
),
"<"
+
newArr
[
i
]
+
">$1</"
+
newArr
[
i
]
+
">"
)
}
}
}
return
newHtml
}
export
{
encodeStr
,
changePath
,
saveFixed
saveFixed
,
removeTag
,
checkTag
}
dsk-operate-ui/src/views/radar/Tender/details.vue
View file @
0e4673ac
...
...
@@ -10,7 +10,7 @@
<span
class=
"list-label list-label-zb"
v-if=
"textList.tenderStage"
>
{{
textList
.
tenderStage
}}
</span>
<span
class=
"list-label"
v-if=
"textList.province||textList.city||textList.area"
>
{{
textList
.
province
}}
<template
v-if=
"textList.city"
>
-
{{
textList
.
city
}}
</
template
><
template
v-if=
"textList.area"
>
-
{{
textList
.
area
}}
</
template
></span>
<span
class=
"list-label list-label-zb"
v-if=
"textList.businessType"
>
{{textList.businessType}}
...
...
@@ -19,22 +19,22 @@
{{textList.industry}}
</span>
</div>
<div
class=
"list-content"
>
<p
class=
"list-content-text"
v-if=
"textList.tenderee"
>
<span>
招采单位:
</span>
<router-link
v-if=
"textList.tenderee"
:to=
"textList.tendereeUipId?'/enterprise/' + encodeStr(textList.tendereeId) :'/company/' + encodeStr(textList.tendereeId) "
tag=
"a"
class=
"list-titel-a blue"
v-html=
"textList.tenderee"
></router-link>
<span
v-else
>
--
</span>
</p>
<p
class=
"list-content-text"
v-if=
"textList.agency"
>
<span>
代理单位:
</span>
<router-link
v-if=
"textList.agency"
:to=
"textList.agencyUipId?'/enterprise/' + encodeStr(textList.agencyId) :'/company/' + encodeStr(textList.agencyId) "
tag=
"a"
class=
"list-titel-a blue"
v-html=
"textList.agency"
></router-link>
<span
v-else
>
--
</span>
</p>
</div>
<div
class=
"list-content"
v-if=
"textList.projectAmount||textList.contact"
>
<p
class=
"list-content-text"
v-if=
"textList.projectAmount"
>
...
...
@@ -47,7 +47,7 @@
<span
>
招采单位 {{textList.contact}}{{textList.contactTel}}
</span>
</p>
</div>
<div
class=
"list-content"
v-if=
"textList.issueTime||textList.overTime||textList.dataSource"
>
<p
class=
"list-content-text"
v-if=
"textList.issueTime"
>
<span>
发布时间:
</span>
...
...
@@ -66,7 +66,7 @@
<span
>
{{textList.dataSource||'--'}}
</span>
</p>
</div>
</li>
</ul>
...
...
@@ -82,20 +82,20 @@
</span>
</div>
<div
class=
"main3-box"
v-html=
"textList.content"
>
</div>
</div>
</div>
</template>
<
script
>
import
"@/assets/styles/public.scss"
;
import
api
from
'@/api/radar/radar.js'
;
import
{
encodeStr
}
from
"@/assets/js/common.js"
import
{
encodeStr
,
removeTag
,
checkTag
}
from
"@/assets/js/common.js"
export
default
{
name
:
'TenderDetails'
,
...
...
@@ -118,11 +118,13 @@
}).
then
(
res
=>
{
// console.log(res);
this
.
textList
=
res
.
data
;
this
.
textList
.
content
=
removeTag
(
res
.
data
.
content
,
'link,meta'
,
'script,style'
,
'href,target,style'
)
//采集详情针对性处理
this
.
textList
.
content
=
checkTag
(
res
.
data
.
content
,
'h1,a'
,
'b,span'
)
//采集详情针对性处理
}).
catch
(
error
=>
{
});
},
}
}
...
...
@@ -325,7 +327,7 @@
min-height
:
400px
;
border
:
1px
solid
#D8D8D8
;
padding
:
16px
;
overflow
:
hidden
;
}
.list-content-img
{
position
:
absolute
;
...
...
@@ -349,4 +351,4 @@
}
</
style
>
\ No newline at end of file
</
style
>
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