Toggle navigation
Toggle navigation
This project
Loading...
Sign in
monitor_v3
/
hg-monitor-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
xwx
3 years ago
Commit
39d4f8546be93eeff4d23b61ce9e7c74b036c79a
2 parents
4a80bc4e
e245a275
Merge branch 'master' of
http://113.200.75.45:82/monitor_v3/hg-monitor-web
into master-v32-xwx
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
7 deletions
hg-monitor-web-base/src/main/resources/static/vue3/public/css/base.css
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/document/index.html
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/document/index.js
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/documentationManagement/index.html
hg-monitor-web-base/src/main/resources/static/vue3/public/css/base.css
View file @
39d4f85
...
...
@@ -56,3 +56,6 @@ custom-class="config-dialog"
.select-all
.el-button
{
height
:
42px
;
}
.button-more
{
position
:
absolute
;
right
:
0
;
top
:
33px
;
z-index
:
1
;
background
:
#f5f7fa
;
width
:
80px
;
padding
:
10px
;
}
\ No newline at end of file
...
...
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/document/index.html
View file @
39d4f85
...
...
@@ -92,8 +92,43 @@
<!--列表-->
<div
v-if=
"activeBtn == 'list'"
>
<cm-table-page
:columns=
"columns"
:dataList=
"dataList"
@
loaddata=
"getPage"
:showIndex=
"true"
:showBorder=
"false"
:showSelection=
"false"
:showPage=
"false"
:height=
"height - 54"
></cm-table-page>
:showBorder=
"false"
:showSelection=
"false"
:showTools=
"isEditName"
:showPage=
"false"
:height=
"height - 54"
>
<template
#
default=
"{row,prop,column}"
>
<div
class=
"fileName-div"
style=
"display: flex; align-items: center;"
v-if=
"isEditName && prop == 'fileName'"
@
click=
"getFile(row)"
>
<i
:class=
"['iconfont', iconclass[row.type] == undefined ? 'icon-wenjian' : iconclass[row.type]]"
style=
"font-size: 22px;margin-right: 10px;"
></i>
<div>
<span
@
click
.
stop=
"editFileName(row,index)"
v-if=
"isInput!=row.id"
>
{{row.fileName}}
</span>
</div>
<el-input
@
click
.
stop=
""
@
blur=
"reNameFile(row,true)"
v-if=
"isInput==row.id"
type=
"text"
v-model=
"row.fileName"
></el-input>
</div>
</template>
<template
#
tools=
"{scope}"
>
<div
>
<el-button
type=
"text"
size=
"small"
@
click
.
prevent=
"getFile(scope.row)"
>
<i
class=
"el-icon-view"
/>
查看
<i
@
mouseenter=
"moreShow=scope.row.id"
:class=
"{'el-icon-arrow-down':moreShow!=scope.row.id,'el-icon-arrow-up':moreShow==scope.row.id}"
></i>
</el-button>
<div
class=
"button-more"
v-if=
"moreShow==scope.row.id"
@
mouseleave=
"moreShow=''"
>
<ul>
<li>
<el-button
type=
"text"
size=
"small"
@
click
.
prevent=
"handleDownloadFile(scope.row,scope.$index)"
>
<i
class=
"el-icon-download"
/>
下载
</el-button>
</li>
<li>
<el-button
type=
"text"
size=
"small"
@
click
.
prevent=
"handleDelete(scope.row,scope.$index)"
>
<i
class=
"el-icon-delete"
/>
删除
</el-button>
</li>
</ul>
</div>
</div>
</template>
</cm-table-page>
</div>
<div
v-if=
"activeBtn == 'view'"
style=
"background-color: white"
:style=
"{'height':(height -50) +'px','max-height':(height -50) + 'px','overflow':'auto'}"
>
<div
style=
"text-align: left;margin: 6px;border-bottom: solid 1px #F2F6FC;padding-bottom: 5px;"
>
...
...
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/document/index.js
View file @
39d4f85
...
...
@@ -46,6 +46,11 @@ export default {
isSelect
:{
type
:
Boolean
,
default
:
false
},
//是否编辑文件名称
isEditName
:{
type
:
Boolean
,
default
:
false
}
},
data
()
{
...
...
@@ -67,6 +72,8 @@ export default {
},
setup
(
props
,
{
attrs
,
slots
,
emit
})
{
const
{
proxy
}
=
Vue
.
getCurrentInstance
();
//是否编辑文档名称
const
isInput
=
Vue
.
ref
();
let
height
=
Vue
.
ref
(
window
.
innerHeight
-
20
);
let
iconclass
=
{
'folder'
:
'icon-wenjianjia'
,
...
...
@@ -173,7 +180,8 @@ export default {
// return `<i class="iconfont ${cls}" style="font-size: 22px;margin-right: 10px;"></i><input value="${inputFileName}"></input>`
return
`
<
i
class
=
"iconfont ${cls}"
style
=
"font-size: 22px;margin-right: 10px;"
><
/i><span>${row.fileName}</
span
>
`
}
},
{
},
{
prop
:
'createUser'
,
label
:
'提交人'
,
sortable
:
true
,
...
...
@@ -184,8 +192,8 @@ export default {
sortable
:
true
,
width
:
'180px'
}
/* ,{
prop: '',
/*,{
prop: 'handle',
label: '操作',
sortable: false,
width: '180px',
...
...
@@ -330,6 +338,31 @@ export default {
}
}
/*
* 单个删除文档
* lu
* */
let
handleDelete
=
(
row
,
index
)
=>
{
dataList
.
value
.
filter
((
v
)
=>
{
if
(
v
.
id
==
row
.
id
){
v
.
checked
=
true
}
})
deleteDocument
(
row
.
id
,
row
.
type
)
}
/*
* 下载单个文档
* lu
* */
let
handleDownloadFile
=
(
row
,
index
)
=>
{
dataList
.
value
.
filter
((
v
)
=>
{
if
(
v
.
id
==
row
.
id
){
v
.
checked
=
true
}
})
downloadFile
();
}
const
moreShow
=
Vue
.
ref
();
//更多按钮是否显示
/**
* 将文档放入回收站
...
...
@@ -702,17 +735,55 @@ export default {
proxy
.
$global
.
showMsg
(
msg
,
'warning'
);
}
}
isInput
.
value
=
''
;
})
reNameFileFlg
.
value
[
item
.
id
]
=
false
;
}
}
/*表格列表添加文件大小列
*lu
* */
let
addColumns
=
()
=>
{
let
newColumns
=
{
prop
:
'fileSize'
,
label
:
'文件大小'
,
width
:
'120px'
,
render
:
function
(
row
){
let
fileSizeB
=
0
;
if
(
row
.
fileSize
){
fileSizeB
=
row
.
fileSize
;
}
let
fileSize
=
filterType
(
fileSizeB
)
return
`
<
span
>
$
{
fileSize
}
<
/span>
`
}
}
if
(
props
.
isEditName
){
columns
.
value
.
splice
(
1
,
0
,
newColumns
)
}
}
/*文件大小单位转换
* lu
* */
let
filterType
=
(
val
)
=>
{
if
(
val
==
0
)
return
"0 B"
;
let
k
=
1024
;
let
sizes
=
[
"B"
,
"KB"
,
"GB"
,
"TB"
,
"PB"
,
"EB"
,
"ZB"
,
"YB"
];
let
i
=
Math
.
floor
(
Math
.
log
(
val
)
/
Math
.
log
(
k
));
return
(
val
/
Math
.
pow
(
k
,
i
)).
toPrecision
(
3
)
+
" "
+
sizes
[
i
];
}
/**
* 挂载完
*/
Vue
.
onMounted
(()
=>
{
//表格列表添加文件大小列
addColumns
();
getUserList
();
// 预览模式 不展示左侧树
if
(
!
props
.
isView
)
{
...
...
@@ -782,8 +853,15 @@ export default {
},
function
(){},
false
)
}
//点击文件名称编辑
const
editFileName
=
(
item
)
=>
{
isInput
.
value
=
item
.
id
;
}
return
{
/* viewEdit,*/
editFileName
,
isInput
,
iconclass
,
layout
,
height
,
...
...
@@ -832,7 +910,12 @@ export default {
editType
,
selectAll
,
isAllSelect
,
selectText
selectText
,
handleDelete
,
handleDownloadFile
,
moreShow
,
addColumns
,
filterType
}
}
...
...
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/documentationManagement/index.html
View file @
39d4f85
<div
class=
"container"
>
<cm-document
:isSelect=
"true"
></cm-document>
<cm-document
:isSelect=
"true"
:isEditName=
"true"
></cm-document>
</div>
...
...
Please
register
or
login
to post a comment