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

Function copyScreen

src/components/Grid/Grid.jsx:26–44  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

24 });
25 }
26 const copyScreen = async (id) => {
27 // 根据id copy模板
28 props.setLoading(true)
29 const params = copyData.data
30 const componentList = JSON.parse(JSON.stringify(params.componentList))
31 params.componentList = []
32 componentList.map(item => {
33 params.componentList.push({ extend: item.extend })
34 })
35 params.name = `${params.name}_copy`
36 params.extend.title = `${params.name}_copy`
37 params.extend.description = params.description
38 delete params.id
39 delete params.createTime
40 params.type = props.type
41 props.setLoading(false)
42 props.initData()
43
44 }
45 const deleteSelectedTemplate = async (id) => {
46 // 删除模板
47 data.fileList.splice(searchIndex(id), 1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected