---wiki正式切换到vue3版本---
This commit is contained in:
23
zyplayer-doc-ui/wiki-ui/src/assets/lib/HtmlUtil.js
Normal file
23
zyplayer-doc-ui/wiki-ui/src/assets/lib/HtmlUtil.js
Normal file
@@ -0,0 +1,23 @@
|
||||
export default {
|
||||
createNavigationHeading() {
|
||||
let headArr = []
|
||||
let headNodeArr = document
|
||||
.querySelector('.wiki-page-content')
|
||||
.querySelectorAll('h1,h2,h3,h4,h5,h6')
|
||||
if (headNodeArr.length <= 0) {
|
||||
return []
|
||||
}
|
||||
headNodeArr.forEach((node) => {
|
||||
let text = node.innerHTML
|
||||
.replace(/^\s+/g, '')
|
||||
.replace(/\s+$/g, '')
|
||||
.replace(/<\/?[^>]+(>|$)/g, '')
|
||||
headArr.push({
|
||||
node: node,
|
||||
level: parseInt(node.tagName.replace(/[h]/i, ''), 10),
|
||||
text: text,
|
||||
})
|
||||
})
|
||||
return headArr
|
||||
},
|
||||
}
|
||||
24
zyplayer-doc-ui/wiki-ui/src/assets/lib/UnitUtil.js
Normal file
24
zyplayer-doc-ui/wiki-ui/src/assets/lib/UnitUtil.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
computeFileSize(fileSize) {
|
||||
if (!fileSize) {
|
||||
return '-'
|
||||
}
|
||||
let size = ''
|
||||
if (fileSize < 0.1 * 1024) {
|
||||
size = fileSize.toFixed(2) + 'B'
|
||||
} else if (fileSize < 0.1 * 1024 * 1024) {
|
||||
size = (fileSize / 1024).toFixed(2) + 'KB'
|
||||
} else if (fileSize < 0.1 * 1024 * 1024 * 1024) {
|
||||
size = (fileSize / (1024 * 1024)).toFixed(2) + 'MB'
|
||||
} else {
|
||||
size = (fileSize / (1024 * 1024 * 1024)).toFixed(2) + 'GB'
|
||||
}
|
||||
let sizeStr = size + ''
|
||||
let index = sizeStr.indexOf('.')
|
||||
let dou = sizeStr.substr(index + 1, 2)
|
||||
if (dou == '00') {
|
||||
return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2)
|
||||
}
|
||||
return size
|
||||
},
|
||||
}
|
||||
46
zyplayer-doc-ui/wiki-ui/src/assets/lib/wangEditor.css
Normal file
46
zyplayer-doc-ui/wiki-ui/src/assets/lib/wangEditor.css
Normal file
@@ -0,0 +1,46 @@
|
||||
/**展示内容的样式*/
|
||||
.wang-editor-body {
|
||||
font-size: 14px;
|
||||
padding: 6px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.wang-editor-body table {
|
||||
border-top: 1px solid #ccc;
|
||||
border-left: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.wang-editor-body table td, .wang-editor-body table th {
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-right: 1px solid #ccc;
|
||||
padding: 3px 5px;
|
||||
}
|
||||
|
||||
.wang-editor-body table th {
|
||||
border-bottom: 2px solid #ccc;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wang-editor-body blockquote {
|
||||
display: block;
|
||||
border-left: 8px solid #d0e5f2;
|
||||
padding: 5px 10px;
|
||||
margin: 10px 0;
|
||||
line-height: 1.4;
|
||||
font-size: 100%;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.wang-editor-body code {
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
background-color: #f1f1f1;
|
||||
border-radius: 3px;
|
||||
padding: 3px 5px;
|
||||
margin: 0 3px;
|
||||
}
|
||||
|
||||
.wang-editor-body pre code {
|
||||
display: block;
|
||||
}
|
||||
Reference in New Issue
Block a user