diff --git a/package.json b/package.json index 5f4e869..4cb883c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "variant-form3", - "version": "3.0.1", + "version": "3.0.2", "private": false, "scripts": { "serve": "vite", diff --git a/src/components/form-designer/designer.js b/src/components/form-designer/designer.js index 06590b7..9725b05 100644 --- a/src/components/form-designer/designer.js +++ b/src/components/form-designer/designer.js @@ -148,6 +148,8 @@ export function createDesigner(vueInstance) { checkWidgetMove(evt) { /* Only field widget can be dragged into sub-form */ if (!!evt.draggedContext && !!evt.draggedContext.element) { let wgCategory = evt.draggedContext.element.category + let wgType = evt.draggedContext.element.type + '' + //console.log('wgType======', wgType) if (!!evt.to) { if ((evt.to.className === 'sub-form-table') && (wgCategory === 'container')) { //this.$message.info(this.vueInstance.i18nt('designer.hint.onlyFieldWidgetAcceptable')) @@ -159,6 +161,22 @@ export function createDesigner(vueInstance) { return true }, + checkFieldMove(evt) { + if (!!evt.draggedContext && !!evt.draggedContext.element) { + let wgCategory = evt.draggedContext.element.category + let wgType = evt.draggedContext.element.type + '' + //console.log('wgType======', wgType) + if (!!evt.to) { + if ((evt.to.className === 'sub-form-table') && (wgType === 'slot')) { + //this.$message.info(this.vueInstance.i18nt('designer.hint.onlyFieldWidgetAcceptable')) + return false + } + } + } + + return true + }, + /** * 追加表格新行 * @param widget @@ -696,6 +714,7 @@ export function createDesigner(vueInstance) { let newWidget = deepClone(origin) let tempId = generateId() newWidget.id = newWidget.type.replace(/-/g, '') + tempId + console.log('test id===', newWidget.id) newWidget.options.name = newWidget.id newWidget.options.label = newWidget.type.toLowerCase() diff --git a/src/components/form-designer/setting-panel/option-items-setting.vue b/src/components/form-designer/setting-panel/option-items-setting.vue index 03703b9..b9c2557 100644 --- a/src/components/form-designer/setting-panel/option-items-setting.vue +++ b/src/components/form-designer/setting-panel/option-items-setting.vue @@ -61,7 +61,7 @@ @@ -75,7 +75,7 @@ diff --git a/src/components/form-designer/toolbar-panel/index.vue b/src/components/form-designer/toolbar-panel/index.vue index 626b457..f3a0e8f 100644 --- a/src/components/form-designer/toolbar-panel/index.vue +++ b/src/components/form-designer/toolbar-panel/index.vue @@ -13,7 +13,7 @@ {{i18nt('designer.toolbar.mobileLayout')}} - + @@ -60,7 +60,7 @@ {{i18nt('designer.hint.resetForm')}} {{i18nt('designer.hint.disableForm')}} {{i18nt('designer.hint.enableForm')}} - {{i18nt('designer.hint.closePreview')}} + {{i18nt('designer.hint.closePreview')}} @@ -93,7 +93,7 @@ {{i18nt('designer.hint.copyJson')}} {{i18nt('designer.hint.saveFormJson')}} - + {{i18nt('designer.hint.closePreview')}} @@ -120,7 +120,7 @@ {{i18nt('designer.hint.copyHtmlCode')}} {{i18nt('designer.hint.saveVueCode')}} {{i18nt('designer.hint.saveHtmlCode')}} - + {{i18nt('designer.hint.closePreview')}} @@ -140,7 +140,7 @@ {{i18nt('designer.hint.copyFormData')}} {{i18nt('designer.hint.saveFormData')}} - + {{i18nt('designer.hint.closePreview')}} @@ -167,7 +167,7 @@ {{i18nt('designer.hint.copyVue3SFC')}} {{i18nt('designer.hint.saveVue2SFC')}} {{i18nt('designer.hint.saveVue3SFC')}} - + {{i18nt('designer.hint.closePreview')}} diff --git a/src/components/form-designer/widget-panel/index.vue b/src/components/form-designer/widget-panel/index.vue index cc44a8c..ae079ef 100644 --- a/src/components/form-designer/widget-panel/index.vue +++ b/src/components/form-designer/widget-panel/index.vue @@ -23,6 +23,7 @@