优化bug

This commit is contained in:
24kycj
2024-11-30 17:29:57 +08:00
parent c2dc433d87
commit ba2579642d
5 changed files with 61 additions and 102 deletions
+4 -7
View File
@@ -32,14 +32,15 @@ export default {
} }
if (val.confirm) { if (val.confirm) {
this.$confirm(val.confirm, '温馨提示', { this.$confirm(val.confirm, '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '重试',
closeOnClickModal: false,
closeOnPressEscape: false,
showClose: false, showClose: false,
showCancelButton: false,
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
if (val.req && val.req === 'continue_task') { if (val.req && val.req === 'continue_task') {
// 下一个任务 // 下一个任务
this.$store.dispatch('websocketsend', { this.$store.dispatch('chat/websocketsend', {
req_name: 'continue_task', req_name: 'continue_task',
req_type: 1, req_type: 1,
req_info: {} req_info: {}
@@ -52,10 +53,6 @@ export default {
}).catch(() => { }).catch(() => {
}); });
this.$messageBox({
message: val.messageBox,
type: val.type,
})
} }
}, },
deep: true, deep: true,
@@ -3,11 +3,11 @@
<div class="btn-group" v-show="false"> <div class="btn-group" v-show="false">
<div class="btn" @click="addFolder()" style="color: #67c23a"> <div class="btn" @click="addFolder()" style="color: #67c23a">
<i class="el-icon-folder" /> <i class="el-icon-folder" />
{{ $t("file.addFolder") }} 添加文件夹
</div> </div>
<div class="btn" @click="addFile()" style="color: #67c23a"> <div class="btn" @click="addFile()" style="color: #67c23a">
<i class="el-icon-files" /> <i class="el-icon-files" />
{{ $t("file.addFile") }} 添加文件
</div> </div>
</div> </div>
<fileEmpty v-if="allNumber == 0" /> <fileEmpty v-if="allNumber == 0" />
@@ -142,7 +142,7 @@ export default {
const _this = this; const _this = this;
dialog dialog
.showOpenDialog({ .showOpenDialog({
properties: ["multiSelections"], properties: ["openFile", "multiSelections"],
}) })
.then(async (res) => { .then(async (res) => {
for (const item of res.filePaths) { for (const item of res.filePaths) {
+1 -2
View File
@@ -539,7 +539,6 @@ export default {
task.task_size += fileList[i].size task.task_size += fileList[i].size
if (i === fileList.length - 1) that.form.ass_task.push(task) if (i === fileList.length - 1) that.form.ass_task.push(task)
} }
console.log(that.form.ass_task)
} else { } else {
let task = { let task = {
ass_task_index: 1, ass_task_index: 1,
@@ -559,7 +558,7 @@ export default {
item.val = that.$refs[item.origin_name][0].files[0].path item.val = that.$refs[item.origin_name][0].files[0].path
} }
if (!item.val) { if (!item.val) {
item.val = item.default item.val = item.default || ''
} }
}) })
let csv1 = that.soonList.map(item => item.origin_name).join(',') let csv1 = that.soonList.map(item => item.origin_name).join(',')
+37 -36
View File
@@ -12,38 +12,38 @@ const PrinterStatus = {
// 打印机报错 // 打印机报错
const printer_errors = { const printer_errors = {
'0x00011': '从盘仓到光驱时,光盘仓为空', '0x11': '从盘仓到光驱时,光盘仓为空',
'0x00012': '从盘仓到光驱时,抓取光盘错误', '0x12': '从盘仓到光驱时,抓取光盘错误',
'0x00013': '从盘仓到光驱时,其他错误', '0x13': '从盘仓到光驱时,其他错误',
'0x00014': '从盘仓到打印托盘时,光盘仓为空', '0x14': '从盘仓到打印托盘时,光盘仓为空',
'0x00015': '从盘仓到打印托盘时,抓取光盘错误', '0x15': '从盘仓到打印托盘时,抓取光盘错误',
'0x00016': '从盘仓到打印托盘时,其他错误', '0x16': '从盘仓到打印托盘时,其他错误',
'0x00017': '从光驱到打印托盘时,光盘仓为空', '0x17': '从光驱到打印托盘时,光盘仓为空',
'0x00018': '从光驱到打印托盘时,抓取光盘错误', '0x18': '从光驱到打印托盘时,抓取光盘错误',
'0x00019': '从光驱到打印托盘时,其他错误', '0x19': '从光驱到打印托盘时,其他错误',
'0x0001A': '从打印托盘到弃置位时,光盘仓为空', '0x1a': '从打印托盘到弃置位时,光盘仓为空',
'0x0001B': '从打印托盘到弃置位时,抓取光盘错误', '0x1b': '从打印托盘到弃置位时,抓取光盘错误',
'0x0001C': '从打印托盘到弃置位时,其他错误', '0x1c': '从打印托盘到弃置位时,其他错误',
'0x0001D': '从光驱到弃置位时,光盘仓为空', '0x1d': '从光驱到弃置位时,光盘仓为空',
'0x0001E': '从光驱到弃置位时,抓取光盘错误', '0x1e': '从光驱到弃置位时,抓取光盘错误',
'0x0001F': '从光驱到弃置位时,其他错误', '0x1f': '从光驱到弃置位时,其他错误',
} }
// 提交任务报错 // 提交任务报错
const submitErros = { const submitErros = {
'0x00001': '读取任务JSON失败', '0x1': '读取任务JSON失败',
'0x00003': '新建任务失败', '0x3': '新建任务失败',
'0x00004': '新建任务文件夹失败', '0x4': '新建任务文件夹失败',
'0x00005': '没有任务数量', '0x5': '没有任务数量',
'0x00006': '打印参数错误', '0x6': '打印参数错误',
'0x00007': '刻录参数错误', '0x7': '刻录参数错误',
'0x00008': '没有任务', '0x8': '没有任务',
'0x00009': '模板文件解析失败', '0x9': '模板文件解析失败',
'0x0000A': '打印类型错误', '0xa': '打印类型错误',
'0x0000B': 'csv文件读取失败', '0xb': 'csv文件读取失败',
'0x0000C': '拷贝路径错误', '0xc': '拷贝路径错误',
'0x0000D': '新建ISO文件失败', '0xd': '新建ISO文件失败',
'0x0000E': '更新任务数据失败', '0xe': '更新任务数据失败',
} }
@@ -145,9 +145,8 @@ const defaultData = {
// 任务列表 // 任务列表
task_list: [ task_list: [
// { // {
// task_uuid: '20204215', // task_uuid: '202042152',
// task_name: '复制任务', // task_name: '复制任务',
// task_size: 100000,
// finish_freq: 2, // finish_freq: 2,
// total_freq: 10, // total_freq: 10,
// task_status: 2, // task_status: 2,
@@ -354,7 +353,8 @@ const actions = {
// 提交任务报错处理 // 提交任务报错处理
} else if (data.resp_name === 'submit_task_res') { } else if (data.resp_name === 'submit_task_res') {
let error = data.resp_info let error = data.resp_info
commit('setData', { name: 'printer_error', data: {type: 'error', notify: '任务' + error.task_uuid + '提交失败:' + submitErros[error.task_res], message: '' } }) 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') { } else if (data.resp_name === 'printer_error') {
let error = data.resp_info let error = data.resp_info
@@ -364,7 +364,7 @@ const actions = {
for (let i = 0; i < errors.length; i++) { for (let i = 0; i < errors.length; i++) {
if (errors[i] == 1) { if (errors[i] == 1) {
setTimeout(() => { setTimeout(() => {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: Error1[i] } }) commit('setData', { name: 'printer_error', data: {type: 'error', confirm: Error1[i], req: 'continue_task' } })
}, 500); }, 500);
} }
} }
@@ -374,7 +374,7 @@ const actions = {
for (let i = 0; i < errors.length; i++) { for (let i = 0; i < errors.length; i++) {
if (errors[i] == 1) { if (errors[i] == 1) {
setTimeout(() => { setTimeout(() => {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: Error2[i] } }) commit('setData', { name: 'printer_error', data: {type: 'error', confirm: Error2[i], req: 'continue_task' } })
}, 500); }, 500);
} }
} }
@@ -384,12 +384,13 @@ const actions = {
for (let i = 0; i < errors.length; i++) { for (let i = 0; i < errors.length; i++) {
if (errors[i] == 1) { if (errors[i] == 1) {
setTimeout(() => { setTimeout(() => {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: Error3[i] } }) commit('setData', { name: 'printer_error', data: {type: 'error', confirm: Error3[i], req: 'continue_task' } })
}, 500); }, 500);
} }
} }
} }
if (error.printer_error) { 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' } }) commit('setData', { name: 'printer_error', data: {type: 'error', confirm: printer_errors[error.printer_error], req: 'continue_task' } })
} }
} }
@@ -413,12 +414,12 @@ const actions = {
websocketsend({ commit, dispatch }, res) { websocketsend({ commit, dispatch }, res) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!state.serviceStatus) { if (!state.serviceStatus) {
commit('setData', { name: 'printer_error', data: {type: 'warning', message: '服务连接中,请耐心等待', notify: '' } }) commit('setData', { name: 'printer_error', data: {type: 'warning', message: '服务连接中,请耐心等待' } })
reject() reject()
return return
} }
if (!state.isConnect) { if (!state.isConnect) {
commit('setData', { name: 'printer_error', data: {type: 'warning', message: '请先打开服务', notify: '' } }) commit('setData', { name: 'printer_error', data: {type: 'warning', message: '请先打开服务' } })
reject() reject()
return return
} }
+12 -50
View File
@@ -174,7 +174,7 @@
<div class="flex_box device_right_top_progress"> <div class="flex_box device_right_top_progress">
<div class="device_right_top_progress_box" :style="{ 'width': cd_list[0].copy_scheduler + '%' }"></div> <div class="device_right_top_progress_box" :style="{ 'width': cd_list[0].copy_scheduler + '%' }"></div>
</div> </div>
<div class="device_right_top_text">已刻录{{ $filterSize(cd_list[0].use_size) }}{{ $filterSize(cd_list[0].total_size) }}<span v-if="cd_list[0].burn_speed">速度{{ cd_list[0].burn_speed }}X</span></div> <div class="device_right_top_text">已刻录{{ $filterSize(cd_list[0].use_size) }}{{ $filterSize(cd_list[0].total_size) }}<span v-if="cd_list[0].burn_speed">速度{{ cd_list[0].burn_speed.toFixed(2) }}X</span></div>
</template> </template>
<div class="device_right_top_text">状态{{ $store.state.chat.CDStatus[cd_list[0].cd_status] }}</div> <div class="device_right_top_text">状态{{ $store.state.chat.CDStatus[cd_list[0].cd_status] }}</div>
<div class="device_right_top_text">任务{{ cd_list[0].cd_taskid && cd_list[0].copy_scheduler ? cd_list[0].cd_taskid : '' }}</div> <div class="device_right_top_text">任务{{ cd_list[0].cd_taskid && cd_list[0].copy_scheduler ? cd_list[0].cd_taskid : '' }}</div>
@@ -195,7 +195,7 @@
<div class="flex_box device_right_top_progress"> <div class="flex_box device_right_top_progress">
<div class="device_right_top_progress_box" :style="{ 'width': cd_list[1].copy_scheduler + '%' }"></div> <div class="device_right_top_progress_box" :style="{ 'width': cd_list[1].copy_scheduler + '%' }"></div>
</div> </div>
<div class="device_right_top_text">已刻录{{ $filterSize(cd_list[1].use_size) }}{{ $filterSize(cd_list[1].total_size) }}<span v-if="cd_list[1].burn_speed">速度{{ cd_list[1].burn_speed }}X</span></div> <div class="device_right_top_text">已刻录{{ $filterSize(cd_list[1].use_size) }}{{ $filterSize(cd_list[1].total_size) }}<span v-if="cd_list[1].burn_speed">速度{{ cd_list[1].burn_speed.toFixed(2) }}X</span></div>
</template> </template>
<div class="device_right_top_text">状态{{ $store.state.chat.CDStatus[cd_list[1].cd_status] }}</div> <div class="device_right_top_text">状态{{ $store.state.chat.CDStatus[cd_list[1].cd_status] }}</div>
<div class="device_right_top_text">任务{{ cd_list[1].cd_taskid && cd_list[1].copy_scheduler ? cd_list[1].cd_taskid : '' }}</div> <div class="device_right_top_text">任务{{ cd_list[1].cd_taskid && cd_list[1].copy_scheduler ? cd_list[1].cd_taskid : '' }}</div>
@@ -242,57 +242,14 @@
<div class="flex_box work_top"> <div class="flex_box work_top">
<div class="work_top_text">作业列表</div> <div class="work_top_text">作业列表</div>
</div> </div>
<el-table default-expand-all class="work_table" :data="task_list" empty-text="暂无作业列表"> <el-table row-key="task_uuid" default-expand-all class="work_table" :data="task_list" empty-text="暂无作业列表" :tree-props="{children: 'ass_task', hasChildren: 'hasChildren'}">
<el-table-column type="expand"> <!-- <el-table-column type="index" width="80" label="序号"></el-table-column> -->
<template slot-scope="scope">
<el-table class="child_table" :show-header="false" :data="scope.row.ass_task">
<el-table-column width="48" label=""></el-table-column>
<el-table-column type="index" width="80" label="序号">
<template slot-scope="child">
<div>{{ scope.$index + 1 }}_{{ child.$index + 1 }}</div>
</template>
</el-table-column>
<el-table-column prop="task_uuid" label="作业ID">
<template slot-scope="child">
<div>{{ scope.row.task_uuid }}_{{ child.$index + 1 }}</div>
</template>
</el-table-column>
<el-table-column prop="task_name" label="子任务名称">
<template slot-scope="child">
<div>{{ scope.row.task_name }}_{{ child.$index + 1 }}</div>
</template>
</el-table-column>
<el-table-column label="类型">
<template slot-scope="child">
<div>{{ CDTypes[child.row.cd_type] }}</div>
</template>
</el-table-column>
<el-table-column prop="task_size" label="大小">
<template slot-scope="child">
<div>{{ $filterSize(child.row.task_size) }}</div>
</template>
</el-table-column>
<el-table-column prop="start_time" label="开始时间"></el-table-column>
<el-table-column prop="finish_time" label="结束时间"></el-table-column>
<el-table-column label="完成"></el-table-column>
<el-table-column prop="task_status" label="状态">
<template slot-scope="child">
<div class="flex_box work_status_box">
<div>{{ statusList[child.row.task_status] }}</div>
<!-- <i class="el-icon-caret-bottom"></i> -->
</div>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column type="index" width="80" label="序号"></el-table-column>
<el-table-column prop="task_uuid" label="作业ID"></el-table-column> <el-table-column prop="task_uuid" label="作业ID"></el-table-column>
<el-table-column prop="task_name" label="任务名称"></el-table-column> <el-table-column prop="task_name" label="任务名称"></el-table-column>
<!-- <el-table-column prop="DataSource" label="来源"></el-table-column> --> <!-- <el-table-column prop="DataSource" label="来源"></el-table-column> -->
<el-table-column label="类型"> <el-table-column label="类型">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ CDTypes[scope.row.ass_task[0].cd_type] }}</div> <div>{{ scope.row.ass_task&&scope.row.ass_task[0]&&CDTypes[scope.row.ass_task[0].cd_type] }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="task_size" label="大小"> <el-table-column prop="task_size" label="大小">
@@ -435,13 +392,18 @@ export default {
'$store.state.chat.task_list': { '$store.state.chat.task_list': {
handler(val) { handler(val) {
if (val && val.length) { if (val && val.length) {
let tasks = [...val]
let list = [] let list = []
val.forEach((item) => { tasks.forEach((item, index) => {
if (item.ass_task&&item.ass_task.length) {
let task_size = 0 let task_size = 0
item.ass_task.forEach((item2) => { item.ass_task.forEach((item2, idx) => {
item2.task_uuid = item.task_uuid+'_'+(idx+1)
item2.task_name = item.task_name+'_'+(idx+1)
task_size = this.$accAdd(task_size, item2.task_size) task_size = this.$accAdd(task_size, item2.task_size)
}) })
item.task_size = task_size item.task_size = task_size
}
list.push(item) list.push(item)
}) })
this.task_list = list this.task_list = list