diff --git a/.eslintrc.js b/.eslintrc.js index e621507..18db68b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,6 +16,7 @@ module.exports = { ElMessage: "readonly", ElMessageBox: "readonly", ElLoading: "readonly", + ElNotification: "readonly" }, extends: ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/typescript/recommended", "@vue/prettier/@typescript-eslint"], parser: "vue-eslint-parser", diff --git a/packages/editor/auto-imports.d.ts b/packages/editor/auto-imports.d.ts index 1d89ee8..c13b693 100644 --- a/packages/editor/auto-imports.d.ts +++ b/packages/editor/auto-imports.d.ts @@ -5,5 +5,6 @@ // Generated by unplugin-auto-import export {} declare global { - + const ElMessage: typeof import('element-plus/es')['ElMessage'] + const ElNotification: typeof import('element-plus/es')['ElNotification'] } diff --git a/packages/editor/components.d.ts b/packages/editor/components.d.ts index 8258e3d..b7adea7 100644 --- a/packages/editor/components.d.ts +++ b/packages/editor/components.d.ts @@ -40,4 +40,7 @@ declare module 'vue' { Shape: typeof import('./src/components/Shape.vue')['default'] Workspace: typeof import('./src/components/Workspace.vue')['default'] } + export interface ComponentCustomProperties { + vLoading: typeof import('element-plus/es')['ElLoadingDirective'] + } } diff --git a/packages/editor/package.json b/packages/editor/package.json index 0bc0466..2c8aed0 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "starfish-editor", - "version": "1.1.11", + "version": "1.1.12", "main": "dist/starfish-editor.umd.js", "style": "dist/style.css", "module": "dist/starfish-editor.es.js", diff --git a/packages/editor/src/common/ConditionSelect/ConditionTanc.vue b/packages/editor/src/common/ConditionSelect/ConditionTanc.vue index ba728d9..45f3283 100644 --- a/packages/editor/src/common/ConditionSelect/ConditionTanc.vue +++ b/packages/editor/src/common/ConditionSelect/ConditionTanc.vue @@ -158,16 +158,6 @@ export default { value: "常量", label: "常量", }, - // { - // rule: [], - // value: "字段", - // label: "字段", - // }, - // { - // rule: [], - // value: "请求参数", - // label: "请求参数", - // }, ], }; }, diff --git a/packages/editor/src/components/PropsPanel.vue b/packages/editor/src/components/PropsPanel.vue index 153367b..2715623 100644 --- a/packages/editor/src/components/PropsPanel.vue +++ b/packages/editor/src/components/PropsPanel.vue @@ -107,7 +107,7 @@ export default defineComponent({ ControllEditSize, jsonEnter: defineAsyncComponent({ loader: () => import("./jsonEditor.vue"), - loadingComponent: Loading + loadingComponent: Loading, }), globalFormComponent: defineAsyncComponent({ loader: () => import("./globalFormList.vue"), @@ -168,8 +168,10 @@ export default defineComponent({ return new Promise((resolve) => { ruleForm.value.validate((valid: boolean) => { if (!valid) { - window.VApp.$notify.error({ - title: content, + ElNotification({ + title: "Error", + message: content, + type: "error", }); resolve(false); } else { @@ -259,8 +261,10 @@ export default defineComponent({ formStore?.set("previewShow", ispreview); formStore?.set("preview", false); } else if (ispreview) { - window.VApp.$notify.success({ - title: type ? "已自动保存" : "保存成功", + ElNotification({ + title: "Success", + message: type ? "已自动保存" : "保存成功", + type: "success", }); } } diff --git a/playground/auto-imports.d.ts b/playground/auto-imports.d.ts index 78813d8..c13b693 100644 --- a/playground/auto-imports.d.ts +++ b/playground/auto-imports.d.ts @@ -6,4 +6,5 @@ export {} declare global { const ElMessage: typeof import('element-plus/es')['ElMessage'] + const ElNotification: typeof import('element-plus/es')['ElNotification'] } diff --git a/playground/components.d.ts b/playground/components.d.ts index 31978d4..0d60187 100644 --- a/playground/components.d.ts +++ b/playground/components.d.ts @@ -7,54 +7,11 @@ export {} declare module 'vue' { export interface GlobalComponents { - ElAlert: typeof import('element-plus/es')['ElAlert'] - ElAside: typeof import('element-plus/es')['ElAside'] ElButton: typeof import('element-plus/es')['ElButton'] - ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] - ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] - ElCol: typeof import('element-plus/es')['ElCol'] - ElCollapse: typeof import('element-plus/es')['ElCollapse'] - ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] - ElColorPicker: typeof import('element-plus/es')['ElColorPicker'] - ElContainer: typeof import('element-plus/es')['ElContainer'] - ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] - ElDivider: typeof import('element-plus/es')['ElDivider'] - ElDrawer: typeof import('element-plus/es')['ElDrawer'] - ElDropdown: typeof import('element-plus/es')['ElDropdown'] - ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] - ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] - ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElFooter: typeof import('element-plus/es')['ElFooter'] - ElForm: typeof import('element-plus/es')['ElForm'] - ElFormItem: typeof import('element-plus/es')['ElFormItem'] - ElHeader: typeof import('element-plus/es')['ElHeader'] - ElIcon: typeof import('element-plus/es')['ElIcon'] - ElInput: typeof import('element-plus/es')['ElInput'] - ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] - ElMain: typeof import('element-plus/es')['ElMain'] - ElOption: typeof import('element-plus/es')['ElOption'] - ElRadio: typeof import('element-plus/es')['ElRadio'] - ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] - ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] - ElRow: typeof import('element-plus/es')['ElRow'] - ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] - ElSelect: typeof import('element-plus/es')['ElSelect'] - ElSlider: typeof import('element-plus/es')['ElSlider'] - ElSwitch: typeof import('element-plus/es')['ElSwitch'] - ElTable: typeof import('element-plus/es')['ElTable'] - ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElTabPane: typeof import('element-plus/es')['ElTabPane'] - ElTabs: typeof import('element-plus/es')['ElTabs'] - ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect'] - ElTooltip: typeof import('element-plus/es')['ElTooltip'] - ElTree: typeof import('element-plus/es')['ElTree'] - ElUpload: typeof import('element-plus/es')['ElUpload'] Form: typeof import('./src/components/Form.vue')['default'] Home: typeof import('./src/components/Home.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } - export interface ComponentCustomProperties { - vLoading: typeof import('element-plus/es')['ElLoadingDirective'] - } } diff --git a/playground/package.json b/playground/package.json index 34c9172..0d7effc 100644 --- a/playground/package.json +++ b/playground/package.json @@ -11,7 +11,7 @@ "dependencies": { "@element-plus/icons-vue": "^2.0.8", "element-plus": "^2.2.12", - "starfish-editor": "^1.1.11", + "starfish-editor": "^1.1.12", "starfish-form": "^1.2.7", "vite": "^4.5.2", "vue": "^3.2.37",