fix event require input
This commit is contained in:
@@ -88,8 +88,10 @@
|
|||||||
/>
|
/>
|
||||||
</t-form-item>
|
</t-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showSourceValueInput" class="source-value-panel">
|
<t-form-item v-if="showSourceValueInput" label="积分动作" content-align="right">
|
||||||
<div class="source-value-title" v-text="sourceValueAction === 'CONSUME' ? '消耗积分' : '发放积分'" />
|
<span v-text="sourceValueAction === 'CONSUME' ? '消耗积分' : '发放积分'" />
|
||||||
|
</t-form-item>
|
||||||
|
<t-form-item v-if="showSourceValueInput" label="积分数量" required-mark>
|
||||||
<t-input
|
<t-input
|
||||||
v-model.trim="pointValueText"
|
v-model.trim="pointValueText"
|
||||||
type="number"
|
type="number"
|
||||||
@@ -97,7 +99,7 @@
|
|||||||
borderless
|
borderless
|
||||||
:placeholder="sourceValuePlaceholder"
|
:placeholder="sourceValuePlaceholder"
|
||||||
/>
|
/>
|
||||||
</div>
|
</t-form-item>
|
||||||
<t-form-item label="登记备注">
|
<t-form-item label="登记备注">
|
||||||
<t-textarea
|
<t-textarea
|
||||||
v-model.trim="note"
|
v-model.trim="note"
|
||||||
@@ -830,20 +832,6 @@ watch(scanCode, (value) => {
|
|||||||
padding: 0 1rem;
|
padding: 0 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.source-value-panel {
|
|
||||||
padding: .75rem 1rem 1rem;
|
|
||||||
|
|
||||||
.source-value-title {
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.t-input {
|
|
||||||
margin-top: .5rem;
|
|
||||||
border: 1px solid var(--td-component-border);
|
|
||||||
border-radius: .75rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.photo {
|
.photo {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
@@ -882,11 +870,6 @@ watch(scanCode, (value) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.source-value-panel .t-input {
|
|
||||||
background: rgba(15, 23, 42, .72);
|
|
||||||
border-color: rgba(148, 163, 184, .16);
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.textarea .t-textarea__inner) {
|
:deep(.textarea .t-textarea__inner) {
|
||||||
color: #e2e8f0;
|
color: #e2e8f0;
|
||||||
background: rgba(15, 23, 42, .72);
|
background: rgba(15, 23, 42, .72);
|
||||||
|
|||||||
+1
-27
@@ -75,36 +75,10 @@ export function resolvePointRuleAction(rule: PointRule): PointAction | undefined
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resolvePointValueRuleConfig(rule: PointRule): SourceValueConfig | undefined {
|
function resolvePointValueRuleConfig(rule: PointRule): SourceValueConfig | undefined {
|
||||||
if (rule.status !== "ACTIVE") {
|
if (rule.status !== "ACTIVE" || rule.triggerType !== "SOURCE_VALUE" || rule.pointMode !== "SOURCE_VALUE") {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (rule.pointMode === "FIXED") {
|
|
||||||
return resolveFixedPointValueRuleConfig(rule);
|
|
||||||
}
|
|
||||||
if (rule.triggerType === "SOURCE_VALUE" && rule.pointMode === "SOURCE_VALUE") {
|
|
||||||
return resolveSourceValueRuleConfig(rule);
|
return resolveSourceValueRuleConfig(rule);
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolveFixedPointValueRuleConfig(rule: PointRule): SourceValueConfig | undefined {
|
|
||||||
const action = resolvePointRuleAction(rule);
|
|
||||||
const pointValue = rule.pointValue;
|
|
||||||
if (
|
|
||||||
action === undefined
|
|
||||||
|| pointValue === undefined
|
|
||||||
|| pointValue === null
|
|
||||||
|| !Number.isSafeInteger(pointValue)
|
|
||||||
|| pointValue === 0
|
|
||||||
) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const value = Math.abs(pointValue);
|
|
||||||
return {
|
|
||||||
action,
|
|
||||||
range: [value, value]
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveSourceValueRuleConfig(rule: PointRule): SourceValueConfig | undefined {
|
function resolveSourceValueRuleConfig(rule: PointRule): SourceValueConfig | undefined {
|
||||||
|
|||||||
Reference in New Issue
Block a user