index.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202
  1. <!--楼栋管理-->
  2. <template>
  3. <div class="app-container buildingManagement">
  4. <div class="max-left-box">
  5. <div class="tree-box scrollbar-box" v-if="treeList[0]">
  6. <p style="color:#0183FA;font-size:18px;">{{schoolName}}</p>
  7. <div class="terr-max-box" v-for="(item,index) in treeList" :key="index">
  8. <div class="max-name-box">
  9. <p class="max-name" :class="checkTreeId==item.id?'check-color':''" @click="clickCheckTree(item,1)">
  10. {{item.name}}</p>
  11. <el-dropdown @command="(command)=>handleCommand(command,item)" trigger="click">
  12. <span class="iconfont icon-a-gengduo2" style="display:inline-block;cursor:pointer;color:#999;font-size:20px;"></span>
  13. <el-dropdown-menu slot="dropdown">
  14. <el-dropdown-item command="1" v-hasPermiRouter="['system:build:edit']">编辑</el-dropdown-item>
  15. <el-dropdown-item command="2" v-hasPermiRouter="['system:build:del']">删除</el-dropdown-item>
  16. </el-dropdown-menu>
  17. </el-dropdown>
  18. </div>
  19. <div class="terr-big-box" v-for="(itemOne,indexOne) in item.buildFloorVoList" :key="indexOne">
  20. <div class="big-name-box">
  21. <p v-if="!itemOne.buildFloorVoList[0]" style="width:16px;"></p>
  22. <span v-if="!itemOne.onType&&itemOne.buildFloorVoList[0]" @click="terrClick(itemOne)"
  23. class="el-icon-caret-right" style="font-size:20px;margin-right:5px;"></span>
  24. <span v-if="itemOne.onType&&itemOne.buildFloorVoList[0]" @click="terrClick(itemOne)"
  25. class="el-icon-caret-bottom" style="font-size:20px;margin-right:5px;"></span>
  26. <p class="name-p" :class="checkTreeId==itemOne.id?'check-color':''" @click="clickCheckTree(itemOne,2)">
  27. {{itemOne.name}}</p>
  28. </div>
  29. <div v-if="itemOne.onType" class="terr-min-box" v-for="(itemTwo,indexTwo) in itemOne.buildFloorVoList"
  30. :key="indexTwo">
  31. <p class="min-name" :class="checkTreeId==itemTwo.id?'check-color':''"
  32. @click="clickCheckTree(itemTwo,3,itemOne)">{{itemTwo.name}}</p>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <p class="tree-null-p" v-if="!treeList[0]">暂无数据</p>
  38. <p class="max-left-big-button" v-hasPermiRouter="['system:build:add']" @click="handleCommand(3)">新增校区</p>
  39. </div>
  40. <div class="max-right-box">
  41. <div class="school-box" v-if="checkTreeType == 1">
  42. <div class="max-right-button-box">
  43. <p class="null-p"></p>
  44. <p class="max-right-big-button" @click="handleCommand(4)" v-hasPermiRouter="['system:build:add']">新增楼栋</p>
  45. </div>
  46. <div class="right-big-list-box scrollbar-box">
  47. <div class="for-max-box" v-for="(item,index) in buildingList" :key="index"
  48. @dragover.prevent="dragoverPrevent(item)">
  49. <div class="for-big-box">
  50. <div class="for-big-box-left">
  51. <span class="iconfont icon-a-gengduo3" style="cursor: pointer;font-size:44px;color:#d8d8d8;margin:27px 0 0 30px;"
  52. draggable="true"
  53. @dragstart="dragstartPlay($event)"
  54. @dragend="dragEnterOver($event, item)"></span>
  55. <div class="for-text-one">
  56. <p class="for-text-null-p"></p>
  57. <p class="for-text-one-p">{{item.name}}</p>
  58. <p class="for-text-null-p"></p>
  59. </div>
  60. <img src="@/assets/ZDimages/integratedManagement/icon_bjgl_lcs.png" class="for-img-two">
  61. <div class="for-text-box-one">
  62. <p>{{item.floorNum}}</p>
  63. <p>楼层数</p>
  64. </div>
  65. <img src="@/assets/ZDimages/integratedManagement/icon_bjgl_fj.png" class="for-img-three">
  66. <div class="for-text-box-two">
  67. <p>{{item.roomNum}}</p>
  68. <p>房间数</p>
  69. </div>
  70. </div>
  71. <div class="for-button-min-box">
  72. <div @click="handleCommand(5,item)" v-hasPermiRouter="['system:build:edit']">
  73. <span class="iconfont iconfont-a icon-bianji"></span>
  74. <p>编辑</p>
  75. </div>
  76. <div @click="handleCommand(6,item)" v-hasPermiRouter="['system:build:del']">
  77. <span class="iconfont iconfont-b icon-a-shanchu"></span>
  78. <p>删除</p>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <img class="null-img" v-if="!buildingList[0]" src="@/assets/ZDimages/basicsModules/null-data-1.png">
  84. </div>
  85. </div>
  86. <div class="building-box" v-if="checkTreeType == 2">
  87. <div class="max-right-button-box">
  88. <p class="null-p"></p>
  89. <p class="page-submit-common-style-button"
  90. style="margin-right:4px;width: 130px" @click="handleCommand(7)"
  91. v-hasPermiRouter="['system:build:add']"
  92. >新增楼层</p>
  93. </div>
  94. <div class="right-big-list-box scrollbar-box">
  95. <div class="for-max-box" v-for="(item,index) in buildingList" :key="index"
  96. @dragover.prevent="dragoverPrevent(item)">
  97. <div class="for-big-box">
  98. <div class="for-big-box-left">
  99. <span class="iconfont icon-a-gengduo3" style="cursor: pointer;font-size:44px;color:#d8d8d8;margin:27px 0 0 30px;"
  100. draggable="true"
  101. @dragstart="dragstartPlay($event)"
  102. @dragend="dragEnterOver($event, item)"></span>
  103. <div class="for-text-one">
  104. <p class="for-text-null-p"></p>
  105. <p class="for-text-one-p">{{item.name}}</p>
  106. <p class="for-text-null-p"></p>
  107. </div>
  108. </div>
  109. <div class="for-button-min-box">
  110. <div v-hasPermiRouter="['system:build:edit']" @click="handleCommand(8,item)">
  111. <span class="iconfont iconfont-a icon-bianji"></span>
  112. <p>编辑</p>
  113. </div>
  114. <div v-hasPermiRouter="['system:build:del']" @click="handleCommand(9,item)">
  115. <span class="iconfont iconfont-b icon-a-shanchu"></span>
  116. <p>删除</p>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <img class="null-img" v-if="!buildingList[0]" src="@/assets/ZDimages/basicsModules/null-data-1.png">
  122. </div>
  123. </div>
  124. <div class="floor-box" v-if="checkTreeType == 3">
  125. <div class="floor-table-box">
  126. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  127. <el-form-item label="关键字" prop="searchValue" style="margin-right:20px;">
  128. <el-input
  129. v-model="queryParams.searchValue"
  130. placeholder="房间号/房间名称"
  131. clearable
  132. size="small"
  133. />
  134. </el-form-item>
  135. <el-form-item label="房间类型" prop="roomType" style="margin-right:20px;">
  136. <el-select v-model="queryParams.roomType" placeholder="请选择房间类型">
  137. <el-option
  138. v-for="dict in roomTypeOptions"
  139. :key="dict.value"
  140. :label="dict.label"
  141. :value="dict.value">
  142. </el-option>
  143. </el-select>
  144. </el-form-item>
  145. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  146. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  147. <p class="page-submit-common-style-button"
  148. style="float: right;"
  149. @click="roomButton(1)"
  150. v-hasPermiRouter="['system:roominfo:add']"
  151. >新增房间</p>
  152. </el-form>
  153. <el-table class="table-box" border :data="dataList">
  154. <el-table-column label="房间号" align="left" prop="roomNum" width="240"/>
  155. <el-table-column label="房间名称" align="left" prop="roomName"/>
  156. <el-table-column label="房间类型" align="left" prop="roomType" width="200">
  157. <template slot-scope="scope">
  158. <span v-for="(item,index) in roomTypeOptions" :key="index" v-if="item.value == scope.row.roomType">{{item.label}}</span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column label="创建人" align="left" prop="createName" width="200"/>
  162. <el-table-column label="创建时间" align="left" prop="createTime" width="200">
  163. <template slot-scope="scope">
  164. {{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}
  165. </template>
  166. </el-table-column>
  167. <el-table-column label="操作" align="left" width="140">
  168. <template slot-scope="scope">
  169. <div class="table-button-box">
  170. <p class="table-button-null"></p>
  171. <p class="table-button-p"
  172. @click="roomButton(2,scope.row)"
  173. v-hasPermiRouter="['system:roominfo:edit']"
  174. >编辑</p>
  175. <p class="table-button-p"
  176. v-hasPermiRouter="['system:roominfo:del']"
  177. @click="roomButton(3,scope.row)"
  178. >删除</p>
  179. <p class="table-button-null"></p>
  180. </div>
  181. </template>
  182. </el-table-column>
  183. </el-table>
  184. <pagination
  185. v-show="total>0"
  186. :total="total"
  187. :page.sync="queryParams.page"
  188. :limit.sync="queryParams.pageSize"
  189. @pagination="getList"
  190. />
  191. </div>
  192. </div>
  193. </div>
  194. <!-- 新增/编辑校区 -->
  195. <el-dialog :title="dialogTitle" v-if="dialogOpen" :visible.sync="dialogOpen" width="600px" append-to-body>
  196. <el-form ref="dialogForm" :model="dialogForm" :rules="rules" label-width="110px">
  197. <el-form-item label="校区名称:" prop="campusName">
  198. <el-input v-model="dialogForm.campusName" maxlength="30" placeholder="请输入校区名称"
  199. :disabled="dialogType==2 || dialogType==22 || dialogType==3 || dialogType==33"/>
  200. </el-form-item>
  201. <el-form-item label="楼栋名称:" prop="buildingName"
  202. v-if="dialogType==2 || dialogType==22 || dialogType==3 || dialogType==33">
  203. <el-input v-model="dialogForm.buildingName" maxlength="30" placeholder="请输入楼栋名称"
  204. :disabled="dialogType==3 || dialogType==33"/>
  205. </el-form-item>
  206. <el-form-item label="楼层名称:" prop="floorName" v-if="dialogType==3 || dialogType==33">
  207. <el-input v-model="dialogForm.floorName" maxlength="30" placeholder="请输入楼层名称"/>
  208. </el-form-item>
  209. <el-form-item label="排序序号:" prop="sortNo" class="dialog-sort-no-form-item-box">
  210. <el-input-number v-model="dialogForm.sortNo" :min="0" :max="999" placeholder="请输入排序序号" :controls="false"
  211. style="width:450px;"></el-input-number>
  212. </el-form-item>
  213. </el-form>
  214. <div slot="footer" class="dialog-footer dialog-footer-box">
  215. <p class="dialog-footer-button-null"></p>
  216. <p class="dialog-footer-button-info" @click="cancel">取消</p>
  217. <p class="dialog-footer-button-primary" @click="submitForm">提交</p>
  218. <p class="dialog-footer-button-null"></p>
  219. </div>
  220. </el-dialog>
  221. <!-- 新增/编辑房间 -->
  222. <el-dialog :title="dialogRoomTitle" v-if="dialogRoomOpen" :visible.sync="dialogRoomOpen" width="600px" append-to-body>
  223. <el-form ref="dialogRoomForm" :model="dialogRoomForm" :rules="rules" label-width="110px">
  224. <el-form-item label="房间号:" prop="roomNum">
  225. <el-input v-model="dialogRoomForm.roomNum" maxlength="20" style="width:400px;" placeholder="请输入房间号"/>
  226. </el-form-item>
  227. <el-form-item label="房间名称:" prop="roomName">
  228. <el-input v-model="dialogRoomForm.roomName" maxlength="30" style="width:400px;" placeholder="请输入房间名称"/>
  229. </el-form-item>
  230. <el-form-item label="房间类型:" prop="roomType">
  231. <el-select v-model="dialogRoomForm.roomType" placeholder="请选择房间类型" style="width:400px;">
  232. <el-option
  233. v-for="dict in roomTypeOptions"
  234. :key="dict.value"
  235. :label="dict.label"
  236. :value="dict.value">
  237. </el-option>
  238. </el-select>
  239. </el-form-item>
  240. </el-form>
  241. <div slot="footer" class="dialog-footer dialog-footer-box">
  242. <p class="dialog-footer-button-null"></p>
  243. <p class="dialog-footer-button-info" @click="roomCancel">取消</p>
  244. <p class="dialog-footer-button-primary" @click="roomSubmitForm">提交</p>
  245. <p class="dialog-footer-button-null"></p>
  246. </div>
  247. </el-dialog>
  248. </div>
  249. </template>
  250. <script>
  251. import { systemBuildingGetTreeList,} from "@/api/commonality/permission";
  252. import { getDicts,} from "@/api/commonality/noPermission";
  253. import { systemBuildingGetTreeAdd,systemBuildingGetUpdate,
  254. systemBuildingGetList,systemBuildingEditSortNum,systemBuildingEditDelete,
  255. systemRoomInfoList,systemRoomInfoAdd,systemRoomInfoUpdate,
  256. systemRoomInfoDelete,systemRoomInfoDetail} from "@/api/integratedManagement/index";
  257. export default {
  258. name: 'index',
  259. data(){
  260. return{
  261. schoolName:localStorage.getItem('schoolName'),
  262. pageType: 1,
  263. //拖拽排序起始Y点(用于计算朝向)
  264. clientY: null,
  265. clientId: null,
  266. //学校/楼栋/楼层
  267. treeList: [],
  268. //选中状态
  269. checkTreeId: null,
  270. checkTreeType: 1,
  271. buildingList: [],
  272. //楼层展开/关闭状态
  273. //编辑弹窗开关
  274. dialogOpen: false,
  275. dialogType: null,
  276. dialogTitle: '',
  277. // 表单参数
  278. dialogForm: {},
  279. //校区名称
  280. yxName: null,
  281. ldName: null,
  282. lcName: null,
  283. parentId: null,
  284. // 表单校验
  285. rules: {
  286. campusName: [
  287. { required: true, message: '请输入校区名称', trigger: 'blur' },
  288. { required: true, message: '请输入校区名称', validator: this.spaceJudgment, trigger: 'blur' }
  289. ],
  290. buildingName: [
  291. { required: true, message: '请输入楼栋名称', trigger: 'blur' },
  292. { required: true, message: '请输入楼栋名称', validator: this.spaceJudgment, trigger: 'blur' }
  293. ],
  294. floorName: [
  295. { required: true, message: '请输入楼层名称', trigger: 'blur' },
  296. { required: true, message: '请输入楼层名称', validator: this.spaceJudgment, trigger: 'blur' }
  297. ],
  298. sortNo: [
  299. { required: true, message: '请输入排序序号', trigger: 'blur' },
  300. { required: true, message: '请输入排序序号', validator: this.spaceJudgment, trigger: 'blur' }
  301. ],
  302. roomNum: [
  303. { required: true, message: '请输入房间号', trigger: 'blur' },
  304. { required: true, message: '请输入房间号', validator: this.spaceJudgment, trigger: 'blur' }
  305. ],
  306. roomName: [
  307. { required: true, message: '请输入房间名称', trigger: 'blur' },
  308. { required: true, message: '请输入房间名称', validator: this.spaceJudgment, trigger: 'blur' }
  309. ],
  310. roomType: [
  311. { required: true, message: '请选择房间类型', trigger: 'blur' },
  312. ]
  313. },
  314. // 显示搜索条件
  315. showSearch: true,
  316. loading: false,
  317. //楼层查询数据
  318. queryParams: {},
  319. //房间列表数据
  320. dataList: [],
  321. total: 10,
  322. //房间类型列表
  323. roomTypeOptions: [],
  324. //传参数据
  325. propsData: {},
  326. //房间
  327. dialogRoomTitle:"",
  328. dialogRoomOpen:false,
  329. dialogRoomForm:{},
  330. }
  331. },
  332. created() {
  333. this.getDicts();
  334. },
  335. mounted() {
  336. this.getTreeList();
  337. },
  338. methods: {
  339. //新增学校/楼栋/楼层数据
  340. addBuildFloor(type) {
  341. this.$refs['dialogForm'].validate(valid => {
  342. if (valid) {
  343. //1.学校 2.楼栋 3.楼层
  344. let obj = {
  345. name: type == 1 ? this.dialogForm.campusName : (type == 2 ? this.dialogForm.buildingName : (type == 3 ? this.dialogForm.floorName : '')),
  346. type: type,
  347. sortNo: this.dialogForm.sortNo,
  348. parentId: type == 1 ? 0 : this.checkTreeId
  349. }
  350. systemBuildingGetTreeAdd(obj).then(response => {
  351. this.msgSuccess(response.message)
  352. this.cancel()
  353. this.getTreeList()
  354. })
  355. }
  356. })
  357. },
  358. //编辑学校/楼栋/楼层数据
  359. putBuildFloor(type) {
  360. this.$refs['dialogForm'].validate(valid => {
  361. if (valid) {
  362. //1.学校 2.楼栋 3.楼层
  363. let obj = {
  364. id: this.dialogForm.id,
  365. name: type == 1 ? this.dialogForm.campusName : (type == 2 ? this.dialogForm.buildingName : (type == 3 ? this.dialogForm.floorName : '')),
  366. type: type,
  367. sortNo: this.dialogForm.sortNo
  368. }
  369. systemBuildingGetUpdate(obj).then(response => {
  370. this.msgSuccess(response.message)
  371. this.cancel()
  372. this.getTreeList()
  373. })
  374. }
  375. })
  376. },
  377. //删除学校/楼栋/楼层数据
  378. delBuildFloor(id) {
  379. systemBuildingEditDelete({id:id}).then(response => {
  380. this.msgSuccess(response.message)
  381. this.getTreeList()
  382. })
  383. },
  384. //调整排序
  385. editSortNum(data) {
  386. systemBuildingEditSortNum(data).then(response => {
  387. this.msgSuccess(response.message)
  388. this.getTreeList()
  389. })
  390. },
  391. roomButton(type,row){
  392. let self = this;
  393. if(type == 1){
  394. this.$set(this, 'dialogRoomTitle', '新增房间')
  395. this.$set(this, 'dialogRoomForm', {
  396. roomNum: '',
  397. roomName: '',
  398. roomType: '',
  399. })
  400. this.$set(this, 'dialogRoomOpen', true)
  401. }else if(type == 2){
  402. this.$set(this, 'dialogRoomTitle', '编辑房间')
  403. this.$set(this, 'dialogRoomForm', row)
  404. this.$set(this, 'dialogRoomOpen', true)
  405. }else if(type == 3){
  406. this.$confirm('是否确认删除?', "警告", {
  407. confirmButtonText: "确定",
  408. cancelButtonText: "取消",
  409. type: "warning"
  410. }).then(function() {
  411. }).then(() => {
  412. systemRoomInfoDelete({roomId:row.roomId}).then(response => {
  413. self.msgSuccess(response.message)
  414. self.getList();
  415. });
  416. }).catch(() => {});
  417. }
  418. },
  419. // 取消按钮
  420. roomCancel() {
  421. this.$set(this, 'dialogRoomOpen', false)
  422. this.$set(this, 'dialogRoomForm', {})
  423. this.$set(this, 'dialogRoomTitle', null)
  424. },
  425. //确定按钮
  426. roomSubmitForm() {
  427. let obj = JSON.parse(JSON.stringify(this.dialogRoomForm))
  428. if(obj.roomId){
  429. systemRoomInfoUpdate(obj).then(response => {
  430. this.msgSuccess(response.message);
  431. this.getList()
  432. this.$set(this, 'dialogRoomOpen', false)
  433. })
  434. }else{
  435. obj.floorId = this.checkTreeId;
  436. systemRoomInfoAdd(obj).then(response => {
  437. this.msgSuccess(response.message);
  438. this.getList()
  439. this.$set(this, 'dialogRoomOpen', false)
  440. })
  441. }
  442. },
  443. // 取消按钮
  444. cancel() {
  445. this.$set(this, 'dialogOpen', false)
  446. this.$set(this, 'dialogForm', {})
  447. this.$set(this, 'dialogType', null)
  448. },
  449. //确定按钮
  450. submitForm() {
  451. if (this.dialogType == 1) {
  452. //新增
  453. this.addBuildFloor(1)
  454. } else if (this.dialogType == 11) {
  455. //编辑
  456. this.putBuildFloor(1)
  457. } else if (this.dialogType == 2) {
  458. //新增
  459. this.addBuildFloor(2)
  460. } else if (this.dialogType == 22) {
  461. //编辑
  462. this.putBuildFloor(2)
  463. } else if (this.dialogType == 3) {
  464. //新增
  465. this.addBuildFloor(3)
  466. } else if (this.dialogType == 33) {
  467. //编辑
  468. this.putBuildFloor(3)
  469. }
  470. },
  471. //楼栋弹出下啦列表选中事件
  472. handleCommand(command, item) {
  473. let self = this
  474. if (command == 1) {
  475. //编辑校区
  476. this.$set(this, 'dialogTitle', '编辑校区')
  477. this.$set(this, 'dialogForm', {
  478. id: item.id,
  479. campusName: item.name,
  480. sortNo: item.sortNo
  481. })
  482. this.$set(this, 'dialogType', 11)
  483. this.$set(this, 'dialogOpen', true)
  484. } else if (command == 2) {
  485. //删除校区
  486. this.$confirm('确定要删除该校区吗?', '警告', {
  487. confirmButtonText: '确定',
  488. cancelButtonText: '取消',
  489. type: 'warning'
  490. }).then(function() {
  491. self.delBuildFloor(item.id)
  492. }).then(() => {
  493. }).catch(() => {
  494. })
  495. } else if (command == 3) {
  496. //新增校区
  497. this.$set(this, 'dialogForm', {})
  498. this.$set(this, 'dialogTitle', '新增校区')
  499. this.$set(this, 'dialogType', 1)
  500. this.$set(this, 'dialogOpen', true)
  501. } else if (command == 4) {
  502. //新增楼栋
  503. this.$set(this, 'dialogForm', {
  504. campusName: this.yxName
  505. })
  506. this.$set(this, 'dialogTitle', '新增楼栋')
  507. this.$set(this, 'dialogType', 2)
  508. this.$set(this, 'dialogOpen', true)
  509. } else if (command == 5) {
  510. //编辑楼栋
  511. this.$set(this, 'dialogForm', {
  512. id: item.id,
  513. campusName: this.yxName,
  514. buildingName: item.name,
  515. sortNo: item.sortNo
  516. })
  517. this.$set(this, 'dialogTitle', '编辑楼栋')
  518. this.$set(this, 'dialogType', 22)
  519. this.$set(this, 'dialogOpen', true)
  520. } else if (command == 6) {
  521. //删除楼栋
  522. this.$confirm('确定要删除该楼栋吗?', '警告', {
  523. confirmButtonText: '确定',
  524. cancelButtonText: '取消',
  525. type: 'warning'
  526. }).then(function() {
  527. self.delBuildFloor(item.id)
  528. }).then(() => {
  529. }).catch(() => {
  530. })
  531. } else if (command == 7) {
  532. //新增楼层
  533. this.$set(this, 'dialogForm', {
  534. campusName: this.yxName,
  535. buildingName: this.ldName
  536. })
  537. this.$set(this, 'dialogTitle', '新增楼层')
  538. this.$set(this, 'dialogType', 3)
  539. this.$set(this, 'dialogOpen', true)
  540. } else if (command == 8) {
  541. //编辑楼层
  542. this.$set(this, 'dialogForm', {
  543. id: item.id,
  544. campusName: this.yxName,
  545. buildingName: this.ldName,
  546. floorName: item.name,
  547. sortNo: item.sortNo
  548. })
  549. this.$set(this, 'dialogTitle', '编辑楼层')
  550. this.$set(this, 'dialogType', 33)
  551. this.$set(this, 'dialogOpen', true)
  552. } else if (command == 9) {
  553. //删除楼层
  554. this.$confirm('确定要删除该楼层吗?', '警告', {
  555. confirmButtonText: '确定',
  556. cancelButtonText: '取消',
  557. type: 'warning'
  558. }).then(function() {
  559. self.delBuildFloor(item.id)
  560. }).then(() => {
  561. }).catch(() => {
  562. })
  563. }
  564. },
  565. //获取学校/楼栋/楼层树状数据
  566. getTreeList() {
  567. systemBuildingGetTreeList({}).then(response => {
  568. if (response.data[0]) {
  569. for (let i = 0; i < response.data.length; i++) {
  570. for (let o = 0; o < response.data[i].buildFloorVoList.length; o++) {
  571. response.data[i].buildFloorVoList[o].onType = true
  572. }
  573. }
  574. this.$set(this, 'treeList', response.data)
  575. if (!this.checkTreeId) {
  576. this.$set(this, 'checkTreeId', response.data[0].id)
  577. this.$set(this, 'yxName', response.data[0].name)
  578. this.$set(this, 'parentId', response.data[0].parentId)
  579. }
  580. let obj = {
  581. parentId: this.checkTreeId ? this.checkTreeId : response.data[0].id,
  582. type:this.checkTreeType
  583. }
  584. if(this.checkTreeType == 3){
  585. this.resetQuery()
  586. }else{
  587. this.getTreeSonList(obj);
  588. }
  589. }
  590. })
  591. },
  592. //获取校区/楼栋/楼层列表数据
  593. getTreeSonList(data) {
  594. systemBuildingGetList(data).then(response => {
  595. this.$set(this, 'buildingList', response.data)
  596. })
  597. },
  598. //获取楼层实验室数据列表
  599. getList() {
  600. let obj = JSON.parse(JSON.stringify(this.queryParams));
  601. obj.floorId = this.checkTreeId;
  602. systemRoomInfoList(obj).then(response => {
  603. this.dataList = response.data.records
  604. this.total = response.data.total
  605. })
  606. },
  607. //页面切换
  608. clickPage(type, item) {
  609. if (type == 1) {
  610. this.$set(this, 'pageType', type)
  611. } else if (type == 2) {
  612. this.$set(this, 'propsData', item)
  613. if(item.name){
  614. this.$set(this.propsData, 'buildName', item.buildName)
  615. this.$set(this.propsData, 'floorName', item.name)
  616. }else{
  617. this.$set(this.propsData, 'buildName', this.ldName)
  618. this.$set(this.propsData, 'floorName', this.lcName)
  619. }
  620. this.$set(this, 'pageType', type)
  621. }else if(type == 3){
  622. this.$set(this, 'pageType', 1)
  623. this.resetQuery()
  624. }
  625. },
  626. selectFocus() {
  627. },
  628. //树状结构选中
  629. clickCheckTree(item, type, itemOne) {
  630. if (item.id != this.checkTreeId) {
  631. this.$set(this, 'checkTreeId', item.id)
  632. this.$set(this, 'checkTreeType', type)
  633. if (type == 1) {
  634. this.$set(this, 'yxName', item.name)
  635. this.$set(this, 'buildingList', [])
  636. } else if (type == 2) {
  637. this.$set(this, 'ldName', item.name)
  638. this.$set(this, 'buildingList', [])
  639. } else if (type == 3) {
  640. this.$set(this, 'ldName', itemOne.name)
  641. this.$set(this, 'lcName', item.name)
  642. this.$set(this, 'buildingList', {})
  643. }
  644. let obj = {
  645. parentId: item.id,
  646. type:this.checkTreeType
  647. }
  648. this.$set(this,'parentId',item.parentId);
  649. if(type == 3){
  650. this.resetQuery(obj)
  651. }else{
  652. this.getTreeSonList(obj);
  653. }
  654. }
  655. },
  656. //树状结构展开收回
  657. terrClick(itemOne) {
  658. itemOne.onType = !itemOne.onType
  659. },
  660. //拖拽抓取时触发
  661. dragstartPlay(event) {
  662. this.$set(this, 'clientY', event.clientY)
  663. },
  664. //拖拽途径触发
  665. dragoverPrevent(item) {
  666. this.$set(this, 'clientId', item.id)
  667. },
  668. //拖拽释放触发
  669. dragEnterOver(event, item) {
  670. let self = this
  671. let newList = []
  672. if (this.clientId && item.id != this.clientId) {
  673. let list = []
  674. let obj = null
  675. for (let i = 0; i < self.buildingList.length; i++) {
  676. if (self.buildingList[i].id == item.id) {
  677. obj = JSON.parse(JSON.stringify(self.buildingList[i]))
  678. }
  679. }
  680. if (event.clientY > this.clientY) {
  681. for (let i = 0; i < self.buildingList.length; i++) {
  682. if (self.buildingList[i].id != item.id && self.buildingList[i].id != this.clientId) {
  683. list.push(self.buildingList[i])
  684. } else if (self.buildingList[i].id == this.clientId) {
  685. list.push(self.buildingList[i])
  686. list.push(obj)
  687. }
  688. }
  689. } else if (event.clientY < this.clientY) {
  690. for (let i = 0; i < self.buildingList.length; i++) {
  691. if (self.buildingList[i].id == this.clientId) {
  692. list.push(obj)
  693. list.push(self.buildingList[i])
  694. } else if (self.buildingList[i].id != item.id && self.buildingList[i].id != this.clientId) {
  695. list.push(self.buildingList[i])
  696. }
  697. }
  698. }
  699. for (let i = 0; i < list.length; i++) {
  700. newList.push({ id: list[i].id, sortNo: i })
  701. }
  702. this.$set(this, 'clientId', null)
  703. this.editSortNum(newList)
  704. }
  705. },
  706. /** 搜索按钮操作 */
  707. handleQuery() {
  708. this.$set(this.queryParams, 'page', 1)
  709. this.getList()
  710. },
  711. /** 重置按钮操作 */
  712. resetQuery() {
  713. this.$set(this, 'queryParams', {
  714. searchValue: '',
  715. roomType: '',
  716. page: 1,
  717. pageSize: 10
  718. })
  719. this.handleQuery()
  720. },
  721. /** 查询字典数据列表 */
  722. getDicts() {
  723. getDicts('layout_room_type').then(response => {
  724. let list = response.data;
  725. list.push({
  726. label:"其他",
  727. value:"-99",
  728. });
  729. this.$set(this,'roomTypeOptions',list);
  730. });
  731. },
  732. }
  733. }
  734. </script>
  735. <style scoped lang="scss">
  736. .buildingManagement{
  737. flex: 1;
  738. display: flex;
  739. flex-direction: row;
  740. overflow: hidden;
  741. padding:20px;
  742. .max-left-box {
  743. width: 281px;
  744. border-right: 1px dashed #A2A2A2;
  745. display: flex;
  746. flex-direction: column;
  747. .tree-null-p {
  748. text-align: center;
  749. line-height: 100px;
  750. flex: 1;
  751. color: #999;
  752. }
  753. .tree-box {
  754. flex: 1;
  755. .terr-max-box {
  756. margin-top: 20px;
  757. .max-name-box {
  758. display: flex;
  759. margin-right: 20px;
  760. margin-bottom: 10px;
  761. color: #D8D8D8;
  762. font-size: 20px;
  763. .max-name {
  764. flex: 1;
  765. margin-right: 19px;
  766. color: #333;
  767. font-size: 16px;
  768. line-height: 16px;
  769. margin-top: 3px;
  770. cursor: pointer;
  771. }
  772. }
  773. .terr-big-box {
  774. margin-left: 30px;
  775. .big-name-box {
  776. cursor: pointer;
  777. min-height: 20px;
  778. line-height: 20px;
  779. padding:10px 20px 10px 0;
  780. display: flex;
  781. font-size: 16px;
  782. color: #333;
  783. img {
  784. width: 16px;
  785. height: 16px;
  786. margin-top: 2px;
  787. margin-right: 4px;
  788. }
  789. .name-p {
  790. flex: 1;
  791. }
  792. }
  793. .terr-min-box {
  794. margin-left: 30px;
  795. .min-name {
  796. cursor: pointer;
  797. min-height: 20px;
  798. line-height: 20px;
  799. padding:10px 20px 10px 0;
  800. display: flex;
  801. font-size: 16px;
  802. color: #333;
  803. }
  804. }
  805. }
  806. .check-color {
  807. color: #0183FA !important;
  808. }
  809. }
  810. }
  811. .max-left-big-button {
  812. color: #0183FA;
  813. border: 1px dashed #0183FA;
  814. -webkit-border-radius: 6px;
  815. -moz-border-radius: 6px;
  816. border-radius: 6px;
  817. width: 180px;
  818. line-height: 40px;
  819. margin: 20px 0 20px 40px;
  820. text-align: center;
  821. font-size: 14px;
  822. cursor: pointer;
  823. }
  824. .max-left-big-button:hover {
  825. color: #fff;
  826. background: #0183FA;
  827. border: 1px solid #0183FA;
  828. }
  829. }
  830. .max-right-box {
  831. flex: 1;
  832. display: flex;
  833. flex-direction: column;
  834. overflow: hidden;
  835. .school-box {
  836. flex: 1;
  837. display: flex;
  838. flex-direction: column;
  839. overflow: hidden;
  840. .max-right-button-box {
  841. height: 40px;
  842. display: flex;
  843. margin-bottom: 22px;
  844. .null-p {
  845. flex: 1;
  846. }
  847. .max-right-big-button {
  848. color: #fff;
  849. background: #0045AF;
  850. -webkit-border-radius: 6px;
  851. -moz-border-radius: 6px;
  852. border-radius: 6px;
  853. width: 130px;
  854. line-height: 40px;
  855. text-align: center;
  856. font-size: 14px;
  857. cursor: pointer;
  858. }
  859. .max-right-big-button:hover {
  860. color: #fff;
  861. background: #0183FA;
  862. }
  863. }
  864. .right-big-list-box {
  865. flex: 1;
  866. position: relative;
  867. .for-max-box {
  868. .for-big-box {
  869. display: flex;
  870. border: 1px solid #dedede;
  871. height: 100px;
  872. box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.16);
  873. margin-bottom: 30px;
  874. margin-left: 36px;
  875. border-radius: 6px;
  876. .for-big-box-left {
  877. flex: 1;
  878. display: flex;
  879. .for-img-one {
  880. cursor: pointer;
  881. height: 30px;
  882. width: 30px;
  883. margin: 35px 0 0 30px;
  884. }
  885. .for-text-one {
  886. display: flex;
  887. flex-direction: column;
  888. margin-left: 95px;
  889. width: 230px;
  890. font-weight: 500;
  891. .for-text-null-p{
  892. flex:1;
  893. }
  894. .for-text-one-p{
  895. font-size: 16px;
  896. line-height: 20px;
  897. }
  898. }
  899. .for-img-two {
  900. height: 48px;
  901. width: 48px;
  902. margin: 26px 23px 0 30px;
  903. }
  904. .for-text-box-one {
  905. width: 88px;
  906. margin-right: 73px;
  907. p {
  908. text-align: center;
  909. }
  910. p:nth-child(1) {
  911. margin-top: 20px;
  912. font-size: 24px;
  913. line-height: 30px;
  914. color: #0183FA;
  915. }
  916. p:nth-child(2) {
  917. margin-top: 10px;
  918. font-size: 16px;
  919. line-height: 16px;
  920. color: #333;
  921. }
  922. }
  923. .for-img-three {
  924. height: 48px;
  925. width: 48px;
  926. margin: 26px 23px 0 0;
  927. }
  928. .for-text-box-two {
  929. width: 88px;
  930. p {
  931. text-align: center;
  932. }
  933. p:nth-child(1) {
  934. margin-top: 20px;
  935. font-size: 24px;
  936. line-height: 30px;
  937. color: #0183FA;
  938. }
  939. p:nth-child(2) {
  940. margin-top: 10px;
  941. font-size: 16px;
  942. line-height: 16px;
  943. color: #333;
  944. }
  945. }
  946. }
  947. .for-button-min-box {
  948. width: 220px;
  949. margin-top: 9px;
  950. height: 82px;
  951. border-left: 1px dashed rgba(0, 0, 0, 0.3);
  952. display: flex;
  953. line-height: 82px;
  954. div {
  955. margin-left: 34px;
  956. display: flex;
  957. width: 60px;
  958. cursor: pointer;
  959. .iconfont-a{
  960. margin-right:5px;
  961. font-size:18px;
  962. color:#0183FA;
  963. }
  964. .iconfont-b{
  965. margin-right:5px;
  966. margin-top: 1px;
  967. font-size:15px;
  968. color:#0183FA;
  969. }
  970. p {
  971. font-size: 14px;
  972. color: #333;
  973. }
  974. }
  975. }
  976. }
  977. }
  978. .null-img {
  979. position: absolute;
  980. top: 40%;
  981. left: 50%;
  982. width: 276px;
  983. height: 321px;
  984. margin-top: -160px;
  985. margin-left: -138px;
  986. }
  987. }
  988. }
  989. .building-box {
  990. flex: 1;
  991. display: flex;
  992. flex-direction: column;
  993. overflow: hidden;
  994. .max-right-button-box {
  995. height: 40px;
  996. display: flex;
  997. margin-bottom: 22px;
  998. .null-p {
  999. flex: 1;
  1000. }
  1001. .max-right-big-button {
  1002. color: #fff;
  1003. background: #0045AF;
  1004. -webkit-border-radius: 6px;
  1005. -moz-border-radius: 6px;
  1006. border-radius: 6px;
  1007. width: 130px;
  1008. line-height: 40px;
  1009. text-align: center;
  1010. font-size: 14px;
  1011. cursor: pointer;
  1012. }
  1013. .max-right-big-button:hover {
  1014. color: #fff;
  1015. background: #0183FA;
  1016. }
  1017. }
  1018. .right-big-list-box {
  1019. flex: 1;
  1020. position: relative;
  1021. .for-max-box {
  1022. margin-bottom: 30px;
  1023. .for-big-box {
  1024. display: flex;
  1025. border: 1px solid #dedede;
  1026. height: 100px;
  1027. box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.16);
  1028. margin-left: 36px;
  1029. border-radius: 6px;
  1030. .for-big-box-left {
  1031. flex: 1;
  1032. display: flex;
  1033. .for-img-one {
  1034. cursor: pointer;
  1035. height: 30px;
  1036. width: 30px;
  1037. margin: 35px 0 0 30px;
  1038. }
  1039. .for-text-one {
  1040. display: flex;
  1041. flex-direction: column;
  1042. margin-left: 95px;
  1043. width: 630px;
  1044. font-weight: 500;
  1045. .for-text-null-p{
  1046. flex:1;
  1047. }
  1048. .for-text-one-p{
  1049. font-size: 16px;
  1050. line-height: 20px;
  1051. }
  1052. }
  1053. .for-img-two {
  1054. height: 48px;
  1055. width: 48px;
  1056. margin: 26px 23px 0 30px;
  1057. }
  1058. .for-text-box-one {
  1059. width: 88px;
  1060. margin-right: 73px;
  1061. p {
  1062. text-align: center;
  1063. }
  1064. p:nth-child(1) {
  1065. margin-top: 20px;
  1066. font-size: 24px;
  1067. line-height: 30px;
  1068. color: #0183FA;
  1069. }
  1070. p:nth-child(2) {
  1071. margin-top: 10px;
  1072. font-size: 16px;
  1073. line-height: 16px;
  1074. color: #333;
  1075. }
  1076. }
  1077. .for-img-three {
  1078. height: 48px;
  1079. width: 48px;
  1080. margin: 26px 23px 0 0;
  1081. }
  1082. .for-text-box-two {
  1083. width: 88px;
  1084. p {
  1085. text-align: center;
  1086. }
  1087. p:nth-child(1) {
  1088. margin-top: 20px;
  1089. font-size: 24px;
  1090. line-height: 30px;
  1091. color: #0183FA;
  1092. }
  1093. p:nth-child(2) {
  1094. margin-top: 10px;
  1095. font-size: 16px;
  1096. line-height: 16px;
  1097. color: #333;
  1098. }
  1099. }
  1100. }
  1101. .for-button-min-box {
  1102. width: 330px;
  1103. margin-top: 9px;
  1104. height: 82px;
  1105. border-left: 1px dashed rgba(0, 0, 0, 0.3);
  1106. display: flex;
  1107. line-height: 82px;
  1108. div {
  1109. margin-left: 34px;
  1110. display: flex;
  1111. width: 60px;
  1112. cursor: pointer;
  1113. .iconfont-a{
  1114. margin-right:5px;
  1115. font-size:18px;
  1116. color:#0183FA;
  1117. }
  1118. .iconfont-b{
  1119. margin-right:5px;
  1120. margin-top: 1px;
  1121. font-size:15px;
  1122. color:#0183FA;
  1123. }
  1124. p {
  1125. font-size: 14px;
  1126. color: #333;
  1127. }
  1128. }
  1129. }
  1130. }
  1131. .layout-data-max-big-null-box {
  1132. height: 400px;
  1133. margin-left: 36px;
  1134. border-left: 1px solid #e0e0e0;
  1135. border-right: 1px solid #e0e0e0;
  1136. border-bottom: 1px solid #e0e0e0;
  1137. position: relative;
  1138. overflow: hidden;
  1139. img {
  1140. position: absolute;
  1141. top: 50%;
  1142. left: 50%;
  1143. margin-left: -71px;
  1144. margin-top: -71px;
  1145. width: 142px;
  1146. height: 142px;
  1147. }
  1148. div {
  1149. margin-top: 300px;
  1150. height: 30px;
  1151. display: flex;
  1152. p:nth-child(1) {
  1153. flex: 1;
  1154. }
  1155. p:nth-child(2) {
  1156. margin-right: 20px;
  1157. color: #333;
  1158. font-size: 14px;
  1159. }
  1160. p:nth-child(3) {
  1161. color: #0183FA;
  1162. font-size: 14px;
  1163. cursor: pointer;
  1164. }
  1165. p:nth-child(4) {
  1166. flex: 1;
  1167. }
  1168. }
  1169. }
  1170. }
  1171. .null-img {
  1172. position: absolute;
  1173. top: 40%;
  1174. left: 50%;
  1175. width: 276px;
  1176. height: 321px;
  1177. margin-top: -160px;
  1178. margin-left: -138px;
  1179. }
  1180. }
  1181. }
  1182. .floor-box {
  1183. flex: 1;
  1184. display: flex;
  1185. flex-direction: column;
  1186. overflow: hidden;
  1187. .floor-table-box {
  1188. margin-left: 36px;
  1189. flex: 1;
  1190. display: flex;
  1191. flex-direction: column;
  1192. overflow: hidden;
  1193. }
  1194. }
  1195. }
  1196. }
  1197. </style>