Browse Source

后台搜索UI

master
小久哥 3 years ago
parent
commit
6b43fad1d5
  1. 32
      src/views/farm/discuss/index.vue
  2. 29
      src/views/farm/project/index.vue
  3. 68
      src/views/farm/task/index.vue

32
src/views/farm/discuss/index.vue

@ -4,11 +4,19 @@
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="项目名" prop="projectId">
<el-input v-model="queryParams.projectId" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="任务名" prop="taskId">
<el-input v-model="queryParams.taskId" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
<el-select v-model="queryParams.projectId" filterable placeholder="请单选">
<el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="任务内容" prop="projectId">
<el-select v-model="queryParams.taskId" filterable placeholder="请单选">
<el-option v-for="item in taskCateList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="讨论发表时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
@ -36,7 +44,7 @@
<el-table v-loading="loading" stripe :data="list">
<el-table-column label="讨论ID" align="center" prop="id" />
<el-table-column label="项目名" align="center" prop="projectId" />
<el-table-column label="任务" align="center" prop="taskId" />
<el-table-column label="任务内容" align="center" prop="taskId" />
<el-table-column label="讨论内容" align="center" prop="content" />
<el-table-column label="事件图片" align="center" prop="images">
<template slot-scope="scope">
@ -108,7 +116,7 @@ import ImageUpload from '@/components/ImageUpload';
import Editor from '@/components/Editor';
import { getProjectPage } from "@/api/farm/project";
import { getTaskPage } from "@/api/farm/task";
import { getTaskCatePage } from "@/api/farm/taskCate";
export default {
name: "Discuss",
@ -151,13 +159,23 @@ export default {
},
projectList:[],
taskList:[],
taskCateList:[]
};
},
created() {
this.getProject();
this.getTaskCateList();
},
methods: {
getTaskCateList() {
getTaskCatePage({
pageNo: 1,
pageSize: 400
}).then(res => {
this.taskCateList = res.data.list.filter(t => t.parentId != 0);
})
},
/*获取项目列表*/
getProject(){
getProjectPage({
@ -197,7 +215,7 @@ export default {
});
this.taskList.forEach(task =>{
if (task.id == discuss.taskId) {
discuss.taskId = task.name;
discuss.taskId = task.taskMsg;
}
})
});

29
src/views/farm/project/index.vue

@ -13,8 +13,19 @@
<el-form-item label="项目名" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="区域名" prop="areas">
<el-input v-model="queryParams.areas" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
<el-form-item label="区域" prop="areaId">
<el-select v-model="queryParams.areaId" filterable placeholder="请单选">
<el-option v-for="item in areasList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="成员名" prop="executorName">
<el-select v-model="queryParams.executorName" filterable placeholder="请单选">
<el-option v-for="item in membersList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="优先级" prop="weight">
<el-input v-model="queryParams.weight" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
@ -80,7 +91,7 @@
<el-table-column label="图片" align="center" prop="images">
<template slot-scope="scope">
<el-image
v-if="scope.row.images[0] != null"
v-if="scope.row.images != null && scope.row.images[0] != null"
:src="scope.row.images[0]" :preview-src-list="scope.row.images">
</el-image>
</template>
@ -302,17 +313,7 @@ export default {
this.addBeginAndEndTime(params, this.dateRangePlanEndTime, 'planEndTime');
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
//
getProjectSearchPage(params).then(response =>{
response.data.list.forEach(element => {
element.areas = JSON.parse(element.areas);
element.areas.forEach(inn => {
this.areasList.forEach((area) =>{
if(inn = area.id){
element.name = area.name;
}
})
});
});
getProjectPage(params).then(response =>{
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;

68
src/views/farm/task/index.vue

@ -8,11 +8,54 @@
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="项目名" prop="projectId">
<el-select v-model="queryParams.projectId" filterable placeholder="请单选">
<el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="负责人" prop="mainPerson">
<el-select v-model="queryParams.mainPerson" filterable placeholder="请单选">
<el-option v-for="item in cpUserList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="执行人" prop="executorName">
<el-select v-model="queryParams.executorName" filterable placeholder="请单选">
<el-option v-for="item in cpUserList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="任务名" prop="taskCateId">
<el-input v-model="queryParams.taskCateId" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
<el-select v-model="queryParams.taskCateId" filterable placeholder="请单选">
<el-option v-for="item in cateOneList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="资源名" prop="resources">
<el-input v-model="queryParams.resources" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
<el-form-item label="任务内容" prop="taskCateName">
<el-select v-model="queryParams.taskCateName" filterable placeholder="请单选">
<el-option v-for="item in cateTwoList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="区域" prop="areaId">
<el-select v-model="queryParams.areaId" filterable placeholder="请单选">
<el-option v-for="item in areasList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="资源名" prop="areas">
<el-select v-model="queryParams.resourceId" filterable placeholder="请单选">
<el-option v-for="item in resourceList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="开始时间">
<el-date-picker v-model="dateRangePlanStartTime" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
@ -274,7 +317,10 @@ export default {
cropId: null,
cropNum: null,
workingHours: null,
draft: false
draft: false,
areaId:null,
executorName:null
},
//
form: {
@ -320,7 +366,12 @@ export default {
};
},
created() {
this.getList()
this.getList(),
this.getTaskCateList();
this.getAreasList();
this.getProjectList();
this.getResource();
this.getCpUserList();
},
methods: {
startMethod(){
@ -393,6 +444,8 @@ export default {
cateFirstList.push({ value: one.id, label: one.name, children: cateSecondList })
});
this.taskCateList = cateFirstList;
console.log("1111111", this.taskCateList);
})
},
getCpUserList() {
@ -463,7 +516,7 @@ export default {
this.addBeginAndEndTime(params, this.dateRangePlanEndTime, 'planEndTime');
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
//
getTaskSearchPage(params).then(response => {
getAdminTaskPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
@ -492,6 +545,9 @@ export default {
mainPerson: undefined,
executorPerson: undefined,
workingHours: undefined,
projectId:undefined,
areaId:undefined,
executorName:undefined
};
this.resetForm("form");
},

Loading…
Cancel
Save