调整分发配置:格式化类型与加密狗参数
- 格式化类型改为 Fat32 / exFat / NTFS - 加密狗改为「不限次数」勾选,提交 dongle_install_count 为 255 或 0 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,9 +9,9 @@ export const COPY_TYPE_OPTIONS: SelectOption[] = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const FORMAT_TYPE_OPTIONS: SelectOption[] = [
|
export const FORMAT_TYPE_OPTIONS: SelectOption[] = [
|
||||||
{ label: '不格式化', value: 'none' },
|
{ label: 'Fat32', value: 'fat32' },
|
||||||
{ label: '快速格式化', value: 'fat' },
|
{ label: 'exFat', value: 'exfat' },
|
||||||
{ label: '完全格式化', value: 'ntfs' }
|
{ label: 'NTFS', value: 'ntfs' }
|
||||||
]
|
]
|
||||||
|
|
||||||
export const PRIORITY_OPTIONS: SelectOption[] = [
|
export const PRIORITY_OPTIONS: SelectOption[] = [
|
||||||
|
|||||||
@@ -24,9 +24,8 @@ export interface DistributeFormState {
|
|||||||
templateFile: string
|
templateFile: string
|
||||||
templatePreview: TemplatePreview | null
|
templatePreview: TemplatePreview | null
|
||||||
copyType: 0 | 1
|
copyType: 0 | 1
|
||||||
formatType: 'none' | 'fat' | 'ntfs'
|
formatType: 'fat32' | 'exfat' | 'ntfs'
|
||||||
dongleEnabled: boolean
|
dongleUnlimited: boolean
|
||||||
dongleMode: -1 | 0 | 255
|
|
||||||
priority: 'low' | 'mid' | 'high'
|
priority: 'low' | 'mid' | 'high'
|
||||||
ribbonType: 'any' | 'YMCKO' | 'YMCK'
|
ribbonType: 'any' | 'YMCKO' | 'YMCK'
|
||||||
generateIso: boolean
|
generateIso: boolean
|
||||||
@@ -45,9 +44,8 @@ function createDefaultForm(): DistributeFormState {
|
|||||||
templateFile: '',
|
templateFile: '',
|
||||||
templatePreview: null,
|
templatePreview: null,
|
||||||
copyType: 0,
|
copyType: 0,
|
||||||
formatType: 'none',
|
formatType: 'fat32',
|
||||||
dongleEnabled: true,
|
dongleUnlimited: false,
|
||||||
dongleMode: -1,
|
|
||||||
priority: 'low',
|
priority: 'low',
|
||||||
ribbonType: 'any',
|
ribbonType: 'any',
|
||||||
generateIso: false,
|
generateIso: false,
|
||||||
|
|||||||
@@ -7,12 +7,22 @@ export interface BuildJobOptions {
|
|||||||
udfFile?: string
|
udfFile?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatFileForApi(formatType: DistributeFormState['formatType']): string {
|
||||||
|
switch (formatType) {
|
||||||
|
case 'exfat':
|
||||||
|
return 'exFAT'
|
||||||
|
case 'ntfs':
|
||||||
|
return 'NTFS'
|
||||||
|
default:
|
||||||
|
return 'FAT32'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function buildJobConfig(
|
export function buildJobConfig(
|
||||||
form: DistributeFormState,
|
form: DistributeFormState,
|
||||||
opts: BuildJobOptions
|
opts: BuildJobOptions
|
||||||
): Record<string, unknown> {
|
): Record<string, unknown> {
|
||||||
const { hasCopy, hasPrint } = resolveJobTasks(form)
|
const { hasCopy, hasPrint } = resolveJobTasks(form)
|
||||||
const needFormat = form.formatType !== 'none'
|
|
||||||
|
|
||||||
const body: Record<string, unknown> = {
|
const body: Record<string, unknown> = {
|
||||||
task_id: opts.taskId,
|
task_id: opts.taskId,
|
||||||
@@ -22,10 +32,10 @@ export function buildJobConfig(
|
|||||||
label: form.volumeLabel || 'DATA_CARD',
|
label: form.volumeLabel || 'DATA_CARD',
|
||||||
file_type: String(form.copyType),
|
file_type: String(form.copyType),
|
||||||
zone_type: form.copyType === 1 ? '1' : '0',
|
zone_type: form.copyType === 1 ? '1' : '0',
|
||||||
need_format: needFormat,
|
need_format: true,
|
||||||
format_file: form.formatType === 'ntfs' ? 'NTFS' : 'FAT',
|
format_file: formatFileForApi(form.formatType),
|
||||||
disk_size: '16GB',
|
disk_size: '16GB',
|
||||||
dongle_install_count: form.dongleEnabled ? form.dongleMode : -1
|
dongle_install_count: form.dongleUnlimited ? 255 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasCopy) {
|
if (hasCopy) {
|
||||||
|
|||||||
@@ -45,15 +45,8 @@
|
|||||||
<AppSelect v-model="formStore.formatType" :items="FORMAT_TYPE_OPTIONS" />
|
<AppSelect v-model="formStore.formatType" :items="FORMAT_TYPE_OPTIONS" />
|
||||||
</div>
|
</div>
|
||||||
<label class="c-checkbox-item">
|
<label class="c-checkbox-item">
|
||||||
<input v-model="formStore.dongleEnabled" type="checkbox" />
|
<input v-model="formStore.dongleUnlimited" type="checkbox" />
|
||||||
<span>加密狗</span>
|
<span>不限次数</span>
|
||||||
<input
|
|
||||||
v-model.number="formStore.dongleMode"
|
|
||||||
type="number"
|
|
||||||
class="c-input dog-count"
|
|
||||||
:disabled="!formStore.dongleEnabled"
|
|
||||||
/>
|
|
||||||
<span class="dog-hint">{{ dongleHint }}</span>
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -182,14 +175,6 @@ function onClear(): void {
|
|||||||
notify.info('已清空,已恢复初始状态')
|
notify.info('已清空,已恢复初始状态')
|
||||||
}
|
}
|
||||||
|
|
||||||
const dongleHint = computed(() => {
|
|
||||||
if (!formStore.dongleEnabled) return '(未启用)'
|
|
||||||
if (formStore.dongleMode === -1) return '(-1 无加密狗)'
|
|
||||||
if (formStore.dongleMode === 0) return '(0 一次性)'
|
|
||||||
if (formStore.dongleMode === 255) return '(255 无限次)'
|
|
||||||
return '(0=一次 255=无限)'
|
|
||||||
})
|
|
||||||
|
|
||||||
async function addPath(): Promise<void> {
|
async function addPath(): Promise<void> {
|
||||||
const r = await dialogOpenDirectory()
|
const r = await dialogOpenDirectory()
|
||||||
if (!r.ok) {
|
if (!r.ok) {
|
||||||
|
|||||||
Reference in New Issue
Block a user