riku
2025-07-29 056ea576d820729878ffd62cd54cd7598e72d07e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<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>