Commit 74360459 authored by chenqikuai's avatar chenqikuai

fix

parent c09609c3
......@@ -190,11 +190,11 @@
}
},
"@tinymce/tinymce-vue": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@tinymce/tinymce-vue/-/tinymce-vue-5.0.0.tgz",
"integrity": "sha512-1HRCNa2eGdztOKShYAiHIry50LTU6YJG//qSP9AJElrXhb3BIBN0Bef6E56nZObVgwCgSmI4cnX35VU9D49aow==",
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/@tinymce/tinymce-vue/-/tinymce-vue-4.0.7.tgz",
"integrity": "sha512-1esB8wGWrjPCY+rK8vy3QB1cxwXo7HLJWuNrcyPl6LOVR+QJjub0OiV/C+TUEsLN6OpCtRv+QnIqMC5vXz783Q==",
"requires": {
"tinymce": "^6.0.0 || ^5.5.1"
"tinymce": "^5.5.0"
}
},
"@types/crypto-js": {
......@@ -2161,9 +2161,9 @@
"integrity": "sha512-XH8UiPCQcWNuk2LYePibW/4qL97+ZQ1AN3FNXwZRBNPPowo/NRU5fAlDCSNBJIYCKbioZfuYtMhG4quqoJhVzg=="
},
"tinymce": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/tinymce/-/tinymce-6.1.0.tgz",
"integrity": "sha512-IdSdMlmuyhpEpUuabhBUaRC2NzZZxP2/CO/F+/54kTaAifB1Et5mKEty03pJYZxl6GBdFgclKRA2UU5JKJtJbA=="
"version": "5.10.5",
"resolved": "https://registry.npmjs.org/tinymce/-/tinymce-5.10.5.tgz",
"integrity": "sha512-nFKtLhmoRtExBxUfv06JlkbQWux5D+d115vxSRAqUmccZdrtpFvOIYwZmikvulLdM9pfEpvO0B+RQ2qFV/+R7w=="
},
"to-fast-properties": {
"version": "2.0.0",
......
......@@ -15,7 +15,7 @@
},
"dependencies": {
"@chenfengyuan/vue-countdown": "^2.0.0",
"@tinymce/tinymce-vue": "^5.0.0",
"@tinymce/tinymce-vue": "^4.0.7",
"axios": "^0.26.1",
"comlink": "^4.3.1",
"cqk-sy-ui": "^1.2.82",
......
......@@ -350,7 +350,30 @@ async function dialogConfirm(
return component[methodName](params);
}
function changeUnit(indexOfList: number, value: { id: string; title: string; children: (any | { id: string; label: string; key: string; type: PropertyType; options: string[]; value: string | string[]; parent: any; data?: { value: string; format: string; type: string; } | undefined; })[]; parent: any | null; type: PropertyType; addInputChildren: (label: string) => void; changeChild2Unit: (child: Property) => Unit; }) {
function changeUnit(
indexOfList: number,
value: {
id: string;
title: string;
children: (
| any
| {
id: string;
label: string;
key: string;
type: PropertyType;
options: string[];
value: string | string[];
parent: any;
data?: { value: string; format: string; type: string } | undefined;
}
)[];
parent: any | null;
type: PropertyType;
addInputChildren: (label: string) => void;
changeChild2Unit: (child: Property) => Unit;
}
) {
rootUnitList.value.splice(indexOfList, 1, value);
}
......@@ -864,7 +887,52 @@ function showAddChildDialog(data?: any) {
isShowAddChildDialog.value = true;
}
// 删除子级
function deleteItem(data?: { id: string; title: string; children: (any | { id: string; label: string; key: string; type: PropertyType; options: string[]; value: string | string[]; parent: any; data?: { value: string; format: string; type: string; } | undefined; })[]; parent: any | null; type: PropertyType; addInputChildren: (label: string) => void; changeChild2Unit: (child: Property) => Unit; } | { id: string; label: string; key: string; type: PropertyType; options: string[]; value: string | string[]; parent: { id: string; title: string; children: (any | any)[]; parent: any | null; type: PropertyType; addInputChildren: (label: string) => void; changeChild2Unit: (child: Property) => Unit; }; data?: { value: string; format: string; type: string; } | undefined; } | null | undefined) {
function deleteItem(
data?:
| {
id: string;
title: string;
children: (
| any
| {
id: string;
label: string;
key: string;
type: PropertyType;
options: string[];
value: string | string[];
parent: any;
data?:
| { value: string; format: string; type: string }
| undefined;
}
)[];
parent: any | null;
type: PropertyType;
addInputChildren: (label: string) => void;
changeChild2Unit: (child: Property) => Unit;
}
| {
id: string;
label: string;
key: string;
type: PropertyType;
options: string[];
value: string | string[];
parent: {
id: string;
title: string;
children: (any | any)[];
parent: any | null;
type: PropertyType;
addInputChildren: (label: string) => void;
changeChild2Unit: (child: Property) => Unit;
};
data?: { value: string; format: string; type: string } | undefined;
}
| null
| undefined
) {
const target = data || selectedEditItem.value;
if (target) {
let list = target.parent ? target.parent.children : rootUnitList.value;
......
......@@ -136,9 +136,13 @@ export default defineComponent({
beforeUnmount() {
this.Editor?.remove();
},
emits: ["input"],
methods: {
setup(editor) {
setup(editor: any) {
this.Editor = editor;
editor.on("init", () => {
editor.setContent(this.value);
});
editor.on("input change undo redo", () => {
this.$emit("input", editor.getContent());
});
......
......@@ -73,7 +73,7 @@
@modifyForms="modifyForms"
@dragstart="dragstart(item, index)"
@dragend="dragend()"
@dragover="dragover(item, index)"
@dragover="dragover(item as any, index)"
>
<div class="flex-grow relative">
<div
......@@ -87,7 +87,7 @@
</div>
<property-item
class="property-item"
:property="item"
:property="(item as any)"
:setProperty="
(v) => {
changeUnitChildrenItemValue(index, v);
......
......@@ -36,7 +36,7 @@ export default defineComponent({
},
computed: {},
methods: {
getContent(val) {
getContent(val: any) {
this.setPropertyValue(val);
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment