From 425d89e7f63883e86a167c15192e7ad55a0c7856 Mon Sep 17 00:00:00 2001
From: aaron <462826@qq.com>
Date: Wed, 11 Nov 2020 11:19:48 +0800
Subject: [PATCH] popup to confirm for delete
---
ui/src/components/DefDesign.vue | 127 +++++++++++++++++++-------------
ui/src/main.js | 3 +
2 files changed, 77 insertions(+), 53 deletions(-)
diff --git a/ui/src/components/DefDesign.vue b/ui/src/components/DefDesign.vue
index 9eabbc29..a9698902 100644
--- a/ui/src/components/DefDesign.vue
+++ b/ui/src/components/DefDesign.vue
@@ -8,61 +8,75 @@
:closable=true
:footer="null"
@cancel="cancel"
- >
-
-
-
-
-
+
+
+
+ 确认删除选中字段及其子字段?
+
+
+
@@ -81,6 +95,7 @@ export default {
const styl = 'height: ' + (document.documentElement.clientHeight - 56) + 'px;'
return {
styl: styl,
+ removeVisible: false,
infoVisible: true,
configVisible: false,
@@ -198,8 +213,9 @@ export default {
this.addMode = 'child'
this.addChildField()
}else if (e.key === 'remove') {
- this.removeField()
+ this.removeVisible = true
}
+ console.log('clearMenu 1')
this.clearMenu()
},
addNeighborField () {
@@ -238,6 +254,7 @@ export default {
},
removeField () {
console.log('removeField', this.targetModel)
+ this.removeVisible = false
removeDefField(this.targetModel).then(res => {
console.log('removeDefField', res)
@@ -249,6 +266,10 @@ export default {
this.configVisible = false
})
},
+ cancelRemove (e) {
+ e.preventDefault()
+ this.removeVisible = false
+ },
onDrop (info) {
console.log(info, info.node.eventKey, info.dragNode.eventKey) // {event, node, dragNode, dragNodesKeys}
const dropKey = info.node.eventKey
diff --git a/ui/src/main.js b/ui/src/main.js
index 2ff12279..d596df2d 100644
--- a/ui/src/main.js
+++ b/ui/src/main.js
@@ -49,6 +49,8 @@ import Icon from "ant-design-vue/lib/icon";
import Col from "ant-design-vue/lib/col";
import Row from "ant-design-vue/lib/row";
+import Spin from "ant-design-vue/lib/spin";
+import 'ant-design-vue/lib/spin/style';
import zhCN from './assets/lang/zh-CN'
import router from "./router"
@@ -76,6 +78,7 @@ Vue.use(Row)
Vue.use(Col)
Vue.use(InputNumber)
Vue.use(Switch)
+Vue.use(Spin)
const i18n = new VueI18n({
locale: 'zh-CN',
--
GitLab