feat: implement automatic margin pricing and margin reverse engineering in sync

This commit is contained in:
SmartUp Developer
2026-07-02 21:22:37 +08:00
parent 9011c68b9d
commit 0e77de31ae
5 changed files with 106 additions and 34 deletions
+27 -4
View File
@@ -158,7 +158,7 @@
<div class="binding-main">
<div class="binding-title">{{ binding.website_name }} / {{ binding.target_group_name || binding.target_group_id }}</div>
<div class="binding-meta">
{{ algorithmLabel(binding.algorithm) }} + {{ binding.percent }}% ·
{{ binding.algorithm === 'priority_weighted_plus_percent' ? `${algorithmLabel(binding.algorithm)} · 自动约 ${binding.percent}%` : `${algorithmLabel(binding.algorithm)} + ${binding.percent}%` }} ·
{{ binding.source_groups.length }} 个上游分组
</div>
</div>
@@ -297,8 +297,8 @@
</el-col>
<el-col :span="12">
<el-form-item label="百分比">
<div class="custom-percent-stepper">
<button type="button" @click="adjustPercent(-5)" class="stepper-btn">
<div class="custom-percent-stepper" :class="{ disabled: bindingForm.algorithm === 'priority_weighted_plus_percent' }">
<button type="button" @click="adjustPercent(-5)" class="stepper-btn" :disabled="bindingForm.algorithm === 'priority_weighted_plus_percent'">
<el-icon><Minus /></el-icon>
</button>
<input
@@ -308,8 +308,10 @@
max="100"
v-model.number="bindingForm.percent"
class="stepper-input"
:disabled="bindingForm.algorithm === 'priority_weighted_plus_percent'"
:placeholder="bindingForm.algorithm === 'priority_weighted_plus_percent' ? '自动计算' : ''"
/>
<button type="button" @click="adjustPercent(5)" class="stepper-btn">
<button type="button" @click="adjustPercent(5)" class="stepper-btn" :disabled="bindingForm.algorithm === 'priority_weighted_plus_percent'">
<el-icon><Plus /></el-icon>
</button>
</div>
@@ -2588,6 +2590,27 @@ onMounted(loadAll)
margin: 0;
}
.custom-percent-stepper.disabled {
opacity: 0.6;
background: #0f0706;
border-color: #2b1c18;
}
.custom-percent-stepper.disabled .stepper-btn {
cursor: not-allowed;
color: #5c4a45;
}
.custom-percent-stepper.disabled .stepper-btn:hover {
background: transparent;
color: #5c4a45;
}
.custom-percent-stepper.disabled .stepper-input {
cursor: not-allowed;
color: #8c746b;
}
/* Custom Switch Toggle */
.switch-toggle-line {
display: flex;