调整work

This commit is contained in:
24kycj
2025-12-28 12:44:40 +08:00
parent 741387aff2
commit ff6df432ec
29 changed files with 6843 additions and 9126 deletions
+18 -33
View File
@@ -13,39 +13,19 @@
<fileEmpty v-if="allNumber == 0" /> <fileEmpty v-if="allNumber == 0" />
<fileList v-else :list="filesList" :del="delFile" :key="key" /> <fileList v-else :list="filesList" :del="delFile" :key="key" />
<div v-if="progressVisible"> <div v-if="progressVisible">
<el-dialog <el-dialog :close-on-click-modal="false" width="500px" :visible.sync="progressVisible" :append-to-body="true"
:close-on-click-modal="false" class="prodialog">
width="500px" <progressdialog :list="filesList" :overNumber="overNumber" :allNumber="allNumber"
:visible.sync="progressVisible" :changevisiable="changeProgressvisible" :changestate="changestate" :isSucess="isSucess" ref="progressdialog">
:append-to-body="true" </progressdialog>
class="prodialog"
>
<progressdialog
:list="filesList"
:overNumber="overNumber"
:allNumber="allNumber"
:changevisiable="changeProgressvisible"
:changestate="changestate"
:isSucess="isSucess"
ref="progressdialog"
></progressdialog>
</el-dialog> </el-dialog>
</div> </div>
<div v-if="archiverVisible"> <div v-if="archiverVisible">
<el-dialog <el-dialog :close-on-click-modal="false" width="500px" :visible.sync="archiverVisible" :append-to-body="true"
:close-on-click-modal="false" class="archiverDialog" :show-close="false">
width="500px" <archiverdialog :isOver="archiverIsover" :isFalse="archiverIsfalse" :changevisiable="changeArchivervisible">
:visible.sync="archiverVisible" </archiverdialog>
:append-to-body="true"
class="archiverDialog"
:show-close="false"
>
<archiverdialog
:isOver="archiverIsover"
:isFalse="archiverIsfalse"
:changevisiable="changeArchivervisible"
></archiverdialog>
</el-dialog> </el-dialog>
</div> </div>
<slot></slot> <slot></slot>
@@ -476,11 +456,13 @@ export default {
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
} }
.archiverDialog { .archiverDialog {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
/deep/.el-dialog__header { /deep/.el-dialog__header {
padding: 10px; padding: 10px;
} }
@@ -488,12 +470,15 @@ export default {
.files { .files {
width: 100%; width: 100%;
background-color: #f5f5f5; background-color: transparent;
margin: 10px auto 0; margin: 0;
font-size: 12px; font-size: 12px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); box-shadow: none;
position: relative; position: relative;
height: 375px; flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
} }
.btn-group { .btn-group {
+3 -2
View File
@@ -1,5 +1,6 @@
<template> <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> </template>
<script> <script>
export default { export default {
@@ -20,7 +21,7 @@ export default {
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="less" scoped> <style lang="less" scoped>
.empty { .empty {
height: 345px; flex: 1;
width: 100%; width: 100%;
} }
</style> </style>
+7 -3
View File
@@ -27,21 +27,25 @@ export default {
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="less" scoped> <style lang="less" scoped>
.list { .list {
height: 374px; flex: 1;
max-height: 374px; height: auto;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
&::-webkit-scrollbar { &::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/ width: 10px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 1px; height: 1px;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/ /*滚动条里面小方块*/
border-radius: 10px; border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #c7c7cb; background: #c7c7cb;
} }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
/*滚动条里面轨道*/ /*滚动条里面轨道*/
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
@@ -1,10 +1,8 @@
<template> <template>
<div class="dialog"> <div class="dialog">
<div class="progress"> <div class="progress">
<el-progress <el-progress :percentage="Math.min(100, Math.max(0, parseInt(fake.progress * 100) || 0))"
:percentage="parseInt(fake.progress * 100)" :format="format"></el-progress>
:format="format"
></el-progress>
<div class="txt"> <div class="txt">
<div class="over">{{ overNumber }}</div> <div class="over">{{ overNumber }}</div>
<div class="all">/{{ allNumber }}</div> <div class="all">/{{ allNumber }}</div>
@@ -26,20 +24,10 @@
</div> </div>
<div v-else-if="!isSucess" style="color: red">文件上传失败</div> <div v-else-if="!isSucess" style="color: red">文件上传失败</div>
<div class="button"> <div class="button">
<el-button <el-button ref="btnStop" type="success" @click="stop()" :disabled="overNumber == allNumber || !isSucess">{{
ref="btnStop" $t("dialog.stop") }}</el-button>
type="success" <el-button ref="btnOver" type="success" @click="changevisiable(flase)"
@click="stop()" :disabled="overNumber != allNumber && isSucess">{{ $t("dialog.over") }}</el-button>
: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> </div>
</div> </div>
@@ -83,15 +71,17 @@ export default {
getPercent(num, total) { getPercent(num, total) {
num = parseFloat(num); num = parseFloat(num);
total = parseFloat(total); total = parseFloat(total);
if (isNaN(num) || isNaN(total)) { if (isNaN(num) || isNaN(total) || total <= 0) {
return "-"; return 0;
} }
return total <= 0 ? "0" : Math.round((num / total) * 10000) / 10000.0; let per = num / total;
return per > 1 ? 1 : per;
}, },
stop() { stop() {
this.changestate(false); this.changestate(false);
this.isSucess = false; this.isSucess = false;
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("dialog.haveStop"), message: this.$t("dialog.haveStop"),
type: "warning", type: "warning",
}); });
@@ -157,16 +147,17 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.dialog {
}
.progress { .progress {
// border: 1px black solid; // border: 1px black solid;
/deep/ .el-progress-bar { /deep/ .el-progress-bar {
width: 97%; width: 97%;
} }
/deep/.el-progress__text { /deep/.el-progress__text {
float: right; float: right;
} }
.txt { .txt {
position: absolute; position: absolute;
top: 55px; top: 55px;
@@ -183,6 +174,7 @@ export default {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
} }
.all { .all {
// border: 1px black solid; // border: 1px black solid;
color: black; color: black;
@@ -194,17 +186,21 @@ export default {
.records { .records {
max-height: 400px; max-height: 400px;
overflow: auto; overflow: auto;
&::-webkit-scrollbar { &::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/ width: 10px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 1px; height: 1px;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/ /*滚动条里面小方块*/
border-radius: 10px; border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #c7c7cb; background: #c7c7cb;
} }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
/*滚动条里面轨道*/ /*滚动条里面轨道*/
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
@@ -212,13 +208,15 @@ export default {
background: #ededed; background: #ededed;
} }
} }
.record { .record {
margin-top: 15px; margin-top: 15px;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: space-between; justify-content: space-between;
.name {
}
.state { .state {
margin-right: 20px; margin-right: 20px;
} }
@@ -228,6 +226,7 @@ export default {
height: 30px; height: 30px;
width: 100%; width: 100%;
margin-top: 15px; margin-top: 15px;
.button { .button {
float: right; float: right;
display: flex; display: flex;
@@ -235,6 +234,7 @@ export default {
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
width: 50%; width: 50%;
.el-button { .el-button {
display: flex; display: flex;
justify-content: center; justify-content: center;
@@ -243,6 +243,7 @@ export default {
width: 50px; width: 50px;
} }
} }
.text { .text {
line-height: 30px; line-height: 30px;
float: left; float: left;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,24 +1,18 @@
<template> <template>
<div class="screen-recorder"> <div class="screen-recorder">
<el-tooltip <template v-if="!statusOnly">
:content="isRecording ? $t('recorder.stopRecording') : $t('recorder.startRecording')" <el-tooltip :content="isRecording ? $t('recorder.stopRecording') : $t('recorder.startRecording')" placement="top">
placement="top"> <el-button size="medium" :type="isRecording ? 'danger' : 'primary'"
<el-button :icon="isRecording ? 'el-icon-video-pause' : 'el-icon-video-camera'" circle @click="toggleRecording"
size="medium" :loading="loading" class="record-btn">
:type="isRecording ? 'danger' : 'primary'"
:icon="isRecording ? 'el-icon-video-pause' : 'el-icon-video-camera'"
circle
@click="toggleRecording"
:loading="loading"
class="record-btn"
>
</el-button> </el-button>
</el-tooltip> </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-dot"></span>
<span class="recording-text">{{ recordingTime }}</span> <span class="recording-text">{{ statusOnly ? '录制中...' : recordingTime }}</span>
</div> </div>
</div> </div>
</template> </template>
@@ -32,6 +26,10 @@ export default {
taskId: { taskId: {
type: String, type: String,
default: '' default: ''
},
statusOnly: {
type: Boolean,
default: false
} }
}, },
data() { data() {
@@ -44,7 +42,8 @@ export default {
recordingTime: '00:00', recordingTime: '00:00',
timer: null, timer: null,
stream: null, stream: null,
currentTaskId: '' // 录屏开始时的任务ID currentTaskId: '', // 录屏开始时的任务ID
autoSave: true // 是否在停止时保存
}; };
}, },
methods: { methods: {
@@ -56,8 +55,9 @@ export default {
} }
}, },
async startRecording() { async startRecording(options = {}) {
this.loading = true; this.loading = true;
this.autoSave = true;
try { try {
// 调用主进程开始录制 // 调用主进程开始录制
@@ -99,7 +99,10 @@ export default {
}; };
this.mediaRecorder.onstop = async () => { this.mediaRecorder.onstop = async () => {
await this.saveRecording(); if (this.autoSave) {
await this.saveRecording(options.savePath);
}
this.recordedChunks = [];
}; };
// 开始录制 // 开始录制
@@ -121,8 +124,9 @@ export default {
} }
}, },
async stopRecording() { async stopRecording(save = true) {
this.loading = true; this.loading = true;
this.autoSave = save;
try { try {
if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') { if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {
@@ -147,7 +151,12 @@ export default {
} }
}, },
async saveRecording() { async cancelRecording() {
await this.stopRecording(false);
this.$message.info('录制已取消');
},
async saveRecording(customPath) {
if (this.recordedChunks.length === 0) { if (this.recordedChunks.length === 0) {
return; return;
} }
@@ -163,8 +172,8 @@ export default {
reader.onloadend = async () => { reader.onloadend = async () => {
const base64data = reader.result; const base64data = reader.result;
// 发送到主进程保存,传递任务ID // 发送到主进程保存,传递任务ID和可选路径
const result = await ipcRenderer.invoke('stop-recording', base64data, this.currentTaskId); const result = await ipcRenderer.invoke('stop-recording', base64data, this.currentTaskId, customPath);
if (result.success) { if (result.success) {
this.$message.success(this.$t('recorder.savedSuccess') || `录制已保存: ${result.fileName}`); this.$message.success(this.$t('recorder.savedSuccess') || `录制已保存: ${result.fileName}`);
@@ -252,9 +261,12 @@ export default {
} }
@keyframes blink { @keyframes blink {
0%, 100% {
0%,
100% {
opacity: 1; opacity: 1;
} }
50% { 50% {
opacity: 0.3; opacity: 0.3;
} }
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,113 @@
<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" />
<!-- 高级功能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>
<span slot="footer" class="dialog-footer grand-footer">
<div class="footer-left">
<el-button type="warning" size="medium" plain icon="el-icon-key" @click="setAuthCode">
设置授权码
</el-button>
</div>
<div class="footer-buttons">
<el-button @click="handleClose" size="medium" icon="el-icon-close">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" @click="handleSave" size="medium" icon="el-icon-check">{{ $t('common.confirm')
}}</el-button>
</div>
</span>
</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: () => ({})
}
},
computed: {
visibleSync: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
methods: {
handleClose() {
this.visibleSync = false
},
handleSave() {
this.$emit('save')
},
setAuthCode() {
this.$prompt(this.$t('work.inputAuthCode') || '请输入作业授权码', this.$t('work.setAuthCode') || '授权码设置', {
confirmButtonText: this.$t('common.ok') || '确定',
cancelButtonText: this.$t('common.cancel') || '取消',
inputValue: this.form.auth_code || '',
inputPattern: /^[a-zA-Z0-9]*$/,
inputErrorMessage: '授权码格式不正确'
}).then(({ value }) => {
this.$set(this.form, 'auth_code', value);
this.$message({
type: 'success',
message: '授权码已设置'
});
}).catch(() => { });
}
}
}
</script>
<style scoped>
/* 样式将包含在主组件中或按需引入 */
.grand-footer {
display: flex;
justify-content: space-between;
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,153 @@
<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>
</div>
<el-table v-if="tableData && tableData.length > 0" :data="tableData" class="metadata-table flex-grow-table"
:empty-text="$t('work.nodata')" :show-header="false">
<el-table-column prop="name" min-width="110"></el-table-column>
<el-table-column min-width="240">
<template slot-scope="scope">
<div v-if="scope.row.type == 1">
<input type="file" title="" accept="image/*" :ref="scope.row.origin_name"
:data-name="scope.row.origin_name"
@change="(e) => $emit('image-change', scope.row.origin_name, e.target.files[0])" />
</div>
<div v-else-if="scope.row.type == 3 || scope.row.type == 4 || scope.row.type == 5">
<el-input v-model="form[scope.row.origin_name]" clearable size="mini"
:disabled="csvIsExist" />
</div>
<div v-else>{{ scope.row.origin_name }}</div>
</template>
</el-table-column>
<el-table-column min-width="90">
<template slot-scope="scope">
<div v-if="scope.row.type == 3 || scope.row.type == 4 || scope.row.type == 5">
<el-button size="mini" icon="el-icon-upload2" @click="$emit('open-csv')">
{{ file_name ? file_name : $t('work.binfile') }}
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<!-- 空状态占位框 (当无数据时显示) -->
<div v-else class="empty-placeholder-box">
<span class="empty-text">{{ $t('work.nodata') }}</span>
</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
}
},
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)
}
}
}
</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;
}
</style>
+142
View File
@@ -0,0 +1,142 @@
<template>
<div class="task-header-container">
<div class="task-header-flex">
<!-- 容量选择 -->
<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" />
</el-select>
</div>
<!-- 拷贝类型 (work.content screenshot 中显示为 "拷贝类型" 附近位置 ) -->
<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>
<!-- 分区模式 (如果需要显示) -->
<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>
export default {
name: 'TaskHeader',
props: {
juanbiao_form: String,
file_form: Number,
size_form: [Number, String],
type_form: Number,
sizeType: Array
},
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>
+854
View File
@@ -0,0 +1,854 @@
<template>
<div class="work">
<!-- 头部配置区 -->
<!-- 顶部通栏配置与按钮 -->
<div class="top-header-bar">
<!-- 左侧配置表单 -->
<div class="header-settings">
<task-header :file_form.sync="file_form" :size_form.sync="size_form" :type_form.sync="type_form"
:size-type="sizeType" />
</div>
<!-- 右侧功能按钮 -->
<div class="header-buttons">
<!-- 录制组件 (绿色圆形) -->
<div class="recorder-wrapper" v-if="isRecording || high_setting_form.is_print_logo">
<screen-recorder ref="screenRecorder" :task-id="upload_disk" :status-only="true"
@recording-started="onRecordingStarted" @recording-stopped="onRecordingStopped"
@recording-saved="onRecordingSaved" />
<el-tooltip content="打印" placement="top">
<div v-if="high_setting_form.is_print_logo" class="print-logo-indicator">
<img src="static/images/luzhi.png" @error="onLogoError" v-if="!logoError"
class="logo-img" />
<i v-else class="el-icon-printer"></i>
</div>
</el-tooltip>
</div>
<!-- 高级设置按钮 (白色) -->
<el-button size="medium" @click="highSettingVisible = true" class="senior-btn-white"
icon="el-icon-setting">
{{ $t('work.senior') }}
</el-button>
</div>
<!-- 隐藏的组件 -->
<advanced-settings :visible.sync="highSettingVisible" :form="high_setting_form" :file-form="file_form"
@save="saveHighSettings" @test-recording="handleTestRecording" />
<network-auth-dialog :visible="networkAuthVisible" :network-paths="networkAuthPaths"
@confirm="onNetworkAuthConfirm" @cancel="onNetworkAuthCancel" />
</div>
<!-- 主体左内容 + 右标签 -->
<el-row :gutter="20" class="main-content-row">
<!-- 内容管理 -->
<el-col :span="switch_cont && switch_tag ? 12 : 24" v-if="switch_cont">
<file-management ref="files" :save-work-list="saveWorkList" :juanbiao="juanbiao_form"
@update:juanbiao="juanbiao_form = $event" @size-change="onSizeChange" @upload-over="upload_over"
@network-paths-changed="onNetworkPathsChanged">
<template slot="progress">
<el-progress :text-inside="true" :percentage="file_percent" :format="formatSize"
class="size-progress" :stroke-width="20" :color="customColors" />
</template>
</file-management>
</el-col>
<!-- 标签管理 -->
<el-col :span="switch_cont && switch_tag ? 12 : 24" v-if="switch_tag">
<tag-metadata ref="tagRef" :templates="templates" :current-template.sync="currentTemplate"
:file-data="fileData" :print-flag.sync="print_flag" :table-data="tableData" :form="form"
:csv-is-exist="csvIsExist" :file_name="file_name" @template-change="changeTemplate"
@open-design="openDesign" @open-file="openFile" @open-csv="openFile2"
@image-change="onMetadataImageChange" />
</el-col>
</el-row>
<!-- 底部操作栏 -->
<div class="footer-actions">
<div class="left-info">
<div class="stat-item">
<label class="stat-label">{{ $t('work.num') }}:</label>
<el-input-number v-model="number" :min="1" size="mini" controls-position="right"
class="count-input-new" />
</div>
</div>
<div class="right-buttons">
<el-button type="success" size="small" @click="saveWork" class="footer-btn">
{{ $t('work.save') }}
</el-button>
<el-button type="success" size="medium" @click="upload" :loading="submitLoading"
class="footer-btn submit-btn">
{{ $t('work.submit') }}
</el-button>
</div>
</div>
<!-- 隐藏的文件选择器 -->
<input type="file" accept=".cs,.soon" @change="fileLoad" ref="refFile" style="display: none" />
<input type="file" accept=".csv" @change="fileLoad2" ref="refFile2" style="display: none" />
<input type="file" accept="..zip,.rar" @change="fileLoad3" ref="refFile3" style="display: none" />
</div>
</template>
<script>
import TaskHeader from './TaskHeader.vue'
import AdvancedSettings from './AdvancedSettings.vue'
import FileManagement from './FileManagement.vue'
import TagMetadata from './TagMetadata.vue'
import ScreenRecorder from '../recorder/ScreenRecorder.vue'
import NetworkAuthDialog from '../NetworkAuthDialog.vue'
import { extendStringPrototypes, getNowFormatDate, genTaskUUID } from './utils'
// Node/Electron imports
const fs = require('fs')
const path = require('path')
const remote = require('@electron/remote')
const { dialog } = remote
const { ipcRenderer } = require('electron')
export default {
name: 'WorkMain',
components: {
TaskHeader,
AdvancedSettings,
FileManagement,
TagMetadata,
ScreenRecorder,
NetworkAuthDialog
},
props: {
dice: Number,
saveWorkList: Object,
isNew: Boolean,
printerList: Array,
shareDisk: String,
isCopy: { type: Boolean, default: false },
filterPassedType: { type: Array, default: () => [] },
sizeType: { type: Array, default: () => [] }
},
data() {
return {
// 业务状态
juanbiao_form: '',
file_form: 0,
size_form: null,
type_form: 0,
number: 1,
// 对话框与引导
highSettingVisible: false,
networkAuthVisible: false,
networkAuthPaths: [],
networkCredentials: {},
// 录制状态
isRecording: false,
// 模板与数据
templates: [],
currentTemplate: '',
fileData: {},
tableData: [],
form: {},
fileLists: [],
file_name: null,
csvIsExist: false,
metadataFiles: {},
// 其他
upload_disk: '',
size: 0,
print_flag: 1,
switch_cont: true,
switch_tag: true,
submitLoading: false,
flag_cont_up: false,
customColors: [
{ color: '#67C23A', percentage: 99 },
{ color: '#F56C6C', percentage: 100 }
],
logoError: false,
// 高级设置表单
high_setting_form: {
priority: 0,
fileSystem: 0,
target_work: 0,
color_type: 0,
s1: false,
s2: false,
s3: false,
s4: false,
s5: false,
pass: '',
repass: '',
localfiles: false,
formatFile: 0,
Span_USBcard: false,
hasAddFile: false,
is_blend: false,
is_record: false,
record_path: '',
is_print_logo: false,
is_generate_iso: false,
iso_file_name: '',
is_generate_zip: false,
zip_file_name: '',
is_zip_encrypt: false,
zip_password: '',
zip_repassword: '',
copy_hash: false,
is_dongle_count: false,
dongle_count: 0,
auth_code: ''
}
}
},
computed: {
file_percent() {
if (!this.size_form || isNaN(parseFloat(this.size_form))) return 0
let mb = parseFloat(this.size_form) * 931.3
if (mb <= 0) return 0
let per = (this.size / (1024 * 1024) / mb) * 100
if (isNaN(per) || !isFinite(per)) return 0
return per > 100 ? 100 : parseFloat(per.toFixed(1))
}
},
created() {
extendStringPrototypes()
this.upload_disk = genTaskUUID()
},
mounted() {
this.initData()
},
beforeDestroy() {
this.cancelRecordingIfActive()
},
methods: {
initData() {
const high = localStorage.getItem('high_setting_form')
if (high) {
try {
const savedForm = JSON.parse(high);
// 排除掉不需要持久化的字段,确保每次打开默认不选中
const defaults = {
is_generate_iso: false,
is_generate_zip: false,
is_zip_encrypt: false
};
this.high_setting_form = { ...this.high_setting_form, ...savedForm, ...defaults }
// 仅在路径为空时初始化默认路径(兼容三端)
if (!this.high_setting_form.record_path) {
this.high_setting_form.record_path = this.getDefaultRecordPath();
}
} catch (e) {
console.error('Failed to parse high settings')
}
} else {
// 无缓存时初始化默认路径
this.high_setting_form.record_path = this.getDefaultRecordPath();
}
this.juanbiao_form = getNowFormatDate()
this.print_flag = this.dice === 1 ? 2 : 1
this.loadNetworkCredentials()
this.getTemplates()
},
// --- 高级设置与录制 ---
getDefaultRecordPath() {
try {
let root = process.env.NODE_ENV === "development"
? process.cwd()
: path.dirname(remote.app.getPath("exe"));
return path.join(root, 'videos');
} catch (e) {
return path.join(process.cwd(), 'videos');
}
},
saveHighSettings() {
localStorage.setItem('high_setting_form', JSON.stringify(this.high_setting_form))
this.$message.success(this.$t('dispose.successReserve'))
this.highSettingVisible = false
},
autoStartRecording() {
// 已废弃,改为显式手动开始或提交时自动停止
},
async stopRecordingIfActive() {
if (this.$refs.screenRecorder && this.$refs.screenRecorder.isRecording) {
await this.$refs.screenRecorder.stopRecording(true); // 提交时保存
}
},
async cancelRecordingIfActive() {
if (this.$refs.screenRecorder && this.$refs.screenRecorder.isRecording) {
await this.$refs.screenRecorder.cancelRecording(); // 环境关闭时取消
}
},
onRecordingStarted() { this.isRecording = true },
onRecordingStopped() { this.isRecording = false },
onRecordingSaved(result) { this.$message.success(`录制已保存: ${result.fileName}`) },
handleTestRecording(recordPath) {
const recorder = this.$refs.screenRecorder;
if (recorder) {
if (recorder.isRecording) {
recorder.stopRecording(true);
} else {
recorder.startRecording({
savePath: recordPath || this.getDefaultRecordPath()
});
}
} else {
this.$message.error('未找到录像组件');
}
},
onLogoError() {
this.logoError = true;
},
// --- 文件管理回调 ---
onSizeChange(size) { this.size = size },
formatSize() {
if (!this.size_form || isNaN(parseFloat(this.size_form))) return '0MB / 0MB'
let mb = (parseFloat(this.size_form) * 931.3).toFixed(0)
return (this.size / (1024 * 1024)).toFixed(1) + 'MB / ' + mb + 'MB'
},
// --- 标签页逻辑 ---
openDesign() {
ipcRenderer.send('openDesign')
},
openFile() { this.$refs.refFile.click() },
openFile2() { this.$refs.refFile2.click() },
fileLoad() {
this.fileLists = this.$refs.refFile.files
if (this.fileLists[0]) {
const reader = new FileReader()
reader.onload = (e) => this.readFile(e.target.result)
reader.readAsText(this.fileLists[0])
}
},
readFile(content) {
try {
const data = JSON.parse(content)
this.fileData = data
this.tableData = data.tableData || []
this.currentTemplate = ''
} catch (e) {
this.$message.error('无效的标签文件')
}
},
fileLoad2() {
this.file_name = this.$refs.refFile2.files[0].name
this.csvLoad()
},
csvLoad() {
const selectedFile = this.$refs.refFile2.files[0]
const reader = new FileReader()
reader.onload = (e) => {
const lines = e.target.result.split('\n')
if (lines.length >= 2) {
const headers = lines[0].replace('\r', '').split(',')
const values = lines[1].replace('\r', '').split(',')
headers.forEach((h, i) => {
if (h) this.$set(this.form, h, values[i])
})
this.csvIsExist = true
}
}
reader.readAsText(selectedFile)
},
fileLoad3() {
this.file_name3 = this.$refs.refFile3.files[0].name
},
getTemplates() {
const templateDir = path.join(remote.app.getPath('userData'), 'User Templates')
if (!fs.existsSync(templateDir)) {
try { fs.mkdirSync(templateDir, { recursive: true }) } catch (e) { console.error(e) }
}
fs.readdir(templateDir, (err, files) => {
if (!err) {
this.templates = files.filter(f => f.endsWith('.cs') || f.endsWith('.soon')).map(file => ({
label: file,
value: path.join(templateDir, file)
}))
}
})
},
changeTemplate(templatePath) {
if (!templatePath) return
fs.readFile(templatePath, 'utf8', (err, data) => {
if (!err) this.readFile(data)
})
},
onMetadataImageChange(fieldName, file) {
if (fieldName && file) {
this.$set(this.metadataFiles, fieldName, file)
}
},
// --- 网络认证 ---
loadNetworkCredentials() {
try {
const stored = localStorage.getItem('networkCredentials')
if (stored) this.networkCredentials = JSON.parse(stored)
} catch (e) { console.error(e) }
},
onNetworkPathsChanged(paths) {
this.networkAuthPaths = paths || []
this.networkAuthVisible = paths && paths.length > 0
},
onNetworkAuthConfirm(netInfo) {
this.networkCredentials = netInfo
this.networkAuthVisible = false
this.performSubmit()
},
onNetworkAuthCancel() {
this.networkAuthVisible = false
},
// --- 提交逻辑 ---
async upload() {
console.log('--- 开始提交作业 ---')
if (!this.size_form) {
console.warn('未选择容量')
return this.$message.warning(this.$t('work.size_form_error'))
}
// 检查容量限制
if (!this.high_setting_form.Span_USBcard) {
const maxSize = (this.size_form * 1000 / 1.024 / 1.024 / 1.024) * 1024 * 1024
if (this.size > maxSize) return this.$message.warning(this.$t('work.sizeExtra'))
}
// ISO/ZIP 前置验证
if (this.high_setting_form.is_generate_iso && !this.high_setting_form.iso_file_name) {
return this.$message.warning(this.$t('work.isoNameInput'))
}
if (this.high_setting_form.is_generate_zip) {
if (!this.high_setting_form.zip_file_name) return this.$message.warning(this.$t('work.zipNameInput'))
if (this.high_setting_form.is_zip_encrypt) {
if (!this.high_setting_form.zip_password) return this.$message.warning(this.$t('work.pleasePassword'))
if (this.high_setting_form.zip_password !== this.high_setting_form.zip_repassword) {
return this.$message.warning(this.$t('work.zipPassWrong'))
}
}
}
const hasFiles = this.$refs.files && this.$refs.files.allNumber > 0;
if (hasFiles) {
console.log('检测到待上传文件数量:', this.$refs.files.allNumber)
this.flag_cont_up = true
this.$refs.files.resume(this.file_form)
} else {
console.log('无待上传文件或未打开内容管理,直接执行提交')
this.upload_over()
}
},
upload_over() {
console.log('文件上传/准备就绪, flag_cont_up:', this.flag_cont_up)
if (this.flag_cont_up) {
this.submitAndTag()
} else {
this.performSubmit()
}
},
async submitAndTag() {
console.log('--- 执行 submitAndTag ---')
// 这里的逻辑处理标签文件的上传
const data1 = new FormData()
let hasFile = false
if (this.isNew) {
if (this.fileLists[0]) {
data1.append('file1', this.fileLists[0])
hasFile = true
}
} else if (this.fileData) {
const _file = new File([JSON.stringify(this.fileData)], this.saveWorkList.taskName, { type: 'text/plain' })
data1.append('file1', _file)
hasFile = true
}
if (!hasFile && this.switch_tag) {
console.warn('标签管理已打开但未上传标签文件')
return this.$message.warning(this.$t('work.pleaseUploadTag'))
}
// 添加 CSV 文件
if (this.$refs.refFile2 && this.$refs.refFile2.files[0]) {
data1.append('file2', this.$refs.refFile2.files[0])
}
// 添加 Bin/Img 文件 (refFile3)
if (this.$refs.refFile3 && this.$refs.refFile3.files[0]) {
data1.append('file3', this.$refs.refFile3.files[0])
}
// 添加元数据图片
if (this.tableData && this.tableData.length > 0) {
this.tableData.forEach(row => {
if (row.type == 1 && this.metadataFiles[row.origin_name]) {
data1.append(row.origin_name, this.metadataFiles[row.origin_name])
}
})
}
this.$message.info(this.$t('work.uploadingTag'))
const pathName = this.high_setting_form.localfiles ? 'local' : this.upload_disk
this.$axios.post('/upload/' + pathName, data1).then(() => {
this.performSubmit()
}).catch(err => {
this.$message.error(this.$t('work.uploadFail'))
})
},
async performSubmit() {
console.log('--- 执行 performSubmit ---')
try {
await this.stopRecordingIfActive()
console.log('录像停止检查完成')
} catch (e) {
console.error('停止录像失败:', e)
}
this.submitLoading = true
console.log('submitLoading 已设为 true')
// 构建原始参数字符串
let data_param = 'CardSoon_File=' + (this.high_setting_form.localfiles ? 'local' : this.upload_disk)
console.log('--- 提交作业数据预览 ---')
console.log('任务ID:', this.upload_disk)
console.log('高级设置:', JSON.parse(JSON.stringify(this.high_setting_form)))
// 拼接标签文件、CSV等参数(简化演示,实际应完整复制)
let data = `&label=${encodeURIComponent(this.juanbiao_form)}`
data += `&printCopys=${this.number}`
data += `&disk_size=${this.size_form}`
data += `&zone_type=${this.type_form}`
data += `&hasPrintTask=${!!this.switch_tag}`
data += `&hasCopyTask=${this.$refs.files ? this.$refs.files.allNumber > 0 : false}`
data += `&copy_cache_data=${this.isCopy}`
data += `&SpanUcard=${this.high_setting_form.Span_USBcard}`
data += `&hash=${this.high_setting_form.s1}`
data += `&md5=${this.high_setting_form.s2}`
data += `&printer=${this.high_setting_form.target_work}`
if (this.high_setting_form.formatFile !== 0) {
data += `&formatFile=${this.high_setting_form.formatFile}`
}
// --- 兼容旧版字段与新增强制提交字段 ---
// 基础开关
data += `&local=${!!this.high_setting_form.localfiles}`
data += `&version=local` // 单机版标识
data += `&hasAddFile=${!!this.high_setting_form.hasAddFile}` // 拷贝附加文件
// ISO/ZIP 高级功能
data += `&is_generate_iso=${!!this.high_setting_form.is_generate_iso}`
data += `&iso_file_name=${encodeURIComponent(this.high_setting_form.iso_file_name || '')}`
data += `&is_generate_zip=${!!this.high_setting_form.is_generate_zip}`
data += `&zip_file_name=${encodeURIComponent(this.high_setting_form.zip_file_name || '')}`
data += `&is_zip_encrypt=${!!this.high_setting_form.is_zip_encrypt}`
data += `&zip_password=${encodeURIComponent(this.high_setting_form.zip_password || '')}`
// 硬件与安全
data += `&copy_hash=${!!this.high_setting_form.copy_hash}`
data += `&enable_dongle_counter=${!!this.high_setting_form.is_dongle_count}`
data += `&donglel_install_count=${this.high_setting_form.dongle_count || 0}`
data += `&auth_code=${encodeURIComponent(this.high_setting_form.auth_code || '')}`
// 录像与标识
data += `&is_blend=${!!this.high_setting_form.is_blend}`
data += `&is_printer_record_logo=${!!this.high_setting_form.is_print_logo}`
// 录像路径逻辑:如果正在录像或已结束,则传递路径
if (this.high_setting_form.is_record) {
// 优先使用录像组件反馈的路径,否则使用配置路径
const videoPath = (this.$refs.screenRecorder && this.$refs.screenRecorder.videoPath) || this.high_setting_form.record_path
data += `&record_path=${encodeURIComponent(videoPath || '')}`
} else {
data += `&record_path=`
}
// 文件类型映射 (0:File -> 1, 1:ISO -> 2, 2:Encrypt -> 3, 4:Forbid -> 4)
const fileTypeMap = { 0: 1, 1: 2, 2: 3, 4: 4 }
let apiFileType = fileTypeMap[this.file_form] || 1
data += `&file_type=${apiFileType}`
// 网络路径认证信息 (若存在)
if (this.networkCredentials && (Array.isArray(this.networkCredentials) ? this.networkCredentials.length > 0 : Object.keys(this.networkCredentials).length > 0)) {
data += `&net_info=${encodeURIComponent(JSON.stringify(this.networkCredentials))}`
}
console.log('--- 最终提交 URL 参数 ---')
console.log(data_param + data)
const url = '/rest/job/?' + data_param + data
if (!this.isCopy) {
console.log('执行本地路径提交 (Local Mode)')
this.localUpload(this.upload_disk, data_param, data)
} else {
console.log('执行普通网络提交 (Copy Mode)')
this.$axios.post(url)
.then(() => {
this.$message.success(this.$t('work.submitSuccess'))
this.$emit('jobPost')
})
.catch((err) => {
console.error('提交任务失败:', err)
this.$message.error(this.$t('index.fail'))
})
.finally(() => this.submitLoading = false)
}
},
localUpload(pathName, data_param, data) {
const filesList = this.$refs.files.getLists()
let file_path = []
for (let i in filesList) {
file_path.push(filesList[i].path)
}
const jsonData = { files: file_path }
const jsonFilePath = path.join(remote.app.getPath('userData'), 'filepath.json')
try {
fs.writeFileSync(jsonFilePath, JSON.stringify(jsonData), 'utf-8')
const fileContent = fs.readFileSync(jsonFilePath)
const blob = new Blob([fileContent], { type: 'application/json' })
const formData = new FormData()
formData.append('file', blob, 'filepath.json')
if (this.networkCredentials && (Array.isArray(this.networkCredentials) ? this.networkCredentials.length > 0 : Object.keys(this.networkCredentials).length > 0)) {
formData.append('net_info', JSON.stringify(this.networkCredentials))
}
this.submitLoading = true
this.$axios.post(`/upload/${pathName}`, formData).then(() => {
this.$axios.post('/rest/job/?' + data_param + data).then(() => {
this.$message.success(this.$t('work.submitSuccess'))
this.$emit('jobPost')
}).catch(err => {
this.$message.error(this.$t('index.fail'))
}).finally(() => this.submitLoading = false)
}).catch(err => {
this.$message.error('Local upload failed')
this.submitLoading = false
})
} catch (e) {
console.error(e)
this.$message.error('Failed to create file list')
this.submitLoading = false
}
},
saveWork() {
const save = {
fileData: this.fileData,
tableData: this.tableData,
juanbiao: this.juanbiao_form,
size_form: this.size_form,
type_form: this.type_form,
high_setting: this.high_setting_form
}
dialog.showSaveDialog({
title: 'Save Task',
filters: [{ name: 'Soon Work', extensions: ['swk'] }]
}).then(result => {
if (result.filePath) fs.writeFileSync(result.filePath, JSON.stringify(save))
})
}
}
}
</script>
<style>
/* 全局辅助样式,用于处理对话框等 body 级元素 */
@import './styles/compact-layout.css';
</style>
<style scoped>
@import './styles/work-styles.css';
/* 全局辅助样式 */
.work {
padding: 20px 25px;
/* Increased padding */
margin: 0 auto;
width: 100%;
}
.top-header-bar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
/* Added spacing between header and cards */
padding: 0 10px;
}
/* 响应式适配:小窗口高度压缩 */
@media (max-height: 850px) {
.work {
padding: 5px 15px;
}
.top-header-bar {
margin-bottom: 8px;
}
.footer-actions {
margin-top: 5px;
padding: 5px 20px;
border-top: 1px solid #eee;
}
}
.header-settings {
flex: 1;
}
.header-buttons {
display: flex;
align-items: center;
padding-top: 5px;
gap: 15px;
}
.recorder-wrapper {
display: flex;
align-items: center;
gap: 8px;
background: rgba(109, 193, 76, 0.05);
padding: 2px 8px 2px 2px;
border-radius: 25px;
border: 1px solid rgba(109, 193, 76, 0.1);
}
.print-logo-indicator {
width: 30px;
height: 30px;
background: #fff;
border: 1px dashed #409EFF;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
color: #409EFF;
font-size: 18px;
box-shadow: 0 2px 4px rgba(64, 158, 255, 0.1);
transition: all 0.3s;
overflow: hidden;
}
.logo-img {
width: 100%;
height: 100%;
object-fit: contain;
padding: 2px;
}
.print-logo-indicator:hover {
border-style: solid;
transform: scale(1.05);
}
.senior-btn-white {
background: #fff;
border: 1px solid #dcdfe6;
color: #606266;
border-radius: 8px;
padding: 8px 16px;
font-weight: 500;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.senior-btn-white:hover {
color: #409eff;
border-color: #409eff;
background-color: #fff;
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.15);
transform: translateY(-1px);
}
.main-content-row {
margin: 0 !important;
/* Reset margin */
}
/* Footer alignment */
.footer-actions {
margin-top: 15px;
padding: 15px 25px;
display: flex;
justify-content: flex-end;
align-items: center;
gap: 20px;
border-top: 1px solid #ebeef5;
background-color: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(4px);
}
.left-info {
margin-right: 15px;
}
.count-input-new {
width: 100px;
/* Wider input */
margin-left: 10px;
}
.footer-btn {
min-width: 90px;
padding: 10px 24px;
border-radius: 12px;
font-weight: 600;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
border: none;
}
.footer-btn.el-button--success {
background: #67c23a;
border-color: #67c23a;
box-shadow: none;
color: white;
}
.footer-btn.el-button--success:hover {
background: #85ce61;
border-color: #85ce61;
transform: none;
}
.submit-btn {
min-width: 120px;
}
/* 深度选择器穿透 */
.work ::v-deep .uploader-file-name {
text-align: left;
}
.work ::v-deep .el-progress-bar__outer {
background-color: #bac2d7;
}
.work ::v-deep .uploader-file-progress {
background-color: #b0ee91;
}
.work ::v-deep .el-input__inner {
height: 32px;
line-height: 32px;
}
.work ::v-deep .el-input__suffix .el-input__icon {
height: 32px;
line-height: 32px;
}
</style>
+3
View File
@@ -0,0 +1,3 @@
import WorkMain from './WorkMain.vue'
export default WorkMain
@@ -0,0 +1,126 @@
<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.has_counter"></el-switch>
</div>
</div>
<!-- 计数器详细 -->
<div v-if="form.has_counter" class="mt-10 p-10"
style="background: #fdf6ec; border-radius: 6px; border: 1px solid #faecd8;">
<el-form-item :label="$t('work.installCount')" label-width="140px" class="mb-0">
<el-input-number v-model="form.install_count" :min="1" size="mini" />
</el-form-item>
</div>
</div>
</template>
<script>
export default {
name: 'AdvancedFeatures',
props: {
form: {
type: Object,
required: true
},
fileForm: {
type: Number,
default: 0
}
}
}
</script>
@@ -0,0 +1,86 @@
<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
}
},
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() {
// 这里原本是从父组件传入,或者硬编码
return [{ value: 0, label: this.$t("work.any") || '任一' }]
},
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: 1, label: 'FAT32' },
{ value: 2, label: 'exFAT' },
{ value: 3, label: 'NTFS' }
]
}
}
}
</script>
@@ -0,0 +1,52 @@
<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.is_dongle_count">
{{ $t('work.installDongle') || '加密狗计数' }}
</el-checkbox>
</div>
<transition name="el-zoom-in-top">
<div v-if="form.is_dongle_count" class="ml-20">
<el-form-item :label="$t('work.installCount') || '安装次数'" label-width="80px">
<el-input-number size="small" v-model="form.dongle_count" :min="1" :max="999" />
</el-form-item>
</div>
</transition>
</div>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('work.setAuthCode') || '授权码'" label-width="80px">
<el-input size="small" v-model="form.auth_code"
:placeholder="$t('work.inputAuthCode') || '输入授权码'" />
</el-form-item>
</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,125 @@
<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.is_record"></el-switch>
</div>
<div class="g-switch-item" v-if="form.is_record">
<div class="flex-align-center">
<span class="g-label">{{ $t('work.printRecordLogo') }}</span>
<i v-if="form.is_print_logo" class="el-icon-picture ml-5 logo-icon-active"
title="luzhi.png"></i>
</div>
<el-switch v-model="form.is_print_logo"></el-switch>
</div>
</div>
<div v-if="form.is_record" class="path-box-container">
<div class="path-box">
<el-form-item :label="$t('work.recordPath')" label-width="110px">
<el-input v-model="form.record_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_path', result.filePaths[0])
}
})
},
testRecording() {
this.$emit('test-recording', this.form.record_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;
}
}
+75
View File
@@ -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
View File
@@ -13,17 +13,8 @@
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<div class="grid-content bg-purple"> <div class="grid-content bg-purple">
<el-select <el-select :placeholder="$t('work.pleaseSelect')" style="width: 160px" v-model="size_form">
:placeholder="$t('work.pleaseSelect')" <el-option v-for="item in size_type" :key="item.value" :label="item.label" :value="item.value">
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-option>
</el-select> </el-select>
</div> </div>
@@ -48,17 +39,9 @@
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<div class="grid-content bg-purple"> <div class="grid-content bg-purple">
<el-select <el-select :placeholder="$t('work.pleaseSelect')" style="float: left; margin-left: 10px"
:placeholder="$t('work.pleaseSelect')" v-model="file_form">
style="float: left; margin-left: 10px" <el-option v-for="item in file_type" :key="item.value" :label="item.label" :value="item.value">
v-model="file_form"
>
<el-option
v-for="item in file_type"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@@ -76,17 +59,9 @@
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<div class="grid-content bg-purple"> <div class="grid-content bg-purple">
<el-select <el-select :placeholder="$t('work.pleaseSelect')" v-model="type_form">
:placeholder="$t('work.pleaseSelect')" <el-option v-for="item in type" :key="item.value" :label="item.label" :value="item.value"
v-model="type_form" :disabled="item.disabled">
>
<el-option
v-for="item in type"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@@ -94,25 +69,13 @@
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-popover <el-popover style="float: right" placement="left" width="600" trigger="click">
style="float: right"
placement="left"
width="600"
trigger="click"
>
<div> <div>
<el-form :label-position="'right'" label-width="250px"> <el-form :label-position="'right'" label-width="250px">
<el-form-item :label="$t('work.better')"> <el-form-item :label="$t('work.better')">
<el-select <el-select :placeholder="$t('work.pleaseSelect')" v-model="high_setting_form.priority">
:placeholder="$t('work.pleaseSelect')" <el-option v-for="item in high_setting.priority" :key="item.value" :label="item.label"
v-model="high_setting_form.priority" :value="item.value">
>
<el-option
v-for="item in high_setting.priority"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -124,44 +87,23 @@
</el-select> </el-select>
</el-form-item>--> </el-form-item>-->
<el-form-item :label="$t('work.startWorkSpace')"> <el-form-item :label="$t('work.startWorkSpace')">
<el-select <el-select :placeholder="$t('work.pleaseSelect')" v-model="high_setting_form.target_work">
:placeholder="$t('work.pleaseSelect')" <el-option v-for="item in high_setting.target_work" :key="item.value" :label="item.label"
v-model="high_setting_form.target_work" :value="item.value">
>
<el-option
v-for="item in high_setting.target_work"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('work.ribbonType')"> <el-form-item :label="$t('work.ribbonType')">
<el-select <el-select :placeholder="$t('work.pleaseSelect')" v-model="high_setting_form.color_type">
:placeholder="$t('work.pleaseSelect')" <el-option v-for="item in high_setting.color_type" :key="item.value" :label="item.label"
v-model="high_setting_form.color_type" :value="item.value">
>
<el-option
v-for="item in high_setting.color_type"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('work.formatFile')"> <el-form-item :label="$t('work.formatFile')">
<el-select <el-select :placeholder="$t('work.pleaseSelect')" v-model="high_setting_form.formatFile">
:placeholder="$t('work.pleaseSelect')" <el-option v-for="item in high_setting.formatFile" :key="item.value" :label="item.label"
v-model="high_setting_form.formatFile" :value="item.value">
>
<el-option
v-for="item in high_setting.formatFile"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -209,82 +151,47 @@
</div> </div>
<el-row :gutter="20" style="margin-top: 10px"> <el-row :gutter="20" style="margin-top: 10px">
<el-col :span="12"> <el-col :span="12">
<el-switch <el-switch v-model="switch_cont" :active-text="$t('work.addContent')" style="float: left">
v-model="switch_cont"
:active-text="$t('work.addContent')"
style="float: left"
>
</el-switch> </el-switch>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-switch <el-switch v-model="switch_tag" style="float: right" :active-text="$t('work.addTag')">
v-model="switch_tag"
style="float: right"
:active-text="$t('work.addTag')"
>
</el-switch> </el-switch>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="0" style="margin-top: 10px"> <el-row :gutter="0" style="margin-top: 10px">
<el-col <el-col :span="switch_tag && switch_cont ? 12 : switch_tag && !switch_cont ? 0 : 24
:span=" ">
switch_tag && switch_cont ? 12 : switch_tag && !switch_cont ? 0 : 24
"
>
<div class="grid-content bg-purple"> <div class="grid-content bg-purple">
<div class="file"> <div class="file">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="3"> <el-col :span="3">
<span <span style="
style="
font-size: 18px; font-size: 18px;
font-weight: 700; font-weight: 700;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
text-align: left; text-align: left;
" ">{{ $t("work.contentTitle") }}</span>
>{{ $t("work.contentTitle") }}</span
>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-input <el-input v-model="juanbiao_form" :placeholder="$t('work.pleaseInput')"
v-model="juanbiao_form" style="width: 200px; float: left">
:placeholder="$t('work.pleaseInput')"
style="width: 200px; float: left"
>
<template slot="prepend"> <template slot="prepend">
{{ $t("work.sign") }} {{ $t("work.sign") }}
</template> </template>
</el-input> </el-input>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-progress <el-progress :text-inside="true" :percentage="file_percent" :format="format" style="line-height: 40px"
:text-inside="true" :stroke-width="20" :color="customColors"></el-progress>
:percentage="file_percent"
:format="format"
style="line-height: 40px"
:stroke-width="20"
:color="customColors"
></el-progress>
</el-col> </el-col>
</el-row> </el-row>
<div style="clear: both"></div> <div style="clear: both"></div>
<uploader <uploader :options="options" class="uploader-example" ref="uploader" @file-added="onFileAdded"
:options="options" @file-removed="onFileRemoved" :autoStart="false" @complete="upload_over" @drop.prevent="onDrag">
class="uploader-example"
ref="uploader"
@file-added="onFileAdded"
@file-removed="onFileRemoved"
:autoStart="false"
@complete="upload_over"
@drop.prevent="onDrag"
>
<uploader-unsupport> </uploader-unsupport> <uploader-unsupport> </uploader-unsupport>
<uploader-drop <uploader-drop style="height: 405px" class="drag-bg" :style="'background-image:url(' + bgi + ');'">
style="height: 405px"
class="drag-bg"
:style="'background-image:url(' + bgi + ');'"
>
<uploader-btn> {{ $t("work.selectFile") }}</uploader-btn> <uploader-btn> {{ $t("work.selectFile") }}</uploader-btn>
<uploader-btn :directory="true">{{ <uploader-btn :directory="true">{{
$t("work.selectFloder") $t("work.selectFloder")
@@ -321,114 +228,61 @@
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col <el-col :span="switch_cont && switch_tag ? 12 : switch_cont && !switch_tag ? 0 : 24
:span=" ">
switch_cont && switch_tag ? 12 : switch_cont && !switch_tag ? 0 : 24
"
>
<div class="grid-content bg-purple"> <div class="grid-content bg-purple">
<div class="label"> <div class="label">
<div class="title" style="width: 100%"> <div class="title" style="width: 100%">
<div style="display: inline-block; float: left"> <div style="float: left">
{{ $t("work.tag") }} {{ $t("work.tag") }}
<el-button <el-button type="text" icon="el-icon-upload2" style="margin-left: 10px; font-size: 14px"
type="text" @click="openFile">
icon="el-icon-upload2"
style="margin-left: 10px; font-size: 14px"
@click="openFile"
>
{{ $t("work.importTag") }} {{ $t("work.importTag") }}
</el-button> </el-button>
</div> </div>
<!--<el-checkbox v-model="flag">单面打印</el-checkbox>--> <!--<el-checkbox v-model="flag">单面打印</el-checkbox>-->
<div style="display: inline-block; float: right; right: 0px"> <div style="float: right; right: 0px">
<span <span style="font-size: 14px; color: #606266; font-weight: normal">
style="font-size: 14px; color: #606266; font-weight: normal"
>
{{ $t("work.print") }} {{ $t("work.print") }}
</span> </span>
<el-select <el-select v-model="print_flag" :placeholder="$t('work.pleaseSelect')" size="mini">
v-model="print_flag" <el-option v-for="item in print_op" v-if="!(flag && item.value == 1)" :key="item.value"
:placeholder="$t('work.pleaseSelect')" :label="item.label" :value="item.value">
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-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div style="float: right"></div> <div style="float: right"></div>
<input <input type="file" accept=".soon,.cs" @change="fileLoad" ref="refFile" style="display: none" />
type="file"
accept=".soon,.cs"
@change="fileLoad"
ref="refFile"
style="display: none"
/>
<div style="clear: both"></div> <div style="clear: both"></div>
<div class="display"> <div class="display">
<img <img v-if="print_flag == 1 || print_flag == 2" :src="fileData.frontDisplayPic" style="
v-if="print_flag == 1 || print_flag == 2"
:src="fileData.frontDisplayPic"
style="
height: 120px; height: 120px;
position: relative; position: relative;
top: 50%; top: 50%;
transform: translateY(-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; height: 120px;
position: relative; position: relative;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
" " />
/>
</div> </div>
<el-table <el-table :data="tableData" height="185" style="width: 100%" :empty-text="$t('work.nodata')">
:data="tableData"
height="185"
style="width: 100%"
:empty-text="$t('work.nodata')"
>
<el-table-column prop="name" :label="$t('work.fieldName')"> <el-table-column prop="name" :label="$t('work.fieldName')">
</el-table-column> </el-table-column>
<el-table-column prop="val" width="400"> <el-table-column prop="val" width="400">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<input <input type="file" accept=".csv" @change="fileLoad2" ref="refFile2" style="display: none" />
type="file" <el-tooltip class="item" effect="dark" :content="file_name == null
accept=".csv"
@change="fileLoad2"
ref="refFile2"
style="display: none"
/>
<el-tooltip
class="item"
effect="dark"
:content="
file_name == null
? $t('work.binfile') ? $t('work.binfile')
: file_name.strLen() > 12 : file_name.strLen() > 12
? file_name.subCHStr(0, 12) + '...' ? file_name.subCHStr(0, 12) + '...'
: file_name : file_name
" " placement="top-start">
placement="top-start" <el-button type="text" icon="el-icon-upload2" style="margin-left: 10px; font-size: 14px"
> @click="openFile2">
<el-button
type="text"
icon="el-icon-upload2"
style="margin-left: 10px; font-size: 14px"
@click="openFile2"
>
{{ {{
file_name == null file_name == null
? $t("work.binfile") ? $t("work.binfile")
@@ -439,13 +293,7 @@
</el-button> </el-button>
</el-tooltip> </el-tooltip>
<input <input type="file" accept="..zip,.rar" @change="fileLoad3" ref="refFile3" style="display: none" />
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-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" <el-button type="text" icon="el-icon-upload2" style="margin-left: 10px;font-size: 14px"
@click="openFile3"> @click="openFile3">
@@ -455,28 +303,17 @@
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.type == 1"> <div v-if="scope.row.type == 1">
<input <input type="file" accept="image/*" :ref="scope.row.origin_name"
type="file" :data-name="scope.row.origin_name" />
accept="image/*"
:ref="scope.row.origin_name"
:data-name="scope.row.origin_name"
/>
</div> </div>
<div <div v-if="
v-if="
scope.row.type == 3 || scope.row.type == 3 ||
scope.row.type == 4 || scope.row.type == 4 ||
scope.row.type == 5 scope.row.type == 5
" ">
>
<!--合成文本--> <!--合成文本-->
<el-input <el-input :placeholder="$t('work.pleaseInput')" v-model="form[scope.row.origin_name]" clearable
:placeholder="$t('work.pleaseInput')" style="width: calc(100% - 30px) !important" :disabled="csvIsExist">
v-model="form[scope.row.origin_name]"
clearable
style="width: calc(100% - 30px) !important"
:disabled="csvIsExist"
>
</el-input> </el-input>
</div> </div>
</template> </template>
@@ -489,42 +326,26 @@
<el-row :gutter="20" style="height: 30px; margin-top: 20px"> <el-row :gutter="20" style="height: 30px; margin-top: 20px">
<el-col :span="14"> <el-col :span="14">
<div v-if="file_form == 3 && switch_cont"> <div v-if="file_form == 3 && switch_cont">
<el-input <el-input :placeholder="$t('work.pleasePassword')" style="width: 25%; float: left" show-password v-model="p1">
:placeholder="$t('work.pleasePassword')"
style="width: 25%; float: left"
show-password
v-model="p1"
>
<template slot="prepend"> <template slot="prepend">
{{ $t("work.password") }} {{ $t("work.password") }}
</template> </template>
</el-input> </el-input>
<el-input <el-input :placeholder="$t('work.pleasePassword')" style="width: 25%; float: left; margin-left: 10px"
:placeholder="$t('work.pleasePassword')" show-password v-model="p2">
style="width: 25%; float: left; margin-left: 10px"
show-password
v-model="p2"
>
<template slot="prepend"> <template slot="prepend">
{{ $t("work.comfirm") }} {{ $t("work.comfirm") }}
</template> </template>
</el-input> </el-input>
<el-input <el-input :placeholder="$t('work.addContent')" style="width: 40%; float: left; margin-left: 10px"
:placeholder="$t('work.addContent')" v-model="zip_name">
style="width: 40%; float: left; margin-left: 10px"
v-model="zip_name"
>
<template slot="prepend"> <template slot="prepend">
{{ $t("work.name") }} {{ $t("work.name") }}
</template> </template>
</el-input> </el-input>
</div> </div>
<div v-else-if="file_form == 2 && switch_cont"> <div v-else-if="file_form == 2 && switch_cont">
<el-input <el-input :placeholder="$t('work.addContent')" style="width: 40%; float: left" v-model="zip_name">
:placeholder="$t('work.addContent')"
style="width: 40%; float: left"
v-model="zip_name"
>
<template slot="prepend"> <template slot="prepend">
{{ $t("work.name") }} {{ $t("work.name") }}
</template> </template>
@@ -533,11 +354,7 @@
<div style="width: 100%" v-else>&nbsp;</div> <div style="width: 100%" v-else>&nbsp;</div>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-input <el-input :placeholder="$t('work.addContent')" v-model="number" style="width: 200px; float: left">
:placeholder="$t('work.addContent')"
v-model="number"
style="width: 200px; float: left"
>
<template slot="prepend"> <template slot="prepend">
{{ $t("work.num") }} {{ $t("work.num") }}
</template> </template>
@@ -998,7 +815,8 @@ export default {
data1.append(`file${files_n_incr}`, this.$refs.refFile.files[0]); //标签cs文件 data1.append(`file${files_n_incr}`, this.$refs.refFile.files[0]); //标签cs文件
files_n_incr++; files_n_incr++;
} else { } else {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.pleaseUploadTag"), message: this.$t("work.pleaseUploadTag"),
type: "warning", type: "warning",
}); });
@@ -1057,7 +875,8 @@ export default {
} }
} }
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.uploadingTag"), message: this.$t("work.uploadingTag"),
}); });
let pathName; let pathName;
@@ -1065,7 +884,8 @@ export default {
//打开本地选项 //打开本地选项
let rootFile = this.$refs.uploader.uploader.getRoot(); let rootFile = this.$refs.uploader.uploader.getRoot();
if (rootFile.fileList.length != 1) { if (rootFile.fileList.length != 1) {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.oneFolder"), message: this.$t("work.oneFolder"),
type: "warning", type: "warning",
}); });
@@ -1073,7 +893,8 @@ export default {
} }
let filePath = rootFile.fileList[0]; let filePath = rootFile.fileList[0];
if (!filePath.isFolder) { if (!filePath.isFolder) {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.notFolder"), message: this.$t("work.notFolder"),
type: "warning", type: "warning",
}); });
@@ -1191,7 +1012,8 @@ export default {
} }
if (!flag) { if (!flag) {
//报错内容 //报错内容
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.pleaseUploadingImgBin"), message: this.$t("work.pleaseUploadingImgBin"),
type: "warning", type: "warning",
}); });
@@ -1211,7 +1033,8 @@ export default {
} }
i++; i++;
} }
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.UploadingImgBin"), message: this.$t("work.UploadingImgBin"),
}); });
let re; let re;
@@ -1228,7 +1051,8 @@ export default {
re = true; re = true;
}) })
.catch(() => { .catch(() => {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.UploadingImgBinFail"), message: this.$t("work.UploadingImgBinFail"),
type: "warning", type: "warning",
}); });
@@ -1242,7 +1066,8 @@ export default {
if (this.switch_cont) { if (this.switch_cont) {
//开启了左边内容则先左边 //开启了左边内容则先左边
if (this.size == 0) { if (this.size == 0) {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.pleaseUploadContent"), message: this.$t("work.pleaseUploadContent"),
type: "warning", type: "warning",
}); });
@@ -1261,7 +1086,8 @@ export default {
return; return;
} else { } else {
this.$refs.uploader.uploader.resume(); this.$refs.uploader.uploader.resume();
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.uploadingContent"), message: this.$t("work.uploadingContent"),
}); });
} }
@@ -1274,7 +1100,8 @@ export default {
data1.append(`file${files_n_incr}`, this.$refs.refFile.files[0]); //标签cs文件 data1.append(`file${files_n_incr}`, this.$refs.refFile.files[0]); //标签cs文件
files_n_incr++; files_n_incr++;
} else { } else {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.pleaseUploadTag"), message: this.$t("work.pleaseUploadTag"),
type: "warning", type: "warning",
}); });
@@ -1330,7 +1157,8 @@ export default {
} }
} }
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.uploadingTag"), message: this.$t("work.uploadingTag"),
}); });
this.$axios({ this.$axios({
@@ -1476,7 +1304,8 @@ export default {
let rootFile = this.$refs.uploader.uploader.getRoot(); let rootFile = this.$refs.uploader.uploader.getRoot();
console.log(rootFile); console.log(rootFile);
if (rootFile.fileList.length != 1) { if (rootFile.fileList.length != 1) {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.oneFolder"), message: this.$t("work.oneFolder"),
type: "warning", type: "warning",
}); });
@@ -1484,7 +1313,8 @@ export default {
} }
let filePath = rootFile.fileList[0]; let filePath = rootFile.fileList[0];
if (!filePath.isFolder) { if (!filePath.isFolder) {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.notFolder"), message: this.$t("work.notFolder"),
type: "warning", type: "warning",
}); });
@@ -1509,7 +1339,8 @@ export default {
!this.$refs.uploader.uploader.isComplete() && !this.$refs.uploader.uploader.isComplete() &&
!this.high_setting_form.localfiles !this.high_setting_form.localfiles
) { ) {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.uploadFail"), message: this.$t("work.uploadFail"),
type: "warning", type: "warning",
}); });
@@ -1532,7 +1363,8 @@ export default {
//选择的是zip文档,则名称一定要填写 //选择的是zip文档,则名称一定要填写
if (this.file_form == 2) { if (this.file_form == 2) {
if (this.zip_name == "") { if (this.zip_name == "") {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.zipNameInput"), message: this.$t("work.zipNameInput"),
type: "warning", type: "warning",
}); });
@@ -1543,7 +1375,8 @@ export default {
//选择的是zip加密,名称和密码需要校验 //选择的是zip加密,名称和密码需要校验
if (this.file_form == 3) { if (this.file_form == 3) {
if (this.zip_name == "") { if (this.zip_name == "") {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.zipNameInput"), message: this.$t("work.zipNameInput"),
type: "warning", type: "warning",
}); });
@@ -1551,7 +1384,8 @@ export default {
} }
data += "&zip_name=" + this.zip_name; data += "&zip_name=" + this.zip_name;
if (this.p1 == "" || this.p1 != this.p2) { if (this.p1 == "" || this.p1 != this.p2) {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.zipPassWrong"), message: this.$t("work.zipPassWrong"),
type: "warning", type: "warning",
}); });
@@ -1564,7 +1398,8 @@ export default {
if (this.switch_tag) { if (this.switch_tag) {
//标签开启,则标签文件一定要上传 //标签开启,则标签文件一定要上传
if (this.$refs.refFile.files.length == 0) { if (this.$refs.refFile.files.length == 0) {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.pleaseUploadTag"), message: this.$t("work.pleaseUploadTag"),
type: "warning", type: "warning",
}); });
@@ -1584,7 +1419,8 @@ export default {
//打印面数print_flag为1 - 双面的时候,模板flag必须为1 - 双面 //打印面数print_flag为1 - 双面的时候,模板flag必须为1 - 双面
//打印面数print_flag为2 - 正 的时候 模板正面必须有内容 (flag != 3) //打印面数print_flag为2 - 正 的时候 模板正面必须有内容 (flag != 3)
//打印面数print_flag为3 - 反 的时候 模板背面必须有内容 (flag != 2) //打印面数print_flag为3 - 反 的时候 模板背面必须有内容 (flag != 2)
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.print_flagError"), message: this.$t("work.print_flagError"),
type: "warning", type: "warning",
}); });
@@ -1593,7 +1429,8 @@ export default {
data += "&print_flag=" + this.print_flag; //打印面数需要在开启了标签时,1双 2正3背 data += "&print_flag=" + this.print_flag; //打印面数需要在开启了标签时,1双 2正3背
} }
if (this.juanbiao_form == "") { if (this.juanbiao_form == "") {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.juanbiaoInput"), message: this.$t("work.juanbiaoInput"),
type: "warning", type: "warning",
}); });
@@ -1620,7 +1457,8 @@ export default {
//} //}
//console.log(data); //console.log(data);
//console.log(data_param) //console.log(data_param)
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.submiting"), message: this.$t("work.submiting"),
}); });
this.$emit("jobPost"); this.$emit("jobPost");
@@ -1633,11 +1471,14 @@ export default {
}, },
computed: { computed: {
file_percent() { file_percent() {
const sizeFormNum = parseFloat(this.size_form);
if (isNaN(sizeFormNum) || sizeFormNum <= 0) return 0;
let t = let t =
(this.size / (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; 100;
return t ? t > 100 ? 100.1 : t : 0 if (isNaN(t) || !isFinite(t)) return 0;
return t > 100 ? 100.1 : t;
}, },
print_op() { print_op() {
return [ return [
@@ -1812,7 +1653,8 @@ export default {
}, },
file_percent(val) { file_percent(val) {
if (val == 100.1) { if (val == 100.1) {
this.$message({offset:100, this.$message({
offset: 100,
message: this.$t("work.sizeExtra"), message: this.$t("work.sizeExtra"),
type: "warning", type: "warning",
}); });
@@ -1861,6 +1703,7 @@ export default {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
padding: 10px; padding: 10px;
.title { .title {
float: left; float: left;
font-size: 18px; font-size: 18px;
@@ -1869,6 +1712,7 @@ export default {
line-height: 40px; line-height: 40px;
} }
} }
.label { .label {
height: 500px; height: 500px;
width: 100%; width: 100%;
@@ -1895,8 +1739,7 @@ export default {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
} }
.uploader-example .uploader-btn {
}
.uploader-example .uploader-list { .uploader-example .uploader-list {
max-height: 405px; max-height: 405px;
@@ -1904,23 +1747,28 @@ export default {
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
} }
.uploader-list::-webkit-scrollbar { .uploader-list::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/ width: 10px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 1px; height: 1px;
} }
.uploader-list::-webkit-scrollbar-thumb { .uploader-list::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/ /*滚动条里面小方块*/
border-radius: 10px; border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #c7c7cb; background: #c7c7cb;
} }
.uploader-list::-webkit-scrollbar-track { .uploader-list::-webkit-scrollbar-track {
/*滚动条里面轨道*/ /*滚动条里面轨道*/
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 10px; border-radius: 10px;
background: #ededed; background: #ededed;
} }
.display { .display {
margin-top: 10px; margin-top: 10px;
background-color: #212830; background-color: #212830;
@@ -1939,6 +1787,7 @@ export default {
/deep/ .uploader-file-name { /deep/ .uploader-file-name {
text-align: left; text-align: left;
} }
/deep/ .el-progress-bar__outer { /deep/ .el-progress-bar__outer {
background-color: #bac2d7; background-color: #bac2d7;
} }
File diff suppressed because it is too large Load Diff
Binary file not shown.
+52 -5
View File
@@ -1,4 +1,10 @@
export default { export default {
common: {
confirm: "确认",
cancel: "取消",
save: "保存",
ok: "确定"
},
recorder: { recorder: {
startRecording: "开始录制", startRecording: "开始录制",
stopRecording: "停止录制", stopRecording: "停止录制",
@@ -452,14 +458,16 @@ export default {
}, },
work: { work: {
template: "模板", template: "模板",
mixMode: "制作混合模式存储卡", metadataEdit: "标签内容编辑",
mixMode: "混合模式",
spanUSBcard: "允许跨卡", spanUSBcard: "允许跨卡",
hasAddFile: "拷贝附加文件", hasAddFile: "拷贝附加文件",
size_form_error: "请选择容量", size_form_error: "请选择容量",
size: "容量:", size: "容量:",
content: "拷贝类型:", content: "拷贝类型:",
fileAnd: "文件和文件夹", fileAnd: "文件和文件夹",
eCd: "制作电子光盘存储卡", eCd: "电子光盘",
encryptCard: "加密存储卡",
zip: "生成ZIP后再拷贝", zip: "生成ZIP后再拷贝",
iso: "生成ISO后再拷贝", iso: "生成ISO后再拷贝",
passZip: "加密ZIP", passZip: "加密ZIP",
@@ -470,6 +478,8 @@ export default {
forbidCopyPart: "防拷贝分区", forbidCopyPart: "防拷贝分区",
cdWithDisk: "光盘+磁盘", cdWithDisk: "光盘+磁盘",
senior: "高级作业设置", senior: "高级作业设置",
// 基础配置
basicConfig: "基础配置",
better: "优先级", better: "优先级",
low: "低", low: "低",
normal: "正常", normal: "正常",
@@ -479,12 +489,47 @@ export default {
ribbonType: "色带类型", ribbonType: "色带类型",
sigleColor: "单色", sigleColor: "单色",
colorful: "彩色", colorful: "彩色",
gshType: "作业前格式化类型", gshType: "格式化类型",
formatFile: "拷贝前格式化类型", formatFile: "格式化类型",
auto: "不格式化", auto: "不格式化",
// 高级功能
advancedFeatures: "高级功能",
generateISO: "拷贝前生成ISO",
isoFileName: "ISO名",
inputIsoName: "输入ISO名称",
generateZIP: "生成ZIP",
zipFileName: "ZIP名",
inputZipName: "输入ZIP名称",
isEncrypt: "加密",
inputPassword: "密码",
confirmPassword: "确认密码",
// HASH设置
hash: "生成HASH文件", hash: "生成HASH文件",
genMD5: "生成MD5",
copyHash: "拷贝HASH",
printMD5: "打印MD5",
md5: "打印MD5到HASH字段", md5: "打印MD5到HASH字段",
fail: "如果作业失败,则打印失败标签", // 功能开关
funcSwitch: "功能开关",
failLabel: "失败打印标签",
fail: "失败打印标签",
allowSpanCard: "允许跨卡",
presetContent: "预设内容拷贝",
// 录制相关
screenRecordReview: "屏幕记录审查",
enableScreenRecord: "启用屏幕录制",
printRecordLogo: "打印标识",
recordPath: "录制路径",
defaultPath: "项目根目录/videos",
recordingStatus: "录制状态",
recording: "录制中...",
notRecording: "未录制",
// 硬件管控
hardwareControl: "硬件管控",
installDongle: "加密狗计数",
installCount: "安装次数",
setAuthCode: "设置授权码",
inputAuthCode: "输入授权码",
addContent: "添加内容", addContent: "添加内容",
addTag: "添加标签", addTag: "添加标签",
contentTitle: "内容", contentTitle: "内容",
@@ -495,6 +540,8 @@ export default {
tag: "标签", tag: "标签",
createTag: "创建标签", createTag: "创建标签",
importTag: "选择标签", importTag: "选择标签",
design: "创建标签",
import: "选择标签",
print: "打印:", print: "打印:",
front: "仅打印正面", front: "仅打印正面",
back: "仅打印背面", back: "仅打印背面",
+45 -4
View File
@@ -1,4 +1,10 @@
export default { export default {
common: {
confirm: "Confirm",
cancel: "Cancel",
save: "Save",
ok: "OK"
},
recorder: { recorder: {
startRecording: "Start Recording", startRecording: "Start Recording",
stopRecording: "Stop Recording", stopRecording: "Stop Recording",
@@ -409,12 +415,45 @@ export default {
cdPart: "Virtual Disc", cdPart: "Virtual Disc",
forbidCopyPart: "Anti-copy Format", forbidCopyPart: "Anti-copy Format",
cdWithDisk: "Removable Disk+Virtual Disc", cdWithDisk: "Removable Disk+Virtual Disc",
senior: "Advanced job Settings", senior: "Advanced Settings",
// Basic Config
basicConfig: "Basic Config",
better: "Priority", better: "Priority",
low: "Low",
normal: "Normal",
high: "Hign",
startWorkSpace: "Target Station", startWorkSpace: "Target Station",
ribbonType: "Ribbon Type",
formatFile: "Format Type",
// Advanced Features
advancedFeatures: "Advanced Features",
generateISO: "Generate ISO",
isoFileName: "ISO Name",
inputIsoName: "Enter ISO Name",
generateZIP: "Generate ZIP",
zipFileName: "ZIP Name",
inputZipName: "Enter ZIP Name",
isEncrypt: "Encrypt",
inputPassword: "Password",
confirmPassword: "Confirm Password",
// Hash
genMD5: "Gen MD5",
copyHash: "Copy HASH",
printMD5: "Print MD5",
// Switches
failLabel: "Print Fail Label",
allowSpanCard: "Span USB Card",
presetContent: "Preset Content",
// Recording
screenRecordReview: "Screen Record Review",
enableScreenRecord: "Enable Recording",
printRecordLogo: "Print Logo",
recordPath: "Record Path",
// Hardware
hardwareControl: "Hardware Control",
installDongle: "Dongle Count",
installCount: "Install Count",
setAuthCode: "Auth Code",
inputAuthCode: "Enter Auth Code",
// Metadata
metadataEdit: "Metadata Edit",
any: "Any", any: "Any",
ribbonType: "RibbonType", ribbonType: "RibbonType",
sigleColor: "Mono", sigleColor: "Mono",
@@ -434,6 +473,8 @@ export default {
selectFloder: "Add Floders", selectFloder: "Add Floders",
tag: "Lable", tag: "Lable",
importTag: "Add Lables", importTag: "Add Lables",
design: "Design",
import: "Import",
print: "Print:", print: "Print:",
front: "Print front only", front: "Print front only",
back: "Print back only", back: "Print back only",
+48 -3
View File
@@ -1,4 +1,10 @@
export default { export default {
common: {
confirm: "確認",
cancel: "取消",
save: "保存",
ok: "確定"
},
finger: { finger: {
intTips: "指紋模塊正在初始化", intTips: "指紋模塊正在初始化",
errorInttips: "指紋模塊初始化失敗", errorInttips: "指紋模塊初始化失敗",
@@ -387,8 +393,45 @@ export default {
cdPart: "光盤分區", cdPart: "光盤分區",
forbidCopyPart: "防拷貝分區", forbidCopyPart: "防拷貝分區",
cdWithDisk: "光盤+磁盤", cdWithDisk: "光盤+磁盤",
senior: "高級作業設", senior: "高級作業設",
// Basic Config
basicConfig: "基礎設定",
better: "優先級", better: "優先級",
startWorkSpace: "目標工作站",
ribbonType: "色帶類型",
formatFile: "格式化類型",
// Advanced Features
advancedFeatures: "高級功能",
generateISO: "生成ISO",
isoFileName: "ISO名稱",
inputIsoName: "輸入ISO名稱",
generateZIP: "生成ZIP",
zipFileName: "ZIP名稱",
inputZipName: "輸入ZIP名稱",
isEncrypt: "加密",
inputPassword: "密碼",
confirmPassword: "確認密碼",
// Hash
genMD5: "生成MD5",
copyHash: "拷貝HASH",
printMD5: "打印MD5",
// Switches
failLabel: "失敗打印標籤",
allowSpanCard: "允許跨卡",
presetContent: "預設內容",
// Recording
screenRecordReview: "屏幕記錄審查",
enableScreenRecord: "啟用屏幕錄制",
printRecordLogo: "打印標識",
recordPath: "錄制路徑",
// Hardware
hardwareControl: "硬體管控",
installDongle: "加密狗計數",
installCount: "安裝次數",
setAuthCode: "授權碼",
inputAuthCode: "輸入授權碼",
// Metadata
metadataEdit: "標籤內容編輯",
low: "低", low: "低",
normal: "正常", normal: "正常",
high: "高", high: "高",
@@ -397,8 +440,8 @@ export default {
ribbonType: "色帶類型", ribbonType: "色帶類型",
sigleColor: "單色", sigleColor: "單色",
colorful: "彩色", colorful: "彩色",
gshType: "作業前格式化類型", gshType: "格式化類型",
formatFile: "拷貝前格式化類型", formatFile: "格式化類型",
auto: "不格式化", auto: "不格式化",
hash: "生成HASH文件", hash: "生成HASH文件",
md5: "打印MD5到HASH字段", md5: "打印MD5到HASH字段",
@@ -412,6 +455,8 @@ export default {
selectFloder: "選擇文件夾", selectFloder: "選擇文件夾",
tag: "標籤", tag: "標籤",
importTag: "添加標籤文件", importTag: "添加標籤文件",
design: "設計",
import: "導入",
print: "打印:", print: "打印:",
front: "僅打印正面", front: "僅打印正面",
back: "僅打印背面", back: "僅打印背面",
+34
View File
@@ -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
}