优化服务

This commit is contained in:
24kycj
2024-11-19 21:13:18 +08:00
parent 1707dfdbcc
commit 8eb94d7c5d
6 changed files with 328 additions and 195 deletions
File diff suppressed because one or more lines are too long
+7 -14
View File
@@ -15,24 +15,17 @@ export default {
watch: { watch: {
'$store.state.chat.printer_error': { '$store.state.chat.printer_error': {
handler(val) { handler(val) {
if (val.error1 || val.error1 === 0) { if (val.message) {
this.$notify({ this.$message({
title: '温馨提示', message: val.message,
message: this.$store.state.Error1[val.error1], type: val.type,
duration: 0
}) })
} }
if (val.error2 || val.error2 === 0) { if (val.notify) {
this.$notify({ this.$notify({
title: '温馨提示', title: '温馨提示',
message: this.$store.state.Error2[val.error2], message: val.notify,
duration: 0 type: val.type,
})
}
if (val.error3 || val.error3 === 0) {
this.$notify({
title: '温馨提示',
message: this.$store.state.Error3[val.error3],
duration: 0 duration: 0
}) })
} }
+23 -13
View File
@@ -398,10 +398,7 @@ export default {
} }
}, },
mounted() { 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: { methods: {
// 进度条处理 // 进度条处理
@@ -539,7 +536,11 @@ export default {
let csv1 = that.soonList.map(item => item.origin_name).join(',') let csv1 = that.soonList.map(item => item.origin_name).join(',')
let csv2 = that.soonList.map(item => item.val).join(',') let csv2 = that.soonList.map(item => item.val).join(',')
that.csvForm.req_info.file_text = csv1 + '\n' + csv2 that.csvForm.req_info.file_text = csv1 + '\n' + csv2
that.$store.dispatch('chat/websocketsend', that.csvForm) that.$store.dispatch('chat/websocketsend', that.csvForm).then(() => {
}).catch(() => {
})
} }
that.submitLoading = true that.submitLoading = true
if (that.form.json_file) that.form.has_print_task = true if (that.form.json_file) that.form.has_print_task = true
@@ -547,15 +548,18 @@ export default {
let theForm = { ...that.form } let theForm = { ...that.form }
if (!theForm.udf_file) delete theForm.udf_file if (!theForm.udf_file) delete theForm.udf_file
that.testForm.req_info = theForm that.testForm.req_info = theForm
that.$store.dispatch('chat/websocketsend', that.testForm) that.$store.dispatch('chat/websocketsend', that.testForm).then(() => {
setTimeout(() => { setTimeout(() => {
that.$message({ that.$message({
message: '新建作业成功', message: '新建作业成功',
type: 'success' type: 'success'
}) })
that.submitLoading = false
that.close()
}, 1500)
}).catch(() => {
that.submitLoading = false that.submitLoading = false
that.close() })
}, 2000)
}, },
// 获取模板文件列表 // 获取模板文件列表
getTemplates() { getTemplates() {
@@ -711,9 +715,15 @@ export default {
}, },
show() { show() {
this.addShow = true this.addShow = true
this.getTemplates()
this.form.task_uuid = this.genTaskUUID()
this.csvForm.req_info.uuid = this.form.task_uuid
this.form.label = dayjs().format('YYYY-MM-DD')
console.log(this.form.task_uuid)
}, },
close() { close() {
this.addShow = false this.addShow = false
this.$emit('close')
}, },
// 高级设置 // 高级设置
setCancel() { setCancel() {
+130 -124
View File
@@ -1,7 +1,6 @@
// import { getAllList, getChatList, bindId, chatBegin } from '@/api/message' // import { getAllList, getChatList, bindId, chatBegin } from '@/api/message'
let timeouter = null let timeouter = null
let websock = null let websock = null
let isConnect = false
// 状态JSON // 状态JSON
// 打印机状态 // 打印机状态
@@ -103,8 +102,100 @@ const cd_types = [
} }
] ]
const defaultData = {
// 任务列表
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, //蓝色墨盒遗留
cover_flag: false, //是否盖盖
printer_name: '', //打印机名称
printer_status: 'I', //打印机状态 数字转成字符为I
printer_tray: 'I', //打印机托盘状态 数字转成字符为I
red_last: 0, //红色墨盒遗留
yellow_last: 0, //黄色墨盒遗留
system_ip: '', //主机IP
system_name: '', //主机名称
// 左右盘仓
strong_list: [
{
strong_pos: 1, // 1:左盘仓,2:右盘仓
cd_type: 2, //CD类型:CD1DVD2 DVD_DL:3BD4,BD_DL:5,BD_TL:6,BD_QL:7
cd_num: 0
},
{
strong_pos: 2,
cd_type: 1,
cd_num: 0
}
],
strongList: {
1: {
strong_pos: 1,
cd_type: 2,
cd_num: 0
},
2: {
strong_pos: 2,
cd_type: 1,
cd_num: 0
}
}
},
// 光驱信息
cd_list: [
{
cd_pos: 1, // 设备位置 1:下光驱,2:上光驱
cd_status: 1, // 设备状态 0:无法确定光盘状态 ,1:没有光盘 , 2:光驱托盘打开, 3:光驱未准备好,4:光盘状态正常,光盘已插入
cd_taskid: '', // 当前任务id
dev_path: '', // 光驱路径
dev_type: 2, // 光驱类型
cd_assid: '', // 作业的卷标名
total_size: 0, // 总容量
use_size: 0, // 已使用容量
copy_scheduler: 0 // 任务进度
},
{
cd_pos: 2,
cd_status: 1,
cd_taskid: '',
dev_path: '',
dev_type: 1
}
],
// 日志信息
logList: [
// {
// time: '2024-04-01 12:00:00',
// text: '任务开始',
// status: 'INFO'
// }
],
allLogList: []
}
const getDefaultState = () => { const getDefaultState = () => {
return { return {
isConnect: false,
serviceStatus: false,
reconnections: 0, reconnections: 0,
PrinterStatus, PrinterStatus,
Error1, Error1,
@@ -115,99 +206,10 @@ const getDefaultState = () => {
diskTypes, diskTypes,
CDTypes, CDTypes,
cd_types, cd_types,
// 任务列表 refreshTime: 10,
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, //蓝色墨盒遗留
cover_flag: false, //是否盖盖
printer_name: '', //打印机名称
printer_status: 'I', //打印机状态 数字转成字符为I
printer_tray: 'I', //打印机托盘状态 数字转成字符为I
red_last: 0, //红色墨盒遗留
yellow_last: 0, //黄色墨盒遗留
system_ip: '', //主机IP
system_name: '', //主机名称
// 左右盘仓
strong_list: [
{
strong_pos: 1, // 1:左盘仓,2:右盘仓
cd_type: 2, //CD类型:CD1DVD2 DVD_DL:3BD4,BD_DL:5,BD_TL:6,BD_QL:7
cd_num: 0
},
{
strong_pos: 2,
cd_type: 1,
cd_num: 0
}
],
strongList: {
1: {
strong_pos: 1,
cd_type: 2,
cd_num: 0
},
2: {
strong_pos: 2,
cd_type: 1,
cd_num: 0
}
}
},
// 光驱信息
cd_list: [
{
cd_pos: 1, // 设备位置 1:下光驱,2:上光驱
cd_status: 1, // 设备状态 0:无法确定光盘状态 ,1:没有光盘 , 2:光驱托盘打开, 3:光驱未准备好,4:光盘状态正常,光盘已插入
cd_taskid: '', // 当前任务id
dev_path: '', // 光驱路径
dev_type: 2, // 光驱类型
cd_assid: '', // 作业的卷标名
total_size: 0, // 总容量
use_size: 0, // 已使用容量
copy_scheduler: 0 // 任务进度
},
{
cd_pos: 2,
cd_status: 1,
cd_taskid: '',
dev_path: '',
dev_type: 1
}
],
// 错误信息 // 错误信息
printer_error: { printer_error: {},
error1: '', ...defaultData
error2: '',
error3: ''
},
// 日志信息
logList: [
// {
// time: '2024-04-01 12:00:00',
// text: '任务开始',
// status: 'INFO'
// }
],
allLogList: []
} }
} }
@@ -221,9 +223,9 @@ const mutations = {
const actions = { const actions = {
// 初始化websocket // 初始化websocket
initWebSocket({ commit, dispatch, rootState }) { initWebSocket({ state, dispatch, rootState }) {
if (typeof WebSocket === 'undefined') return console.log('您的浏览器不支持websocket') if (typeof WebSocket === 'undefined') return console.log('您的浏览器不支持websocket')
if ((websock && isConnect) || !rootState.user.token) { if ((websock && state.isConnect) || !rootState.user.token) {
return return
} }
websock = new WebSocket(process.env.VUE_APP_SOCKET_API) websock = new WebSocket(process.env.VUE_APP_SOCKET_API)
@@ -311,7 +313,6 @@ const actions = {
error2: '', error2: '',
error3: '' error3: ''
} }
commit('setData', { name: 'printer_error', data: info })
if (error.error1) { if (error.error1) {
let errors = error.error1.split('') let errors = error.error1.split('')
for (let i = 0; i < errors.length; i++) { for (let i = 0; i < errors.length; i++) {
@@ -331,7 +332,17 @@ const actions = {
} }
} }
setTimeout(() => { setTimeout(() => {
commit('setData', { name: 'printer_error', data: info }) if (info.error1 || info.error1 === 0) {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: this.$store.state.Error1[info.error1], message: '' } })
}
if (info.error2 || info.error2 === 0) {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: this.$store.state.Error2[info.error2], message: '' } })
}
if (info.error3 || info.error3 === 0) {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: this.$store.state.Error3[info.error3], message: '' } })
}
}, 100) }, 100)
} }
} else { } else {
@@ -352,46 +363,41 @@ const actions = {
}, },
// 发送消息 // 发送消息
websocketsend({ commit, dispatch }, res) { websocketsend({ commit, dispatch }, res) {
if (!websock) { return new Promise((resolve, reject) => {
// Message.info('webSocket未连接,正在尝试连接') if (!websock || !state.isConnect || !state.serviceStatus) {
dispatch('initWebSocket') commit('setData', { name: 'printer_error', data: {type: 'error', message: '服务连接失败,正在尝试重新连接', notify: '' } })
return dispatch('initWebSocket')
} reject()
websock.send(JSON.stringify(res)) return
}
websock.send(JSON.stringify(res))
resolve()
})
}, },
// 链接建立之后执行的方法 // 链接建立之后执行的方法
websocketonopen: ({ commit, dispatch }, res) => { websocketonopen: ({ commit, dispatch }, res) => {
console.log('链接建立之后执行send方法发送数据', res) console.log('链接建立之后执行send方法发送数据', res)
isConnect = true commit('setData', { name: 'isConnect', data: true })
commit('setData', { name: 'serviceStatus', data: true })
}, },
// 链接关闭之后执行的方法 // 链接关闭之后执行的方法
websocketonclose: ({ commit, dispatch }, res) => { websocketonclose: ({ commit, dispatch }, res) => {
console.log('断开链接', res) console.log('断开链接', res)
// 关闭 // 关闭
if (isConnect) { commit('setData', { name: 'isConnect', data: false })
isConnect = false for (let key in defaultData) {
dispatch('initWebSocket') commit('setData', { name: key, data: defaultData[key] })
} }
}, },
// 链接错误之后执行的方法 // 链接错误之后执行的方法
websocketonerror({ commit, dispatch }, res) { websocketonerror({ state, commit, dispatch }, res) {
isConnect = false commit('setData', { name: 'isConnect', data: false })
commit('setData', { name: 'serviceStatus', data: false })
state.reconnections += 1 state.reconnections += 1
if (state.reconnections <= 3) { const refreshTime = parseInt(state.refreshTime)*1000
setTimeout(() => { setTimeout(() => {
dispatch('initWebSocket') dispatch('initWebSocket')
}, 5000) }, refreshTime)
} else {
// state.reconnections = 0
// dispatch('initWebSocket')
// MessageBox.alert('服务器启动异常,请刷新重试', '温馨提示', {
// confirmButtonText: '刷新',
// showCancelButton: true
// })
// .then(() => {
// })
// .catch(() => {})
}
}, },
// 关闭 // 关闭
closeWebsocket: () => { closeWebsocket: () => {
+134 -37
View File
@@ -7,16 +7,20 @@
<img src="@/assets/images/Plus1_icon.png" /> <img src="@/assets/images/Plus1_icon.png" />
<div>新建作业</div> <div>新建作业</div>
</div> </div>
<div class="flex_box flex_row_center top_btn2"> <div @click="openWork" class="flex_box flex_row_center top_btn2">
<img src="@/assets/images/Search_icon.png" /> <img src="@/assets/images/Search_icon.png" />
<div>打开作业文件</div> <div>打开作业文件</div>
</div> </div>
<div @click="$router.push({ path: '/manage' })" class="flex_box flex_row_center top_btn2"> <div @click="goUrl('/manage')" class="flex_box flex_row_center top_btn2">
<img src="@/assets/images/Setting_icon.png" /> <img src="@/assets/images/Setting_icon.png" />
<div>系统设置</div> <div>系统设置</div>
</div> </div>
<div class="top_left_line"></div> <div class="top_left_line"></div>
<el-switch class="top_left_status" v-model="workStatus" active-color="#07C160" inactive-color="#aaa"> </el-switch> <el-tooltip :content="workStatus?'关闭服务':'打开服务'" placement="bottom">
<div class="flex_box flex_row_center top_left_status_box">
<el-switch :disabled="!serviceStatus" @change="serviceChange" class="top_left_status" v-model="workStatus" active-color="#07C160" inactive-color="#aaa"> </el-switch>
</div>
</el-tooltip>
<div class="flex_box top_left_option"> <div class="flex_box top_left_option">
<div class="top_left_text">完成拷贝数:</div> <div class="top_left_text">完成拷贝数:</div>
<div class="top_left_num">{{ task_list.length }}</div> <div class="top_left_num">{{ task_list.length }}</div>
@@ -136,7 +140,8 @@
</div> </div>
</div> </div>
</div> </div>
<div :class="`flex_box device_status device_status${printer_info.printer_status} device_status${printer_info.cover_flag}`"> <!-- <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 || !isConnect || !serviceStatus }">
<div class="device_status_dot"></div> <div class="device_status_dot"></div>
<div class="device_status_text">{{ runText }}</div> <div class="device_status_text">{{ runText }}</div>
</div> </div>
@@ -154,15 +159,15 @@
<div class="flex_box device_right_top"> <div class="flex_box device_right_top">
<div class="flex_box flex_row_between device_right_top_item"> <div class="flex_box flex_row_between device_right_top_item">
<div class="device_right_top_img"> <div class="device_right_top_img">
<img v-if="cd_list[0].total_size" src="@/assets/images/device3.png" /> <img v-if="cd_list[0].cd_status == 4" src="@/assets/images/device3.png" />
<img v-if="!cd_list[0].total_size" src="@/assets/images/device2.png" /> <img v-if="cd_list[0].cd_status != 4" src="@/assets/images/device2.png" />
<div class="device_right_top_img_text" :class="{ 'device_right_top_img_text1': cd_list[0].total_size }">{{ diskTypes[cd_list[0].dev_type] }}</div> <div class="device_right_top_img_text" :class="{ 'device_right_top_img_text1': cd_list[0].cd_status == 4 }">{{ diskTypes[cd_list[0].dev_type] }}</div>
</div> </div>
<div class="device_right_top_content"> <div class="device_right_top_content">
<div class="device_right_top_title">{{ cd_list[0].dev_path || '' }}({{ $store.state.chat.CDName[cd_list[0].cd_pos] }})</div> <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"> <template v-if="cd_list[0].copy_scheduler > 0">
<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].cd_taskid.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($accSub(cd_list[0].total_size, cd_list[0].use_size)) }}可用{{ $filterSize(cd_list[0].total_size) }}</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> </template>
@@ -174,15 +179,15 @@
<div class="device_right_top_line"></div> <div class="device_right_top_line"></div>
<div class="flex_box flex_row_between device_right_top_item"> <div class="flex_box flex_row_between device_right_top_item">
<div class="device_right_top_img"> <div class="device_right_top_img">
<img v-if="cd_list[1].total_size" src="@/assets/images/device3.png" /> <img v-if="cd_list[1].cd_status == 4" src="@/assets/images/device3.png" />
<img v-if="!cd_list[1].total_size" src="@/assets/images/device2.png" /> <img v-if="cd_list[1].cd_status != 4" src="@/assets/images/device2.png" />
<div class="device_right_top_img_text" :class="{ 'device_right_top_img_text1': cd_list[1].total_size }">{{ diskTypes[cd_list[1].dev_type] }}</div> <div class="device_right_top_img_text" :class="{ 'device_right_top_img_text1': cd_list[1].cd_status == 4 }">{{ diskTypes[cd_list[1].dev_type] }}</div>
</div> </div>
<div class="device_right_top_content"> <div class="device_right_top_content">
<div class="device_right_top_title">{{ cd_list[1].dev_path || '' }}({{ $store.state.chat.CDName[cd_list[1].cd_pos] }})</div> <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"> <template v-if="cd_list[1].copy_scheduler">
<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].cd_taskid.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($accSub(cd_list[1].total_size, cd_list[1].use_size)) }}可用{{ $filterSize(cd_list[1].total_size) }}</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> </template>
@@ -198,7 +203,7 @@
<img src="@/assets/images/inform1_icon.png" /> <img src="@/assets/images/inform1_icon.png" />
<div>动态</div> <div>动态</div>
</div> </div>
<div @click="showAll = !showAll" class="flex_box notice_all"> <div @click="noticeChange" class="flex_box notice_all">
<img src="@/assets/images/Calendar_icon.png" /> <img src="@/assets/images/Calendar_icon.png" />
<div>{{ showAll ? '最新日志' : '全部日志' }}</div> <div>{{ showAll ? '最新日志' : '全部日志' }}</div>
</div> </div>
@@ -316,7 +321,7 @@
</div> </div>
<!-- 新建作业 --> <!-- 新建作业 -->
<work-add ref="workAdd"></work-add> <work-add v-if="workShow" @close="workShow=false" ref="workAdd"></work-add>
</div> </div>
</template> </template>
@@ -333,11 +338,11 @@ export default {
components: { UserInfo, WorkAdd }, components: { UserInfo, WorkAdd },
data() { data() {
return { return {
// 设备运行状态 // 服务状态
workStatus: true, isConnect: false,
serviceStatus: false,
// 工作状态 // 工作状态
infoStatus: 0, infoStatus: 0,
runText: '',
// 运行选项 // 运行选项
runVal: 1, runVal: 1,
currentRunVal: 0, currentRunVal: 0,
@@ -410,7 +415,8 @@ export default {
// 日志信息 // 日志信息
logList: [], logList: [],
allLogList: [], allLogList: [],
showAll: false showAll: false,
workShow: false
} }
}, },
watch: { watch: {
@@ -434,11 +440,6 @@ export default {
}, },
'$store.state.chat.printer_info': { '$store.state.chat.printer_info': {
handler(val) { handler(val) {
if (val.cover_flag) {
this.runText = '设备门盖被打开,请关闭门盖。'
} else {
this.runText = this.$store.state.chat.PrinterStatus[val.printer_status]
}
this.default_cd = val.strongList this.default_cd = val.strongList
this.printer_info = { ...val } this.printer_info = { ...val }
}, },
@@ -479,17 +480,65 @@ export default {
}, },
deep: true, deep: true,
immediate: true immediate: true
},
'$store.state.chat.isConnect': {
handler(val) {
this.isConnect = val
},
deep: true,
immediate: true
},
'$store.state.chat.serviceStatus': {
handler(val) {
this.serviceStatus = val
},
deep: true,
immediate: true
} }
}, },
computed: { computed: {
...mapGetters(['name', 'roles']) ...mapGetters(['name', 'roles']),
runText() {
let text = this.$store.state.chat.PrinterStatus[this.printer_info.printer_status]
if (this.printer_info.cover_flag) {
text = '设备门盖被打开,请关闭门盖。'
}
if (!this.isConnect) {
text = '服务已关闭'
}
if (!this.serviceStatus) {
text = '正在连接服务器,请检查服务器是否正常'
}
return text
},
workStatus() {
return this.isConnect&&this.serviceStatus
},
}, },
mounted() { mounted() {
that = this that = this
}, },
methods: { methods: {
// 服务打开/关闭
serviceChange(e) {
if (!that.serviceStatus) {
return
}
if (e) {
that.$store.dispatch('chat/initWebSocket')
} else {
that.$store.dispatch('chat/closeWebsocket')
}
},
// 执行 // 执行
handleRun() { handleRun() {
if (!that.workStatus) {
that.$message({
message: '请先连接服务',
type: 'warning'
})
return
}
const index = that.runList.findIndex((item) => item.value == that.runVal) const index = that.runList.findIndex((item) => item.value == that.runVal)
// that.$message({ // that.$message({
// message: that.runList[index].label, // message: that.runList[index].label,
@@ -510,13 +559,59 @@ export default {
this.changeCD.req_info.strong_list[type].strong_type = e this.changeCD.req_info.strong_list[type].strong_type = e
}, },
sureCD() { sureCD() {
that.$store.dispatch('chat/websocketsend', this.changeCD) that.$store.dispatch('chat/websocketsend', this.changeCD).then(() => {
clearTimeout(outTimer) clearTimeout(outTimer)
this.currentRunVal = 0 this.currentRunVal = 0
}).catch(() => {
clearTimeout(outTimer)
this.currentRunVal = 0
})
}, },
// 新建作业 // 新建作业
showWork() { showWork() {
that.$refs.workAdd.show() // if (!that.workStatus) {
// that.$message({
// message: '请先连接服务',
// type: 'warning'
// })
// return
// }
that.workShow = true
that.$nextTick(() => {
that.$refs.workAdd.show()
})
},
// 打开作业文件
openWork() {
if (!that.workStatus) {
that.$message({
message: '请先连接服务',
type: 'warning'
})
return
}
},
// 显示日志
noticeChange() {
if (!that.workStatus) {
that.$message({
message: '请先连接服务',
type: 'warning'
})
return
}
that.showAll = !that.showAll
},
// 跳转
goUrl(e) {
if (!that.workStatus) {
that.$message({
message: '请先连接服务',
type: 'warning'
})
return
}
that.$router.push({ path: e })
}, },
// 退出登录 // 退出登录
goOut() { goOut() {
@@ -579,9 +674,12 @@ $red: #ff0000;
background: #e0e0e0; background: #e0e0e0;
margin: 0 16px; margin: 0 16px;
} }
.top_left_status { .top_left_status_box {
padding: 0 16px; width: 90px;
zoom: 1.3; .top_left_status {
padding: 0 16px;
zoom: 1.3;
}
} }
.top_left_option { .top_left_option {
margin-left: 16px; margin-left: 16px;
@@ -814,7 +912,7 @@ $red: #ff0000;
line-height: 30px; line-height: 30px;
} }
} }
.device_statusI { .device_status1 {
.device_status_dot { .device_status_dot {
background-color: $green; background-color: $green;
} }
@@ -822,8 +920,7 @@ $red: #ff0000;
color: $green; color: $green;
} }
} }
.device_statusB, .device_status2 {
.device_statusP {
.device_status_dot { .device_status_dot {
background-color: $yellow; background-color: $yellow;
} }
@@ -831,7 +928,7 @@ $red: #ff0000;
color: $yellow; color: $yellow;
} }
} }
.device_statustrue { .device_status3 {
.device_status_dot { .device_status_dot {
background-color: $red; background-color: $red;
} }
+33 -7
View File
@@ -42,12 +42,14 @@
<div class="form_label">刷新时间</div> <div class="form_label">刷新时间</div>
<div class="form_val"> <div class="form_val">
<div class="flex_box flex_col_top form_input"> <div class="flex_box flex_col_top form_input">
<el-input border="none" v-model="refreshTime" placeholder="请输入刷新时间"></el-input> <el-input border="none" v-model.number="refreshTime" placeholder="请输入刷新时间">
<el-button type="primary">执行</el-button> <template slot="append"></template>
</el-input>
<el-button @click="handleRefresh" type="primary">执行</el-button>
</div> </div>
</div> </div>
</div> </div>
<div class="flex_box form_option"> <!-- <div class="flex_box form_option">
<div class="form_label">休眠时间</div> <div class="form_label">休眠时间</div>
<div class="form_val"> <div class="form_val">
<div class="flex_box flex_col_top form_input"> <div class="flex_box flex_col_top form_input">
@@ -55,7 +57,7 @@
<el-button type="primary">执行</el-button> <el-button type="primary">执行</el-button>
</div> </div>
</div> </div>
</div> </div> -->
<div class="flex_box form_option"> <div class="flex_box form_option">
<div class="form_label">清除任务</div> <div class="form_label">清除任务</div>
<div class="form_val"> <div class="form_val">
@@ -150,7 +152,7 @@ export default {
name: '清洁工作站' name: '清洁工作站'
} }
], ],
refreshTime: 3000, refreshTime: 10,
sleepTime: 300000, sleepTime: 300000,
isDel: true, isDel: true,
langVal: 'zhCN', langVal: 'zhCN',
@@ -173,8 +175,27 @@ export default {
computed: { computed: {
...mapGetters(['name', 'roles']) ...mapGetters(['name', 'roles'])
}, },
watch: {
'$store.state.chat.refreshTime': {
handler (val) {
this.refreshTime = val
},
immediate: true,
deep: true
}
},
methods: { methods: {
// 刷新时间
handleRefresh() {
this.$store.commit('chat/setData', {
name: 'refreshTime',
data: this.refreshTime
})
this.$message({
message: '设置成功',
type: 'success'
})
}
} }
} }
</script> </script>
@@ -237,6 +258,11 @@ export default {
border: 1px solid #98E8A6; border: 1px solid #98E8A6;
overflow: hidden; overflow: hidden;
::v-deep { ::v-deep {
.el-input-group__append {
font-size: 16px;
color: #000;
font-weight: 500;
}
.el-input__inner { .el-input__inner {
width: 360px; width: 360px;
height: 40px; height: 40px;
@@ -283,7 +309,7 @@ export default {
left: 8px; left: 8px;
} }
.el-checkbox__label { .el-checkbox__label {
font-size: 24px; font-size: 19px;
line-height: 24px; line-height: 24px;
} }
.el-checkbox__input.is-checked+.el-checkbox__label { .el-checkbox__input.is-checked+.el-checkbox__label {