This commit is contained in:
24kycj
2024-12-09 19:30:07 +08:00
parent 63a507a76e
commit 85e58775bc
3 changed files with 17 additions and 25 deletions
+8 -13
View File
@@ -148,7 +148,9 @@
<el-select @change="changeTemplate" v-model="currentTemplate" placeholder="选择一个标签或点击创建标签"> <el-select @change="changeTemplate" v-model="currentTemplate" placeholder="选择一个标签或点击创建标签">
<el-option v-for="item in templates" :key="item.value" :label="item.label" :value="item.value"> </el-option> <el-option v-for="item in templates" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select> </el-select>
<div @click="openFile" class="work_right_top_file">···</div> <el-tooltip content="选择更多模版" placement="bottom">
<div @click="openFile" class="work_right_top_file">···</div>
</el-tooltip>
</div> </div>
<div class="work_right_top_add">新建标签</div> <div class="work_right_top_add">新建标签</div>
</div> </div>
@@ -211,8 +213,7 @@ const dayjs = require('dayjs')
import fileEmpty from './files/fileEmpty' import fileEmpty from './files/fileEmpty'
import files from './files/file' import files from './files/file'
const exePath = path.dirname(process.execPath) const exePath = !app.isPackaged ? process.cwd() : path.dirname(process.execPath)
// const exePath = process.cwd();
export default { export default {
name: 'UserInfo', name: 'UserInfo',
components: { fileEmpty, files }, components: { fileEmpty, files },
@@ -742,20 +743,14 @@ export default {
// 选择模板 // 选择模板
changeTemplate(e) { changeTemplate(e) {
let that = this let that = this
const absolutePath = path.resolve(e) const fullPath = path.join(exePath, e)
fs.realpath(absolutePath, (err, fullPath) => { that.form.json_file = fullPath
if (err) { fs.readFile(fullPath, 'utf8', (err, data) => {
console.error(err)
return
}
that.form.json_file = fullPath
})
fs.readFile(e, 'utf8', (err, data) => {
if (err) { if (err) {
console.error('读取文件时出错:', err) console.error('读取文件时出错:', err)
return return
} }
let name = e.split('\\')[1] let name = path.basename(fullPath)
that.fileLists[0] = new File([data], name, { that.fileLists[0] = new File([data], name, {
type: '' type: ''
}) })
+1 -4
View File
@@ -327,8 +327,7 @@ import { mapGetters } from 'vuex'
const { app, dialog } = require('@electron/remote') const { app, dialog } = require('@electron/remote')
import UserInfo from '@/components/userInfo/userInfo.vue' import UserInfo from '@/components/userInfo/userInfo.vue'
import WorkAdd from '@/components/workAdd/workAdd.vue' import WorkAdd from '@/components/workAdd/workAdd.vue'
const exePath = path.dirname(process.execPath) const exePath = !app.isPackaged ? process.cwd() : path.dirname(process.execPath)
// const exePath = process.cwd();
const shPath = path.join(exePath, 'CardsoonServer', 'control.sh') const shPath = path.join(exePath, 'CardsoonServer', 'control.sh')
export default { export default {
name: 'dashboard', name: 'dashboard',
@@ -422,7 +421,6 @@ export default {
watch: { watch: {
'$store.state.user.oneLogin': { '$store.state.user.oneLogin': {
handler(val) { handler(val) {
console.log(val, 'oneLoginoneLoginoneLogin')
if (val) { if (val) {
this.$store.dispatch('setDatas', { name: 'oneLogin', data: false }) this.$store.dispatch('setDatas', { name: 'oneLogin', data: false })
this.startService() this.startService()
@@ -512,7 +510,6 @@ export default {
}, },
'$store.state.chat.isConnect': { '$store.state.chat.isConnect': {
handler(val) { handler(val) {
console.log(val, 'isConnect')
if (val) { if (val) {
this.$message({ this.$message({
message: '服务已连接', message: '服务已连接',
+8 -8
View File
@@ -244,7 +244,7 @@ export default {
case 1: case 1:
// 校准设备 // 校准设备
that that
.$confirm('确定执行校准设备操作吗?', '温馨提示', { .$confirm('请在打印机托盘放入一张光盘,点击确定后将自动校准打印机', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -269,7 +269,7 @@ export default {
case 2: case 2:
// 校准上光驱 // 校准上光驱
that that
.$confirm('确定执行校准上光驱操作吗?', '温馨提示', { .$confirm('请在上光驱放入一张光盘,点击确定后将自动校准上光驱', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -294,7 +294,7 @@ export default {
case 3: case 3:
// 校准下光驱 // 校准下光驱
that that
.$confirm('确定执行校准下光驱操作吗?', '温馨提示', { .$confirm('请在下光驱放入一张光盘,点击确定后将自动校准下光驱', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -319,7 +319,7 @@ export default {
case 4: case 4:
// 校准盘仓 // 校准盘仓
that that
.$confirm('确定执行校准盘仓操作吗?', '温馨提示', { .$confirm('请在左右进盘仓各放入一张光盘,点击确定后将自动校准盘仓', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -360,7 +360,7 @@ export default {
case 2: case 2:
// 自动设置光驱 // 自动设置光驱
that that
.$confirm('确定执行自动设置光驱操作吗?', '温馨提示', { .$confirm('请再左右盘仓至少放入一张光盘,点击确认后将自动设置上下光驱,如果自动设置失败请手动设置光驱', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -389,7 +389,7 @@ export default {
case 1: case 1:
// 重启设备 // 重启设备
that that
.$confirm('确定执行重启设备操作吗?', '温馨提示', { .$confirm('点击确定执行重启设备操作', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -412,7 +412,7 @@ export default {
case 2: case 2:
// 清除错误 // 清除错误
that that
.$confirm('确定执行清除错误操作吗?', '温馨提示', { .$confirm('点击确定执行清除错误操作', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -435,7 +435,7 @@ export default {
case 3: case 3:
// 进入运输模式 // 进入运输模式
that that
.$confirm('请确保已经取掉左右光盘仓托架,点击确定', '温馨提示', { .$confirm('请确保已经取掉左右光盘仓托架,点击确定后设备将进入运输模式', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'