更新优化

This commit is contained in:
24kycj
2024-11-17 21:20:47 +08:00
parent 26e9c0a75b
commit 2ba2e70a2b
5 changed files with 237 additions and 152 deletions
@@ -33,13 +33,13 @@
.top_right {
.top_right_name {
font-weight: 500;
font-size: 15px;
font-size: 18px;
color: #000000;
padding: 0 16px;
}
.top_right_btn {
font-weight: 500;
font-size: 15px;
font-size: 18px;
color: #00C325;
line-height: 50px;
padding-left: 16px;
+70 -58
View File
@@ -180,13 +180,13 @@
<div slot="footer" class="flex_box flex_row_between footer_box">
<div class="flex_box footer_main">
<div class="footer_input">
<el-input placeholder="请输入数量" v-model="form.task_freq">
<el-input placeholder="请输入数量" v-model.number="form.task_freq">
<template slot="prepend">数量</template>
</el-input>
</div>
</div>
<div class="flex_box footer_btns">
<el-button type="primary" class="footer_save" @click="workSave" :loading="saveFlag">保存</el-button>
<!-- <el-button type="primary" class="footer_save" @click="workSave" :loading="saveFlag">保存</el-button> -->
<el-button type="primary" class="footer_submit" @click="workSubmit" :loading="submitFlag">提交</el-button>
</div>
</div>
@@ -292,6 +292,15 @@ export default {
{ color: '#67C23A', percentage: 99 },
{ color: '#F56C6C', percentage: 100 }
],
csvForm: {
req_name: 'upload_file',
req_type: 1,
req_info: {
uuid: '',
file_name: 'templ.csv',
file_text: ''
}
},
// 高级设置
setShow: false,
setForm: {},
@@ -386,11 +395,12 @@ export default {
console.log(diskSize)
let t = diskSize ? this.$accDiv(this.totalSize, diskSize) * 100 : 0
return t > 100 ? 100.1 : t
},
}
},
mounted() {
this.getTemplates()
this.form.task_uuid = this.genTaskUUID()
this.csvForm.req_info.uuid = this.genTaskUUID()
this.form.label = dayjs().format('YYYY-MM-DD')
},
methods: {
@@ -410,15 +420,13 @@ export default {
sizeChange(size) {
this.totalSize = size
},
async upload_over() {
},
async upload_over() {},
// 保存
workSave() {
that.saveFlag = true
setTimeout(() => {
that.saveFlag = false
}, 1000);
}, 1000)
},
// 提交
workSubmit() {
@@ -428,7 +436,7 @@ export default {
that.submitFlag = true
setTimeout(() => {
that.submitFlag = false
}, 1000);
}, 1000)
for (let key in files) {
let file = { ...files[key] }
try {
@@ -518,6 +526,21 @@ export default {
}
this.form.ass_task.push(task)
}
// csv文件处理
if (!that.form.udf_file && that.soonList.length > 0) {
const isEmpty = that.soonList.some((item) => item.val === '')
if (isEmpty) {
that.$message({
message: '可变字段不能为空',
type: 'warning'
})
return
}
let csv1 = that.soonList.map(item => item.origin_name).join(',')
let csv2 = that.soonList.map(item => item.val).join(',')
that.csvForm.req_info.file_text = csv1 + '\n' + csv2
that.$store.dispatch('chat/websocketsend', that.csvForm)
}
that.submitLoading = true
if (that.form.json_file) that.form.has_print_task = true
if (fileList.length) that.form.has_copy_task = true
@@ -623,16 +646,6 @@ export default {
console.error(`stderr: ${stderr}`)
})
},
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)
}
}
},
// 文件上传处理
openFile() {
this.$refs.refFile.dispatchEvent(new MouseEvent('click'))
@@ -763,22 +776,22 @@ export default {
}
.work_top_val {
.el-input {
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
}
::v-deep {
.el-input__inner {
width: 180px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-size: 16px;
color: #000;
font-weight: 500;
}
.el-input__icon {
font-size: 16px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-weight: bold;
color: #000;
}
@@ -787,7 +800,7 @@ export default {
}
.work_top_set {
cursor: pointer;
height: 36px;
height: 40px;
padding: 0 22px;
background: rgba(0, 195, 37, 0.12);
border-radius: 4px;
@@ -819,7 +832,7 @@ export default {
}
.work_left_top_btn {
cursor: pointer;
height: 32px;
height: 40px;
padding: 0 22px;
background: rgba(0, 195, 37, 0.12);
border-radius: 4px;
@@ -836,8 +849,8 @@ export default {
}
.work_left_top_input {
.el-input {
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
}
::v-deep {
.el-input-group__prepend {
@@ -847,16 +860,16 @@ export default {
}
.el-input__inner {
width: 180px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-size: 16px;
color: #000;
font-weight: 500;
}
.el-input__icon {
font-size: 16px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-weight: bold;
color: #000;
}
@@ -878,7 +891,6 @@ export default {
color: #000;
}
}
}
}
}
@@ -896,23 +908,23 @@ export default {
::v-deep {
.el-input__inner {
width: 300px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-size: 16px;
color: #000;
font-weight: 500;
}
.el-input__icon {
font-size: 16px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-weight: bold;
color: #000;
}
}
.work_right_top_file {
width: 63px;
height: 32px;
height: 40px;
cursor: pointer;
background: rgba(195, 189, 0, 0.12);
border-radius: 4px;
@@ -920,13 +932,13 @@ export default {
font-weight: 500;
font-size: 16px;
color: #d9b028;
line-height: 32px;
line-height: 40px;
text-align: center;
margin: 0 22px;
}
.work_right_top_add {
width: 123px;
height: 32px;
height: 40px;
cursor: pointer;
background: #d8f6ff;
border-radius: 4px;
@@ -934,7 +946,7 @@ export default {
font-weight: 500;
font-size: 16px;
color: #25aed9;
line-height: 32px;
line-height: 40px;
text-align: center;
}
}
@@ -993,21 +1005,21 @@ export default {
}
.wook_soon_input {
width: 300px;
height: 32px;
height: 40px;
border-radius: 4px;
::v-deep {
.el-input__inner {
width: 300px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-size: 16px;
color: #000;
font-weight: 500;
}
.el-input__icon {
font-size: 16px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-weight: bold;
color: #000;
}
@@ -1015,7 +1027,7 @@ export default {
}
.wook_soon_add {
width: 110px;
height: 32px;
height: 40px;
cursor: pointer;
background: #d8f6ff;
border-radius: 4px;
@@ -1056,16 +1068,16 @@ export default {
}
.el-input__inner {
width: 180px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-size: 16px;
color: #000;
font-weight: 500;
}
.el-input__icon {
font-size: 16px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-weight: bold;
color: #000;
}
@@ -1108,7 +1120,7 @@ export default {
font-weight: 500;
font-size: 16px;
color: #000000;
line-height: 32px;
line-height: 40px;
text-align: right;
padding-right: 12px;
}
@@ -1116,16 +1128,16 @@ export default {
::v-deep {
.el-input__inner {
width: 180px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-size: 16px;
color: #000;
font-weight: 500;
}
.el-input__icon {
font-size: 16px;
height: 32px;
line-height: 32px;
height: 40px;
line-height: 40px;
font-weight: bold;
color: #000;
}
@@ -1161,7 +1173,7 @@ export default {
height: 62px;
.set_btn1 {
width: 120px;
height: 32px;
height: 40px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #000000;
@@ -1173,7 +1185,7 @@ export default {
}
.set_btn2 {
width: 120px;
height: 32px;
height: 40px;
background: #00c325;
border-radius: 4px;
font-weight: 500;
+56 -19
View File
@@ -54,7 +54,7 @@ const CDStatus = {
const diskTypes = {
1: 'CD',
2: 'DVD',
3: 'BD',
3: 'BD'
}
const CDTypes = {
1: 'CD',
@@ -116,7 +116,25 @@ const getDefaultState = () => {
CDTypes,
cd_types,
// 任务列表
task_list: [],
task_list: [
// {
// task_uuid: '20204215',
// task_name: '复制任务',
// task_size: 100000,
// finish_freq: 2,
// total_freq: 10,
// task_status: 2,
// 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
// }
// ]
// }
],
// 打印机信息
printer_info: {
blue_last: 0, //蓝色墨盒遗留
@@ -158,7 +176,7 @@ const getDefaultState = () => {
cd_list: [
{
cd_pos: 1, // 设备位置 1:下光驱,2:上光驱
cd_status: 4, // 设备状态 0:无法确定光盘状态 ,1:没有光盘 , 2:光驱托盘打开, 3:光驱未准备好,4:光盘状态正常,光盘已插入
cd_status: 1, // 设备状态 0:无法确定光盘状态 ,1:没有光盘 , 2:光驱托盘打开, 3:光驱未准备好,4:光盘状态正常,光盘已插入
cd_taskid: '', // 当前任务id
dev_path: '', // 光驱路径
dev_type: 2, // 光驱类型
@@ -182,7 +200,14 @@ const getDefaultState = () => {
error3: ''
},
// 日志信息
logList: []
logList: [
// {
// time: '2024-04-01 12:00:00',
// text: '任务开始',
// status: 'INFO'
// }
],
allLogList: []
}
}
@@ -252,6 +277,33 @@ 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 === 'add_log') {
let logs = data.resp_info.add_log
let loglist = []
let logLists = [...state.logList]
for (let i = 0; i < logs.length; i++) {
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, ''),
text: texts[2],
status: texts[1]
})
}
let list = [...loglist, ...logLists]
commit('setData', { name: 'logList', data: list })
} else if (data.resp_name === 'all_log') {
let logs = data.resp_info.add_log
let loglist = []
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, ''),
text: texts[2],
status: texts[1]
})
}
commit('setData', { name: 'logList', data: loglist })
} else if (data.resp_name === 'printer_error') {
let error = data.resp_info
let info = {
@@ -281,21 +333,6 @@ const actions = {
setTimeout(() => {
commit('setData', { name: 'printer_error', data: info })
}, 100)
} else if (data.resp_name === 'add_log') {
let logs = data.resp_info.add_log
let loglist = []
let logLists = [...state.logList]
for (let i = 0; i < logs.length; i++) {
let texts = logs[i].split('|')
if (logLists.length > 20) logLists.splice(logLists.length - 1, 1)
loglist.unshift({
time: texts[0],
text: texts[2],
status: texts[1]
})
}
let list = [...loglist, ...state.logList]
commit('setData', { name: 'logList', data: list })
}
} else {
// 未知消息
+5
View File
@@ -138,3 +138,8 @@ a:hover {
::-webkit-scrollbar-thumb:hover {
background-color: #b5b5b5; /* 设置滑块hover状态时的背景颜色 */
}
.el-select-dropdown__item {
font-size: 16px;
height: 40px;
line-height: 40px;
}
+72 -41
View File
@@ -19,11 +19,11 @@
<el-switch class="top_left_status" v-model="workStatus" active-color="#07C160" inactive-color="#aaa"> </el-switch>
<div class="flex_box top_left_option">
<div class="top_left_text">完成拷贝数:</div>
<div class="top_left_num">9</div>
<div class="top_left_num">{{ task_list.length }}</div>
</div>
<div class="flex_box top_left_option">
<div class="top_left_text">废弃拷贝数:</div>
<div class="top_left_num top_left_num1">2</div>
<div class="top_left_num top_left_num1">0</div>
</div>
<div class="flex_box top_left_option">
<div class="top_left_text">错误:</div>
@@ -44,13 +44,17 @@
<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="flex_box device_info_options">
<div class="device_info_option">
<div class="device_info_option_box">
<img src="@/assets/images/device4.png" />
<div class="device_info_option_cap">
<div class="device_info_option_cap_box" :class="{'device_info_option_cap_box1': printer_info.strongList[1].cd_num < 30, 'device_info_option_cap_box2': printer_info.strongList[1].cd_num < 10}" :style="{height: $accDiv(printer_info.strongList[1].cd_num, 50) * 100 + '%'}"></div>
<div
class="device_info_option_cap_box"
:class="{ 'device_info_option_cap_box1': printer_info.strongList[1].cd_num < 30, 'device_info_option_cap_box2': printer_info.strongList[1].cd_num < 10 }"
:style="{ height: $accDiv(printer_info.strongList[1].cd_num, 50) * 100 + '%' }"
></div>
</div>
</div>
<div class="flex_box flex_row_center device_info_option_b">
@@ -62,7 +66,11 @@
<div class="device_info_option_box">
<img src="@/assets/images/device4.png" />
<div class="device_info_option_cap">
<div class="device_info_option_cap_box" :class="{'device_info_option_cap_box1': printer_info.strongList[2].cd_num < 30, 'device_info_option_cap_box2': printer_info.strongList[2].cd_num < 10}" :style="{height: $accDiv(printer_info.strongList[2].cd_num, 50) * 100 + '%'}"></div>
<div
class="device_info_option_cap_box"
:class="{ 'device_info_option_cap_box1': printer_info.strongList[2].cd_num < 30, 'device_info_option_cap_box2': printer_info.strongList[2].cd_num < 10 }"
:style="{ height: $accDiv(printer_info.strongList[2].cd_num, 50) * 100 + '%' }"
></div>
</div>
</div>
<div class="flex_box flex_row_center device_info_option_b">
@@ -134,7 +142,7 @@
<div class="device_right_top_title">{{ cd_list[0].dev_path || '' }}({{ $store.state.chat.CDName[cd_list[0].cd_pos] }})</div>
<template v-if="cd_list[0].total_size">
<div class="flex_box device_right_top_progress">
<div class="device_right_top_progress_box" :style="{ width: cd_list[0].cd_taskid.copy_scheduler + '%' }"></div>
<div class="device_right_top_progress_box" :style="{ 'width': cd_list[0].cd_taskid.copy_scheduler + '%' }"></div>
</div>
<div class="device_right_top_text">{{ $filterSize($accSub(cd_list[0].total_size, cd_list[0].use_size)) }}可用{{ $filterSize(cd_list[0].total_size) }}</div>
</template>
@@ -154,7 +162,7 @@
<div class="device_right_top_title">{{ cd_list[1].dev_path || '' }}({{ $store.state.chat.CDName[cd_list[1].cd_pos] }})</div>
<template v-if="cd_list[1].total_size">
<div class="flex_box device_right_top_progress">
<div class="device_right_top_progress_box" :style="{ width: cd_list[1].cd_taskid.copy_scheduler + '%' }"></div>
<div class="device_right_top_progress_box" :style="{ 'width': cd_list[1].cd_taskid.copy_scheduler + '%' }"></div>
</div>
<div class="device_right_top_text">{{ $filterSize($accSub(cd_list[1].total_size, cd_list[1].use_size)) }}可用{{ $filterSize(cd_list[1].total_size) }}</div>
</template>
@@ -186,7 +194,7 @@
</div>
</template>
<template v-if="showAll">
<div v-for="(item, index) in logList" :key="index" :class="`flex_box flex_row_between notice_item notice_${item.status}`">
<div v-for="(item, index) in allLogList" :key="index" :class="`flex_box flex_row_between notice_item notice_${item.status}`">
<div class="notice_content">
<span>{{ index + 1 }}</span
>[{{ item.status }}]{{ item.text }}
@@ -206,13 +214,28 @@
<el-table max-height="250" class="work_table" :data="task_list" empty-text="暂无作业列表">
<el-table-column type="expand">
<template slot-scope="scope">
<el-table max-height="250" :data="scope.row.ass_task">
<el-table-column width="50" label=""></el-table-column>
<el-table :show-header="false" max-height="250" :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>
@@ -220,6 +243,7 @@
</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">
@@ -245,8 +269,8 @@
<div>{{ $filterSize(scope.row.task_size) }}</div>
</template>
</el-table-column>
<!-- <el-table-column prop="CreateTime" label="开始时间"></el-table-column> -->
<!-- <el-table-column prop="FinishTime" label="结束时间"></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="完成">
<template slot-scope="scope">
<div>{{ scope.row.finish_freq }}/{{ scope.row.total_freq }}</div>
@@ -325,14 +349,14 @@ export default {
// 作业列表
task_list: [],
statusList: {
'0': '新建中',
'1': '准备中',
'2': '等待中',
'3': '正在拷贝',
'4': '正在打印',
'5': '已失败',
'6': '运行中',
'100': '已完成'
0: '新建中',
1: '准备中',
2: '等待中',
3: '正在拷贝',
4: '正在打印',
5: '已失败',
6: '运行中',
100: '已完成'
},
// 设备信息
printer_info: {},
@@ -404,6 +428,13 @@ export default {
},
deep: true,
immediate: true
},
'$store.state.chat.allLogList': {
handler(val) {
this.allLogList = [...val]
},
deep: true,
immediate: true
}
},
computed: {
@@ -450,12 +481,12 @@ $red: #ff0000;
.top_btn1 {
cursor: pointer;
padding: 0 16px;
height: 30px;
height: 40px;
background: #00c325;
border-radius: 6px;
margin-right: 16px;
font-weight: 500;
font-size: 15px;
font-size: 18px;
color: #ffffff;
img {
width: 18px;
@@ -466,13 +497,13 @@ $red: #ff0000;
.top_btn2 {
cursor: pointer;
padding: 0 16px;
height: 30px;
height: 40px;
background: rgba(0, 195, 37, 0.12);
border: 2px solid rgba(0, 195, 37, 0.32);
border-radius: 6px;
margin-right: 16px;
font-weight: 500;
font-size: 15px;
font-size: 18px;
color: #00c325;
img {
width: 18px;
@@ -482,7 +513,7 @@ $red: #ff0000;
}
.top_left_line {
width: 2px;
height: 30px;
height: 40px;
background: #e0e0e0;
margin: 0 16px;
}
@@ -494,7 +525,7 @@ $red: #ff0000;
margin-left: 16px;
.top_left_text {
font-weight: 500;
font-size: 15px;
font-size: 18px;
color: #000000;
text-decoration: underline;
}
@@ -504,7 +535,7 @@ $red: #ff0000;
background: #00c325;
border-radius: 6px;
font-weight: 500;
font-size: 15px;
font-size: 18px;
color: #ffffff;
line-height: 28px;
margin-left: 12px;
@@ -623,8 +654,8 @@ $red: #ff0000;
width: 36px;
height: 67px;
border-radius: 2px;
background: linear-gradient( 270deg, #E1FBFE 0%, #FFFFFF 50%, #E5F9FF 100%);
border: 1px solid #B1CDD0;
background: linear-gradient(270deg, #e1fbfe 0%, #ffffff 50%, #e5f9ff 100%);
border: 1px solid #b1cdd0;
position: relative;
.device_info_option_content {
position: absolute;
@@ -635,24 +666,24 @@ $red: #ff0000;
}
}
.device_info_option_blue {
background: linear-gradient( 270deg, #E1FBFE 0%, #FFFFFF 50%, #E5F9FF 100%);
border: 1px solid #B1CDD0;
background: linear-gradient(270deg, #e1fbfe 0%, #ffffff 50%, #e5f9ff 100%);
border: 1px solid #b1cdd0;
.device_info_option_content {
background: linear-gradient( 90deg, #279FD0 0%, #80E1F7 48%, #2FB0E0 100%);
background: linear-gradient(90deg, #279fd0 0%, #80e1f7 48%, #2fb0e0 100%);
}
}
.device_info_option_red {
background: linear-gradient( 270deg, #FBE5F7 0%, #FFFFFF 50%, #F6E1F1 100%);
border: 1px solid #E6BCD6;
background: linear-gradient(270deg, #fbe5f7 0%, #ffffff 50%, #f6e1f1 100%);
border: 1px solid #e6bcd6;
.device_info_option_content {
background: linear-gradient( 90deg, #D02886 0%, #F56ABE 48%, #D02991 100%);
background: linear-gradient(90deg, #d02886 0%, #f56abe 48%, #d02991 100%);
}
}
.device_info_option_yellow {
background: linear-gradient( 270deg, #FEFDC5 0%, #FFFFFF 50%, #FEFDC5 100%);
border: 1px solid #EAECC6;
background: linear-gradient(270deg, #fefdc5 0%, #ffffff 50%, #fefdc5 100%);
border: 1px solid #eaecc6;
.device_info_option_content {
background: linear-gradient( 90deg, #F7EA32 0%, #FEFAAA 48%, #F8E94B 100%);
background: linear-gradient(90deg, #f7ea32 0%, #fefaaa 48%, #f8e94b 100%);
}
}
}
@@ -793,7 +824,7 @@ $red: #ff0000;
background: #000;
border-radius: 4px;
padding: 4px 10px;
font-size: 15px;
font-size: 18px;
font-weight: 500;
color: #fff;
text-align: center;
@@ -910,7 +941,7 @@ $red: #ff0000;
}
}
.notice_time {
width: 108px;
width: 160px;
text-align: center;
font-size: 14px;
color: #000000;
@@ -973,7 +1004,7 @@ $red: #ff0000;
}
.cell {
line-height: 28px;
font-size: 12px;
font-size: 16px;
color: #000000;
}
}