Commit 66fa5eae by cwq0219

弹窗组件

1 parent b2c3e73d
<!-- 弹窗 -->
<template>
<div>
<el-dialog
:title="title"
:visible.sync="isVisible"
:before-close="handleClose"
:close-on-click-modal="false"
:width="width"
>
<slot></slot>
<div slot="footer">
<slot name="btn-start"></slot>
<el-button
type="primary"
@click="handleConfirm"
:loading="$store.state.d2admin.loading.value"
>{{btnOkLabel}}</el-button>
<slot name="btn-middle"></slot>
<el-button v-if="!noCancel" @click="handleClose">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'd2-dialog',
data() {
return {
}
},
props: {
title: {
type: String,
default: ''
},
isVisible: {
type: Boolean,
default: false
},
btnOkLabel: {
type: String,
default: '确定'
},
noCancel: {
type: Boolean,
default: false
},
width: {
type: String,
default: '580px'
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style scoped>
</style>
......@@ -213,22 +213,6 @@ export default {
}
},
watch: {
// searchForm: {
// handler(val) {
// const attr = Object.keys(val).find(item => val[item] !== this.oldValue[item])
// if (!val[attr] && this.oldValue[attr]) {
// this.getListApi ? this.refreshEmit() : this.$emit('refreshTable', this.page)
// }
// this.oldValue = _.cloneDeep(val)
// },
// deep: true
// },
// 调用其他接口,导致表格刷新-标识
// '$store.state.d2admin.refreshtable.value'(val) {
// (val === 'fresh') && this.refreshEmit()
// }
},
mounted() {
const btn = document.getElementById(this.tableParams.btnId)
btn && btn.addEventListener('click', this.refreshEmit)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!