fix PointRuleDetail.vue style

This commit is contained in:
Timi
2026-09-09 11:55:10 +08:00
parent 32268dbe76
commit 2532ea488a
3 changed files with 172 additions and 114 deletions
+32 -36
View File
@@ -31,12 +31,24 @@
</t-cell>
<t-cell title="规则备注" :note="Text.display(rule.remark)" />
</t-cell-group>
<t-cell-group v-if="rule" title="积分配置" theme="card" v-entrance-transition="140">
<t-cell-group
v-if="rule"
class="script"
title="积分配置"
theme="card"
v-entrance-transition="140"
>
<t-cell title="规则模式" :note="rule.ruleMode === 'GROOVY' ? '脚本规则' : '简单规则'" />
<t-cell v-if="rule.ruleMode !== 'GROOVY'" title="固定积分" :note="formatPointValue(rule.pointValue)" />
<template v-if="rule?.ruleMode === 'GROOVY'">
<t-cell title="执行脚本" :note="scriptName" />
<t-cell class="empty-cell-title-margin" title="脚本说明">
<t-cell class="description empty-cell-title-margin">
<template #title>
<div class="title">
<span>脚本说明</span>
<span class="tips orange">如需调整规则请联系技术支持</span>
</div>
</template>
<template #description>
<markdown-view :content="rule.groovyScript?.description || '暂无脚本说明'" />
</template>
@@ -49,9 +61,9 @@
language="groovy"
readonly
line-numbers
class="script-editor"
class="code"
/>
<div v-else class="empty-script" v-text="'暂无脚本代码'" />
<div v-else class="center-tips" v-text="'暂无脚本代码'" />
</template>
</t-cell>
</template>
@@ -66,10 +78,9 @@
</t-cell-group>
<t-button
v-if="rule && canDelete"
class="delete red bg-white cell-button"
class="cell-button"
:loading="isDeleting"
variant="text"
block
theme="danger"
@click="confirmRemove"
>
删除
@@ -134,20 +145,6 @@ const rulePointText = computed(() => {
return formatPointValue(rule.value?.pointValue);
});
const scriptName = computed(() => rule.value?.groovyScript?.name || rule.value?.groovyScriptId || "未绑定脚本");
const scriptStatusText = computed(() => {
const script = rule.value?.groovyScript;
if (!script) {
return "脚本不存在";
}
if (script.enabled && script.publishedVersionId) {
return "已启用并已发布";
}
return script.enabled ? "已启用,未发布" : "已停用";
});
const scriptVersionText = computed(() => {
const version = rule.value?.groovyScript?.latest?.version;
return version === undefined || version === null ? "未创建版本" : String(version);
});
const scriptContent = computed(() => rule.value?.groovyScript?.latest?.content || "");
async function loadStoreScope(): Promise<void> {
@@ -335,10 +332,6 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
.delete {
margin: 0 1rem;
}
.rule-header {
gap: .75rem;
margin: 0 1rem;
@@ -387,20 +380,23 @@ onUnmounted(() => {
}
}
.script-section {
.script {
.script-editor {
height: 24rem;
min-height: 16rem;
background: var(--td-bg-color-page);
border-radius: .5rem;
.description {
.title {
flex: 1;
display: flex;
justify-content: space-between;
.tips {
font-size: .75rem;
}
}
}
.empty-script {
padding: 1rem;
color: var(--td-text-color-placeholder);
background: var(--td-bg-color-page);
border-radius: .5rem;
.code {
min-height: 10rem;
}
}
}