Commit ef981a17 by 李君

优化

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