|
@@ -5,7 +5,7 @@
|
|
|
* 数据:`/api/maint_survey` → `{rows: [{层, 存在, 名, 覆盖, 条数, 末次更新, 频率, 责任, 位置, 摄入, 说明}], error?}`。
|
|
* 数据:`/api/maint_survey` → `{rows: [{层, 存在, 名, 覆盖, 条数, 末次更新, 频率, 责任, 位置, 摄入, 说明}], error?}`。
|
|
|
* 三种分支:未取到("正在巡检…")· 出错 · 两层表(数据 / 机理)。
|
|
* 三种分支:未取到("正在巡检…")· 出错 · 两层表(数据 / 机理)。
|
|
|
*/
|
|
*/
|
|
|
-import { computed } from 'vue'
|
|
|
|
|
|
|
+import { computed, ref, watch } from 'vue'
|
|
|
import { PORTAL_RECALC_HTML } from '../lib/portalRecalc'
|
|
import { PORTAL_RECALC_HTML } from '../lib/portalRecalc'
|
|
|
import { PORTAL_CSS } from '../lib/portalSections'
|
|
import { PORTAL_CSS } from '../lib/portalSections'
|
|
|
import { t } from '../i18n/zh'
|
|
import { t } from '../i18n/zh'
|
|
@@ -18,9 +18,15 @@ const props = defineProps<{ apis?: Record<string, any> | null }>()
|
|
|
const publicMeta = (x: unknown): string => String(x == null ? '' : x)
|
|
const publicMeta = (x: unknown): string => String(x == null ? '' : x)
|
|
|
|
|
|
|
|
/** ★P68 用**门户 CSS + 该节原文**装进同源 iframe(srcdoc),与门户四节同一手法 ⇒ 渲染与 v2.9.2 一致 */
|
|
/** ★P68 用**门户 CSS + 该节原文**装进同源 iframe(srcdoc),与门户四节同一手法 ⇒ 渲染与 v2.9.2 一致 */
|
|
|
-const recalcSrc = computed<string>(() => '<!doctype html><html lang="zh" data-theme="light"><head>'
|
|
|
|
|
|
|
+const recalcBlobUrl = ref<string>('')
|
|
|
|
|
+const _recalcSrc = computed<string>(() => '<!doctype html><html lang="zh" data-theme="light"><head>'
|
|
|
+ '<meta charset="utf-8"><base target="_top"><style>' + PORTAL_CSS + '</style></head><body>'
|
|
+ '<meta charset="utf-8"><base target="_top"><style>' + PORTAL_CSS + '</style></head><body>'
|
|
|
+ PORTAL_RECALC_HTML + '</body></html>')
|
|
+ PORTAL_RECALC_HTML + '</body></html>')
|
|
|
|
|
+watch(_recalcSrc, (html) => {
|
|
|
|
|
+ const old = recalcBlobUrl.value
|
|
|
|
|
+ recalcBlobUrl.value = URL.createObjectURL(new Blob([html], { type: 'text/html;charset=utf-8' }))
|
|
|
|
|
+ if (old) { try { URL.revokeObjectURL(old) } catch { /* ignore */ } }
|
|
|
|
|
+}, { immediate: true })
|
|
|
|
|
|
|
|
const md = computed<any>(() => props.apis?.['/detail/api/maint_survey'] ?? props.apis?.['/api/maint_survey'] ?? null)
|
|
const md = computed<any>(() => props.apis?.['/detail/api/maint_survey'] ?? props.apis?.['/api/maint_survey'] ?? null)
|
|
|
|
|
|
|
@@ -74,6 +80,6 @@ const groups = computed(() => LAYERS
|
|
|
<div class="eyebrow" style="margin-top:18px">{{ t('tab.recalc') }}</div>
|
|
<div class="eyebrow" style="margin-top:18px">{{ t('tab.recalc') }}</div>
|
|
|
<Recalc />
|
|
<Recalc />
|
|
|
<iframe data-added="recalc" class="portal-recalc-frame" title="数据重算与产物"
|
|
<iframe data-added="recalc" class="portal-recalc-frame" title="数据重算与产物"
|
|
|
- :srcdoc="recalcSrc" style="width:100%;height:1420px;border:0;display:block;margin-top:18px"></iframe>
|
|
|
|
|
|
|
+ :src="recalcBlobUrl" style="width:100%;height:1420px;border:0;display:block;margin-top:18px"></iframe>
|
|
|
</section>
|
|
</section>
|
|
|
</template>
|
|
</template>
|