zydx-plus 1.33.381 → 1.33.382
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/editor/src/editor.vue +83 -81
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1920,98 +1920,100 @@ export default {
|
|
|
1920
1920
|
readOnlyPage() { // 只读分页
|
|
1921
1921
|
this.htmlArr = []
|
|
1922
1922
|
const data = document.querySelectorAll('.editing-cont')[0].childNodes[0].childNodes
|
|
1923
|
-
this
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1923
|
+
this.$nextTick(()=>{
|
|
1924
|
+
this.wit = document.getElementsByClassName('editor-content')[0].offsetWidth + 20
|
|
1925
|
+
if (this.wit > 900) this.wit = 900
|
|
1926
|
+
let max = this.wit * 1.6 - 46
|
|
1927
|
+
let pHeight = 0
|
|
1928
|
+
let html = ''
|
|
1929
|
+
for (let i = 0; i < data.length; i++) {
|
|
1930
|
+
if (data[i].className === 'custom-link') { // 分割线
|
|
1931
|
+
pHeight += 21
|
|
1932
|
+
html += data[i].outerHTML
|
|
1933
|
+
continue
|
|
1934
|
+
}
|
|
1935
|
+
if (data[i].firstChild.localName === 'img') {
|
|
1936
|
+
const img = data[i].firstChild
|
|
1937
|
+
const imgHeight = img.offsetHeight
|
|
1938
|
+
if ((pHeight + imgHeight) > max) {
|
|
1939
|
+
this.htmlArr.push(html)
|
|
1940
|
+
pHeight = 0
|
|
1941
|
+
html = ''
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
if (data[i].dataset?.signid === 'splitLine') {
|
|
1938
1945
|
this.htmlArr.push(html)
|
|
1939
1946
|
pHeight = 0
|
|
1940
1947
|
html = ''
|
|
1941
1948
|
}
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
html = ''
|
|
1947
|
-
}
|
|
1948
|
-
if (data[i].dataset?.signid === 'ack') {
|
|
1949
|
-
this.htmlArr.push(html)
|
|
1950
|
-
pHeight = 0
|
|
1951
|
-
html = ''
|
|
1952
|
-
}
|
|
1953
|
-
let text = data[i].offsetHeight
|
|
1954
|
-
if ((pHeight + text) > max) {
|
|
1955
|
-
const {start, end, size} = this.rows(data[i], max - pHeight)
|
|
1956
|
-
let child = data[i].childNodes[0]
|
|
1957
|
-
let childNodes = data[i].childNodes[0].childNodes[0]
|
|
1958
|
-
let fontSize = size
|
|
1959
|
-
let fontFamily = 'Microsoft Yahei'
|
|
1960
|
-
let childBColor = '#fff'
|
|
1961
|
-
let childColor = '#000'
|
|
1962
|
-
let textAlign = window.getComputedStyle(data[i], null).textAlign
|
|
1963
|
-
let color = '#000'
|
|
1964
|
-
let className = data[i].className
|
|
1965
|
-
let signid = data[i].dataset.signid
|
|
1966
|
-
let signidArr = signid ? signid.split('-') : []
|
|
1967
|
-
let label = 'span'
|
|
1968
|
-
if (child && child.nodeName !== '#text') {
|
|
1969
|
-
fontSize = window.getComputedStyle(child, null).fontSize
|
|
1970
|
-
fontFamily = window.getComputedStyle(child, null).fontFamily
|
|
1971
|
-
color = window.getComputedStyle(child, null).color
|
|
1972
|
-
}
|
|
1973
|
-
if (childNodes && childNodes.nodeName === 'MARK') {
|
|
1974
|
-
childBColor = window.getComputedStyle(childNodes, null).backgroundColor
|
|
1975
|
-
childColor = window.getComputedStyle(childNodes, null).color
|
|
1976
|
-
}
|
|
1977
|
-
if (signid && signidArr[0] === 'title') {
|
|
1978
|
-
label = 'strong'
|
|
1979
|
-
} else {
|
|
1980
|
-
label = 'span'
|
|
1949
|
+
if (data[i].dataset?.signid === 'ack') {
|
|
1950
|
+
this.htmlArr.push(html)
|
|
1951
|
+
pHeight = 0
|
|
1952
|
+
html = ''
|
|
1981
1953
|
}
|
|
1982
|
-
|
|
1954
|
+
let text = data[i].offsetHeight
|
|
1955
|
+
if ((pHeight + text) > max) {
|
|
1956
|
+
const {start, end, size} = this.rows(data[i], max - pHeight)
|
|
1957
|
+
let child = data[i].childNodes[0]
|
|
1958
|
+
let childNodes = data[i].childNodes[0].childNodes[0]
|
|
1959
|
+
let fontSize = size
|
|
1960
|
+
let fontFamily = 'Microsoft Yahei'
|
|
1961
|
+
let childBColor = '#fff'
|
|
1962
|
+
let childColor = '#000'
|
|
1963
|
+
let textAlign = window.getComputedStyle(data[i], null).textAlign
|
|
1964
|
+
let color = '#000'
|
|
1965
|
+
let className = data[i].className
|
|
1966
|
+
let signid = data[i].dataset.signid
|
|
1967
|
+
let signidArr = signid ? signid.split('-') : []
|
|
1968
|
+
let label = 'span'
|
|
1969
|
+
if (child && child.nodeName !== '#text') {
|
|
1970
|
+
fontSize = window.getComputedStyle(child, null).fontSize
|
|
1971
|
+
fontFamily = window.getComputedStyle(child, null).fontFamily
|
|
1972
|
+
color = window.getComputedStyle(child, null).color
|
|
1973
|
+
}
|
|
1983
1974
|
if (childNodes && childNodes.nodeName === 'MARK') {
|
|
1984
|
-
|
|
1975
|
+
childBColor = window.getComputedStyle(childNodes, null).backgroundColor
|
|
1976
|
+
childColor = window.getComputedStyle(childNodes, null).color
|
|
1977
|
+
}
|
|
1978
|
+
if (signid && signidArr[0] === 'title') {
|
|
1979
|
+
label = 'strong'
|
|
1985
1980
|
} else {
|
|
1986
|
-
|
|
1981
|
+
label = 'span'
|
|
1987
1982
|
}
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1983
|
+
if (child && child.nodeName !== '#text') {
|
|
1984
|
+
if (childNodes && childNodes.nodeName === 'MARK') {
|
|
1985
|
+
html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}" class="${className}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}"><mark class="custom-class" data-color="${childBColor}" style="background-color: ${childBColor}; color: ${childColor};">${start.data}</mark></${label}></p>`
|
|
1986
|
+
} else {
|
|
1987
|
+
html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}" class="${className}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}">${start.data}</${label}></p>`
|
|
1988
|
+
}
|
|
1989
|
+
} else {
|
|
1990
|
+
html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}" class="${className}"><${label} style="font-size: ${size}px;">${start.data}</${label}></p>`
|
|
1991
|
+
}
|
|
1992
|
+
this.htmlArr.push(html)
|
|
1993
|
+
pHeight = 0
|
|
1994
|
+
html = ''
|
|
1995
|
+
if (child && child.nodeName !== '#text') {
|
|
1996
|
+
if (childNodes && childNodes.nodeName === 'MARK') {
|
|
1997
|
+
html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}"><mark class="custom-class" data-color="${childBColor}" style="background-color: ${childBColor}; color: ${childColor};">${end.data}</mark></${label}></p>`
|
|
1998
|
+
} else {
|
|
1999
|
+
html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}">${end.data}</${label}></p>`
|
|
2000
|
+
}
|
|
1997
2001
|
} else {
|
|
1998
|
-
html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${
|
|
2002
|
+
html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${size}px;">${end.data}</${label}></p>`
|
|
1999
2003
|
}
|
|
2004
|
+
pHeight = end.size
|
|
2000
2005
|
} else {
|
|
2001
|
-
|
|
2006
|
+
pHeight += text
|
|
2007
|
+
if(data[i].dataset?.signid !== 'splitLine'&&data[i].dataset?.signid !== 'referenceSplitLine')html += data[i].outerHTML
|
|
2008
|
+
}
|
|
2009
|
+
if (i === data.length - 1) {
|
|
2010
|
+
this.htmlArr.push(html)
|
|
2011
|
+
pHeight = 0
|
|
2012
|
+
html = ''
|
|
2013
|
+
break
|
|
2002
2014
|
}
|
|
2003
|
-
pHeight = end.size
|
|
2004
|
-
} else {
|
|
2005
|
-
pHeight += text
|
|
2006
|
-
if(data[i].dataset?.signid !== 'splitLine'&&data[i].dataset?.signid !== 'referenceSplitLine')html += data[i].outerHTML
|
|
2007
|
-
}
|
|
2008
|
-
if (i === data.length - 1) {
|
|
2009
|
-
this.htmlArr.push(html)
|
|
2010
|
-
pHeight = 0
|
|
2011
|
-
html = ''
|
|
2012
|
-
break
|
|
2013
2015
|
}
|
|
2014
|
-
}
|
|
2016
|
+
})
|
|
2015
2017
|
// 绑定点击事件
|
|
2016
2018
|
setTimeout(() => {
|
|
2017
2019
|
this.documentClick()
|
|
@@ -4551,9 +4553,9 @@ li {
|
|
|
4551
4553
|
border-bottom: 1px dashed rgba(204, 204, 204, 1);
|
|
4552
4554
|
}
|
|
4553
4555
|
:deep(.paging-line)::before{
|
|
4554
|
-
|
|
4556
|
+
//margin-right: 0.25rem;
|
|
4555
4557
|
}
|
|
4556
4558
|
:deep(.paging-line)::after{
|
|
4557
|
-
|
|
4559
|
+
//margin-left: 0.25rem;
|
|
4558
4560
|
}
|
|
4559
4561
|
</style>
|