MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / Workspace

Function Workspace

src/pages/Workspace/index.jsx:31–504  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29let basicHeight = 0
30let isMove = true;
31function Workspace() {
32 const [property, setProperty] = useState({}); // 属性区的属性
33 const [basicProperty, setBasicProperty] = useState({}); // 属性区的基础属性
34 const [current, setCurrent] = useState({}); // 当前元素
35 const [layer, setLayer] = useState([]); // 图层
36 const [nowId, setNowId] = useState(); // 当前元素
37 const [nowGroupId, setNowGroupId] = useState(); // 当前选中的组id
38 const [zoom, setZoom] = useState(69.8); // 当前大屏的高
39 const [shareModal, setShareModal] = useState(false); // 分享modal开关
40 const [htmlReverseModal, setHtmlReverseModal] = useState(false); // html逆向工程modal开关
41 const [linkKeyMatchStatus, setLinkKeyMatchStatus] = useState(false); // 联动菜单是否映射成功
42 const [SSEServer, setSSEServer] = useState(null)
43 const [spinning, setSpinning] = useState(false) // 是否显示Spin
44 const [spinText, setSpinText] = useState('加载中') // 加载文案
45 const [dataOrigin, setDataOrigin] = useState([]) // 系统配置api
46 const [exportBluePrint, setExportBluePrint] = useState([]) // 导出到蓝湖编辑器数据
47 const [isShowBluePrint, setIsShowBluePrint] = useState(false) // 是否展示蓝图编辑器
48 const iframeRef = useRef(null);
49 const rulerRef = useRef(null);
50 const id = window.location.hash.split('?')[1].split('=')[1] // 根据url截取的id
51
52 function sendMsg(command) {
53 effectFrame({
54 command
55 });
56 }
57 function confirmModal(title, onOk) {
58 // 确定框
59 confirm({
60 title,
61 getContainer: document.getElementById("workspace"),
62 icon: <ExclamationCircleOutlined />,
63 okText: '确定',
64 okType: 'danger',
65 okButtonProps: {
66 ghost: true
67 },
68 maskClosable: true,
69 mask: true,
70 cancelText: '取消',
71 cancelButtonProps: {
72 ghost: true
73 },
74 onOk() {
75 setTimeout(async () => {
76 onOk()
77 }, 100);
78 },
79 onCancel() { },
80 });
81 }
82
83 function share() {
84 setShareModal(true)
85 }
86 function onClickHtmlReverse() {
87 setHtmlReverseModal(true)
88 }

Callers

nothing calls this directly

Calls 5

zoomChangeFunction · 0.85
confirmModalFunction · 0.85
openBluePrintFunction · 0.85
initTemplateFunction · 0.85
sendMsgFunction · 0.70

Tested by

no test coverage detected