update code
This commit is contained in:
parent
dce43668b3
commit
9dc291fa60
38
src/App.vue
38
src/App.vue
|
@ -511,7 +511,7 @@ import JsBarcode from 'jsbarcode'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
count:'',
|
count: '',
|
||||||
fieldArr: [],
|
fieldArr: [],
|
||||||
confShow: false,
|
confShow: false,
|
||||||
tableCol: 4,
|
tableCol: 4,
|
||||||
|
@ -539,7 +539,7 @@ export default {
|
||||||
modeIndex: 0,
|
modeIndex: 0,
|
||||||
imageType: '',
|
imageType: '',
|
||||||
id: 0,
|
id: 0,
|
||||||
code:'',
|
code: '',
|
||||||
flag: false,
|
flag: false,
|
||||||
options: {
|
options: {
|
||||||
margins: [100, 120, 100, 120],
|
margins: [100, 120, 100, 120],
|
||||||
|
@ -610,15 +610,19 @@ export default {
|
||||||
})
|
})
|
||||||
.catch(error => console.error(error))
|
.catch(error => console.error(error))
|
||||||
},
|
},
|
||||||
createBarCode(){//条形码
|
createBarCode() {//条形码
|
||||||
const svgElement = document.createElement('svg')
|
const svgElement = document.createElement('svg')
|
||||||
// 解析一维码
|
// 解析一维码
|
||||||
let content = '1234567788'
|
let content = '1234567788'
|
||||||
let options = JsBarcode.Options
|
let options = {
|
||||||
|
'lineColor': 'red'
|
||||||
|
}//JsBarcode.Options
|
||||||
|
console.log(options)
|
||||||
|
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)
|
||||||
|
|
||||||
},
|
},
|
||||||
handleGeneratebak(idName, name) {//不用了
|
handleGeneratebak(idName, name) {//不用了
|
||||||
|
@ -651,13 +655,13 @@ export default {
|
||||||
)}`
|
)}`
|
||||||
},
|
},
|
||||||
copy(value) {
|
copy(value) {
|
||||||
if(navigator.clipboard && window.isSecureContext) {
|
if (navigator.clipboard && window.isSecureContext) {
|
||||||
navigator.clipboard.writeText(value).then(function() {
|
navigator.clipboard.writeText(value).then(function () {
|
||||||
console.log('复制成功');
|
console.log('复制成功');
|
||||||
}).catch(function(error) {
|
}).catch(function (error) {
|
||||||
console.error('复制失败', error);
|
console.error('复制失败', error);
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
const textArea = document.createElement('textarea');
|
const textArea = document.createElement('textarea');
|
||||||
textArea.value = value;
|
textArea.value = value;
|
||||||
document.body.appendChild(textArea);
|
document.body.appendChild(textArea);
|
||||||
|
@ -787,7 +791,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) => {
|
||||||
|
@ -914,8 +918,10 @@ export default {
|
||||||
if (tdListItem.value.length == 0) {
|
if (tdListItem.value.length == 0) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
let tdValue = tdListItem.value[0].value
|
for (let j = 0; j < tdListItem.value.length; j++) {
|
||||||
tdListItem.value[0].value = this.getFieldValue(tdValue, order)
|
let tdValue = tdListItem.value[j].value
|
||||||
|
tdListItem.value[j].value = this.getFieldValue(tdValue, order)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return trList
|
return trList
|
||||||
},
|
},
|
||||||
|
@ -973,7 +979,7 @@ export default {
|
||||||
'rowspan': tdListItem.rowspan,
|
'rowspan': tdListItem.rowspan,
|
||||||
'value': []
|
'value': []
|
||||||
}
|
}
|
||||||
if(tdListItem.slashTypes != undefined) {
|
if (tdListItem.slashTypes != undefined) {
|
||||||
item.slashTypes = tdListItem.slashTypes
|
item.slashTypes = tdListItem.slashTypes
|
||||||
}
|
}
|
||||||
if (tdListItem.value.length == 0) {
|
if (tdListItem.value.length == 0) {
|
||||||
|
@ -1004,7 +1010,7 @@ export default {
|
||||||
res.push(temTrList)
|
res.push(temTrList)
|
||||||
} else if (configItem.hasOwnProperty('type') && configItem['type'] == 'image') {
|
} else if (configItem.hasOwnProperty('type') && configItem['type'] == 'image') {
|
||||||
//console.log(configItem)
|
//console.log(configItem)
|
||||||
if(configItem.hasOwnProperty('field') && configItem['field'] == 'code') {
|
if (configItem.hasOwnProperty('field') && configItem['field'] == 'code') {
|
||||||
|
|
||||||
configItem.value = this.handleGenerate()
|
configItem.value = this.handleGenerate()
|
||||||
}
|
}
|
||||||
|
@ -1020,7 +1026,7 @@ export default {
|
||||||
//console.log('res',res)
|
//console.log('res',res)
|
||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
handlerTdListItem(tdItem, order){
|
handlerTdListItem(tdItem, order) {
|
||||||
let list = JSON.stringify(tdItem)
|
let list = JSON.stringify(tdItem)
|
||||||
list = JSON.parse(list)
|
list = JSON.parse(list)
|
||||||
for (let i = 0; i < list['value'].length; i++) {
|
for (let i = 0; i < list['value'].length; i++) {
|
||||||
|
@ -1105,7 +1111,7 @@ export default {
|
||||||
getSelectImage() {
|
getSelectImage() {
|
||||||
//const imageFileDom = document.querySelector('#image')
|
//const imageFileDom = document.querySelector('#image')
|
||||||
//imageFileDom.click()
|
//imageFileDom.click()
|
||||||
if(this.flag == true) return
|
if (this.flag == true) return
|
||||||
let _this = this
|
let _this = this
|
||||||
new Dialog({
|
new Dialog({
|
||||||
title: '图片类型',
|
title: '图片类型',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user