| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <template>
- <div class="minigame-threshold admin-page">
- <el-card>
- <PageHeader slot="header" title="小游戏维度阈值显隐配置">
- <el-select
- v-model="selectedGameId"
- placeholder="选择小游戏"
- filterable
- clearable
- class="game-select"
- @change="onGameChange"
- >
- <el-option
- v-for="g in games"
- :key="g.id"
- :label="(g.gameName || '') + '(' + (g.gameCode || '') + ')'"
- :value="g.id"
- />
- </el-select>
- </PageHeader>
- <div class="game-body">
- <div v-if="!selectedGameId" class="game-empty">
- <el-empty description="请先选择一个小游戏,再配置维度阈值显隐" />
- </div>
- <content-dimension-threshold-editor
- v-else
- content-type="MINIGAME"
- :content-id="selectedGameId"
- />
- </div>
- </el-card>
- </div>
- </template>
- <script>
- import ContentDimensionThresholdEditor from '@/components/ContentDimensionThresholdEditor.vue'
- import { getAllMiniGames } from '@/api/content-dimension-threshold'
- export default {
- name: 'MiniGameThreshold',
- components: { ContentDimensionThresholdEditor },
- data() {
- return {
- games: [],
- selectedGameId: null,
- loading: false
- }
- },
- created() {
- this.loadGames()
- },
- methods: {
- async loadGames() {
- this.loading = true
- try {
- const res = await getAllMiniGames()
- if (res.code === 200 && Array.isArray(res.data)) {
- this.games = res.data
- }
- } catch (e) {
- this.$message.error('加载小游戏列表失败')
- } finally {
- this.loading = false
- }
- },
- onGameChange(val) {
- this.selectedGameId = val || null
- }
- }
- }
- </script>
- <style scoped>
- .minigame-threshold {
- padding: 24px;
- flex: 1;
- display: flex;
- flex-direction: column;
- min-height: 0;
- }
- .minigame-threshold > .el-card {
- flex: 1;
- display: flex;
- flex-direction: column;
- min-height: 0;
- }
- .minigame-threshold > .el-card /deep/ .el-card__body {
- flex: 1;
- display: flex;
- flex-direction: column;
- min-height: 0;
- }
- .game-select {
- width: 320px;
- }
- .game-body {
- flex: 1;
- min-height: 0;
- overflow-y: auto;
- }
- .game-empty {
- padding: 40px 0;
- }
- </style>
|