From bdf4bc828a46a6ca2a1724bf57858866038e31b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com> Date: Sun, 30 Jan 2022 11:58:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=94=AF=E6=8C=81=E5=B7=A6?= =?UTF-8?q?=E5=8F=B3=E7=AE=AD=E5=A4=B4=E7=BF=BB=E9=A1=B5=EF=BC=8Cbutton=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/MagicBoot/mb-button.vue | 7 ++++--- .../src/components/MagicBoot/mb-table.vue | 17 +++++++++++++++++ .../src/views/system/dict/dict-items.vue | 10 ++-------- .../src/views/system/dict/dict-list.vue | 2 +- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/magic-boot-ui/src/components/MagicBoot/mb-button.vue b/magic-boot-ui/src/components/MagicBoot/mb-button.vue index 8da6d9c..999ff5d 100644 --- a/magic-boot-ui/src/components/MagicBoot/mb-button.vue +++ b/magic-boot-ui/src/components/MagicBoot/mb-button.vue @@ -61,6 +61,7 @@ export default { data() { return { el_: this.el || {}, + requestMethod_: this.requestMethod, beforeConfirm_: this.beforeConfirm, successTips_: this.successTips, failTips_: this.failTips @@ -69,7 +70,7 @@ export default { created() { if (this.btnType) { if (this.btnType === 'delete') { - this.requestMethod = 'post' + this.requestMethod_ = 'post' this.el_.type = 'danger' this.el_.text = '删除' this.el_.icon = 'el-icon-delete' @@ -96,7 +97,7 @@ export default { buttonClickRequest() { // var requestOptions = {} // requestOptions.url = this.requestUrl - // requestOptions.method = this.requestMethod + // requestOptions.method = this.requestMethod_ // if (requestOptions.method === 'get') { // requestOptions.params = this.requestData // } else { @@ -108,7 +109,7 @@ export default { }) } return new Promise((resolve, reject) => { - if (this.requestMethod === 'get') { + if (this.requestMethod_ === 'get') { this.$get(this.requestUrl, this.requestData).then(res => { const { data } = res if (data) { diff --git a/magic-boot-ui/src/components/MagicBoot/mb-table.vue b/magic-boot-ui/src/components/MagicBoot/mb-table.vue index f720352..92bb500 100644 --- a/magic-boot-ui/src/components/MagicBoot/mb-table.vue +++ b/magic-boot-ui/src/components/MagicBoot/mb-table.vue @@ -122,6 +122,7 @@ export default { this.newWhere = this.$common.renderWhere(this.where) }, mounted() { + this.keyup() if (this.data) { this.handlerData() } @@ -191,6 +192,22 @@ export default { if (this.data) { this.handlerData() } + }, + keyup(){ + document.onkeyup = (e) => { + if(e.target.nodeName != 'INPUT'){ + if (e && e.keyCode == 37) { + if(this.listCurrent != 1){ + this.listCurrent -= 1 + } + } else if (e && e.keyCode == 39) { + if(this.listCurrent != parseInt((this.total + this.limit - 1) / this.limit)){ + this.listCurrent += 1 + } + } + } + this.handlerPagination() + } } } } diff --git a/magic-boot-ui/src/views/system/dict/dict-items.vue b/magic-boot-ui/src/views/system/dict/dict-items.vue index b1b1265..d53412d 100644 --- a/magic-boot-ui/src/views/system/dict/dict-items.vue +++ b/magic-boot-ui/src/views/system/dict/dict-items.vue @@ -58,7 +58,8 @@ export default { type: 'input', label: '值', value: '' - } + }, + dictId: this.dictId }, cols: [ { @@ -118,19 +119,12 @@ export default { temp: this.getTemp() } }, - watch: { - dictId(newVal) { - this.dictId = newVal - this.reloadTable() - } - }, mounted() { this.selectValue = this.value this.reloadTable() }, methods: { reloadTable() { - this.tableOptions.where.dictId = this.dictId this.$refs.table.reloadList() }, getTemp() { diff --git a/magic-boot-ui/src/views/system/dict/dict-list.vue b/magic-boot-ui/src/views/system/dict/dict-list.vue index 74a3b5d..6c32a50 100644 --- a/magic-boot-ui/src/views/system/dict/dict-list.vue +++ b/magic-boot-ui/src/views/system/dict/dict-list.vue @@ -35,7 +35,7 @@