Commit a911ba00 by 李金轩

ljx

1 parent 326e96bc
This diff could not be displayed because it is too large.
window._baseUrl = window.location.hostname === 'localhost' ? 'http://store.keliuyun.com:9998' : '' window._baseUrl = ['localhost', '192.168.1.104'].includes(window.location.hostname) ? 'http://store.keliuyun.com:9998' : ''
const log = console.log.bind(console) const log = console.log.bind(console)
...@@ -13,9 +13,9 @@ const axiosInstance = axios.create( ...@@ -13,9 +13,9 @@ const axiosInstance = axios.create(
// 请求拦截器 // 请求拦截器
axiosInstance.interceptors.request.use( axiosInstance.interceptors.request.use(
config => { config => {
if (window.location.hostname === 'localhost') if (['localhost', '192.168.1.104'].includes(window.location.hostname))
{ {
config.headers.Authorization = '967c22ec-4257-40c8-9385-5c0f068afaa7' config.headers.Authorization = '34cdfc09-4ff1-44ac-9e9b-0b0da9b3047a'
} }
else else
{ {
......
.pagination-page {
float: right;
padding-right: 10px;
}
.result-wrapper {
/* padding: 0 20px; */
width: 50%;
min-width: 600px;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
border-radius: 4px;
margin: 20px auto 0;
position: relative;
overflow: auto;
}
.result-header {
text-align: center;
font-size: 16px;
padding: 10px 0;
box-shadow: 0px 0px 3px 0 rgba(0, 0, 0, .2);
/* margin: 10px 0 0; */
}
.result-page {
margin: 8px 0;
}
.result-progress-wrapper::after,
.result-progress-wrapper::before {
content: '';
display: table;
}
.result-progress-wrapper::after {
clear: both;
}
.result-item {
padding: 10px;
}
.scrollbar-wrapper {
height: 100%;
height: 376px;
max-height: 376px;
overflow-x: hidden !important;
}
.result-intro {
float: left;
}
.result-clear-btn {
float: right;
border-radius: 20px;
}
.result-footer {
padding: 12px 20px;
font-size: 16px;
box-shadow: 0px 0px 3px 0 rgba(0, 0, 0, .2);
}
.result-footer::after,
.result-footer::before {
content: '';
display: table;
}
.result-footer::after {
clear: both;
}
<template>
<div class="result-wrapper">
<div class="result-header">结果展示</div>
<div id="showDiv" class="scrollbar-wrapper">
<div v-for="item in informationList">
{{ item }}
</div>
</div>
</div>
</template>
<script>
import $ from 'jquery'
import {onMounted, onUpdated} from 'vue'
export default {
props: ['data'],
setup(props, {emit}) {
const informationList = props.data
// function
const renderResultToHtml = function(data, hasSccessDetail) {
let text = "本次共执行job " +
data.total +
" 个,成功 " +
data.success +
" 个,失败 " +
data.failed +
" 个.</br>"
if (data.failedJob && data.failedJob.length > 0)
{
text += "-----失败job详情-----</br>"
text += data.failedJob.join("</br>")
if (data.data)
{
text += "</br>" + data.data
}
}
if (data.successJob && data.successJob.length > 0)
{
text += "-----成功job详情-----</br>"
text += data.successJob.join("</br>")
if (hasSccessDetail)
{
if (data.data)
{
console.log(data.data)
data.data.forEach(item => {
text +=
"</br>" +
" 设备序列号: " +
item.deviceSerialnum +
" 时间: " +
item.counttime +
" 进客流: " +
item.innum +
" 出客流: " +
item.outnum
})
}
}
}
text += "</br>-----------------------------------------------"
text += "</br>"
text += "</br>"
text += "</br>"
$("#showDiv").append(text)
}
onUpdated(
() => {
log(informationList)
}
)
return {
informationList
}
}
}
</script>
<style lang="less" scoped>
@import "./InformationDisplay.less";
</style>
.pagination-page {
float: right;
padding-right: 10px;
}
.result-wrapper {
/* padding: 0 20px; */
width: 50%;
min-width: 600px;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
border-radius: 4px;
margin: 20px auto 0;
position: relative;
overflow: auto;
}
.result-header {
text-align: center;
font-size: 16px;
padding: 10px 0;
box-shadow: 0px 0px 3px 0 rgba(0, 0, 0, .2);
/* margin: 10px 0 0; */
}
.result-page {
margin: 8px 0;
}
.result-progress-wrapper::after,
.result-progress-wrapper::before {
content: '';
display: table;
}
.result-progress-wrapper::after {
clear: both;
}
.result-item {
padding: 10px;
}
.scrollbar-wrapper {
height: 100%;
height: 376px;
max-height: 376px;
overflow-x: hidden !important;
}
.result-intro {
float: left;
}
.result-clear-btn {
float: right;
border-radius: 20px;
}
.result-footer {
padding: 12px 20px;
font-size: 16px;
box-shadow: 0px 0px 3px 0 rgba(0, 0, 0, .2);
}
.result-footer::after,
.result-footer::before {
content: '';
display: table;
}
.result-footer::after {
clear: both;
}
<template>
<div class="result-wrapper">
<div class="result-header">结果展示</div>
<div class="scrollbar-wrapper">
<div v-for="item in resultList" class="result-item">
<div class="result-page">
<span>总处理条数 : {{ item.totalNum }}</span>
</div>
<el-row>
<el-col :span="2">
执行进度 :
</el-col>
<el-col :span="22">
<el-progress :text-inside="true" :stroke-width="26" :percentage="item?.progress"/>
</el-col>
</el-row>
<el-row>
<el-col :span="2">
</el-col>
<el-col :span="22">
<span>{{ item.current }}条/共{{ item.curPageSize }}</span>
<span class="pagination-page">{{ item.currentPage }}页/共{{ item.totalPage }}</span>
</el-col>
</el-row>
</div>
</div>
<!-- <div class="result-footer">-->
<!-- <span class="result-intro" v-if="startTiming && endTiming">{{ footerText || '数据重跑' }}完毕! 共计 {{ totalTime | formatTime }}</span>-->
<!-- <el-button class="result-clear-btn" @click="onClearClick">清空结果</el-button>-->
<!-- </div>-->
</div>
</template>
<script>
export default {
props: {
data: {
type: Array,
default: []
},
},
setup(props, {emit}) {
const resultList = props.data
return {
resultList
}
}
}
</script>
<style lang="less" scoped>
@import "./ResultDisplay.less";
</style>
<template>
<h2>{{ options.length }} Items</h2>
<a-select
v-model:value="value"
mode="multiple"
style="width: 100%"
placeholder="Please select"
:options="options"
/>
</template>
<script>
import {defineComponent, reactive} from 'vue'
const options = []
for (let i = 0; i < 100000; i++)
{
const value = `${i.toString(36)}${i}`
options.push({
value,
disabled: i === 10,
})
}
export default defineComponent({
setup() {
const state = reactive({
options,
value: ['a10', 'c12'],
})
return state
},
})
</script>
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
style="width: 200px" style="width: 200px"
mode="multiple" mode="multiple"
:maxTagCount="1" :maxTagCount="1"
@change="onPlazaChange"
> >
<a-select-option <a-select-option
v-for="item in plazaList" v-for="item in plazaList"
...@@ -29,121 +28,90 @@ ...@@ -29,121 +28,90 @@
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="选择日期:"> <a-form-item label="数据:">
<a-range-picker v-model:value="querySnapshotRecordForm.date" :format="'YYYY-MM-DD'"/> <a-select v-model:value="querySnapshotRecordForm.scheduleTypeList"
style="width: 200px"
mode="multiple"
:maxTagCount="1"
>
<a-select-option
v-for="(name, value) in progressMap"
:value="value"
>
{{ name }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="开始日期:">
<a-date-picker v-model:value="querySnapshotRecordForm.startDate"/>
</a-form-item>
<a-form-item label="结束日期:">
<a-date-picker v-model:value="querySnapshotRecordForm.endDate"/>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" @click="confirmSearch" :loading="isLoading">查询</a-button> <a-button type="primary" @click="confirmSearch">开始</a-button>
</a-form-item> </a-form-item>
</a-form> </a-form>
<div v-loading="isLoading"> <InformationDisplay :data="informationList" :key="resultList"></InformationDisplay>
<el-row v-for="row in pagedTableDataList">
<el-col :span="3" v-for="item in row">
<div style="margin: 0 5px">
<div style="display:flex; justify-content: flex-end ">
<span @click="downloadFile(item.features_url)"
style="color: #409EFF;font-size: 15px;cursor: pointer;">
下载特征值文件
</span>
</div>
<el-image :src="item.picture_url"
:fit="'fill'"
class="single-image">
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
</el-col>
</el-row>
<a-pagination
v-model:current="pageNum"
v-model:pageSize="pageSize"
:total="total"
:show-total="total => `共 ${total} 条`"
:pageSizeOptions="['24', '48', '96', '192']"
@change="onPageNumChange"
@showSizeChange="onPageSizeChange"
show-size-changer
show-quick-jumper
style="text-align:center"
/>
</div>
</template> </template>
<script> <script>
import {computed, reactive, ref, toRaw} from 'vue' import {reactive, ref, toRaw} from 'vue'
import moment from 'moment'
import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi' import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import {isArray} from '@/PublicUtil/Judgment' import {isArray} from '@/PublicUtil/Judgment'
import moment from 'moment' import {formatDate, formatTime} from '@/PublicUtil/PublicUtil'
import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil' import InformationDisplay from '@/component/InformationDisplay/InformationDisplay'
import dataRerunApi from '@/views/DataRerun/DataRerunApi'
export default { export default {
components: {
InformationDisplay,
},
setup() { setup() {
// scalar const resultList = ref([])
const pageNum = ref(1) const informationList = ref([])
const pageSize = ref(24)
const total = ref()
const isLoading = ref(false)
// sequence // sequence
const dataList = ref([])
const accountList = ref([]) const accountList = ref([])
const plazaList = ref([]) const plazaList = ref([])
const zoneList = ref([]) const zoneList = ref([])
const gateList = ref([]) const gateList = ref([])
let webSocketMap = {
mallcountData: undefined,
floorcountData: undefined,
zonecountData: undefined,
gatecountData: undefined,
mallfaceSta: undefined,
floorfaceSta: undefined,
zonefaceSta: undefined,
gatefaceSta: undefined,
}
const pagedTableDataList = computed( // mapping
() => { const progressMap = {
return getPagedList(dataList.value, 8) mallcountData: "商场客流",
} floorcountData: "楼层客流",
) zonecountData: "店铺客流",
gatecountData: "监控点客流",
mallfaceSta: "商场人脸",
floorfaceSta: "楼层人脸",
zonefaceSta: "店铺人脸",
gatefaceSta: "监控点人脸"
}
const querySnapshotRecordForm = reactive( const querySnapshotRecordForm = reactive(
{ {
account_id: [], account_id: [],
plaza_id: [], plaza_id: [],
zone_id: [], scheduleTypeList: [],
gate_id: [], startDate: moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD'),
type: 0, endDate: moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD'),
direction: [1, -1, 0],
picType: 2,
personType: [1, 2],
date: [moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD'), moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD')],
startTime: moment('00:00:00', 'HH:mm:ss'),
endTime: moment('23:59:59', 'HH:mm:ss'),
} }
) )
// function
const onPageNumChange = function(num) {
pageNum.value = num
confirmSearch()
}
const onPageSizeChange = function(current, size) {
pageNum.value = 1
pageSize.value = size
confirmSearch()
}
const onSubmit = function() {
}
const onAccountChange = function() { const onAccountChange = function() {
getPlazaList() getPlazaList()
getZoneList()
getGateList()
}
const onPlazaChange = function() {
getZoneList()
getGateList()
}
const onZoneChange = function() {
getGateList()
} }
const getPlazaList = function() { const getPlazaList = function() {
...@@ -163,44 +131,6 @@ export default { ...@@ -163,44 +131,6 @@ export default {
) )
} }
const getZoneList = function() {
querySnapshotRecordForm.zone_id = []
zoneList.value = []
snapshotRecordApi.getZoneList(
{
account_id: querySnapshotRecordForm.account_id.toString(),
plaza_id: querySnapshotRecordForm.plaza_id.toString(),
}
).then(
(r) => {
if (isArray(r))
{
zoneList.value = r
}
}
)
}
const getGateList = function() {
querySnapshotRecordForm.gate_id = []
gateList.value = []
snapshotRecordApi.getGateList(
{
account_id: querySnapshotRecordForm.account_id.toString(),
plaza_id: querySnapshotRecordForm.plaza_id.toString(),
zone_id: querySnapshotRecordForm.zone_id.toString(),
type: querySnapshotRecordForm.type,
}
).then(
(r) => {
if (isArray(r.data))
{
gateList.value = r.data
}
}
)
}
const getAccountList = function() { const getAccountList = function() {
querySnapshotRecordForm.account_id = [] querySnapshotRecordForm.account_id = []
accountList.value = [] accountList.value = []
...@@ -214,61 +144,110 @@ export default { ...@@ -214,61 +144,110 @@ export default {
) )
} }
const confirmSearch = function() { const floatToPercent = function(floatNum) {
isLoading.value = true if (!floatNum)
const rawData = toRaw(querySnapshotRecordForm) {
const data = filterEmptyValueInObject( return 0
{ }
account_id: rawData.account_id.toString(), let formatNum = Math.floor(floatNum * 100)
type: rawData.type, return formatNum >= 100 ? 100 : formatNum
plaza_id: rawData.plaza_id.toString(), }
zone_id: rawData.zone_id.toString(),
gate_id: rawData.gate_id.toString(), const dealMessage = function(message) {
direction: rawData.direction.toString(), // scheduleType
picType: rawData.picType, const {dates, mallIds, mallNames, status, stepCount, scheduleType, counter} = message
personType: rawData.personType.toString(), let resObj = {}
resObj.dates = dates
resObj.mallIds = mallIds
resObj.mallNames = mallNames
resObj.status = status
resObj.progress = floatToPercent(stepCount)
resObj.totalNum = 0
resObj.totalPage = 0
resObj.current = 0
resObj.curPageSize = 0
resObj.currentPage = 0
resObj.scheduleType = scheduleType
if (counter)
{
// dataNum dateMallNum step totalData totalDate totalMall totalMallDateProduct allDataCount
resObj.totalNum = counter.allDataCount
resObj.totalPage = counter.totalMallDateProduct
resObj.current = counter.dataNum
resObj.curPageSize = counter.totalData
resObj.currentPage = counter.dateMallNum
}
if (resultList.value.length)
{
const isSameScheduleType = resultList.value.some(item => item.scheduleType === scheduleType)
isSameScheduleType
? resultList.value.forEach(item => {
//
item.progress = floatToPercent(stepCount)
if (counter)
{
item.totalNum = counter.allDataCount
item.totalPage = counter.totalMallDateProduct
item.current = counter.dataNum
item.curPageSize = counter.totalData
item.currentPage = counter.dateMallNum
}
})
: resultList.value.push(resObj)
resObj = {}
}
else
{
resultList.value.push(resObj)
resObj = {}
}
}
const initializeWebSocket = function(scheduleType) {
if (webSocketMap[scheduleType] !== undefined)
{
webSocketMap[scheduleType].close()
}
webSocketMap[scheduleType] = new WebSocket(`ws://store.keliuyun.com:9998/recal/schedule/${scheduleType}`)
startTime: formatDate(rawData.date) + ' ' + formatTime(rawData.startTime), webSocketMap[scheduleType].onopen = () => {
endTime: formatDate(rawData.date) + ' ' + formatTime(rawData.endTime), queryData(scheduleType)
page: pageNum.value - 1, }
pageSize: pageSize.value,
webSocketMap[scheduleType].onmessage = function(event) {
let message = JSON.parse(event.data)
dealMessage(message)
if (message.stepCount === 1)
{
webSocketMap[scheduleType].close()
} }
) }
}
snapshotRecordApi.getSnapshotRecordList(data).then( const queryData = function(scheduleType) {
const rawData = toRaw(querySnapshotRecordForm)
const data = {
mallIds: rawData.plaza_id,
scheduleType: scheduleType,
startDate: formatDate(rawData.startDate) + ' ' + '00:00:00',
endDate: formatDate(rawData.endDate) + ' ' + '00:00:00',
}
dataRerunApi.getResult(data, scheduleType).then(
(r) => { (r) => {
isLoading.value = false informationList.value.push(r)
dataList.value = r.data.persons
total.value = r.data.pageNum
} }
) )
} }
const formatDirection = function(number) { const confirmSearch = function() {
switch (number) resultList.value = []
informationList.value = []
for (const scheduleType of querySnapshotRecordForm.scheduleTypeList)
{ {
case 1: initializeWebSocket(scheduleType)
{
return '进'
}
case 0:
{
return '出'
}
case 2:
{
return '横穿'
}
default:
{
break
}
} }
} }
const downloadFile = function(url) {
window.open(url)
}
const __main = function() { const __main = function() {
getAccountList() getAccountList()
...@@ -277,35 +256,24 @@ export default { ...@@ -277,35 +256,24 @@ export default {
__main() __main()
return { return {
// scalar
isLoading,
pageNum,
pageSize,
total,
// sequence // sequence
accountList, accountList,
plazaList, plazaList,
zoneList, zoneList,
gateList, gateList,
pagedTableDataList, resultList,
informationList,
// mapping // mapping
progressMap,
querySnapshotRecordForm, querySnapshotRecordForm,
// function
onPageNumChange,
onPageSizeChange,
onSubmit,
onAccountChange, onAccountChange,
onPlazaChange, initializeWebSocket,
onZoneChange,
confirmSearch, confirmSearch,
formatDirection,
downloadFile,
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style scoped>
@import "./DataRerun.less";
</style>
</style>
import axiosInstance from "@/Request/PublicAxiosInstance" import axiosInstance from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil" import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
const map = {
mallcountData: "/mall/countData",
floorcountData: "/floor/countData",
zonecountData: "/zone/countData",
gatecountData: "/gate/countData",
mallfaceSta: "/mall/faceSta",
floorfaceSta: "/floor/faceSta",
zonefaceSta: "/zone/faceSta",
gatefaceSta: "/gate/faceSta",
}
class DataRerunApi { class DataRerunApi {
getAccountList(data) { getResult(data, type) {
return axiosInstance.request( return axiosInstance.request(
{ {
method: 'GET', method: 'POST',
url: `/accounts`, url: `${map[type]}`,
data: data
} }
) )
} }
......
...@@ -38,13 +38,11 @@ ...@@ -38,13 +38,11 @@
<a-date-picker v-model:value="querySnapshotRecordForm.date"/> <a-date-picker v-model:value="querySnapshotRecordForm.date"/>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" @click="initializeWebSocket">查询</a-button> <a-button type="primary" @click="initializeWebSocket">开始</a-button>
</a-form-item> </a-form-item>
</a-form> </a-form>
<div class="result-header">结果展示</div> <ResultDisplay :data="resultList" :key="resultList"></ResultDisplay>
<el-progress v-for="item in resultList" :text-inside="true" :stroke-width="26" :percentage="item?.progress"/>
</template> </template>
<script> <script>
...@@ -54,8 +52,12 @@ import moment from 'moment' ...@@ -54,8 +52,12 @@ import moment from 'moment'
import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi' import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import {isArray} from '@/PublicUtil/Judgment' import {isArray} from '@/PublicUtil/Judgment'
import {formatDate, formatTime} from '@/PublicUtil/PublicUtil' import {formatDate, formatTime} from '@/PublicUtil/PublicUtil'
import ResultDisplay from '@/component/ResultDisplay/ResultDisplay'
export default { export default {
components: {
ResultDisplay,
},
setup() { setup() {
let webSocket = undefined let webSocket = undefined
const resultList = ref([]) const resultList = ref([])
...@@ -181,7 +183,6 @@ export default { ...@@ -181,7 +183,6 @@ export default {
webSocket.onmessage = function(event) { webSocket.onmessage = function(event) {
let message = JSON.parse(event.data) let message = JSON.parse(event.data)
log('[onmessage]:', message)
dealMessage(message) dealMessage(message)
if (message.stepCount === 1) if (message.stepCount === 1)
{ {
......
...@@ -40,13 +40,11 @@ ...@@ -40,13 +40,11 @@
<a-date-picker v-model:value="querySnapshotRecordForm.date"/> <a-date-picker v-model:value="querySnapshotRecordForm.date"/>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" @click="initializeWebSocket">查询</a-button> <a-button type="primary" @click="initializeWebSocket">开始</a-button>
</a-form-item> </a-form-item>
</a-form> </a-form>
<div class="result-header">结果展示</div> <ResultDisplay :data="resultList" :key="resultList"></ResultDisplay>
<el-progress v-for="item in resultList" :text-inside="true" :stroke-width="26" :percentage="item?.progress"/>
</template> </template>
<script> <script>
...@@ -57,8 +55,12 @@ import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRe ...@@ -57,8 +55,12 @@ import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRe
import {isArray} from '@/PublicUtil/Judgment' import {isArray} from '@/PublicUtil/Judgment'
import {formatDate, formatTime} from '@/PublicUtil/PublicUtil' import {formatDate, formatTime} from '@/PublicUtil/PublicUtil'
import featureReExtractApi from '@/views/FeatureReExtract/FeatureReExtractApi' import featureReExtractApi from '@/views/FeatureReExtract/FeatureReExtractApi'
import ResultDisplay from '@/component/ResultDisplay/ResultDisplay'
export default { export default {
components: {
ResultDisplay,
},
setup() { setup() {
let webSocket = undefined let webSocket = undefined
const resultList = ref([]) const resultList = ref([])
......
...@@ -28,23 +28,21 @@ ...@@ -28,23 +28,21 @@
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="特征重提类型:"> <a-form-item label="比对类型:">
<a-select v-model:value="querySnapshotRecordForm.featureRevisitType" style="width: 200px"> <a-select v-model:value="querySnapshotRecordForm.featureRevisitType" style="width: 200px">
<a-select-option :value="1">店员库重建</a-select-option> <a-select-option :value="1">店员对比</a-select-option>
<a-select-option :value="2">顾客库重建</a-select-option> <a-select-option :value="2">顾客对比</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="选择日期:" v-if="querySnapshotRecordForm.featureRevisitType === 2"> <a-form-item label="选择日期:">
<a-date-picker v-model:value="querySnapshotRecordForm.date"/> <a-date-picker v-model:value="querySnapshotRecordForm.date"/>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" @click="initializeWebSocket">查询</a-button> <a-button type="primary" @click="initializeWebSocket">开始</a-button>
</a-form-item> </a-form-item>
</a-form> </a-form>
<div class="result-header">结果展示</div> <ResultDisplay :data="resultList" :key="resultList"></ResultDisplay>
<el-progress v-for="item in resultList" :text-inside="true" :stroke-width="26" :percentage="item?.progress"/>
</template> </template>
<script> <script>
...@@ -54,8 +52,13 @@ import moment from 'moment' ...@@ -54,8 +52,13 @@ import moment from 'moment'
import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi' import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import {isArray} from '@/PublicUtil/Judgment' import {isArray} from '@/PublicUtil/Judgment'
import {formatDate, formatTime} from '@/PublicUtil/PublicUtil' import {formatDate, formatTime} from '@/PublicUtil/PublicUtil'
import peopleReContrastApi from '@/views/PeopleReContrast/PeopleReContrastApi'
import ResultDisplay from '@/component/ResultDisplay/ResultDisplay'
export default { export default {
components: {
ResultDisplay,
},
setup() { setup() {
let webSocket = undefined let webSocket = undefined
const resultList = ref([]) const resultList = ref([])
...@@ -174,13 +177,12 @@ export default { ...@@ -174,13 +177,12 @@ export default {
} }
resultList.value = [] resultList.value = []
webSocket = new WebSocket(`ws://store.keliuyun.com:9998/recal/schedule/rebuildFeatureLib${querySnapshotRecordForm.featureRevisitType}`) webSocket = new WebSocket(`ws://store.keliuyun.com:9998/recal/schedule/rematchPerson${querySnapshotRecordForm.featureRevisitType}`)
webSocket.onopen = queryData webSocket.onopen = queryData
webSocket.onmessage = function(event) { webSocket.onmessage = function(event) {
let message = JSON.parse(event.data) let message = JSON.parse(event.data)
log('[onmessage]:', message)
dealMessage(message) dealMessage(message)
if (message.stepCount === 1) if (message.stepCount === 1)
{ {
...@@ -197,20 +199,22 @@ export default { ...@@ -197,20 +199,22 @@ export default {
{ {
const data = { const data = {
mallIds: rawData.plaza_id, mallIds: rawData.plaza_id,
scheduleType: `rebuildFeatureLib${rawData.featureRevisitType}`, scheduleType: `rematchPerson${rawData.featureRevisitType}`,
startDate: formatDate(rawData.date) + ' ' + '00:00:00',
endDate: formatDate(rawData.date) + ' ' + '23:59:59',
} }
featureLibraryRebuildApi.getStaffResult(data) peopleReContrastApi.getStaffResult(data)
break break
} }
case 2: case 2:
{ {
const data = { const data = {
mallIds: rawData.plaza_id, mallIds: rawData.plaza_id,
scheduleType: `rebuildFeatureLib${rawData.featureRevisitType}`, scheduleType: `rematchPerson${rawData.featureRevisitType}`,
startDate: formatDate(rawData.date) + ' ' + '00:00:00', startDate: formatDate(rawData.date) + ' ' + '00:00:00',
endDate: formatDate(rawData.date) + ' ' + '23:59:59', endDate: formatDate(rawData.date) + ' ' + '23:59:59',
} }
featureLibraryRebuildApi.getCustomResult(data) peopleReContrastApi.getCustomResult(data)
break break
} }
} }
......
import axiosInstance from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
class PeopleReContrastApi {
getStaffResult(data) {
return axiosInstance.request(
{
method: 'POST',
url: `/mall/staff`,
data: data
}
)
}
getCustomResult(data) {
return axiosInstance.request(
{
method: 'POST',
url: `/mall/custom`,
data: data
}
)
}
}
const peopleReContrastApi = new PeopleReContrastApi()
export default peopleReContrastApi
<template> <template>
<a-form :model="queryClusterResultForm" layout="inline"> <a-form :model="queryClusterResultForm" layout="inline" :label-col="{span: 4}" :wrapper-col="{span: 14}">
<a-form-item label="集团:"> <a-form-item label="集团:">
<a-select v-model:value="queryClusterResultForm.account_id" <a-select v-model:value="queryClusterResultForm.account_id"
style="width: 200px" style="width: 200px"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!