🐞 fix(标签): 修改联调问题

dev
zjb 10 months ago
parent 32577f3cd7
commit afc89ccad7

@ -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"
});
}
};

@ -35,9 +35,7 @@
size="medium"
v-model="queryForm.data.parentId"
>
<el-option label="民谣" value="1744043047018172416"></el-option>
<el-option label="摇滚" value="1744044157997027328"></el-option>
<el-option label="流行" value="1746150704759836672"></el-option>
<el-option v-for="item in queryForm.remoteData.parentTag" :label="item.nameCh" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
@ -46,8 +44,12 @@
size="medium"
v-model="queryForm.data.creatorId"
>
<el-option label="发布人1" value="1"></el-option>
<el-option label="发布人2" value="2"></el-option>
<el-option
v-for="item in queryForm.remoteData.publisher"
:label="item.name"
:value="item.id"
:key="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
@ -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 @@
<el-table-column label="歌曲数" prop="songRefCount"></el-table-column>
<el-table-column
label="关联期刊数"
prop="articleRefCount"
prop="columnRefCount"
></el-table-column>
<el-table-column
label="子标签数"
@ -235,9 +239,7 @@
size="medium"
v-model="modifyDialog.form.data.parentId"
>
<el-option label="民谣" value="1744043047018172416"></el-option>
<el-option label="摇滚" value="1744044157997027328"></el-option>
<el-option label="流行" value="1746150704759836672"></el-option>
<el-option v-for="item in queryForm.remoteData.parentTag" :label="item.nameCh" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="中文名称" prop="nameCh">
@ -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;
}
});
},
// ************************* *************************
/**
* 查询按扭点击事件

Loading…
Cancel
Save