Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2024-03-11 09:54:39 +08:00
6 changed files with 45 additions and 17 deletions
+3 -1
View File
@@ -911,7 +911,9 @@
}
})(img));
img.width = 113;
img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) );
console.log(urlPrefix + list[i].url)
img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) );
img.setAttribute('_src', urlPrefix + list[i].url);
domUtils.addClass(icon, 'icon');
+16 -11
View File
@@ -7336,15 +7336,14 @@ var fillCharReg = new RegExp(domUtils.fillChar, 'g');
* editor.setContent('<p>new text</p>', true); //插入的结果是<p>old text</p><p>new text</p>
* ```
*/
setContent: function (html, isAppendTo, notFireSelectionchange) {
var me = this;
me.fireEvent('beforesetcontent', html);
me.fireEvent('beforesetcontent', html);
var root = UE.htmlparser(html);
me.filterInputRule(root);
html = root.toHtml();
me.body.innerHTML = (isAppendTo ? me.body.innerHTML : '') + html;
me.body.innerHTML = (isAppendTo ? me.body.innerHTML : '') + html;
function isCdataDiv(node){
@@ -8078,14 +8077,14 @@ UE.Editor.defaultOptions = function(editor){
setTimeout(function(){
try{
me.options.imageUrl && me.setOpt('serverUrl', me.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/, '$1controller$2'));
var configUrl = me.getActionUrl('config'),
console.log(me.options.imageUrl)
var configUrl = me.getActionUrl('config'),
isJsonp = utils.isCrossDomainUrl(configUrl);
/* 发出ajax请求 */
me._serverConfigLoaded = false;
configUrl && UE.ajax.request(configUrl,{
configUrl && UE.ajax.request('http://localhost:8184/laws-sinotruk/sys/split/file/getImage?fileName=7DS756NXKGimage5.png',{
'method': 'GET',
'dataType': isJsonp ? 'jsonp':'',
'onsuccess':function(r){
@@ -9378,7 +9377,7 @@ var filterWord = UE.filterWord = function () {
* ```
*/
var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) {
var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) {
//todo 原来的方式 [^"'<>\/] 有\/就不能配对上 <TD vAlign=top background=../AAA.JPG> 这样的标签了
//先去掉了,加上的原因忘了,这里先记录
var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,
@@ -9548,7 +9547,8 @@ var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) {
if (nextIndex < htmlstr.length) {
text(currentParent, htmlstr.slice(nextIndex));
}
return root;
console.log(root)
return root;
};
@@ -27736,7 +27736,7 @@ UE.ui = baidu.editor.ui = {};
});
},
setContent: function(content){
this.getDom('content').innerHTML = content;
this.getDom('content').innerHTML = content;
},
setType: function(type){
type = type || 'info';
@@ -29566,6 +29566,11 @@ UE.registerUI('autosave', function(editor) {
});
window.getHtml = function (content) {
let html = ''
var root = UE.htmlparser(content);
html = root.toHtml();
return html
}
})();
@@ -79,6 +79,12 @@ export default {
const fileNowTypes = file.type.split('/')
fileFlag = (fileTypes[0] === fileNowTypes[0])
// console.log('filetype',fileFlag)
const fileSize = file.size // 上传的文件大小
if (fileSize > 1024 * 1024 * 500) {
this.$message.warning('文件大小超出500MB限制, 请压缩或降低文件质量!')
this.fileTypeSatus = false
return false
}
if (!fileFlag) {
this.$message.warning(this.$t('文件格式不正确,请上传图片格式文件'))
this.fileTypeSatus = false
@@ -87,11 +93,10 @@ export default {
if (this.uploadFileFlag < 20) {
this.uploadFileFlag++
}
this.fileTypeSatus = true
this.$message.destroy()
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
this.errorMessage = file.name + '文件大小超出1000MB限制, 请压缩或降低文件质量!'
this.errorMessage = file.name + '文件大小超出500MB限制, 请压缩或降低文件质量!'
}
},
remove () {
@@ -107,7 +112,7 @@ export default {
}
})
if (this.fileTypeSatus) {
if (file.size > 1000000000) {
if (file.size > 1024 * 1024 * 500) {
this.$message.warning(this.errorMessage)
} else {
if (status === 'error') {
@@ -197,6 +197,9 @@ export default {
if (res.success) {
this.contentList = [...res.result]
this.contentList.forEach(item => {
if (item.type === this.TypeOfClauseItem.TABLE.value) {
item.itemContent = window.getHtml(item.itemContent)
}
const imgData = item.itemContent.split('fileName=')[1]
item.thumbUrl = window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + imgData
})
@@ -622,4 +625,7 @@ export default {
.unscramble-item:last-child {
margin-bottom: 0;
}
/deep/ .clause-item-content td, th{
border: 1px solid #DDD;
}
</style>
@@ -26,7 +26,8 @@ export default {
methods: {
open (val) {
this.contentVisible = true
this.contentValue = val
console.log(val)
this.contentValue = window.getHtml(val)
},
handleCancel () {
this.contentVisible = false
@@ -15,6 +15,7 @@
<script>
import UEditor from '../../../../components/uEditor/UEditor.vue'
import { getHtml } from '../../../../../public/ueditor/ueditor.all'
export default {
name: 'SplitDetailAddTable',
components: { UEditor },
@@ -121,9 +122,17 @@ export default {
}
},
methods: {
unhtml (str) {
return str ? str.replace(/[<>]/g, (a) => {
return {
'<': '&lt;',
'>': '&gt;',
}[a]
}) : ''
},
open (tableStr) {
console.log('$$$$$$$$$$$$', tableStr)
this.tableVisible = true
// console.log(window.getHtml(tableStr))
this.ueContent = tableStr
this.$nextTick(() => {
this.$refs.ueditor.setContent(this.ueContent)