123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- // 生成房间号数组
- const makeRooms = (floor, rooms, extraRooms) => {
- // makeRooms(floor, rooms, extraRooms) {
- let arr = [];
- for (let i = 1; i < rooms + 1; i++) {
- let roomNumber = floor * 100 + i
- for (let j = 0; j < extraRooms + 1; j++) {
- if (j > 0) {
- let realRoom = roomNumber + '-' + j
- let data = {
- name: realRoom,
- checked: false,
- }
- arr.push(data)
- } else {
- let data = {
- name: roomNumber,
- checked: false,
- }
- arr.push(data)
- }
- }
- };
- return arr
- }
- const floor = () => {
- let floorNum = []
- for (let i = 1; i < 56; i++) {
- if (i != 0) {
- let data = {
- checked: false,
- name: i + '楼'
- }
- floorNum.push(data)
- }
- }
- return floorNum
- }
- const storiedBuilding = () => {
- let building = [{
- checked: false,
- name: '单幢'
- }]
- for (var i = 0; i < 25; i++) {
- let data = {
- checked: false,
- name: String.fromCharCode((65 + i)) + '幢'
- }
- building.push(data)
- }
- for (let i = 1; i <= 20; i++) {
- if (i != 0) {
- let data = {
- checked: false,
- name: i + '幢'
- }
- building.push(data)
- }
- }
- return building
- }
- module.exports = {
- makeRooms,
- floor,
- storiedBuilding
- }
|