|
@@ -8,8 +8,9 @@
|
|
|
>
|
|
|
<el-form-item label="任务时间">
|
|
|
<el-date-picker
|
|
|
- v-model="queryparameters.times"
|
|
|
+ v-model="qdate"
|
|
|
type="daterange"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
range-separator="到"
|
|
|
start-placeholder="开始时间"
|
|
|
end-placeholder="结束时间"
|
|
@@ -30,7 +31,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="区属">
|
|
|
<el-select
|
|
|
- v-model="queryparameters.area"
|
|
|
+ v-model="queryparameters.taskArea"
|
|
|
class="m-2"
|
|
|
placeholder="请选择"
|
|
|
>
|
|
@@ -43,7 +44,7 @@
|
|
|
</el-form-item>
|
|
|
<div style="float: right">
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary">查询</el-button>
|
|
|
+ <el-button type="primary" @click="getList">查询</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="success" @click="showadd = true">新增</el-button>
|
|
@@ -51,10 +52,11 @@
|
|
|
</div>
|
|
|
</el-form>
|
|
|
|
|
|
+<div>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
class="eltable"
|
|
|
- height="300"
|
|
|
+
|
|
|
style="width: 100%"
|
|
|
@row-click="tblrowclick"
|
|
|
>
|
|
@@ -85,17 +87,26 @@
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
</el-table>
|
|
|
- <div style="text-align: right; margin-top: 10px; width: 100%">
|
|
|
- <el-pagination
|
|
|
+ <div style="position:relative;padding-right:20px;margin-top:-20px">
|
|
|
+
|
|
|
+ <Pagination :total="pagedata.total??0" v-show="pagedata.total > 0"
|
|
|
+ v-model:page="queryparameters.pageNum"
|
|
|
+ v-model:limit="queryparameters.pageSize"
|
|
|
+ @pagination="getList"></Pagination>
|
|
|
+ <!-- <el-pagination
|
|
|
style="float: right"
|
|
|
small
|
|
|
background
|
|
|
- layout="prev, pager, next"
|
|
|
- :total="50"
|
|
|
+ :page-sizes="[10, 20, 30, 50]"
|
|
|
+
|
|
|
+ :page-size="10"
|
|
|
+ layout=" sizes,prev, pager, next"
|
|
|
+ :total="pagedata.total??0"
|
|
|
class="mt-4"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
|
|
|
<el-dialog v-model="showadd" title="新增任务" width="70%" draggable>
|
|
|
<div>
|
|
@@ -116,9 +127,14 @@ import { defineComponent, ref, reactive, onMounted } from "vue";
|
|
|
import { useDict } from "@/utils/dict";
|
|
|
import TaskAdd from "@/components/Task/Add";
|
|
|
import router from "../../../router";
|
|
|
+// 分页组件
|
|
|
+
|
|
|
+import Pagination from '@/components/Pagination'
|
|
|
+
|
|
|
import { listTask, getTask, delTask, addTask, updateTask } from "@/api/system/task";
|
|
|
|
|
|
const showadd = ref(false);
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
|
|
|
// const { task_status } = useDict("task_status");
|
|
|
const { task_status, task_type, task_event_type, task_event_category,sys_area } = useDict("task_status", "task_type", "task_event_type", "task_event_category","sys_area");
|
|
@@ -126,18 +142,22 @@ const { task_status, task_type, task_event_type, task_event_category,sys_area }
|
|
|
|
|
|
// const { area } = useDict("area");
|
|
|
|
|
|
-const queryparameters = ref({ times: "", status: "", area: "" });
|
|
|
+const qdate = ref([]);
|
|
|
+
|
|
|
+const queryparameters = ref({ status: "", taskArea: "",pageNum:1,pageSize:10 });
|
|
|
const tableData = ref([
|
|
|
|
|
|
]);
|
|
|
+const pagedata = ref({})
|
|
|
|
|
|
const tblrowclick = (row) => {
|
|
|
console.log(row);
|
|
|
router.push("/task/detail");
|
|
|
};
|
|
|
const getList = () =>{
|
|
|
- listTask({}).then(response => {
|
|
|
+ listTask(proxy.addDateRange(queryparameters.value,qdate.value)).then(response => {
|
|
|
tableData.value = response.rows;
|
|
|
+ pagedata.value = response;
|
|
|
});
|
|
|
}
|
|
|
getList();
|
|
@@ -147,16 +167,17 @@ onMounted(() => {});
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.formbody {
|
|
|
- background: rgb(247, 247, 247);
|
|
|
+ background: #fff;
|
|
|
width: 100%;
|
|
|
border-radius: 5px;
|
|
|
- min-height: 90vh;
|
|
|
+ min-height: 80vh;
|
|
|
padding: 15px 10px;
|
|
|
.eltable {
|
|
|
border: 1px solid #e5e9f2;
|
|
|
border-radius: 5px;
|
|
|
- min-height: 78vh;
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
</style>
|
|
|
|