update
This commit is contained in:
parent
ffe8d2e3e1
commit
30cbecbd72
@ -11,7 +11,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"amis": "^3.0.0",
|
||||
"amis-ui": "^3.0.0",
|
||||
"axios": "^1.3.4",
|
||||
"copy-to-clipboard": "^3.3.3",
|
||||
"element-plus": "^2.3.3",
|
||||
|
||||
@ -1,14 +1,17 @@
|
||||
<template>
|
||||
<div ref="box"></div>
|
||||
<div ref="boxRef"></div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {defineProps,watch,toRaw} from "vue"
|
||||
import {defineProps,onMounted,watch,toRaw,ref} from "vue"
|
||||
import {ElMessage} from 'element-plus'
|
||||
import 'amis/sdk/sdk.js';
|
||||
import 'amis/lib/themes/default.css';
|
||||
import axios from 'axios'
|
||||
import copy from 'copy-to-clipboard'
|
||||
import {toast} from 'amis-ui'
|
||||
import {getPagesInfo} from '@/api/lowcode/lcPages'
|
||||
import {getToken} from '@/api/auth'
|
||||
|
||||
const boxRef = ref()
|
||||
const props = defineProps({
|
||||
formid: {
|
||||
type: String,
|
||||
@ -28,12 +31,17 @@
|
||||
onRendering(newValue)
|
||||
})
|
||||
|
||||
onMounted(()=>{
|
||||
onRendering(props.formjson)
|
||||
})
|
||||
|
||||
|
||||
function onRendering(data:any){
|
||||
console.log(data)
|
||||
// @ts-ignore
|
||||
let amis = amisRequire('amis/embed')
|
||||
let theme = 'cxd'
|
||||
let amisScoped = amis.embed(
|
||||
this.$refs.box,
|
||||
let amisScoped = amis.embed(
|
||||
boxRef.value,
|
||||
toRaw(data),
|
||||
{
|
||||
updateLocation: (to, replace) => {},
|
||||
@ -91,7 +99,7 @@
|
||||
isCancel: (value) => (axios ).isCancel(value),
|
||||
copy: content => {
|
||||
copy(content);
|
||||
toast.success('内容已复制到粘贴板');
|
||||
ElMessage.success('内容已复制到粘贴板');
|
||||
},
|
||||
theme
|
||||
}
|
||||
|
||||
@ -43,7 +43,6 @@
|
||||
}
|
||||
|
||||
function onTabMenuClick(tabItem: TabsPaneContext){
|
||||
console.log(tabItem)
|
||||
let path = tabItem.props.name as string;
|
||||
router.push(path);
|
||||
}
|
||||
|
||||
@ -45,6 +45,9 @@ public class SysMenuVo {
|
||||
@ApiModelProperty(value = "组件名称")
|
||||
private String component;
|
||||
|
||||
@ApiModelProperty(value = "组件类型:0、默认,1、amis")
|
||||
private Integer componentType;
|
||||
|
||||
@ApiModelProperty(value = "是否显示:0、不显示,1、显示")
|
||||
private Boolean isShow;
|
||||
|
||||
|
||||
@ -119,6 +119,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
.icon(menu.getIcon())
|
||||
.sort(menu.getSort())
|
||||
.component(Objects.nonNull(menu.getComponent()) && menu.getComponent().length() > 0 ? menu.getComponent() : "Layout")
|
||||
.componentType(menu.getComponentType())
|
||||
.isShow(Objects.equals(1, menu.getIsShow()) ? true : false)
|
||||
.meta(meta)
|
||||
.build()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user