Browse Source

任务事件UI

master
小久哥 3 years ago
parent
commit
a2db13b00f
  1. 9
      src/api/farm/event.js
  2. 30
      src/views/farm/event/index.vue

9
src/api/farm/event.js

@ -43,6 +43,15 @@ export function getEventPage(query) {
})
}
// 搜索条件获得农场任务事件分页
export function getEventSearchPage(query) {
return request({
url: '/farm/event/pageSearch',
method: 'get',
params: query
})
}
// 导出农场任务事件 Excel
export function exportEventExcel(query) {
return request({

30
src/views/farm/event/index.vue

@ -112,7 +112,7 @@
</template>
<script>
import { createEvent, updateEvent, deleteEvent, getEvent, getEventPage, exportEventExcel } from "@/api/farm/event";
import { createEvent, updateEvent, deleteEvent, getEvent, getEventPage, getEventSearchPage, exportEventExcel } from "@/api/farm/event";
import ImageUpload from '@/components/ImageUpload';
import Editor from '@/components/Editor';
import { getProjectPage } from "@/api/farm/project";
@ -221,6 +221,32 @@ export default {
this.loading = false;
});
},
/** 搜索条件查询列表 */
getSearchList() {
this.loading = true;
//
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
//
getEventSearchPage(params).then(response => {
response.data.list.forEach(eve => {
this.projectList.forEach(project =>{
if(project.id == eve.projectId){
eve.projectId = project.name;
}
});
this.taskList.forEach(task =>{
if (task.id == eve.taskId) {
eve.taskId = task.name;
}
})
});
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
@ -241,7 +267,7 @@ export default {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
this.getSearchList();
},
/** 重置按钮操作 */
resetQuery() {

Loading…
Cancel
Save