first commit

This commit is contained in:
@jyuhsin
2025-11-16 13:55:02 +08:00
commit d62e48bf27
4702 changed files with 899773 additions and 0 deletions
@@ -0,0 +1,73 @@
<template>
<div>
<el-button type="primary" @click="onOpen" size="small">打开设计</el-button>
<el-dialog title="表单设计" :visible.sync="dialogVisible" append-to-body width="80%">
<fc-designer ref="designerRef" height="100vh" :config="{ showSaveBtn: true }" @save="onSave"></fc-designer>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="onConfirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
module.exports = {
name: "index",
props: {
value: {
type: [Object, String],
required: false
}
},
data() {
return {
dialogVisible: false,
form: {}
}
},
watch: {
value: {
handler(newVal) {
if (newVal && typeof newVal === "object") {
this.form = newVal
} else if (newVal && typeof newVal === "string") {
try {
this.form = JSON.parse(newVal)
} catch (error) {
this.form = {}
}
}
console.log(this.form)
},
deep: true,
immediate: true
}
},
methods: {
onOpen() {
this.dialogVisible = true
this.$nextTick(() => {
console.log(this.value)
console.log(this.form)
console.log(this.$refs.designerRef)
if (this.$refs.designerRef && this.form) {
this.$refs.designerRef.setOptions(this.form.options)
this.$refs.designerRef.setRule(this.form.rule)
}
})
},
onSave(val) {
console.log(val)
this.form = val
},
onConfirm() {
console.log(this.$refs.designerRef)
this.$emit("input", this.form)
this.dialogVisible = false
}
}
}
</script>
<style scoped></style>