Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fe339f317 | |||
| 0001ecc000 | |||
| 04ca328a67 | |||
| a6ce251509 | |||
| ff6df432ec | |||
| 741387aff2 | |||
| bfe8127ee8 | |||
| 01c8b05d30 | |||
| 6a4a448cfd | |||
| 5a48bf0237 |
+3
-1
@@ -26,7 +26,9 @@
|
||||
"output": "build"
|
||||
},
|
||||
"extraFiles": [
|
||||
"lib"
|
||||
"lib",
|
||||
"ProductionServer",
|
||||
"help"
|
||||
],
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
|
||||
+76
-8
@@ -1,4 +1,4 @@
|
||||
const { Menu, app, BrowserWindow } = require("electron");
|
||||
const { Menu, app, BrowserWindow, shell } = require("electron");
|
||||
// Note: Store should be handled in renderer process, not main
|
||||
// import "../renderer/store";
|
||||
const fs = require('fs');
|
||||
@@ -7,11 +7,14 @@ const path = require('path')
|
||||
// 导入录制器模块(设置全局变量)
|
||||
require('./recorder');
|
||||
// require("./fingerprint/win");
|
||||
// 获取应用根目录(兼容三端,与 exe 同级)
|
||||
// 开发环境:使用项目根目录
|
||||
// 生产环境:获取可执行文件所在目录(与 exe 同级,兼容 Windows/Linux/macOS)
|
||||
let root = "";
|
||||
if (process.env.NODE_ENV !== "development") {
|
||||
root = path.dirname(app.getPath("exe"));
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
root = path.join(__dirname, '../../');
|
||||
} else {
|
||||
root = "..\\..\\";
|
||||
root = path.dirname(app.getPath("exe"));
|
||||
}
|
||||
|
||||
// 获取日志文件的路径
|
||||
@@ -88,7 +91,63 @@ if (!gotTheLock) {
|
||||
}
|
||||
});
|
||||
}
|
||||
app.on("ready", createWindow);
|
||||
// 执行安装脚本(仅在首次安装时执行一次,兼容三端,无需额外权限)
|
||||
function runInstallScript() {
|
||||
const productionServerPath = path.join(root, "ProductionServer");
|
||||
const installFlagPath = path.join(productionServerPath, ".install_completed");
|
||||
|
||||
// 检查是否已执行过
|
||||
if (fs.existsSync(installFlagPath)) {
|
||||
console.log("安装脚本已执行过,跳过本次执行");
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据平台确定脚本文件名和命令(使用 sh 执行 .sh 文件无需执行权限)
|
||||
const scriptName = process.platform === "win32" ? "install.bat" : "install.sh";
|
||||
const installScriptPath = path.join(productionServerPath, scriptName);
|
||||
const execCommand = process.platform === "win32"
|
||||
? `"${installScriptPath}"`
|
||||
: `sh "${installScriptPath}"`; // 使用 sh 执行,无需执行权限
|
||||
|
||||
// 检查脚本是否存在
|
||||
if (!fs.existsSync(installScriptPath)) {
|
||||
console.log("安装脚本不存在: " + installScriptPath);
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行安装脚本
|
||||
console.log("首次安装,执行安装脚本: " + installScriptPath);
|
||||
writeLog(`首次安装,执行安装脚本: ${installScriptPath} (平台: ${process.platform})`);
|
||||
|
||||
child_process.exec(execCommand, { cwd: productionServerPath }, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error("安装脚本执行错误:", error);
|
||||
writeLog("安装脚本执行错误: " + error.message);
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行成功,创建标记文件
|
||||
try {
|
||||
fs.writeFileSync(installFlagPath, new Date().toISOString(), "utf-8");
|
||||
console.log("安装脚本执行完成");
|
||||
writeLog("安装脚本执行完成");
|
||||
if (stdout) console.log("输出:", stdout);
|
||||
if (stderr) console.error("错误输出:", stderr);
|
||||
} catch (writeErr) {
|
||||
console.error("创建安装标记文件失败:", writeErr);
|
||||
writeLog("创建安装标记文件失败: " + writeErr.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
app.on("ready", () => {
|
||||
// 在创建窗口后执行安装脚本
|
||||
createWindow();
|
||||
// 延迟执行安装脚本,确保应用已启动
|
||||
setTimeout(() => {
|
||||
runInstallScript();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
app.on("window-all-closed", () => {
|
||||
if (process.platform !== "darwin") {
|
||||
@@ -115,9 +174,18 @@ app.on("open-file", (e, filePath) => {
|
||||
preFilePath = filePath;
|
||||
});
|
||||
|
||||
ipcMain.on('open-help-file', event => {
|
||||
var exePath = path.dirname(app.getPath('exe'));
|
||||
child_process.exec(`start "" "${exePath}/help/User Manual.pdf"`);
|
||||
ipcMain.on('open-help-file', async event => {
|
||||
const helpFilePath = path.join(root, "help", "User Manual.pdf");
|
||||
|
||||
try {
|
||||
await shell.openPath(helpFilePath);
|
||||
} catch (error) {
|
||||
console.error("打开帮助文件错误:", error);
|
||||
writeLog("打开帮助文件错误: " + error.message);
|
||||
if (event.reply) {
|
||||
event.reply('open-help-file-error', error.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on("get-root", (event) => {
|
||||
|
||||
+42
-8
@@ -14,6 +14,14 @@ class ScreenRecorder {
|
||||
this.mainWindow = window;
|
||||
}
|
||||
|
||||
// 重置录制状态(用于前端初始化时清理可能的僵尸状态)
|
||||
resetRecording() {
|
||||
this.isRecording = false;
|
||||
this.recordedChunks = [];
|
||||
console.log('Recording state reset by renderer');
|
||||
return { success: true, message: 'State reset' };
|
||||
}
|
||||
|
||||
async startRecording() {
|
||||
if (this.isRecording) {
|
||||
return { success: false, message: '正在录制中' };
|
||||
@@ -45,7 +53,7 @@ class ScreenRecorder {
|
||||
}
|
||||
}
|
||||
|
||||
async stopRecording(videoData) {
|
||||
async stopRecording(videoData, taskId = '', customPath = null) {
|
||||
if (!this.isRecording) {
|
||||
return { success: false, message: '当前没有进行录制' };
|
||||
}
|
||||
@@ -53,18 +61,40 @@ class ScreenRecorder {
|
||||
try {
|
||||
this.isRecording = false;
|
||||
|
||||
// 确保videos目录存在 - 在应用根目录下
|
||||
// 获取应用根目录
|
||||
const appPath = process.env.NODE_ENV === 'development'
|
||||
? path.join(__dirname, '../../')
|
||||
: path.dirname(app.getPath('exe'));
|
||||
const videosDir = path.join(appPath, 'videos');
|
||||
|
||||
let videosDir;
|
||||
if (customPath) {
|
||||
// 如果是绝对路径直接使用,否则拼接应用根目录
|
||||
videosDir = path.isAbsolute(customPath)
|
||||
? customPath
|
||||
: path.join(appPath, customPath);
|
||||
} else {
|
||||
// 默认目录:应用根目录/videos
|
||||
videosDir = path.join(appPath, 'videos');
|
||||
}
|
||||
|
||||
if (!fs.existsSync(videosDir)) {
|
||||
fs.mkdirSync(videosDir, { recursive: true });
|
||||
}
|
||||
|
||||
// 生成文件名:soonworker+时间戳
|
||||
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, -5);
|
||||
const fileName = `soonworker_${timestamp}.webm`;
|
||||
// 生成文件名:任务ID_日期时间格式 (YYYYMMDD_HHmmss)
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const hours = String(now.getHours()).padStart(2, '0');
|
||||
const minutes = String(now.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(now.getSeconds()).padStart(2, '0');
|
||||
const dateTimeStr = `${year}${month}${day}_${hours}${minutes}${seconds}`;
|
||||
|
||||
// 如果有任务ID,使用任务ID_日期时间,否则使用日期时间
|
||||
const fileName = taskId
|
||||
? `${taskId}_${dateTimeStr}.webm`
|
||||
: `${dateTimeStr}.webm`;
|
||||
const filePath = path.join(videosDir, fileName);
|
||||
|
||||
// 将base64数据转换为Buffer并保存
|
||||
@@ -102,14 +132,18 @@ ipcMain.handle('start-recording', async () => {
|
||||
return await recorder.startRecording();
|
||||
});
|
||||
|
||||
ipcMain.handle('stop-recording', async (event, videoData) => {
|
||||
return await recorder.stopRecording(videoData);
|
||||
ipcMain.handle('stop-recording', async (event, videoData, taskId, customPath) => {
|
||||
return await recorder.stopRecording(videoData, taskId, customPath);
|
||||
});
|
||||
|
||||
ipcMain.handle('get-videos-path', () => {
|
||||
return recorder.getVideosPath();
|
||||
});
|
||||
|
||||
ipcMain.handle('reset-recording', async () => {
|
||||
return recorder.resetRecording();
|
||||
});
|
||||
|
||||
// 使用全局变量方式,避免webpack模块转换问题
|
||||
global.ScreenRecorderInstance = recorder;
|
||||
global.setMainWindow = (window) => recorder.setMainWindow(window);
|
||||
|
||||
@@ -1,45 +1,23 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="$t('networkAuth.title')"
|
||||
:visible.sync="visible"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:show-close="false"
|
||||
:append-to-body="true"
|
||||
:z-index="9999"
|
||||
>
|
||||
<el-dialog :title="$t('networkAuth.title')" :visible.sync="visible" width="600px" :close-on-click-modal="false"
|
||||
:close-on-press-escape="false" :show-close="false" :append-to-body="true" :z-index="9999">
|
||||
<div class="network-auth-content">
|
||||
<p class="auth-description">
|
||||
{{ $t('networkAuth.description') }}
|
||||
</p>
|
||||
|
||||
<div class="network-paths">
|
||||
<div
|
||||
v-for="(path, index) in networkPaths"
|
||||
:key="index"
|
||||
class="network-path-item"
|
||||
>
|
||||
<div v-for="(path, index) in networkPaths" :key="index" class="network-path-item">
|
||||
<div class="path-info">
|
||||
<span class="path-label">{{ $t('networkAuth.pathLabel') }}</span>
|
||||
<span class="path-value">{{ path.path }}</span>
|
||||
</div>
|
||||
|
||||
<div class="auth-fields">
|
||||
<el-input
|
||||
v-model="path.userName"
|
||||
:placeholder="$t('networkAuth.userName')"
|
||||
size="small"
|
||||
style="width: 150px; margin-right: 10px;"
|
||||
/>
|
||||
<el-input
|
||||
v-model="path.password"
|
||||
type="password"
|
||||
:placeholder="$t('networkAuth.password')"
|
||||
size="small"
|
||||
style="width: 150px;"
|
||||
show-password
|
||||
/>
|
||||
<el-input v-model="path.userName" :placeholder="$t('networkAuth.userName')" size="small"
|
||||
style="width: 150px; margin-right: 10px;" />
|
||||
<el-input v-model="path.password" type="password" :placeholder="$t('networkAuth.password')" size="small"
|
||||
style="width: 150px;" show-password />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -102,7 +80,7 @@ export default {
|
||||
this.$emit('confirm', netInfo)
|
||||
} catch (error) {
|
||||
console.error('保存网络认证信息失败:', error)
|
||||
this.$message.error('保存认证信息失败')
|
||||
this.$message.error(this.$t('networkAuth.authSaveFail'))
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
|
||||
+100
-140
@@ -6,13 +6,8 @@
|
||||
<div class="title">
|
||||
{{ $t("index.wordSpace") }}
|
||||
</div>
|
||||
<div
|
||||
class="card"
|
||||
v-for="(item, index) of infoData"
|
||||
:key="item.PrinterID"
|
||||
@click="() => (printData = index)"
|
||||
style="text-align: left"
|
||||
>
|
||||
<div class="card" v-for="(item, index) of infoData" :key="item.PrinterID" @click="() => (printData = index)"
|
||||
style="text-align: left">
|
||||
<span style="font-size: 18px; margin-left: 40px">{{
|
||||
getPrintName(item.PrinterID, true)
|
||||
}}</span>
|
||||
@@ -30,9 +25,7 @@
|
||||
<div :span="21" style="height: 100%; width: calc(100% - 164px)">
|
||||
<div class="grid-content bg-purple-light mid">
|
||||
<div class="toMain">
|
||||
<span style="margin-right: 20px"
|
||||
>{{ $t("admin.hello") }} {{ user }}</span
|
||||
>
|
||||
<span style="margin-right: 20px">{{ $t("admin.hello") }} {{ user }}</span>
|
||||
<router-link to="/main"> {{ $t("admin.home") }}</router-link>
|
||||
</div>
|
||||
|
||||
@@ -46,27 +39,11 @@
|
||||
<el-tab-pane :label="$t('admin.userManage')" name="second">
|
||||
<div class="brief">
|
||||
<el-row :gutter="20" style="height: 100%">
|
||||
<el-table
|
||||
:data="userData"
|
||||
style="width: 100%"
|
||||
:empty-text="$t('admin.nodata')"
|
||||
>
|
||||
<el-table-column
|
||||
prop="userUuid"
|
||||
label="ID"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
:label="$t('admin.userName')"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="userRole"
|
||||
:label="$t('admin.role')"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="time"
|
||||
:label="$t('admin.lastTime')"
|
||||
></el-table-column>
|
||||
<el-table :data="userData" style="width: 100%" :empty-text="$t('admin.nodata')">
|
||||
<el-table-column prop="userUuid" label="ID"></el-table-column>
|
||||
<el-table-column prop="userName" :label="$t('admin.userName')"></el-table-column>
|
||||
<el-table-column prop="userRole" :label="$t('admin.role')"></el-table-column>
|
||||
<el-table-column prop="time" :label="$t('admin.lastTime')"></el-table-column>
|
||||
<el-table-column prop="time" :label="$t('admin.online')">
|
||||
<template slot-scope="scope">
|
||||
{{
|
||||
@@ -79,26 +56,12 @@
|
||||
<!--<el-table-column prop="describe" label="描述"></el-table-column>-->
|
||||
<el-table-column width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="medium"
|
||||
@click="() => edit(scope.row)"
|
||||
>{{ $t("admin.edit") }}</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="medium"
|
||||
@click="adduserVisible = true"
|
||||
v-if="scope.row.userName == 'admin'"
|
||||
>{{ $t("admin.add") }}</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="medium"
|
||||
@click="() => deleted(scope.row)"
|
||||
v-if="scope.row.userName != 'admin'"
|
||||
>{{ $t("admin.delete") }}</el-button
|
||||
>
|
||||
<el-button type="text" size="medium" @click="() => edit(scope.row)">{{ $t("admin.edit")
|
||||
}}</el-button>
|
||||
<el-button type="text" size="medium" @click="adduserVisible = true"
|
||||
v-if="scope.row.userName == 'admin'">{{ $t("admin.add") }}</el-button>
|
||||
<el-button type="text" size="medium" @click="() => deleted(scope.row)"
|
||||
v-if="scope.row.userName != 'admin'">{{ $t("admin.delete") }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -116,47 +79,30 @@
|
||||
<div class="service">
|
||||
<div class="lable">{{ $t("admin.selectWorkstation") }}</div>
|
||||
<el-select v-model="workValue">
|
||||
<el-option
|
||||
v-for="(item, index) in infoData"
|
||||
:key="item.PrinterID"
|
||||
:label="getPrintName(item.PrinterID)"
|
||||
:value="item.PrinterID"
|
||||
:disabled="runningState"
|
||||
>
|
||||
<el-option v-for="(item, index) in infoData" :key="item.PrinterID"
|
||||
:label="getPrintName(item.PrinterID)" :value="item.PrinterID" :disabled="runningState">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<div class="lable">{{ $t("admin.formatType") }}</div>
|
||||
<el-select v-model="formatValue">
|
||||
<el-option
|
||||
v-for="item in formatOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:disabled="runningState"
|
||||
>
|
||||
<el-option v-for="item in formatOptions" :key="item.value" :label="item.label" :value="item.value"
|
||||
:disabled="runningState">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<div class="lable">{{ $t("admin.number") }}</div>
|
||||
<el-input
|
||||
v-model="number"
|
||||
:disabled="runningState"
|
||||
></el-input>
|
||||
<el-input v-model="number" :disabled="runningState"></el-input>
|
||||
</div>
|
||||
<el-button
|
||||
@click="
|
||||
<el-button @click="
|
||||
() => {
|
||||
running = 0;
|
||||
runningEmergy = false;
|
||||
isFormat = true;
|
||||
handleFormat();
|
||||
}
|
||||
"
|
||||
:loading="runningState && isFormat"
|
||||
:disabled="runningState && !isFormat"
|
||||
>{{ $t("work.submit") }}</el-button
|
||||
>
|
||||
" :loading="runningState && isFormat" :disabled="runningState && !isFormat">{{ $t("work.submit")
|
||||
}}</el-button>
|
||||
</div>
|
||||
|
||||
<div class="copy">
|
||||
@@ -167,41 +113,25 @@
|
||||
<div class="service">
|
||||
<div class="lable">{{ $t("admin.selectWorkstation") }}</div>
|
||||
<el-select v-model="workValue2">
|
||||
<el-option
|
||||
v-for="(item, index) in infoData"
|
||||
:key="index"
|
||||
:label="getPrintName(item.PrinterID)"
|
||||
:value="item.PrinterID"
|
||||
:disabled="runningState"
|
||||
>
|
||||
<el-option v-for="(item, index) in infoData" :key="index" :label="getPrintName(item.PrinterID)"
|
||||
:value="item.PrinterID" :disabled="runningState">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<div class="lable">{{ $t("admin.copyPath") }}</div>
|
||||
<el-input
|
||||
v-model="path"
|
||||
:disabled="runningState"
|
||||
></el-input>
|
||||
<el-input v-model="path" :disabled="runningState"></el-input>
|
||||
|
||||
<div class="lable">{{ $t("admin.number") }}</div>
|
||||
<el-input
|
||||
v-model="number2"
|
||||
:disabled="runningState"
|
||||
></el-input>
|
||||
<el-input v-model="number2" :disabled="runningState"></el-input>
|
||||
</div>
|
||||
<el-button
|
||||
:loading="runningState && !isFormat"
|
||||
:disabled="runningState && isFormat"
|
||||
@click="
|
||||
<el-button :loading="runningState && !isFormat" :disabled="runningState && isFormat" @click="
|
||||
() => {
|
||||
running = 0;
|
||||
runningEmergy = false;
|
||||
isFormat = false;
|
||||
handleCopy();
|
||||
}
|
||||
"
|
||||
>{{ $t("work.submit") }}</el-button
|
||||
>
|
||||
">{{ $t("work.submit") }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
@@ -235,49 +165,22 @@
|
||||
<div class="wLog" v-html="wlog" style="text-align: left"></div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:title="$t('admin.addUser')"
|
||||
:visible.sync="adduserVisible"
|
||||
width="450px"
|
||||
class="infdialog"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<adduser
|
||||
:changevisiable="this.chageAdduservisible"
|
||||
v-if="adduserVisible"
|
||||
></adduser>
|
||||
<el-dialog :title="$t('admin.addUser')" :visible.sync="adduserVisible" width="450px" class="infdialog"
|
||||
destroy-on-close :close-on-click-modal="false">
|
||||
<adduser :changevisiable="this.chageAdduservisible" v-if="adduserVisible"></adduser>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:title="$t('admin.editUser')"
|
||||
:visible.sync="edituserVisible"
|
||||
width="450px"
|
||||
class="infdialog"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<edituser
|
||||
:changevisiable="this.chageEdituservisible"
|
||||
v-if="edituserVisible"
|
||||
:data="editData"
|
||||
@editover="
|
||||
<el-dialog :title="$t('admin.editUser')" :visible.sync="edituserVisible" width="450px" class="infdialog"
|
||||
destroy-on-close :close-on-click-modal="false">
|
||||
<edituser :changevisiable="this.chageEdituservisible" v-if="edituserVisible" :data="editData" @editover="
|
||||
() => {
|
||||
chageEdituservisible(false);
|
||||
getUserData();
|
||||
}
|
||||
"
|
||||
></edituser>
|
||||
"></edituser>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:title="$t('admin.copying')"
|
||||
:visible.sync="copyVisible"
|
||||
width="450px"
|
||||
>
|
||||
<el-progress
|
||||
:percentage="parseInt(copyState.progress * 100)"
|
||||
v-if="copyVisible"
|
||||
></el-progress>
|
||||
<el-dialog :title="$t('admin.copying')" :visible.sync="copyVisible" width="450px">
|
||||
<el-progress :percentage="parseInt(copyState.progress * 100)" v-if="copyVisible"></el-progress>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -513,6 +416,11 @@ export default {
|
||||
method: "get",
|
||||
url: "/web/get_printer_info",
|
||||
}).then((res) => {
|
||||
if (!res.data || !res.data.printerList) {
|
||||
console.warn('获取工作站列表返回的数据格式不正确:', res)
|
||||
this.infoData = []
|
||||
return
|
||||
}
|
||||
this.infoData = res.data.printerList;
|
||||
this.workValue2 = this.workValue =
|
||||
res.data.printerList.length > 0
|
||||
@@ -527,6 +435,10 @@ export default {
|
||||
this.DualSide = 1; //只要有一个是双面就是1
|
||||
}
|
||||
}
|
||||
}).catch((e) => {
|
||||
console.error('获取工作站列表失败:', e)
|
||||
this.infoData = []
|
||||
this.$message.error('获取工作站列表失败,请检查网络连接')
|
||||
});
|
||||
},
|
||||
runCheckState() {
|
||||
@@ -561,8 +473,7 @@ export default {
|
||||
//阻止即将发生的事件
|
||||
this.runningEmergy = true;
|
||||
appendLog(
|
||||
`Task ${this.running + 1}/${
|
||||
this.isFormat ? this.number : this.number2
|
||||
`Task ${this.running + 1}/${this.isFormat ? this.number : this.number2
|
||||
} failed, Error = ${data.printer_status}`,
|
||||
this.root
|
||||
);
|
||||
@@ -884,7 +795,7 @@ export default {
|
||||
);
|
||||
await this.$axios({
|
||||
method: "post",
|
||||
url: `/admin/format_disk_notype?drive_path=${disk[0]}:&drive_type=${this.formatValue}`,
|
||||
url: `/admin/format_disk?drive_path=${disk[0]}:&drive_type=${this.formatValue}`,
|
||||
})
|
||||
.then((res) => {
|
||||
//正常格式化
|
||||
@@ -1032,42 +943,50 @@ export default {
|
||||
/deep/ .el-tabs__content {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.infdialog {
|
||||
/deep/.el-dialog {
|
||||
padding: 20px 0px;
|
||||
}
|
||||
|
||||
/deep/.el-dialog__header {
|
||||
padding: 0px;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/deep/.el-dialog__body {
|
||||
margin-top: 30px;
|
||||
padding: 0px;
|
||||
}
|
||||
/deep/.el-dialog__title {
|
||||
}
|
||||
|
||||
/deep/.el-dialog__title {}
|
||||
}
|
||||
|
||||
.wLog {
|
||||
max-height: 600px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #42b983;
|
||||
}
|
||||
|
||||
.left {
|
||||
background-color: #e8e7ee;
|
||||
height: 100%;
|
||||
@@ -1076,10 +995,12 @@ a {
|
||||
box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
|
||||
.title {
|
||||
color: #999999;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #f5f5f5;
|
||||
height: 50px;
|
||||
@@ -1100,36 +1021,45 @@ a {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
|
||||
.tabs {
|
||||
height: 100%;
|
||||
|
||||
/deep/.el-tabs__header {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
/deep/ .el-tabs__content {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
/*滚动条整体样式*/
|
||||
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
width: 10px;
|
||||
/*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
background: #c7c7cb;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
/*滚动条里面轨道*/
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 10px;
|
||||
background: #ededed;
|
||||
}
|
||||
|
||||
.system {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.App {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
@@ -1139,10 +1069,12 @@ a {
|
||||
box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
|
||||
.format {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
border-bottom: 1px rgb(224, 224, 224) solid;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
width: 150px;
|
||||
@@ -1155,6 +1087,7 @@ a {
|
||||
background-color: rgb(240, 240, 240);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 14px;
|
||||
padding: 10px;
|
||||
@@ -1163,22 +1096,27 @@ a {
|
||||
align-items: center;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.service {
|
||||
height: 150px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
|
||||
.lable {
|
||||
margin: 20px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-button {
|
||||
color: rgb(154, 202, 128);
|
||||
width: 120px;
|
||||
@@ -1189,12 +1127,15 @@ a {
|
||||
float: right;
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
.el-button:hover {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.el-button:active {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.el-button:focus {
|
||||
background-color: white;
|
||||
}
|
||||
@@ -1204,6 +1145,7 @@ a {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
border-bottom: 1px rgb(224, 224, 224) solid;
|
||||
|
||||
.title {
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
@@ -1217,6 +1159,7 @@ a {
|
||||
background-color: rgb(240, 240, 240);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 14px;
|
||||
padding: 10px;
|
||||
@@ -1224,22 +1167,27 @@ a {
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.service {
|
||||
height: 150px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
|
||||
.lable {
|
||||
margin: 20px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-button {
|
||||
color: rgb(154, 202, 128);
|
||||
width: 120px;
|
||||
@@ -1250,21 +1198,26 @@ a {
|
||||
float: right;
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
.el-button:hover {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.el-button:active {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.el-button:focus {
|
||||
background-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dispose {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.brief {
|
||||
height: 90%;
|
||||
width: 100%;
|
||||
@@ -1274,10 +1227,12 @@ a {
|
||||
box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
|
||||
.el-table {
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.add-button {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
@@ -1286,6 +1241,7 @@ a {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
background-color: #c8cfd7;
|
||||
height: 100%;
|
||||
@@ -1295,10 +1251,12 @@ a {
|
||||
box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
|
||||
.title {
|
||||
color: #999999;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.log {
|
||||
padding: 20px;
|
||||
font-size: 18px;
|
||||
@@ -1311,11 +1269,13 @@ a {
|
||||
-moz-box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.toMain {
|
||||
position: absolute;
|
||||
right: 200px;
|
||||
font-size: 16px;
|
||||
z-index: 1;
|
||||
|
||||
.link {
|
||||
color: blue;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -4,12 +4,7 @@
|
||||
<div class="row">
|
||||
<div class="lable">LogLevel</div>
|
||||
<el-select v-model="iniData.LogLevel">
|
||||
<el-option
|
||||
v-for="item in LogLevelOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-option v-for="item in LogLevelOptions" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div class="tips">{{ $t("dispose.infoTips") }}</div>
|
||||
@@ -17,12 +12,7 @@
|
||||
<div class="row">
|
||||
<div class="lable">AutoRetryTimes</div>
|
||||
<el-select v-model="iniData.AutoRetryTimes">
|
||||
<el-option
|
||||
v-for="item in autoRetryOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-option v-for="item in autoRetryOptions" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div class="tips">{{ $t("dispose.errorTips1") }}</div>
|
||||
@@ -43,245 +33,138 @@
|
||||
<div class="row">
|
||||
<div class="lable">RejectConfig</div>
|
||||
<div class="switch">
|
||||
<el-switch v-model="iniData.RejectConfig"></el-switch>
|
||||
<el-switch v-model="iniData.RejectConfig" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</div>
|
||||
<div class="tips">{{ $t("dispose.tips1") }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="lable">StopOnFailure</div>
|
||||
<div class="switch">
|
||||
<el-switch v-model="iniData.StopOnFailure"></el-switch>
|
||||
<el-switch v-model="iniData.StopOnFailure" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</div>
|
||||
<div class="tips">{{ $t("dispose.errorTips2") }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="lable">KeepCombinedImage</div>
|
||||
<div class="switch">
|
||||
<el-switch v-model="iniData.KeepCombinedImage"></el-switch>
|
||||
<el-switch v-model="iniData.KeepCombinedImage" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</div>
|
||||
<div class="tips">{{ $t("dispose.isReserveimg") }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="lable">CleanTaskFile</div>
|
||||
<div class="switch">
|
||||
<el-switch v-model="iniData.CleanTaskFile"></el-switch>
|
||||
<el-switch v-model="iniData.CleanTaskFile" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</div>
|
||||
<div class="tips">{{ $t("dispose.isReservetask") }}</div>
|
||||
</div>
|
||||
<div
|
||||
class="row"
|
||||
style="
|
||||
<div class="row" style="
|
||||
align-items: start;
|
||||
height: 50px;
|
||||
border-bottom: 1px rgb(224, 224, 224) solid;
|
||||
"
|
||||
>
|
||||
">
|
||||
<div class="lable">UploadSharedDir</div>
|
||||
<div class="switch">
|
||||
<el-switch v-model="iniData.UploadSharedDir"></el-switch>
|
||||
<el-switch v-model="iniData.UploadSharedDir" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</div>
|
||||
<div class="tips">{{ $t("dispose.isUpload") }}</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="row"
|
||||
style="
|
||||
<div class="row">
|
||||
<div class="lable">AuthorizationCode</div>
|
||||
<el-input v-model="iniData.AuthorizationCode" :placeholder="$t('dispose.authCodePlaceholder')"></el-input>
|
||||
<div class="tips">{{ $t("dispose.authCodeTips") }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="
|
||||
align-items: flex-start;
|
||||
justify-content: flex-end;
|
||||
margin-top: 40px;
|
||||
margin-right: 40px;
|
||||
height: 300px;
|
||||
"
|
||||
>
|
||||
">
|
||||
<el-button @click="save">{{ $t("work.submit") }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const { ipcRenderer } = require("electron");
|
||||
var fs = require("fs"),
|
||||
ini = require("ini");
|
||||
export default {
|
||||
name: "dispose",
|
||||
data() {
|
||||
return {
|
||||
autoRetryOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: "0",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "1",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: "2",
|
||||
},
|
||||
{ value: 0, label: "0" },
|
||||
{ value: 1, label: "1" },
|
||||
{ value: 2, label: "2" },
|
||||
],
|
||||
LogLevelOptions: [
|
||||
{
|
||||
value: "TRACE",
|
||||
label: "TRACE",
|
||||
},
|
||||
{
|
||||
value: "DEBUG",
|
||||
label: "DEBUG",
|
||||
},
|
||||
{
|
||||
value: "INFO",
|
||||
label: "INFO",
|
||||
},
|
||||
{
|
||||
value: "WARNING",
|
||||
label: "WARNING",
|
||||
},
|
||||
{
|
||||
value: "ERROR",
|
||||
label: "ERROR",
|
||||
},
|
||||
{
|
||||
value: "FATAL",
|
||||
label: "FATAL",
|
||||
},
|
||||
{ value: "TRACE", label: "TRACE" },
|
||||
{ value: "DEBUG", label: "DEBUG" },
|
||||
{ value: "INFO", label: "INFO" },
|
||||
{ value: "WARNING", label: "WARNING" },
|
||||
{ value: "ERROR", label: "ERROR" },
|
||||
{ value: "FATAL", label: "FATAL" },
|
||||
],
|
||||
iniData: null,
|
||||
|
||||
AutoRetryTimes: null,
|
||||
LogLevel: "TRACE",
|
||||
TaskDir: null,
|
||||
SharedDir: null,
|
||||
RejectConfig: false,
|
||||
StopOnFailure: false,
|
||||
KeepCombinedImage: false,
|
||||
CleanTaskFile: false,
|
||||
iniData: {
|
||||
LogLevel: "INFO",
|
||||
AutoRetryTimes: 0,
|
||||
TaskDir: "",
|
||||
SharedDir: "",
|
||||
RejectConfig: 0,
|
||||
StopOnFailure: 0,
|
||||
KeepCombinedImage: 0,
|
||||
CleanTaskFile: 0,
|
||||
UploadSharedDir: 0,
|
||||
AuthorizationCode: "",
|
||||
DeleteTask: 0 // Ensure this is preserved if present in API
|
||||
},
|
||||
show: true,
|
||||
root: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
save() {
|
||||
//console.log(this.iniData);
|
||||
//console.log(ini.stringify(this.iniData));
|
||||
//fs.writeFileSync("../Debug/config.ini");
|
||||
let that = this;
|
||||
fs.writeFile(
|
||||
this.root + "/../ProductionServer/config.ini",
|
||||
ini.stringify(this.iniData),
|
||||
function (err) {
|
||||
if (err) {
|
||||
that.$message.error(that.$t("dispose.errorReserve"));
|
||||
// 获取配置
|
||||
getConfig() {
|
||||
this.$axios.get('/web/get_config')
|
||||
.then(res => {
|
||||
if (res && res.data) {
|
||||
// 合并数据,确保所有字段都存在
|
||||
this.iniData = { ...this.iniData, ...res.data.data };
|
||||
} else {
|
||||
that.$message({
|
||||
type: "success",
|
||||
message: that.$t("dispose.successReserve"),
|
||||
this.$message.error(this.$t("dispose.errorRead"));
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.$message.error(this.$t("dispose.errorRead"));
|
||||
});
|
||||
},
|
||||
save() {
|
||||
// 构造 query string
|
||||
let params = [];
|
||||
for (let key in this.iniData) {
|
||||
if (this.iniData.hasOwnProperty(key)) {
|
||||
// 使用 encodeURIComponent 确保特殊字符正确传输
|
||||
params.push(`${key}=${encodeURIComponent(this.iniData[key])}`);
|
||||
}
|
||||
}
|
||||
);
|
||||
const queryString = params.join('&');
|
||||
|
||||
this.$axios.post(`/web/update_config?${queryString}`)
|
||||
.then(res => {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: this.$t("dispose.successReserve"),
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.$message.error(this.$t("dispose.errorReserve"));
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
//var data = ini.parse(fs.readFileSync("F:\\controll\\config.ini", "utf-8"));
|
||||
ipcRenderer.on("get-root-callback", (event, data) => {
|
||||
this.root = data;
|
||||
fs.readFile(this.root + "/../ProductionServer/config.ini", "utf-8", (err, res) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
this.$message.error(that.$t("dispose.errorRead"));
|
||||
this.show = false;
|
||||
} else {
|
||||
console.log(res);
|
||||
let data = ini.parse(res);
|
||||
console.log(data);
|
||||
this.iniData = data;
|
||||
that.iniData.AutoRetryTimes = data.AutoRetryTimes
|
||||
? data.AutoRetryTimes
|
||||
: 0;
|
||||
that.iniData.TaskDir = data.TaskDir ? data.TaskDir : "";
|
||||
that.iniData.SharedDir = data.SharedDir ? data.SharedDir : "";
|
||||
that.iniData.LogLevel = data.LogLevel ? data.LogLevel : "";
|
||||
that.iniData.CleanTaskFile =
|
||||
data.CleanTaskFile == "true" ||
|
||||
data.CleanTaskFile == "True" ||
|
||||
data.CleanTaskFile
|
||||
? true
|
||||
: false;
|
||||
that.iniData.KeepCombinedImage =
|
||||
data.KeepCombinedImage == "true" ||
|
||||
data.KeepCombinedImage == "True" ||
|
||||
data.KeepCombinedImage
|
||||
? true
|
||||
: false;
|
||||
that.iniData.RejectConfig =
|
||||
data.RejectConfig == "true" ||
|
||||
data.RejectConfig == "True" ||
|
||||
data.RejectConfig
|
||||
? true
|
||||
: false;
|
||||
that.iniData.StopOnFailure =
|
||||
data.StopOnFailure == "true" ||
|
||||
data.StopOnFailure == "True" ||
|
||||
data.StopOnFailure
|
||||
? true
|
||||
: false;
|
||||
that.iniData.UploadSharedDir =
|
||||
data.UploadSharedDir == "true" ||
|
||||
data.UploadSharedDir == "True" ||
|
||||
data.UploadSharedDir
|
||||
? true
|
||||
: false;
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
ipcRenderer.send("get-root");
|
||||
|
||||
//iniparser.parse("../Debug/config.ini", function (err, data) {
|
||||
/*
|
||||
AutoRetryTimes: "0"
|
||||
CardsoonModel: "SF80"
|
||||
CleanTaskFile: "false"
|
||||
RejectConfig: "false"
|
||||
KeepCombinedImage: "True"
|
||||
LogLevel: "DEBUG"
|
||||
SharedDir: "C:\\CardSoonRepo"
|
||||
StopOnFailure: "false"
|
||||
SystemSn: "830001"
|
||||
TaskDir: "C:\\PrintTasks"
|
||||
Version: "V3.1"
|
||||
|
||||
iniparser.parse("F:\\controll\\config.ini", function (err, data) {
|
||||
console.log(err);
|
||||
if (err) {
|
||||
that.$message.error("读取配置文件失败!");
|
||||
} else {
|
||||
console.log(data);
|
||||
that.AutoRetryTimes = data.AutoRetryTimes ? data.AutoRetryTimes : 0;
|
||||
that.TaskDir = data.TaskDir ? data.TaskDir : "";
|
||||
that.SharedDir = data.SharedDir ? data.SharedDir : "";
|
||||
that.LogLevel = data.LogLevel ? data.LogLevel : "";
|
||||
that.CleanTaskFile =
|
||||
data.CleanTaskFile == "true" || data.CleanTaskFile == "True"
|
||||
? true
|
||||
: false;
|
||||
that.KeepCombinedImage =
|
||||
data.KeepCombinedImage == "true" || data.KeepCombinedImage == "True"
|
||||
? true
|
||||
: false;
|
||||
that.RejectConfig =
|
||||
data.RejectConfig == "true" || data.RejectConfig == "True"
|
||||
? true
|
||||
: false;
|
||||
that.StopOnFailure =
|
||||
data.StopOnFailure == "true" || data.StopOnFailure == "True"
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
});
|
||||
*/
|
||||
this.getConfig();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -298,6 +181,7 @@ export default {
|
||||
-moz-box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
@@ -310,38 +194,45 @@ export default {
|
||||
align-items: center;
|
||||
background-color: rgb(240, 240, 240);
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
|
||||
.lable {
|
||||
width: 200px;
|
||||
margin-left: 20px;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 200px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
width: 200px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.switch {
|
||||
display: flex;
|
||||
margin-left: 20px;
|
||||
justify-content: flex-start;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 14px;
|
||||
margin-left: 20px;
|
||||
width: calc(100% - 440px);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
color: rgb(154, 202, 128);
|
||||
width: 120px;
|
||||
@@ -350,12 +241,15 @@ export default {
|
||||
border-radius: 1px;
|
||||
box-shadow: 1px 0px 2px 0px grey;
|
||||
}
|
||||
|
||||
.el-button:hover {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.el-button:active {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.el-button:focus {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
@@ -13,39 +13,19 @@
|
||||
<fileEmpty v-if="allNumber == 0" />
|
||||
<fileList v-else :list="filesList" :del="delFile" :key="key" />
|
||||
<div v-if="progressVisible">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
width="500px"
|
||||
:visible.sync="progressVisible"
|
||||
:append-to-body="true"
|
||||
class="prodialog"
|
||||
>
|
||||
<progressdialog
|
||||
:list="filesList"
|
||||
:overNumber="overNumber"
|
||||
:allNumber="allNumber"
|
||||
:changevisiable="changeProgressvisible"
|
||||
:changestate="changestate"
|
||||
:isSucess="isSucess"
|
||||
ref="progressdialog"
|
||||
></progressdialog>
|
||||
<el-dialog :close-on-click-modal="false" width="500px" :visible.sync="progressVisible" :append-to-body="true"
|
||||
class="prodialog">
|
||||
<progressdialog :list="filesList" :overNumber="overNumber" :allNumber="allNumber"
|
||||
:changevisiable="changeProgressvisible" :changestate="changestate" :isSucess="isSucess" ref="progressdialog">
|
||||
</progressdialog>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<div v-if="archiverVisible">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
width="500px"
|
||||
:visible.sync="archiverVisible"
|
||||
:append-to-body="true"
|
||||
class="archiverDialog"
|
||||
:show-close="false"
|
||||
>
|
||||
<archiverdialog
|
||||
:isOver="archiverIsover"
|
||||
:isFalse="archiverIsfalse"
|
||||
:changevisiable="changeArchivervisible"
|
||||
></archiverdialog>
|
||||
<el-dialog :close-on-click-modal="false" width="500px" :visible.sync="archiverVisible" :append-to-body="true"
|
||||
class="archiverDialog" :show-close="false">
|
||||
<archiverdialog :isOver="archiverIsover" :isFalse="archiverIsfalse" :changevisiable="changeArchivervisible">
|
||||
</archiverdialog>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<slot></slot>
|
||||
@@ -369,7 +349,11 @@ export default {
|
||||
entries.forEach((f) => this.fileBack(f, false));
|
||||
}
|
||||
} else if (file_form == 1) {
|
||||
//电子光盘
|
||||
// 电子光盘:不需要拷贝,直接标记为完成
|
||||
this.overNumber = 0;
|
||||
for (const file of entries) {
|
||||
this.fileBack(file, true);
|
||||
}
|
||||
} else if (file_form == 2) {
|
||||
//zip
|
||||
this.archiverIsover = false;
|
||||
@@ -384,7 +368,11 @@ export default {
|
||||
let password = "123456";
|
||||
zip(this.filesList, this.zip_path, this.archiverBack, true, password);
|
||||
} else if (file_form == 4) {
|
||||
//u盘
|
||||
// 禁拷贝U盘:不需要拷贝,直接标记为完成
|
||||
this.overNumber = 0;
|
||||
for (const file of entries) {
|
||||
this.fileBack(file, true);
|
||||
}
|
||||
} else {
|
||||
// 默认路径上传:不实际拷贝,仅回调推进流程
|
||||
this.overNumber = 0;
|
||||
@@ -476,11 +464,13 @@ export default {
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.archiverDialog {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
/deep/.el-dialog__header {
|
||||
padding: 10px;
|
||||
}
|
||||
@@ -488,12 +478,15 @@ export default {
|
||||
|
||||
.files {
|
||||
width: 100%;
|
||||
background-color: #f5f5f5;
|
||||
margin: 10px auto 0;
|
||||
background-color: transparent;
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: none;
|
||||
position: relative;
|
||||
height: 375px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div :style="'background-image:url(' + bgi + ');background-repeat: no-repeat;background-position: 50% 50%;'" class="empty"></div>
|
||||
<div :style="'background-image:url(' + bgi + ');background-repeat: no-repeat;background-position: 50% 50%;'"
|
||||
class="empty"></div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
@@ -20,7 +21,7 @@ export default {
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style lang="less" scoped>
|
||||
.empty {
|
||||
height: 345px;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -27,21 +27,25 @@ export default {
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style lang="less" scoped>
|
||||
.list {
|
||||
height: 374px;
|
||||
max-height: 374px;
|
||||
flex: 1;
|
||||
height: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
/*滚动条整体样式*/
|
||||
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
width: 10px;
|
||||
/*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
background: #c7c7cb;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
/*滚动条里面轨道*/
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<template>
|
||||
<div class="dialog">
|
||||
<div class="progress">
|
||||
<el-progress
|
||||
:percentage="parseInt(fake.progress * 100)"
|
||||
:format="format"
|
||||
></el-progress>
|
||||
<el-progress :percentage="Math.min(100, Math.max(0, parseInt(fake.progress * 100) || 0))"
|
||||
:format="format"></el-progress>
|
||||
<div class="txt">
|
||||
<div class="over">{{ overNumber }}</div>
|
||||
<div class="all">/{{ allNumber }}</div>
|
||||
@@ -26,20 +24,10 @@
|
||||
</div>
|
||||
<div v-else-if="!isSucess" style="color: red">文件上传失败!!!</div>
|
||||
<div class="button">
|
||||
<el-button
|
||||
ref="btnStop"
|
||||
type="success"
|
||||
@click="stop()"
|
||||
:disabled="overNumber == allNumber || !isSucess"
|
||||
>{{ $t("dialog.stop") }}</el-button
|
||||
>
|
||||
<el-button
|
||||
ref="btnOver"
|
||||
type="success"
|
||||
@click="changevisiable(flase)"
|
||||
:disabled="overNumber != allNumber && isSucess"
|
||||
>{{ $t("dialog.over") }}</el-button
|
||||
>
|
||||
<el-button ref="btnStop" type="success" @click="stop()" :disabled="overNumber == allNumber || !isSucess">{{
|
||||
$t("dialog.stop") }}</el-button>
|
||||
<el-button ref="btnOver" type="success" @click="changevisiable(flase)"
|
||||
:disabled="overNumber != allNumber && isSucess">{{ $t("dialog.over") }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -83,15 +71,17 @@ export default {
|
||||
getPercent(num, total) {
|
||||
num = parseFloat(num);
|
||||
total = parseFloat(total);
|
||||
if (isNaN(num) || isNaN(total)) {
|
||||
return "-";
|
||||
if (isNaN(num) || isNaN(total) || total <= 0) {
|
||||
return 0;
|
||||
}
|
||||
return total <= 0 ? "0" : Math.round((num / total) * 10000) / 10000.0;
|
||||
let per = num / total;
|
||||
return per > 1 ? 1 : per;
|
||||
},
|
||||
stop() {
|
||||
this.changestate(false);
|
||||
this.isSucess = false;
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("dialog.haveStop"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -157,16 +147,17 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.dialog {
|
||||
}
|
||||
.progress {
|
||||
|
||||
// border: 1px black solid;
|
||||
/deep/ .el-progress-bar {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
/deep/.el-progress__text {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.txt {
|
||||
position: absolute;
|
||||
top: 55px;
|
||||
@@ -183,6 +174,7 @@ export default {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.all {
|
||||
// border: 1px black solid;
|
||||
color: black;
|
||||
@@ -194,17 +186,21 @@ export default {
|
||||
.records {
|
||||
max-height: 400px;
|
||||
overflow: auto;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
/*滚动条整体样式*/
|
||||
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
width: 10px;
|
||||
/*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
background: #c7c7cb;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
/*滚动条里面轨道*/
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
@@ -212,13 +208,15 @@ export default {
|
||||
background: #ededed;
|
||||
}
|
||||
}
|
||||
|
||||
.record {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
.name {
|
||||
}
|
||||
|
||||
|
||||
|
||||
.state {
|
||||
margin-right: 20px;
|
||||
}
|
||||
@@ -228,6 +226,7 @@ export default {
|
||||
height: 30px;
|
||||
width: 100%;
|
||||
margin-top: 15px;
|
||||
|
||||
.button {
|
||||
float: right;
|
||||
display: flex;
|
||||
@@ -235,6 +234,7 @@ export default {
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
width: 50%;
|
||||
|
||||
.el-button {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -243,6 +243,7 @@ export default {
|
||||
width: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
line-height: 30px;
|
||||
float: left;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+222
-519
File diff suppressed because it is too large
Load Diff
@@ -1,24 +1,18 @@
|
||||
<template>
|
||||
<div class="screen-recorder">
|
||||
<el-tooltip
|
||||
:content="isRecording ? $t('recorder.stopRecording') : $t('recorder.startRecording')"
|
||||
placement="top">
|
||||
<el-button
|
||||
size="medium"
|
||||
:type="isRecording ? 'danger' : 'primary'"
|
||||
:icon="isRecording ? 'el-icon-video-pause' : 'el-icon-video-camera'"
|
||||
circle
|
||||
@click="toggleRecording"
|
||||
:loading="loading"
|
||||
class="record-btn"
|
||||
>
|
||||
<template v-if="!statusOnly">
|
||||
<el-tooltip :content="isRecording ? $t('recorder.stopRecording') : $t('recorder.startRecording')" placement="top">
|
||||
<el-button size="medium" :type="isRecording ? 'danger' : 'primary'"
|
||||
:icon="isRecording ? 'el-icon-switch-button' : 'el-icon-video-camera'" circle @click="toggleRecording"
|
||||
:loading="loading" class="record-btn">
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- 录制状态指示器 -->
|
||||
<div v-if="isRecording" class="recording-indicator">
|
||||
<div v-if="isRecording" class="recording-indicator" :class="{ 'status-only': statusOnly }">
|
||||
<span class="recording-dot"></span>
|
||||
<span class="recording-text">{{ recordingTime }}</span>
|
||||
<span class="recording-text">{{ statusOnly ? $t('recorder.recording') : recordingTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -28,6 +22,16 @@ const { ipcRenderer } = require('electron');
|
||||
|
||||
export default {
|
||||
name: 'ScreenRecorder',
|
||||
props: {
|
||||
taskId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
statusOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isRecording: false,
|
||||
@@ -37,7 +41,11 @@ export default {
|
||||
startTime: null,
|
||||
recordingTime: '00:00',
|
||||
timer: null,
|
||||
stream: null
|
||||
stream: null,
|
||||
currentTaskId: '', // 录屏开始时的任务ID
|
||||
autoSave: true, // 是否在停止时保存
|
||||
videoPath: '', // 录制视频的绝对路径
|
||||
customSavePath: '' // 存储启动时传入的保存路径
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -49,8 +57,9 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async startRecording() {
|
||||
async startRecording(options = {}) {
|
||||
this.loading = true;
|
||||
this.autoSave = true;
|
||||
|
||||
try {
|
||||
// 调用主进程开始录制
|
||||
@@ -79,6 +88,7 @@ export default {
|
||||
|
||||
this.stream = stream;
|
||||
this.recordedChunks = [];
|
||||
this.customSavePath = options.savePath || ''; // 保存自定义路径
|
||||
|
||||
// 创建MediaRecorder
|
||||
this.mediaRecorder = new MediaRecorder(stream, {
|
||||
@@ -92,32 +102,53 @@ export default {
|
||||
};
|
||||
|
||||
this.mediaRecorder.onstop = async () => {
|
||||
await this.saveRecording();
|
||||
if (this.autoSave) {
|
||||
await this.saveRecording(this.customSavePath); // 使用保存的路径
|
||||
}
|
||||
this.recordedChunks = [];
|
||||
};
|
||||
|
||||
// 开始录制
|
||||
this.mediaRecorder.start();
|
||||
this.isRecording = true;
|
||||
this.startTime = Date.now();
|
||||
// 保存录屏开始时的任务ID
|
||||
this.currentTaskId = this.taskId || '';
|
||||
this.startTimer();
|
||||
|
||||
this.$message.success(this.$t('recorder.recordingStarted') || '开始录制');
|
||||
this.$message.success(this.$t('recorder.recordingStarted'));
|
||||
this.$emit('recording-started');
|
||||
|
||||
} catch (error) {
|
||||
console.error('启动录制失败:', error);
|
||||
this.$message.error(this.$t('recorder.startFailed') || '启动录制失败');
|
||||
this.$message.error(this.$t('recorder.startFailed'));
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
|
||||
async stopRecording() {
|
||||
async stopRecording(save = true) {
|
||||
this.loading = true;
|
||||
this.autoSave = save;
|
||||
|
||||
try {
|
||||
if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {
|
||||
// 创建 Promise 等待 onstop 回调完成
|
||||
await new Promise((resolve) => {
|
||||
// 保存原有的 onstop 处理器
|
||||
const originalOnStop = this.mediaRecorder.onstop;
|
||||
|
||||
// 包装 onstop,在原处理器完成后 resolve
|
||||
this.mediaRecorder.onstop = async (event) => {
|
||||
if (originalOnStop) {
|
||||
await originalOnStop.call(this, event);
|
||||
}
|
||||
resolve();
|
||||
};
|
||||
|
||||
// 触发 stop 事件
|
||||
this.mediaRecorder.stop();
|
||||
});
|
||||
}
|
||||
|
||||
// 停止所有轨道
|
||||
@@ -132,17 +163,23 @@ export default {
|
||||
|
||||
} catch (error) {
|
||||
console.error('停止录制失败:', error);
|
||||
this.$message.error(this.$t('recorder.stopFailed') || '停止录制失败');
|
||||
this.$message.error(this.$t('recorder.stopFailed'));
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
|
||||
async saveRecording() {
|
||||
async cancelRecording() {
|
||||
await this.stopRecording(false);
|
||||
this.$message.info(this.$t('recorder.recordingCanceled'));
|
||||
},
|
||||
|
||||
async saveRecording(customPath) {
|
||||
if (this.recordedChunks.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
// 将录制的数据块合并为Blob
|
||||
const blob = new Blob(this.recordedChunks, {
|
||||
@@ -152,24 +189,37 @@ export default {
|
||||
// 转换为base64
|
||||
const reader = new FileReader();
|
||||
reader.onloadend = async () => {
|
||||
if (this._isDestroyed) return;
|
||||
try {
|
||||
const base64data = reader.result;
|
||||
|
||||
// 发送到主进程保存
|
||||
const result = await ipcRenderer.invoke('stop-recording', base64data);
|
||||
// 发送到主进程保存,传递任务ID和可选路径
|
||||
const result = await ipcRenderer.invoke('stop-recording', base64data, this.currentTaskId, customPath);
|
||||
|
||||
if (this._isDestroyed) return;
|
||||
|
||||
if (result.success) {
|
||||
this.$message.success(this.$t('recorder.savedSuccess') || `录制已保存: ${result.fileName}`);
|
||||
this.$message.success(this.$t('recorder.savedSuccess') + `: ${result.fileName}`);
|
||||
this.videoPath = result.filePath; // 保存视频绝对路径供外部使用
|
||||
this.$emit('recording-saved', result);
|
||||
resolve(result);
|
||||
} else {
|
||||
this.$message.error(result.message);
|
||||
reject(new Error(result.message));
|
||||
}
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
};
|
||||
reader.onerror = reject;
|
||||
reader.readAsDataURL(blob);
|
||||
|
||||
} catch (error) {
|
||||
console.error('保存录制失败:', error);
|
||||
this.$message.error(this.$t('recorder.saveFailed') || '保存录制失败');
|
||||
this.$message.error(this.$t('recorder.saveFailed'));
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
startTimer() {
|
||||
@@ -243,9 +293,12 @@ export default {
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
0%, 100% {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
@@ -15,18 +15,8 @@
|
||||
<div>{{ $t("systemControl.tips1") }}</div>
|
||||
</div>
|
||||
<div class="serviceImg">
|
||||
<el-button
|
||||
icon="el-icon-video-play"
|
||||
circle
|
||||
@click="play"
|
||||
:disabled="state || state == null"
|
||||
></el-button>
|
||||
<el-button
|
||||
icon="el-icon-video-pause"
|
||||
circle
|
||||
@click="pause"
|
||||
:disabled="!state || state == null"
|
||||
></el-button>
|
||||
<el-button icon="el-icon-video-play" circle @click="play" :disabled="state || state == null"></el-button>
|
||||
<el-button icon="el-icon-video-pause" circle @click="pause" :disabled="!state || state == null"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,12 +26,8 @@
|
||||
<div class="select">
|
||||
<div class="lable">{{ $t("systemControl.selectWorkstation") }}</div>
|
||||
<el-select v-model="workValue">
|
||||
<el-option
|
||||
v-for="item in printData"
|
||||
:key="item.PrinterID"
|
||||
:label="getPrintName(item.PrinterID)"
|
||||
:value="item.PrinterID"
|
||||
>
|
||||
<el-option v-for="item in printData" :key="item.PrinterID" :label="getPrintName(item.PrinterID)"
|
||||
:value="item.PrinterID">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -118,27 +104,18 @@
|
||||
<div class="select">
|
||||
<div class="lable">{{ $t("systemControl.refreshTime1") }}</div>
|
||||
<el-input v-model="refreshTime1" type="number" style="width: 300px">
|
||||
<el-button
|
||||
slot="append"
|
||||
icon="el-icon-finished"
|
||||
@click="handleSaveTime1"
|
||||
></el-button>
|
||||
></el-input
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-finished" @click="handleSaveTime1"></el-button>
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="select">
|
||||
<div class="lable">{{ $t("systemControl.refreshTime2") }}</div>
|
||||
<el-input v-model="refreshTime2" type="number" style="width: 300px">
|
||||
<el-button
|
||||
slot="append"
|
||||
icon="el-icon-finished"
|
||||
@click="handleSaveTime2"
|
||||
></el-button
|
||||
></el-input>
|
||||
<el-button slot="append" icon="el-icon-finished" @click="handleSaveTime2"></el-button></el-input>
|
||||
</div>
|
||||
<div class="select">
|
||||
<div class="lable">{{ $t("systemControl.guide") }}</div>
|
||||
<el-switch @change="changeStep" v-model="showStep" :active-text="$t('systemControl.show')" :inactive-text="$t('systemControl.hide')"></el-switch>
|
||||
<el-switch @change="changeStep" v-model="showStep" :active-text="$t('systemControl.show')"
|
||||
:inactive-text="$t('systemControl.hide')"></el-switch>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -147,12 +124,7 @@
|
||||
<div class="select">
|
||||
<div class="lable">{{ $t("systemControl.changeLanguage") }}</div>
|
||||
<el-select v-model="selectLan">
|
||||
<el-option
|
||||
v-for="item in languages"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-option v-for="item in languages" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -360,11 +332,20 @@ export default {
|
||||
method: "get",
|
||||
url: "/web/get_printer_info",
|
||||
}).then((res) => {
|
||||
if (!res.data || !res.data.printerList) {
|
||||
console.warn('获取工作站列表返回的数据格式不正确:', res)
|
||||
this.printData = []
|
||||
return
|
||||
}
|
||||
this.printData = res.data.printerList;
|
||||
if (this.printData.length != 0) {
|
||||
//自动选择第一个
|
||||
this.workValue = this.printData[0].PrinterID;
|
||||
}
|
||||
}).catch((e) => {
|
||||
console.error('获取工作站列表失败:', e)
|
||||
this.printData = []
|
||||
this.$message.error('获取工作站列表失败,请检查网络连接')
|
||||
});
|
||||
},
|
||||
checkServerState(callback) {
|
||||
@@ -779,12 +760,14 @@ export default {
|
||||
box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
|
||||
.restart {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-bottom: 1px rgb(224, 224, 224) solid;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
width: 300px;
|
||||
@@ -797,27 +780,32 @@ export default {
|
||||
background-color: rgb(240, 240, 240);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.service {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.tips {
|
||||
color: rgb(94, 94, 94);
|
||||
font-size: 14px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.serviceImg {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
margin-left: 100px;
|
||||
|
||||
.begin {
|
||||
width: 55px;
|
||||
height: 55px;
|
||||
}
|
||||
|
||||
.stop {
|
||||
margin-left: 5px;
|
||||
width: 50px;
|
||||
@@ -826,12 +814,14 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.control {
|
||||
width: 100%;
|
||||
height: 420px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-bottom: 1px rgb(224, 224, 224) solid;
|
||||
|
||||
.title {
|
||||
margin-top: 20px;
|
||||
font-size: 14px;
|
||||
@@ -845,9 +835,11 @@ export default {
|
||||
background-color: rgb(240, 240, 240);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.service {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.select {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -865,10 +857,12 @@ export default {
|
||||
width: 150px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
width: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
.concrete {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -894,6 +888,7 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
|
||||
.el-button {
|
||||
width: 180px;
|
||||
height: 35px;
|
||||
@@ -911,15 +906,19 @@ export default {
|
||||
border-radius: 1px;
|
||||
box-shadow: 1px 0px 2px 0px grey;
|
||||
}
|
||||
|
||||
.el-button:nth-child(4) {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.el-button:hover {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.el-button:active {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.el-button:focus {
|
||||
background-color: white;
|
||||
}
|
||||
@@ -927,11 +926,13 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.languageer {
|
||||
width: 100%;
|
||||
height: 220px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.title {
|
||||
margin-top: 20px;
|
||||
font-size: 14px;
|
||||
@@ -945,6 +946,7 @@ export default {
|
||||
background-color: rgb(240, 240, 240);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.select {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -952,12 +954,14 @@ export default {
|
||||
align-items: flex-start;
|
||||
margin-left: 20px;
|
||||
margin-top: 20px;
|
||||
|
||||
.lable {
|
||||
margin-top: 5px;
|
||||
font-size: 14px;
|
||||
width: 150px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+19
-2984
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<el-dialog :title="$t('work.senior')" :visible.sync="visibleSync" width="780px" append-to-body
|
||||
custom-class="grand-dialog" :close-on-click-modal="false" top="5vh" @close="handleClose">
|
||||
<div class="grand-setting-content" style="max-height: 75vh; overflow-y: auto; padding-right: 10px;">
|
||||
<el-form :model="form" label-position="right" label-width="120px" size="small">
|
||||
|
||||
<!-- 动态分模式渲染 -->
|
||||
<basic-config :form="form" :file-form="fileForm" :options="options" :printer-list="printerList"
|
||||
:size-form="sizeForm" />
|
||||
|
||||
<!-- 高级功能(ISO/ZIP/HASH/计数器) -->
|
||||
<advanced-features :form="form" :file-form="fileForm" />
|
||||
|
||||
<!-- 屏幕录制 -->
|
||||
<recording-settings :form="form" :file-form="fileForm"
|
||||
@test-recording="$emit('test-recording', $event)" />
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BasicConfig from './sections/BasicConfig.vue'
|
||||
import AdvancedFeatures from './sections/AdvancedFeatures.vue'
|
||||
import RecordingSettings from './sections/RecordingSettings.vue'
|
||||
|
||||
export default {
|
||||
name: 'AdvancedSettings',
|
||||
components: {
|
||||
BasicConfig,
|
||||
AdvancedFeatures,
|
||||
RecordingSettings
|
||||
},
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
fileForm: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
printerList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
sizeForm: {
|
||||
type: [Number, String],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
visibleSync: {
|
||||
get() {
|
||||
return this.visible
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:visible', val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.visibleSync = false
|
||||
},
|
||||
handleSave() {
|
||||
// 验证加密狗计数
|
||||
if (this.form.enable_dongle_counter) {
|
||||
if (!this.form.install_dongle_count || this.form.install_dongle_count < 0 || !Number.isInteger(this.form.install_dongle_count)) {
|
||||
this.$message.warning(this.$t('work.dongleCountRequired'))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 验证 ISO 文件名
|
||||
if (this.form.is_generate_iso && !this.form.iso_file_name) {
|
||||
this.$message.warning(this.$t('work.isoNameInput'))
|
||||
return
|
||||
}
|
||||
|
||||
// 验证 ZIP 文件名
|
||||
if (this.form.is_generate_zip) {
|
||||
if (!this.form.zip_file_name) {
|
||||
this.$message.warning(this.$t('work.zipNameInput'))
|
||||
return
|
||||
}
|
||||
|
||||
// 验证 ZIP 加密密码
|
||||
if (this.form.is_zip_encrypt) {
|
||||
if (!this.form.zip_password) {
|
||||
this.$message.warning(this.$t('work.pleasePassword'))
|
||||
return
|
||||
}
|
||||
if (this.form.zip_password !== this.form.zip_repassword) {
|
||||
this.$message.warning(this.$t('work.zipPassWrong'))
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.$emit('save')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 样式将包含在主组件中或按需引入 */
|
||||
.grand-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.footer-buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="file">
|
||||
<div class="section-title">
|
||||
<div class="title-left">
|
||||
<i class="el-icon-folder-opened"></i>
|
||||
<span class="title-text">{{ $t('work.contentTitle') }}</span>
|
||||
</div>
|
||||
<div class="content-header-actions">
|
||||
<el-button size="small" @click="$refs.files.addFolder()">{{ $t("file.addFolder") }}</el-button>
|
||||
<el-button size="small" @click="$refs.files.addFile()">{{ $t("file.addFile") }}</el-button>
|
||||
<div class="volume-label-group">
|
||||
<span class="label-text">{{ $t('work.sign') }}</span>
|
||||
<el-input :value="juanbiao" @input="$emit('update:juanbiao', $event)" size="small"
|
||||
:placeholder="$t('work.pleaseInput')" class="volume-input" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 列表容器 -->
|
||||
<div class="content-container mt-10">
|
||||
<files ref="files" :onSizechange="onSizeChange" :complete="onUploadOver" :saveWorkList="saveWorkList"
|
||||
class="flex-1-files" @network-paths-changed="$emit('network-paths-changed', $event)">
|
||||
<slot name="progress"></slot>
|
||||
</files>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Files from '../files/file.vue'
|
||||
|
||||
export default {
|
||||
name: 'FileManagement',
|
||||
components: { Files },
|
||||
props: {
|
||||
saveWorkList: Object,
|
||||
juanbiao: String
|
||||
},
|
||||
methods: {
|
||||
handleCommand(command) {
|
||||
if (command === 'folder') {
|
||||
this.$refs.files.addFolder()
|
||||
} else {
|
||||
this.$refs.files.addFile()
|
||||
}
|
||||
},
|
||||
onSizeChange(size) {
|
||||
this.$emit('size-change', size)
|
||||
},
|
||||
onUploadOver() {
|
||||
this.$emit('upload-over')
|
||||
},
|
||||
// 将父组件需要的 ref 方法公开
|
||||
hasNetworkPaths() { return this.$refs.files.hasNetworkPaths() },
|
||||
getNetworkPaths() { return this.$refs.files.getNetworkPaths() },
|
||||
resume(form) { this.$refs.files.resume(form) },
|
||||
getLists() { return this.$refs.files.getLists() }
|
||||
},
|
||||
computed: {
|
||||
// 暴露 allNumber 供父组件校验
|
||||
allNumber() {
|
||||
return (this.$refs && this.$refs.files) ? this.$refs.files.allNumber : 0
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import './styles/work-styles.css';
|
||||
|
||||
.file {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.content-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.flex-1-files {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.content-header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.volume-label-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.label-text {
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.volume-input {
|
||||
width: 140px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<el-popover v-if="guideStep && guideStep[step]" :placement="guideStep[step].placement" width="250" trigger="manual"
|
||||
v-model="guideStep[step].show">
|
||||
<div class="guide_box">
|
||||
<div class="guide_title">
|
||||
{{ $t('guide.title') }}<span>({{ parseInt(currentStep) + 1 }}/{{ guideStep.length }})</span>
|
||||
</div>
|
||||
<div class="guide_desc">{{ $t(`guide.step${step + 1}`) }}</div>
|
||||
<div class="guide_btns">
|
||||
<el-button @click="$emit('exit-guide')" class="guide_btn1" size="mini" type="text">
|
||||
{{ $t('guide.skip') }}
|
||||
</el-button>
|
||||
<el-button v-if="parseInt(currentStep) > 0" @click="$emit('prev-step')" class="guide_btn1" size="mini">
|
||||
{{ $t('guide.prev') }}
|
||||
</el-button>
|
||||
<el-button @click="$emit('next-step')" class="guide_btn2" size="mini" type="primary">
|
||||
{{ currentStep == guideStep.length - 1 ? $t('guide.complete') : $t('guide.next') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="reference" :class="{ guide_body: currentStep == step }">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</el-popover>
|
||||
<div v-else>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'GuidePopover',
|
||||
props: {
|
||||
step: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
guideStep: {
|
||||
type: [Object, Array],
|
||||
default: null
|
||||
},
|
||||
currentStep: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.guide_body {
|
||||
position: relative;
|
||||
z-index: 9999;
|
||||
background-color: white;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.guide_box {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.guide_title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.guide_title span {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.guide_desc {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.guide_btns {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.guide_btn1 {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.guide_btn2 {
|
||||
background-color: #409EFF;
|
||||
border-color: #409EFF;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,448 @@
|
||||
<template>
|
||||
<div class="label">
|
||||
<div class="section-title">
|
||||
<div class="title-left">
|
||||
<i class="el-icon-collection-tag"></i>
|
||||
<span class="title-text">{{ $t('work.tag') }}</span>
|
||||
</div>
|
||||
<div class="header-right-actions">
|
||||
<el-select v-model="currentTemplateLocal" :placeholder="$t('work.pleaseSelect')" size="small"
|
||||
class="template-select" @change="onTemplateChange" clearable filterable>
|
||||
<el-option v-for="(item, index) in templates" :key="index" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
<el-button size="small" @click="$emit('open-design')">
|
||||
{{ $t('work.design') }}
|
||||
</el-button>
|
||||
<el-button size="small" @click="$emit('open-file')">
|
||||
{{ $t('work.import') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 预览区域 -->
|
||||
<div class="display_box" v-if="fileData.frontDisplayPic || fileData.backDisplayPic">
|
||||
<el-tooltip effect="light" content="打印正面" placement="bottom">
|
||||
<div class="display_item" @click="setPrintFlag(2)">
|
||||
<div class="display_bg" v-if="printFlag === 3"></div>
|
||||
<img :src="fileData.frontDisplayPic" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light" content="打印反面" placement="bottom">
|
||||
<div class="display_item" @click="setPrintFlag(3)">
|
||||
<div class="display_bg" v-if="printFlag === 2"></div>
|
||||
<img :src="fileData.backDisplayPic" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="display_box display_box_placeholder" v-else>
|
||||
<span class="empty-text-dark">{{ $t('work.nodata') }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 详细参数列表 -->
|
||||
<div class="metadata-container mt-10">
|
||||
<div class="sub-title">
|
||||
<i class="el-icon-edit-outline"></i>
|
||||
<span>{{ $t('work.metadataEdit') }}</span>
|
||||
<span class="field-count" v-if="tableData && tableData.length > 0">({{ tableData.length }})</span>
|
||||
</div>
|
||||
|
||||
<!-- 卡片式布局替代表格 -->
|
||||
<div v-if="tableData && tableData.length > 0" class="metadata-fields-list">
|
||||
<div v-for="(item, index) in tableData" :key="index" class="field-item"
|
||||
:class="{ 'field-disabled': csvIsExist && (item.type == 3 || item.type == 4 || item.type == 5) }">
|
||||
|
||||
<!-- 左侧:字段名称区域 -->
|
||||
<div class="field-label-area">
|
||||
<div class="field-info">
|
||||
<div class="field-name-row">
|
||||
<span class="field-name" :title="item.name">{{ item.name }}</span>
|
||||
<span v-if="item.sideLabel" class="side-badge"
|
||||
:class="{ 'side-front': item.sideLabel.includes('正'), 'side-back': item.sideLabel.includes('背') }">
|
||||
{{ item.sideLabel.replace('[', '').replace(']', '') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧:输入区域 -->
|
||||
<div class="field-input-area">
|
||||
<!-- 图片类型 -->
|
||||
<div v-if="item.type == 1" class="image-upload-wrapper">
|
||||
<!-- 预览图 -->
|
||||
<div v-if="imgPreviews[item.origin_name]" class="image-preview mb-5">
|
||||
<img :src="imgPreviews[item.origin_name]" class="preview-img" />
|
||||
</div>
|
||||
|
||||
<label :for="'upload-' + item.origin_name" class="upload-label">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
<span>{{ $t('work.selectImage') }}</span>
|
||||
</label>
|
||||
<input :id="'upload-' + item.origin_name" type="file" accept="image/*"
|
||||
:ref="item.origin_name" :data-name="item.origin_name" class="hidden-file-input"
|
||||
@change="(e) => handleImageChange(item.origin_name, e)" />
|
||||
</div>
|
||||
|
||||
<!-- 文本/条码类型 -->
|
||||
<div v-else-if="item.type == 3 || item.type == 4 || item.type == 5" class="text-input-wrapper">
|
||||
<el-input v-model="form[item.origin_name]" :placeholder="$t('work.pleaseInput')" clearable
|
||||
size="small" :disabled="csvIsExist" class="modern-input" />
|
||||
<el-button size="small" icon="el-icon-upload2" @click="$emit('open-csv')"
|
||||
class="csv-import-btn" :title="$t('work.binfile')">
|
||||
<span class="btn-text">{{ file_name || $t('work.binfile') }}</span>
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 其他类型 -->
|
||||
<div v-else class="field-value-display">
|
||||
{{ item.origin_name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 空状态占位框 (当无数据时显示) -->
|
||||
<div v-else class="empty-state-modern">
|
||||
<i class="el-icon-document"></i>
|
||||
<p class="empty-title">{{ $t('work.noTemplate') }}</p>
|
||||
<p class="empty-hint">{{ $t('work.selectTemplateHint') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TagMetadata',
|
||||
props: {
|
||||
templates: Array,
|
||||
currentTemplate: String,
|
||||
fileData: Object,
|
||||
printFlag: Number,
|
||||
tableData: Array,
|
||||
form: Object,
|
||||
csvIsExist: Boolean,
|
||||
file_name: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentTemplateLocal: this.currentTemplate,
|
||||
imgPreviews: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentTemplate(val) { this.currentTemplateLocal = val }
|
||||
},
|
||||
methods: {
|
||||
onTemplateChange(val) {
|
||||
this.$emit('update:current-template', val)
|
||||
this.$emit('template-change', val)
|
||||
},
|
||||
setPrintFlag(flag) {
|
||||
this.$emit('update:print-flag', flag)
|
||||
},
|
||||
handleImageChange(fieldName, event) {
|
||||
const file = event.target.files[0]
|
||||
if (file) {
|
||||
// 生成预览URL
|
||||
if (this.imgPreviews[fieldName]) {
|
||||
URL.revokeObjectURL(this.imgPreviews[fieldName]) // 释放旧URL
|
||||
}
|
||||
const url = URL.createObjectURL(file)
|
||||
this.$set(this.imgPreviews, fieldName, url)
|
||||
|
||||
// 触发原有事件
|
||||
this.$emit('image-change', fieldName, file)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import './styles/work-styles.css';
|
||||
|
||||
.header-right-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.header-right-actions ::v-deep .el-button {
|
||||
border-radius: 8px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.label {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.metadata-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.flex-grow-table {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.template-select {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
/* ================== 现代化卡片式字段列表 ================== */
|
||||
.metadata-fields-list {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 4px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
/* 字段项卡片 */
|
||||
.field-item {
|
||||
background: #ffffff;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 10px;
|
||||
padding: 14px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.field-item:hover {
|
||||
border-color: #cbd5e1;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.field-disabled {
|
||||
opacity: 0.6;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* 左侧:字段名称区域 */
|
||||
.field-label-area {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
min-width: 180px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.field-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.field-name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin-bottom: 2px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.field-name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.side-badge {
|
||||
font-size: 11px;
|
||||
padding: 1px 6px;
|
||||
border-radius: 4px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.side-front {
|
||||
background-color: #e0f2fe;
|
||||
color: #0369a1;
|
||||
border: 1px solid #bae6fd;
|
||||
}
|
||||
|
||||
.side-back {
|
||||
background-color: #fce7f3;
|
||||
color: #be185d;
|
||||
border: 1px solid #fbcfe8;
|
||||
}
|
||||
|
||||
/* 右侧:输入区域 */
|
||||
.field-input-area {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
/* 图片上传样式 */
|
||||
.image-upload-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.image-preview {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
/* 固定高度或自适应 */
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
border: 1px dashed #d1d5db;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f9fafb;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.preview-img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.upload-label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 7px 14px;
|
||||
background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
color: #4b5563;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.upload-label:hover {
|
||||
background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
|
||||
border-color: #9ca3af;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.upload-label i {
|
||||
font-size: 16px;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
.hidden-file-input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 文本输入样式 */
|
||||
.text-input-wrapper {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.modern-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.csv-import-btn {
|
||||
border-radius: 8px;
|
||||
border-color: #d1d5db;
|
||||
background: #ffffff;
|
||||
transition: all 0.2s;
|
||||
max-width: 140px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.csv-import-btn:hover {
|
||||
background: #f9fafb;
|
||||
border-color: #9ca3af;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.csv-import-btn .btn-text {
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 100px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.field-value-display {
|
||||
padding: 7px 12px;
|
||||
background: #f9fafb;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
/* ================== 字段计数 ================== */
|
||||
.field-count {
|
||||
font-size: 12px;
|
||||
color: #9ca3af;
|
||||
font-weight: 600;
|
||||
margin-left: 4px;
|
||||
padding: 2px 8px;
|
||||
background: #f3f4f6;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
/* ================== 现代化空状态 ================== */
|
||||
.empty-state-modern {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 48px 24px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.empty-state-modern i {
|
||||
font-size: 56px;
|
||||
color: #cbd5e1;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.empty-title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #64748b;
|
||||
margin: 0 0 8px 0;
|
||||
}
|
||||
|
||||
.empty-hint {
|
||||
font-size: 13px;
|
||||
color: #94a3b8;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ================== 滚动条美化 ================== */
|
||||
.metadata-fields-list::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.metadata-fields-list::-webkit-scrollbar-thumb {
|
||||
background: #cbd5e1;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.metadata-fields-list::-webkit-scrollbar-thumb:hover {
|
||||
background: #94a3b8;
|
||||
}
|
||||
|
||||
.metadata-fields-list::-webkit-scrollbar-track {
|
||||
background: #f1f5f9;
|
||||
border-radius: 3px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<div class="task-header-container">
|
||||
<div class="task-header-flex">
|
||||
<!-- 容量选择 - 步骤8 -->
|
||||
<guide-popover :step="8" :guide-step="guideStep" :current-step="currentStep"
|
||||
@exit-guide="$emit('exit-guide')" @prev-step="$emit('prev-step')" @next-step="$emit('next-step')">
|
||||
<div class="header-item">
|
||||
<label class="inline-label">{{ $t('work.size') }}</label>
|
||||
<el-select v-model="sizeFormLocal" class="header-select size-select" size="small"
|
||||
@change="$emit('update:size_form', $event)" :placeholder="$t('work.pleaseSelect')">
|
||||
<el-option v-for="item in sizeTypeOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value"
|
||||
:disabled="filterPassedType && filterPassedType.length > 0 && filterPassedType.indexOf(item.value) == -1" />
|
||||
</el-select>
|
||||
</div>
|
||||
</guide-popover>
|
||||
|
||||
<!-- 拷贝类型 - 步骤9 -->
|
||||
<guide-popover :step="9" :guide-step="guideStep" :current-step="currentStep"
|
||||
@exit-guide="$emit('exit-guide')" @prev-step="$emit('prev-step')" @next-step="$emit('next-step')">
|
||||
<div class="header-item">
|
||||
<label class="inline-label">{{ $t('work.content') }}</label>
|
||||
<el-select v-model="fileFormLocal" class="header-select" size="small"
|
||||
@change="$emit('update:file_form', $event)">
|
||||
<el-option v-for="item in fileTypeOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</guide-popover>
|
||||
|
||||
<!-- 分区模式 (如果需要显示) -->
|
||||
<div class="header-item" v-if="false">
|
||||
<!-- Screenshot doesn't show partition mode clearly or it might be hidden/dynamic.
|
||||
Users previous layout had it. I will keep it but maybe conditional or just append?
|
||||
The screenshot only shows 2 selects clearly. Keeping it visible for functionality but later in flow?
|
||||
Actually I'll keep it but ensure flex flow handles it. -->
|
||||
<label class="inline-label">{{ $t('work.partType') }}:</label>
|
||||
<el-select v-model="typeFormLocal" class="header-select" size="small"
|
||||
@change="$emit('update:type_form', $event)">
|
||||
<el-option v-for="item in partitionOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import GuidePopover from './GuidePopover.vue'
|
||||
|
||||
export default {
|
||||
name: 'TaskHeader',
|
||||
components: {
|
||||
GuidePopover
|
||||
},
|
||||
props: {
|
||||
juanbiao_form: String,
|
||||
file_form: Number,
|
||||
size_form: [Number, String],
|
||||
type_form: Number,
|
||||
sizeType: Array,
|
||||
filterPassedType: Array,
|
||||
guideStep: [Object, Array],
|
||||
currentStep: [Number, String]
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fileFormLocal: this.file_form,
|
||||
sizeFormLocal: this.size_form,
|
||||
typeFormLocal: this.type_form
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
file_form(val) { this.fileFormLocal = val },
|
||||
size_form(val) { this.sizeFormLocal = val },
|
||||
type_form(val) { this.typeFormLocal = val }
|
||||
},
|
||||
computed: {
|
||||
juanbiao: {
|
||||
get() { return this.juanbiao_form },
|
||||
set(val) { this.$emit('update:juanbiao_form', val) }
|
||||
},
|
||||
fileTypeOptions() {
|
||||
return [
|
||||
{ label: this.$t('work.fileAnd'), value: 0 },
|
||||
{ label: this.$t('work.eCd'), value: 1 },
|
||||
{ label: this.$t('work.encryptCard'), value: 2 },
|
||||
{ label: this.$t('work.forbidCopyU'), value: 4 }
|
||||
]
|
||||
},
|
||||
sizeTypeOptions() {
|
||||
// 如果没有传入 sizeType,则提供默认
|
||||
if (this.sizeType && this.sizeType.length > 0) return this.sizeType
|
||||
return [
|
||||
{ value: 0.512, label: "512MB" },
|
||||
{ value: 4, label: "4GB" },
|
||||
{ value: 32, label: "32GB" },
|
||||
{ value: 64, label: "64GB" },
|
||||
{ value: 128, label: "128GB" },
|
||||
{ value: 256, label: "256GB" }
|
||||
]
|
||||
},
|
||||
partitionOptions() {
|
||||
return [
|
||||
{ value: 0, label: this.$t("work.diskPart") },
|
||||
{ value: 1, label: this.$t("work.cdPart") },
|
||||
{ value: 3, label: this.$t("work.forbidCopyPart") },
|
||||
{ value: 5, label: this.$t("work.cdWithDisk") }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.task-header-container {
|
||||
padding: 0;
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.task-header-flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
height: 100%;
|
||||
padding-top: 5px;
|
||||
/* Alignment tweak */
|
||||
}
|
||||
|
||||
.header-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.inline-label {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
.header-select {
|
||||
width: 160px;
|
||||
/* Wider selects */
|
||||
}
|
||||
|
||||
.header-select.size-select {
|
||||
width: 220px;
|
||||
/* Capacity select needs even more width for placeholders */
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
import WorkMain from './WorkMain.vue'
|
||||
|
||||
export default WorkMain
|
||||
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<div class="grand-section">
|
||||
<div class="grand-title">
|
||||
<span>{{ $t('work.advancedFeatures') }}</span>
|
||||
<div class="title-line"></div>
|
||||
</div>
|
||||
|
||||
<!-- ISO / ZIP (仅模式 0 和 2) -->
|
||||
<template v-if="fileForm === 0 || fileForm === 2">
|
||||
<!-- ISO 生成组 -->
|
||||
<div class="feature-group" :class="{ active: form.is_generate_iso }">
|
||||
<div class="feature-header">
|
||||
<el-checkbox v-model="form.is_generate_iso">
|
||||
{{ $t('work.generateISO') }}
|
||||
</el-checkbox>
|
||||
</div>
|
||||
<div v-if="form.is_generate_iso" class="feature-content">
|
||||
<el-form-item :label="$t('work.isoFileName')" label-width="100px">
|
||||
<el-input v-model="form.iso_file_name" :placeholder="$t('work.inputIsoName')" size="small" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ZIP 生成组 -->
|
||||
<div class="feature-group" :class="{ active: form.is_generate_zip }">
|
||||
<div class="feature-header">
|
||||
<el-checkbox v-model="form.is_generate_zip">
|
||||
{{ $t('work.generateZIP') }}
|
||||
</el-checkbox>
|
||||
</div>
|
||||
<div v-if="form.is_generate_zip" class="feature-content">
|
||||
<el-form-item :label="$t('work.zipFileName')" label-width="100px">
|
||||
<el-input v-model="form.zip_file_name" :placeholder="$t('work.inputZipName')" size="small" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 嵌套加密设置 -->
|
||||
<div class="sub-feature">
|
||||
<el-checkbox v-model="form.is_zip_encrypt">{{ $t('work.isEncrypt') }}</el-checkbox>
|
||||
<div v-if="form.is_zip_encrypt" class="mt-10">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('work.inputPassword')" label-width="80px">
|
||||
<el-input type="password" v-model="form.zip_password" show-password
|
||||
size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('work.confirmPassword')" label-width="80px">
|
||||
<el-input type="password" v-model="form.zip_repassword" show-password
|
||||
size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="divider-h mb-15" v-if="form.is_generate_iso || form.is_generate_zip"></div>
|
||||
|
||||
<div class="grand-switch-grid" v-if="form.is_generate_iso || form.is_generate_zip">
|
||||
<div class="g-switch-item">
|
||||
<span class="g-label">{{ $t('work.genMD5') }}</span>
|
||||
<el-switch v-model="form.s1"></el-switch>
|
||||
</div>
|
||||
<div class="g-switch-item">
|
||||
<span class="g-label">{{ $t('work.copyHash') }}</span>
|
||||
<el-switch v-model="form.copy_hash"></el-switch>
|
||||
</div>
|
||||
<div class="g-switch-item">
|
||||
<span class="g-label">{{ $t('work.printMD5') }}</span>
|
||||
<el-switch v-model="form.s2"></el-switch>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider-h mt-15 mb-15" v-if="form.is_generate_iso || form.is_generate_zip"></div>
|
||||
</template>
|
||||
|
||||
<!-- 通用开关组 -->
|
||||
<div class="grand-switch-grid">
|
||||
<div class="g-switch-item">
|
||||
<span class="g-label">{{ $t('work.fail') }}</span>
|
||||
<el-switch v-model="form.s3"></el-switch>
|
||||
</div>
|
||||
<div class="g-switch-item" v-if="fileForm !== 4">
|
||||
<span class="g-label">{{ $t('work.allowSpanCard') }}</span>
|
||||
<el-switch v-model="form.Span_USBcard"></el-switch>
|
||||
</div>
|
||||
<div class="g-switch-item" v-if="fileForm !== 4">
|
||||
<span class="g-label">{{ $t('work.presetContent') }}</span>
|
||||
<el-switch v-model="form.hasAddFile"></el-switch>
|
||||
</div>
|
||||
<div class="g-switch-item highlight" v-if="fileForm === 1">
|
||||
<span class="g-label">{{ $t('work.mixMode') }}</span>
|
||||
<el-switch v-model="form.is_blend"></el-switch>
|
||||
</div>
|
||||
<div class="g-switch-item">
|
||||
<span class="g-label">{{ $t('work.installDongle') }}</span>
|
||||
<el-switch v-model="form.enable_dongle_counter"></el-switch>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 计数器详细 -->
|
||||
<div v-if="form.enable_dongle_counter" class="mt-10 p-10"
|
||||
style="background: #fdf6ec; border-radius: 6px; border: 1px solid #faecd8;">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('work.installCount')" label-width="120px" class="mb-0">
|
||||
<el-input-number v-model="form.install_dongle_count" :min="0" :step="1" :precision="0"
|
||||
size="mini" controls-position="right" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-form-item :label="$t('work.authCode')" label-width="100px" class="mb-0">
|
||||
<el-input v-model="form.auth_code" :placeholder="$t('work.inputAuthCode')" size="mini"
|
||||
style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AdvancedFeatures',
|
||||
props: {
|
||||
form: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
fileForm: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<div class="grand-section">
|
||||
<div class="grand-title">
|
||||
<span>{{ $t('work.basicConfig') }}</span>
|
||||
<div class="title-line"></div>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" v-if="fileForm !== 2">
|
||||
<el-form-item :label="$t('work.better')">
|
||||
<el-select v-model="form.priority" class="w-full" :disabled="fileForm === 4">
|
||||
<el-option v-for="item in priorityOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="fileForm !== 2">
|
||||
<el-form-item :label="$t('work.startWorkSpace')">
|
||||
<el-select v-model="form.target_work" class="w-full" :disabled="fileForm === 4">
|
||||
<el-option v-for="item in targetWorkOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('work.ribbonType')">
|
||||
<el-select v-model="form.color_type" class="w-full">
|
||||
<el-option v-for="item in colorTypeOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="fileForm === 0 || fileForm === 2">
|
||||
<el-form-item :label="$t('work.formatFile')">
|
||||
<el-select v-model="form.formatFile" class="w-full">
|
||||
<el-option v-for="item in formatOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'BasicConfig',
|
||||
props: {
|
||||
form: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
fileForm: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
printerList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
sizeForm: {
|
||||
type: [Number, String],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
priorityOptions() {
|
||||
return [
|
||||
{ value: 1, label: this.$t("work.low") },
|
||||
{ value: 0, label: this.$t("work.normal") },
|
||||
{ value: 2, label: this.$t("work.high") }
|
||||
]
|
||||
},
|
||||
targetWorkOptions() {
|
||||
let list = [{ value: 0, label: this.$t("work.any") }]
|
||||
|
||||
if (this.printerList && this.printerList.length > 0) {
|
||||
const requiredSize = parseFloat(this.sizeForm)
|
||||
let filtered = this.printerList
|
||||
|
||||
// Filter by capacity if size is selected
|
||||
if (requiredSize && requiredSize > 0) {
|
||||
filtered = this.printerList.filter(p => {
|
||||
if (!p.PrinterType) return false
|
||||
const type = p.PrinterType.toUpperCase()
|
||||
|
||||
if (requiredSize < 1) {
|
||||
// MB case (e.g. 0.512 -> 512M)
|
||||
const mb = Math.round(requiredSize * 1000)
|
||||
return type.includes(mb + "M")
|
||||
} else {
|
||||
// GB case (e.g. 4 -> 4G)
|
||||
return type.includes(requiredSize + "G")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Map to options
|
||||
if (filtered.length > 0) {
|
||||
list = list.concat(filtered.map(p => ({
|
||||
value: p.PrinterID,
|
||||
label: `${p.PrinterID} (${p.PrinterType})`
|
||||
})))
|
||||
}
|
||||
}
|
||||
return list
|
||||
},
|
||||
colorTypeOptions() {
|
||||
return [
|
||||
{ value: 0, label: this.$t("work.any") },
|
||||
{ value: 1, label: this.$t("work.sigleColor") },
|
||||
{ value: 2, label: this.$t("work.colorful") }
|
||||
]
|
||||
},
|
||||
formatOptions() {
|
||||
return [
|
||||
{
|
||||
value: 0,
|
||||
label: this.$t("work.auto"),
|
||||
},
|
||||
{
|
||||
value: "FAT",
|
||||
label: "FAT",
|
||||
},
|
||||
{
|
||||
value: "FAT32",
|
||||
label: "FAT32",
|
||||
},
|
||||
{
|
||||
value: "NTFS",
|
||||
label: "NTFS",
|
||||
},
|
||||
{
|
||||
value: "EXFAT",
|
||||
label: "EXFAT",
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div class="grand-section">
|
||||
<div class="grand-title">
|
||||
<span>{{ $t('work.hardwareControl') }}</span>
|
||||
<div class="title-line"></div>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="hardware-box">
|
||||
<div class="mb-10">
|
||||
<el-checkbox v-model="form.enable_dongle_counter">
|
||||
{{ $t('work.installDongle') }}
|
||||
</el-checkbox>
|
||||
</div>
|
||||
<transition name="el-zoom-in-top">
|
||||
<div v-if="form.enable_dongle_counter" class="ml-20">
|
||||
<el-form-item :label="$t('work.installCount')" label-width="80px">
|
||||
<el-input-number size="small" v-model="form.install_dongle_count" :min="0" :max="999" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HardwareControl',
|
||||
props: {
|
||||
form: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.hardware-box {
|
||||
padding: 10px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<div class="grand-section">
|
||||
<div class="grand-title">
|
||||
<span>{{ $t('work.screenRecordReview') }}</span>
|
||||
<div class="title-line"></div>
|
||||
</div>
|
||||
<div class="feature-row mb-10">
|
||||
<div class="grand-switch-grid mb-10">
|
||||
<div class="g-switch-item">
|
||||
<span class="g-label">{{ $t('work.enableScreenRecord') }}</span>
|
||||
<el-switch v-model="form.record_screen"></el-switch>
|
||||
</div>
|
||||
<div class="g-switch-item" v-if="form.record_screen">
|
||||
<div class="flex-align-center">
|
||||
<span class="g-label">{{ $t('work.printRecordLogo') }}</span>
|
||||
|
||||
</div>
|
||||
<el-switch v-model="form.print_record_logo"></el-switch>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="form.record_screen" class="path-box-container">
|
||||
<div class="path-box">
|
||||
<el-form-item :label="$t('work.recordPath')" label-width="110px">
|
||||
<el-input v-model="form.record_screen_path" :placeholder="$t('work.defaultPath')" size="small">
|
||||
<el-button slot="append" icon="el-icon-folder-opened" @click="selectRecordPath"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<div class="recording-actions mt-10">
|
||||
<el-button type="danger" size="small" icon="el-icon-video-camera" plain @click="testRecording">
|
||||
{{ $t('recorder.startRecording') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'RecordingSettings',
|
||||
props: {
|
||||
form: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
fileForm: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectRecordPath() {
|
||||
const { dialog } = require('@electron/remote')
|
||||
dialog.showOpenDialog({
|
||||
properties: ['openDirectory']
|
||||
}).then(result => {
|
||||
if (!result.canceled && result.filePaths.length > 0) {
|
||||
this.$set(this.form, 'record_screen_path', result.filePaths[0])
|
||||
}
|
||||
})
|
||||
},
|
||||
testRecording() {
|
||||
this.$emit('test-recording', this.form.record_screen_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.flex-align-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.logo-icon-active {
|
||||
color: #409EFF;
|
||||
font-size: 16px;
|
||||
animation: logo-glow 2s infinite ease-in-out;
|
||||
}
|
||||
|
||||
@keyframes logo-glow {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
opacity: 0.6;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 1;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
|
||||
.recording-tip {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fdf6ec;
|
||||
padding: 6px 10px;
|
||||
border-radius: 4px;
|
||||
border-left: 3px solid #e6a23c;
|
||||
}
|
||||
|
||||
.recording-tip i {
|
||||
margin-right: 5px;
|
||||
font-size: 14px;
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
.divider-v {
|
||||
width: 1px;
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
|
||||
.tips-text {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,172 @@
|
||||
/* Compact Dialog Styles for Advanced Settings */
|
||||
/* 注意:此文件为纯 CSS,不应包含 /deep/。穿透逻辑应在引用它的 Vue 组件中通过 ::v-deep 实现 */
|
||||
|
||||
.grand-dialog {
|
||||
border-radius: 12px !important;
|
||||
overflow: hidden; /* Ensure header/footer respect radius */
|
||||
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
|
||||
}
|
||||
.grand-dialog .el-dialog__header {
|
||||
padding: 20px 24px !important;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
background: #fff;
|
||||
}
|
||||
.grand-dialog .el-dialog__title {
|
||||
font-size: 18px !important;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
.grand-dialog .el-dialog__body {
|
||||
padding: 24px !important;
|
||||
background-color: #f6f8fa; /* Global gray background for contrast */
|
||||
}
|
||||
|
||||
.grand-section {
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
|
||||
padding: 16px 20px !important;
|
||||
margin-bottom: 16px !important;
|
||||
border: 1px solid #eef0f2;
|
||||
}
|
||||
|
||||
.grand-title {
|
||||
font-size: 13px !important;
|
||||
font-weight: 700;
|
||||
margin-bottom: 10px !important;
|
||||
color: #1f2937;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.grand-title .title-line {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background: #f3f4f6;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.divider-h {
|
||||
height: 1px;
|
||||
background: #f3f4f6;
|
||||
margin: 8px 0 !important;
|
||||
}
|
||||
|
||||
.feature-group {
|
||||
background: #fafafa;
|
||||
border-radius: 8px;
|
||||
padding: 10px 14px;
|
||||
margin-bottom: 12px;
|
||||
border: 1px solid #f0f0f0;
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.feature-group.active {
|
||||
background: #ffffff;
|
||||
border-color: #67c23a;
|
||||
box-shadow: 0 4px 12px rgba(103, 194, 58, 0.08);
|
||||
}
|
||||
|
||||
.feature-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
/* 覆盖 checkbox 文字颜色 */
|
||||
.feature-header ::v-deep .el-checkbox__label {
|
||||
font-weight: 600 !important;
|
||||
color: #374151 !important;
|
||||
}
|
||||
|
||||
.feature-content {
|
||||
margin-top: 10px;
|
||||
padding: 12px;
|
||||
background: #f8fafc;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #edf2f7;
|
||||
animation: slideDown 0.3s ease-out;
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.sub-feature {
|
||||
margin-top: 8px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px dashed #e2e8f0;
|
||||
}
|
||||
|
||||
.grand-section .el-form-item {
|
||||
margin-bottom: 14px !important;
|
||||
}
|
||||
|
||||
/* 最后一个元素不需要下边距 */
|
||||
.grand-section .el-col:nth-last-child(-n + 2) .el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.grand-section ::v-deep .el-form-item__label {
|
||||
white-space: nowrap !important;
|
||||
font-size: 13px !important;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.grand-switch-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.g-switch-item {
|
||||
padding: 8px 12px !important;
|
||||
background: #fafafa;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border: 1px solid #f0f0f0;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.g-switch-item:hover {
|
||||
background: #fff;
|
||||
border-color: #67c23a;
|
||||
box-shadow: 0 3px 8px rgba(103, 194, 58, 0.12);
|
||||
}
|
||||
|
||||
.g-label {
|
||||
font-size: 13px !important;
|
||||
white-space: nowrap;
|
||||
color: #374151;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.path-box-container {
|
||||
margin-top: 16px !important;
|
||||
padding-top: 16px !important;
|
||||
border-top: 1px dashed #e5e7eb;
|
||||
}
|
||||
|
||||
.path-box {
|
||||
background: #f8fafc;
|
||||
padding: 12px !important;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.grand-setting-content::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
.grand-setting-content::-webkit-scrollbar-thumb {
|
||||
background: #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
/* 还原原始业务样式 - 完全兼容原始类名 */
|
||||
|
||||
.work {
|
||||
background-color: #f8fafc; /* Softer, modern background */
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 左侧文件管理区域原始样式 */
|
||||
/* 左侧文件管理区域原始样式 */
|
||||
.file {
|
||||
height: 500px;
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.03);
|
||||
border: 1px solid rgba(0, 0, 0, 0.04);
|
||||
box-sizing: border-box;
|
||||
padding: 12px;
|
||||
position: relative;
|
||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
animation: cardFadeIn 0.6s ease-out;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.file:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
@keyframes cardFadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(10px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 右侧标签元数据区域原始样式 */
|
||||
.label {
|
||||
height: 500px;
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.03);
|
||||
border: 1px solid rgba(0, 0, 0, 0.04);
|
||||
box-sizing: border-box;
|
||||
padding: 12px;
|
||||
position: relative;
|
||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
animation: cardFadeIn 0.6s ease-out;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.label:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
/* 标题行布局 */
|
||||
.section-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
margin-bottom: 8px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.title-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.title-left i {
|
||||
font-size: 18px;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: #303133;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.action-label {
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.template-select {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
/* 预览框微调 */
|
||||
/* 预览框微调 */
|
||||
.display_box {
|
||||
margin-top: 10px;
|
||||
background: #111827; /* Deeper navy for professional contrast */
|
||||
height: 180px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.display_item {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
border: 1px dashed #c0ccda;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.display_item img {
|
||||
height: 140px;
|
||||
/* background-color: #1e252d; Optional: match bg if image has transparency */
|
||||
}
|
||||
|
||||
.display_bg {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
/* 底部统计与按钮 */
|
||||
/* 底部统计与按钮 */
|
||||
.footer-actions {
|
||||
margin-top: 15px;
|
||||
padding: 10px 15px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.count-input-new {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
/* 子标题样式 */
|
||||
.sub-title {
|
||||
font-size: 14px;
|
||||
color: #374151;
|
||||
font-weight: 700;
|
||||
margin-bottom: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.sub-title i {
|
||||
color: #fbbf24;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.metadata-table {
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uploader 样式 */
|
||||
.uploader-example {
|
||||
width: 100%;
|
||||
margin: 10px auto 0;
|
||||
font-size: 12px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); /* Softer shadow */
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
flex: 1; /* Expand to fill parent flex container */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.uploader-example .uploader-list {
|
||||
flex: 1; /* Expand list to fill example box */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* 滚动条美化 (还原原始样式) */
|
||||
.uploader-list::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.uploader-list::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
background: #c7c7cb;
|
||||
}
|
||||
|
||||
.uploader-list::-webkit-scrollbar-track {
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 10px;
|
||||
background: #ededed;
|
||||
}
|
||||
|
||||
/* 工具类 */
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
.mt-10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.mb-10 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.empty-placeholder-box {
|
||||
flex: 1; /* Fill the metadata container area when empty */
|
||||
min-height: 200px;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
background-color: #fff;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.display_box_placeholder {
|
||||
justify-content: center;
|
||||
color: #6b7280;
|
||||
font-size: 14px;
|
||||
border: 2px dashed rgba(255, 255, 255, 0.1);
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.display_box_placeholder::before {
|
||||
content: '\e731'; /* Better icon if available, or stay with pic */
|
||||
font-family: 'element-icons' !important;
|
||||
font-size: 32px;
|
||||
opacity: 0.4;
|
||||
background: linear-gradient(135deg, #9ca3af, #4b5563);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.empty-text-dark {
|
||||
color: #5e6d82;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 响应式适配:大屏幕高度扩展 */
|
||||
@media (min-height: 900px) {
|
||||
.file,
|
||||
.label {
|
||||
height: 600px;
|
||||
}
|
||||
.uploader-example .uploader-list {
|
||||
max-height: 485px;
|
||||
}
|
||||
.empty-placeholder-box {
|
||||
height: 315px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Work component utilities
|
||||
*/
|
||||
|
||||
export function extendStringPrototypes() {
|
||||
if (String.prototype.strLen) return;
|
||||
|
||||
String.prototype.strLen = function () {
|
||||
var len = 0
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
if (this.charCodeAt(i) > 255 || this.charCodeAt(i) < 0) len += 2
|
||||
else len++
|
||||
}
|
||||
return len
|
||||
}
|
||||
|
||||
String.prototype.strToChars = function () {
|
||||
var chars = new Array()
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
chars[i] = [this.substr(i, 1), this.isCHS(i)]
|
||||
}
|
||||
String.prototype.charsArray = chars
|
||||
return chars
|
||||
}
|
||||
|
||||
String.prototype.isCHS = function (i) {
|
||||
if (this.charCodeAt(i) > 255 || this.charCodeAt(i) < 0) return true
|
||||
else return false
|
||||
}
|
||||
|
||||
String.prototype.subCHString = function (start, end) {
|
||||
var len = 0
|
||||
var str = ''
|
||||
this.strToChars()
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
if (this.charsArray[i][1]) len += 2
|
||||
else len++
|
||||
if (end < len) return str
|
||||
else if (start < len) str += this.charsArray[i][0]
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
String.prototype.subCHStr = function (start, length) {
|
||||
return this.subCHString(start, start + length)
|
||||
}
|
||||
}
|
||||
|
||||
export function getNowFormatDate() {
|
||||
var date = new Date()
|
||||
var seperator1 = '-'
|
||||
var year = date.getFullYear()
|
||||
var month = date.getMonth() + 1
|
||||
var strDate = date.getDate()
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = '0' + month
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = '0' + strDate
|
||||
}
|
||||
return year + seperator1 + month + seperator1 + strDate
|
||||
}
|
||||
|
||||
export function genTaskUUID() {
|
||||
var myDate = new Date()
|
||||
var dateStr =
|
||||
myDate.getFullYear().toString() +
|
||||
(myDate.getMonth() + 1 >= 10 ? (myDate.getMonth() + 1).toString() : '0' + (myDate.getMonth() + 1).toString()) +
|
||||
(myDate.getDate() > 9 ? myDate.getDate().toString() : '0' + myDate.getDate().toString()) +
|
||||
(myDate.getHours() > 9 ? myDate.getHours().toString() : '0' + myDate.getHours().toString()) +
|
||||
(myDate.getMinutes() > 9 ? myDate.getMinutes().toString() : '0' + myDate.getMinutes().toString()) +
|
||||
(myDate.getSeconds() > 9 ? myDate.getSeconds().toString() : '0' + myDate.getSeconds().toString()) +
|
||||
myDate.getTime().toString().slice(-2);
|
||||
return dateStr
|
||||
}
|
||||
+128
-279
@@ -13,17 +13,8 @@
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-select
|
||||
:placeholder="$t('work.pleaseSelect')"
|
||||
style="width: 160px"
|
||||
v-model="size_form"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in size_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-select :placeholder="$t('work.pleaseSelect')" style="width: 160px" v-model="size_form">
|
||||
<el-option v-for="item in size_type" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -48,17 +39,9 @@
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-select
|
||||
:placeholder="$t('work.pleaseSelect')"
|
||||
style="float: left; margin-left: 10px"
|
||||
v-model="file_form"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in file_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-select :placeholder="$t('work.pleaseSelect')" style="float: left; margin-left: 10px"
|
||||
v-model="file_form">
|
||||
<el-option v-for="item in file_type" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -76,17 +59,9 @@
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-select
|
||||
:placeholder="$t('work.pleaseSelect')"
|
||||
v-model="type_form"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:disabled="item.disabled"
|
||||
>
|
||||
<el-select :placeholder="$t('work.pleaseSelect')" v-model="type_form">
|
||||
<el-option v-for="item in type" :key="item.value" :label="item.label" :value="item.value"
|
||||
:disabled="item.disabled">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -94,25 +69,13 @@
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-popover
|
||||
style="float: right"
|
||||
placement="left"
|
||||
width="600"
|
||||
trigger="click"
|
||||
>
|
||||
<el-popover style="float: right" placement="left" width="600" trigger="click">
|
||||
<div>
|
||||
<el-form :label-position="'right'" label-width="250px">
|
||||
<el-form-item :label="$t('work.better')">
|
||||
<el-select
|
||||
:placeholder="$t('work.pleaseSelect')"
|
||||
v-model="high_setting_form.priority"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in high_setting.priority"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-select :placeholder="$t('work.pleaseSelect')" v-model="high_setting_form.priority">
|
||||
<el-option v-for="item in high_setting.priority" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -124,44 +87,23 @@
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item :label="$t('work.startWorkSpace')">
|
||||
<el-select
|
||||
:placeholder="$t('work.pleaseSelect')"
|
||||
v-model="high_setting_form.target_work"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in high_setting.target_work"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-select :placeholder="$t('work.pleaseSelect')" v-model="high_setting_form.target_work">
|
||||
<el-option v-for="item in high_setting.target_work" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('work.ribbonType')">
|
||||
<el-select
|
||||
:placeholder="$t('work.pleaseSelect')"
|
||||
v-model="high_setting_form.color_type"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in high_setting.color_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-select :placeholder="$t('work.pleaseSelect')" v-model="high_setting_form.color_type">
|
||||
<el-option v-for="item in high_setting.color_type" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('work.formatFile')">
|
||||
<el-select
|
||||
:placeholder="$t('work.pleaseSelect')"
|
||||
v-model="high_setting_form.formatFile"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in high_setting.formatFile"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-select :placeholder="$t('work.pleaseSelect')" v-model="high_setting_form.formatFile">
|
||||
<el-option v-for="item in high_setting.formatFile" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -209,82 +151,47 @@
|
||||
</div>
|
||||
<el-row :gutter="20" style="margin-top: 10px">
|
||||
<el-col :span="12">
|
||||
<el-switch
|
||||
v-model="switch_cont"
|
||||
:active-text="$t('work.addContent')"
|
||||
style="float: left"
|
||||
>
|
||||
<el-switch v-model="switch_cont" :active-text="$t('work.addContent')" style="float: left">
|
||||
</el-switch>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-switch
|
||||
v-model="switch_tag"
|
||||
style="float: right"
|
||||
:active-text="$t('work.addTag')"
|
||||
>
|
||||
<el-switch v-model="switch_tag" style="float: right" :active-text="$t('work.addTag')">
|
||||
</el-switch>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="0" style="margin-top: 10px">
|
||||
<el-col
|
||||
:span="
|
||||
switch_tag && switch_cont ? 12 : switch_tag && !switch_cont ? 0 : 24
|
||||
"
|
||||
>
|
||||
<el-col :span="switch_tag && switch_cont ? 12 : switch_tag && !switch_cont ? 0 : 24
|
||||
">
|
||||
<div class="grid-content bg-purple">
|
||||
<div class="file">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<span
|
||||
style="
|
||||
<span style="
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
"
|
||||
>{{ $t("work.contentTitle") }}</span
|
||||
>
|
||||
">{{ $t("work.contentTitle") }}</span>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-input
|
||||
v-model="juanbiao_form"
|
||||
:placeholder="$t('work.pleaseInput')"
|
||||
style="width: 200px; float: left"
|
||||
>
|
||||
<el-input v-model="juanbiao_form" :placeholder="$t('work.pleaseInput')"
|
||||
style="width: 200px; float: left">
|
||||
<template slot="prepend">
|
||||
{{ $t("work.sign") }}
|
||||
</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:percentage="file_percent"
|
||||
:format="format"
|
||||
style="line-height: 40px"
|
||||
:stroke-width="20"
|
||||
:color="customColors"
|
||||
></el-progress>
|
||||
<el-progress :text-inside="true" :percentage="file_percent" :format="format" style="line-height: 40px"
|
||||
:stroke-width="20" :color="customColors"></el-progress>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="clear: both"></div>
|
||||
<uploader
|
||||
:options="options"
|
||||
class="uploader-example"
|
||||
ref="uploader"
|
||||
@file-added="onFileAdded"
|
||||
@file-removed="onFileRemoved"
|
||||
:autoStart="false"
|
||||
@complete="upload_over"
|
||||
@drop.prevent="onDrag"
|
||||
>
|
||||
<uploader :options="options" class="uploader-example" ref="uploader" @file-added="onFileAdded"
|
||||
@file-removed="onFileRemoved" :autoStart="false" @complete="upload_over" @drop.prevent="onDrag">
|
||||
<uploader-unsupport> </uploader-unsupport>
|
||||
<uploader-drop
|
||||
style="height: 405px"
|
||||
class="drag-bg"
|
||||
:style="'background-image:url(' + bgi + ');'"
|
||||
>
|
||||
<uploader-drop style="height: 405px" class="drag-bg" :style="'background-image:url(' + bgi + ');'">
|
||||
<uploader-btn> {{ $t("work.selectFile") }}</uploader-btn>
|
||||
<uploader-btn :directory="true">{{
|
||||
$t("work.selectFloder")
|
||||
@@ -321,114 +228,61 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="
|
||||
switch_cont && switch_tag ? 12 : switch_cont && !switch_tag ? 0 : 24
|
||||
"
|
||||
>
|
||||
<el-col :span="switch_cont && switch_tag ? 12 : switch_cont && !switch_tag ? 0 : 24
|
||||
">
|
||||
<div class="grid-content bg-purple">
|
||||
<div class="label">
|
||||
<div class="title" style="width: 100%">
|
||||
<div style="display: inline-block; float: left">
|
||||
<div style="float: left">
|
||||
{{ $t("work.tag") }}
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-upload2"
|
||||
style="margin-left: 10px; font-size: 14px"
|
||||
@click="openFile"
|
||||
>
|
||||
<el-button type="text" icon="el-icon-upload2" style="margin-left: 10px; font-size: 14px"
|
||||
@click="openFile">
|
||||
{{ $t("work.importTag") }}
|
||||
</el-button>
|
||||
</div>
|
||||
<!--<el-checkbox v-model="flag">单面打印</el-checkbox>-->
|
||||
<div style="display: inline-block; float: right; right: 0px">
|
||||
<span
|
||||
style="font-size: 14px; color: #606266; font-weight: normal"
|
||||
>
|
||||
<div style="float: right; right: 0px">
|
||||
<span style="font-size: 14px; color: #606266; font-weight: normal">
|
||||
{{ $t("work.print") }}
|
||||
</span>
|
||||
<el-select
|
||||
v-model="print_flag"
|
||||
:placeholder="$t('work.pleaseSelect')"
|
||||
size="mini"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in print_op"
|
||||
v-if="!(flag && item.value == 1)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-select v-model="print_flag" :placeholder="$t('work.pleaseSelect')" size="mini">
|
||||
<el-option v-for="item in print_op" v-if="!(flag && item.value == 1)" :key="item.value"
|
||||
:label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: right"></div>
|
||||
<input
|
||||
type="file"
|
||||
accept=".soon,.cs"
|
||||
@change="fileLoad"
|
||||
ref="refFile"
|
||||
style="display: none"
|
||||
/>
|
||||
<input type="file" accept=".soon,.cs" @change="fileLoad" ref="refFile" style="display: none" />
|
||||
<div style="clear: both"></div>
|
||||
<div class="display">
|
||||
<img
|
||||
v-if="print_flag == 1 || print_flag == 2"
|
||||
:src="fileData.frontDisplayPic"
|
||||
style="
|
||||
<img v-if="print_flag == 1 || print_flag == 2" :src="fileData.frontDisplayPic" style="
|
||||
height: 120px;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
"
|
||||
/>
|
||||
<img
|
||||
v-if="print_flag == 1 || print_flag == 3"
|
||||
:src="fileData.backDisplayPic"
|
||||
style="
|
||||
" />
|
||||
<img v-if="print_flag == 1 || print_flag == 3" :src="fileData.backDisplayPic" style="
|
||||
height: 120px;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
"
|
||||
/>
|
||||
" />
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
height="185"
|
||||
style="width: 100%"
|
||||
:empty-text="$t('work.nodata')"
|
||||
>
|
||||
<el-table :data="tableData" height="185" style="width: 100%" :empty-text="$t('work.nodata')">
|
||||
<el-table-column prop="name" :label="$t('work.fieldName')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" width="400">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<input
|
||||
type="file"
|
||||
accept=".csv"
|
||||
@change="fileLoad2"
|
||||
ref="refFile2"
|
||||
style="display: none"
|
||||
/>
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
:content="
|
||||
file_name == null
|
||||
<input type="file" accept=".csv" @change="fileLoad2" ref="refFile2" style="display: none" />
|
||||
<el-tooltip class="item" effect="dark" :content="file_name == null
|
||||
? $t('work.binfile')
|
||||
: file_name.strLen() > 12
|
||||
? file_name.subCHStr(0, 12) + '...'
|
||||
: file_name
|
||||
"
|
||||
placement="top-start"
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-upload2"
|
||||
style="margin-left: 10px; font-size: 14px"
|
||||
@click="openFile2"
|
||||
>
|
||||
" placement="top-start">
|
||||
<el-button type="text" icon="el-icon-upload2" style="margin-left: 10px; font-size: 14px"
|
||||
@click="openFile2">
|
||||
{{
|
||||
file_name == null
|
||||
? $t("work.binfile")
|
||||
@@ -439,13 +293,7 @@
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<input
|
||||
type="file"
|
||||
accept="..zip,.rar"
|
||||
@change="fileLoad3"
|
||||
ref="refFile3"
|
||||
style="display: none"
|
||||
/>
|
||||
<input type="file" accept="..zip,.rar" @change="fileLoad3" ref="refFile3" style="display: none" />
|
||||
<!--<el-tooltip class="item" effect="dark" :content="file_name3" placement="top-start">
|
||||
<el-button type="text" icon="el-icon-upload2" style="margin-left: 10px;font-size: 14px"
|
||||
@click="openFile3">
|
||||
@@ -455,28 +303,17 @@
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.type == 1">
|
||||
<input
|
||||
type="file"
|
||||
accept="image/*"
|
||||
:ref="scope.row.origin_name"
|
||||
:data-name="scope.row.origin_name"
|
||||
/>
|
||||
<input type="file" accept="image/*" :ref="scope.row.origin_name"
|
||||
:data-name="scope.row.origin_name" />
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
<div v-if="
|
||||
scope.row.type == 3 ||
|
||||
scope.row.type == 4 ||
|
||||
scope.row.type == 5
|
||||
"
|
||||
>
|
||||
">
|
||||
<!--合成文本-->
|
||||
<el-input
|
||||
:placeholder="$t('work.pleaseInput')"
|
||||
v-model="form[scope.row.origin_name]"
|
||||
clearable
|
||||
style="width: calc(100% - 30px) !important"
|
||||
:disabled="csvIsExist"
|
||||
>
|
||||
<el-input :placeholder="$t('work.pleaseInput')" v-model="form[scope.row.origin_name]" clearable
|
||||
style="width: calc(100% - 30px) !important" :disabled="csvIsExist">
|
||||
</el-input>
|
||||
</div>
|
||||
</template>
|
||||
@@ -489,42 +326,26 @@
|
||||
<el-row :gutter="20" style="height: 30px; margin-top: 20px">
|
||||
<el-col :span="14">
|
||||
<div v-if="file_form == 3 && switch_cont">
|
||||
<el-input
|
||||
:placeholder="$t('work.pleasePassword')"
|
||||
style="width: 25%; float: left"
|
||||
show-password
|
||||
v-model="p1"
|
||||
>
|
||||
<el-input :placeholder="$t('work.pleasePassword')" style="width: 25%; float: left" show-password v-model="p1">
|
||||
<template slot="prepend">
|
||||
{{ $t("work.password") }}
|
||||
</template>
|
||||
</el-input>
|
||||
<el-input
|
||||
:placeholder="$t('work.pleasePassword')"
|
||||
style="width: 25%; float: left; margin-left: 10px"
|
||||
show-password
|
||||
v-model="p2"
|
||||
>
|
||||
<el-input :placeholder="$t('work.pleasePassword')" style="width: 25%; float: left; margin-left: 10px"
|
||||
show-password v-model="p2">
|
||||
<template slot="prepend">
|
||||
{{ $t("work.comfirm") }}
|
||||
</template>
|
||||
</el-input>
|
||||
<el-input
|
||||
:placeholder="$t('work.addContent')"
|
||||
style="width: 40%; float: left; margin-left: 10px"
|
||||
v-model="zip_name"
|
||||
>
|
||||
<el-input :placeholder="$t('work.addContent')" style="width: 40%; float: left; margin-left: 10px"
|
||||
v-model="zip_name">
|
||||
<template slot="prepend">
|
||||
{{ $t("work.name") }}
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-else-if="file_form == 2 && switch_cont">
|
||||
<el-input
|
||||
:placeholder="$t('work.addContent')"
|
||||
style="width: 40%; float: left"
|
||||
v-model="zip_name"
|
||||
>
|
||||
<el-input :placeholder="$t('work.addContent')" style="width: 40%; float: left" v-model="zip_name">
|
||||
<template slot="prepend">
|
||||
{{ $t("work.name") }}
|
||||
</template>
|
||||
@@ -533,11 +354,7 @@
|
||||
<div style="width: 100%" v-else> </div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-input
|
||||
:placeholder="$t('work.addContent')"
|
||||
v-model="number"
|
||||
style="width: 200px; float: left"
|
||||
>
|
||||
<el-input :placeholder="$t('work.addContent')" v-model="number" style="width: 200px; float: left">
|
||||
<template slot="prepend">
|
||||
{{ $t("work.num") }}
|
||||
</template>
|
||||
@@ -998,7 +815,8 @@ export default {
|
||||
data1.append(`file${files_n_incr}`, this.$refs.refFile.files[0]); //标签cs文件
|
||||
files_n_incr++;
|
||||
} else {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.pleaseUploadTag"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1057,7 +875,8 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.uploadingTag"),
|
||||
});
|
||||
let pathName;
|
||||
@@ -1065,7 +884,8 @@ export default {
|
||||
//打开本地选项
|
||||
let rootFile = this.$refs.uploader.uploader.getRoot();
|
||||
if (rootFile.fileList.length != 1) {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.oneFolder"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1073,7 +893,8 @@ export default {
|
||||
}
|
||||
let filePath = rootFile.fileList[0];
|
||||
if (!filePath.isFolder) {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.notFolder"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1191,7 +1012,8 @@ export default {
|
||||
}
|
||||
if (!flag) {
|
||||
//报错内容
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.pleaseUploadingImgBin"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1211,7 +1033,8 @@ export default {
|
||||
}
|
||||
i++;
|
||||
}
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.UploadingImgBin"),
|
||||
});
|
||||
let re;
|
||||
@@ -1228,7 +1051,8 @@ export default {
|
||||
re = true;
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.UploadingImgBinFail"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1242,7 +1066,8 @@ export default {
|
||||
if (this.switch_cont) {
|
||||
//开启了左边内容则先左边
|
||||
if (this.size == 0) {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.pleaseUploadContent"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1261,7 +1086,8 @@ export default {
|
||||
return;
|
||||
} else {
|
||||
this.$refs.uploader.uploader.resume();
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.uploadingContent"),
|
||||
});
|
||||
}
|
||||
@@ -1274,7 +1100,8 @@ export default {
|
||||
data1.append(`file${files_n_incr}`, this.$refs.refFile.files[0]); //标签cs文件
|
||||
files_n_incr++;
|
||||
} else {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.pleaseUploadTag"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1330,7 +1157,8 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.uploadingTag"),
|
||||
});
|
||||
this.$axios({
|
||||
@@ -1476,7 +1304,8 @@ export default {
|
||||
let rootFile = this.$refs.uploader.uploader.getRoot();
|
||||
console.log(rootFile);
|
||||
if (rootFile.fileList.length != 1) {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.oneFolder"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1484,7 +1313,8 @@ export default {
|
||||
}
|
||||
let filePath = rootFile.fileList[0];
|
||||
if (!filePath.isFolder) {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.notFolder"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1509,7 +1339,8 @@ export default {
|
||||
!this.$refs.uploader.uploader.isComplete() &&
|
||||
!this.high_setting_form.localfiles
|
||||
) {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.uploadFail"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1532,7 +1363,8 @@ export default {
|
||||
//选择的是zip文档,则名称一定要填写
|
||||
if (this.file_form == 2) {
|
||||
if (this.zip_name == "") {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.zipNameInput"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1543,7 +1375,8 @@ export default {
|
||||
//选择的是zip加密,名称和密码需要校验
|
||||
if (this.file_form == 3) {
|
||||
if (this.zip_name == "") {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.zipNameInput"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1551,7 +1384,8 @@ export default {
|
||||
}
|
||||
data += "&zip_name=" + this.zip_name;
|
||||
if (this.p1 == "" || this.p1 != this.p2) {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.zipPassWrong"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1564,7 +1398,8 @@ export default {
|
||||
if (this.switch_tag) {
|
||||
//标签开启,则标签文件一定要上传
|
||||
if (this.$refs.refFile.files.length == 0) {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.pleaseUploadTag"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1584,7 +1419,8 @@ export default {
|
||||
//打印面数print_flag为1 - 双面的时候,模板flag必须为1 - 双面
|
||||
//打印面数print_flag为2 - 正 的时候 模板正面必须有内容 (flag != 3)
|
||||
//打印面数print_flag为3 - 反 的时候 模板背面必须有内容 (flag != 2)
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.print_flagError"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1593,7 +1429,8 @@ export default {
|
||||
data += "&print_flag=" + this.print_flag; //打印面数需要在开启了标签时,1双 2正3背
|
||||
}
|
||||
if (this.juanbiao_form == "") {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.juanbiaoInput"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1620,7 +1457,8 @@ export default {
|
||||
//}
|
||||
//console.log(data);
|
||||
//console.log(data_param)
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.submiting"),
|
||||
});
|
||||
this.$emit("jobPost");
|
||||
@@ -1633,11 +1471,14 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
file_percent() {
|
||||
const sizeFormNum = parseFloat(this.size_form);
|
||||
if (isNaN(sizeFormNum) || sizeFormNum <= 0) return 0;
|
||||
let t =
|
||||
(this.size /
|
||||
(((this.size_form * 1000) / 1.024 / 1.024 / 1.024) * 1024 * 1024)) *
|
||||
(((sizeFormNum * 1000) / 1.024 / 1.024 / 1.024) * 1024 * 1024)) *
|
||||
100;
|
||||
return t ? t > 100 ? 100.1 : t : 0
|
||||
if (isNaN(t) || !isFinite(t)) return 0;
|
||||
return t > 100 ? 100.1 : t;
|
||||
},
|
||||
print_op() {
|
||||
return [
|
||||
@@ -1812,7 +1653,8 @@ export default {
|
||||
},
|
||||
file_percent(val) {
|
||||
if (val == 100.1) {
|
||||
this.$message({offset:100,
|
||||
this.$message({
|
||||
offset: 100,
|
||||
message: this.$t("work.sizeExtra"),
|
||||
type: "warning",
|
||||
});
|
||||
@@ -1861,6 +1703,7 @@ export default {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
padding: 10px;
|
||||
|
||||
.title {
|
||||
float: left;
|
||||
font-size: 18px;
|
||||
@@ -1869,6 +1712,7 @@ export default {
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
height: 500px;
|
||||
width: 100%;
|
||||
@@ -1895,8 +1739,7 @@ export default {
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.uploader-example .uploader-btn {
|
||||
}
|
||||
|
||||
|
||||
.uploader-example .uploader-list {
|
||||
max-height: 405px;
|
||||
@@ -1904,23 +1747,28 @@ export default {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.uploader-list::-webkit-scrollbar {
|
||||
/*滚动条整体样式*/
|
||||
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
width: 10px;
|
||||
/*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.uploader-list::-webkit-scrollbar-thumb {
|
||||
/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
background: #c7c7cb;
|
||||
}
|
||||
|
||||
.uploader-list::-webkit-scrollbar-track {
|
||||
/*滚动条里面轨道*/
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 10px;
|
||||
background: #ededed;
|
||||
}
|
||||
|
||||
.display {
|
||||
margin-top: 10px;
|
||||
background-color: #212830;
|
||||
@@ -1939,6 +1787,7 @@ export default {
|
||||
/deep/ .uploader-file-name {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/deep/ .el-progress-bar__outer {
|
||||
background-color: #bac2d7;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+71
-10
File diff suppressed because one or more lines are too long
+74
-10
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -38,6 +38,7 @@ if(!localStorage.getItem('lang')){
|
||||
}
|
||||
|
||||
const i18n = new VueI18n({
|
||||
silentTranslationWarn: true,
|
||||
//locale: lan, // 默认语言
|
||||
locale: (function () {
|
||||
if (localStorage.getItem('lang')) {
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
const state = {
|
||||
setFormDefault: {
|
||||
is_blend: false,
|
||||
record_screen: false,
|
||||
record_screen_path: '',
|
||||
print_record_logo: false,
|
||||
install_dongle_count: 0 // Changed from boolean to number (0-256)
|
||||
}
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
SET_FORM_DEFAULT(state, payload) {
|
||||
state.setFormDefault = payload
|
||||
},
|
||||
UPDATE_FORM_DEFAULT(state, payload) {
|
||||
state.setFormDefault = { ...state.setFormDefault, ...payload }
|
||||
}
|
||||
}
|
||||
|
||||
const actions = {
|
||||
setFormDefault({ commit }, payload) {
|
||||
commit('SET_FORM_DEFAULT', payload)
|
||||
},
|
||||
updateFormDefault({ commit }, payload) {
|
||||
commit('UPDATE_FORM_DEFAULT', payload)
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
}
|
||||
Reference in New Issue
Block a user