增加前端格式检查配置
This commit is contained in:
@@ -26,7 +26,7 @@ const publishOptionsDraft = ref<ListingPublishOptions>(cloneOptions(emptyListing
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
val => {
|
||||
if (val) {
|
||||
publishOptionsDraft.value = parsePublishOptions(props.config.value)
|
||||
description.value = props.config.description || ''
|
||||
@@ -47,7 +47,7 @@ function cloneOptions(options: ListingPublishOptions) {
|
||||
function linesToItems(value: string) {
|
||||
return value
|
||||
.split('\n')
|
||||
.map((item) => item.trim())
|
||||
.map(item => item.trim())
|
||||
.filter(Boolean)
|
||||
}
|
||||
|
||||
@@ -200,7 +200,9 @@ function readError(error: unknown, fallback: string) {
|
||||
@update:model-value="emit('update:modelValue', $event)"
|
||||
>
|
||||
<div class="dialog-body">
|
||||
<p class="config-key-label"><strong>{{ config.key }}</strong></p>
|
||||
<p class="config-key-label">
|
||||
<strong>{{ config.key }}</strong>
|
||||
</p>
|
||||
|
||||
<div class="publish-options-editor">
|
||||
<div class="editor-toolbar">
|
||||
@@ -300,7 +302,12 @@ function readError(error: unknown, fallback: string) {
|
||||
<strong>发布规则</strong>
|
||||
</div>
|
||||
<el-form-item label="最低烽火等级">
|
||||
<el-input-number v-model="publishOptionsDraft.fire_level_min" :min="1" :step="1" class="full-control" />
|
||||
<el-input-number
|
||||
v-model="publishOptionsDraft.fire_level_min"
|
||||
:min="1"
|
||||
:step="1"
|
||||
class="full-control"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
@@ -309,7 +316,11 @@ function readError(error: unknown, fallback: string) {
|
||||
<strong>押金与价格提示</strong>
|
||||
</div>
|
||||
<el-form-item label="押金提示">
|
||||
<el-input v-model="publishOptionsDraft.price_config.deposit_placeholder" type="textarea" :rows="3" />
|
||||
<el-input
|
||||
v-model="publishOptionsDraft.price_config.deposit_placeholder"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="押金后缀">
|
||||
<el-input
|
||||
@@ -319,10 +330,16 @@ function readError(error: unknown, fallback: string) {
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格提示">
|
||||
<el-input v-model="publishOptionsDraft.price_config.price_placeholder" class="full-control" />
|
||||
<el-input
|
||||
v-model="publishOptionsDraft.price_config.price_placeholder"
|
||||
class="full-control"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="比例说明">
|
||||
<el-input v-model="publishOptionsDraft.price_config.ratio_description" class="full-control" />
|
||||
<el-input
|
||||
v-model="publishOptionsDraft.price_config.ratio_description"
|
||||
class="full-control"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
@@ -339,19 +356,35 @@ function readError(error: unknown, fallback: string) {
|
||||
class="full-control"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-table :data="publishOptionsDraft.deposit_recommend_config.skin_group_rules" size="small" border>
|
||||
<el-table
|
||||
:data="publishOptionsDraft.deposit_recommend_config.skin_group_rules"
|
||||
size="small"
|
||||
border
|
||||
>
|
||||
<el-table-column label="皮肤分组 Key" min-width="150">
|
||||
<template #default="{ row }"><el-input v-model="row.group_key" placeholder="operatorRed" /></template>
|
||||
<template #default="{ row }"
|
||||
><el-input v-model="row.group_key" placeholder="operatorRed"
|
||||
/></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="名称" min-width="140">
|
||||
<template #default="{ row }"><el-input v-model="row.label" placeholder="干员红皮" /></template>
|
||||
<template #default="{ row }"
|
||||
><el-input v-model="row.label" placeholder="干员红皮"
|
||||
/></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="每个增加押金" min-width="140">
|
||||
<template #default="{ row }"><el-input-number v-model="row.amount_per_item" :min="0" :step="5" /></template>
|
||||
<template #default="{ row }"
|
||||
><el-input-number v-model="row.amount_per_item" :min="0" :step="5"
|
||||
/></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90">
|
||||
<template #default="{ $index }">
|
||||
<el-button size="small" type="danger" plain @click="removeDepositSkinGroupRule($index)">删除</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="danger"
|
||||
plain
|
||||
@click="removeDepositSkinGroupRule($index)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -365,16 +398,30 @@ function readError(error: unknown, fallback: string) {
|
||||
<span>保险基础比例</span>
|
||||
<el-button size="small" @click="addInsuranceBaseRatio">添加保险比例</el-button>
|
||||
</div>
|
||||
<el-table :data="publishOptionsDraft.ratio_config.insurance_base_ratios" size="small" border>
|
||||
<el-table
|
||||
:data="publishOptionsDraft.ratio_config.insurance_base_ratios"
|
||||
size="small"
|
||||
border
|
||||
>
|
||||
<el-table-column label="保险" min-width="160">
|
||||
<template #default="{ row }"><el-input v-model="row.insurance" placeholder="3*3" /></template>
|
||||
<template #default="{ row }"
|
||||
><el-input v-model="row.insurance" placeholder="3*3"
|
||||
/></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="基础比例" min-width="120">
|
||||
<template #default="{ row }"><el-input-number v-model="row.ratio" :min="0" :step="0.5" /></template>
|
||||
<template #default="{ row }"
|
||||
><el-input-number v-model="row.ratio" :min="0" :step="0.5"
|
||||
/></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90">
|
||||
<template #default="{ $index }">
|
||||
<el-button size="small" type="danger" plain @click="removeInsuranceBaseRatio($index)">删除</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="danger"
|
||||
plain
|
||||
@click="removeInsuranceBaseRatio($index)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -403,11 +450,15 @@ function readError(error: unknown, fallback: string) {
|
||||
<template #default="{ row }"><el-input v-model="row.group_key" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="缺失加成" min-width="120">
|
||||
<template #default="{ row }"><el-input-number v-model="row.missing_penalty" :min="0" :step="0.5" /></template>
|
||||
<template #default="{ row }"
|
||||
><el-input-number v-model="row.missing_penalty" :min="0" :step="0.5"
|
||||
/></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90">
|
||||
<template #default="{ $index }">
|
||||
<el-button size="small" type="danger" plain @click="removeRatioConfigItem($index)">删除</el-button>
|
||||
<el-button size="small" type="danger" plain @click="removeRatioConfigItem($index)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -418,14 +469,20 @@ function readError(error: unknown, fallback: string) {
|
||||
</div>
|
||||
<el-table :data="publishOptionsDraft.ratio_config.coin_corrections" size="small" border>
|
||||
<el-table-column label="大于 M" min-width="130">
|
||||
<template #default="{ row }"><el-input-number v-model="row.threshold_m" :min="0" :step="10" /></template>
|
||||
<template #default="{ row }"
|
||||
><el-input-number v-model="row.threshold_m" :min="0" :step="10"
|
||||
/></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比例加成" min-width="130">
|
||||
<template #default="{ row }"><el-input-number v-model="row.correction" :min="0" :step="0.5" /></template>
|
||||
<template #default="{ row }"
|
||||
><el-input-number v-model="row.correction" :min="0" :step="0.5"
|
||||
/></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90">
|
||||
<template #default="{ $index }">
|
||||
<el-button size="small" type="danger" plain @click="removeCoinCorrection($index)">删除</el-button>
|
||||
<el-button size="small" type="danger" plain @click="removeCoinCorrection($index)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -436,7 +493,11 @@ function readError(error: unknown, fallback: string) {
|
||||
<strong>皮肤分类</strong>
|
||||
<el-button size="small" @click="addSkinGroup">添加分类</el-button>
|
||||
</div>
|
||||
<div v-for="(group, index) in publishOptionsDraft.skin_groups" :key="`${group.key}-${index}`" class="skin-config-row">
|
||||
<div
|
||||
v-for="(group, index) in publishOptionsDraft.skin_groups"
|
||||
:key="`${group.key}-${index}`"
|
||||
class="skin-config-row"
|
||||
>
|
||||
<el-input v-model="group.key" placeholder="分类 key" />
|
||||
<el-input v-model="group.title" placeholder="分类名称" />
|
||||
<el-input
|
||||
@@ -470,7 +531,9 @@ function readError(error: unknown, fallback: string) {
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90">
|
||||
<template #default="{ $index }">
|
||||
<el-button size="small" type="danger" plain @click="removeQuantityItem($index)">删除</el-button>
|
||||
<el-button size="small" type="danger" plain @click="removeQuantityItem($index)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -496,7 +559,9 @@ function readError(error: unknown, fallback: string) {
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90">
|
||||
<template #default="{ $index }">
|
||||
<el-button size="small" type="danger" plain @click="removeScreenshotSlot($index)">删除</el-button>
|
||||
<el-button size="small" type="danger" plain @click="removeScreenshotSlot($index)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
Reference in New Issue
Block a user