|
|
@@ -0,0 +1,215 @@
|
|
|
+<template>
|
|
|
+ <div class="child-page-display">
|
|
|
+ <div class="child-page-header">
|
|
|
+ <div class="header-left">
|
|
|
+ <span class="badge">{{ lang.ssWaitSelection }}</span>
|
|
|
+ <span class="hint">{{ formatHint(lang.ssWaitSelectionHint, toolsArray.length) }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="header-right">
|
|
|
+ <button
|
|
|
+ v-for="(tool, index) in toolsArray"
|
|
|
+ :key="tool.tool_id"
|
|
|
+ class="candidate-tag"
|
|
|
+ :class="{ active: selectedToolIndex === index }"
|
|
|
+ @click="selectTool(index)"
|
|
|
+ >
|
|
|
+ {{ lang.ssCandidate }} {{ fillDigit(index + 1, 2) }} {{ tool.tool_name }}
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="child-page-body">
|
|
|
+ <div class="question-area">
|
|
|
+ <iframe src="https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=30ca7d10-4d09-11f1-9985-005056924926&type=79" frameborder="0"></iframe>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="side-panel">
|
|
|
+ <button class="side-btn primary">{{ lang.ssKeep }}</button>
|
|
|
+ <button class="side-btn secondary">{{ lang.ssDiscard }}</button>
|
|
|
+ <div class="divider"></div>
|
|
|
+ <button class="side-btn link">{{ lang.ssKeepAll }}</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { ref, onMounted, watch } from 'vue'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
+import { useMainStore } from '@/store'
|
|
|
+import { fillDigit } from '@/utils/common'
|
|
|
+import { lang } from '@/main'
|
|
|
+
|
|
|
+const mainStore = useMainStore()
|
|
|
+const { childPageToolsArray } = storeToRefs(mainStore)
|
|
|
+
|
|
|
+const toolsArray = childPageToolsArray.value
|
|
|
+const selectedToolIndex = ref(0)
|
|
|
+
|
|
|
+const formatHint = (str: string, count: number) => {
|
|
|
+ return str.replace('{0}', String(count))
|
|
|
+}
|
|
|
+
|
|
|
+const selectTool = (index: number) => {
|
|
|
+ selectedToolIndex.value = index
|
|
|
+ console.log('👶 选中工具:', toolsArray[index])
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ console.log('👶 带选页打开,toolsArray:', toolsArray)
|
|
|
+})
|
|
|
+
|
|
|
+watch(childPageToolsArray, (newVal) => {
|
|
|
+ console.log('👶 带选页 toolsArray 更新:', newVal)
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.child-page-display {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ background-color: #fffbeb;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ border-radius: 3px;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.child-page-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 7px 20px;
|
|
|
+ background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
|
|
|
+
|
|
|
+ .header-left {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .badge {
|
|
|
+ background-color: #d97706;
|
|
|
+ color: white;
|
|
|
+ padding: 4px 12px;
|
|
|
+ border-radius: 4px;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+
|
|
|
+ .hint {
|
|
|
+ color: #78350f;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .header-right {
|
|
|
+ display: flex;
|
|
|
+ gap: 8px;
|
|
|
+ background: #d97706;
|
|
|
+ padding: 5px 10px;
|
|
|
+ border-radius: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .candidate-tag {
|
|
|
+ background-color: #d97706;
|
|
|
+ color: white;
|
|
|
+ padding: 4px 12px;
|
|
|
+ border-radius: 4px;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 500;
|
|
|
+ border: none;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.2s;
|
|
|
+ border-radius: 30px;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background-color: #b45309;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ background-color: white;
|
|
|
+ color: #d97706;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.child-page-body {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ padding: 20px;
|
|
|
+ gap: 20px;
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.question-area {
|
|
|
+ flex: 1;
|
|
|
+ background-color: white;
|
|
|
+ border: 2px solid #f59e0b;
|
|
|
+ border-radius: 8px;
|
|
|
+ padding: 20px;
|
|
|
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
|
+
|
|
|
+ iframe {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.side-panel {
|
|
|
+ width: 90px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 12px;
|
|
|
+
|
|
|
+ .side-btn {
|
|
|
+ padding: 12px 20px;
|
|
|
+ border: none;
|
|
|
+ border-radius: 8px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.2s;
|
|
|
+
|
|
|
+ &.primary {
|
|
|
+ background-color: #f59e0b;
|
|
|
+ color: white;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background-color: #d97706;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.secondary {
|
|
|
+ background-color: white;
|
|
|
+ color: #6b7280;
|
|
|
+ border: 1px solid #e5e7eb;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ border-color: #f59e0b;
|
|
|
+ color: #f59e0b;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.link {
|
|
|
+ background-color: transparent;
|
|
|
+ color: #f59e0b;
|
|
|
+ text-align: left;
|
|
|
+ padding-left: 0;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ text-decoration: underline;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .divider {
|
|
|
+ height: 1px;
|
|
|
+ background-color: #e5e7eb;
|
|
|
+ margin: 4px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|