diff --git a/src/api/tag.js b/src/api/tag.js
index 1e47c7c..0a560bd 100644
--- a/src/api/tag.js
+++ b/src/api/tag.js
@@ -13,11 +13,10 @@ export default {
*/
getList(data, pageNum, pageSize) {
return request({
- // url: `/luoo-tag/tag/list?pageNum=${pageNum}&pageSize=${pageSize}`,
url: `/luoo-tag/tag/list`,
method: "get",
- params:{
- ... data,
+ params: {
+ ...data,
pageNum,
pageSize
}
@@ -81,5 +80,25 @@ export default {
url: `/luoo-tag/tag/${id}`,
method: "delete"
});
+ },
+ /**
+ * 创建人
+ * @returns
+ */
+ createrList() {
+ return request({
+ url: "/luoo-tag/tag/creator/list",
+ method: "get"
+ });
+ },
+ /**
+ * 创建人
+ * @returns
+ */
+ parentNameList() {
+ return request({
+ url: "/luoo-tag/tag/name",
+ method: "get"
+ });
}
};
diff --git a/src/views/tag/index.vue b/src/views/tag/index.vue
index 2a2cca4..35b94ea 100644
--- a/src/views/tag/index.vue
+++ b/src/views/tag/index.vue
@@ -35,9 +35,7 @@
size="medium"
v-model="queryForm.data.parentId"
>
-
-
-
+
@@ -46,8 +44,12 @@
size="medium"
v-model="queryForm.data.creatorId"
>
-
-
+
@@ -55,7 +57,9 @@
placeholder="选择时间范围"
v-model="queryForm.data.timeRange"
type="daterange"
- :range-separator="queryForm.data.timeRange.length === 0 ? null : '~'"
+ :range-separator="
+ queryForm.data.timeRange.length === 0 ? null : '~'
+ "
:editable="false"
:clearable="false"
value-format="yyyy-MM-dd"
@@ -120,7 +124,7 @@
-
-
-
+
@@ -275,7 +277,8 @@ export default {
// 查询表单
queryForm: {
remoteData: {
- publisher: []
+ publisher: [],
+ parentTag: []
},
lastQuery: {},
data: {
@@ -323,6 +326,8 @@ export default {
},
filters: {},
created() {
+ this.fetchCreaterList();
+ this.fetchParentNameList();
this.fetchData(this.queryForm.data);
},
methods: {
@@ -340,29 +345,47 @@ export default {
let queryParam = {
...param
};
- // if (this.queryForm.data.timeRange) {
- // if (this.queryForm.data.timeRange[0]) {
- // queryParam.createTimeStart =
- // this.queryForm.data.timeRange[0] + " 00:00:00";
- // }
+ if (this.queryForm.data.timeRange) {
+ if (this.queryForm.data.timeRange[0]) {
+ queryParam.createTimeStart =
+ this.queryForm.data.timeRange[0] + " 00:00:00";
+ }
- // if (this.queryForm.data.timeRange[1]) {
- // queryParam.createTimeEnd =
- // this.queryForm.data.timeRange[1] + " 23:59:59";
- // }
- // }
+ if (this.queryForm.data.timeRange[1]) {
+ queryParam.createTimeEnd =
+ this.queryForm.data.timeRange[1] + " 23:59:59";
+ }
+ }
this.table.loading = true;
- this.table.page.total = 0;
this.table.data = [];
tagApi
.getList(queryParam, this.table.page.current, this.table.page.size)
.then(res => {
- this.table.data = res.data.content;
- this.table.page.total = res.data.totalElements;
- this.table.page.current = res.data.number + 1;
+ this.table.data = res.data.rows;
+ this.table.page.total = res.data.total;
this.table.loading = false;
});
},
+ /**
+ * 创建人下拉框
+ */
+ fetchCreaterList() {
+ tagApi.createrList().then(res => {
+ if (res.code === 200) {
+ this.queryForm.remoteData.publisher = res.data;
+ }
+ });
+ },
+ /**
+ * 父级名称下拉框
+ */
+ fetchParentNameList() {
+ tagApi.parentNameList().then(res => {
+ if (res.code === 200) {
+ this.queryForm.remoteData.parentTag = res.data;
+ }
+ });
+ },
// ************************* 按扭事件 *************************
/**
* 查询按扭点击事件