|
@@ -17,7 +17,7 @@
|
|
|
@load="getList"
|
|
|
>
|
|
|
<div
|
|
|
- v-for="(item, index) in event_list"
|
|
|
+ v-for="(item, index) in taskData"
|
|
|
:key="item.id"
|
|
|
class="event-list-item"
|
|
|
>
|
|
@@ -64,9 +64,11 @@ import { getCurrentInstance, reactive, ref, toRefs, onMounted } from "vue";
|
|
|
import { useRouter } from "vue-router";
|
|
|
import searchImg from "@/assets/images/search.png";
|
|
|
import closeImg from "@/assets/images/close.png";
|
|
|
+import { workSubList } from "@/api/inspectionWork/inspector";
|
|
|
+
|
|
|
const proxy = getCurrentInstance()?.proxy;
|
|
|
const router = useRouter();
|
|
|
-const event_list = ref([]);
|
|
|
+const taskData = ref([]);
|
|
|
const total = ref(0);
|
|
|
const loading = ref(false);
|
|
|
const error = ref(false);
|
|
@@ -75,12 +77,13 @@ const initFormData = reactive({
|
|
|
scope: "",
|
|
|
cycle: "",
|
|
|
time: "",
|
|
|
- event_title: "",
|
|
|
- id: ""
|
|
|
+ title: "",
|
|
|
+ id: 0
|
|
|
});
|
|
|
const data = reactive({
|
|
|
form: { ...initFormData },
|
|
|
queryParams: {
|
|
|
+ search_keyword: '',
|
|
|
page: 1,
|
|
|
pageSize: 10
|
|
|
}
|
|
@@ -88,49 +91,56 @@ const data = reactive({
|
|
|
const { queryParams, form } = toRefs(data);
|
|
|
// 获取列表数据的方法
|
|
|
async function getList() {
|
|
|
+ /*
|
|
|
loading.value = true;
|
|
|
try {
|
|
|
// 这里是获取列表数据的逻辑,可以根据实际需求进行修改
|
|
|
- const res = await fetchListData(
|
|
|
- queryParams.value.page,
|
|
|
- queryParams.value.pageSize
|
|
|
+ const res = await workSubList(
|
|
|
+ queryParams.value
|
|
|
);
|
|
|
- event_list.value = res.data.list;
|
|
|
- total.value = res.data.total;
|
|
|
+ taskData.value = res.data;
|
|
|
+ total.value = res.total;
|
|
|
} catch (err) {
|
|
|
console.error("获取列表数据出错", err);
|
|
|
error.value = true;
|
|
|
} finally {
|
|
|
loading.value = false;
|
|
|
}
|
|
|
+ */
|
|
|
+ loading.value = false;
|
|
|
+ taskData.value = [
|
|
|
+ {id: 1, title: '巡查子任务1', cycle: '每天', scope: '范围', time: '2024-10-27'},
|
|
|
+ {id: 2, title: '巡查子任务2', cycle: '每天', scope: '范围', time: '2024-10-27'},
|
|
|
+ {id: 3, title: '巡查子任务3', cycle: '每天', scope: '范围', time: '2024-10-27'},
|
|
|
+ {id: 4, title: '巡查子任务4', cycle: '每天', scope: '范围', time: '2024-10-27'},
|
|
|
+ {id: 5, title: '巡查子任务5', cycle: '每天', scope: '范围', time: '2024-10-27'},
|
|
|
+ ];
|
|
|
+ total.value = 5;
|
|
|
}
|
|
|
// 搜索关键字变化时触发的方法
|
|
|
function on_search_keyword(keyword) {
|
|
|
// 根据搜索关键字更新查询参数
|
|
|
queryParams.value.search_keyword = keyword;
|
|
|
+ queryParams.value.page = 1;
|
|
|
// 刷新列表数据
|
|
|
getList();
|
|
|
}
|
|
|
|
|
|
// 右侧关闭按钮点击时触发的方法
|
|
|
-function on_search_cancel() {
|
|
|
+const on_search_cancel = () => {
|
|
|
// 清空搜索关键字
|
|
|
queryParams.value.search_keyword = "";
|
|
|
+ queryParams.value.page = 1;
|
|
|
// 刷新列表数据
|
|
|
getList();
|
|
|
}
|
|
|
-</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
-.van-doc-block__title {
|
|
|
- color: var(--van-doc-text-color-4);
|
|
|
- margin: 0;
|
|
|
- padding: 32px 16px 16px;
|
|
|
- font-size: 14px;
|
|
|
- font-weight: 400;
|
|
|
- line-height: 16px;
|
|
|
+const handleView = (item) => {
|
|
|
+
|
|
|
}
|
|
|
+</script>
|
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
.event-list-item {
|
|
|
position: relative;
|
|
|
margin: 16px 16px 0;
|
|
@@ -139,7 +149,7 @@ function on_search_cancel() {
|
|
|
border: 0.5px solid #eaedf7;
|
|
|
box-shadow: 0 0 4px 0 #4554661a;
|
|
|
&:first-child {
|
|
|
- margin-top: 0;
|
|
|
+ margin-top: 16px;
|
|
|
}
|
|
|
.item-title {
|
|
|
display: flex;
|