Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web
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
INET-TWO
web
Commits
80bc8171
Commit
80bc8171
authored
Aug 07, 2024
by
ztf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加自定义组件
parent
fc9f14ca
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
270 additions
and
0 deletions
+270
-0
index.vue
...Components/components/InterfaceInfoObjFileLinks/index.vue
+111
-0
index.vue
...mponents/components/RelatedInterfaceLinkAddList/index.vue
+83
-0
index.vue
...oc/src/privateComponents/components/infoContent/index.vue
+76
-0
No files found.
applications/dee-doc/src/privateComponents/components/InterfaceInfoObjFileLinks/index.vue
0 → 100644
View file @
80bc8171
<!-- 提资信息-附件 -->
<
template
>
<span>
<el-button
v-show=
"showAdd"
type=
"text"
@
click
.
stop=
"btnClick"
>
操作
</el-button>
<el-dropdown>
<span
class=
"el-dropdown-link"
>
<el-button
v-show=
"files.length"
type=
"text"
>
{{
`查看(${files.length
}
)`
}}
<
/el-button
>
<
/span
>
<
el
-
dropdown
-
menu
slot
=
"dropdown"
class
=
"ExtReviewDocComLink-updateflie"
>
<
el
-
dropdown
-
item
v
-
for
=
"(file,index) in files"
:
key
=
"index"
>
<
div
class
=
"file-row"
>
<
span
class
=
"file-name"
:
title
=
"file.originalFileName"
@
click
=
"downloadFile(file)"
>
{{
file
.
originalFileName
}}
<
/span
>
<
/div></
el
-
dropdown
-
item
>
<
/el-dropdown-menu
>
<
/el-dropdown
>
<
/span
>
<
/template
>
<
script
>
import
_get
from
'lodash.get'
import
{
downFileByFileCode
,
downFileByFileId
}
from
'@/api/file'
export
default
{
name
:
'InterfaceInfoObjFileLinks'
,
componentName
:
'提资信息-附件'
,
props
:
{
scope
:
{
type
:
Object
,
default
:
null
}
,
filterKey
:
{
type
:
String
,
default
:
()
=>
''
}
,
showAdd
:
{
type
:
Boolean
,
default
:
false
}
}
,
data
()
{
return
{
}
}
,
computed
:
{
files
()
{
if
(
!
this
.
scope
||
!
this
.
scope
.
row
||
!
this
.
scope
.
column
)
{
return
[]
}
let
objFileLinks
=
_get
(
this
.
scope
.
row
,
this
.
scope
.
column
.
property
)
if
(
!
objFileLinks
)
{
return
[]
}
if
(
this
.
filterKey
)
{
objFileLinks
=
objFileLinks
.
filter
(
link
=>
this
.
filterKey
.
includes
(
link
.
contentType
))
}
return
objFileLinks
.
map
(
link
=>
link
.
target
)
}
}
,
watch
:
{
}
,
// 生命周期 - 创建完成(访问当前this实例)
created
()
{
}
,
// 生命周期 - 挂载完成(访问DOM元素)
mounted
()
{
}
,
methods
:
{
btnClick
(
row
)
{
this
.
$emit
(
'clickRowFun'
,
this
.
scope
,
{
btnvalue
:
'objFileLinks'
}
)
}
,
downloadFile
(
file
)
{
if
(
!
file
.
fileCode
&&
!
file
.
resourceId
)
{
this
.
$utils
.
showMessageWarning
(
'没有权限下载该文件!'
)
return
}
if
(
file
.
fileCode
)
{
downFileByFileCode
(
file
.
fileCode
).
then
(
res
=>
{
this
.
downLoadFileUrl
(
res
)
}
)
return
}
if
(
file
.
resourceId
)
{
downFileByFileId
(
file
.
resourceId
).
then
(
res
=>
{
this
.
downLoadFileUrl
(
res
)
}
)
}
}
,
downLoadFileUrl
(
res
)
{
if
(
res
.
headers
[
'content-disposition'
])
{
const
fileName
=
decodeURI
(
res
.
headers
[
'content-disposition'
].
substring
(
res
.
headers
[
'content-disposition'
].
indexOf
(
'='
)
+
1
,
res
.
headers
[
'content-disposition'
].
length
))
const
url
=
window
.
URL
.
createObjectURL
(
new
Blob
([
res
.
data
],
{
type
:
res
.
headers
[
'content-type'
]
}
))
this
.
$utils
.
downLoadFileUrl
(
url
,
decodeURI
(
fileName
))
}
else
{
if
(
res
.
data
instanceof
Blob
)
{
var
reader
=
new
FileReader
()
reader
.
addEventListener
(
'loadend'
,
()
=>
{
const
message
=
reader
.
result
&&
JSON
.
parse
(
reader
.
result
)
this
.
$utils
.
showMessageWarning
(
message
?
message
.
message
:
'数据包下载出错:未找到数据包内容的下载链接,请联系管理员排查问题!'
)
}
)
reader
.
readAsText
(
res
.
data
,
'utf-8'
)
}
else
{
const
message
=
res
.
data
&&
res
.
data
.
message
this
.
$utils
.
showMessageWarning
(
message
||
'数据包下载出错:未找到数据包内容的下载链接,请联系管理员排查问题!'
)
}
}
}
}
}
<
/script
>
<
style
lang
=
"scss"
>
/* @import url(); 引入css类 */
<
/style
>
applications/dee-doc/src/privateComponents/components/RelatedInterfaceLinkAddList/index.vue
0 → 100644
View file @
80bc8171
<!--
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-08-07 10:59:21
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-08-07 11:00:57
-->
<
template
>
<div
class=
"RelatedInterfaceLinkAddList"
>
<dee-as-com
class=
"FeatureTypicalcom"
:lay-config=
"
{
typeName: 'InternalInterface',
layKey: 'RelatedInterfaceLink-Result'
}"
@selectionChange="selectionChange"
/>
<div
class=
"btns"
>
<el-button
type=
"primary"
class=
"submitBTN"
:disabled=
"!isDisable"
@
click=
"tosubmit"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"$emit('cancel')"
>
取消
</el-button>
</div>
</div>
</
template
>
<
script
>
import
{
post
}
from
'@/utils/http'
export
default
{
name
:
'RelatedInterfaceLinkAddList'
,
componentName
:
'相关接口单-添加'
,
props
:
{
basicData
:
{
type
:
Object
,
default
:
()
=>
{}
}
},
data
()
{
return
{
selections
:
[]
}
},
computed
:
{
isDisable
()
{
return
Boolean
(
this
.
selections
.
length
)
}
},
mounted
()
{
},
methods
:
{
selectionChange
(
data
)
{
this
.
selections
=
data
},
tosubmit
()
{
const
source
=
this
.
$parent
.
$parent
.
$parent
.
$parent
.
basicData
const
params
=
this
.
selections
.
map
(
r
=>
{
return
{
source
:
source
,
operator
:
'ADD'
,
target
:
r
}
})
post
(
'ExtRelatedInterfaceLink/recursions'
,
params
).
then
(
res
=>
{
this
.
$emit
(
'completeEven'
)
})
}
}
}
</
script
>
<
style
lang=
'scss'
scoped
>
.RelatedInterfaceLinkAddList
{
height
:
80%
;
.FeatureTypicalcom
{
height
:
calc
(
100%
-
50px
);
}
.btns
{
margin-top
:
20px
;
display
:
flex
;
justify-content
:
center
;
.submitBTN
{
margin-right
:
25px
;
}
}
}
</
style
>
applications/dee-doc/src/privateComponents/components/infoContent/index.vue
0 → 100644
View file @
80bc8171
<
template
>
<span
v-show=
"!!value"
>
<el-button
type=
"text"
size=
"mini"
@
click=
"drawer = true"
>
显示
</el-button>
<el-drawer
title=
"提资信息"
:visible
.
sync=
"drawer"
:append-to-body=
"true"
direction=
"rtl"
:before-close=
"handleClose"
>
<div
class=
"drawer-pop-content"
>
{{
value
}}
</div>
</el-drawer>
</span>
</
template
>
<
script
>
export
default
{
name
:
'InfoContent'
,
componentName
:
'提资内容显示'
,
props
:
{
value
:
{
type
:
String
,
default
:
()
=>
''
},
width
:
{
type
:
String
,
default
:
()
=>
'400'
},
// eslint-disable-next-line vue/require-default-prop
scope
:
{
type
:
Object
,
defalut
:
()
=>
null
}
},
data
()
{
return
{
drawer
:
false
}
},
computed
:
{
title
()
{
if
(
!
this
.
scope
||
!
this
.
scope
.
column
)
{
return
'标题'
}
return
this
.
scope
.
column
.
title
||
'标题'
}
},
watch
:
{},
// 生命周期 - 创建完成(访问当前this实例)
created
()
{},
// 生命周期 - 挂载完成(访问DOM元素)
mounted
()
{},
methods
:
{
handleClose
()
{
this
.
drawer
=
false
}
}
}
</
script
>
<
style
lang=
"scss"
>
/* @import url(); 引入css类 */
.drawer-pop-content
{
height
:
calc
(
100%
-
20px
);
padding
:
10px
;
word-wrap
:
break-all
;
word-wrap
:break-word
;
word-break
:
break-word
;
overflow-y
:
auto
;
}
</
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