feat: 教育管理员订阅计划展示

This commit is contained in:
2025-12-18 13:29:30 +08:00
parent c6f3a44b81
commit 81e230b79f
3 changed files with 70 additions and 16 deletions

View File

@@ -91,7 +91,7 @@
<a-select
v-model:value="subscriptionPlanId"
style="width: 250px"
:options="planOptions"
:options="activePlanOptions"
:field-names="{ label: 'name', value: 'id' }"
:placeholder="$t('admin.SelectPlan')"
></a-select>
@@ -106,7 +106,7 @@
<a-spin size="large" />
</div>
</template>
<script>
<script lang="ts">
import {
defineComponent,
ref,
@@ -115,6 +115,7 @@ import {
onMounted,
nextTick,
toRefs,
computed,
} from "vue";
import { Https } from "@/tool/https";
import { Modal, message } from "ant-design-vue";
@@ -134,6 +135,13 @@ export default defineComponent({
setup(props, { emit }) {
const {t} = useI18n()
const { planOptions } = toRefs(props)
// 筛选出状态为 ACTIVE 的订阅计划
const activePlanOptions = computed(() => {
if (!planOptions.value || !Array.isArray(planOptions.value)) {
return []
}
return planOptions.value.filter((plan: any) => plan.status === 'ACTIVE')
})
let operations = reactive({
operationsModal: false,
operationsEdit: false,
@@ -303,6 +311,7 @@ export default defineComponent({
blur,
setOk,
planOptions,
activePlanOptions
};
},
data() {