This commit is contained in:
lq 2024-07-24 14:00:59 +08:00
parent 9dc291fa60
commit d5ed0bce25

View File

@ -391,7 +391,7 @@ import TheWelcome from './components/TheWelcome.vue'
<i title="纸张类型"></i> <i title="纸张类型"></i>
<div class="options"> <div class="options">
<ul> <ul>
<li data-paper-size="794* " class="active" @click="executePaperSize">A4</li> <li data-paper-size="794*1123" class="active" @click="executePaperSize">A4</li>
<li data-paper-size="1593*2251" @click="executePaperSize">A2</li> <li data-paper-size="1593*2251" @click="executePaperSize">A2</li>
<li data-paper-size="1125*1593" @click="executePaperSize">A3</li> <li data-paper-size="1125*1593" @click="executePaperSize">A3</li>
<li data-paper-size="565*796" @click="executePaperSize">A5</li> <li data-paper-size="565*796" @click="executePaperSize">A5</li>
@ -585,9 +585,9 @@ export default {
} }
pdf.addImage(imgData, 'PNG', x, y, options.width, options.height) pdf.addImage(imgData, 'PNG', x, y, options.width, options.height)
// PDF // PDF
//const blob = pdf.output("blob") const blob = pdf.output("blob")
//this.uploadFile(blob) this.uploadFile(blob)
//pdf.save(pdfName + '.pdf') pdf.save(pdfName + '.pdf')
}, },
uploadFile(blob) { uploadFile(blob) {
const formData = new FormData() const formData = new FormData()
@ -618,9 +618,8 @@ export default {
'lineColor': 'red' 'lineColor': 'red'
}//JsBarcode.Options }//JsBarcode.Options
console.log(options) console.log(options)
options['lineColor'] = 'red' //options['lineColor'] = 'red'
JsBarcode(svgElement, content, options) JsBarcode(svgElement, content, options)
let base64Image = this.convertSvgElementToBase64(svgElement) let base64Image = this.convertSvgElementToBase64(svgElement)
console.log('条形码: ', base64Image) console.log('条形码: ', base64Image)
@ -778,6 +777,13 @@ export default {
this.nameField = Object.assign({}, this.nameField, nameField) this.nameField = Object.assign({}, this.nameField, nameField)
}, },
getHTMLValuea() { getHTMLValuea() {
const editorOption = this.instance.command.getOptions()
console.log(editorOption)
const html = this.instance.command.getHTML()
//let str = html.main
//console.log(html)
//str = str.replace(/&quot;/g, "'")
//console.log(str)
const ccc = this.instance.command.getValue() const ccc = this.instance.command.getValue()
console.log(ccc.data) console.log(ccc.data)
const aaa = this.instance.command.getText() const aaa = this.instance.command.getText()
@ -791,7 +797,7 @@ export default {
} }
//localStorage.setItem('word_data', JSON.stringify(ccc.data)) //localStorage.setItem('word_data', JSON.stringify(ccc.data))
//return false return false
let saveData = { 'id': this.id, 'type': this.orderType, 'field_style': ccc.data } let saveData = { 'id': this.id, 'type': this.orderType, 'field_style': ccc.data }
let api = '/api/Administrator/OrderFieldStyle/save' let api = '/api/Administrator/OrderFieldStyle/save'
axios.post(api, saveData).then((res) => { axios.post(api, saveData).then((res) => {
@ -886,6 +892,7 @@ export default {
return value return value
} }
let end = value.indexOf('}') let end = value.indexOf('}')
if(end == -1) return value
let fieldKey = value.substring(start + 1, end) let fieldKey = value.substring(start + 1, end)
let field = this.searchNameField[fieldKey] let field = this.searchNameField[fieldKey]
let newValue = '' let newValue = ''
@ -1042,6 +1049,7 @@ export default {
let start = value.indexOf('{') let start = value.indexOf('{')
if (start != -1) { if (start != -1) {
let end = value.indexOf('}') let end = value.indexOf('}')
if(end == -1) return value
let keyStr = value.substring(start + 1, end) let keyStr = value.substring(start + 1, end)
let fieldKey = this.nameField[keyStr] let fieldKey = this.nameField[keyStr]
value = value.replace('{' + keyStr + '}', orderData[fieldKey]) value = value.replace('{' + keyStr + '}', orderData[fieldKey])
@ -1065,6 +1073,9 @@ export default {
if (res.data.code == 1) { if (res.data.code == 1) {
doc = res.data.data.field_style doc = res.data.data.field_style
let tempDoc = JSON.stringify(doc) let tempDoc = JSON.stringify(doc)
///console.log(doc)
tempDoc = JSON.parse(tempDoc) tempDoc = JSON.parse(tempDoc)
_this.doc = tempDoc _this.doc = tempDoc
_this.id = res.data.data.id _this.id = res.data.data.id
@ -1076,7 +1087,7 @@ export default {
initDoc(showData) { initDoc(showData) {
//showData = localStorage.getItem('word_data') //showData = localStorage.getItem('word_data')
//showData = JSON.parse(showData) //showData = JSON.parse(showData)
//console.log(showData.main) console.log(showData)
if (Object.keys(showData).length === 0) { if (Object.keys(showData).length === 0) {
showData = { showData = {
header: [], header: [],