diff --git a/.eslintrc.js b/.eslintrc.js index 42f18d2..dbe68de 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,11 @@ module.exports = { - extends: ['@vue/eslint-config-standard'], + root: true, + extends: ['plugin:vue/vue3-essential', '@vue/eslint-config-standard-with-typescript'], + parserOptions: { + ecmaVersion: 'latest', + }, rules: { 'vue/multi-word-component-names': 'off', + '@typescript-eslint/no-explicit-any': 'off', }, } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3312cd6..b146d08 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,7 +4,6 @@ "vitest.explorer", "dbaeumer.vscode-eslint", "EditorConfig.EditorConfig", - "esbenp.prettier-vscode", "vscode-icons-team.vscode-icons", "esbenp.prettier-vscode", "stylelint.vscode-stylelint", diff --git a/Untitled-1.json b/Untitled-1.json new file mode 100644 index 0000000..3777399 --- /dev/null +++ b/Untitled-1.json @@ -0,0 +1,232 @@ +{ + "widgetList": [ + { + "key": 47004, + "type": "table", + "category": "container", + "icon": "table", + "rows": [ + { + "cols": [ + { + "type": "table-cell", + "category": "container", + "icon": "table-cell", + "internal": true, + "widgetList": [], + "merged": false, + "options": { + "name": "table-cell-89646", + "cellWidth": "", + "cellHeight": "", + "colspan": 1, + "rowspan": 1, + "wordBreak": false, + "customClass": "" + }, + "id": "table-cell-89646" + }, + { + "type": "table-cell", + "category": "container", + "icon": "table-cell", + "internal": true, + "widgetList": [], + "merged": false, + "options": { + "name": "table-cell-94169", + "cellWidth": "", + "cellHeight": "", + "colspan": 1, + "rowspan": 1, + "wordBreak": false, + "customClass": "" + }, + "id": "table-cell-94169" + } + ], + "id": "table-row-17138", + "merged": false + }, + { + "cols": [ + { + "type": "table-cell", + "category": "container", + "icon": "table-cell", + "internal": true, + "widgetList": [ + { + "key": 63447, + "type": "input", + "alias": "", + "icon": "text-field", + "formItemFlag": true, + "options": { + "name": "input52553", + "keyNameEnabled": false, + "keyName": "", + "label": "input", + "labelAlign": "", + "type": "text", + "defaultValue": "", + "placeholder": "", + "columnWidth": "200px", + "size": "", + "labelWidth": null, + "labelHidden": false, + "labelWrap": false, + "readonly": false, + "disabled": false, + "hidden": false, + "clearable": true, + "showPassword": false, + "required": false, + "requiredHint": "", + "validation": "", + "validationHint": "", + "customClass": "", + "labelIconClass": null, + "labelIconPosition": "rear", + "labelTooltip": null, + "minLength": null, + "maxLength": null, + "showWordLimit": false, + "prefixIcon": "", + "suffixIcon": "", + "appendButton": false, + "appendButtonDisabled": false, + "buttonIcon": "custom-search", + "appendText": false, + "textForAppend": "", + "onCreated": "", + "onMounted": "", + "onInput": "", + "onChange": "", + "onFocus": "", + "onBlur": "", + "onValidate": "", + "onAppendButtonClick": "" + }, + "id": "input52553" + } + ], + "merged": false, + "options": { + "name": "table-cell-57911", + "cellWidth": "", + "cellHeight": "", + "colspan": 2, + "rowspan": 1, + "wordBreak": false, + "customClass": "" + }, + "id": "table-cell-57911" + }, + { + "type": "table-cell", + "category": "container", + "icon": "table-cell", + "internal": true, + "widgetList": [], + "merged": true, + "options": { + "name": "table-cell-74240", + "cellWidth": "", + "cellHeight": "", + "colspan": 2, + "rowspan": 1, + "wordBreak": false, + "customClass": "" + }, + "id": "table-cell-74240" + } + ], + "id": "table-row-57542", + "merged": false + } + ], + "options": { + "name": "table61396", + "hidden": false, + "customClass": [] + }, + "id": "table61396" + }, + { + "key": 63447, + "type": "input", + "alias": "", + "icon": "text-field", + "formItemFlag": true, + "options": { + "name": "input26255", + "keyNameEnabled": false, + "keyName": "", + "label": "input", + "labelAlign": "", + "type": "text", + "defaultValue": "", + "placeholder": "", + "columnWidth": "200px", + "size": "", + "labelWidth": null, + "labelHidden": false, + "labelWrap": false, + "readonly": false, + "disabled": false, + "hidden": false, + "clearable": true, + "showPassword": false, + "required": false, + "requiredHint": "", + "validation": "", + "validationHint": "", + "customClass": [], + "labelIconClass": null, + "labelIconPosition": "rear", + "labelTooltip": null, + "minLength": null, + "maxLength": null, + "showWordLimit": false, + "prefixIcon": "", + "suffixIcon": "", + "appendButton": false, + "appendButtonDisabled": false, + "buttonIcon": "custom-search", + "appendText": false, + "textForAppend": "", + "onCreated": "", + "onMounted": "", + "onInput": "", + "onChange": "", + "onFocus": "", + "onBlur": "", + "onValidate": "", + "onAppendButtonClick": "" + }, + "id": "input26255" + } + ], + "formConfig": { + "modelName": "formData", + "refName": "vForm", + "rulesName": "rules", + "labelWidth": 80, + "labelPosition": "left", + "h5LabelTop": false, + "gridResponsive": false, + "size": "", + "labelAlign": "label-left-align", + "cssCode": "", + "customClass": [], + "functions": "", + "layoutType": "PC", + "jsonVersion": 3, + "dataSources": [], + "onFormCreated": "", + "onFormMounted": "", + "onFormDataChange": "", + "onFormValidate": "" + } +} diff --git a/package-lock.json b/package-lock.json index 72e98e2..44bc733 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1071,9 +1071,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.6.0.tgz", - "integrity": "sha512-WhCn7Z7TauhBtmzhvKpoQs0Wwb/kBcy4CwpuI0/eEIr2Lx2auxmulAzLr91wVZJaz47iUZdkXOK7WlAfxGKCnA==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.6.1.tgz", + "integrity": "sha512-KTsJMmobmbrFLe3LDh0PC2FXpcSYJt/MLjlkh/9LEnmKYLSYmT/0EW9JWANjeoemiuZrmogti0tW5Ch+qNUYDw==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.4.3" @@ -2334,25 +2334,25 @@ } }, "node_modules/@vue/devtools-api": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-7.7.2.tgz", - "integrity": "sha512-1syn558KhyN+chO5SjlZIwJ8bV/bQ1nOVTG66t2RbG66ZGekyiYNmRO7X9BJCXQqPsFHlnksqvPhce2qpzxFnA==", + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-7.7.5.tgz", + "integrity": "sha512-HYV3tJGARROq5nlVMJh5KKHk7GU8Au3IrrmNNqr978m0edxgpHgYPDoNUGrvEgIbObz09SQezFR3A1EVmB5WZg==", "dependencies": { - "@vue/devtools-kit": "^7.7.2" + "@vue/devtools-kit": "^7.7.5" } }, "node_modules/@vue/devtools-core": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@vue/devtools-core/-/devtools-core-7.7.2.tgz", - "integrity": "sha512-lexREWj1lKi91Tblr38ntSsy6CvI8ba7u+jmwh2yruib/ltLUcsIzEjCnrkh1yYGGIKXbAuYV2tOG10fGDB9OQ==", + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@vue/devtools-core/-/devtools-core-7.7.5.tgz", + "integrity": "sha512-ElKr0NDor57gVaT+gMQ8kcVP4uFGqHcxuuQndW/rPwh6aHWvEcUL3sxL8cEk+e1Rdt28kS88erpsiIMO6hEENQ==", "dev": true, "dependencies": { - "@vue/devtools-kit": "^7.7.2", - "@vue/devtools-shared": "^7.7.2", + "@vue/devtools-kit": "^7.7.5", + "@vue/devtools-shared": "^7.7.5", "mitt": "^3.0.1", - "nanoid": "^5.0.9", - "pathe": "^2.0.2", - "vite-hot-client": "^0.2.4" + "nanoid": "^5.1.0", + "pathe": "^2.0.3", + "vite-hot-client": "^2.0.4" }, "peerDependencies": { "vue": "^3.0.0" @@ -2377,23 +2377,23 @@ } }, "node_modules/@vue/devtools-kit": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@vue/devtools-kit/-/devtools-kit-7.7.2.tgz", - "integrity": "sha512-CY0I1JH3Z8PECbn6k3TqM1Bk9ASWxeMtTCvZr7vb+CHi+X/QwQm5F1/fPagraamKMAHVfuuCbdcnNg1A4CYVWQ==", + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@vue/devtools-kit/-/devtools-kit-7.7.5.tgz", + "integrity": "sha512-S9VAVJYVAe4RPx2JZb9ZTEi0lqTySz2CBeF0wHT5D3dkTLnT9yMMGegKNl4b2EIELwLSkcI9bl2qp0/jW+upqA==", "dependencies": { - "@vue/devtools-shared": "^7.7.2", - "birpc": "^0.2.19", + "@vue/devtools-shared": "^7.7.5", + "birpc": "^2.3.0", "hookable": "^5.5.3", "mitt": "^3.0.1", "perfect-debounce": "^1.0.0", "speakingurl": "^14.0.1", - "superjson": "^2.2.1" + "superjson": "^2.2.2" } }, "node_modules/@vue/devtools-shared": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@vue/devtools-shared/-/devtools-shared-7.7.2.tgz", - "integrity": "sha512-uBFxnp8gwW2vD6FrJB8JZLUzVb6PNRG0B0jBnHsOH8uKyva2qINY8PTF5Te4QlTbMDqU5K6qtJDr6cNsKWhbOA==", + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@vue/devtools-shared/-/devtools-shared-7.7.5.tgz", + "integrity": "sha512-QBjG72RfpM0DKtpns2RZOxBltO226kOAls9e4Lri6YxS2gWTgL0H+wj1R2K76lxxIeOrqo4+2Ty6RQnzv+WSTQ==", "dependencies": { "rfdc": "^1.4.1" } @@ -2821,9 +2821,9 @@ } }, "node_modules/birpc": { - "version": "0.2.19", - "resolved": "https://registry.npmjs.org/birpc/-/birpc-0.2.19.tgz", - "integrity": "sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/birpc/-/birpc-2.3.0.tgz", + "integrity": "sha512-ijbtkn/F3Pvzb6jHypHRyve2QApOCZDR25D/VnkY2G/lBNcXCTsnsCxgY4k4PkVB7zfwzYbY3O9Lcqe3xufS5g==", "funding": { "url": "https://github.com/sponsors/antfu" } @@ -4714,12 +4714,15 @@ } }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" } }, "node_modules/lines-and-columns": { @@ -5462,18 +5465,6 @@ } } }, - "node_modules/postcss-load-config/node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, "node_modules/postcss-nested": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", @@ -6508,33 +6499,33 @@ } }, "node_modules/tailwindcss": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz", - "integrity": "sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==", + "version": "3.4.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz", + "integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==", "dev": true, "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", - "chokidar": "^3.5.3", + "chokidar": "^3.6.0", "didyoumean": "^1.2.2", "dlv": "^1.1.3", - "fast-glob": "^3.3.0", + "fast-glob": "^3.3.2", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.19.1", - "lilconfig": "^2.1.0", - "micromatch": "^4.0.5", + "jiti": "^1.21.6", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", - "picocolors": "^1.0.0", - "postcss": "^8.4.23", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", - "postcss-load-config": "^4.0.1", - "postcss-nested": "^6.0.1", - "postcss-selector-parser": "^6.0.11", - "resolve": "^1.22.2", - "sucrase": "^3.32.0" + "postcss-load-config": "^4.0.2", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" }, "bin": { "tailwind": "lib/cli.js", @@ -6707,9 +6698,9 @@ } }, "node_modules/tr46": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.0.tgz", - "integrity": "sha512-IUWnUK7ADYR5Sl1fZlO1INDUhVhatWl7BtJWsIhwJ0UAK7ilzzIa8uIqOO/aYVWHZPJkKbEL+362wrzoeRF7bw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", "dev": true, "dependencies": { "punycode": "^2.3.1" @@ -6868,9 +6859,9 @@ "dev": true }, "node_modules/vite": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.0.tgz", - "integrity": "sha512-9aC0n4pr6hIbvi1YOpFjwQ+QOTGssvbJKoeYkuHHGWwlXfdxQlI8L2qNMo9awEEcCPSiS+5mJZk5jH1PAqoDeQ==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.1.tgz", + "integrity": "sha512-kkzzkqtMESYklo96HKKPE5KKLkC1amlsqt+RjFMlX2AvbRB/0wghap19NdBxxwGZ+h/C6DLCrcEphPIItlGrRQ==", "dev": true, "dependencies": { "esbuild": "^0.25.0", @@ -6942,9 +6933,9 @@ } }, "node_modules/vite-hot-client": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/vite-hot-client/-/vite-hot-client-0.2.4.tgz", - "integrity": "sha512-a1nzURqO7DDmnXqabFOliz908FRmIppkBKsJthS8rbe8hBEXwEwe4C3Pp33Z1JoFCYfVL4kTOMLKk0ZZxREIeA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vite-hot-client/-/vite-hot-client-2.0.4.tgz", + "integrity": "sha512-W9LOGAyGMrbGArYJN4LBCdOC5+Zwh7dHvOHC0KmGKkJhsOzaKbpo/jEjpPKVHIW0/jBWj8RZG0NUxfgA8BxgAg==", "dev": true, "funding": { "url": "https://github.com/sponsors/antfu" @@ -7007,16 +6998,16 @@ } }, "node_modules/vite-plugin-vue-devtools": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/vite-plugin-vue-devtools/-/vite-plugin-vue-devtools-7.7.2.tgz", - "integrity": "sha512-5V0UijQWiSBj32blkyPEqIbzc6HO9c1bwnBhx+ay2dzU0FakH+qMdNUT8nF9BvDE+i6I1U8CqCuJiO20vKEdQw==", + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/vite-plugin-vue-devtools/-/vite-plugin-vue-devtools-7.7.5.tgz", + "integrity": "sha512-cSlQYI1E+8d0qubBg70suTBbXMFbTHLn7vLPYUPK9GjNNJ0nw+Yks0ZLOAp7/+PjmqSpN5fK1taor6HeAjKb1g==", "dev": true, "dependencies": { - "@vue/devtools-core": "^7.7.2", - "@vue/devtools-kit": "^7.7.2", - "@vue/devtools-shared": "^7.7.2", - "execa": "^9.5.1", - "sirv": "^3.0.0", + "@vue/devtools-core": "^7.7.5", + "@vue/devtools-kit": "^7.7.5", + "@vue/devtools-shared": "^7.7.5", + "execa": "^9.5.2", + "sirv": "^3.0.1", "vite-plugin-inspect": "0.8.9", "vite-plugin-vue-inspector": "^5.3.1" }, diff --git a/src/components/RendererDom.vue b/src/components/RendererDom.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/components/UseIcon.vue b/src/components/UseIcon.vue new file mode 100644 index 0000000..8360407 --- /dev/null +++ b/src/components/UseIcon.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/src/stores/counter.ts b/src/stores/counter.ts deleted file mode 100644 index b6757ba..0000000 --- a/src/stores/counter.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ref, computed } from 'vue' -import { defineStore } from 'pinia' - -export const useCounterStore = defineStore('counter', () => { - const count = ref(0) - const doubleCount = computed(() => count.value * 2) - function increment() { - count.value++ - } - - return { count, doubleCount, increment } -}) diff --git a/src/stores/index.ts b/src/stores/index.ts new file mode 100644 index 0000000..a8dc752 --- /dev/null +++ b/src/stores/index.ts @@ -0,0 +1,9 @@ +import type { App } from "vue"; +import { createPinia } from "pinia"; +const store = createPinia(); + +export function setupStore(app: App) { + app.use(store); +} + +export { store }; diff --git a/src/stores/modules/formConfig.ts b/src/stores/modules/formConfig.ts new file mode 100644 index 0000000..0f1911e --- /dev/null +++ b/src/stores/modules/formConfig.ts @@ -0,0 +1,17 @@ +import { defineStore } from 'pinia' +import { store } from "@/stores"; +export const configStore = defineStore('formConfig', { + state: () => ({ + formConfig: {} + }), + getters: { + getFormConfig: (state) => state.formConfig, + }, + actions: { + + } +}) + +export function useConfigStore() { + return configStore(store); +} diff --git a/src/stores/modules/widgetList.ts b/src/stores/modules/widgetList.ts new file mode 100644 index 0000000..ac83d22 --- /dev/null +++ b/src/stores/modules/widgetList.ts @@ -0,0 +1,17 @@ +import { defineStore } from 'pinia' +import { store } from "@/stores"; +export const widgetStore = defineStore('widget', { + state: () => ({ + widgetList: [], + }), + getters: { + getWidgetList: (state) => state.widgetList, + }, + actions: { + + } +}) + +export function useWidgetStore() { + return widgetStore(store); +} diff --git a/src/types/widgetsConfigInterface.ts b/src/types/widgetsConfigInterface.ts new file mode 100644 index 0000000..843cfa2 --- /dev/null +++ b/src/types/widgetsConfigInterface.ts @@ -0,0 +1,24 @@ +export interface IContainerOption { + name: string + hidden: boolean + customClass: string +} + +export type ICategory = 'container' | 'formItem' + +export interface IWidget { + // 类别 + category: ICategory + // 类型 + type: string + // 展示名称 + displayName: string + // 图标 + icon: string + // 子类 + rows?: [] + // 属性 + options: IContainerOption +} + + diff --git a/src/utils/componentMap.ts b/src/utils/componentMap.ts new file mode 100644 index 0000000..4f8ec07 --- /dev/null +++ b/src/utils/componentMap.ts @@ -0,0 +1,16 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { + ElTable, + ElTableColumn, + ElInput, + ElForm, + ElFormItem +} from 'element-plus' + +export const componentMap: Record = { + 'el-table': ElTable, + 'el-table-column': ElTableColumn, + 'el-input': ElInput, + 'el-form': ElForm, + 'el-form-item': ElFormItem, +} \ No newline at end of file diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..168aa9f --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,16 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import melonJson from "./melon.json"; +/** + * 初始化和重置文书结构 + * @param widgetJson + */ +export const initJson = (widgetJson: any) => { + widgetJson['widgetList'] = [] + // widgetJson['formConfig'] = {} +} + +export const addItem = (fatherId = "", widgetJson: any) => { + if (fatherId) { } else { + widgetJson['widgetList'] = [melonJson] + } +} \ No newline at end of file diff --git a/src/utils/melon.json b/src/utils/melon.json new file mode 100644 index 0000000..17cd4f6 --- /dev/null +++ b/src/utils/melon.json @@ -0,0 +1,76 @@ +{ + "key": 47004, + "id": "table-61396", + "category": "container", + "type": "el-table", + "displayName": "表格", + "icon": "Monitor", + "rows": [ + { + "cols": [ + { + "key": 47005, + "id": "table-column-12332", + "category": "container", + "type": "el-table-column", + "displayName": "子单元格", + "icon": "Monitor", + "rows": [], + "options": { + "name": "table-column-12332", + "cellWidth": "", + "cellHeight": "", + "colspan": 1, + "rowspan": 1, + "wordBreak": false, + "customClass": "" + } + }, + { + "key": 47015, + "id": "table-column-12344", + "category": "container", + "type": "el-table-column", + "displayName": "子单元格", + "icon": "Monitor", + "widgetList": [ + { + "key": 47016, + "id": "input-12355", + "category": "formItem", + "type": "el-input", + "displayName": "输入框", + "icon": "Folder", + "options": { + "name": "input-12355", + "keyNameEnabled": false, + "keyName": "", + "label": "input", + "labelAlign": "", + "type": "text", + "defaultValue": "", + "hidden": false, + "customClass": "" + } + } + ], + "rows": [], + "options": { + "name": "table-column-12344", + "cellWidth": "", + "cellHeight": "", + "colspan": 1, + "rowspan": 1, + "wordBreak": false, + "customClass": "" + } + } + ] + } + ], + "options": { + "name": "", + "hidden": false, + "customClass": "" + } +} diff --git a/src/utils/widgetsConfig.ts b/src/utils/widgetsConfig.ts new file mode 100644 index 0000000..d322217 --- /dev/null +++ b/src/utils/widgetsConfig.ts @@ -0,0 +1,54 @@ +import type { IWidget } from "@/types/widgetsConfigInterface" + +export const containers: IWidget[] = [ + { + category: 'container', + type: 'el-table', + displayName: '表格', + icon: 'Monitor', + rows: [], + options: { + name: '', + hidden: false, + customClass: '', + } + }, + { + category: 'container', + type: 'el-table-column', + displayName: '子单元格', + icon: 'Monitor', + rows: [], + options: { + name: '', + hidden: false, + customClass: '', + } + } +] + + +export const basicFields: IWidget[] = [ + { + category: 'formItem', + type: 'el-input', + displayName: '输入框', + icon: 'Folder', + options: { + name: '', + hidden: false, + customClass: '', + }, + }, + { + category: 'formItem', + type: 'el-redio', + displayName: ' 单选项', + icon: 'Folder', + options: { + name: '', + hidden: false, + customClass: '', + }, + }, +] diff --git a/src/views/Home/HomeView.vue b/src/views/Home/HomeView.vue index d646902..eef690a 100644 --- a/src/views/Home/HomeView.vue +++ b/src/views/Home/HomeView.vue @@ -1,18 +1,24 @@ - + - + diff --git a/src/views/Home/subCom/LeftSide.vue b/src/views/Home/subCom/LeftSide.vue index 303ecce..8504ae6 100644 --- a/src/views/Home/subCom/LeftSide.vue +++ b/src/views/Home/subCom/LeftSide.vue @@ -1,9 +1,28 @@ @@ -11,46 +30,23 @@ const collapseActive = ref(['RQ', 'JCZD']) - - - - - - 组件一 + + + + + + + + {{ item['displayName'] }} + + - - - 组件一 - - - - 组件一 - - - - - - - - 组件一 - - - - 组件一 - - - - + + + diff --git a/src/views/Home/subCom/MainWrapper.vue b/src/views/Home/subCom/MainWrapper.vue index 3a0bc7b..50cc269 100644 --- a/src/views/Home/subCom/MainWrapper.vue +++ b/src/views/Home/subCom/MainWrapper.vue @@ -1,5 +1,10 @@ - + - + {{ widgetJson }}
组件一
{{ item['displayName'] }}