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