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>
<div class="options">
<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="1125*1593" @click="executePaperSize">A3</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
//const blob = pdf.output("blob")
//this.uploadFile(blob)
//pdf.save(pdfName + '.pdf')
const blob = pdf.output("blob")
this.uploadFile(blob)
pdf.save(pdfName + '.pdf')
},
uploadFile(blob) {
const formData = new FormData()
@ -618,9 +618,8 @@ export default {
'lineColor': 'red'
}//JsBarcode.Options
console.log(options)
options['lineColor'] = 'red'
//options['lineColor'] = 'red'
JsBarcode(svgElement, content, options)
let base64Image = this.convertSvgElementToBase64(svgElement)
console.log('条形码: ', base64Image)
@ -778,6 +777,13 @@ export default {
this.nameField = Object.assign({}, this.nameField, nameField)
},
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()
console.log(ccc.data)
const aaa = this.instance.command.getText()
@ -791,7 +797,7 @@ export default {
}
//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 api = '/api/Administrator/OrderFieldStyle/save'
axios.post(api, saveData).then((res) => {
@ -886,6 +892,7 @@ export default {
return value
}
let end = value.indexOf('}')
if(end == -1) return value
let fieldKey = value.substring(start + 1, end)
let field = this.searchNameField[fieldKey]
let newValue = ''
@ -1042,6 +1049,7 @@ export default {
let start = value.indexOf('{')
if (start != -1) {
let end = value.indexOf('}')
if(end == -1) return value
let keyStr = value.substring(start + 1, end)
let fieldKey = this.nameField[keyStr]
value = value.replace('{' + keyStr + '}', orderData[fieldKey])
@ -1065,6 +1073,9 @@ export default {
if (res.data.code == 1) {
doc = res.data.data.field_style
let tempDoc = JSON.stringify(doc)
///console.log(doc)
tempDoc = JSON.parse(tempDoc)
_this.doc = tempDoc
_this.id = res.data.data.id
@ -1076,7 +1087,7 @@ export default {
initDoc(showData) {
//showData = localStorage.getItem('word_data')
//showData = JSON.parse(showData)
//console.log(showData.main)
console.log(showData)
if (Object.keys(showData).length === 0) {
showData = {
header: [],