2025-04-29 16:36:51 +08:00
|
|
|
|
<template>
|
2025-05-16 15:21:08 +08:00
|
|
|
|
<z-paging ref="paging" v-model="arrData" default-page-no="1" :default-page-size="pageNum" auto-show-back-to-top
|
|
|
|
|
|
@query="query">
|
2025-05-13 09:22:55 +08:00
|
|
|
|
<template #top>
|
|
|
|
|
|
<div style="display:flex;padding: 10px;">
|
|
|
|
|
|
<uni-easyinput v-model="siteName" placeholder="请输入站点名称" suffixIcon="search" @iconClick="search" />
|
|
|
|
|
|
<label style="margin-left: 10px;" @click="openMap">
|
|
|
|
|
|
<uni-icons custom-prefix="iconfont" type="icon-ebikeditu2" color="#1b1a1a" size="40" />
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divSearch">
|
|
|
|
|
|
<div v-for="(item,index) in arrSearch " :key="index"
|
|
|
|
|
|
:class="'divSearchTab'+(searchIndex==index?' divSearchTabSel':'')" @click="changerOrder(index)">
|
|
|
|
|
|
<label>{{item}}</label>
|
|
|
|
|
|
<div class="divSearchRow">
|
|
|
|
|
|
<div class="divSearchCel">
|
|
|
|
|
|
<uni-icons custom-prefix="iconfont" type="icon-ebikesanjiaoxing"
|
|
|
|
|
|
:color="(searchIndex==index&&searchType=='up')?iconColorSel:iconColor" size="8" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divSearchCel">
|
|
|
|
|
|
<uni-icons custom-prefix="iconfont" type="icon-ebikesanjiaoxing-copy"
|
|
|
|
|
|
:color="(searchIndex==index&&searchType=='down')?iconColorSel:iconColor" size="8" />
|
|
|
|
|
|
</div>
|
2025-04-29 16:36:51 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-05-13 09:22:55 +08:00
|
|
|
|
</template>
|
2025-04-29 16:36:51 +08:00
|
|
|
|
<div>
|
|
|
|
|
|
<uni-card v-for="(item,index) in arrData" :key="'c'+index">
|
|
|
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
|
|
|
<div class="divListItemType">
|
|
|
|
|
|
{{item.zdlx}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divListItemSite">
|
|
|
|
|
|
{{item.zdmc}}
|
|
|
|
|
|
</div>
|
2025-05-07 16:06:02 +08:00
|
|
|
|
<div class="divTool">
|
2025-04-29 16:36:51 +08:00
|
|
|
|
<label style="padding-left: 10px;" @click="editSite(item)">
|
|
|
|
|
|
<uni-icons custom-prefix="iconfont" type="icon-ebikebianji" color="rgb(121 116 116)"
|
2025-05-07 16:06:02 +08:00
|
|
|
|
size="20" />
|
2025-04-29 16:36:51 +08:00
|
|
|
|
</label>
|
|
|
|
|
|
<label style="padding-left: 10px;" @click="delSite(item)">
|
|
|
|
|
|
<uni-icons custom-prefix="iconfont" type="icon-ebikeshanchu" color="rgb(121 116 116)"
|
2025-05-07 16:06:02 +08:00
|
|
|
|
size="20" />
|
2025-04-29 16:36:51 +08:00
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divListItem">
|
|
|
|
|
|
<div class="divListItemTitle">站点级别</div>
|
|
|
|
|
|
<div class="divListItemValue" style="color: red;">{{item.zdjb}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divListItem">
|
|
|
|
|
|
<div class="divListItemTitle">创建时间</div>
|
|
|
|
|
|
<div class="divListItemValue">{{item.cjsj}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divListItem">
|
|
|
|
|
|
<div class="divListItemTitle">车辆数量</div>
|
|
|
|
|
|
<div class="divListItemValue">{{item.clsl1}}/{{item.clsl2}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divListItem">
|
|
|
|
|
|
<div class="divListItemTitle">租/还车辆数</div>
|
|
|
|
|
|
<div class="divListItemValue">{{item.zcsl}}/{{item.hcsl}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divListItem">
|
|
|
|
|
|
<div class="divListItemTitle">创建地点</div>
|
|
|
|
|
|
<div class="divListItemValue" style="line-height: 18px;">{{item.cjdd}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divListItem">
|
|
|
|
|
|
<div class="divListItemTitle">创建人</div>
|
|
|
|
|
|
<div class="divListItemValue">{{item.cjr}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</uni-card>
|
2025-05-07 16:06:02 +08:00
|
|
|
|
<div v-if="arrData.length==0" class="divNoData">
|
|
|
|
|
|
暂无数据
|
|
|
|
|
|
</div>
|
2025-04-29 16:36:51 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-05-13 09:22:55 +08:00
|
|
|
|
</z-paging>
|
|
|
|
|
|
<div style="position:fixed;bottom:30px;right: 15px;z-index: 100;" @click="addSite">
|
|
|
|
|
|
<uni-icons type="plus" color="#7a6d6d" size="40" />
|
|
|
|
|
|
</div>
|
2025-04-29 16:36:51 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import {
|
2025-05-16 15:21:08 +08:00
|
|
|
|
ref,
|
|
|
|
|
|
onMounted,
|
2025-05-07 16:06:02 +08:00
|
|
|
|
onUnmounted
|
2025-04-29 16:36:51 +08:00
|
|
|
|
} from 'vue';
|
|
|
|
|
|
import {
|
|
|
|
|
|
showModelMessage
|
|
|
|
|
|
} from "@/utils/tools.js";
|
2025-05-07 16:06:02 +08:00
|
|
|
|
import {
|
|
|
|
|
|
useSelarea
|
|
|
|
|
|
} from "@/stores/selarea.js";
|
|
|
|
|
|
import {
|
|
|
|
|
|
onShow
|
|
|
|
|
|
} from "@dcloudio/uni-app";
|
|
|
|
|
|
import {
|
|
|
|
|
|
callOperateApi
|
|
|
|
|
|
} from '../../../utils/api';
|
2025-05-13 09:22:55 +08:00
|
|
|
|
import {
|
|
|
|
|
|
cloneDeep
|
|
|
|
|
|
} from 'lodash';
|
2025-04-29 16:36:51 +08:00
|
|
|
|
|
|
|
|
|
|
const arrSearch = ["实时车辆", "借车订单量", "还车订单量"]
|
|
|
|
|
|
const iconColor = " #BDBDBD";
|
|
|
|
|
|
const iconColorSel = "#000";
|
|
|
|
|
|
const searchIndex = ref(null);
|
|
|
|
|
|
const searchType = ref("");
|
2025-05-13 09:22:55 +08:00
|
|
|
|
const paging = ref(null);
|
2025-04-29 16:36:51 +08:00
|
|
|
|
//数据
|
2025-05-07 16:06:02 +08:00
|
|
|
|
const arrData = ref([]);
|
2025-04-29 16:36:51 +08:00
|
|
|
|
|
|
|
|
|
|
const showBtn = ref(false); //显示按钮
|
|
|
|
|
|
const btnContent = [{
|
|
|
|
|
|
text: '编辑',
|
|
|
|
|
|
active: false
|
|
|
|
|
|
}, {
|
|
|
|
|
|
text: '删除',
|
|
|
|
|
|
active: false
|
|
|
|
|
|
}];
|
2025-05-07 16:06:02 +08:00
|
|
|
|
const selAreaStore = useSelarea();
|
|
|
|
|
|
let zoneId = null;
|
2025-05-13 09:22:55 +08:00
|
|
|
|
let selData = null;
|
|
|
|
|
|
let loadType = "";
|
2025-05-09 09:21:05 +08:00
|
|
|
|
let siteName = ref(""); //查询条件
|
2025-05-16 15:21:08 +08:00
|
|
|
|
let pageNum = 5;
|
2025-05-13 09:22:55 +08:00
|
|
|
|
|
|
|
|
|
|
function query(pageNo, pageSize) {
|
2025-05-16 15:21:08 +08:00
|
|
|
|
let params = {
|
2025-05-13 09:22:55 +08:00
|
|
|
|
zoneId,
|
|
|
|
|
|
pageNum: pageNo.toString(),
|
2025-05-16 15:21:08 +08:00
|
|
|
|
pageSize: pageSize.toString(),
|
2025-05-13 09:22:55 +08:00
|
|
|
|
siteName: siteName.value
|
|
|
|
|
|
}
|
2025-05-16 15:21:08 +08:00
|
|
|
|
if(searchIndex.value==0){
|
|
|
|
|
|
showModelMessage("该功能暂未实现!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
else{
|
|
|
|
|
|
const lx=searchType.value;
|
|
|
|
|
|
switch(searchIndex.value){
|
|
|
|
|
|
case "1":
|
|
|
|
|
|
if(lx=="up"){
|
|
|
|
|
|
params={...params,borrowingSort: 1}
|
|
|
|
|
|
}
|
|
|
|
|
|
else{
|
|
|
|
|
|
params={...params,borrowingSort: 2}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "2":
|
|
|
|
|
|
if(lx=="up"){
|
|
|
|
|
|
params={...params,returnOrder: 1}
|
|
|
|
|
|
}
|
|
|
|
|
|
else{
|
|
|
|
|
|
params={...params,returnOrder: 2}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
|
title:"加载中"
|
|
|
|
|
|
})
|
2025-05-13 09:22:55 +08:00
|
|
|
|
callOperateApi("ebikeRegion/pageSite", params, "get").then(res => {
|
|
|
|
|
|
const {
|
|
|
|
|
|
code,
|
|
|
|
|
|
data,
|
|
|
|
|
|
message
|
|
|
|
|
|
} = res;
|
|
|
|
|
|
if (code != 200) {
|
2025-05-16 15:21:08 +08:00
|
|
|
|
uni.hideLoading();
|
2025-05-13 09:22:55 +08:00
|
|
|
|
console.log("ebikeRegion/pageSite错误", message);
|
|
|
|
|
|
paging.value.complete(false);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
const {
|
|
|
|
|
|
records
|
|
|
|
|
|
} = data;
|
2025-05-16 15:21:08 +08:00
|
|
|
|
|
2025-05-13 09:22:55 +08:00
|
|
|
|
const arrNewData = [];
|
|
|
|
|
|
records.map((item, index) => {
|
|
|
|
|
|
const {
|
|
|
|
|
|
siteRegionId,
|
|
|
|
|
|
siteName,
|
|
|
|
|
|
createdTime,
|
|
|
|
|
|
allowedParkingNum,
|
|
|
|
|
|
siteAdress,
|
|
|
|
|
|
levelName,
|
2025-05-16 15:21:08 +08:00
|
|
|
|
siteTypeName,
|
|
|
|
|
|
borrowingOrder,
|
|
|
|
|
|
returnOrder
|
2025-05-13 09:22:55 +08:00
|
|
|
|
} = item;
|
|
|
|
|
|
const sindex = (pageNo - 1) * pageSize + index;
|
|
|
|
|
|
const newdata = {
|
|
|
|
|
|
id: siteRegionId,
|
2025-05-16 15:21:08 +08:00
|
|
|
|
zdlx: (siteTypeName && siteTypeName.length > 0) ? siteTypeName.substring(0, 1) :"", //站点类型
|
2025-05-13 09:22:55 +08:00
|
|
|
|
zdmc: siteName, //站点名称
|
|
|
|
|
|
zdjb: levelName, //站点级别
|
|
|
|
|
|
cjsj: createdTime, //创建时间
|
|
|
|
|
|
clsl1: 0, //车辆数量
|
|
|
|
|
|
clsl2: allowedParkingNum, //限制车辆数量
|
2025-05-16 15:21:08 +08:00
|
|
|
|
zcsl: borrowingOrder, //租车数量
|
|
|
|
|
|
hcsl: returnOrder, //还车数量
|
2025-05-13 09:22:55 +08:00
|
|
|
|
cjdd: siteAdress, //创建地点
|
|
|
|
|
|
cjr: "创建人", //创建人
|
|
|
|
|
|
pageNum,
|
|
|
|
|
|
index: sindex
|
|
|
|
|
|
}
|
|
|
|
|
|
arrNewData[index] = newdata;
|
|
|
|
|
|
});
|
|
|
|
|
|
paging.value.complete(arrNewData);
|
2025-05-16 15:21:08 +08:00
|
|
|
|
uni.hideLoading();
|
2025-05-13 09:22:55 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
2025-05-07 16:06:02 +08:00
|
|
|
|
|
2025-04-29 16:36:51 +08:00
|
|
|
|
function search(e) {
|
2025-05-13 09:22:55 +08:00
|
|
|
|
paging.value.reload();
|
2025-05-16 15:21:08 +08:00
|
|
|
|
searchIndex.value=null;
|
|
|
|
|
|
searchType.value=null;
|
2025-04-29 16:36:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//排序
|
|
|
|
|
|
function changerOrder(index) {
|
2025-05-07 16:06:02 +08:00
|
|
|
|
if (searchIndex.value == index && searchType.value == "up") {
|
2025-04-29 16:36:51 +08:00
|
|
|
|
searchType.value = "down";
|
2025-05-07 16:06:02 +08:00
|
|
|
|
|
|
|
|
|
|
} else {
|
2025-04-29 16:36:51 +08:00
|
|
|
|
searchType.value = "up";
|
|
|
|
|
|
}
|
2025-05-07 16:06:02 +08:00
|
|
|
|
searchIndex.value = index;
|
2025-05-16 15:21:08 +08:00
|
|
|
|
paging.value.reload();
|
2025-04-29 16:36:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-07 16:06:02 +08:00
|
|
|
|
function openMap() {
|
2025-04-29 16:36:51 +08:00
|
|
|
|
uni.navigateTo({
|
2025-05-07 16:06:02 +08:00
|
|
|
|
url: "/pages/map/map-bikesite?type=view"
|
2025-04-29 16:36:51 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//添加站点
|
|
|
|
|
|
function addSite() {
|
|
|
|
|
|
uni.navigateTo({
|
2025-05-07 16:06:02 +08:00
|
|
|
|
url: "/pages/map/map-bikesite?type=add&k=" + Date.now()
|
2025-04-29 16:36:51 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//编辑
|
|
|
|
|
|
function editSite(data) {
|
2025-05-07 16:06:02 +08:00
|
|
|
|
const {
|
|
|
|
|
|
id,
|
|
|
|
|
|
radius
|
|
|
|
|
|
} = data;
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
url: `/pages/devops/bikesite/bikesite-info?type=edit&id=${id}&k=${Date.now()}`
|
2025-04-29 16:36:51 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-13 09:22:55 +08:00
|
|
|
|
function delSite(obj) {
|
|
|
|
|
|
const {
|
|
|
|
|
|
id,
|
|
|
|
|
|
pageNum: pn,
|
|
|
|
|
|
index,
|
|
|
|
|
|
zdmc
|
|
|
|
|
|
} = obj;
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
ids: [id]
|
2025-05-07 16:06:02 +08:00
|
|
|
|
}
|
2025-05-13 09:22:55 +08:00
|
|
|
|
|
|
|
|
|
|
showModelMessage(`确认删除站点:${zdmc}?`, null, true).then((res) => {
|
|
|
|
|
|
const {
|
|
|
|
|
|
cancel,
|
|
|
|
|
|
confirm
|
|
|
|
|
|
} = res;
|
|
|
|
|
|
if (cancel) return;
|
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
|
title: '加载中'
|
|
|
|
|
|
})
|
|
|
|
|
|
callOperateApi("ebikeRegion/delSite", params, "post").then(res => {
|
2025-05-09 09:21:05 +08:00
|
|
|
|
console.log("11111111111111111111111", "ebikeRegion/delSite", res);
|
|
|
|
|
|
const {
|
|
|
|
|
|
code,
|
|
|
|
|
|
data,
|
|
|
|
|
|
message
|
|
|
|
|
|
} = res;
|
|
|
|
|
|
if (code != 200) {
|
2025-05-13 09:22:55 +08:00
|
|
|
|
uni.hideLoading();
|
2025-05-09 09:21:05 +08:00
|
|
|
|
showModelMessage("删除失败!");
|
|
|
|
|
|
console.log("ebikeRegion/delSite错误", message)
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2025-05-13 09:22:55 +08:00
|
|
|
|
// selData = obj;
|
|
|
|
|
|
// loadType = "del";
|
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
|
showModelMessage("删除成功!");
|
|
|
|
|
|
paging.value.reload();
|
2025-05-09 09:21:05 +08:00
|
|
|
|
})
|
2025-05-07 16:06:02 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-16 15:21:08 +08:00
|
|
|
|
|
2025-05-13 09:22:55 +08:00
|
|
|
|
|
2025-05-07 16:06:02 +08:00
|
|
|
|
onShow(() => {
|
|
|
|
|
|
zoneId = selAreaStore.value;
|
2025-05-16 15:21:08 +08:00
|
|
|
|
if (paging && paging.value) paging.value.refresh();
|
2025-05-13 09:22:55 +08:00
|
|
|
|
// loadData(pageNum);
|
2025-04-29 16:36:51 +08:00
|
|
|
|
});
|
2025-05-07 16:06:02 +08:00
|
|
|
|
|
2025-04-29 16:36:51 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
@import url("bikesite-list.css");
|
|
|
|
|
|
</style>
|