From da5a1293b3f40ab176629a7fb2bb5901bf9ae4af Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 26 七月 2021 13:12:03 +0800
Subject: [PATCH] update 更新自定义vo转化接口
---
ruoyi-ui/src/views/demo/demo/index.vue | 45 ++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/ruoyi-ui/src/views/demo/demo/index.vue b/ruoyi-ui/src/views/demo/demo/index.vue
index b831ad9..c2ef2e0 100644
--- a/ruoyi-ui/src/views/demo/demo/index.vue
+++ b/ruoyi-ui/src/views/demo/demo/index.vue
@@ -33,6 +33,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handlePage">鎼滅储(鑷畾涔夊垎椤垫帴鍙�)</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
@@ -150,9 +151,17 @@
<el-form-item label="鍊�" prop="value">
<el-input v-model="form.value" placeholder="璇疯緭鍏ュ��" />
</el-form-item>
+ <el-form-item label="鍒涘缓鏃堕棿" prop="createTime">
+ <el-date-picker clearable size="small"
+ v-model="form.createTime"
+ type="datetime"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ placeholder="閫夋嫨鍒涘缓鏃堕棿">
+ </el-date-picker>
+ </el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+ <el-button :loading="buttonLoading" type="primary" @click="submitForm">纭� 瀹�</el-button>
<el-button @click="cancel">鍙� 娑�</el-button>
</div>
</el-dialog>
@@ -160,7 +169,7 @@
</template>
<script>
-import { listDemo, getDemo, delDemo, addDemo, updateDemo, exportDemo } from "@/api/demo/demo";
+import { listDemo, pageDemo, getDemo, delDemo, addDemo, updateDemo, exportDemo } from "@/api/demo/demo";
export default {
name: "Demo",
@@ -168,6 +177,8 @@
},
data() {
return {
+ //鎸夐挳loading
+ buttonLoading: false,
// 閬僵灞�
loading: true,
// 瀵煎嚭閬僵灞�
@@ -229,6 +240,20 @@
this.loading = false;
});
},
+ /** 鑷畾涔夊垎椤垫煡璇� */
+ getPage() {
+ this.loading = true;
+ this.queryParams.params = {};
+ if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
+ this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
+ this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
+ }
+ pageDemo(this.queryParams).then(response => {
+ this.demoList = response.rows;
+ this.total = response.total;
+ this.loading = false;
+ });
+ },
// 鍙栨秷鎸夐挳
cancel() {
this.open = false;
@@ -257,6 +282,11 @@
this.queryParams.pageNum = 1;
this.getList();
},
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ handlePage() {
+ this.queryParams.pageNum = 1;
+ this.getPage();
+ },
/** 閲嶇疆鎸夐挳鎿嶄綔 */
resetQuery() {
this.daterangeCreateTime = [];
@@ -277,9 +307,11 @@
},
/** 淇敼鎸夐挳鎿嶄綔 */
handleUpdate(row) {
+ this.loading = true;
this.reset();
const id = row.id || this.ids
getDemo(id).then(response => {
+ this.loading = false;
this.form = response.data;
this.open = true;
this.title = "淇敼娴嬭瘯鍗曡〃";
@@ -289,17 +321,22 @@
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
+ this.buttonLoading = true;
if (this.form.id != null) {
updateDemo(this.form).then(response => {
this.msgSuccess("淇敼鎴愬姛");
this.open = false;
this.getList();
+ }).finally(() => {
+ this.buttonLoading = false;
});
} else {
addDemo(this.form).then(response => {
this.msgSuccess("鏂板鎴愬姛");
this.open = false;
this.getList();
+ }).finally(() => {
+ this.buttonLoading = false;
});
}
}
@@ -312,9 +349,11 @@
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning"
- }).then(function() {
+ }).then(() => {
+ this.loading = true;
return delDemo(ids);
}).then(() => {
+ this.loading = false;
this.getList();
this.msgSuccess("鍒犻櫎鎴愬姛");
})
--
Gitblit v1.9.3