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