|
|
@ -1,11 +1,14 @@ |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { reactive, toRaw } from "vue"; |
|
|
import { createVNode, getCurrentInstance, reactive, toRaw } from "vue"; |
|
|
import { Format } from "@ease-forge/shared"; |
|
|
import { Format } from "@ease-forge/shared"; |
|
|
import { createBlockComponent } from "@ease-forge/runtime"; |
|
|
import { createBlockComponent } from "@ease-forge/runtime"; |
|
|
import DataForm, { type DataFormProps } from "@/components/data-form/DataForm.vue"; |
|
|
import DataForm, { type DataFormProps } from "@/components/data-form/DataForm.vue"; |
|
|
|
|
|
|
|
|
window.globalConfig.componentManage.registerComponent("DataForm", DataForm); |
|
|
window.globalConfig.componentManage.registerComponent("DataForm", DataForm); |
|
|
|
|
|
|
|
|
|
|
|
// 当前组件对象 |
|
|
|
|
|
const instance = getCurrentInstance(); |
|
|
|
|
|
|
|
|
const data = reactive({ |
|
|
const data = reactive({ |
|
|
str: "abcABC", |
|
|
str: "abcABC", |
|
|
num_1: 123, |
|
|
num_1: 123, |
|
|
@ -372,7 +375,8 @@ const MyDataForm = createBlockComponent({ |
|
|
style: { |
|
|
style: { |
|
|
overflowY: "auto", |
|
|
overflowY: "auto", |
|
|
}, |
|
|
}, |
|
|
data: "{{ data }}", |
|
|
// data: "{{ data }}", |
|
|
|
|
|
data: toRaw(data), |
|
|
formFields: dataForm1.formFields, |
|
|
formFields: dataForm1.formFields, |
|
|
columnCount: dataForm1.columnCount, |
|
|
columnCount: dataForm1.columnCount, |
|
|
layout: dataForm1.layout, |
|
|
layout: dataForm1.layout, |
|
|
@ -383,7 +387,16 @@ const MyDataForm = createBlockComponent({ |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
function test() { |
|
|
function test() { |
|
|
system.showDialog(MyDataForm, { |
|
|
system.showDialog(createVNode(DataForm, { |
|
|
|
|
|
style: { |
|
|
|
|
|
overflowY: "auto", |
|
|
|
|
|
}, |
|
|
|
|
|
data: toRaw(data), |
|
|
|
|
|
formFields: dataForm1.formFields, |
|
|
|
|
|
columnCount: dataForm1.columnCount, |
|
|
|
|
|
layout: dataForm1.layout, |
|
|
|
|
|
labelWidth: "100px", |
|
|
|
|
|
}), { |
|
|
title: '模型查看器', |
|
|
title: '模型查看器', |
|
|
width: 950, |
|
|
width: 950, |
|
|
height: 400, |
|
|
height: 400, |
|
|
@ -393,6 +406,7 @@ function test() { |
|
|
showOkButton: true, |
|
|
showOkButton: true, |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
console.log("data", data); |
|
|
console.log("data", data); |
|
|
|
|
|
// instance?.proxy.$forceUpdate(); |
|
|
}).finally(); |
|
|
}).finally(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|