This commit is contained in:
parent
64856f846b
commit
dc340bd144
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
|
||||
<div class="printcard-container">
|
||||
<div :class="item.isSelected ? 'printcard printcard-selected' : 'printcard'" v-for="(item, index) in InkjetPrinterData"
|
||||
:key="index" @click="toggleCard(item)">
|
||||
<div :class="item.isSelected ? 'printcard printcard-selected' : 'printcard'"
|
||||
v-for="(item, index) in InkjetPrinterData" :key="index" @click="toggleCard(item)">
|
||||
<!-- 卡片内容 -->
|
||||
<div class="printcard-content">
|
||||
<div class="printcard-header">
|
||||
|
|
@ -15,10 +15,14 @@
|
|||
<div class="printcard-buttons">
|
||||
<a-button type="primary" @click.stop="pageStart(item)">启动</a-button>
|
||||
<a-button type="danger" @click.stop="pageStop(item)" style=" margin-left: 5px; ">停止</a-button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> {{ (item.ip || '') + (item.ip ? ":" : '') + (item.port || '') }}</h3>
|
||||
<div class="printcard-toolbar">
|
||||
<a-icon key="setting" type="setting" @click.stop="pageSetting(item)"></a-icon>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
|
@ -26,13 +30,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="margin: 9px;width:300px;display: flex;">
|
||||
<a-input v-model="addText" /> <a-button style="margin-left: 4px;" @click.stop="pageAdd()">增加条码</a-button>
|
||||
</div>
|
||||
<vxe-table border show-overflow keep-source ref="xTable" :height="table1Height" :data="detailsData"
|
||||
:row-config="{ height: 120 }" :column-config="{ resizable: true }">
|
||||
|
||||
|
||||
<vxe-column field="fileName" title="条码编号" width="160"></vxe-column>
|
||||
<vxe-column field="times" title="打印次数" width="100"></vxe-column>
|
||||
<vxe-column field="print_statistics" title="打印次数" width="100"></vxe-column>
|
||||
<vxe-column title="获取打印统计" width="150">
|
||||
<template #default="{ row }">
|
||||
<a-button type="primary" @click.stop="pageGetPrintInfo(row)">获取打印统计</a-button>
|
||||
|
|
@ -44,9 +50,9 @@
|
|||
|
||||
Y <a-input-number style="width:60px" v-model="row.y" />
|
||||
角度 <a-input-number style="width:60px" v-model="row.direction" />
|
||||
字体 <a-select v-model="row.fontName" :options="fonts"></a-select>
|
||||
字体 <a-select v-model="row.fontName" :options="fonts" style="width:80px;"></a-select>
|
||||
字号 <a-input-number style="width:60px" v-model="row.fontSize" />
|
||||
间距 <a-input-number style="width:60px" v-model="row.fontSpacing" />
|
||||
间距 <a-select v-model="row.fontSpacing" :options="fontSpacings" style="width:80px;"></a-select>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="操作" width="150">
|
||||
|
|
@ -56,11 +62,9 @@
|
|||
</vxe-column>
|
||||
|
||||
</vxe-table>
|
||||
|
||||
|
||||
<div style="margin: 9px;width:300px;display: flex;">
|
||||
<a-input v-model="addText" /> <a-button style="margin-left: 4px;" @click.stop="pageAdd()">增加条码</a-button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -87,16 +91,29 @@ export default {
|
|||
|
||||
currentPrint: null,
|
||||
table1Height: 300,
|
||||
addText:'',
|
||||
addText: '',
|
||||
InkjetPrinterData: [
|
||||
|
||||
],
|
||||
fonts: [
|
||||
{ value: 'Arial', label: 'Arial' }
|
||||
],
|
||||
fontSpacings: [
|
||||
{ value: 5, label: '5' },
|
||||
{ value: 4, label: '4' },
|
||||
{ value: 3, label: '3' },
|
||||
{ value: 2, label: '2' },
|
||||
{ value: 1, label: '1' },
|
||||
{ value: 0, label: '0' },
|
||||
{ value: -1, label: '-1' },
|
||||
{ value: -2, label: '-2' },
|
||||
{ value: -3, label: '-3' },
|
||||
{ value: -4, label: '-4' },
|
||||
{ value: -5, label: '-5' },
|
||||
],
|
||||
|
||||
detailsData: [
|
||||
{ fileName: '080142-690844XAB', x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 24, fontSpacing: 10 }
|
||||
{ fileName: '080142-690844XAB', x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 100, fontSpacing: 10 }
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -115,7 +132,9 @@ export default {
|
|||
},
|
||||
// 函数
|
||||
methods: {
|
||||
|
||||
pageSetting(row) {
|
||||
this.$openPage("/InkjetPrinter/InkjetPrinterSetting/" + row.id); // 打开页面
|
||||
},
|
||||
filesInit() {
|
||||
this.$mk.post({
|
||||
url: this.actions.getFiles,
|
||||
|
|
@ -129,17 +148,17 @@ export default {
|
|||
let ds = [];
|
||||
let textList = a.textList || a.data.textList || [];
|
||||
textList.forEach(text => {
|
||||
ds.push({ fileName: text, x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 24, fontSpacing: 10 })
|
||||
ds.push({ fileName: text, x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 100, fontSpacing: 10 })
|
||||
});
|
||||
|
||||
this.detailsData = ds;
|
||||
}
|
||||
});
|
||||
},
|
||||
pageAdd(){
|
||||
pageAdd() {
|
||||
|
||||
this.detailsData = [...this.detailsData, { fileName: this.addText || '', x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 100, fontSpacing: 10 }]
|
||||
|
||||
this.detailsData = [...this.detailsData ,{ fileName: this.addText || '', x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 24, fontSpacing: 10 }]
|
||||
|
||||
},
|
||||
|
||||
printInit() {
|
||||
|
|
@ -195,7 +214,7 @@ export default {
|
|||
pageStart(item) {
|
||||
var sendData = {
|
||||
id: this.$mk.toBigInt(item.id)
|
||||
};
|
||||
};
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/InkjetPrinter/v1/start/machine`,
|
||||
loading: "启动中...",
|
||||
|
|
@ -213,7 +232,7 @@ export default {
|
|||
pageStop(item) {
|
||||
var sendData = {
|
||||
id: this.$mk.toBigInt(item.id)
|
||||
};
|
||||
};
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/InkjetPrinter/v1/stop/machine`,
|
||||
loading: "停止中...",
|
||||
|
|
@ -227,13 +246,13 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
pageGetPrintInfo() {
|
||||
pageGetPrintInfo(row) {
|
||||
if (!this.currentPrint) {
|
||||
this.$mk.error("请先选择机器");
|
||||
return;
|
||||
}
|
||||
var sendData = {};
|
||||
sendData.id = this.$mk.toBigInt(this.currentPrint.id);
|
||||
var sendData = {};
|
||||
sendData.id = this.$mk.toBigInt(this.currentPrint.id);
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/InkjetPrinter/v1/get/print/statistics`,
|
||||
loading: "获取中...",
|
||||
|
|
@ -243,7 +262,11 @@ export default {
|
|||
if (a.code != 200) {
|
||||
this.$mk.error(a.msg);
|
||||
} else {
|
||||
console.log(a)
|
||||
if (a.data && a.data.print_statistics) {
|
||||
row.print_statistics = a.data.print_statistics;
|
||||
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -255,7 +278,7 @@ export default {
|
|||
}
|
||||
var sendData = Object.assign({}, item);
|
||||
delete sendData._X_ROW_KEY;
|
||||
delete sendData.times;
|
||||
delete sendData.print_statistics;
|
||||
sendData.id = this.$mk.toBigInt(this.currentPrint.id);
|
||||
sendData.contents = sendData.fileName;
|
||||
this.$mk.post({
|
||||
|
|
@ -293,7 +316,7 @@ export default {
|
|||
width: calc(33.33% - 20px);
|
||||
/* 调整卡片宽度,包括间距 */
|
||||
margin: 10px;
|
||||
padding: 20px;
|
||||
padding: 15px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
|
|
@ -313,6 +336,8 @@ export default {
|
|||
font-size: 16px;
|
||||
color: #333;
|
||||
line-height: 1.5;
|
||||
position: relative;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.printcard-content .ant-input {
|
||||
|
|
@ -334,4 +359,14 @@ export default {
|
|||
.printcard-selected {
|
||||
background-color: #b2d9f1;
|
||||
}
|
||||
|
||||
.printcard-toolbar {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -53,8 +53,20 @@ export default {
|
|||
{ title: '复位打印统计', url: "/InkjetPrinter/v1/reset/print/statistics" },
|
||||
{ title: '取消报警闪烁', url: "/InkjetPrinter/v1/cancel/alarm/flash" },
|
||||
{ title: '设置打印延迟', postField: 'delay', url: "/InkjetPrinter/v1/set/print/delay", type: 'integer', value: 1000 },
|
||||
{ title: '设置字体大小', postField: 'fontSize', url: "/InkjetPrinter/v1/font/size", type: 'integer', value: 80 },
|
||||
{ title: '设置字体间距', postField: 'fontSpacing', url: "/InkjetPrinter/v1/font/spacing", type: 'integer', value: 80 },
|
||||
{ title: '设置字体大小', postField: 'fontSize',isNumber:true, url: "/InkjetPrinter/v1/font/size", type: 'integer', value: 80 },
|
||||
{ title: '设置字体间距', postField: 'fontSpacing', url: "/InkjetPrinter/v1/font/spacing", type: 'select',options: [
|
||||
{ value: 5, label: '5' },
|
||||
{ value: 4, label: '4' },
|
||||
{ value: 3, label: '3' },
|
||||
{ value: 2, label: '2' },
|
||||
{ value: 1, label: '1' },
|
||||
{ value: 0, label: '0' },
|
||||
{ value: -1, label: '-1' },
|
||||
{ value: -2, label: '-2' },
|
||||
{ value: -3, label: '-3' },
|
||||
{ value: -4, label: '-4' },
|
||||
{ value: -5, label: '-5' },
|
||||
] , value: 0 },
|
||||
{
|
||||
title: '设置打印上下翻转', postField: 'direction', url: "/InkjetPrinter/v1/set/print/flip", type: 'select', value: 0,
|
||||
options: [{ value: 0, label: '上翻' }, { value: 1, label: '下翻' }]
|
||||
|
|
@ -141,6 +153,9 @@ export default {
|
|||
if (item.postField) {
|
||||
sendData[item.postField] = item.value;
|
||||
}
|
||||
if(item.isString){
|
||||
sendData[item.postField] = item.value +"";
|
||||
}
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}` + item.url,
|
||||
loading: "发送指令中...",
|
||||
|
|
|
|||
Loading…
Reference in New Issue