优化
This commit is contained in:
16160
dist-electron/main.js
16160
dist-electron/main.js
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vite-electron",
|
||||
"private": true,
|
||||
"version": "1.4.27",
|
||||
"version": "2.0.0",
|
||||
"main": "dist-electron/main.js",
|
||||
"scripts": {
|
||||
"dev": "chcp 65001 && vite",
|
||||
|
||||
@@ -58,14 +58,14 @@
|
||||
</div>
|
||||
<div class="drawerbox_bo_box_icontext">叫号</div>
|
||||
</div> -->
|
||||
<div class="drawerbox_bo_box_itembox" @click="screenref.shows()">
|
||||
<!-- <div class="drawerbox_bo_box_itembox" @click="screenref.shows()">
|
||||
<div class="drawerbox_bo_box_icon">
|
||||
<el-icon size="40">
|
||||
<Lock />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="drawerbox_bo_box_icontext">锁屏</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div class="drawerbox_bo_box_itembox" @click="to('webview', {
|
||||
url: 'https://cashiernewadmin.sxczgkj.cn/',
|
||||
title: '后台管理'
|
||||
|
||||
@@ -57,10 +57,19 @@ async function findVersionAjax() {
|
||||
let updateFlag = useStorage.get('updateFlag')
|
||||
const res = await findVersion()
|
||||
if (res && res.version) {
|
||||
let reg = /\./g;
|
||||
if (res.version.replace(reg, '') > packageData.version.replace(reg, '') && res.url && !updateFlag) {
|
||||
showDialog.value = true
|
||||
updataInfo.value = res
|
||||
const newVersion = res.version;
|
||||
const oldVersion = packageData.version;
|
||||
const result = compareVersions(newVersion, oldVersion);
|
||||
if (result > 0) {
|
||||
console.log(`${newVersion} 比 ${oldVersion} 大`);
|
||||
if (!updateFlag) {
|
||||
showDialog.value = true
|
||||
updataInfo.value = res
|
||||
}
|
||||
} else if (result < 0) {
|
||||
console.log(`${newVersion} 比 ${oldVersion} 小`);
|
||||
} else {
|
||||
console.log(`${newVersion} 与 ${oldVersion} 相等`);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -68,6 +77,25 @@ async function findVersionAjax() {
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
function compareVersions(version1, version2) {
|
||||
const v1 = version1.split('.').map(Number);
|
||||
const v2 = version2.split('.').map(Number);
|
||||
const maxLength = Math.max(v1.length, v2.length);
|
||||
|
||||
for (let i = 0; i < maxLength; i++) {
|
||||
const num1 = v1[i] || 0;
|
||||
const num2 = v2[i] || 0;
|
||||
|
||||
if (num1 > num2) {
|
||||
return 1;
|
||||
} else if (num1 < num2) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 下载新版本
|
||||
async function uplaodHandle() {
|
||||
try {
|
||||
|
||||
@@ -62,13 +62,17 @@ export const useGlobal = defineStore("global", {
|
||||
label: "收银机客户端",
|
||||
},
|
||||
{
|
||||
type: "APC",
|
||||
type: "WEB",
|
||||
label: "PC管理端",
|
||||
},
|
||||
{
|
||||
type: "APP",
|
||||
label: "APP管理端",
|
||||
},
|
||||
{
|
||||
type: "H5",
|
||||
label: "收款码",
|
||||
},
|
||||
],
|
||||
dineMode: [
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<el-form-item label="设备类型">
|
||||
<el-select v-model="form.connectionType">
|
||||
<el-option label="USB" value="USB"></el-option>
|
||||
<el-option label="网络" value="network"></el-option>
|
||||
<!-- <el-option label="网络" value="network"></el-option> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择设备">
|
||||
@@ -205,7 +205,7 @@ function getPrintList() {
|
||||
// 测试打印
|
||||
function printHandle() {
|
||||
if (!form.value.address) {
|
||||
ElMessage.warning("请选择打印设备");
|
||||
ElMessage.error("请选择打印设备");
|
||||
return;
|
||||
}
|
||||
printDataLoading.value = true;
|
||||
@@ -222,8 +222,12 @@ function printHandle() {
|
||||
// 提交打印机
|
||||
async function submitHandle() {
|
||||
try {
|
||||
if (!form.value.name) {
|
||||
ElMessage.error("请输入设备名称");
|
||||
return;
|
||||
}
|
||||
if (!form.value.address) {
|
||||
ElMessage.warning("请选择打印设备");
|
||||
ElMessage.error("请选择打印设备");
|
||||
return;
|
||||
}
|
||||
Loading.value = true;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<el-form-item label="设备类型">
|
||||
<el-select v-model="form.connectionType">
|
||||
<el-option label="USB" value="USB"></el-option>
|
||||
<el-option label="网络" value="network"></el-option>
|
||||
<!-- <el-option label="网络" value="network"></el-option> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择设备">
|
||||
@@ -67,7 +67,7 @@
|
||||
<div class="print_view">
|
||||
<canvas class="ewm" ref="canvasRef"></canvas>
|
||||
<div class="header">
|
||||
<img class="logo" :src="printData.ticketLogo" />
|
||||
<img class="logo" :src="printData.ticketLogo || logo" />
|
||||
<!-- <span class="title">双屿Pisces</span> -->
|
||||
</div>
|
||||
<div class="number_wrap">
|
||||
@@ -112,6 +112,7 @@ import classify from "@/components/classify/index.vue";
|
||||
import QRCode from 'qrcode'
|
||||
import { usePrint } from "@/store/print.js";
|
||||
import { useGoods } from '@/store/goods.js'
|
||||
import logo from '@/assets/prinnt_label_logo.png';
|
||||
|
||||
const goodsStore = useGoods()
|
||||
const printStore = usePrint();
|
||||
@@ -177,8 +178,16 @@ const printHandle = _.throttle(function () {
|
||||
// 提交打印机
|
||||
async function submitHandle() {
|
||||
try {
|
||||
if (!form.value.name) {
|
||||
ElMessage.error("请输入设备名称");
|
||||
return;
|
||||
}
|
||||
if (!form.value.address) {
|
||||
ElMessage.warning("请选择打印设备");
|
||||
ElMessage.error("请选择打印设备");
|
||||
return;
|
||||
}
|
||||
if (!form.value.categoryList.length) {
|
||||
ElMessage.error("请选择商品分类");
|
||||
return;
|
||||
}
|
||||
Loading.value = true;
|
||||
|
||||
Reference in New Issue
Block a user