am-freescan/am-web/tests/framework-reference-ui.html

19 lines
2.1 KiB
HTML
Raw Normal View History

<!doctype html>
<html lang="zh-CN"><meta charset="UTF-8"><title>E2E 框架引用配置检查</title>
<style>body{margin:0;background:#f5f7fa;font:14px Arial;color:#303133}main{width:min(496px,calc(100vw - 48px));margin:24px auto;padding:24px;background:white;border:1px solid #dcdfe6;border-radius:8px}h1{font-size:18px}#result{white-space:pre-wrap}</style>
<main><h1>导入已上传的标志点框架</h1><p>独立组件检查 · 不连接扫描仪 · 不保存业务数据</p><div id="app"></div><pre id="result" role="status"></pre></main>
<script type="module">
import { createApp, h } from 'vue'
import './componentApiFixture.mjs'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import Panel from '/src/cmvr/common/views/flow/components/params/ScannerFrameworkImportParams.vue'
import { createWorkcellNodeGroups } from '/src/cmvr/common/utils/scanMotorNodes.mjs'
const templates=createWorkcellNodeGroups()[0].nodeList
const exporter={id:'E2E-export',type:'serviceNode',properties:{...templates.find(n=>n.action==='SCANNER_EXPORT'),name:'导出标定框架'}}
const importer={id:'E2E-import',type:'serviceNode',properties:{...templates.find(n=>n.action==='SCANNER_FRAMEWORK_IMPORT'),executionTarget:{roleKey:'scanner',deviceSlotKey:'scanner'}}}
const graph={nodes:[{id:'E2E-start',type:'start',properties:{name:'开始',resourceRoles:[{roleKey:'scanner',displayName:'现场扫描工位',deviceSlots:[{slotKey:'scanner',deviceKind:14,displayName:'FreeScan扫描仪'}]}]}},exporter,importer],edges:[{sourceNodeId:'E2E-start',targetNodeId:'E2E-export'},{sourceNodeId:'E2E-export',targetNodeId:'E2E-import'}]}
window.lf={getGraphData:()=>graph,setProperties:(id,value)=>{document.querySelector('#result').textContent=JSON.stringify({id,source:value.nodeParams.find(p=>p.name==='frameworkUrls'),request:value.nodeParams.find(p=>p.name==='requestJson')},null,2)}}
createApp({render:()=>h(Panel,{data:importer,onCancel:()=>{document.querySelector('#result').textContent='已取消,未修改配置'},onSaveSuccess:()=>{document.querySelector('#result').textContent+='\n配置保存验证通过'}})}).use(ElementPlus).mount('#app')
</script></html>