Commit ef981a17 by 李君

优化

1 parent 1560935a
......@@ -14,7 +14,7 @@ const axiosInstance = axios.create(
// 请求拦截器
axiosInstance.interceptors.request.use(
config => {
// Cookies.set('atoken','c2f52c71-8736-47c7-9eaf-2a3f6a7cc631')
// Cookies.set('atoken','d697b325-3a0d-4364-b851-a27d8b6e2a1e')
if(!Cookies.get('atoken')){
ElMessage({
message: `登录过期,请重新登录`,
......
......@@ -3,6 +3,7 @@
title="特征对比"
v-model:visible="isVisible"
width="1500px"
style="top: 50px"
class="detail-modal"
>
<div>
......
......@@ -4,6 +4,10 @@
v-model:visible="isVisible"
width="1500px"
class="detail-modal"
style="top: 50px"
:body-style="{
padding:'10px 20px'
}"
>
<div>
<a-row :gutter="[16,16]">
......@@ -209,8 +213,7 @@ export default {
background-color: orange;
}
.rowBox{
height: 600px;
height: 700px;
overflow-y: auto;
}
.singleBox{
......@@ -221,6 +224,7 @@ export default {
padding-bottom: 0;
height: 32px;
line-height: 32px;
margin-bottom: 0;
}
}
.itemBox{
......
<template>
<a-form :model="queryForm" layout="inline" :label-col="{ style: { width: '100px' } }">
<a-form-item label="集团:" style="padding: 5px 0">
<a-select v-model:value="queryForm.account_id"
style="width: 280px"
mode="multiple"
:maxTagCount="1"
@change="onAccountChange"
:options="accountList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="广场:" style="padding: 5px 0">
<a-select v-model:value="queryForm.plaza_id"
style="width: 280px"
mode="multiple"
:maxTagCount="1"
@change="onPlazaChange"
:options="plazaList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="日期:" style="padding: 5px 0">
<a-date-picker v-model:value="queryForm.countDate" style="width: 280px"/>
</a-form-item>
......@@ -66,6 +90,8 @@
</template>
<script>
import moment from 'moment'
import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import {isArray} from '@/PublicUtil/Judgment'
import {defineComponent, ref,toRaw,reactive } from 'vue'
import {filterEmptyValueInObject,formatDate} from '@/PublicUtil/PublicUtil'
import equipmentTimeErrorVerificationApi from '@/views/EquipmentTimeErrorVerification/EquipmentTimeErrorVerificationApi'
......@@ -77,15 +103,95 @@ export default defineComponent({
const total = ref()
const dataList = ref([])
const isLoading = ref(false)
const onPageNumChange = function(num) {
pageNum.value = num
confirmSearch()
}
const accountList = ref([])
const plazaList = ref([])
const queryForm = reactive(
{
account_id: [],
plaza_id: [],
countDate: moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD')
}
)
const searchCondition = ref({})
if(window.localStorage.getItem('searchCondition')){
searchCondition.value = JSON.parse(window.localStorage.getItem('searchCondition'));
queryForm.account_id = searchCondition.value.zone_id;
queryForm.plaza_id = searchCondition.value.plaza_id;
}
const getAccountList = function() {
queryForm.accountIds = []
accountList.value = []
clusterResultApi.getAccountList().then(
(r) => {
if (isArray(r))
{
for (const item of r)
{
accountList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(accountList.value.length){
if(searchCondition.value.account_id && searchCondition.value.account_id.length>0){
queryForm.account_id = searchCondition.value.account_id
}else{
queryForm.account_id.push(accountList.value[0].value)
}
getPlazaList()
}
}
}
)
}
const onAccountChange = function() {
getPlazaList(1)
}
const getPlazaList = function(val) {
queryForm.plaza_id = []
plazaList.value = []
if(!queryForm.account_id.toString()){
return
}
clusterResultApi.getPlazaList(
{
account_id: queryForm.account_id.toString()
}
).then(
(r) => {
if (isArray(r))
{
for (const item of r)
{
plazaList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(plazaList.value.length>0){
if(!val&&searchCondition.value.plaza_id && searchCondition.value.plaza_id.length>0){
queryForm.plaza_id = searchCondition.value.plaza_id
}else{
queryForm.plaza_id.push(plazaList.value[0].value)
}
confirmSearch()
}
}
}
)
}
const onPlazaChange = function() {
confirmSearch()
}
const onPageNumChange = function(num) {
pageNum.value = num
confirmSearch()
}
const onPageSizeChange = function(current, size) {
pageNum.value = 1
pageSize.value = size
......@@ -97,14 +203,18 @@ export default defineComponent({
const data = filterEmptyValueInObject({
page: pageNum.value - 1,
pageSize: pageSize.value,
countDate:formatDate(rawData.countDate)
countDate:formatDate(rawData.countDate),
accountIds:rawData.account_id.toString(),
mallIds:rawData.plaza_id.toString(),
})
console.log(data)
dataList.value = [],total.value = 0
equipmentTimeErrorVerificationApi.getList(data).then(
(r) => {
isLoading.value = false
dataList.value = r.data.devices
total.value = r.data.pageNum
if(r.msg_code==200){
dataList.value = r.data.devices
total.value = r.data.pageNum
}
}
)
}
......@@ -114,11 +224,15 @@ export default defineComponent({
confirmSearch()
}
const __main = function() {
confirmSearch()
getAccountList()
}
__main()
return {
accountList,
onAccountChange,
plazaList,
onPlazaChange,
queryForm,
pageNum,
pageSize,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!