Skip to content

Commit

Permalink
fix(sidepanel): admin table sort by location and address
Browse files Browse the repository at this point in the history
  • Loading branch information
lastsunday committed Jun 3, 2024
1 parent 584e7f3 commit 2668c2b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### ⭐ Added

1. (SidePanel)新增统计图表:根据指定搜索条件统计薪酬区间职位数。
2. (SidePanel)新增管理页面搜索表格查询:地区,地址。

### ✏️ Changed

Expand Down
29 changes: 15 additions & 14 deletions src/data/bo/searchJobBO.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { PageBO } from "./pageBO";

export class SearchJobBO extends PageBO{

jobName;
jobCompanyName;
startDatetime;
endDatetime;
firstPublishStartDatetime;
firstPublishEndDatetime;
orderByColumn;
/**
* ASC,DESC
*/
orderBy;
}
export class SearchJobBO extends PageBO {
jobName;
jobCompanyName;
startDatetime;
endDatetime;
firstPublishStartDatetime;
firstPublishEndDatetime;
jobLocationName;
jobAddress;
orderByColumn;
/**
* ASC,DESC
*/
orderBy;
}
7 changes: 7 additions & 0 deletions src/offscreen/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,13 @@ function genJobSearchWhereConditionSql(param) {
whereCondition +=
" AND job_company_name LIKE '%" + param.jobCompanyName + "%' ";
}
if (param.jobLocationName) {
whereCondition +=
" AND job_location_name LIKE '%" + param.jobLocationName + "%' ";
}
if (param.jobAddress) {
whereCondition += " AND job_address LIKE '%" + param.jobAddress + "%' ";
}
if (param.startDatetime) {
whereCondition +=
" AND create_datetime >= '" +
Expand Down
39 changes: 33 additions & 6 deletions src/sidepanel/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@
clearable
@change="onClickSearch"
/>
<el-input
style="width: 240px"
placeholder="地区"
v-model="jobSearchLocationName"
clearable
@change="onClickSearch"
/>
<el-input
style="width: 240px"
placeholder="地址"
v-model="jobSearchAddress"
clearable
@change="onClickSearch"
/>
<el-date-picker
type="daterange"
range-separator=""
Expand Down Expand Up @@ -177,6 +191,13 @@
</el-text>
</template>
</el-table-column>
<el-table-column label="地区" width="120">
<template #default="scope">
<el-text line-clamp="1">
{{ scope.row.jobLocationName }}
</el-text>
</template>
</el-table-column>
<el-table-column
label="最低薪资"
prop="jobSalaryMin"
Expand Down Expand Up @@ -306,6 +327,8 @@ const datetimeFormat = computed(() => {
});
const jobSearchName = ref(null);
const jobSearchCompanyName = ref(null);
const jobSearchLocationName = ref(null);
const jobSearchAddress = ref(null);
const jobSearchDatetime = ref([]);
const jobSearchFirstPublishDatetime = ref([]);
const jobSearchOrderByColumn = ref("create_datetime");
Expand Down Expand Up @@ -380,20 +403,20 @@ const showDialogAvgSalary = async () => {
});
};
const sortChange = function(column){
if(column.order !== null && column.prop){
const sortChange = function (column) {
if (column.order !== null && column.prop) {
jobSearchOrderByColumn.value = toLine(column.prop);
if(column.order === 'descending'){
if (column.order === "descending") {
jobSearchOrderBy.value = "DESC";
}else if(column.order === 'ascending'){
} else if (column.order === "ascending") {
jobSearchOrderBy.value = "ASC";
}else{
} else {
jobSearchOrderByColumn.value = "create_datetime";
jobSearchOrderBy.value = "DESC";
}
}
search();
}
};
const searchResultExport = async () => {
let list = tableData.value;
Expand Down Expand Up @@ -438,6 +461,8 @@ const onClickSearch = async () => {
const reset = async () => {
jobSearchName.value = null;
jobSearchCompanyName.value = null;
jobSearchLocationName.value = null;
jobSearchAddress.value = null;
jobSearchDatetime.value = [];
jobSearchFirstPublishDatetime.value = [];
currentPage.value = 1;
Expand All @@ -455,6 +480,8 @@ function getSearchParam() {
searchParam.pageNum = currentPage.value;
searchParam.pageSize = pageSize.value;
searchParam.jobName = jobSearchName.value;
searchParam.jobLocationName = jobSearchLocationName.value;
searchParam.jobAddress = jobSearchAddress.value;
searchParam.jobCompanyName = jobSearchCompanyName.value;
if (jobSearchDatetime.value && jobSearchDatetime.value.length > 0) {
searchParam.startDatetime = dayjs(jobSearchDatetime.value[0]);
Expand Down

0 comments on commit 2668c2b

Please sign in to comment.