index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  1. <template>
  2. <div class="column">
  3. <div class="row" style="justify-content: center">
  4. <div class="content-left">
  5. <div class="left0">
  6. <div class="left">
  7. <div class="scroll-left">
  8. <el-scrollbar
  9. v-loading="loading"
  10. >
  11. <div
  12. style="cursor: pointer"
  13. @click="clickBuildItem(item)"
  14. v-for="(item, index) in buildingList"
  15. :key="index"
  16. :style="{
  17. backgroundColor: item.select ? systemTheme : '#e9f1f6',
  18. width: item.select ? '140px' : '140px'
  19. }"
  20. :class="{ 'building-item-s': item.select, 'building-item': !item.select }"
  21. >
  22. <img v-if="item.select" src="@/assets/imgs/bed1.png" style="width: 16px; height: 16px" alt=""/>
  23. <img v-if="!item.select" src="@/assets/imgs/bed2.png" style="width: 16px; height: 16px" alt=""/>
  24. <el-text style="font-size: 15px;margin-left: 4px;width: 80px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
  25. :style="{ color: item.select ? '#ffffff' : '#2A2F42' }">{{ item.buildName }}</el-text>
  26. <img @click.stop="addBuilding(item.id || 0, true)" src="@/assets/imgs/bad5.png"
  27. v-if="item.select" style="width: 20px; height: 20px" class="ml-5px" alt=""/>
  28. </div>
  29. </el-scrollbar>
  30. </div>
  31. <div
  32. v-hasPermi="['bedSetting:addBuild']"
  33. @click="addBuilding(undefined)"
  34. class="row buttonL mt-4px"
  35. >
  36. <img src="@/assets/imgs/bed3.png" style="width: 18px; height: 18px" alt="" />
  37. <span>添加楼栋</span>
  38. </div>
  39. <div @click="importBed" v-hasPermi="['bedSetting:importBuild']" class="row buttonL mt-12px">
  40. <img src="@/assets/imgs/bed4.png" style="width: 18px; height: 18px" alt="" />
  41. <span>导入床位</span>
  42. </div>
  43. </div>
  44. <div>
  45. </div>
  46. <div class="right">
  47. <el-scrollbar
  48. v-loading="loadingF"
  49. height="72vh"
  50. wrap-style="padding-left:20px;margin-right: 20px;"
  51. >
  52. <div style="padding-top: 12px">
  53. <div
  54. @click="clickFloorItem(item)"
  55. v-for="(item, index) in buildListTemp.floorList"
  56. :key="index"
  57. :class="{ 'floor-item-s': item.select, 'floor-item': !item.select }"
  58. :style="{ backgroundColor: item.select ? systemTheme : '#ffffff' }"
  59. >
  60. <el-text
  61. style="
  62. font-size: 15px;
  63. white-space: nowrap;
  64. overflow: hidden;
  65. text-overflow: ellipsis;
  66. width: 86px;
  67. text-align: center;
  68. "
  69. :style="{ color: item.select ? '#fff' : '#2A2F42' }"
  70. >{{ item.floorName }}</el-text
  71. >
  72. </div>
  73. </div>
  74. </el-scrollbar>
  75. </div>
  76. </div>
  77. <div class="bar">
  78. <TenantSelect v-model="queryParams.tenantIds" single @change="handleChange"/>
  79. </div>
  80. </div>
  81. <div v-show="!isFullscreen" class="rightCard" style="width: 100%">
  82. <el-row style="margin-bottom: 6px;width: 100%">
  83. <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="18">
  84. <div style=" display: flex;align-items: center;flex-direction: row;height: 52px;margin-left: 0.4vw;">
  85. <div
  86. class="row"
  87. :style="{ backgroundColor: systemTheme }"
  88. style="border-radius: 14px 6px 14px 6px;padding: 0 16px;height: 36px;align-items: center; justify-content: center;"
  89. >
  90. <span style="font-size: 16px" :style="{ color: '#ffffff' }">{{buildListTemp.floorCount }}</span>
  91. <span style="color: #fff; font-size: 16px">层</span>
  92. </div>
  93. <el-text style="color: #2a2f42; font-size: 16px; margin-left: 20px">总房间数:</el-text>
  94. <el-text style="font-size: 16px; margin-left: 5px" :style="{ color: systemTheme }">{{resultRoom.totalRoomCount}}</el-text>
  95. <el-text style="color: #2a2f42; font-size: 16px; margin-left: 20px">托养用房数:</el-text>
  96. <el-text style="font-size: 16px; margin-left: 5px" :style="{ color: systemTheme }">{{resultRoom.daycareRoomCount}}</el-text>
  97. <el-text style="color: #2a2f42; font-size: 16px; margin-left: 20px">床位数:</el-text>
  98. <el-text style="font-size: 16px; margin-left: 5px" :style="{ color: systemTheme }">{{resultRoom.totalBedCount}}</el-text>
  99. <el-text style="color: #2a2f42; font-size: 16px; margin-left: 20px">活动室数:</el-text>
  100. <el-text style="font-size: 16px; margin-left: 5px" :style="{ color: systemTheme }">{{resultRoom.activityRoomCount}}</el-text>
  101. </div>
  102. </el-col>
  103. <el-col :xs="24" :sm="24" :md="6" :lg="6" :xl="6" style="width: 100%">
  104. <div style="display: flex;align-items: center;flex-direction: row;justify-content: end;width: 100%;padding-right: 1vw">
  105. <el-button
  106. v-hasPermi="['bed-setting:add-room']"
  107. @click="addRoom"
  108. class="addButton"
  109. >
  110. <template #default>
  111. <el-icon :color="systemTheme"><Briefcase /></el-icon>
  112. <span style="font-size: 15px; margin-left: 4px; color: #605be2" :style="{ color: systemTheme }">添加</span>
  113. </template>
  114. </el-button>
  115. <el-dropdown>
  116. <el-button
  117. type="primary"
  118. v-hasPermi="['bed-setting:export-room']"
  119. @click="exportRoom"
  120. class="addButton2"
  121. style="margin-left: 20px"
  122. >
  123. <template #default>
  124. <img src="@/assets/imgs/bed6.png" style="width: 18px; height: 18px" alt="" />
  125. <span style="font-size: 15px; margin-left: 4px; color: #ffffff">导出</span>
  126. </template>
  127. </el-button>
  128. <template #dropdown>
  129. <el-dropdown-menu>
  130. <el-dropdown-item @click="exportExp(1)">导出门口屏</el-dropdown-item>
  131. <el-dropdown-item @click="exportExp(2)">导出二维码</el-dropdown-item>
  132. </el-dropdown-menu>
  133. </template>
  134. </el-dropdown>
  135. </div>
  136. </el-col>
  137. </el-row>
  138. <el-scrollbar v-if="roomList.length > 0" height="78vh" style="margin-left: 0.4vw">
  139. <Flex wrap="wrap" :gap="16" style="padding-bottom: 36px">
  140. <div style="position: relative" v-for="(item, index) in roomList" :key="index">
  141. <!-- @mouseover="item.showOverlay=true" @mouseleave="item.showOverlay=false">-->
  142. <div style="position: relative" class="roomBoxItem">
  143. <div class="roomBoxItem" style="position: absolute">
  144. <div style="display: flex;align-items: center;flex-direction: row;padding-right: 10px;">
  145. <div class="floor-text-left" :style="{ backgroundColor: systemTheme }">{{item.roomName}}</div>
  146. <div style="flex-grow: 1"></div>
  147. <img v-show="isShowIcon(item, '女')" src="@/assets/imgs/bed10.png" style="width: 20px; height: 20px; margin-left: 4px"/>
  148. <img v-show="isShowIcon(item, '男')" src="@/assets/imgs/bed9.png" style="width: 20px; height: 20px"/>
  149. <img v-show="isShowIcon(item, '卫生间')" src="@/assets/imgs/bed8.png" style="width: 20px; height: 20px; margin-left: 3px"/>
  150. </div>
  151. <div v-if="item.roomUsage === '1'" style="margin-top: 10px; overflow: hidden">
  152. <Flex wrap="wrap" :gap="8" style="margin-left: 10px">
  153. <div class="roomBoxItemSon" v-for="(itemB, indexB) in item.bedList" :key="indexB">
  154. <img src="@/assets/imgs/chuangwei.png" />
  155. <span :style="{ color: systemTheme }">{{ itemB.bedName }}</span>
  156. </div>
  157. </Flex>
  158. </div>
  159. <div v-else style="width: 278px; height: 234px; justify-content: center" class="row">
  160. <img v-show="item.coverImage === 'bed12.png'" src="@/assets/imgs/bed12.png" style="width: 250px; height: 170px; margin-top: 6px"/>
  161. <img v-show="item.coverImage === 'bed11.png'" src="@/assets/imgs/bed11.png" style="width: 250px; height: 170px; margin-top: 6px"/>
  162. </div>
  163. <div style="height: 10px"></div>
  164. </div>
  165. <div :style="{ backgroundColor: systemTheme }" style="width: 2px;border-radius: 2px;height: 200px;position: absolute;margin-top: 22px;"></div>
  166. </div>
  167. <div class="overlay">
  168. <div
  169. @click="deleteCK(item)"
  170. style="padding: 10px;background-color: white;border-radius: 10px;cursor: pointer;">
  171. <img src="@/assets/imgs/shanchu.png" style="width: 22px; height: 22px" alt="" />
  172. </div>
  173. <div
  174. @click="editCK(item)"
  175. style="padding: 10px;background-color: white;border-radius: 10px;margin-left: 16px;cursor: pointer;">
  176. <img src="@/assets/imgs/bianji.png" style="width: 22px; height: 22px" alt="" />
  177. </div>
  178. </div>
  179. </div>
  180. </Flex>
  181. <div style="height: 12px"></div>
  182. </el-scrollbar>
  183. <el-empty v-else style="height: 58vh" :image-size="80" description="暂无数据" />
  184. <div style="height: 10px"></div>
  185. </div>
  186. </div>
  187. <div v-show="isFullscreen" class="rightCard" style="width: 92%; margin-top: 2vh">
  188. <el-row style="margin-bottom: 6px">
  189. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  190. <div style=" display: flex;align-items: center;flex-direction: row;height: 52px;margin-left: 0.4vw;">
  191. <div class="row" :style="{ backgroundColor: systemTheme }" style="border-radius: 14px 6px 14px 6px;padding: 0 16px;height: 36px;align-items: center;justify-content: center;">
  192. <span style="font-size: 16px" :style="{ color: '#ffffff' }">{{buildListTemp.floorCount}}</span>
  193. <span style="color: #fff; font-size: 16px">层</span>
  194. </div>
  195. <el-text style="color: #2a2f42; font-size: 16px; margin-left: 20px">总房间数:</el-text>
  196. <el-text style="font-size: 16px; margin-left: 5px" :style="{ color: systemTheme }">{{resultRoom.totalRoomCount}}</el-text>
  197. <el-text style="color: #2a2f42; font-size: 16px; margin-left: 20px">托养用房数:</el-text>
  198. <el-text style="font-size: 16px; margin-left: 5px" :style="{ color: systemTheme }">{{resultRoom.daycareRoomCount }}</el-text>
  199. </div>
  200. </el-col>
  201. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  202. <div style="display: flex;align-items: center;flex-direction: row;height: 52px;margin-left: 0.4vw;">
  203. <div class="row" style="border-radius: 14px 6px 14px 6px;padding: 0 16px;height: 36px;align-items: center;justify-content: center;">
  204. <span style="font-size: 16px" :style="{ color: '#ffffff00' }">2</span>
  205. <span style="color: #ffff0000; font-size: 16px">层</span>
  206. </div>
  207. <el-text style="color: #2a2f42; font-size: 16px; margin-left: 20px">床位数:</el-text>
  208. <el-text style="font-size: 16px; margin-left: 5px" :style="{ color: systemTheme }">{{resultRoom.totalBedCount }}</el-text>
  209. <el-text style="color: #2a2f42; font-size: 16px; margin-left: 20px">活动室数:</el-text>
  210. <el-text style="font-size: 16px; margin-left: 5px" :style="{ color: systemTheme }">{{resultRoom.activityRoomCount}}</el-text>
  211. </div>
  212. </el-col>
  213. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  214. <div style="display: flex;align-items: center;flex-direction: row;justify-content: start;width: 90%;">
  215. <el-button
  216. v-hasPermi="['bed-setting:add-room']"
  217. @click="addRoom"
  218. class="addButton"
  219. >
  220. <template #default>
  221. <el-icon :color="systemTheme"><Briefcase /></el-icon>
  222. <span style="font-size: 15px; margin-left: 4px; color: #605be2" :style="{ color: systemTheme }">添加</span>
  223. </template>
  224. </el-button>
  225. <el-dropdown>
  226. <el-button
  227. type="primary"
  228. v-hasPermi="['bed-setting:export-room']"
  229. @click="exportRoom"
  230. class="addButton2"
  231. style="margin-left: 20px"
  232. >
  233. <template #default>
  234. <img src="@/assets/imgs/bed6.png" style="width: 18px; height: 18px" alt="" />
  235. <span style="font-size: 15px; margin-left: 4px; color: #ffffff">导出</span>
  236. </template>
  237. </el-button>
  238. <template #dropdown>
  239. <el-dropdown-menu>
  240. <el-dropdown-item @click="exportExp(1)">导出门口屏</el-dropdown-item>
  241. <el-dropdown-item @click="exportExp(2)">导出二维码</el-dropdown-item>
  242. </el-dropdown-menu>
  243. </template>
  244. </el-dropdown>
  245. </div>
  246. </el-col>
  247. </el-row>
  248. <el-scrollbar
  249. v-if="roomList.length > 0"
  250. height="78vh"
  251. style="margin-left: 0.4vw; margin-top: 10px"
  252. >
  253. <Flex wrap="wrap" :gap="16" style="padding-bottom: 36px">
  254. <div style="position: relative" v-for="(item, index) in roomList" :key="index">
  255. <!-- @mouseover="item.showOverlay=true" @mouseleave="item.showOverlay=false">-->
  256. <div style="position: relative" class="roomBoxItem">
  257. <div class="roomBoxItem" style="position: absolute">
  258. <div style="display: flex;align-items: center;flex-direction: row;padding-right: 10px;">
  259. <div class="floor-text-left" :style="{ backgroundColor: systemTheme }">{{item.roomName}}</div>
  260. <div style="flex-grow: 1"></div>
  261. <img v-show="isShowIcon(item, '女')" src="@/assets/imgs/bed10.png" style="width: 20px; height: 20px; margin-left: 4px" alt=""/>
  262. <img v-show="isShowIcon(item, '男')" src="@/assets/imgs/bed9.png" style="width: 20px; height: 20px" alt=""/>
  263. <img v-show="isShowIcon(item, '卫生间')" src="@/assets/imgs/bed8.png" style="width: 20px; height: 20px; margin-left: 3px" alt=""/>
  264. </div>
  265. <div v-if="item.roomUsage === '1'" style="margin-top: 10px; overflow: hidden">
  266. <Flex wrap="wrap" :gap="8" style="margin-left: 10px">
  267. <div class="roomBoxItemSon" v-for="(itemB, indexB) in item.bedList" :key="indexB">
  268. <img src="@/assets/imgs/chuangwei.png" alt=""/>
  269. <span :style="{ color: systemTheme }">
  270. {{ itemB.bedName }}
  271. </span>
  272. </div>
  273. </Flex>
  274. </div>
  275. <div v-else style="width: 278px; height: 234px; justify-content: center" class="row">
  276. <img v-show="item.coverImage === 'bed12.png'" src="@/assets/imgs/bed12.png" style="width: 250px; height: 170px; margin-top: 6px" alt=""/>
  277. <img v-show="item.coverImage === 'bed11.png'" src="@/assets/imgs/bed11.png" style="width: 250px; height: 170px; margin-top: 6px" alt=""/>
  278. </div>
  279. <div style="height: 10px"></div>
  280. </div>
  281. <div :style="{ backgroundColor: systemTheme }" style="width: 2px;border-radius: 2px;height: 200px;position: absolute;margin-top: 22px;"></div>
  282. </div>
  283. <div class="overlay">
  284. <div @click="deleteCK(item)" style="padding: 10px; background-color: white; border-radius: 10px; cursor: pointer">
  285. <img src="@/assets/imgs/shanchu.png" style="width: 22px; height: 22px" alt="" />
  286. </div>
  287. <div @click="editCK(item)" style="padding: 10px;background-color: white;border-radius: 10px;margin-left: 16px;cursor: pointer;">
  288. <img src="@/assets/imgs/bianji.png" style="width: 22px; height: 22px" alt="" />
  289. </div>
  290. </div>
  291. </div>
  292. </Flex>
  293. <div style="height: 12px"></div>
  294. </el-scrollbar>
  295. <el-empty v-else style="height: 58vh" :image-size="80" description="暂无数据" />
  296. <div style="height: 10px"></div>
  297. </div>
  298. <Form ref="formRefAddBuild" @success="getList" />
  299. <RoomForm ref="roomFormRefAddBuild" @success="successAddBuildRoom" />
  300. <Import
  301. ref="importRef"
  302. @success="getList"
  303. :config="{
  304. title: '导入',
  305. downloadUrl: 'build/downloadExcel',
  306. excelTempName: '房源配置-[导入床位]模板',
  307. importUrl: '/build/importBuildExcel',
  308. failExportUrl: ''
  309. }"
  310. />
  311. </div>
  312. </template>
  313. <script setup lang="ts">
  314. import { Flex } from 'ant-design-vue'
  315. import { UploadFilled, CirclePlus, OfficeBuilding, Edit, Briefcase } from '@element-plus/icons-vue'
  316. import Form from '@/views/system/bedManage/bedSetting/Form.vue'
  317. import RoomForm from '@/views/system/bedManage/bedSetting/RoomForm.vue'
  318. import {
  319. deleteRoom,
  320. getBuildList,
  321. getRoom,
  322. buildStatistic,
  323. exportScreenExcel
  324. } from '@/api/system/badManage'
  325. const message = useMessage() // 消息弹窗
  326. import { useAppStore } from '@/store/modules/app'
  327. import { propTypes } from '@/utils/propTypes'
  328. import { watchArray } from '@vueuse/core'
  329. import { onMounted } from 'vue'
  330. import download from "@/utils/download";
  331. import Import from "@/components/ImportFile/index.vue";
  332. import { useUserStore } from '@/store/modules/user'
  333. const appStore = useAppStore()
  334. const userStore = useUserStore()
  335. const systemTheme = ref(appStore.getTheme.elColorPrimary)
  336. let buildListTemp = ref({}) //当前选中楼栋
  337. let floorListTemp = ref({}) //当前选中楼层
  338. const widthScreen = ref(0)
  339. const heightScreen = ref(0)
  340. const loading = ref(false)
  341. const loadingF = ref(false)
  342. const buildingList = ref([])
  343. const resultRoom = ref({})
  344. const importRef = ref()
  345. const showBottom = ref(false)
  346. const isFullscreen = ref(false)
  347. const queryParams = reactive({
  348. tenantIds: userStore.orgTenantId && userStore.orgTenantId.length ? [userStore.orgTenantId[0]] : []
  349. })
  350. const importBed = () => {
  351. importRef.value.open()
  352. }
  353. //房间
  354. const roomList = ref([])
  355. onUnmounted(() => {
  356. window.removeEventListener('resize', handleResize)
  357. })
  358. const formRefAddBuild = ref()
  359. const roomFormRefAddBuild = ref()
  360. const addRoom = () => {
  361. roomFormRefAddBuild.value.open(queryParams.tenantIds[0], floorListTemp.value.id, undefined, false)
  362. }
  363. const exportRoom = () => {}
  364. watch(
  365. () => appStore.getTheme.elColorPrimary,
  366. (n, e) => {
  367. console.log('颜色改变:', e, n)
  368. systemTheme.value = n
  369. }
  370. )
  371. const addBuilding = (id?: number, isDetail: boolean = false) => {
  372. formRefAddBuild.value.open(queryParams.tenantIds[0], id, isDetail)
  373. }
  374. const successAddBuild = () => {}
  375. const successAddBuildRoom = () => {
  376. getRoomList(floorListTemp.value.id)
  377. }
  378. function clickBuildIcon(item) {
  379. console.log(item)
  380. }
  381. const isShowIcon = (item, type) => {
  382. if (item === undefined) {
  383. return false
  384. } else
  385. return (
  386. item.roomSettings !== undefined &&
  387. item.roomSettings !== null &&
  388. item.roomSettings.indexOf(type) !== -1
  389. )
  390. }
  391. //删除房间
  392. const deleteCK = async (item) => {
  393. console.log('删除', item)
  394. try {
  395. // 二次确认
  396. await message.delConfirm()
  397. const res = await deleteRoom(item.id)
  398. console.log('ssss', res)
  399. if (res) {
  400. message.success('删除成功')
  401. await getRoomList(floorListTemp.value.id)
  402. }
  403. } catch (e) {
  404. //message.error(e)
  405. console.log('取消', item)
  406. }
  407. }
  408. //导出
  409. const exportExp = (item) => {
  410. console.log(item,buildListTemp.value)
  411. if(item===1){
  412. //download.excel()
  413. exportScreenExcel(buildListTemp.value.id).then((res)=>{
  414. download.excel(res, '门口屏.xls')
  415. }).catch((err)=>{})
  416. }
  417. }
  418. function handleResize() {
  419. // 获取当前窗口的宽度
  420. const windowWidth = window.innerWidth
  421. // 在控制台输出窗口宽度
  422. //console.log('新的窗口宽度为2:', windowWidth);
  423. if (windowWidth < widthScreen.value / 2.0) {
  424. isFullscreen.value = true
  425. console.log('新的')
  426. } else {
  427. isFullscreen.value = false
  428. }
  429. // 这里可以添加更多基于窗口宽度的逻辑
  430. }
  431. //编辑房间
  432. const editCK = (item) => {
  433. console.log('编辑', item,floorListTemp.value.id)
  434. roomFormRefAddBuild.value.open(queryParams.tenantIds[0],floorListTemp.value.id, item, true)
  435. }
  436. function clickAllIcon() {
  437. console.log('点击icon')
  438. }
  439. function clickBuildItem(item) {
  440. console.log(item)
  441. floorListTemp.value = {}
  442. roomList.value = []
  443. buildListTemp.value = item
  444. buildListTemp.value.floorList.reverse()
  445. try {
  446. for (const itemElement of item.floorList) {
  447. itemElement.select = false
  448. }
  449. item.floorList[item.floorList.length - 1].select = true
  450. floorListTemp.value = item.floorList[item.floorList.length - 1]
  451. } catch (e) {}
  452. for (let buildingListKey of buildingList.value) {
  453. buildingListKey.select = false
  454. }
  455. item.select = true
  456. if (floorListTemp.value.id != undefined) {
  457. getRoomList(floorListTemp.value.id)
  458. }
  459. buildStatisticFun(item.id)
  460. }
  461. function clickFloorItem(item) {
  462. console.log(item.id)
  463. floorListTemp.value = item
  464. for (let buildingListKey of buildListTemp.value.floorList) {
  465. buildingListKey.select = false
  466. }
  467. item.select = true
  468. getRoomList(item.id)
  469. }
  470. /** 查询列表 */
  471. const getList = async () => {
  472. buildingList.value = []
  473. loading.value = true
  474. try {
  475. const params = {...queryParams}
  476. params.tenantIds = queryParams.tenantIds[0]
  477. const data = await getBuildList(params)
  478. for (const datum of data) {
  479. datum.select = false
  480. buildingList.value.push(datum)
  481. }
  482. if(buildingList.value.length){
  483. buildingList.value[0].select = true
  484. try {
  485. buildListTemp.value = buildingList.value[0]
  486. buildListTemp.value.floorList = buildListTemp.value.floorList.reverse()
  487. for (const itemElement of buildListTemp.value.floorList) {
  488. itemElement.select = false
  489. }
  490. buildListTemp.value.floorList[buildListTemp.value.floorList.length - 1].select = true
  491. floorListTemp.value = buildListTemp.value.floorList[buildListTemp.value.floorList.length - 1]
  492. await getRoomList(buildListTemp.value.floorList[buildListTemp.value.floorList.length - 1].id)
  493. await buildStatisticFun(buildListTemp.value.id)
  494. } catch (e) {}
  495. }
  496. } finally {
  497. loading.value = false
  498. }
  499. }
  500. /** 查询房间 */
  501. const getRoomList = async (id) => {
  502. loadingF.value = true
  503. roomList.value = []
  504. try {
  505. const data = await getRoom({floorId: id})
  506. console.log('查询房间', data, id)
  507. if (data !== undefined && data.length > 0) {
  508. for (const datum of data) {
  509. datum.showOverlay = false
  510. roomList.value.push(datum)
  511. }
  512. }
  513. } catch (e) {
  514. } finally {
  515. loadingF.value = false
  516. }
  517. }
  518. const buildStatisticFun = async (buildId) => {
  519. try {
  520. const res = await buildStatistic(buildId)
  521. console.log('查询统计', res)
  522. resultRoom.value = res
  523. } catch (e) {}
  524. }
  525. const handleChange = (val) => {
  526. buildListTemp.value = []
  527. roomList.value = []
  528. resultRoom.value = {}
  529. queryParams.tenantIds = [val]
  530. getList()
  531. // console.log("ddd", , val)
  532. }
  533. onMounted(() => {
  534. getList()
  535. window.addEventListener('resize', handleResize)
  536. widthScreen.value =
  537. window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
  538. heightScreen.value =
  539. window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
  540. if (widthScreen.value < 860) {
  541. isFullscreen.value = true
  542. }
  543. })
  544. </script>
  545. <style scoped lang="scss">
  546. //.bgView{
  547. // background-image: url('../../../../assets/imgs/allbg.png');
  548. // background-size: 100% 100%;
  549. //
  550. //}
  551. .content-left{
  552. display: flex;
  553. flex-direction: column;
  554. background: linear-gradient(180deg, #f2f6fc 0%, #f2f6fc 100%);
  555. box-shadow:
  556. 2px 2px 2px rgba(255, 255, 255, 0),
  557. -1px -1px 1px rgba(255, 255, 255, 1),
  558. 1px -1px 1px rgba(255, 255, 255, 1),
  559. -2px 2px 2px rgba(255, 255, 255, 0);
  560. height: 81vh;
  561. .left0 {
  562. height: 75vh;
  563. display: flex;
  564. width: 290px;
  565. .left {
  566. flex: 2;
  567. // justify-content: center;
  568. // overflow: hidden;
  569. border-radius: 12px;
  570. margin-top: 15px;
  571. margin-left: 15px;
  572. .scroll-left{
  573. height: 62vh;
  574. }
  575. }
  576. .right{
  577. flex: 1;
  578. }
  579. //box-shadow: 2px 2px 2px rgba(255, 255, 255, 0),
  580. //-1px -1px 1px rgba(255, 255, 255, 0.5),
  581. //1px -1px 1px rgba(255, 255, 255, 0.5),
  582. //-2px 2px 2px rgba(255, 255, 255, 0);
  583. // border: 0.2px solid white;
  584. //border-image: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)) 1 1;
  585. }
  586. .bar{
  587. padding: 0 10px;
  588. .el-form-item{
  589. margin-bottom: 0 !important;
  590. }
  591. }
  592. }
  593. .row {
  594. display: flex;
  595. align-items: center;
  596. flex-direction: row;
  597. }
  598. .column {
  599. display: flex;
  600. flex-direction: column;
  601. }
  602. .building-item {
  603. align-items: center;
  604. width: 160px;
  605. display: flex;
  606. flex-direction: row;
  607. margin: 0 0 16px 0;
  608. padding: 0 10px;
  609. height: 36px;
  610. border-radius: 10px;
  611. }
  612. .building-item-s {
  613. align-items: center;
  614. display: flex;
  615. width: 160px;
  616. flex-direction: row;
  617. margin: 0 0 16px 0;
  618. padding: 0 10px;
  619. height: 36px;
  620. border-radius: 10px;
  621. }
  622. .building-item:hover {
  623. background-color: #ffffff66 !important;
  624. }
  625. .floor-item {
  626. background-color: #ffffff;
  627. align-items: center;
  628. width: 86px;
  629. height: 57px;
  630. cursor: pointer;
  631. display: flex;
  632. justify-content: center;
  633. flex-direction: row;
  634. margin: 0 0 20px 0;
  635. border-radius: 8px;
  636. }
  637. .floor-item-s {
  638. background-color: #e9edfa;
  639. align-items: center;
  640. display: flex;
  641. justify-content: center;
  642. width: 86px;
  643. height: 57px;
  644. cursor: pointer;
  645. margin: 0 0 20px 0;
  646. flex-direction: row;
  647. border-radius: 8px;
  648. }
  649. .floor-item:hover {
  650. background-color: #ffffffaa !important;
  651. }
  652. .el-button {
  653. margin: 10px 0 0 0;
  654. }
  655. .roomBoxItem {
  656. max-width: 15vw;
  657. min-width: 278px;
  658. height: 234px;
  659. background-color: #ffffff;
  660. border-radius: 8px;
  661. display: flex;
  662. flex-direction: column;
  663. }
  664. .roomBoxItemSon {
  665. width: 124px;
  666. height: 88px;
  667. background-color: #f2f6fc;
  668. border-radius: 4px;
  669. display: flex;
  670. flex-direction: column;
  671. align-items: center;
  672. justify-content: center;
  673. position: relative;
  674. }
  675. .roomBoxItemSon img {
  676. width: 60px;
  677. height: 60px;
  678. position: absolute;
  679. bottom: 0;
  680. right: 0;
  681. margin-right: 10px;
  682. margin-bottom: 10px;
  683. }
  684. .roomBoxItemSon span {
  685. font-size: 14px;
  686. position: absolute;
  687. top: 0;
  688. left: 0;
  689. margin-top: 8px;
  690. margin-left: 8px;
  691. }
  692. .floor-text-left {
  693. padding: 0 10px;
  694. background-color: #768bdf;
  695. border-radius: 11px 8px 18px 8px;
  696. display: flex;
  697. height: 28px;
  698. margin-right: 4px;
  699. align-items: center;
  700. justify-content: center;
  701. color: #fff;
  702. font-size: 13px;
  703. }
  704. .overlay {
  705. position: absolute;
  706. top: 0;
  707. left: 0;
  708. right: 0;
  709. bottom: 0;
  710. background: rgba(0, 0, 0, 0.2); /* 半透明黑色背景 */
  711. color: white;
  712. display: flex;
  713. border-radius: 8px;
  714. flex-direction: row;
  715. align-items: center;
  716. justify-content: center;
  717. opacity: 0;
  718. transition: opacity 0.2s ease;
  719. }
  720. .overlay:hover {
  721. opacity: 1;
  722. }
  723. .rightCard {
  724. flex-grow: 1;
  725. display: flex;
  726. flex-direction: column;
  727. padding-left: 12px;
  728. background-color: #f2f6fc;
  729. border-radius: 12px;
  730. margin-left: 16px;
  731. height: 81vh;
  732. box-shadow:
  733. 2px 2px 2px rgba(255, 255, 255, 0),
  734. -1px -1px 1px rgba(255, 255, 255, 1),
  735. 1px -1px 1px rgba(255, 255, 255, 1),
  736. -2px 2px 2px rgba(255, 255, 255, 0);
  737. }
  738. .addButton {
  739. width: 86px;
  740. height: 38px;
  741. border-radius: 8px;
  742. }
  743. .addButton:hover {
  744. //transform: scale(1.01);
  745. }
  746. .addButton2 {
  747. width: 84px;
  748. height: 36px;
  749. border-radius: 8px;
  750. }
  751. .addButton2:hover {
  752. //transform: scale(1.01);
  753. }
  754. .buttonL {
  755. background-color: white;
  756. border: none;
  757. color: #333333;
  758. border-radius: 10px;
  759. width: 140px;
  760. height: 36px;
  761. justify-content: center;
  762. cursor: pointer;
  763. }
  764. .buttonL:hover {
  765. background-color: #ffffffaa;
  766. }
  767. .buttonL span {
  768. color: #2a2f42;
  769. font-size: 15px;
  770. margin-left: 4px;
  771. line-height: 20px;
  772. }
  773. .el-button:focus {
  774. outline: none !important;
  775. box-shadow: none !important;
  776. }
  777. </style>