图斑调整优化

dianlixunjian
刘妍 2024-07-18 11:36:57 +08:00
parent 4dfce8d0dd
commit 734bb3e004
1 changed files with 461 additions and 447 deletions

View File

@ -147,7 +147,7 @@
</div> </div>
</div> </div>
<div class="data-list-div" style="padding-top: 1px;"> <div class="data-list-div" style="padding-top: 1px;">
<div v-for="(item, index) in infoDataList" :key="index" :class="item.id == selectId ? 'data-list-item checked' : 'data-list-item'"> <div v-for="(item, index) in infoDataList" :key="index" :class="classFun(item)">
<div class="data-list-layout-div"> <div class="data-list-layout-div">
<div class="data-list-title-div"> <div class="data-list-title-div">
<img <img
@ -156,7 +156,7 @@
style="cursor: pointer" style="cursor: pointer"
@click="locationFun(item)" @click="locationFun(item)"
/> />
<div class="label-div" @click="selectAreaId(item.id)"> <div class="label-div" @click="selectAreaId(item)">
<div class="item-label">{{ item.countyname }}</div> <div class="item-label">{{ item.countyname }}</div>
<div class="item-sub-label"> <div class="item-sub-label">
<span style="margin-right: 12px">{{ item.streetname }}</span> <span style="margin-right: 12px">{{ item.streetname }}</span>
@ -170,7 +170,7 @@
</div> </div>
</div> </div>
<div class="data-list-info-div"> <div class="data-list-info-div">
<div class="info-layout-div" @click="selectAreaId(item.id)"> <div class="info-layout-div" @click="selectAreaId(item)">
<div class="info-item"> <div class="info-item">
<div class="info-label">总面积</div> <div class="info-label">总面积</div>
<div class="info-data">{{ item.area }}</div> <div class="info-data">{{ item.area }}</div>
@ -253,14 +253,14 @@
patchSourceOptions, patchSourceOptions,
} from '@/views/demo/tiankongdi/curbspotcity/util'; } from '@/views/demo/tiankongdi/curbspotcity/util';
import Amend from './amend.vue'; import Amend from './amend.vue';
import { Empty ,Spin,message} from 'ant-design-vue'; import { Empty, message } from 'ant-design-vue';
import ShowInfoModal from '@/views/demo/tiankongdi/curbspotcity/MapList/ShowInfoModal/index.vue'; import ShowInfoModal from '@/views/demo/tiankongdi/curbspotcity/MapList/ShowInfoModal/index.vue';
const modalShow = ref(false); const modalShow = ref(false);
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE; const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
const pageSize = ref(10); const pageSize = ref(10);
const pageNo = ref(1); const pageNo = ref(1);
const total = ref(0) const total = ref(0);
const mapStatusOptions = ref([ const mapStatusOptions = ref([
{ {
label: '正常', label: '正常',
@ -270,19 +270,16 @@
label: '分割后关闭', label: '分割后关闭',
value: '分割后关闭', value: '分割后关闭',
}, },
])
const modalRecord = ref('');
const emits = defineEmits([
'changeSpin',
'changeTask'
]); ]);
const modalRecord = ref('');
const emits = defineEmits(['changeSpin', 'changeTask']);
const order = ref(0); // 0: 1: 2: const order = ref(0); // 0: 1: 2:
const showSortMark = (key, sort) => { const showSortMark = (key, sort) => {
if (infoScreenData.value.sort === key && sort === order.value) { if (infoScreenData.value.sort === key && sort === order.value) {
return true return true;
}
return false
} }
return false;
};
const infoDataList = ref([]); const infoDataList = ref([]);
const infoScreenData: any = ref({ const infoScreenData: any = ref({
@ -306,9 +303,18 @@
order: null, order: null,
type: null, type: null,
}); });
const selectItem = ref();
const classFun = (item) => {
let string = 'data-list-item';
if (selectItem.value && item.id == selectItem.value.id) {
string += ' checked';
}
if (item.unitname == '已关闭') {
string += ' close-div';
}
return string;
};
const mapListScreenChange = (value, type) => { const mapListScreenChange = (value, type) => {
console.log(value,type)
switch (type) { switch (type) {
case 'year': case 'year':
infoScreenData.value.year = value; infoScreenData.value.year = value;
@ -321,7 +327,6 @@
break; break;
case 'countyid': case 'countyid':
infoScreenData.value.countyid = value; infoScreenData.value.countyid = value;
getStreetOrgs(value);
break; break;
case 'streetid': case 'streetid':
infoScreenData.value.streetid = value; infoScreenData.value.streetid = value;
@ -347,21 +352,23 @@
break; break;
case 'mapStatus': case 'mapStatus':
if (value.length > 0) { if (value.length > 0) {
infoScreenData.value.isSplit = value.join(',') infoScreenData.value.isSplit = value.join(',');
} else { } else {
delete infoScreenData.value.isSplit delete infoScreenData.value.isSplit;
} }
break; break;
} }
}; };
const getInfoList = () => { const getInfoList = () => {
emits('changeSpin',true) emits('changeSpin', true);
getLoadDroneCaseInfoDetail(infoScreenData.value).then((res) => { getLoadDroneCaseInfoDetail(infoScreenData.value)
.then((res) => {
infoDataList.value = res.items; infoDataList.value = res.items;
total.value = res.total total.value = res.total;
}).finally(() => {
emits('changeSpin',false)
}) })
.finally(() => {
emits('changeSpin', false);
});
}; };
const showInfoOpen = ref(false); const showInfoOpen = ref(false);
const openCollect = computed(() => { const openCollect = computed(() => {
@ -371,7 +378,6 @@
const showInfoData = ref(); const showInfoData = ref();
onMounted(() => { onMounted(() => {
getInfoList(); getInfoList();
}); });
// //
async function locationFun(record) { async function locationFun(record) {
@ -386,29 +392,28 @@
// //
const getCollectList = () => { const getCollectList = () => {
let collect = infoScreenData.value.type; let collect = infoScreenData.value.type;
console.log(collect)
if (collect === '' || collect == null) { if (collect === '' || collect == null) {
infoScreenData.value.type = 1; infoScreenData.value.type = 1;
} else if (collect === 1) { } else if (collect === 1) {
delete infoScreenData.value.type delete infoScreenData.value.type;
} }
getInfoList() getInfoList();
}; };
const dataListSort = (type) => { const dataListSort = (type) => {
order.value = (order.value + 1) % 3; order.value = (order.value + 1) % 3;
switch (order.value) { switch (order.value) {
case 0: case 0:
delete infoScreenData.value.sort delete infoScreenData.value.sort;
delete infoScreenData.value.order delete infoScreenData.value.order;
break break;
case 1: case 1:
infoScreenData.value.sort = type infoScreenData.value.sort = type;
infoScreenData.value.order = 'asc' infoScreenData.value.order = 'asc';
break break;
case 2: case 2:
infoScreenData.value.sort = type infoScreenData.value.sort = type;
infoScreenData.value.order = 'desc' infoScreenData.value.order = 'desc';
break break;
} }
getInfoList(); getInfoList();
}; };
@ -419,24 +424,27 @@
}); });
}; };
function changeArea() { function changeArea() {
if(!selectId.value){ if (!selectItem.value) {
message.warning('请选择一条数据进行飞地调整') message.warning('请选择一条数据进行飞地调整');
return return;
}
if (selectItem.value.unitname == '已关闭') {
message.warning('已关闭的不能进行飞地调整!');
return;
} }
modalShow.value = true; modalShow.value = true;
modalRecord.value = selectId.value; modalRecord.value = selectItem.value.id;
} }
const selectId =ref() function selectAreaId(item) {
function selectAreaId(id){ selectItem.value = item;
selectId.value = id
} }
const resetScreenData = () => { const resetScreenData = () => {
infoScreenData.value = { infoScreenData.value = {
limit: pageSize.value, limit: pageSize.value,
page: pageNo.value, page: pageNo.value,
} };
getInfoList(); getInfoList();
} };
function closeModal() { function closeModal() {
modalShow.value = false; modalShow.value = false;
} }
@ -504,7 +512,7 @@
font-family: Alibaba PuHuiTi; font-family: Alibaba PuHuiTi;
font-weight: 400; font-weight: 400;
color: #ffffff; color: #ffffff;
background: #139AF8; background: #139af8;
margin-left: 4px; margin-left: 4px;
height: 39px; height: 39px;
font-size: 17px; font-size: 17px;
@ -579,7 +587,7 @@
.interval-div { .interval-div {
height: 100%; height: 100%;
width: 1px; width: 1px;
background:#EDEDED; background: #ededed;
margin-left: 10px; margin-left: 10px;
margin-right: 10px; margin-right: 10px;
} }
@ -720,8 +728,14 @@
border-bottom-right-radius: 6px; border-bottom-right-radius: 6px;
} }
.data-list-item.checked { .data-list-item.checked {
background:#EFF3FC; border: 1px solid #139af8;
border: 1px solid #139AF8; }
.data-list-item.close-div {
background: #eff3fc;
}
.data-list-item.checked.close-div {
background: #eff3fc;
border: 1px solid #139af8;
} }
} }
</style> </style>