31 lines
2.4 KiB
Vue
31 lines
2.4 KiB
Vue
<template>
|
||
<view v-if="user && currentModule" class="page-shell portal-page">
|
||
<PortalHeader title="业务模块" :user="user" />
|
||
<view class="portal-content">
|
||
<view class="module-hero" :class="`module-hero-${currentModule.key}`"><view class="module-hero-icon">{{ currentModule.icon }}</view><view class="module-hero-copy"><text class="module-hero-title">{{ currentModule.name }}</text><text class="module-hero-desc">{{ currentModule.description }}</text></view><text class="module-hero-count">{{ availableCount }}/{{ currentModule.operations.length }} 可用</text></view>
|
||
<view class="section-heading"><text class="group-title">业务功能</text></view>
|
||
<view class="operation-list"><button v-for="operation in currentModule.operations" :key="operation.name" class="operation-item" :class="{ 'operation-item-disabled': !operation.available }" :disabled="!operation.available" @tap="openOperation(operation)"><view class="operation-icon">{{ operation.icon }}</view><view class="operation-info"><text class="operation-name">{{ operation.name }}</text><text class="operation-desc">{{ operation.description }}</text></view><text v-if="operation.available" class="operation-ready">可处理</text><text v-else class="operation-locked">未开放</text><text v-if="operation.available" class="operation-arrow">›</text></button></view>
|
||
<view v-if="availableCount < currentModule.operations.length" class="module-empty-note">灰色功能尚未开放,仅可进入已接入真实接口的作业。</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import PortalHeader from '@/components/PortalHeader.vue'
|
||
import { MODULES } from '@/data/overseas-workbench.js'
|
||
import { session, requireSession } from '@/stores/session.js'
|
||
export default {
|
||
components: { PortalHeader },
|
||
data() { return { user: session.currentUser, moduleKey: 'inbound' } },
|
||
computed: {
|
||
currentModule() { return MODULES.find((module) => module.key === this.moduleKey) || MODULES[0] },
|
||
availableCount() { return this.currentModule.operations.filter((operation) => operation.available).length }
|
||
},
|
||
onLoad(options) { this.moduleKey = options.key || 'inbound' },
|
||
onShow() { if (!requireSession()) return; this.user = session.currentUser },
|
||
methods: {
|
||
openOperation(operation) { if (operation.available) uni.navigateTo({ url: operation.route || `/pages/operation/operation?module=${this.moduleKey}&op=${operation.key}` }) }
|
||
}
|
||
}
|
||
</script>
|