index.vue 41 KB

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