增加前端格式检查配置
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { Delete, DocumentChecked, Picture, RefreshRight, UploadFilled } from '@element-plus/icons-vue'
|
||||
import {
|
||||
Delete,
|
||||
DocumentChecked,
|
||||
Picture,
|
||||
RefreshRight,
|
||||
UploadFilled,
|
||||
} from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
@@ -88,9 +94,9 @@ const {
|
||||
type: 'warning',
|
||||
})
|
||||
},
|
||||
notifySuccess: (message) => ElMessage.success(message),
|
||||
notifyWarning: (message) => ElMessage.warning(message),
|
||||
notifyError: (message) => ElMessage.error(message),
|
||||
notifySuccess: message => ElMessage.success(message),
|
||||
notifyWarning: message => ElMessage.warning(message),
|
||||
notifyError: message => ElMessage.error(message),
|
||||
})
|
||||
|
||||
const agreementDialogVisible = ref(false)
|
||||
@@ -136,22 +142,41 @@ function selectOnlineEnd(value: string | number) {
|
||||
<PublishSection title="基础资料" :description="publishTitle">
|
||||
<div class="field-row panel-field-row">
|
||||
<label>区服<span>*</span></label>
|
||||
<OptionChips :options="serverOptions" :model-value="form.server_region" @select="form.server_region = String($event)" />
|
||||
<OptionChips
|
||||
:options="serverOptions"
|
||||
:model-value="form.server_region"
|
||||
@select="form.server_region = String($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="faceOptions.length" class="field-row panel-field-row">
|
||||
<label>是否本人人脸</label>
|
||||
<OptionChips :options="faceOptions" :model-value="form.face_owner" @select="form.face_owner = String($event)" />
|
||||
<OptionChips
|
||||
:options="faceOptions"
|
||||
:model-value="form.face_owner"
|
||||
@select="form.face_owner = String($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="compact-grid panel-input-grid">
|
||||
<label class="input-block">
|
||||
<span>哈夫币/M<b>*</b></span>
|
||||
<el-input-number v-model="form.haf_coin_amount" :min="0" :controls="false" placeholder="100M 写 100" />
|
||||
<el-input-number
|
||||
v-model="form.haf_coin_amount"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
placeholder="100M 写 100"
|
||||
/>
|
||||
</label>
|
||||
<label class="input-block">
|
||||
<span>绝密KD</span>
|
||||
<el-input-number v-model="form.secret_kd" :min="0" :controls="false" :step="0.1" placeholder="填写绝密KD" />
|
||||
<el-input-number
|
||||
v-model="form.secret_kd"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
:step="0.1"
|
||||
placeholder="填写绝密KD"
|
||||
/>
|
||||
</label>
|
||||
<label class="input-block">
|
||||
<span>烽火等级<b>*</b></span>
|
||||
@@ -167,7 +192,11 @@ function selectOnlineEnd(value: string | number) {
|
||||
|
||||
<div class="field-row panel-field-row">
|
||||
<label>段位<span>*</span></label>
|
||||
<OptionChips :options="rankOptions" :model-value="form.rank_level" @select="form.rank_level = String($event)" />
|
||||
<OptionChips
|
||||
:options="rankOptions"
|
||||
:model-value="form.rank_level"
|
||||
@select="form.rank_level = String($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="field-row panel-field-row">
|
||||
@@ -213,7 +242,11 @@ function selectOnlineEnd(value: string | number) {
|
||||
</div>
|
||||
</PublishSection>
|
||||
|
||||
<PublishSection v-if="quantityItems.length" title="额外消耗品" description="收费项会计入发布价格">
|
||||
<PublishSection
|
||||
v-if="quantityItems.length"
|
||||
title="额外消耗品"
|
||||
description="收费项会计入发布价格"
|
||||
>
|
||||
<div class="quantity-table">
|
||||
<div class="quantity-header">
|
||||
<span>物资</span>
|
||||
@@ -229,7 +262,9 @@ function selectOnlineEnd(value: string | number) {
|
||||
:class="{ disabled: isQuantityItemDisabled(item) }"
|
||||
>
|
||||
<div class="quantity-meta">
|
||||
<strong :title="item.placeholder || item.label"><span>*</span>{{ item.label }}</strong>
|
||||
<strong :title="item.placeholder || item.label"
|
||||
><span>*</span>{{ item.label }}</strong
|
||||
>
|
||||
<small v-if="item.placeholder">{{ item.placeholder }}</small>
|
||||
</div>
|
||||
<span class="quantity-price">{{ item.price }}</span>
|
||||
@@ -266,15 +301,15 @@ function selectOnlineEnd(value: string | number) {
|
||||
|
||||
<PublishSection title="皮肤与交接">
|
||||
<div v-if="skinGroups.length" class="skin-groups">
|
||||
<div
|
||||
v-for="group in skinGroups"
|
||||
:key="group.key"
|
||||
class="skin-group"
|
||||
>
|
||||
<div v-for="group in skinGroups" :key="group.key" class="skin-group">
|
||||
<div class="skin-title">
|
||||
<strong>{{ group.title }}</strong>
|
||||
</div>
|
||||
<OptionChips :options="group.options" :active-values="selectedSkins" @select="toggleSkinOption" />
|
||||
<OptionChips
|
||||
:options="group.options"
|
||||
:active-values="selectedSkins"
|
||||
@select="toggleSkinOption"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -285,7 +320,9 @@ function selectOnlineEnd(value: string | number) {
|
||||
:model-value="form.login_method"
|
||||
@select="form.login_method = String($event)"
|
||||
/>
|
||||
<p class="field-hint">优先推荐账密登录,出售速度通常更快;请结合账号安全情况自行选择。</p>
|
||||
<p class="field-hint">
|
||||
优先推荐账密登录,出售速度通常更快;请结合账号安全情况自行选择。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="time-preset-panel">
|
||||
@@ -300,7 +337,12 @@ function selectOnlineEnd(value: string | number) {
|
||||
class="time-input"
|
||||
/>
|
||||
<div class="time-preset-actions">
|
||||
<button type="button" class="time-chip" :class="{ active: isAllDayOnline() }" @click="selectAllDayOnline">
|
||||
<button
|
||||
type="button"
|
||||
class="time-chip"
|
||||
:class="{ active: isAllDayOnline() }"
|
||||
@click="selectAllDayOnline"
|
||||
>
|
||||
全天
|
||||
</button>
|
||||
<OptionChips
|
||||
@@ -323,7 +365,12 @@ function selectOnlineEnd(value: string | number) {
|
||||
class="time-input"
|
||||
/>
|
||||
<div class="time-preset-actions">
|
||||
<button type="button" class="time-chip" :class="{ active: isAllDayOnline() }" @click="selectAllDayOnline">
|
||||
<button
|
||||
type="button"
|
||||
class="time-chip"
|
||||
:class="{ active: isAllDayOnline() }"
|
||||
@click="selectAllDayOnline"
|
||||
>
|
||||
全天
|
||||
</button>
|
||||
<OptionChips
|
||||
@@ -340,7 +387,11 @@ function selectOnlineEnd(value: string | number) {
|
||||
|
||||
<div v-if="banRecordOptions.length" class="field-row">
|
||||
<label>封禁记录<span>*</span></label>
|
||||
<OptionChips :options="banRecordOptions" :model-value="form.ban_record" @select="form.ban_record = String($event)" />
|
||||
<OptionChips
|
||||
:options="banRecordOptions"
|
||||
:model-value="form.ban_record"
|
||||
@select="form.ban_record = String($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="regionOptions.length" class="region-panel login-region-panel">
|
||||
@@ -363,27 +414,53 @@ function selectOnlineEnd(value: string | number) {
|
||||
</div>
|
||||
</PublishSection>
|
||||
|
||||
<PublishSection title="截图材料" :description="`${uploadedScreenshotCount}/${screenshotSlots.length} 项已上传`">
|
||||
<PublishSection
|
||||
title="截图材料"
|
||||
:description="`${uploadedScreenshotCount}/${screenshotSlots.length} 项已上传`"
|
||||
>
|
||||
<div class="upload-grid">
|
||||
<div v-for="slot in screenshotSlots" :key="slot.key" class="upload-item">
|
||||
<div class="upload-copy">
|
||||
<strong>{{ slot.label }}<span v-if="isScreenshotRequired(slot)">*</span></strong>
|
||||
<small>{{ slot.hint }}</small>
|
||||
<em v-if="getScreenshotLimitHint(slot.key)">{{ getScreenshotLimitHint(slot.key) }}</em>
|
||||
<em v-if="getScreenshotLimitHint(slot.key)">{{
|
||||
getScreenshotLimitHint(slot.key)
|
||||
}}</em>
|
||||
</div>
|
||||
<div v-if="getScreenshotCount(slot.key)" class="upload-preview-list">
|
||||
<div v-for="(url, index) in getScreenshotURLs(slot.key)" :key="`${slot.key}-${url}`" class="upload-preview">
|
||||
<img :src="getScreenshotPreviewURL(slot.key, index)" :alt="`${slot.label}${index + 1}`" />
|
||||
<div
|
||||
v-for="(url, index) in getScreenshotURLs(slot.key)"
|
||||
:key="`${slot.key}-${url}`"
|
||||
class="upload-preview"
|
||||
>
|
||||
<img
|
||||
:src="getScreenshotPreviewURL(slot.key, index)"
|
||||
:alt="`${slot.label}${index + 1}`"
|
||||
/>
|
||||
<button type="button" @click="removeScreenshot(slot.key, index)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</button>
|
||||
</div>
|
||||
<button v-if="canAddScreenshot(slot.key)" type="button" class="upload-add" :disabled="uploading" @click="triggerUpload(slot.key)">
|
||||
<button
|
||||
v-if="canAddScreenshot(slot.key)"
|
||||
type="button"
|
||||
class="upload-add"
|
||||
:disabled="uploading"
|
||||
@click="triggerUpload(slot.key)"
|
||||
>
|
||||
<el-icon><Picture /></el-icon>
|
||||
<span>{{ uploading && activeUploadKey === slot.key ? '上传中' : '继续上传' }}</span>
|
||||
<span>{{
|
||||
uploading && activeUploadKey === slot.key ? '上传中' : '继续上传'
|
||||
}}</span>
|
||||
</button>
|
||||
</div>
|
||||
<button v-else type="button" class="upload-add" :disabled="uploading" @click="triggerUpload(slot.key)">
|
||||
<button
|
||||
v-else
|
||||
type="button"
|
||||
class="upload-add"
|
||||
:disabled="uploading"
|
||||
@click="triggerUpload(slot.key)"
|
||||
>
|
||||
<el-icon><Picture /></el-icon>
|
||||
<span>{{ uploading && activeUploadKey === slot.key ? '上传中' : '上传' }}</span>
|
||||
</button>
|
||||
@@ -402,7 +479,10 @@ function selectOnlineEnd(value: string | number) {
|
||||
<PublishSection title="押金与价格" description="系统按资料自动计算售价">
|
||||
<div class="compact-grid two">
|
||||
<label class="input-block">
|
||||
<span class="deposit-label">押金<b>*</b><em v-if="priceConfig.deposit_hint">{{ priceConfig.deposit_hint }}</em></span>
|
||||
<span class="deposit-label"
|
||||
>押金<b>*</b
|
||||
><em v-if="priceConfig.deposit_hint">{{ priceConfig.deposit_hint }}</em></span
|
||||
>
|
||||
<div class="deposit-control">
|
||||
<el-input-number
|
||||
v-model="form.deposit_amount"
|
||||
@@ -416,7 +496,9 @@ function selectOnlineEnd(value: string | number) {
|
||||
</div>
|
||||
<div class="deposit-breakdown">
|
||||
<span v-for="item in depositBreakdownItems" :key="`${item.label}-${item.count}`">
|
||||
{{ item.label }}<template v-if="item.count > 1"> x{{ item.count }}</template> ¥{{ item.amount }}
|
||||
{{ item.label }}<template v-if="item.count > 1"> x{{ item.count }}</template> ¥{{
|
||||
item.amount
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
@@ -447,21 +529,37 @@ function selectOnlineEnd(value: string | number) {
|
||||
@click="useReferenceSaleRatio"
|
||||
>
|
||||
<strong>参考比例</strong>
|
||||
<span>{{ calculatedDefaultSaleRatio > 0 ? `1元=${formatNumber(calculatedDefaultSaleRatio)}万` : '自动计算' }}</span>
|
||||
<span>{{
|
||||
calculatedDefaultSaleRatio > 0
|
||||
? `1元=${formatNumber(calculatedDefaultSaleRatio)}万`
|
||||
: '自动计算'
|
||||
}}</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="ratio-mode-btn"
|
||||
:class="{ active: form.accelerated_sale_ratio === maxAcceleratedSaleRatio && maxAcceleratedSaleRatio > 0 }"
|
||||
:class="{
|
||||
active:
|
||||
form.accelerated_sale_ratio === maxAcceleratedSaleRatio &&
|
||||
maxAcceleratedSaleRatio > 0,
|
||||
}"
|
||||
:disabled="maxAcceleratedSaleRatio <= 0"
|
||||
@click="useMaxAcceleratedSaleRatio"
|
||||
>
|
||||
<strong>最高比例 (加速)</strong>
|
||||
<span>{{ maxAcceleratedSaleRatio > 0 ? `最高 1元=${formatNumber(maxAcceleratedSaleRatio)}万` : '自动计算' }}</span>
|
||||
<span>{{
|
||||
maxAcceleratedSaleRatio > 0
|
||||
? `最高 1元=${formatNumber(maxAcceleratedSaleRatio)}万`
|
||||
: '自动计算'
|
||||
}}</span>
|
||||
</button>
|
||||
<div
|
||||
class="ratio-custom-card"
|
||||
:class="{ active: hasAcceleratedSaleRatioInput() && form.accelerated_sale_ratio !== maxAcceleratedSaleRatio }"
|
||||
:class="{
|
||||
active:
|
||||
hasAcceleratedSaleRatioInput() &&
|
||||
form.accelerated_sale_ratio !== maxAcceleratedSaleRatio,
|
||||
}"
|
||||
>
|
||||
<strong>自定比例</strong>
|
||||
<el-input-number
|
||||
@@ -577,14 +675,23 @@ function selectOnlineEnd(value: string | number) {
|
||||
>
|
||||
立即发布
|
||||
</el-button>
|
||||
<el-button :icon="DocumentChecked" :disabled="loading" @click="handleSaveDraft">保存草稿</el-button>
|
||||
<el-button :icon="RefreshRight" :disabled="loading" @click="handleResetDraft">重置草稿</el-button>
|
||||
<el-button :icon="DocumentChecked" :disabled="loading" @click="handleSaveDraft"
|
||||
>保存草稿</el-button
|
||||
>
|
||||
<el-button :icon="RefreshRight" :disabled="loading" @click="handleResetDraft"
|
||||
>重置草稿</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<el-dialog v-model="agreementDialogVisible" :title="activeAgreementTitle" width="720px" class="publish-agreement-dialog">
|
||||
<el-dialog
|
||||
v-model="agreementDialogVisible"
|
||||
:title="activeAgreementTitle"
|
||||
width="720px"
|
||||
class="publish-agreement-dialog"
|
||||
>
|
||||
<div class="agreement-dialog-content">{{ activeAgreementContent }}</div>
|
||||
</el-dialog>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user