|
@@ -11,6 +11,24 @@
|
|
|
<el-button type="primary"
|
|
|
@click="getData">刷新
|
|
|
</el-button>
|
|
|
+ <el-dropdown trigger="click" @command="excel2data">
|
|
|
+ <el-button type="success" style="margin-left: 10px">导入/导出
|
|
|
+ <Icon style="color: #ffffff;margin-left: 5px;font-size: 16px" name="el-icon-ArrowDown" />
|
|
|
+ </el-button>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item command="下载模板">
|
|
|
+ <el-button type="warning">下载模板</el-button>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item command="导入数据">
|
|
|
+ <el-button type="primary">导入数据</el-button>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item command="导出数据">
|
|
|
+ <el-button type="primary">导出数据</el-button>
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-input v-model="quickSearch" placeholder="通过车位编号模糊检索" @change="getData" clearable></el-input>
|
|
@@ -126,6 +144,7 @@
|
|
|
<editDialog ref="editDialogRef" @close="getData"></editDialog>
|
|
|
<markDialog ref="parkingMapRef" @close="getData"></markDialog>
|
|
|
<detailDialog ref="detailDialogRef"></detailDialog>
|
|
|
+ <readExcel ref="readExcelRef"></readExcel>
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
@@ -136,9 +155,10 @@ import { auth } from "/@/utils/common";
|
|
|
import request from "/@/api/request";
|
|
|
import { building_list, buildingTree, community_list, district_list, parking } from "/@/api/controllerUrls";
|
|
|
import { computed, onMounted, ref } from "vue";
|
|
|
-import editDialog from "./editDialog.vue";
|
|
|
-import markDialog from "./markDialog.vue";
|
|
|
-import detailDialog from "./detailDialog.vue";
|
|
|
+import editDialog from "./component/editDialog.vue";
|
|
|
+import markDialog from "./component/markDialog.vue";
|
|
|
+import detailDialog from "./component/detailDialog.vue";
|
|
|
+import readExcel from "./excel/readExcel.vue"
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
@@ -152,6 +172,7 @@ let districtId = ref("");
|
|
|
let editDialogRef = ref();
|
|
|
let parkingMapRef = ref();
|
|
|
let detailDialogRef = ref();
|
|
|
+let readExcelRef = ref();
|
|
|
|
|
|
let quickSearch = ref("");
|
|
|
|
|
@@ -172,48 +193,10 @@ function getDistrictList() {
|
|
|
|
|
|
let communityId = ref("");
|
|
|
|
|
|
-//小区列表
|
|
|
-let communityList = ref([]);
|
|
|
-
|
|
|
-//选择区县,获取小区列表
|
|
|
-function selectDstrict(event: any) {
|
|
|
- request.index(community_list, {
|
|
|
- districtIds: event
|
|
|
- }, "").then((res: any) => {
|
|
|
- if (res.code == 1) {
|
|
|
- communityList.value = res.data;
|
|
|
- communityId.value = "";
|
|
|
- buildingId.value = "";
|
|
|
- getData();
|
|
|
- }
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
let buildingId = ref("");
|
|
|
-//楼号列表
|
|
|
-let buildingList = ref([]);
|
|
|
-
|
|
|
-//选择小区,获取楼号列表
|
|
|
-function selectCommunity(event: any) {
|
|
|
- request.index(building_list, {
|
|
|
- communityIds: event
|
|
|
- }, "").then((res: any) => {
|
|
|
- if (res.code == 1) {
|
|
|
- buildingList.value = res.data;
|
|
|
- buildingId.value = "";
|
|
|
- getData();
|
|
|
- }
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
let parkingData = ref([]);
|
|
|
|
|
|
-function selectBuilding() {
|
|
|
- getData();
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
//树相关
|
|
|
let treeData = ref([]);
|
|
@@ -248,15 +231,6 @@ function treeNodeClick(node: any, data: any) {
|
|
|
getData();
|
|
|
}
|
|
|
|
|
|
-let defaultExpanded = computed(() => {
|
|
|
- let res = [];
|
|
|
- for (let row of treeData.value) {
|
|
|
- res.push(row.id);
|
|
|
- }
|
|
|
- return res;
|
|
|
-});
|
|
|
-
|
|
|
-
|
|
|
function getData() {
|
|
|
request.index(parking, {
|
|
|
districtId: districtId.value,
|
|
@@ -290,6 +264,19 @@ function deleteRow(row: any) {
|
|
|
}
|
|
|
|
|
|
|
|
|
+function excel2data(e: string) {
|
|
|
+ if (e === "下载模板") {
|
|
|
+
|
|
|
+ } else if (e === "导入数据") {
|
|
|
+ readExcelRef.value.open()
|
|
|
+ } else if (e === "导出数据") {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
|