<template>
|
<div class="fy-card">
|
<div class="fy-h1">内部线索清单</div>
|
<div class="fy-flex-row">
|
<span>时间</span>
|
<el-date-picker
|
v-model="updateTime"
|
type="datetime"
|
placeholder="选择日期和时间"
|
/>
|
<el-button type="primary" @click="getClues">查询</el-button>
|
<el-button type="success" @click="clueDialog = true"
|
>新建</el-button
|
>
|
</div>
|
<el-scrollbar height="70vh" class="p-h-1">
|
<ClueList :dataList="clueList" @itemSelected="selectClue">
|
</ClueList>
|
</el-scrollbar>
|
<el-row justify="space-between" class="p-8">
|
<el-pagination
|
size="small"
|
v-model:current-page="currentPage"
|
v-model:page-size="pageSize"
|
:page-sizes="[10, 20, 50, 100]"
|
:background="true"
|
layout="total, sizes, pager"
|
:total="total"
|
/>
|
</el-row>
|
</div>
|
<InternalClueEdit
|
v-model="clueDialog"
|
:create="true"
|
:onCreate="createInternalClue"
|
></InternalClueEdit>
|
<ClueTaskEdit
|
v-model="clueTaskDialog"
|
:create="true"
|
:onCreate="createInternalTask"
|
></ClueTaskEdit>
|
</template>
|
|
<script setup>
|
import { ref, onMounted, reactive } from 'vue';
|
import moment from 'moment';
|
|
import clueInternalApi from '@/api/clue/clueInternalApi';
|
import clueTaskApi from '@/api/clue/clueTaskApi';
|
import { onMapMounted } from '@/components/map/baseMap';
|
|
import ClueList from '@/views/overlay-clue/list/components/ClueList.vue';
|
import ClueTaskEdit from '@/views/overlay-clue/task/ClueTaskEdit.vue';
|
import InternalClueEdit from '@/views/internal-clue/InternalClueEdit.vue';
|
|
const emits = defineEmits('itemSelected');
|
|
// 下发时间(每次查询大于此时间的数据)
|
const updateTime = ref();
|
// 线索清单
|
const clueList = ref([]);
|
const currentPage = ref(1);
|
const pageSize = ref(100);
|
const total = ref(0);
|
|
/**
|
* 查询已下发的线索清单
|
*/
|
const getClues = function () {
|
let sTime;
|
let eTime;
|
if (updateTime.value) {
|
const now = moment(updateTime.value);
|
sTime = now.format('YYYY-MM-DD HH:mm:ss');
|
eTime = now.add(1, 'month').format('YYYY-MM-DD HH:mm:ss');
|
}
|
onMapMounted(() => {
|
clueInternalApi
|
.getInternalClue({
|
sTime,
|
eTime,
|
pageNum: currentPage.value,
|
pageSize: pageSize.value
|
})
|
.then((res) => {
|
total.value = res.head.totalCount;
|
clueList.value = res.data;
|
});
|
});
|
};
|
|
/**
|
* 选择线索事件
|
*/
|
const selectClue = function (clue) {
|
emits('itemSelected', clue);
|
};
|
|
onMounted(() => {
|
getClues();
|
});
|
|
/************************************************************** */
|
const clueData = ref();
|
const clueDialog = ref(false);
|
const clueTaskDialog = ref(false);
|
|
function createInternalClue(clue) {
|
clueData.value = clue;
|
clueDialog.value = false;
|
clueTaskDialog.value = true;
|
}
|
function createInternalTask(clueTask) {
|
clueTaskApi
|
.createClueTaskInternal({
|
clueTask: clueTask,
|
clueInternal: clueData.value
|
})
|
.then((res) => {
|
if (res.success) {
|
clueTaskDialog.value = false;
|
getClues();
|
}
|
});
|
}
|
</script>
|
<style scoped></style>
|