优化
This commit is contained in:
@@ -210,6 +210,9 @@ const dayjs = require('dayjs')
|
||||
|
||||
import fileEmpty from './files/fileEmpty'
|
||||
import files from './files/file'
|
||||
|
||||
const exePath = path.dirname(process.execPath)
|
||||
// const exePath = process.cwd();
|
||||
export default {
|
||||
name: 'UserInfo',
|
||||
components: { fileEmpty, files },
|
||||
@@ -720,7 +723,7 @@ export default {
|
||||
},
|
||||
// 获取模板文件列表
|
||||
getTemplates() {
|
||||
const filePath = path.join(process.cwd(), 'User Templates');
|
||||
const filePath = path.join(exePath, 'User Templates');
|
||||
fs.readdir(filePath, (err, files) => {
|
||||
if (err) {
|
||||
console.log(err)
|
||||
@@ -892,7 +895,8 @@ export default {
|
||||
},
|
||||
setSure() {
|
||||
this.setShow = false
|
||||
this.$store.commit('setData', { name: 'setForm', data: this.setForm })
|
||||
that.$store.dispatch('chat/setDatas', {name: 'workStatus', data: true})
|
||||
this.$store.dispatch('setDatas', { name: 'setForm', data: this.setForm })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,6 +313,10 @@ const mutations = {
|
||||
}
|
||||
|
||||
const actions = {
|
||||
// 改变state值
|
||||
setDatas: ({ commit }, data) => {
|
||||
commit('setData', data)
|
||||
},
|
||||
// 初始化websocket
|
||||
initWebSocket({ state, commit, dispatch, rootState }) {
|
||||
if (typeof WebSocket === 'undefined') return console.log('您的浏览器不支持websocket')
|
||||
@@ -450,7 +454,13 @@ const actions = {
|
||||
}
|
||||
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' } })
|
||||
let continues = ['0x11', '0x12', '0x13', '0x14', '0x15', '0x16', '0x17', '0x18', '0x19', '0x1a', '0x1b', '0x1c', '0x1d', '0x1e', '0x1f', '0x21']
|
||||
let req = continues.indexOf(error.printer_error) > -1 ? 'continue_task' : ''
|
||||
if (req) {
|
||||
commit('setData', { name: 'printer_error', data: { type: 'error', confirm: printer_errors[error.printer_error], req: req } })
|
||||
} else {
|
||||
commit('setData', { name: 'printer_error', data: { type: 'error', notify: printer_errors[error.printer_error] } })
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -524,10 +534,6 @@ const actions = {
|
||||
closeWebsocket: () => {
|
||||
// 关闭
|
||||
if (websock) websock.close()
|
||||
},
|
||||
// 改变工作状态
|
||||
changeWorkStatus: ({ commit }, data) => {
|
||||
commit('setData', { name: 'workStatus', data: data })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ const user = {
|
||||
avatar:
|
||||
'https://image.baidu.com/search/detail?ct=503316480&z=&tn=baiduimagedetail&ipn=d&word=admin&step_word=&lid=8980923753406439282&ie=utf-8&in=&cl=2&lm=-1&st=-1&hd=&latest=©right=&cs=1902119677,258344230&os=3526618670,2431782315&simid=3426573763,123057590&pn=11&rn=1&di=7410818322373017601&ln=1928&fr=&fmq=1730735680169_R&ic=&s=undefined&se=&sme=&tab=0&width=&height=&face=undefined&is=0,0&istype=2&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=1e&objurl=https%3A%2F%2Fclearhub.tech%2Fwp-content%2Fuploads%2F2018%2F11%2F12.png&rpstart=0&rpnum=0&adpicid=0&nojc=undefined&dyTabStr=MCwzLDEsMiwxMyw3LDYsNSwxMiw5',
|
||||
roles: ['admin'],
|
||||
oneLogin: false,
|
||||
// 高级设置
|
||||
setForm: setFormDefault,
|
||||
},
|
||||
@@ -41,6 +42,10 @@ const user = {
|
||||
},
|
||||
|
||||
actions: {
|
||||
// 改变state值
|
||||
setDatas: ({ commit }, data) => {
|
||||
commit('setData', data)
|
||||
},
|
||||
// 登录
|
||||
Login({ commit }, userInfo) {
|
||||
const username = userInfo.username.trim()
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<div class="container_box" v-loading="serviceLoading"
|
||||
:element-loading-text="serviceText"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.8)">
|
||||
<div class="container_box" v-loading="serviceLoading" :element-loading-text="serviceText" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
|
||||
<!-- 头部 -->
|
||||
<div class="flex_box flex_row_between top_box">
|
||||
<div class="flex_box top_left">
|
||||
@@ -19,7 +16,7 @@
|
||||
<div>系统设置</div>
|
||||
</div>
|
||||
<div class="top_left_line"></div>
|
||||
<el-tooltip :content="workStatus?'关闭服务':'打开服务'" placement="bottom">
|
||||
<el-tooltip :content="workStatus ? '关闭服务' : '打开服务'" placement="bottom">
|
||||
<div class="flex_box flex_row_center top_left_status_box">
|
||||
<el-switch @change="serviceChange" class="top_left_status" :value="workStatus" active-color="#07C160" inactive-color="#aaa"> </el-switch>
|
||||
</div>
|
||||
@@ -30,11 +27,11 @@
|
||||
</div>
|
||||
<div class="flex_box top_left_option">
|
||||
<div class="top_left_text">废弃刻录数:</div>
|
||||
<div class="top_left_num top_left_num1">{{taskNum[1]}}</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">{{taskNum[2]}}</div>
|
||||
<div class="top_left_num">{{ taskNum[2] }}</div>
|
||||
</div>
|
||||
<div class="top_left_line"></div>
|
||||
</div>
|
||||
@@ -66,7 +63,7 @@
|
||||
<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 }"
|
||||
: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>
|
||||
@@ -78,7 +75,12 @@
|
||||
<i v-if="currentRunVal === 6" class="el-icon-caret-bottom"></i>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-for="(item, index) in CDTypes" :key="index" :command="index"><span :style="{'color': index === printer_info.strongList[2].cd_type ? '#409EFF' : '#000', 'font-weight': index === printer_info.strongList[2].cd_type ? '600' : '400' }">{{ item }}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-for="(item, index) in CDTypes" :key="index" :command="index"
|
||||
><span
|
||||
:style="{ color: index === printer_info.strongList[2].cd_type ? '#409EFF' : '#000', 'font-weight': index === printer_info.strongList[2].cd_type ? '600' : '400' }"
|
||||
>{{ item }}</span
|
||||
></el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
@@ -89,7 +91,7 @@
|
||||
<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 }"
|
||||
: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>
|
||||
@@ -101,7 +103,12 @@
|
||||
<i v-if="currentRunVal === 6" class="el-icon-caret-bottom"></i>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-for="(item, index) in CDTypes" :key="index" :command="index"><span :style="{'color': index === printer_info.strongList[1].cd_type ? '#409EFF' : '#000', 'font-weight': index === printer_info.strongList[1].cd_type ? '600' : '400' }">{{ item }}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-for="(item, index) in CDTypes" :key="index" :command="index"
|
||||
><span
|
||||
:style="{ color: index === printer_info.strongList[1].cd_type ? '#409EFF' : '#000', 'font-weight': index === printer_info.strongList[1].cd_type ? '600' : '400' }"
|
||||
>{{ item }}</span
|
||||
></el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
@@ -124,7 +131,9 @@
|
||||
<div class="device_info_option_b_text device_info_option_b_text1">{{ parseInt(printer_info.yellow_last) }}%</div>
|
||||
</div>
|
||||
<div v-if="isLast" @click="isLast = false" class="flex_box flex_row_center device_info_option_b">
|
||||
<div class="device_info_option_b_text device_info_option_b_text1">{{ parseInt($accDiv($accAdd($accAdd(printer_info.blue_last,printer_info.red_last),printer_info.yellow_last),3)) }}%</div>
|
||||
<div class="device_info_option_b_text device_info_option_b_text1">
|
||||
{{ parseInt($accDiv($accAdd($accAdd(printer_info.blue_last, printer_info.red_last), printer_info.yellow_last), 3)) }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -148,7 +157,14 @@
|
||||
</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 || printer_info.lack_ink || !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>
|
||||
@@ -175,9 +191,11 @@
|
||||
<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].copy_scheduler > 0">
|
||||
<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 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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -196,9 +214,11 @@
|
||||
<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].copy_scheduler">
|
||||
<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 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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -245,7 +265,7 @@
|
||||
<div class="flex_box work_top">
|
||||
<div class="work_top_text">作业列表</div>
|
||||
</div>
|
||||
<el-table row-key="id" default-expand-all class="work_table" :data="task_list" empty-text="暂无作业列表" :tree-props="{children: 'ass_task', hasChildren: 'hasChildren'}">
|
||||
<el-table row-key="id" default-expand-all class="work_table" :data="task_list" empty-text="暂无作业列表" :tree-props="{ children: 'ass_task', hasChildren: 'hasChildren' }">
|
||||
<!-- <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_name" label="任务名称"></el-table-column>
|
||||
@@ -264,7 +284,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="task_status" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.task_status == 5&&scope.row.task_uuid">
|
||||
<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>
|
||||
@@ -294,7 +314,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 新建作业 -->
|
||||
<work-add v-if="workShow" @close="workShow=false" :isNew="isNew" :saveWorkList="saveWorkList" ref="workAdd"></work-add>
|
||||
<work-add v-if="workShow" @close="workShow = false" :isNew="isNew" :saveWorkList="saveWorkList" ref="workAdd"></work-add>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -307,8 +327,9 @@ import { mapGetters } from 'vuex'
|
||||
const { app, dialog } = require('@electron/remote')
|
||||
import UserInfo from '@/components/userInfo/userInfo.vue'
|
||||
import WorkAdd from '@/components/workAdd/workAdd.vue'
|
||||
const exePath = process.cwd();
|
||||
const shPath = path.join(exePath, 'cardsoonServer', 'control.sh')
|
||||
const exePath = path.dirname(process.execPath)
|
||||
// const exePath = process.cwd();
|
||||
const shPath = path.join(exePath, 'CardsoonServer', 'control.sh')
|
||||
export default {
|
||||
name: 'dashboard',
|
||||
components: { UserInfo, WorkAdd },
|
||||
@@ -355,7 +376,7 @@ export default {
|
||||
// 剩余容量
|
||||
progressW: 75,
|
||||
// 作业列表
|
||||
taskNum: [0,0,0],
|
||||
taskNum: [0, 0, 0],
|
||||
task_list: [],
|
||||
statusList: {
|
||||
0: '新建中',
|
||||
@@ -403,12 +424,23 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.user.oneLogin': {
|
||||
handler(val) {
|
||||
console.log(val, 'oneLoginoneLoginoneLogin')
|
||||
if (val) {
|
||||
this.$store.dispatch('setDatas', { name: 'oneLogin', data: false })
|
||||
this.startService()
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
'$store.state.chat.task_list': {
|
||||
handler(val) {
|
||||
if (val && val.length) {
|
||||
let tasks = [...val]
|
||||
let list = []
|
||||
let nums = [0,0,0]
|
||||
let nums = [0, 0, 0]
|
||||
tasks.forEach((item, index) => {
|
||||
if (item.task_status == 100) {
|
||||
nums[0]++
|
||||
@@ -417,13 +449,13 @@ export default {
|
||||
} else if (item.task_status == 5) {
|
||||
nums[2]++
|
||||
}
|
||||
if (item.ass_task&&item.ass_task.length) {
|
||||
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]
|
||||
item.id = item.task_uuid
|
||||
item.ass_task.forEach((item2, idx) => {
|
||||
item2.id = item.task_uuid+'_'+(idx+1)
|
||||
item2.cdType = this.$store.state.chat.CDTypes[item2.cd_type] + '_' + (idx+1)
|
||||
item2.id = item.task_uuid + '_' + (idx + 1)
|
||||
item2.cdType = this.$store.state.chat.CDTypes[item2.cd_type] + '_' + (idx + 1)
|
||||
task_size = this.$accAdd(task_size, item2.task_size)
|
||||
})
|
||||
item.task_size = task_size
|
||||
@@ -528,56 +560,87 @@ export default {
|
||||
return text
|
||||
},
|
||||
workStatus() {
|
||||
return this.isConnect&&this.serviceStatus
|
||||
},
|
||||
return this.isConnect && this.serviceStatus
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
that = this
|
||||
let name = 'ERR_ELECTRON_BUILDER_CANNOT_EXECUTE'
|
||||
console.log(name.toLowerCase())
|
||||
},
|
||||
methods: {
|
||||
// 服务打开/关闭
|
||||
serviceChange(e) {
|
||||
let that = this
|
||||
// if (!that.serviceStatus) {
|
||||
// return
|
||||
// }
|
||||
console.log(e)
|
||||
that.serviceLoading = true
|
||||
if (e) {
|
||||
that.serviceText = '服务启动中'
|
||||
this.$runCmd(`bash ${shPath} start`).then(res => {
|
||||
that.$store.dispatch('chat/changeWorkStatus', true)
|
||||
that
|
||||
.$confirm('确定执行开启服务操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
that.startService()
|
||||
})
|
||||
.catch(() => {
|
||||
that.serviceLoading = false
|
||||
})
|
||||
} else {
|
||||
that
|
||||
.$confirm('确定执行开启服务操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
that.serviceLoading = true
|
||||
that.serviceText = '服务关闭中'
|
||||
that
|
||||
.$runCmd(`bash ${shPath} stop`)
|
||||
.then((res) => {
|
||||
that.$store.dispatch('chat/setDatas', { name: 'workStatus', data: false })
|
||||
setTimeout(() => {
|
||||
that.$store.dispatch('chat/closeWebsocket')
|
||||
that.serviceLoading = false
|
||||
that.$message({
|
||||
message: '服务已关闭',
|
||||
type: 'success'
|
||||
})
|
||||
}, 500)
|
||||
})
|
||||
.catch((err) => {
|
||||
that.$message({
|
||||
message: err,
|
||||
type: 'error'
|
||||
})
|
||||
that.serviceLoading = false
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
that.serviceLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
startService() {
|
||||
let that = this
|
||||
that.serviceLoading = true
|
||||
that.serviceText = '服务启动中'
|
||||
that
|
||||
.$runCmd(`bash ${shPath} start`)
|
||||
.then((res) => {
|
||||
that.$store.dispatch('chat/setDatas', { name: 'workStatus', data: true })
|
||||
setTimeout(() => {
|
||||
that.$store.dispatch('chat/initWebSocket')
|
||||
}, 500);
|
||||
}).catch(err => {
|
||||
}, 500)
|
||||
})
|
||||
.catch((err) => {
|
||||
that.$message({
|
||||
message: err,
|
||||
type: 'error'
|
||||
})
|
||||
that.serviceLoading = false
|
||||
})
|
||||
} else {
|
||||
that.serviceText = '服务关闭中'
|
||||
this.$runCmd(`bash ${shPath} stop`).then(res => {
|
||||
that.$store.dispatch('chat/changeWorkStatus', false)
|
||||
setTimeout(() => {
|
||||
that.$store.dispatch('chat/closeWebsocket')
|
||||
that.serviceLoading = false
|
||||
that.$message({
|
||||
message: '服务已关闭',
|
||||
type: 'success'
|
||||
})
|
||||
}, 500);
|
||||
}).catch(err => {
|
||||
that.$message({
|
||||
message: err,
|
||||
type: 'error'
|
||||
})
|
||||
that.serviceLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
// 执行
|
||||
handleRun() {
|
||||
@@ -603,170 +666,203 @@ export default {
|
||||
switch (that.runVal) {
|
||||
case 1:
|
||||
// 重启设备
|
||||
that.$confirm('确定执行重启设备操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'resetPrinter',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
that
|
||||
.$confirm('确定执行重启设备操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
})
|
||||
break;
|
||||
.then(() => {
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'resetPrinter',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
break
|
||||
case 2:
|
||||
// 清除错误
|
||||
that.$confirm('确定执行清除错误操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'autoSetCDDev',
|
||||
that
|
||||
.$confirm('确定执行清除错误操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'autoSetCDDev',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'cleanError',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'cleanError',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
break;
|
||||
break
|
||||
case 3:
|
||||
// 校准盘仓
|
||||
that.$confirm('确定执行校准盘仓操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'autoSetCDDev',
|
||||
that
|
||||
.$confirm('确定执行校准盘仓操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'autoSetCDDev',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'CaliCDStone',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'CaliCDStone',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
break;
|
||||
break
|
||||
case 4:
|
||||
// 校准设备
|
||||
that.$confirm('确定执行校准设备操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'autoSetCDDev',
|
||||
req_type: 2,
|
||||
that
|
||||
.$confirm('确定执行校准设备操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'autoSetCDDev',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'CaliPrinter',
|
||||
req_type: 1,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'CaliPrinter',
|
||||
req_type: 1,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
break;
|
||||
break
|
||||
case 5:
|
||||
// 自动匹配光驱
|
||||
that.$confirm('确定执行自动匹配光驱操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'autoSetCDDev',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
that
|
||||
.$confirm('确定执行自动匹配光驱操作吗?', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
})
|
||||
break;
|
||||
.then(() => {
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'autoSetCDDev',
|
||||
req_type: 2,
|
||||
req_info: {}
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
break
|
||||
case 6:
|
||||
outTimer = setTimeout(() => {
|
||||
that.currentRunVal = 0
|
||||
that.printer_info.strongList = that.default_cd
|
||||
}, 120000);
|
||||
break;
|
||||
}, 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'
|
||||
})
|
||||
that
|
||||
.$confirm('请确保已经取掉左右光盘仓托架,再点击确定', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
})
|
||||
break;
|
||||
.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
|
||||
},
|
||||
// 更换左右磁盘类型
|
||||
handleCommandCD(e, type) {
|
||||
that.printer_info.strongList[type].cd_type = e
|
||||
that.changeCD.req_info.strong_list[type-1].strong_type = e
|
||||
that.changeCD.req_info.strong_list[type - 1].strong_type = e
|
||||
},
|
||||
sureCD() {
|
||||
that.$store.dispatch('chat/websocketsend', that.changeCD).then(() => {
|
||||
clearTimeout(outTimer)
|
||||
that.currentRunVal = 0
|
||||
}).catch(() => {
|
||||
clearTimeout(outTimer)
|
||||
that.currentRunVal = 0
|
||||
})
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', that.changeCD)
|
||||
.then(() => {
|
||||
clearTimeout(outTimer)
|
||||
that.currentRunVal = 0
|
||||
})
|
||||
.catch(() => {
|
||||
clearTimeout(outTimer)
|
||||
that.currentRunVal = 0
|
||||
})
|
||||
},
|
||||
// 新建作业
|
||||
showWork() {
|
||||
@@ -833,45 +929,49 @@ export default {
|
||||
},
|
||||
// 作业重试
|
||||
workRetry(e) {
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'retry_task',
|
||||
req_type: 1,
|
||||
req_info: {
|
||||
task_uuid: that.task_list[e].task_uuid
|
||||
}
|
||||
}).then(() => {
|
||||
that.$message({
|
||||
message: '重试成功',
|
||||
type: 'success'
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'retry_task',
|
||||
req_type: 1,
|
||||
req_info: {
|
||||
task_uuid: that.task_list[e].task_uuid
|
||||
}
|
||||
})
|
||||
that.task_list[e].task_status = 1
|
||||
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 = 1
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '重试成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
that.task_list[e].task_status = 1
|
||||
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 = 1
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 作业取消
|
||||
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.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'cancle_task',
|
||||
req_type: 1,
|
||||
req_info: {
|
||||
task_uuid: that.task_list[e].task_uuid
|
||||
}
|
||||
})
|
||||
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
|
||||
.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) {
|
||||
@@ -1431,7 +1531,7 @@ $red: #ff0000;
|
||||
height: calc(100vh - 665px) !important;
|
||||
::v-deep .el-table__body-wrapper {
|
||||
height: calc(100% - 48px) !important;
|
||||
overflow: scroll!important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
}
|
||||
.work_top {
|
||||
|
||||
@@ -81,10 +81,10 @@ export default {
|
||||
this.loading = true
|
||||
setToken('data.token')
|
||||
if (localStorage.getItem('setForm')) {
|
||||
this.$store.commit('setData', {name: 'setForm', data: localStorage.getItem('setForm')})
|
||||
this.$store.dispatch('setDatas', {name: 'setForm', data: localStorage.getItem('setForm')})
|
||||
}
|
||||
this.$store.commit('SET_TOKEN', 'data.token')
|
||||
this.$store.dispatch('chat/initWebSocket') // 初始化websocket
|
||||
this.$store.dispatch('setDatas', {name: 'token', data: 'data.token'})
|
||||
this.$store.dispatch('setDatas', {name: 'oneLogin', data: true})
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
this.$router.push({ path: '/' })
|
||||
|
||||
@@ -557,7 +557,7 @@ export default {
|
||||
},
|
||||
// 刷新时间
|
||||
handleRefresh() {
|
||||
this.$store.commit('chat/setData', {
|
||||
this.$store.dispatch('chat/setDatas', {
|
||||
name: 'refreshTime',
|
||||
data: this.refreshTime
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user