优化与对接接口

This commit is contained in:
24kycj
2024-12-05 15:25:51 +08:00
parent d8f155e940
commit e19de21de5
7 changed files with 590 additions and 185 deletions
+5 -5
View File
@@ -39,11 +39,11 @@
name: '系统管理',
path: '/manage'
},
{
id: 2,
name: '用户管理',
path: '/user'
},
// {
// id: 2,
// name: '用户管理',
// path: '/user'
// },
{
id: 3,
name: '系统配置',
+35 -19
View File
@@ -34,7 +34,7 @@
<el-popover v-model="setShow" placement="bottom-end" trigger="click">
<div class="set_box">
<div class="set_list">
<div class="flex_box set_item">
<!-- <div class="flex_box set_item">
<div class="set_label">优先级</div>
<div class="set_val">
<el-select v-model="setForm.priority" placeholder="请选择">
@@ -49,7 +49,7 @@
<el-option v-for="item in stageList" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</div>
</div>
</div> -->
<div class="flex_box set_item">
<div class="set_label">刻录速率</div>
<div class="set_val">
@@ -291,18 +291,18 @@ export default {
value: 2,
label: 'ISO文件刻录'
},
{
value: 3,
label: '复制光盘'
},
{
value: 4,
label: '自动批量读取光盘'
},
{
value: 5,
label: '自动归档任务'
},
// {
// value: 3,
// label: '复制光盘'
// },
// {
// value: 4,
// label: '自动批量读取光盘'
// },
// {
// value: 5,
// label: '自动归档任务'
// },
],
fileProgess: 30,
// 模板列表
@@ -361,10 +361,10 @@ export default {
}
],
speedList: [
{
value: 0,
label: 'Auto'
},
// {
// value: 0,
// label: 'Auto'
// },
{
value: 1,
label: '低'
@@ -543,9 +543,13 @@ export default {
filters: [{ name: 'Soon Work', extensions: ['dwk'] }]
})
.then((result) => {
if (result.filePath == "") { return; }
if (result.filePath.substring(result.filePath.length - 5).indexOf('.') == -1) {
result.filePath += '.dwk';
}
fs.writeFileSync(result.filePath, v)
that.$message({
message: '保存成功',
message: '保存成功'+result.filePath,
type: 'success'
})
})
@@ -657,8 +661,20 @@ export default {
task.path_file.push(fileList[i].path)
task.task_size += fileList[i].size
}
if (task.task_size > diskSize) {
this.$notify({
message: `文件大小超过设备容量!`,
type: 'warning'
})
return
}
that.form.ass_task.push(task)
}
that.form.burn_speed = that.setForm.speed
that.form.is_finished_check = that.setForm.isCheck
that.form.is_finished_close = that.setForm.isClose
that.form.is_finished_delete = that.setForm.isDel
that.form.is_printer_labal_failed = that.setForm.isPrint
// csv文件处理
if (!that.form.udf_file && that.soonList.length > 0) {
that.soonList.forEach((item) => {
+60 -31
View File
@@ -3,14 +3,14 @@ let timeouter = null
let websock = null
// 状态JSON
// 打印机状态
// 设备状态
const PrinterStatus = {
I: '空闲',
B: '忙碌',
P: '正在打印'
}
// 打印机报错
// 设备报错
const printer_errors = {
'0x11': '从盘仓到光驱时,光盘仓为空',
'0x12': '从盘仓到光驱时,抓取光盘错误',
@@ -27,6 +27,8 @@ const printer_errors = {
'0x1d': '从光驱到弃置位时,光盘仓为空',
'0x1e': '从光驱到弃置位时,抓取光盘错误',
'0x1f': '从光驱到弃置位时,其他错误',
'0x21': '作业开始时设备错误,请清除故障后点击重试',
'0x10001': '通讯失败,请检查设备'
}
// 提交任务报错
@@ -41,12 +43,11 @@ const submitErros = {
'0x9': '模板文件解析失败',
'0xa': '打印类型错误',
'0xb': 'csv文件读取失败',
'0xc': '拷贝路径错误',
'0xc': '刻录路径错误',
'0xd': '新建ISO文件失败',
'0xe': '更新任务数据失败',
'0xe': '更新任务数据失败'
}
// 错误状态
const Error1 = {
0: '托盘移动错误',
@@ -149,21 +150,21 @@ const defaultData = {
// task_name: '复制任务',
// finish_freq: 2,
// total_freq: 10,
// task_status: 2,
// task_status: 5,
// ass_task: [
// {
// task_size: 100000,
// cd_type: 2,
// start_time: '2024-04-01 12:00:00',
// finish_time: '2024-04-01 12:00:00',
// task_status: 2
// task_status: 5
// },
// {
// task_size: 100000,
// cd_type: 2,
// start_time: '2024-04-01 12:00:00',
// finish_time: '2024-04-01 12:00:00',
// task_status: 2
// task_status: 5
// }
// ]
// },
@@ -191,14 +192,15 @@ const defaultData = {
// ]
// }
],
// 打印机信息
// 设备信息
printer_info: {
blue_last: 0, //蓝色墨盒遗留
calibration_flag: 0, // 是否校验打印机
calibration_flag: 0, // 是否校验设备
lack_ink: 0, // 缺墨警告
cover_flag: false, //是否盖盖
printer_name: '', //打印机名称
printer_status: 'I', //打印机状态 数字转成字符为I
printer_tray: 'I', //打印机托盘状态 数字转成字符为I
printer_name: '', //设备名称
printer_status: 'I', //设备状态 数字转成字符为I
printer_tray: 'I', //设备托盘状态 数字转成字符为I
red_last: 0, //红色墨盒遗留
yellow_last: 0, //黄色墨盒遗留
system_ip: '', //主机IP
@@ -258,7 +260,28 @@ const defaultData = {
// status: 'INFO'
// }
],
allLogList: []
allLogList: [],
// 手动设置光驱
cdList: [
// {
// "dev_path":"/dev/sre",
// "dev_name":"Finger Module 0110"
// },
// {
// "dev_path":"/dev/sre",
// "dev_name":"PIONEER BD-RW BDR-289M 1.54"
// },
// {
// "dev_path":"/dev/sre",
// "dev_name":"PIONEER BD-RW BDR-1313M 3.54"
// }
],
// 系统配置
settings: {
log_level: 1,
retry_freq: 2,
cache_path: '/home/test/CDFile'
}
}
const getDefaultState = () => {
@@ -318,7 +341,7 @@ const actions = {
// 作业列表
if (data.resp_name === 'task_list') {
commit('setData', { name: 'task_list', data: data.resp_info.task_list })
// 打印机信息
// 设备信息
} else if (data.resp_name === 'printer_info') {
let info = data.resp_info
info.printer_status = String.fromCharCode(info.printer_status)
@@ -351,6 +374,12 @@ const actions = {
commit('setData', { name: 'CDTypes', data: types })
commit('setData', { name: 'cd_types', data: typeLists })
commit('setData', { name: 'cd_list', data: cds })
// 手动设置驱动
} else if (data.resp_name === 'get_all_cdlist') {
commit('setData', { name: 'cdList', data: data.resp_info.cd_list })
// 系统配置
} else if (data.resp_name === 'get_system_config') {
commit('setData', { name: 'settings', data: data.resp_info })
// 新增日志
} else if (data.resp_name === 'add_log') {
let logs = data.resp_info.add_log
@@ -360,7 +389,7 @@ const actions = {
let texts = logs[i].split('|')
if (logLists.length > 20) logLists.splice(logLists.length - 1, 1)
loglist.unshift({
time: texts[0].replace(/\//g, "-").replace(/时/g, ':').replace(/分/g, ':').replace(/秒/g, ''),
time: texts[0].replace(/\//g, '-').replace(/时/g, ':').replace(/分/g, ':').replace(/秒/g, ''),
text: texts[2],
status: texts[1]
})
@@ -374,7 +403,7 @@ const actions = {
for (let i = 0; i < logs.length; i++) {
let texts = logs[i].split('|')
loglist.unshift({
time: texts[0].replace(/\//g, "-").replace(/时/g, ':').replace(/分/g, ':').replace(/秒/g, ''),
time: texts[0].replace(/\//g, '-').replace(/时/g, ':').replace(/分/g, ':').replace(/秒/g, ''),
text: texts[2],
status: texts[1]
})
@@ -383,8 +412,8 @@ const actions = {
// 提交任务报错处理
} else if (data.resp_name === 'submit_task_res') {
let error = data.resp_info
let task_res = "0x" + error.task_res.toString(16)
commit('setData', { name: 'printer_error', data: {type: 'error', notify: '任务' + error.task_uuid + '提交失败:' + submitErros[task_res], } })
let task_res = '0x' + error.task_res.toString(16)
commit('setData', { name: 'printer_error', data: { type: 'error', notify: '任务' + error.task_uuid + '提交失败:' + submitErros[task_res] } })
// 打印报错处理
} else if (data.resp_name === 'printer_error') {
let error = data.resp_info
@@ -394,8 +423,8 @@ const actions = {
for (let i = 0; i < errors.length; i++) {
if (errors[i] == 1) {
setTimeout(() => {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: Error1[i] } })
}, 500);
commit('setData', { name: 'printer_error', data: { type: 'error', notify: Error1[i] } })
}, 500)
}
}
}
@@ -404,8 +433,8 @@ const actions = {
for (let i = 0; i < errors.length; i++) {
if (errors[i] == 1) {
setTimeout(() => {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: Error2[i] } })
}, 500);
commit('setData', { name: 'printer_error', data: { type: 'error', notify: Error2[i] } })
}, 500)
}
}
}
@@ -414,14 +443,14 @@ const actions = {
for (let i = 0; i < errors.length; i++) {
if (errors[i] == 1) {
setTimeout(() => {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: Error3[i] } })
}, 500);
commit('setData', { name: 'printer_error', data: { type: 'error', notify: Error3[i] } })
}, 500)
}
}
}
if (error.printer_error) {
error.printer_error = "0x" + error.printer_error.toString(16)
commit('setData', { name: 'printer_error', data: {type: 'error', confirm: printer_errors[error.printer_error], req: 'continue_task' } })
error.printer_error = '0x' + error.printer_error.toString(16)
commit('setData', { name: 'printer_error', data: { type: 'error', confirm: printer_errors[error.printer_error], req: 'continue_task' } })
}
}
} else {
@@ -444,12 +473,12 @@ const actions = {
websocketsend({ commit, dispatch }, res) {
return new Promise((resolve, reject) => {
if (!state.serviceStatus) {
commit('setData', { name: 'printer_error', data: {type: 'warning', message: '服务连接中,请耐心等待' } })
commit('setData', { name: 'printer_error', data: { type: 'warning', message: '服务连接中,请耐心等待' } })
reject()
return
}
if (!state.isConnect) {
commit('setData', { name: 'printer_error', data: {type: 'warning', message: '请先打开服务' } })
commit('setData', { name: 'printer_error', data: { type: 'warning', message: '请先打开服务' } })
reject()
return
}
@@ -474,7 +503,7 @@ const actions = {
commit('setData', { name: key, data: defaultData[key] })
}
if (state.workStatus) {
const refreshTime = parseInt(state.refreshTime)*1000
const refreshTime = parseInt(state.refreshTime) * 1000
setTimeout(() => {
dispatch('initWebSocket')
}, refreshTime)
@@ -486,7 +515,7 @@ const actions = {
commit('setData', { name: 'isConnect', data: false })
commit('setData', { name: 'serviceStatus', data: false })
state.reconnections += 1
const refreshTime = parseInt(state.refreshTime)*1000
const refreshTime = parseInt(state.refreshTime) * 1000
setTimeout(() => {
dispatch('initWebSocket')
}, refreshTime)
+105 -61
View File
@@ -22,16 +22,16 @@
</div>
</el-tooltip>
<div class="flex_box top_left_option">
<div class="top_left_text">完成拷贝:</div>
<div class="top_left_num">{{ task_list.length }}</div>
<div class="top_left_text">完成刻录:</div>
<div class="top_left_num">{{ taskNum[0] }}</div>
</div>
<div class="flex_box top_left_option">
<div class="top_left_text">废弃拷贝:</div>
<div class="top_left_num top_left_num1">0</div>
<div class="top_left_text">废弃刻录:</div>
<div class="top_left_num top_left_num1">{{taskNum[1]}}</div>
</div>
<div class="flex_box top_left_option">
<div class="top_left_text">错误:</div>
<div class="top_left_num">0</div>
<div class="top_left_num">{{taskNum[2]}}</div>
</div>
<div class="top_left_line"></div>
</div>
@@ -49,7 +49,7 @@
<div class="device_info_box">
<div class="device_info_main" :class="{ device_info_main1: infoStatus === 1 }">
<div class="device_info_item">
<div class="device_info_title">卡树光盘刻录一体机{{ printer_info.printer_name }}</div>
<div class="device_info_title">光盘刻录一体机{{ printer_info.printer_name }}</div>
<div class="device_info_sure">
<div v-if="currentRunVal === 6" class="flex_box flex_row_between device_info_sure_box">
<div class="device_info_sure_text">{{ sureText }}</div>
@@ -145,7 +145,7 @@
</div>
</div>
<!-- <div class="flex_box device_status" :class="`flex_box device_status device_status${printer_info.printer_status} device_status${printer_info.cover_flag}`"> -->
<div class="flex_box device_status" :class="{ 'device_status1': printer_info.printer_status === 'I', 'device_status2': printer_info.printer_status === 'B' || printer_info.printer_status === 'P', 'device_status3': printer_info.cover_flag || printer_info.calibration_flag || !isConnect || !serviceStatus }">
<div class="flex_box device_status" :class="{ 'device_status1': printer_info.printer_status === 'I', 'device_status2': printer_info.printer_status === 'B' || printer_info.printer_status === 'P', 'device_status3': printer_info.cover_flag || printer_info.calibration_flag || printer_info.lack_ink || !isConnect || !serviceStatus }">
<div class="device_status_dot"></div>
<div class="device_status_text">{{ runText }}</div>
</div>
@@ -261,10 +261,20 @@
</el-table-column>
<el-table-column prop="task_status" label="状态">
<template slot-scope="scope">
<div class="flex_box work_status_box">
<div v-if="scope.row.task_status == 5&&scope.row.task_uuid">
<el-dropdown trigger="click" @command="(e) => workCommand(scope.$index, e)">
<div class="el-dropdown-link flex_box work_status_box">
<div>{{ statusList[scope.row.task_status] }}</div>
<i class="el-icon-caret-bottom"></i>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item icon="el-icon-refresh-right" command="retry">重试</el-dropdown-item>
<el-dropdown-item icon="el-icon-circle-close" command="cancel">取消</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div v-else class="flex_box work_status_box">
<div>{{ statusList[scope.row.task_status] }}</div>
<el-button v-if="scope.row.task_status == 5&&scope.row.task_uuid" @click="workRetry(scope.$index)" size="mini" type="primary" class="work_status_retry">重试</el-button>
<!-- <i class="el-icon-caret-bottom"></i> -->
</div>
</template>
</el-table-column>
@@ -312,7 +322,7 @@ export default {
runList: [
{
value: 1,
label: '重启打印机'
label: '重启设备'
},
{
value: 2,
@@ -322,10 +332,6 @@ export default {
value: 3,
label: '校准盘仓'
},
{
value: 4,
label: '校准打印机'
},
{
value: 5,
label: '自动匹配光驱'
@@ -342,15 +348,17 @@ export default {
// 剩余容量
progressW: 75,
// 作业列表
taskNum: [0,0,0],
task_list: [],
statusList: {
0: '新建中',
1: '准备中',
2: '等待中',
3: '正在拷贝',
3: '正在刻录',
4: '正在打印',
5: '已失败',
6: '运行中',
7: '已取消',
100: '已完成'
},
// 设备信息
@@ -393,7 +401,15 @@ export default {
if (val && val.length) {
let tasks = [...val]
let list = []
let nums = [0,0,0]
tasks.forEach((item, index) => {
if (item.task_status == 100) {
nums[0]++
} else if (item.task_status == 7) {
nums[1]++
} else if (item.task_status == 5) {
nums[2]++
}
if (item.ass_task&&item.ass_task.length) {
let task_size = 0
item.cdType = this.$store.state.chat.CDTypes[item.ass_task[0].cd_type]
@@ -407,6 +423,7 @@ export default {
}
list.push(item)
})
this.taskNum = nums
this.task_list = list
}
},
@@ -479,9 +496,12 @@ export default {
text = '设备门盖被打开,请关闭门盖。'
}
if (this.printer_info.calibration_flag) {
text = '请先校准打印机'
text = '请先校准设备'
this.runVal = 4
}
if (this.printer_info.lack_ink) {
text = '缺墨警告'
}
if (!this.isConnect) {
text = '服务已关闭'
}
@@ -538,93 +558,68 @@ export default {
clearTimeout(outTimer)
switch (that.runVal) {
case 1:
// 重启打印机
// 重启设备
that.$store.dispatch('chat/websocketsend', {
req_name: 'resetPrinter',
req_type: 1,
req_type: 2,
req_info: {}
}).then(() => {
that.$message({
message: '重启设备执行成功',
message: '执行成功',
type: 'success'
})
}).catch(() => {
that.$message({
message: '重启设备执行失败,请重新尝试',
type: 'error'
})
})
break;
case 2:
// 清除错误
that.$store.dispatch('chat/websocketsend', {
req_name: 'cleanError',
req_type: 1,
req_type: 2,
req_info: {}
}).then(() => {
that.$message({
message: '清除错误执行成功',
message: '执行成功',
type: 'success'
})
}).catch(() => {
that.$message({
message: '清除错误执行失败,请重新尝试',
type: 'error'
})
})
break;
case 3:
// 校准盘仓
that.$store.dispatch('chat/websocketsend', {
req_name: 'CaliCDStone',
req_type: 1,
req_type: 2,
req_info: {}
}).then(() => {
that.$message({
message: '校准盘仓执行成功',
message: '执行成功',
type: 'success'
})
}).catch(() => {
that.$message({
message: '校准盘仓执行失败,请重新尝试',
type: 'error'
})
})
break;
case 4:
// 校准打印机
// 校准设备
that.$store.dispatch('chat/websocketsend', {
req_name: 'CaliPrinter',
req_type: 1,
req_info: {}
}).then(() => {
that.$message({
message: '校准打印机执行成功',
message: '执行成功',
type: 'success'
})
}).catch(() => {
that.$message({
message: '校准打印机执行失败,请重新尝试',
type: 'error'
})
})
break;
case 5:
// 自动匹配光驱
that.$store.dispatch('chat/websocketsend', {
req_name: 'autoSetCDDev',
req_type: 1,
req_type: 2,
req_info: {}
}).then(() => {
that.$message({
message: '自动匹配光驱执行成功',
message: '执行成功',
type: 'success'
})
}).catch(() => {
that.$message({
message: '自动匹配光驱执行失败,请重新尝试',
type: 'error'
})
})
break;
case 6:
@@ -633,6 +628,24 @@ export default {
that.printer_info.strongList = that.default_cd
}, 120000);
break;
case 7:
that.$confirm('请确保已经取掉左右光盘仓托架,再点击确定', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.$store.dispatch('chat/websocketsend', {
req_name: 'TransportMode',
req_type: 2,
req_info: {}
}).then(() => {
that.$message({
message: '执行成功',
type: 'success'
})
})
})
break;
}
that.currentRunVal = that.runVal
},
@@ -704,10 +717,19 @@ export default {
}
that.showAll = !that.showAll
},
// 下拉操作
workCommand(index, e) {
if (e === 'retry') {
that.workRetry(index)
}
if (e === 'cancel') {
that.workCancel(index)
}
},
// 作业重试
workRetry(e) {
that.$store.dispatch('chat/websocketsend', {
req_name: 'retry task',
req_name: 'retry_task',
req_type: 1,
req_info: {
task_uuid: that.task_list[e].task_uuid
@@ -725,6 +747,27 @@ export default {
}
})
},
// 作业取消
workCancel(e) {
that.$store.dispatch('chat/websocketsend', {
req_name: 'cancle_task',
req_type: 1,
req_info: {
task_uuid: that.task_list[e].task_uuid
}
}).then(() => {
that.$message({
message: '取消成功',
type: 'success'
})
that.task_list[e].task_status = 7
if (that.task_list[e].ass_task&&that.task_list[e].ass_task.length > 0) {
that.task_list[e].ass_task.forEach(item => {
item.task_status = 7
})
}
})
},
// 跳转设置
goSet(e) {
that.$router.push({ path: e })
@@ -1107,7 +1150,7 @@ $red: #ff0000;
.device_right {
width: 50%;
.device_right_top {
height: 200px;
height: 190px;
background: #ffffff;
border-radius: 4px;
margin-bottom: 18px;
@@ -1182,7 +1225,7 @@ $red: #ff0000;
background: #ffffff;
border-radius: 6px;
.notice_top {
height: 75px;
height: 50px;
padding: 0 30px;
border-bottom: 2px solid #e1f5e5;
.notice_title {
@@ -1274,13 +1317,13 @@ $red: #ff0000;
}
}
.work_box {
height: calc(100vh - 640px);
height: calc(100vh - 605px);
::-webkit-scrollbar {
width: 0; /* 设置滚动条的宽度 */
height: 0;
}
.el-table.work_table {
height: calc(100vh - 720px) !important;
height: calc(100vh - 665px) !important;
::v-deep .el-table__body-wrapper {
height: calc(100% - 48px) !important;
overflow: scroll!important;
@@ -1288,15 +1331,15 @@ $red: #ff0000;
}
.work_top {
background-color: #fff;
height: 72px;
height: 50px;
.work_top_text {
width: 132px;
height: 72px;
height: 50px;
background: linear-gradient(180deg, #c1ffcd 0%, #ffffff 100%);
font-weight: bold;
font-size: 19px;
color: #00c325;
line-height: 72px;
line-height: 50px;
text-align: center;
}
}
@@ -1344,6 +1387,7 @@ $red: #ff0000;
font-size: 14px;
color: #000000;
height: 30px;
cursor: pointer;
.work_status_retry {
width: 40px;
height: 22px;
+321 -33
View File
@@ -13,21 +13,21 @@
</div>
<div class="form_content">
<div class="flex_box form_option">
<div class="form_label">移动卡片到</div>
<div class="form_label">校准设备</div>
<div class="form_val">
<div class="flex_box flex_wrap form_tabs">
<div v-for="(item, index) in moveList" :key="index" class="form_tab">{{ item.name }}</div>
<div @click="handleMove(item)" v-for="(item, index) in moveList" :key="index" class="form_tab">{{ item.name }}</div>
</div>
</div>
</div>
<div class="flex_box form_option">
<!-- <div class="flex_box form_option">
<div class="form_label">维护工作站</div>
<div class="form_val">
<div class="flex_box flex_wrap form_tabs">
<div v-for="(item, index) in actionList" :key="index" class="form_tab">{{ item.name }}</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
<div class="form_item">
@@ -66,7 +66,7 @@
</div>
</div>
</div>
<div class="form_item">
<!-- <div class="form_item">
<div class="flex_box form_title">
<div class="flex_box flex_col">
<div class="form_title_text">语言</div>
@@ -90,14 +90,38 @@
</div>
</div>
</div>
</div> -->
</div>
<!-- 手动校准驱动 -->
<el-dialog center title="手动校准驱动" :visible.sync="cdShow" width="1000px">
<div class="cd_box" v-loading="cdList.length === 0">
<div class="cd_title">请通过点击按钮弹出光驱托盘判断并设置光驱</div>
<div class="cd_desc">需对光驱进行手动设置</div>
<div class="cd_desc">使用下拉方框来指定设备中的哪个光驱是上光驱哪个是下光驱</div>
<div class="cd_list">
<div class="flex_box flex_row_between cd_item" v-for="(item, index) in cdList" :key="index">
<div class="cd_name">{{ item.dev_name }}</div>
<div class="flex_box cd_r">
<el-select v-model="item.cdType" @change="cdChange(index, item.cdType)">
<el-option v-for="type in cdOptions" :key="type.value" :label="type.label" :value="type.value"> </el-option>
</el-select>
<el-button @click="cdOpen(index)" type="success">打开</el-button>
<el-button @click="cdClose(index)" type="danger">关闭</el-button>
</div>
</div>
</div>
<div class="flex_box flex_row_center cd_footer">
<el-button @click="cdCancel" class="cd_footer_btn1">取消</el-button>
<el-button @click="cdSubmit" class="cd_footer_btn2" type="primary">确定</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import TabBar from '@/components/tabBar/tabBar.vue';
import TabBar from '@/components/tabBar/tabBar.vue'
export default {
name: 'manage',
@@ -107,27 +131,19 @@ export default {
moveList: [
{
id: 1,
name: '读卡器'
name: '校准设备'
},
{
id: 2,
name: '废卡盒'
name: '校准上光驱'
},
{
id: 3,
name: '出卡口'
name: '校准下光驱'
},
{
id: 4,
name: '等待'
},
{
id: 5,
name: '待取口'
},
{
id: 6,
name: '后出卡口'
name: '手动校准驱动'
}
],
actionList: [
@@ -169,6 +185,22 @@ export default {
label: '繁体中文',
value: 'zhYW'
}
],
cdList: [],
cdShow: false,
cdOptions: [
{
value: 1,
label: '不在设备中'
},
{
value: 2,
label: '上光驱'
},
{
value: 3,
label: '下光驱'
}
]
}
},
@@ -177,14 +209,189 @@ export default {
},
watch: {
'$store.state.chat.refreshTime': {
handler (val) {
handler(val) {
this.refreshTime = val
},
immediate: true,
deep: true
},
'$store.state.chat.cdList': {
handler(val) {
this.cdList = val.map((item) => {
item.cdType = 1
return item
})
},
deep: true,
immediate: true
}
},
methods: {
// 校准设备
handleMove(e) {
switch (e.id) {
case 1:
// 校准设备
that.$store
.dispatch('chat/websocketsend', {
req_name: 'CaliPrinter',
req_type: 2,
req_info: {
cali_num: '02'
}
})
.then(() => {
that.$message({
message: '执行成功',
type: 'success'
})
})
break
case 2:
// 校准上光驱
that.$store
.dispatch('chat/websocketsend', {
req_name: 'CaliPrinter',
req_type: 2,
req_info: {
cali_num: '00'
}
})
.then(() => {
that.$message({
message: '执行成功',
type: 'success'
})
})
break
case 3:
// 校准下光驱
that.$store
.dispatch('chat/websocketsend', {
req_name: 'CaliPrinter',
req_type: 2,
req_info: {
cali_num: '01'
}
})
.then(() => {
that.$message({
message: '执行成功',
type: 'success'
})
})
break
case 4:
this.$store
.dispatch('chat/websocketsend', {
req_name: 'get_all_cd',
req_type: 2,
req_info: {}
})
.then(() => {
this.cdShow = true
})
break
}
},
cdChange(index, e) {
let item = this.cdList[index]
item.cdType = e
this.$set(this.cdList, index, { ...item })
},
cdOpen(e) {
let item = this.cdList[e]
this.$store
.dispatch('chat/websocketsend', {
req_name: 'openCDDevByPath',
req_type: 2,
req_info: {
dev_path: item.dev_path
}
})
.then(() => {
that.$message({
message: '执行成功',
type: 'success'
})
})
},
cdClose(e) {
let item = this.cdList[e]
this.$store
.dispatch('chat/websocketsend', {
req_name: 'closeCDDevByPath',
req_type: 2,
req_info: {
dev_path: item.dev_path
}
})
.then(() => {
that.$message({
message: '执行成功',
type: 'success'
})
})
},
cdCancel() {
this.cdShow = false
},
cdSubmit() {
let top = this.cdList.filter((item) => item.cdType === 2)
let bottom = this.cdList.filter((item) => item.cdType === 3)
if (!top || top.length === 0) {
this.$message({
message: '请设置上光驱',
type: 'error'
})
return
}
if (!bottom || bottom.length === 0) {
this.$message({
message: '请设置下光驱',
type: 'error'
})
return
}
if (top.length > 1) {
this.$message({
message: '上光驱只能设置一个',
type: 'error'
})
return
}
if (bottom.length > 1) {
this.$message({
message: '下光驱只能设置一个',
type: 'error'
})
return
}
this.$store
.dispatch('chat/websocketsend', {
req_name: 'setCDDevice',
req_type: 2,
req_info: {
device_list: [
{
device_path: top[0].dev_path,
device_pos: 2
},
{
device_path: bottom[0].dev_path,
device_pos: 1
}
]
}
})
.then(() => {
this.$message({
message: '提交成功',
type: 'success'
})
this.cdShow = false
})
},
// 刷新时间
handleRefresh() {
this.$store.commit('chat/setData', {
@@ -207,7 +414,7 @@ export default {
.form_item {
padding: 10px 0;
.form_title {
border-bottom: 2px solid #E1F5E5;
border-bottom: 2px solid #e1f5e5;
.form_title_text {
font-weight: 500;
font-size: 25px;
@@ -217,7 +424,7 @@ export default {
.form_title_line {
width: 100%;
height: 6px;
background: #98E8A6;
background: #98e8a6;
border-radius: 4px;
}
}
@@ -239,23 +446,23 @@ export default {
width: 250px;
height: 42px;
cursor: pointer;
background: rgba(0,195,37,0.12);
background: rgba(0, 195, 37, 0.12);
border-radius: 4px;
border: 1px solid rgba(0,195,37,0.32);
border: 1px solid rgba(0, 195, 37, 0.32);
line-height: 40px;
text-align: center;
font-weight: 500;
font-size: 19px;
color: #00C325;
color: #00c325;
margin: 6px;
}
}
.form_input {
width: 500px;
height: 42px;
background: #FFFFFF;
background: #ffffff;
border-radius: 4px;
border: 1px solid #98E8A6;
border: 1px solid #98e8a6;
overflow: hidden;
::v-deep {
.el-input-group__append {
@@ -284,7 +491,7 @@ export default {
height: 40px;
border: none;
padding: 0;
background: #00C325;
background: #00c325;
border-radius: 0px 4px 4px 0px;
}
}
@@ -300,8 +507,8 @@ export default {
height: 24px;
}
.el-checkbox__input.is-checked .el-checkbox__inner {
background-color: #00C325;
border-color: #00C325;
background-color: #00c325;
border-color: #00c325;
}
.el-checkbox__inner::after {
width: 6px;
@@ -312,16 +519,16 @@ export default {
font-size: 19px;
line-height: 24px;
}
.el-checkbox__input.is-checked+.el-checkbox__label {
color: #00C325;
.el-checkbox__input.is-checked + .el-checkbox__label {
color: #00c325;
}
}
.form_select {
width: 500px;
height: 42px;
background: #FFFFFF;
background: #ffffff;
border-radius: 4px;
border: 1px solid #98E8A6;
border: 1px solid #98e8a6;
.el-select {
width: 100%;
padding-left: 10px;
@@ -350,4 +557,85 @@ export default {
}
}
}
.cd_box {
.el-input {
height: 40px;
line-height: 40px;
}
::v-deep {
.el-input__inner {
width: 240px;
height: 40px;
line-height: 40px;
font-size: 16px;
color: #000;
font-weight: 500;
}
.el-input__icon {
font-size: 16px;
height: 40px;
line-height: 40px;
font-weight: bold;
color: #000;
}
}
.cd_title {
font-size: 16px;
font-weight: 500;
color: #000;
line-height: 28px;
}
.cd_desc {
font-size: 13px;
font-weight: 500;
color: #666;
line-height: 24px;
}
.cd_list {
padding: 32px 0;
.cd_item {
padding: 12px 0;
}
.el-button {
margin: 0;
padding: 0;
width: 80px;
height: 40px;
font-size: 15px;
}
.cd_name {
font-size: 14px;
color: #000;
line-height: 24px;
}
.cd_r {
gap: 24px;
}
}
.cd_footer {
gap: 24px;
.cd_footer_btn1 {
width: 120px;
height: 40px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #000000;
font-weight: 500;
font-size: 16px;
color: #000000;
padding: 0;
margin: 0 12px;
}
.cd_footer_btn2 {
width: 120px;
height: 40px;
background: #00c325;
border-radius: 4px;
font-weight: 500;
font-size: 16px;
padding: 0;
margin: 0 12px;
}
}
}
</style>
+57 -29
View File
@@ -16,7 +16,7 @@
<div class="form_label">LogLevel</div>
<div class="flex_box form_val">
<div class="form_select">
<el-select v-model="form.LogLevel" placeholder="请选择">
<el-select v-model="form.log_level" placeholder="请选择">
<el-option
v-for="item in levelList"
:key="item.value"
@@ -32,7 +32,7 @@
<div class="form_label">AutoRetryTimes</div>
<div class="flex_box form_val">
<div class="form_select">
<el-select v-model="form.AutoRetryTimes" placeholder="请选择">
<el-select v-model="form.retry_freq" placeholder="请选择">
<el-option
v-for="item in timesList"
:key="item.value"
@@ -44,7 +44,7 @@
<div class="form_text">作业失败后重试次数默认0为不重试</div>
</div>
</div>
<div class="flex_box form_option">
<!-- <div class="flex_box form_option">
<div class="form_label">TaskDir</div>
<div class="flex_box form_val">
<div class="form_input">
@@ -52,17 +52,17 @@
</div>
<div class="form_text">自动作业文件路径</div>
</div>
</div>
</div> -->
<div class="flex_box form_option">
<div class="form_label">SharedDir</div>
<div class="form_label">CacheDir</div>
<div class="flex_box form_val">
<div class="form_input">
<el-input border="none" v-model="form.SharedDir" placeholder="请输入"></el-input>
<el-input border="none" v-model="form.cache_path" placeholder="请输入"></el-input>
</div>
<div class="form_text">作业缓存路径存放作业中临时生成的内容文件标签合并图片字段数据等</div>
</div>
</div>
<div class="flex_box form_option">
<!-- <div class="flex_box form_option">
<div class="form_label">RejectConfig</div>
<div class="flex_box form_val">
<div class="form_switch">
@@ -104,13 +104,13 @@
<div class="form_switch">
<el-switch active-color="#07C160" inactive-color="#aaa" v-model="form.UploadSharedDir"></el-switch>
</div>
<div class="form_text">启用作业缓存路径勾选后作业内容会先拷贝到缓存路径后再拷贝到存储卡</div>
</div>
<div class="form_text">启用作业缓存路径勾选后作业内容会先刻录到缓存路径后再刻录到存储卡</div>
</div>
</div> -->
</div>
</div>
<div class="flex_box flex_row_center footer_btns">
<el-button type="primary" class="footer_submit" @click="workSubmit">提交</el-button>
<el-button type="primary" class="footer_submit" @click="setSubmit">保存</el-button>
</div>
</div>
</div>
@@ -126,63 +126,91 @@ export default {
data() {
return {
form: {
LogLevel: 'INFO',
AutoRetryTimes: '2',
TaskDir: 'D:\PrintTasks',
SharedDir: 'D:\CardSoonRepo',
RejectConfig: true,
StopOnFailure: false,
KeepCombinedImage: true,
CleanTaskFile: false,
UploadSharedDir: false,
log_level: 1,
retry_freq: 2,
cache_path: '/home/test/CDFile',
},
levelList: [
{
label: 'TRACE',
value: 'TRACE'
value: 0
},
{
label: 'DEBUG',
value: 'DEBUG'
value: 1
},
{
label: 'INFO',
value: 'INFO'
value: 2
},
{
label: 'WARNING',
value: 'WARNING'
value: 3
},
{
label: 'ERROR',
value: 'ERROR'
value: 4
},
{
label: 'FATAL',
value: 'FATAL'
value: 5
},
{
label: 'OFF',
value: 6
}
],
timesList: [
{
label: '0',
value: '0'
value: 0
},
{
label: '1',
value: '1'
value: 1
},
{
label: '2',
value: '2'
value: 2
},
]
}
},
watch: {
'$store.state.chat.settings': {
handler(val) {
this.form = {...val}
},
immediate: true,
deep: true
},
},
computed: {
...mapGetters(['name', 'roles'])
},
methods: {
// 提交
setSubmit() {
if (this.form.cache_path === '') {
this.$message({
message: '请输入作业缓存路径',
type: 'warning'
})
return
}
this.$store
.dispatch('chat/websocketsend', {
req_name: 'set_system_config',
req_type: 5,
req_info: this.form
})
.then(() => {
this.$message({
message: '保存成功',
type: 'success'
})
})
}
}
}
</script>
+1 -1
View File
@@ -37,7 +37,7 @@ export default {
},
{
ID: '2',
userName: '卡树测试',
userName: '测试',
role: 'test',
logintime: '2024-10-05 19:06:45',
status: 0