This commit is contained in:
24kycj
2025-12-30 20:48:21 +08:00
parent ff6df432ec
commit a6ce251509
11 changed files with 514 additions and 278 deletions
+124 -164
View File
@@ -6,13 +6,8 @@
<div class="title">
{{ $t("index.wordSpace") }}
</div>
<div
class="card"
v-for="(item, index) of infoData"
:key="item.PrinterID"
@click="() => (printData = index)"
style="text-align: left"
>
<div class="card" v-for="(item, index) of infoData" :key="item.PrinterID" @click="() => (printData = index)"
style="text-align: left">
<span style="font-size: 18px; margin-left: 40px">{{
getPrintName(item.PrinterID, true)
}}</span>
@@ -30,9 +25,7 @@
<div :span="21" style="height: 100%; width: calc(100% - 164px)">
<div class="grid-content bg-purple-light mid">
<div class="toMain">
<span style="margin-right: 20px"
>{{ $t("admin.hello") }} {{ user }}</span
>
<span style="margin-right: 20px">{{ $t("admin.hello") }} {{ user }}</span>
<router-link to="/main"> {{ $t("admin.home") }}</router-link>
</div>
@@ -46,27 +39,11 @@
<el-tab-pane :label="$t('admin.userManage')" name="second">
<div class="brief">
<el-row :gutter="20" style="height: 100%">
<el-table
:data="userData"
style="width: 100%"
:empty-text="$t('admin.nodata')"
>
<el-table-column
prop="userUuid"
label="ID"
></el-table-column>
<el-table-column
prop="userName"
:label="$t('admin.userName')"
></el-table-column>
<el-table-column
prop="userRole"
:label="$t('admin.role')"
></el-table-column>
<el-table-column
prop="time"
:label="$t('admin.lastTime')"
></el-table-column>
<el-table :data="userData" style="width: 100%" :empty-text="$t('admin.nodata')">
<el-table-column prop="userUuid" label="ID"></el-table-column>
<el-table-column prop="userName" :label="$t('admin.userName')"></el-table-column>
<el-table-column prop="userRole" :label="$t('admin.role')"></el-table-column>
<el-table-column prop="time" :label="$t('admin.lastTime')"></el-table-column>
<el-table-column prop="time" :label="$t('admin.online')">
<template slot-scope="scope">
{{
@@ -79,26 +56,12 @@
<!--<el-table-column prop="describe" label="描述"></el-table-column>-->
<el-table-column width="120">
<template slot-scope="scope">
<el-button
type="text"
size="medium"
@click="() => edit(scope.row)"
>{{ $t("admin.edit") }}</el-button
>
<el-button
type="text"
size="medium"
@click="adduserVisible = true"
v-if="scope.row.userName == 'admin'"
>{{ $t("admin.add") }}</el-button
>
<el-button
type="text"
size="medium"
@click="() => deleted(scope.row)"
v-if="scope.row.userName != 'admin'"
>{{ $t("admin.delete") }}</el-button
>
<el-button type="text" size="medium" @click="() => edit(scope.row)">{{ $t("admin.edit")
}}</el-button>
<el-button type="text" size="medium" @click="adduserVisible = true"
v-if="scope.row.userName == 'admin'">{{ $t("admin.add") }}</el-button>
<el-button type="text" size="medium" @click="() => deleted(scope.row)"
v-if="scope.row.userName != 'admin'">{{ $t("admin.delete") }}</el-button>
</template>
</el-table-column>
</el-table>
@@ -116,47 +79,30 @@
<div class="service">
<div class="lable">{{ $t("admin.selectWorkstation") }}</div>
<el-select v-model="workValue">
<el-option
v-for="(item, index) in infoData"
:key="item.PrinterID"
:label="getPrintName(item.PrinterID)"
:value="item.PrinterID"
:disabled="runningState"
>
<el-option v-for="(item, index) in infoData" :key="item.PrinterID"
:label="getPrintName(item.PrinterID)" :value="item.PrinterID" :disabled="runningState">
</el-option>
</el-select>
<div class="lable">{{ $t("admin.formatType") }}</div>
<el-select v-model="formatValue">
<el-option
v-for="item in formatOptions"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="runningState"
>
<el-option v-for="item in formatOptions" :key="item.value" :label="item.label" :value="item.value"
:disabled="runningState">
</el-option>
</el-select>
<div class="lable">{{ $t("admin.number") }}</div>
<el-input
v-model="number"
:disabled="runningState"
></el-input>
<el-input v-model="number" :disabled="runningState"></el-input>
</div>
<el-button
@click="
() => {
running = 0;
runningEmergy = false;
isFormat = true;
handleFormat();
}
"
:loading="runningState && isFormat"
:disabled="runningState && !isFormat"
>{{ $t("work.submit") }}</el-button
>
<el-button @click="
() => {
running = 0;
runningEmergy = false;
isFormat = true;
handleFormat();
}
" :loading="runningState && isFormat" :disabled="runningState && !isFormat">{{ $t("work.submit")
}}</el-button>
</div>
<div class="copy">
@@ -167,41 +113,25 @@
<div class="service">
<div class="lable">{{ $t("admin.selectWorkstation") }}</div>
<el-select v-model="workValue2">
<el-option
v-for="(item, index) in infoData"
:key="index"
:label="getPrintName(item.PrinterID)"
:value="item.PrinterID"
:disabled="runningState"
>
<el-option v-for="(item, index) in infoData" :key="index" :label="getPrintName(item.PrinterID)"
:value="item.PrinterID" :disabled="runningState">
</el-option>
</el-select>
<div class="lable">{{ $t("admin.copyPath") }}</div>
<el-input
v-model="path"
:disabled="runningState"
></el-input>
<el-input v-model="path" :disabled="runningState"></el-input>
<div class="lable">{{ $t("admin.number") }}</div>
<el-input
v-model="number2"
:disabled="runningState"
></el-input>
<el-input v-model="number2" :disabled="runningState"></el-input>
</div>
<el-button
:loading="runningState && !isFormat"
:disabled="runningState && isFormat"
@click="
() => {
running = 0;
runningEmergy = false;
isFormat = false;
handleCopy();
}
"
>{{ $t("work.submit") }}</el-button
>
<el-button :loading="runningState && !isFormat" :disabled="runningState && isFormat" @click="
() => {
running = 0;
runningEmergy = false;
isFormat = false;
handleCopy();
}
">{{ $t("work.submit") }}</el-button>
</div>
</div>
</el-tab-pane>
@@ -235,49 +165,22 @@
<div class="wLog" v-html="wlog" style="text-align: left"></div>
</el-dialog>
<el-dialog
:title="$t('admin.addUser')"
:visible.sync="adduserVisible"
width="450px"
class="infdialog"
destroy-on-close
:close-on-click-modal="false"
>
<adduser
:changevisiable="this.chageAdduservisible"
v-if="adduserVisible"
></adduser>
<el-dialog :title="$t('admin.addUser')" :visible.sync="adduserVisible" width="450px" class="infdialog"
destroy-on-close :close-on-click-modal="false">
<adduser :changevisiable="this.chageAdduservisible" v-if="adduserVisible"></adduser>
</el-dialog>
<el-dialog
:title="$t('admin.editUser')"
:visible.sync="edituserVisible"
width="450px"
class="infdialog"
destroy-on-close
:close-on-click-modal="false"
>
<edituser
:changevisiable="this.chageEdituservisible"
v-if="edituserVisible"
:data="editData"
@editover="
() => {
chageEdituservisible(false);
getUserData();
}
"
></edituser>
<el-dialog :title="$t('admin.editUser')" :visible.sync="edituserVisible" width="450px" class="infdialog"
destroy-on-close :close-on-click-modal="false">
<edituser :changevisiable="this.chageEdituservisible" v-if="edituserVisible" :data="editData" @editover="
() => {
chageEdituservisible(false);
getUserData();
}
"></edituser>
</el-dialog>
<el-dialog
:title="$t('admin.copying')"
:visible.sync="copyVisible"
width="450px"
>
<el-progress
:percentage="parseInt(copyState.progress * 100)"
v-if="copyVisible"
></el-progress>
<el-dialog :title="$t('admin.copying')" :visible.sync="copyVisible" width="450px">
<el-progress :percentage="parseInt(copyState.progress * 100)" v-if="copyVisible"></el-progress>
</el-dialog>
</div>
</template>
@@ -464,7 +367,7 @@ export default {
131078: { tag: "Card_Low", err: 0 },
131081: { tag: "Need_Cleaning", err: 0 },
1167: { tag: "PAVO_DS_OFFLINE", err: 0 },
196609:{ tag: "FIND_CARD", err: 0 },
196609: { tag: "FIND_CARD", err: 0 },
},
errList: [],
checkStates: {},
@@ -513,6 +416,11 @@ export default {
method: "get",
url: "/web/get_printer_info",
}).then((res) => {
if (!res.data || !res.data.printerList) {
console.warn('获取工作站列表返回的数据格式不正确:', res)
this.infoData = []
return
}
this.infoData = res.data.printerList;
this.workValue2 = this.workValue =
res.data.printerList.length > 0
@@ -527,6 +435,10 @@ export default {
this.DualSide = 1; //只要有一个是双面就是1
}
}
}).catch((e) => {
console.error('获取工作站列表失败:', e)
this.infoData = []
this.$message.error('获取工作站列表失败,请检查网络连接')
});
},
runCheckState() {
@@ -561,8 +473,7 @@ export default {
//阻止即将发生的事件
this.runningEmergy = true;
appendLog(
`Task ${this.running + 1}/${
this.isFormat ? this.number : this.number2
`Task ${this.running + 1}/${this.isFormat ? this.number : this.number2
} failed, Error = ${data.printer_status}`,
this.root
);
@@ -778,10 +689,10 @@ export default {
);
this.$message(
this.$t("admin.comingSoon") +
`${time[0]}` +
this.$t("admin.readLetter") +
`${disk[0]}` +
this.$t("admin.makeCpoy")
`${time[0]}` +
this.$t("admin.readLetter") +
`${disk[0]}` +
this.$t("admin.makeCpoy")
);
this.handleCopyFile(`${disk[0]}:\\`);
}
@@ -877,10 +788,10 @@ export default {
) {
this.$message(
this.$t("admin.comingSoon") +
`${time[0]}` +
this.$t("admin.readLetter") +
`${disk[0]}` +
this.$t("admin.format")
`${time[0]}` +
this.$t("admin.readLetter") +
`${disk[0]}` +
this.$t("admin.format")
);
await this.$axios({
method: "post",
@@ -1032,42 +943,50 @@ export default {
/deep/ .el-tabs__content {
overflow-y: auto;
}
.infdialog {
/deep/.el-dialog {
padding: 20px 0px;
}
/deep/.el-dialog__header {
padding: 0px;
font-size: 15px;
font-weight: bold;
}
/deep/.el-dialog__body {
margin-top: 30px;
padding: 0px;
}
/deep/.el-dialog__title {
}
/deep/.el-dialog__title {}
}
.wLog {
max-height: 600px;
overflow: auto;
}
h1,
h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
.left {
background-color: #e8e7ee;
height: 100%;
@@ -1076,10 +995,12 @@ a {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
.title {
color: #999999;
font-size: 28px;
}
.card {
background-color: #f5f5f5;
height: 50px;
@@ -1100,36 +1021,45 @@ a {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
overflow-y: auto;
.tabs {
height: 100%;
/deep/.el-tabs__header {
margin: 0px;
}
/deep/ .el-tabs__content {
height: 100%;
}
}
&::-webkit-scrollbar {
/*滚动条整体样式*/
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
width: 10px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #c7c7cb;
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 10px;
background: #ededed;
}
.system {
height: 100%;
width: 100%;
}
.App {
height: 100%;
width: 100%;
@@ -1139,10 +1069,12 @@ a {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
.format {
width: 100%;
height: 300px;
border-bottom: 1px rgb(224, 224, 224) solid;
.title {
font-size: 14px;
width: 150px;
@@ -1155,6 +1087,7 @@ a {
background-color: rgb(240, 240, 240);
font-weight: bold;
}
.tips {
font-size: 14px;
padding: 10px;
@@ -1163,22 +1096,27 @@ a {
align-items: center;
text-align: left;
}
.service {
height: 150px;
display: flex;
align-items: center;
justify-content: flex-start;
.lable {
margin: 20px;
font-size: 14px;
}
.el-select {
width: 150px;
}
.el-input {
width: 180px;
}
}
.el-button {
color: rgb(154, 202, 128);
width: 120px;
@@ -1189,12 +1127,15 @@ a {
float: right;
margin-right: 25px;
}
.el-button:hover {
background-color: white;
}
.el-button:active {
background-color: white;
}
.el-button:focus {
background-color: white;
}
@@ -1204,6 +1145,7 @@ a {
width: 100%;
height: 300px;
border-bottom: 1px rgb(224, 224, 224) solid;
.title {
margin-top: 10px;
font-size: 14px;
@@ -1217,6 +1159,7 @@ a {
background-color: rgb(240, 240, 240);
font-weight: bold;
}
.tips {
font-size: 14px;
padding: 10px;
@@ -1224,22 +1167,27 @@ a {
justify-content: flex-start;
align-items: center;
}
.service {
height: 150px;
display: flex;
align-items: center;
justify-content: flex-start;
.lable {
margin: 20px;
font-size: 14px;
}
.el-select {
width: 150px;
}
.el-input {
width: 180px;
}
}
.el-button {
color: rgb(154, 202, 128);
width: 120px;
@@ -1250,21 +1198,26 @@ a {
float: right;
margin-right: 25px;
}
.el-button:hover {
background-color: white;
}
.el-button:active {
background-color: white;
}
.el-button:focus {
background-color: white;
}
}
}
.dispose {
height: 100%;
width: 100%;
}
.brief {
height: 90%;
width: 100%;
@@ -1274,10 +1227,12 @@ a {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
.el-table {
position: absolute;
z-index: 0;
}
.add-button {
position: absolute;
top: 6px;
@@ -1286,6 +1241,7 @@ a {
}
}
}
.right {
background-color: #c8cfd7;
height: 100%;
@@ -1295,10 +1251,12 @@ a {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
.title {
color: #999999;
font-size: 28px;
}
.log {
padding: 20px;
font-size: 18px;
@@ -1311,11 +1269,13 @@ a {
-moz-box-sizing: border-box;
}
}
.toMain {
position: absolute;
right: 200px;
font-size: 16px;
z-index: 1;
.link {
color: blue;
cursor: pointer;
+46 -33
View File
@@ -4,12 +4,7 @@
<div class="row">
<div class="lable">LogLevel</div>
<el-select v-model="iniData.LogLevel">
<el-option
v-for="item in LogLevelOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
<el-option v-for="item in LogLevelOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<div class="tips">{{ $t("dispose.infoTips") }}</div>
@@ -17,12 +12,7 @@
<div class="row">
<div class="lable">AutoRetryTimes</div>
<el-select v-model="iniData.AutoRetryTimes">
<el-option
v-for="item in autoRetryOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
<el-option v-for="item in autoRetryOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<div class="tips">{{ $t("dispose.errorTips1") }}</div>
@@ -68,14 +58,11 @@
</div>
<div class="tips">{{ $t("dispose.isReservetask") }}</div>
</div>
<div
class="row"
style="
<div class="row" style="
align-items: start;
height: 50px;
border-bottom: 1px rgb(224, 224, 224) solid;
"
>
">
<div class="lable">UploadSharedDir</div>
<div class="switch">
<el-switch v-model="iniData.UploadSharedDir"></el-switch>
@@ -83,16 +70,19 @@
<div class="tips">{{ $t("dispose.isUpload") }}</div>
</div>
<div
class="row"
style="
<div class="row">
<div class="lable">AuthorizationCode</div>
<el-input v-model="iniData.AuthorizationCode" :placeholder="$t('dispose.authCodePlaceholder')"></el-input>
<div class="tips">{{ $t("dispose.authCodeTips") }}</div>
</div>
<div class="row" style="
align-items: flex-start;
justify-content: flex-end;
margin-top: 40px;
margin-right: 40px;
height: 300px;
"
>
">
<el-button @click="save">{{ $t("work.submit") }}</el-button>
</div>
</div>
@@ -146,7 +136,18 @@ export default {
label: "FATAL",
},
],
iniData: null,
iniData: {
LogLevel: 'INFO',
AutoRetryTimes: 0,
TaskDir: '',
SharedDir: '',
RejectConfig: false,
StopOnFailure: false,
KeepCombinedImage: false,
CleanTaskFile: false,
UploadSharedDir: false,
AuthorizationCode: ''
},
AutoRetryTimes: null,
LogLevel: "TRACE",
@@ -205,34 +206,35 @@ export default {
that.iniData.LogLevel = data.LogLevel ? data.LogLevel : "";
that.iniData.CleanTaskFile =
data.CleanTaskFile == "true" ||
data.CleanTaskFile == "True" ||
data.CleanTaskFile
data.CleanTaskFile == "True" ||
data.CleanTaskFile
? true
: false;
that.iniData.KeepCombinedImage =
data.KeepCombinedImage == "true" ||
data.KeepCombinedImage == "True" ||
data.KeepCombinedImage
data.KeepCombinedImage == "True" ||
data.KeepCombinedImage
? true
: false;
that.iniData.RejectConfig =
data.RejectConfig == "true" ||
data.RejectConfig == "True" ||
data.RejectConfig
data.RejectConfig == "True" ||
data.RejectConfig
? true
: false;
that.iniData.StopOnFailure =
data.StopOnFailure == "true" ||
data.StopOnFailure == "True" ||
data.StopOnFailure
data.StopOnFailure == "True" ||
data.StopOnFailure
? true
: false;
that.iniData.UploadSharedDir =
data.UploadSharedDir == "true" ||
data.UploadSharedDir == "True" ||
data.UploadSharedDir
data.UploadSharedDir == "True" ||
data.UploadSharedDir
? true
: false;
that.iniData.AuthorizationCode = data.AuthorizationCode ? data.AuthorizationCode : "";
console.log(data);
}
});
@@ -298,6 +300,7 @@ export default {
-moz-box-sizing: border-box;
display: flex;
flex-direction: column;
.title {
font-size: 14px;
font-weight: bold;
@@ -310,38 +313,45 @@ export default {
align-items: center;
background-color: rgb(240, 240, 240);
}
.row {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
margin-top: 20px;
.lable {
width: 200px;
margin-left: 20px;
font-size: 14px;
text-align: left;
}
.el-input {
width: 200px;
margin-left: 20px;
}
.el-select {
width: 200px;
margin-left: 20px;
}
.switch {
display: flex;
margin-left: 20px;
justify-content: flex-start;
width: 200px;
}
.tips {
font-size: 14px;
margin-left: 20px;
width: calc(100% - 440px);
text-align: left;
}
.el-button {
color: rgb(154, 202, 128);
width: 120px;
@@ -350,12 +360,15 @@ export default {
border-radius: 1px;
box-shadow: 1px 0px 2px 0px grey;
}
.el-button:hover {
background-color: white;
}
.el-button:active {
background-color: white;
}
.el-button:focus {
background-color: white;
}
+11 -2
View File
@@ -1025,6 +1025,13 @@ export default {
url: '/web/get_printer_info'
})
.then((res) => {
if (!res.data || !res.data.printerList) {
console.warn('获取工作站列表返回的数据格式不正确:', res)
this.infoData = []
this.$message.error(this.$t('main.notConnected') || '获取工作站列表失败')
return
}
let infoData = [...this.infoData]
this.infoData = res.data.printerList.map((item, index) => {
let child = { ...item }
@@ -1038,7 +1045,7 @@ export default {
}
})
// console.log('infoData', this.infoData)
if (!res.data.printerList || res.data.printerList.length == 0) {
if (res.data.printerList.length == 0) {
this.$message.error(this.$t('main.notConnected'))
}
let DualSide = 0 //默认是单面
@@ -1077,7 +1084,9 @@ export default {
this.DualSide = DualSide
})
.catch((e) => {
console.error('获取工作站列表失败:', e)
this.infoData = []
this.$message.error(this.$t('main.notConnected') || '获取工作站列表失败,请检查网络连接')
})
},
// 清除报错通知
+45 -41
View File
@@ -9,24 +9,14 @@
state == null
? this.$t("systemControl.detecting")
: state
? this.$t("systemControl.start")
: this.$t("systemControl.stop")
? this.$t("systemControl.start")
: this.$t("systemControl.stop")
}}</span>
<div>{{ $t("systemControl.tips1") }}</div>
</div>
<div class="serviceImg">
<el-button
icon="el-icon-video-play"
circle
@click="play"
:disabled="state || state == null"
></el-button>
<el-button
icon="el-icon-video-pause"
circle
@click="pause"
:disabled="!state || state == null"
></el-button>
<el-button icon="el-icon-video-play" circle @click="play" :disabled="state || state == null"></el-button>
<el-button icon="el-icon-video-pause" circle @click="pause" :disabled="!state || state == null"></el-button>
</div>
</div>
</div>
@@ -36,12 +26,8 @@
<div class="select">
<div class="lable">{{ $t("systemControl.selectWorkstation") }}</div>
<el-select v-model="workValue">
<el-option
v-for="item in printData"
:key="item.PrinterID"
:label="getPrintName(item.PrinterID)"
:value="item.PrinterID"
>
<el-option v-for="item in printData" :key="item.PrinterID" :label="getPrintName(item.PrinterID)"
:value="item.PrinterID">
</el-option>
</el-select>
</div>
@@ -118,27 +104,18 @@
<div class="select">
<div class="lable">{{ $t("systemControl.refreshTime1") }}</div>
<el-input v-model="refreshTime1" type="number" style="width: 300px">
<el-button
slot="append"
icon="el-icon-finished"
@click="handleSaveTime1"
></el-button>
></el-input
>
<el-button slot="append" icon="el-icon-finished" @click="handleSaveTime1"></el-button>
></el-input>
</div>
<div class="select">
<div class="lable">{{ $t("systemControl.refreshTime2") }}</div>
<el-input v-model="refreshTime2" type="number" style="width: 300px">
<el-button
slot="append"
icon="el-icon-finished"
@click="handleSaveTime2"
></el-button
></el-input>
<el-button slot="append" icon="el-icon-finished" @click="handleSaveTime2"></el-button></el-input>
</div>
<div class="select">
<div class="lable">{{ $t("systemControl.guide") }}</div>
<el-switch @change="changeStep" v-model="showStep" :active-text="$t('systemControl.show')" :inactive-text="$t('systemControl.hide')"></el-switch>
<el-switch @change="changeStep" v-model="showStep" :active-text="$t('systemControl.show')"
:inactive-text="$t('systemControl.hide')"></el-switch>
</div>
</div>
</div>
@@ -147,12 +124,7 @@
<div class="select">
<div class="lable">{{ $t("systemControl.changeLanguage") }}</div>
<el-select v-model="selectLan">
<el-option
v-for="item in languages"
:key="item.value"
:label="item.label"
:value="item.value"
>
<el-option v-for="item in languages" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
@@ -323,7 +295,7 @@ export default {
// );
//}, 2000);
//this.workValue = !this.printData ? null : this.printData[0].PrinterID;
if (!localStorage.getItem('hideStep')||localStorage.getItem('hideStep')==0) this.showStep = true
if (!localStorage.getItem('hideStep') || localStorage.getItem('hideStep') == 0) this.showStep = true
},
beforeDestroy() {
this.timer = null;
@@ -360,11 +332,20 @@ export default {
method: "get",
url: "/web/get_printer_info",
}).then((res) => {
if (!res.data || !res.data.printerList) {
console.warn('获取工作站列表返回的数据格式不正确:', res)
this.printData = []
return
}
this.printData = res.data.printerList;
if (this.printData.length != 0) {
//自动选择第一个
this.workValue = this.printData[0].PrinterID;
}
}).catch((e) => {
console.error('获取工作站列表失败:', e)
this.printData = []
this.$message.error('获取工作站列表失败,请检查网络连接')
});
},
checkServerState(callback) {
@@ -779,12 +760,14 @@ export default {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
.restart {
width: 100%;
height: 180px;
display: flex;
flex-direction: column;
border-bottom: 1px rgb(224, 224, 224) solid;
.title {
font-size: 14px;
width: 300px;
@@ -797,27 +780,32 @@ export default {
background-color: rgb(240, 240, 240);
font-weight: bold;
}
.service {
width: 100%;
height: 120px;
display: flex;
justify-content: flex-start;
align-items: center;
.tips {
color: rgb(94, 94, 94);
font-size: 14px;
margin-left: 20px;
}
.serviceImg {
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
margin-left: 100px;
.begin {
width: 55px;
height: 55px;
}
.stop {
margin-left: 5px;
width: 50px;
@@ -826,12 +814,14 @@ export default {
}
}
}
.control {
width: 100%;
height: 420px;
display: flex;
flex-direction: column;
border-bottom: 1px rgb(224, 224, 224) solid;
.title {
margin-top: 20px;
font-size: 14px;
@@ -845,9 +835,11 @@ export default {
background-color: rgb(240, 240, 240);
font-weight: bold;
}
.service {
display: flex;
flex-direction: column;
.select {
display: flex;
flex-direction: row;
@@ -865,10 +857,12 @@ export default {
width: 150px;
margin-left: 20px;
}
.el-select {
width: 180px;
}
}
.concrete {
display: flex;
flex-direction: row;
@@ -894,6 +888,7 @@ export default {
flex-wrap: wrap;
justify-content: flex-start;
align-items: flex-start;
.el-button {
width: 180px;
height: 35px;
@@ -911,15 +906,19 @@ export default {
border-radius: 1px;
box-shadow: 1px 0px 2px 0px grey;
}
.el-button:nth-child(4) {
margin-left: 0 !important;
}
.el-button:hover {
background-color: white;
}
.el-button:active {
background-color: white;
}
.el-button:focus {
background-color: white;
}
@@ -927,11 +926,13 @@ export default {
}
}
}
.languageer {
width: 100%;
height: 220px;
display: flex;
flex-direction: column;
.title {
margin-top: 20px;
font-size: 14px;
@@ -945,6 +946,7 @@ export default {
background-color: rgb(240, 240, 240);
font-weight: bold;
}
.select {
display: flex;
flex-direction: row;
@@ -952,12 +954,14 @@ export default {
align-items: flex-start;
margin-left: 20px;
margin-top: 20px;
.lable {
margin-top: 5px;
font-size: 14px;
width: 150px;
text-align: left;
}
.el-select {
width: 180px;
}
@@ -17,11 +17,6 @@
</el-form>
</div>
<span slot="footer" class="dialog-footer grand-footer">
<div class="footer-left">
<el-button type="warning" size="medium" plain icon="el-icon-key" @click="setAuthCode">
设置授权码
</el-button>
</div>
<div class="footer-buttons">
<el-button @click="handleClose" size="medium" icon="el-icon-close">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" @click="handleSave" size="medium" icon="el-icon-check">{{ $t('common.confirm')
@@ -76,22 +71,41 @@ export default {
this.visibleSync = false
},
handleSave() {
// 验证加密狗计数
if (this.form.is_dongle_count) {
if (!this.form.dongle_count || this.form.dongle_count <= 0 || !Number.isInteger(this.form.dongle_count)) {
this.$message.warning(this.$t('work.dongleCountRequired') || '请输入有效的加密狗安装次数(必须是正整数)')
return
}
}
// 验证 ISO 文件名
if (this.form.is_generate_iso && !this.form.iso_file_name) {
this.$message.warning(this.$t('work.isoNameInput') || '请输入 ISO 文件名')
return
}
// 验证 ZIP 文件名
if (this.form.is_generate_zip) {
if (!this.form.zip_file_name) {
this.$message.warning(this.$t('work.zipNameInput') || '请输入 ZIP 文件名')
return
}
// 验证 ZIP 加密密码
if (this.form.is_zip_encrypt) {
if (!this.form.zip_password) {
this.$message.warning(this.$t('work.pleasePassword') || '请输入 ZIP 压缩密码')
return
}
if (this.form.zip_password !== this.form.zip_repassword) {
this.$message.warning(this.$t('work.zipPassWrong') || 'ZIP 压缩密码不一致')
return
}
}
}
this.$emit('save')
},
setAuthCode() {
this.$prompt(this.$t('work.inputAuthCode') || '请输入作业授权码', this.$t('work.setAuthCode') || '授权码设置', {
confirmButtonText: this.$t('common.ok') || '确定',
cancelButtonText: this.$t('common.cancel') || '取消',
inputValue: this.form.auth_code || '',
inputPattern: /^[a-zA-Z0-9]*$/,
inputErrorMessage: '授权码格式不正确'
}).then(({ value }) => {
this.$set(this.form, 'auth_code', value);
this.$message({
type: 'success',
message: '授权码已设置'
});
}).catch(() => { });
}
}
}
@@ -101,7 +115,7 @@ export default {
/* 样式将包含在主组件中或按需引入 */
.grand-footer {
display: flex;
justify-content: space-between;
justify-content: flex-end;
align-items: center;
width: 100%;
}
+244 -8
View File
@@ -167,6 +167,19 @@ export default {
switch_tag: true,
submitLoading: false,
// 新手引导
guideStep: null,
currentStep: 0,
// 文件相关
file_name3: '',
zip_attrs: { accept: '.zip' },
iso_attrs: { accept: 'iso/img' },
// 辅助字段
flag: false,
isPass: false,
filter_rules: [[0], [1, 5], [0], [0], [3]],
flag_cont_up: false,
customColors: [
{ color: '#67C23A', percentage: 99 },
@@ -204,8 +217,7 @@ export default {
zip_repassword: '',
copy_hash: false,
is_dongle_count: false,
dongle_count: 0,
auth_code: ''
dongle_count: 1
}
}
},
@@ -217,6 +229,33 @@ export default {
let per = (this.size / (1024 * 1024) / mb) * 100
if (isNaN(per) || !isFinite(per)) return 0
return per > 100 ? 100 : parseFloat(per.toFixed(1))
},
// 打印选项
print_op() {
return [
{ value: 2, label: this.$t('work.front') },
{ value: 3, label: this.$t('work.back') },
{ value: 1, label: this.$t('work.double') }
]
},
// 分区类型
type() {
return [
{ value: 0, label: this.$t('work.diskPart') },
{ value: 1, label: this.$t('work.cdPart') },
{ value: 3, label: this.$t('work.forbidCopyPart') },
{ value: 5, label: this.$t('work.cdWithDisk') }
]
},
// 文件类型
file_type() {
return [
{ value: 0, label: this.$t('work.fileAnd') },
{ value: 1, label: this.$t('work.eCd') },
{ value: 2, label: this.$t('work.zip') },
{ value: 3, label: this.$t('work.passZip') },
{ value: 4, label: this.$t('work.forbidCopyU') }
]
}
},
created() {
@@ -258,6 +297,16 @@ export default {
this.print_flag = this.dice === 1 ? 2 : 1
this.loadNetworkCredentials()
this.getTemplates()
// 加载新手引导
this.guideStep = JSON.parse(localStorage.getItem('guideStep'))
this.currentStep = localStorage.getItem('currentStep')
if (this.guideStep && this.guideStep[this.currentStep]) {
this.guideStep[this.currentStep].show = false
setTimeout(() => {
this.guideStep[this.currentStep].show = true
}, 200)
}
},
// --- 高级设置与录制 ---
@@ -336,9 +385,51 @@ export default {
try {
const data = JSON.parse(content)
this.fileData = data
this.tableData = data.tableData || []
this.form = {}
this.tableData = []
// 解析正面数据字段
if (data.frontData && Array.isArray(data.frontData)) {
data.frontData.forEach(item => {
if ([1, 3, 4, 5].includes(item.type)) {
const defaultVal = item.DefaultText !== undefined ? item.DefaultText : ''
this.tableData.push({
name: item.name + this.$t('work.front_tag'),
val: defaultVal,
origin_name: item.name,
type: item.type,
default: item.DefaultText
})
this.$set(this.form, item.name, defaultVal)
}
})
}
// 解析背面数据字段
if (data.backData && Array.isArray(data.backData)) {
data.backData.forEach(item => {
if ([1, 3, 4, 5].includes(item.type)) {
const defaultVal = item.DefaultText !== undefined ? item.DefaultText : ''
this.tableData.push({
name: item.name + this.$t('work.back_tag'),
val: defaultVal,
origin_name: item.name,
type: item.type,
default: item.DefaultText
})
this.$set(this.form, item.name, defaultVal)
}
})
}
// 清空文件选择器
if (this.$refs.refFile2) this.$refs.refFile2.value = ''
if (this.$refs.refFile3) this.$refs.refFile3.value = ''
this.csvIsExist = false
this.file_name = null
this.currentTemplate = ''
} catch (e) {
console.error('解析标签文件失败:', e)
this.$message.error('无效的标签文件')
}
},
@@ -382,7 +473,15 @@ export default {
changeTemplate(templatePath) {
if (!templatePath) return
fs.readFile(templatePath, 'utf8', (err, data) => {
if (!err) this.readFile(data)
if (err) {
console.error('读取模板文件时出错:', err)
this.$message.error('读取模板文件失败')
return
}
// 创建文件对象保存到fileLists,与手动导入保持一致
const fileName = path.basename(templatePath)
this.fileLists[0] = new File([data], fileName, { type: '' })
this.readFile(data)
})
},
@@ -558,7 +657,6 @@ export default {
data += `&copy_hash=${!!this.high_setting_form.copy_hash}`
data += `&enable_dongle_counter=${!!this.high_setting_form.is_dongle_count}`
data += `&donglel_install_count=${this.high_setting_form.dongle_count || 0}`
data += `&auth_code=${encodeURIComponent(this.high_setting_form.auth_code || '')}`
// 录像与标识
data += `&is_blend=${!!this.high_setting_form.is_blend}`
@@ -640,9 +738,6 @@ export default {
this.submitLoading = false
})
} catch (e) {
console.error(e)
this.$message.error('Failed to create file list')
this.submitLoading = false
}
},
saveWork() {
@@ -660,6 +755,147 @@ export default {
}).then(result => {
if (result.filePath) fs.writeFileSync(result.filePath, JSON.stringify(save))
})
},
// --- 新手引导功能 ---
exitGuide() {
for (let key in this.guideStep) {
this.guideStep[key].show = false
}
this.currentStep = -1
localStorage.setItem('currentStep', this.currentStep)
localStorage.setItem('guideStep', JSON.stringify(this.guideStep))
},
prevStep() {
this.guideStep[this.currentStep].show = false
this.currentStep = parseInt(this.currentStep) - 1
if (this.guideStep[this.currentStep]) {
this.guideStep[this.currentStep].show = true
localStorage.setItem('guideStep', JSON.stringify(this.guideStep))
localStorage.setItem('currentStep', this.currentStep)
} else {
this.exitGuide()
}
},
nextStep() {
this.guideStep[this.currentStep].show = false
this.currentStep = parseInt(this.currentStep) + 1
if (this.guideStep[this.currentStep]) {
this.guideStep[this.currentStep].show = true
localStorage.setItem('guideStep', JSON.stringify(this.guideStep))
localStorage.setItem('currentStep', this.currentStep)
} else {
this.exitGuide()
}
},
help() {
ipcRenderer.send('open-help-file')
},
// --- 工具方法 ---
toChar(n) {
return String.fromCharCode(65 + parseInt(n))
},
getPrintName(id) {
return this.$t('index.wordSpace') + id.substr(-5)
},
getPrintName1(id) {
for (let i = 0; i < this.printerList.length; i++) {
if (this.printerList[i].PrinterID == id) {
return this.$t('index.wordSpace') + this.toChar(i)
}
}
},
// --- 网络认证增强 ---
getHostFromPath(p) {
if (!p || typeof p !== 'string') return ''
if (p.indexOf('\\\\') === 0) {
const parts = p.slice(2).split('\\')
return parts[0] || ''
}
if (p.indexOf('//') === 0) {
const parts = p.slice(2).split('/')
return parts[0] || ''
}
const m = p.match(/^([^\\\\/: ]+)/)
return (m && m[1]) ? m[1] : ''
},
checkNetworkPaths() {
if (!(this.$refs.files && this.$refs.files.hasNetworkPaths())) {
return false
}
const networkPaths = this.$refs.files.getNetworkPaths() || []
if (networkPaths.length === 0) return false
let stored = {}
try {
stored = JSON.parse(localStorage.getItem('networkCredentials') || '{}')
} catch (e) {
stored = {}
}
const missing = []
const prepared = []
for (const item of networkPaths) {
const host = item.hostName || this.getHostFromPath(item.path) || ''
if (host && stored[host] && stored[host].userName && stored[host].password) {
prepared.push({
host_name: host,
user_name: stored[host].userName,
password: stored[host].password,
})
} else {
missing.push({ ...item, hostName: host })
}
}
if (missing.length > 0) {
this.networkAuthPaths = missing.map(m => ({
path: m.path,
hostName: m.hostName,
userName: '',
password: ''
}))
this.networkAuthVisible = true
this.networkCredentials = prepared
return true
}
this.networkCredentials = prepared
return false
},
// --- 文件管理方法 ---
handleContentCommand(command) {
if (command === 'folder') {
this.addFolder()
} else {
this.addFile()
}
},
addFolder() {
if (this.$refs.files) {
this.$refs.files.addFolder()
}
},
addFile() {
if (this.$refs.files) {
this.$refs.files.addFile()
}
},
fileLoad3() {
if (this.$refs.refFile3 && this.$refs.refFile3.files[0]) {
this.file_name3 = this.$refs.refFile3.files[0].name
}
},
openFile3() {
if (this.$refs.refFile3) {
this.$refs.refFile3.click()
}
},
sizeChange(size) {
this.size = size
}
}
}
@@ -95,15 +95,15 @@
</div>
<div class="g-switch-item">
<span class="g-label">{{ $t('work.installDongle') }}</span>
<el-switch v-model="form.has_counter"></el-switch>
<el-switch v-model="form.is_dongle_count"></el-switch>
</div>
</div>
<!-- 计数器详细 -->
<div v-if="form.has_counter" class="mt-10 p-10"
<div v-if="form.is_dongle_count" class="mt-10 p-10"
style="background: #fdf6ec; border-radius: 6px; border: 1px solid #faecd8;">
<el-form-item :label="$t('work.installCount')" label-width="140px" class="mb-0">
<el-input-number v-model="form.install_count" :min="1" size="mini" />
<el-input-number v-model="form.dongle_count" :min="1" :step="1" :precision="0" size="mini" />
</el-form-item>
</div>
</div>
@@ -21,12 +21,6 @@
</transition>
</div>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('work.setAuthCode') || '授权码'" label-width="80px">
<el-input size="small" v-model="form.auth_code"
:placeholder="$t('work.inputAuthCode') || '输入授权码'" />
</el-form-item>
</el-col>
</el-row>
</div>
</template>
+2
View File
@@ -117,6 +117,8 @@ export default {
successReserve: "保存成功!",
errorRead: "读取配置文件失败!",
configTitle: "系统配置",
authCodePlaceholder: "请输入授权码",
authCodeTips: "系统授权码,用于激活高级功能和许可验证"
},
dialog: {
closeTips: "0.5秒后将自动关闭......",
+2
View File
@@ -151,6 +151,8 @@ export default {
successReserve: "Save success",
errorRead: "Reading configuration file fail",
configTitle: "CardSoon Production Service Configuration File",
authCodePlaceholder: "Enter authorization code",
authCodeTips: "System authorization code for activating advanced features and license validation"
},
dialog: {
closeTips: "The window will close in 0.5 seconds...",
+2
View File
@@ -93,6 +93,8 @@ export default {
successReserve: "保存成功! ",
errorRead: "讀取設定檔失敗! ",
configTitle: "系統配寘",
authCodePlaceholder: "請輸入授權碼",
authCodeTips: "系統授權碼,用於啟動進階功能和許可驗證"
},
dialog: {
closeTips: "0.5秒後將自動關閉…… ",