|
@@ -1,5 +1,10 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
+ <vxe-input v-model="searchV" placeholder="模糊搜索名称" type="search" @search-click="search"></vxe-input>
|
|
|
+ <vxe-input v-model="searchDate" placeholder="日期类型" type="date"></vxe-input>
|
|
|
+ <vxe-input v-model="searchGte" placeholder="日期类型" type="date"></vxe-input>
|
|
|
+ <vxe-input v-model="searchLte" placeholder="日期类型" type="date"></vxe-input>
|
|
|
+ <vxe-button type="text" status="primary" @click="qjSera">区间搜索</vxe-button>
|
|
|
<vxe-toolbar perfect>
|
|
|
<template v-slot:buttons>
|
|
|
<vxe-button icon="el-icon-delete" status="perfect" @click="deleteData">删除</vxe-button>
|
|
@@ -132,6 +137,10 @@ export default {
|
|
|
},
|
|
|
authors: [],
|
|
|
types: [],
|
|
|
+ searchV: "",
|
|
|
+ searchDate: "",
|
|
|
+ searchGte: "",
|
|
|
+ searchLte: "",
|
|
|
};
|
|
|
},
|
|
|
components: {},
|
|
@@ -140,7 +149,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
- this.getBookDate();
|
|
|
+ this.getBookDate({});
|
|
|
getAuthor().then((res) => {
|
|
|
console.log("获取作者信息");
|
|
|
console.log(res.data);
|
|
@@ -154,8 +163,8 @@ export default {
|
|
|
this.types = res.data;
|
|
|
});
|
|
|
},
|
|
|
- getBookDate() {
|
|
|
- getBook(null).then((res) => {
|
|
|
+ getBookDate(par) {
|
|
|
+ getBook(par).then((res) => {
|
|
|
console.log(res.data);
|
|
|
if (res.data.length > 0) {
|
|
|
console.log("getBook");
|
|
@@ -228,6 +237,27 @@ export default {
|
|
|
type: 1,
|
|
|
};
|
|
|
},
|
|
|
+ search() {
|
|
|
+ this.getBookDate({
|
|
|
+ name__contains: this.searchV,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ qjSera() {
|
|
|
+ this.getBookDate({
|
|
|
+ release_time__gte: this.searchGte,
|
|
|
+ release_time__lte: this.searchLte,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ searchDate(vd) {
|
|
|
+ let d = vd.split("-");
|
|
|
+ this.getBookDate({
|
|
|
+ release_time__year: d[0],
|
|
|
+ release_time__month: d[1],
|
|
|
+ release_time__day: d[2],
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|