index.vue 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943
  1. <template>
  2. <div class="work-content">
  3. <div class="work-space">
  4. <div class="space-title">{{ spaceInfo.spaceName }} 申请延时</div>
  5. <!-- <div class="tip">延时期间,空间相关设备会开启</div> -->
  6. </div>
  7. <!--加班的按钮-->
  8. <div class="add-time" id="addTimeId">
  9. <div class="date_box" v-if="dateArr && dateArr.length">
  10. <div
  11. class="date-item"
  12. :class="item.isActive ? 'date-item-active' : ''"
  13. @click.stop="checkDate(item, index)"
  14. :key="'date' + index"
  15. v-for="(item, index) in dateArr"
  16. >
  17. <span>{{ item.week }}</span>
  18. <span>{{ item.day }}</span>
  19. </div>
  20. </div>
  21. <div class="sliders-list" id="sliderListId">
  22. <template v-for="(item, index) in nowTimerArr" :key="'slider' + index">
  23. <div class="sliders-wrapper" id="slidersWrapperId">
  24. <div class="sliders">
  25. <div class="label" v-show="index === 0 || index % 2 === 0">
  26. {{ item.timer }}
  27. </div>
  28. <div
  29. class="slider-box"
  30. @click="checkSlider(item, index)"
  31. :data-index="index"
  32. ></div>
  33. </div>
  34. </div>
  35. </template>
  36. <!--审批状态-->
  37. <template v-if="approvalData && approvalData.length">
  38. <div
  39. class="approval-status"
  40. style="width: 60px"
  41. :key="'approval' + index"
  42. @click="checkApprovalStatus(item, $event)"
  43. :style="{
  44. left: item.left + 'px',
  45. background: item.bg,
  46. }"
  47. v-for="(item, index) in approvalData"
  48. >
  49. {{ item.text }}
  50. </div>
  51. </template>
  52. <div class="slider-btn" id="sliderBtnId" @click="triggerDelTime">
  53. <div class="start" id="startId"></div>
  54. <div class="end-box" id="endBoxId">
  55. <div class="end" id="endId"></div>
  56. <div class="end-radio" id="endRadioId"></div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="add-time-btn">
  62. <div class="cancel-btn" @click="closeWorkTimer">取消</div>
  63. <div
  64. class="comfirm-btn"
  65. :class="formBtn ? 'comfirm-btn-diabled' : ''"
  66. @click="addWorkTimer"
  67. >
  68. 提交申请
  69. </div>
  70. </div>
  71. <!--预约的设备 start-->
  72. <div class="device-title" v-if="isLight || isAir">
  73. <span class="line"></span>
  74. <span class="text">预约开启设备</span>
  75. <span class="line"></span>
  76. </div>
  77. <div class="work-device">
  78. <template v-if="isAir">
  79. <div class="row-title">空调</div>
  80. <div class="device-box">
  81. <template
  82. v-for="(item, index) in nowData.equipmentList"
  83. :key="'eq' + index"
  84. >
  85. <div
  86. class="device-row"
  87. :style="{ width: airNum == 1 ? '98%' : '48%' }"
  88. v-if="item.equipmentCategory !== 'SELTLT'"
  89. @click="checkEquipment(item)"
  90. >
  91. <div class="row-item">
  92. <span>{{ item.localName }}</span>
  93. <img
  94. :src="
  95. item.isCheck
  96. ? parseImgUrl('ipdImages', 'check-open.svg')
  97. : parseImgUrl('ipdImages', 'check-close.svg')
  98. "
  99. alt=""
  100. />
  101. </div>
  102. </div>
  103. </template>
  104. </div>
  105. </template>
  106. <template v-if="isLight">
  107. <div class="row-title">照明</div>
  108. <div class="device-box">
  109. <template
  110. v-for="(item, index) in nowData.equipmentList"
  111. :key="'eq' + index"
  112. >
  113. <div
  114. class="device-row"
  115. :style="{ width: lightNum == 1 ? '98%' : '48%' }"
  116. v-if="item.equipmentCategory === 'SELTLT'"
  117. @click="checkEquipment(item)"
  118. >
  119. <div class="row-item">
  120. <span>{{ item.localName }}</span>
  121. <img
  122. :src="
  123. item.isCheck
  124. ? parseImgUrl('ipdImages', 'check-open.svg')
  125. : parseImgUrl('ipdImages', 'check-close.svg')
  126. "
  127. alt=""
  128. />
  129. </div>
  130. </div>
  131. </template>
  132. </div>
  133. </template>
  134. <div class="device-tip" v-if="isLight || isAir">
  135. <span>计费方式:</span>
  136. <p>
  137. <span> * </span>
  138. 空调延时采用后付费方式,系统将根据您申请的时间产生延时费用。预约时间下您可自由开启空间下的设备。
  139. </p>
  140. <p>
  141. 收费标准按开机设备对应空间的面积计费,空调加时费用按0.4元/m²·h进行计费,照明设备延时使用不计费。
  142. </p>
  143. <p>
  144. 如您提前结束工作,请点击“我要离开”按钮,系统会自动调整设备关闭时间,感谢与您一同共创可持续的办公环境。
  145. </p>
  146. </div>
  147. </div>
  148. <van-loading class="temp-loading" v-if="showLoading" />
  149. </div>
  150. </template>
  151. <script lang="ts">
  152. import { Dialog, Slider, Loading } from "vant";
  153. import {
  154. defineComponent,
  155. reactive,
  156. toRefs,
  157. ref,
  158. onBeforeMount,
  159. onMounted,
  160. onUpdated,
  161. nextTick,
  162. watch,
  163. getCurrentInstance,
  164. } from "vue";
  165. import { swiper } from "@/utils/swiper";
  166. import {
  167. formatDate,
  168. formatDateStr,
  169. getDate,
  170. getNowTime,
  171. getRelNowTime,
  172. getTimers,
  173. getUserInfo,
  174. getWeekDate,
  175. parseImgUrl,
  176. } from "@/utils";
  177. import { myTime } from "@/model/workTimeData";
  178. import { propsToAttrMap } from "@vue/shared";
  179. import { isTemplateElement } from "@babel/types";
  180. import {
  181. saveBatchCustomScene,
  182. setallLampHttp,
  183. setSpaceCondtioners,
  184. } from "@/apis/envmonitor";
  185. import { number } from "echarts";
  186. export default defineComponent({
  187. components: {
  188. VanSlider: Slider,
  189. },
  190. props: {
  191. workkArr: {
  192. type: Array,
  193. default: () => [],
  194. },
  195. projectId: {
  196. type: String,
  197. default: () => "",
  198. },
  199. spaceInfo: {
  200. type: Object,
  201. default: () => {},
  202. },
  203. enterType: {
  204. type: Number,
  205. default: () => 1,
  206. },
  207. deviceItem: {
  208. type: Object,
  209. default: () => null,
  210. },
  211. seviceEquipmentList: {
  212. // 是否走服务定制的设备
  213. type: Array,
  214. default: () => [],
  215. },
  216. },
  217. setup(props, context) {
  218. const proxyGlobal: any = getCurrentInstance();
  219. const screenInfo: any = {
  220. screenWidth: 0,
  221. screenHeight: 0,
  222. };
  223. let dateArr: any = [];
  224. let myTimeArr: any = [];
  225. let timerArr: any = getTimers();
  226. let nowTimerArr: any = [];
  227. let nowData: any = {};
  228. let approvalData: any = [];
  229. let redUrl: any = `${parseImgUrl("ipdImages", "time-check.svg")}`;
  230. let bgRed: any = `linear-gradient(0deg, rgba(255, 0, 0, 0.2), rgba(255, 0, 0, 0.2)), url(${redUrl})`;
  231. const userInfo: any = getUserInfo();
  232. const proxyData = reactive({
  233. userInfo: userInfo,
  234. seviceEquipmentList: props.seviceEquipmentList,
  235. parseImgUrl: parseImgUrl,
  236. isEvent: false,
  237. screenInfo: screenInfo,
  238. projectId: props.projectId,
  239. workkArr: props.workkArr,
  240. bgRed: bgRed,
  241. startIndex: 0,
  242. endIndex: 0,
  243. nowData: nowData,
  244. nowTimerArr: nowTimerArr,
  245. timerArr: timerArr,
  246. startLen: 0,
  247. formBtn: false,
  248. showLoading: false,
  249. deviceItem: props.deviceItem,
  250. enterType: props.enterType, // 1:all 2:空调 3:灯
  251. setScreennWidth() {
  252. let addTimeEl: any = document.querySelector("#addTimeId");
  253. proxyData.screenInfo.screenWidth = addTimeEl.offsetWidth;
  254. },
  255. // 获取当前位置
  256. getNowIndex() {
  257. // let nowIndex: any = 0;
  258. // if (proxyData.nowData.week === "今天") {
  259. // nowIndex = getNowTime()[1];
  260. // }
  261. let nowIndex: any = getNowTime()[1];
  262. return nowIndex;
  263. },
  264. // 获取每天真实的下标
  265. getTomorrowIndex() {
  266. let nowIndex: any = 0;
  267. if (proxyData.nowData.week === "今天") {
  268. nowIndex = getNowTime()[1];
  269. }
  270. return nowIndex;
  271. },
  272. // 获取时间的下标
  273. getTimerIndex(timerArr: any, val: any) {
  274. let cusIndex: any = 0;
  275. timerArr.map((time: any, index: any) => {
  276. if (time.formatTimer == val) {
  277. cusIndex = index;
  278. }
  279. });
  280. return cusIndex;
  281. },
  282. // 获取当前位置的坐标(多端服务定制的判断规则-待开发)
  283. getNowPerstion(timerArr: any) {
  284. let nowIndex: any = proxyData.getNowIndex();
  285. let obj: any = {
  286. nowIndex: nowIndex,
  287. len: 4,
  288. };
  289. let formatTimer: any = timerArr[nowIndex].formatTimer;
  290. let cusStartTime: any = proxyData.parseCusStartTime(
  291. proxyData.nowData.cusStartTime
  292. );
  293. let cusEndTime: any = proxyData.parseCusEndTime(
  294. proxyData.nowData.cusEndTime
  295. );
  296. let spaceCustomContentList: any =
  297. proxyData.nowData.spaceCustomContentList || [];
  298. // debugger
  299. if (formatTimer >= cusStartTime && formatTimer <= cusEndTime) {
  300. // debugger
  301. //在服务定制时间之间
  302. timerArr.map((item: any, index: any) => {
  303. if (item.formatTimer === cusEndTime) {
  304. obj.nowIndex = index;
  305. }
  306. });
  307. let endFormatTimer: any = timerArr[nowIndex + obj.len].formatTimer;
  308. spaceCustomContentList.map((item: any) => {
  309. let startTime: any = proxyData.parseCusStartTime(item.startTime);
  310. if (startTime > cusEndTime && endFormatTimer > startTime) {
  311. let cusIndex: any = proxyData.getTimerIndex(timerArr, startTime);
  312. obj.len =
  313. cusIndex - obj.nowIndex > 0 ? cusIndex - obj.nowIndex : 0;
  314. }
  315. });
  316. } else if (formatTimer < cusStartTime) {
  317. console.log("在当前的服务定制之前---4");
  318. timerArr.map((item: any, index: any) => {
  319. if (item.formatTimer === cusStartTime) {
  320. obj.len = index - nowIndex;
  321. if (obj.len > 4) {
  322. obj.len = 4;
  323. }
  324. }
  325. });
  326. } else if (formatTimer >= cusEndTime) {
  327. // 在服务定制之后
  328. // 在服务定制之后
  329. console.log("在当前的服务定制之后---4");
  330. let endFormatTimer: any = timerArr[nowIndex + obj.len].formatTimer;
  331. spaceCustomContentList.map((item: any) => {
  332. let startTime: any = proxyData.parseCusStartTime(item.startTime);
  333. if (startTime > cusEndTime && endFormatTimer > startTime) {
  334. let cusIndex: any = proxyData.getTimerIndex(timerArr, startTime);
  335. obj.len =
  336. cusIndex - obj.nowIndex > 0 ? cusIndex - obj.nowIndex : 0;
  337. }
  338. });
  339. }
  340. return obj;
  341. },
  342. // 设置当前可选择的时间可选时间
  343. setNowBarPerstion(timerArr: any) {
  344. let sliderList: any = document.querySelector("#sliderListId");
  345. let sliderWidth: any = proxyData.getSliderWapperWidth();
  346. sliderList.style.width = sliderWidth * timerArr.length + "px";
  347. let index: any = proxyData.getNowPerstion(timerArr).nowIndex;
  348. let len: any = proxyData.getNowPerstion(timerArr).len;
  349. let sliderLeft: any = sliderWidth * index;
  350. if (
  351. sliderLeft >
  352. proxyData.screenInfo.screenWidth +
  353. proxyData.screenInfo.screenWidth / 2
  354. ) {
  355. sliderLeft = sliderLeft - sliderWidth;
  356. }
  357. sliderList.style.left = -sliderLeft + "px";
  358. proxyData.setOptionnalPerstion(index, len);
  359. },
  360. sliderSwiper() {
  361. // 获取当前时间的下标
  362. let sliderList: any = document.querySelector("#sliderListId");
  363. let slidersWrapper: any = document.querySelector("#slidersWrapperId");
  364. let leftInit: any = 0;
  365. let width: any =
  366. sliderList.offsetWidth - proxyData.screenInfo.screenWidth;
  367. sliderList.addEventListener("touchstart", function (e: any) {
  368. leftInit = isNaN(parseInt(sliderList.style.left))
  369. ? 0
  370. : parseInt(sliderList.style.left);
  371. leftInit = Math.abs(leftInit);
  372. });
  373. swiper(sliderList, {
  374. swipeLeft: function (e: any) {
  375. if (!proxyData.checkMoveTarget(e)) {
  376. let left: any = isNaN(parseInt(sliderList.style.left))
  377. ? 0
  378. : parseInt(sliderList.style.left);
  379. left = Math.abs(left);
  380. if (left >= width) {
  381. sliderList.style.left = -width + "px";
  382. } else {
  383. sliderList.style.left =
  384. -leftInit - Math.abs(e.mation.moveX - e.mation.startX) + "px";
  385. }
  386. }
  387. },
  388. swipeRight: function (e: any) {
  389. if (!proxyData.checkMoveTarget(e)) {
  390. let left: any = isNaN(parseInt(sliderList.style.left))
  391. ? 0
  392. : parseInt(sliderList.style.left);
  393. if (left >= 0) {
  394. sliderList.style.left = 0 + "px";
  395. } else {
  396. sliderList.style.left =
  397. -leftInit + Math.abs(e.mation.moveX - e.mation.startX) + "px";
  398. }
  399. }
  400. },
  401. });
  402. },
  403. // 判断滑动的是否是滑快
  404. checkMoveTarget(el: any) {
  405. let endBox: any = document.querySelector("#endBoxId");
  406. let endEnd: any = document.querySelector("#endId");
  407. let endRadio: any = document.querySelector("#endRadioId");
  408. if (
  409. el.target === endBox ||
  410. el.target === endEnd ||
  411. el.target === endRadio
  412. ) {
  413. return true;
  414. }
  415. return false;
  416. },
  417. // 判断滑动的位置是否包含服务定制的位置(如果当前滑动的位置在服务定制处不让滑动)
  418. checkPersionService() {
  419. let flag: any = false;
  420. for (let i = proxyData.startIndex; i < proxyData.endIndex; i++) {
  421. if (proxyData.nowTimerArr[i].isServiceTime) {
  422. flag = true;
  423. break;
  424. }
  425. }
  426. proxyData.formBtn = flag;
  427. },
  428. cancelRemoveListener() {
  429. let endBox: any = document.querySelector("#endBoxId");
  430. endBox.removeEventListener("touchstart", function (e: any) {}, false);
  431. endBox.removeEventListener("touchend", function (e: any) {}, false);
  432. endBox.removeEventListener("touchmove", function (e: any) {}, false);
  433. let sliderList: any = document.querySelector("#sliderListId");
  434. sliderList.removeEventListener(
  435. "touchstart",
  436. function (e: any) {},
  437. false
  438. );
  439. sliderList.removeEventListener("touchend", function (e: any) {}, false);
  440. sliderList.removeEventListener(
  441. "touchmove",
  442. function (e: any) {},
  443. false
  444. );
  445. },
  446. /**
  447. * 日历滑动
  448. */
  449. endBoxSwiper() {
  450. let sliderList: any = document.querySelector("#sliderListId");
  451. let endBox: any = document.querySelector("#endBoxId");
  452. let sliderBtnEl: any = document.querySelector("#sliderBtnId");
  453. let startEl: any = document.querySelector("#startId");
  454. let sliderBoxEl: any = document.querySelectorAll(".slider-box")[0];
  455. let sliderInitLeft: any = 0;
  456. let sliderBtnLeft: any = 0;
  457. let screenLeft: any = 0;
  458. let startElLeft: any = 0;
  459. let sliderBtnWidth: any = 0;
  460. let sliderBoxWidth: any = 0;
  461. let direction: any = 0; // 0是像左 1表示向右边移动
  462. let isMove: any = false;
  463. endBox.addEventListener("touchstart", function (e: any) {
  464. isMove = false;
  465. startElLeft = isNaN(parseInt(startEl.style.left))
  466. ? 0
  467. : parseInt(startEl.style.left);
  468. // sliderInitLeft = isNaN(parseInt(sliderList.style.left))
  469. // ? 0
  470. // : parseInt(sliderList.style.left);
  471. sliderBtnLeft = isNaN(parseInt(sliderBtnEl.style.left))
  472. ? 0
  473. : parseInt(sliderBtnEl.style.left);
  474. // sliderInitLeft = Math.abs(sliderInitLeft);
  475. sliderBtnWidth = sliderBtnEl.offsetWidth;
  476. sliderBoxWidth = sliderBoxEl.offsetWidth;
  477. });
  478. endBox.addEventListener("touchend", function (e: any) {
  479. // console.log(e);
  480. if (isMove) {
  481. sliderBtnWidth = sliderBtnEl.offsetWidth;
  482. let index: any = Math.ceil(
  483. sliderBtnWidth / sliderBoxEl.offsetWidth
  484. );
  485. if (proxyData.startIndex + index >= proxyData.timerArr.length - 1) {
  486. index = proxyData.timerArr.length - 1 - proxyData.startIndex;
  487. }
  488. sliderBtnEl.style.width = sliderBoxEl.offsetWidth * index + "px";
  489. sliderBtnEl.style.background = `rgba(0,0,0,0.2)`;
  490. // debugger;
  491. proxyData.setOptionnalPerstion(proxyData.startIndex, index);
  492. isMove = false;
  493. // 判断按钮是否可以点击(如果选择的时候包含服务定制时间,则不可点击)
  494. proxyData.checkPersionService();
  495. }
  496. });
  497. swiper(endBox, {
  498. swipeLeft: function (e: any) {
  499. if (proxyData.checkMoveTarget(e)) {
  500. direction = 0;
  501. isMove = true;
  502. let moveRealX: any = Math.abs(e.mation.moveX - e.mation.startX);
  503. let sliderLeft: any = isNaN(parseInt(sliderList.style.left))
  504. ? 0
  505. : parseInt(sliderList.style.left);
  506. sliderLeft = Math.abs(sliderLeft);
  507. let width: any = sliderBoxEl.offsetWidth;
  508. if (sliderBtnWidth - moveRealX <= width) {
  509. sliderBtnEl.style.width = width + "px";
  510. } else {
  511. sliderBtnEl.style.width = sliderBtnWidth - moveRealX + "px";
  512. proxyData.cancelSliderBoxColor();
  513. }
  514. let bg: any = parseImgUrl("ipdImages", "time-wait.svg");
  515. sliderBtnEl.style.background = `linear-gradient(0deg, rgba(0, 255, 163, 0.2), rgba(0, 255, 163, 0.2))`;
  516. if (
  517. sliderBtnLeft + (sliderBtnWidth - moveRealX) - sliderBoxWidth <
  518. sliderLeft
  519. ) {
  520. let left: any =
  521. -sliderLeft +
  522. (sliderLeft +
  523. sliderBoxWidth -
  524. (sliderBtnLeft + sliderBtnWidth - moveRealX));
  525. if (left > 0) {
  526. sliderList.style.left = 0 + "px";
  527. } else {
  528. sliderList.style.left = left + "px";
  529. }
  530. }
  531. }
  532. },
  533. swipeRight: function (e: any) {
  534. if (proxyData.checkMoveTarget(e)) {
  535. isMove = true;
  536. direction = 1;
  537. let moveRealX: any = Math.abs(e.mation.moveX - e.mation.startX);
  538. sliderBtnEl.style.background = `linear-gradient(0deg, rgba(0, 255, 163, 0.2), rgba(0, 255, 163, 0.2))`;
  539. let sliderLeft: any = isNaN(parseInt(sliderList.style.left))
  540. ? 0
  541. : parseInt(sliderList.style.left);
  542. sliderLeft = Math.abs(sliderLeft);
  543. let width: any =
  544. sliderList.offsetWidth - proxyData.screenInfo.screenWidth;
  545. screenLeft = sliderLeft + proxyData.screenInfo.screenWidth;
  546. if (
  547. sliderBtnLeft +
  548. sliderBtnWidth +
  549. moveRealX +
  550. sliderBoxEl.offsetWidth * 2 >=
  551. screenLeft
  552. ) {
  553. let left: any =
  554. -sliderLeft -
  555. (sliderBtnLeft +
  556. sliderBtnWidth +
  557. moveRealX +
  558. sliderBoxEl.offsetWidth * 2 -
  559. screenLeft);
  560. sliderList.style.left = left + "px";
  561. if (sliderLeft >= width) {
  562. sliderList.style.left = -width + "px";
  563. }
  564. }
  565. if (
  566. sliderBtnLeft +
  567. sliderBtnWidth +
  568. moveRealX +
  569. sliderBoxEl.offsetWidth >=
  570. sliderList.offsetWidth
  571. ) {
  572. sliderBtnEl.style.width =
  573. sliderList.offsetWidth -
  574. sliderBtnLeft -
  575. sliderBoxEl.offsetWidth +
  576. "px";
  577. } else {
  578. sliderBtnEl.style.width = sliderBtnWidth + moveRealX + "px";
  579. }
  580. }
  581. },
  582. });
  583. },
  584. cancelSliderBoxColor() {
  585. let sliderBoxArr: any = document.querySelectorAll(".slider-box");
  586. for (let i = 0; i < sliderBoxArr.length; i++) {
  587. if (!proxyData.nowTimerArr[i].isCheck) {
  588. if (
  589. i >= proxyData.startIndex &&
  590. i < proxyData.startIndex + proxyData.startLen
  591. ) {
  592. sliderBoxArr[i].style.background =
  593. "linear-gradient(0deg, rgba(0, 255, 163, 0.2), rgba(0, 255, 163, 0.2))";
  594. }
  595. }
  596. }
  597. },
  598. /**
  599. * 设置可选日期的位置
  600. */
  601. setOptionnalPerstion(index: any, len: any = 1) {
  602. // debugger
  603. let sliderList: any = document.querySelector("#sliderListId");
  604. proxyData.startIndex = index;
  605. proxyData.startLen = len;
  606. proxyData.endIndex = proxyData.startIndex + len;
  607. let slidersWrapper: any = document.querySelector("#slidersWrapperId");
  608. let slidersWrapperWidth: any =
  609. slidersWrapper.getBoundingClientRect().width;
  610. let sliderBtnEl: any = document.querySelector("#sliderBtnId");
  611. let endEnd: any = document.querySelector("#endBoxId");
  612. let sliderBoxArr: any = document.querySelectorAll(".slider-box");
  613. let parseIndex = proxyData.getTomorrowIndex();
  614. for (let i = 0; i < sliderBoxArr.length; i++) {
  615. if (i >= parseIndex) {
  616. sliderBoxArr[i].style.background = "transparent";
  617. }
  618. }
  619. let bg: any = parseImgUrl("ipdImages", "time-wait.svg");
  620. for (let i = 0; i < len; i++) {
  621. sliderBoxArr[
  622. index + i
  623. ].style.background = `linear-gradient(0deg, rgba(0, 255, 163, 0.2), rgba(0, 255, 163, 0.2)), url(${bg})`;
  624. }
  625. sliderBtnEl.style.width = slidersWrapperWidth * len + "px";
  626. sliderBtnEl.style.background = `rgba(0,0,0,0.2)`;
  627. let left: any = slidersWrapperWidth * index;
  628. sliderBtnEl.style.left = left + "px";
  629. // // 已被选择的时间
  630. proxyData.setCheckTimeStyle();
  631. // // 固定服务时间(空间服务时间)
  632. proxyData.setServiceTimerStyle();
  633. // 过去的时间应该去掉
  634. proxyData.setPastTime();
  635. },
  636. /**
  637. * 设置过去的时间
  638. */
  639. setPastTime() {
  640. // debugger;
  641. if (proxyData.nowData.week === "今天") {
  642. let index: any = proxyData.getNowIndex();
  643. let sliderBoxArr: any = document.querySelectorAll(".slider-box");
  644. for (let i = 0; i < sliderBoxArr.length; i++) {
  645. if (i < index) {
  646. sliderBoxArr[i].style.background = `rgba(196, 196, 196, 0.2)`;
  647. }
  648. }
  649. }
  650. },
  651. /**
  652. * 设置已经选中时间
  653. */
  654. setCheckTimeStyle() {
  655. let timerArr: any = proxyData.nowTimerArr;
  656. let sliderBoxArr: any = document.querySelectorAll(".slider-box");
  657. for (let i = 0; i < timerArr.length; i++) {
  658. if (timerArr[i].isCheck) {
  659. sliderBoxArr[i].style.background = proxyData.bgRed;
  660. }
  661. }
  662. },
  663. /***
  664. * 固定服务时间的颜色增加
  665. */
  666. setServiceTimerStyle() {
  667. let timerArr: any = proxyData.nowTimerArr;
  668. // debugger
  669. let sliderBoxArr: any = document.querySelectorAll(".slider-box");
  670. for (let i = 0; i < timerArr.length; i++) {
  671. if (timerArr[i].isServiceTime) {
  672. sliderBoxArr[i].style.background = `rgba(196, 196, 196, 0.2)`;
  673. }
  674. }
  675. },
  676. // 转化日期(分钟处理成可选择)
  677. parseCusStartTime(time: any) {
  678. let newTime: any = time;
  679. if (time) {
  680. let minute: any = (time / 100) % 100;
  681. if (minute) {
  682. let temTimeInt: any = time / 10000;
  683. temTimeInt = parseInt(temTimeInt);
  684. if (minute < 30) {
  685. if (temTimeInt < 10) {
  686. newTime = "0" + temTimeInt + "30" + "00";
  687. } else {
  688. newTime = temTimeInt + "30" + "00";
  689. }
  690. } else if (minute > 30) {
  691. temTimeInt = temTimeInt + 1;
  692. if (temTimeInt < 10) {
  693. newTime = "0" + temTimeInt + "00" + "00";
  694. } else {
  695. newTime = temTimeInt + "00" + "00";
  696. }
  697. }
  698. }
  699. }
  700. return newTime;
  701. },
  702. // 转化日期(分钟处理成可选择)
  703. parseCusEndTime(time: any) {
  704. let newTime: any = time;
  705. if (time) {
  706. let minute: any = (time / 100) % 100;
  707. if (minute) {
  708. let temTimeInt: any = time / 10000;
  709. temTimeInt = parseInt(temTimeInt);
  710. if (minute < 30) {
  711. if (temTimeInt < 10) {
  712. newTime = "0" + temTimeInt + "00" + "00";
  713. } else {
  714. newTime = temTimeInt + "00" + "00";
  715. }
  716. } else if (minute > 30) {
  717. if (temTimeInt < 10) {
  718. newTime = "0" + temTimeInt + "30" + "00";
  719. } else {
  720. newTime = temTimeInt + "30" + "00";
  721. }
  722. }
  723. }
  724. }
  725. return newTime;
  726. },
  727. /**
  728. * 选中当前模块
  729. */
  730. checkSlider(item: any, index: any) {
  731. if (index === proxyData.nowTimerArr.length - 1) {
  732. return;
  733. }
  734. // 按钮的状态
  735. proxyData.formBtn = false;
  736. let nowIndex: any = proxyData.getNowIndex();
  737. if (proxyData.nowData.week === "今天" && index < nowIndex) {
  738. return;
  739. }
  740. let spaceCustomContentList: any =
  741. proxyData.nowData.spaceCustomContentList || [];
  742. let formatTimer: any = proxyData.nowTimerArr[index].formatTimer; //在服务定制时间之间
  743. let flag: any = false;
  744. spaceCustomContentList.map((spaceCustom: any) => {
  745. let startTime: any = proxyData.parseCusStartTime(
  746. spaceCustom.startTime
  747. );
  748. let endTime: any = proxyData.parseCusEndTime(spaceCustom.endTime);
  749. if (formatTimer >= startTime && formatTimer < endTime) {
  750. flag = true;
  751. }
  752. });
  753. if (flag) {
  754. return;
  755. }
  756. proxyData.setOptionnalPerstion(index);
  757. },
  758. /**
  759. * 获取个人加班申请数据
  760. */
  761. dateArr: dateArr,
  762. myTimeArr: myTimeArr,
  763. isAir: false,
  764. isLight: false,
  765. lightNum: 0,
  766. airNum: 0,
  767. // 格式化设备
  768. formateEquipment() {
  769. proxyData.isLight = false;
  770. proxyData.isAir = false;
  771. proxyData.lightNum = 0;
  772. proxyData.airNum = 0;
  773. if (
  774. proxyData.nowData &&
  775. proxyData.nowData.equipmentList &&
  776. proxyData.nowData.equipmentList.length
  777. ) {
  778. if (proxyData.enterType === 1) {
  779. proxyData.nowData.equipmentList.map((item: any) => {
  780. item.isCheck = true;
  781. });
  782. } else if (proxyData.enterType === 2) {
  783. // 空调
  784. if (proxyData.deviceItem && proxyData.deviceItem.id) {
  785. proxyData.nowData.equipmentList.map((item: any) => {
  786. if (
  787. item.equipmentCategory !== "SELTLT" &&
  788. proxyData.deviceItem.id == item.id
  789. ) {
  790. item.isCheck = true;
  791. } else {
  792. item.isCheck = false;
  793. }
  794. });
  795. } else {
  796. proxyData.nowData.equipmentList.map((item: any) => {
  797. if (item.equipmentCategory !== "SELTLT") {
  798. item.isCheck = true;
  799. } else {
  800. item.isCheck = false;
  801. }
  802. });
  803. }
  804. } else {
  805. // 灯
  806. if (proxyData.deviceItem && proxyData.deviceItem.id) {
  807. proxyData.nowData.equipmentList.map((item: any) => {
  808. if (
  809. item.equipmentCategory === "SELTLT" &&
  810. proxyData.deviceItem.id == item.id
  811. ) {
  812. item.isCheck = true;
  813. } else {
  814. item.isCheck = false;
  815. }
  816. });
  817. } else {
  818. proxyData.nowData.equipmentList.map((item: any) => {
  819. if (item.equipmentCategory === "SELTLT") {
  820. item.isCheck = true;
  821. } else {
  822. item.isCheck = false;
  823. }
  824. });
  825. }
  826. }
  827. // 判断是否有空调和灯
  828. proxyData.nowData.equipmentList.map((item: any) => {
  829. if (item.equipmentCategory == "SELTLT") {
  830. proxyData.isLight = true;
  831. proxyData.lightNum++;
  832. }
  833. if (item.equipmentCategory !== "SELTLT") {
  834. proxyData.isAir = true;
  835. proxyData.airNum++;
  836. }
  837. });
  838. }
  839. },
  840. // 加班时间是否在所有的服务定制时间之前
  841. isCusTimeBefore(spaceCustomContentList: any, time: any) {
  842. let flag: any = false;
  843. spaceCustomContentList.map((item: any) => {
  844. if (time < item.startTime) {
  845. flag = true;
  846. }
  847. });
  848. return flag;
  849. },
  850. // 设置加班选中区域
  851. setWorkTimeList() {
  852. proxyData.isUpdate = false;
  853. proxyGlobal.proxy.$loadinngEnd();
  854. let data: any = proxyData.workkArr;
  855. proxyData.dateArr = [];
  856. let nowDate: any = formatDate("YYYY-MM-DD");
  857. for (let i = 0; i < data.length; i++) {
  858. let date: any = formatDateStr(data[i].date);
  859. let spaceCustomContentList: any =
  860. data[i].spaceCustomContentList || []; // 固定服务定制时间
  861. let week: any = getWeekDate(new Date(date).getDay());
  862. if (date === nowDate) {
  863. week = "今天";
  864. }
  865. let timerArr: any = [];
  866. for (let i = 0; i < proxyData.timerArr.length; i++) {
  867. let obj: any = {
  868. timer: proxyData.timerArr[i],
  869. isCheck: false,
  870. isServiceTime: false,
  871. formatTimer: proxyData.timerArr[i].replace(/[:]/g, "") + "00",
  872. };
  873. timerArr.push(obj);
  874. }
  875. let customSceneList: any = data[i]?.customSceneList ?? [];
  876. customSceneList.map((custom: any) => {
  877. for (let j = 0; j < timerArr.length; j++) {
  878. if (
  879. proxyData.isCusTimeBefore(
  880. spaceCustomContentList,
  881. custom.endTime
  882. )
  883. ) {
  884. // 加班时间在服务定制时间之前
  885. let tempStartTime: any = proxyData.parseCusStartTime(
  886. custom.startTime
  887. );
  888. let tempEndTime: any = proxyData.parseCusStartTime(
  889. custom.endTime
  890. );
  891. if (
  892. timerArr[j].formatTimer >= tempStartTime &&
  893. timerArr[j].formatTimer < tempEndTime
  894. ) {
  895. timerArr[j].isCheck = true;
  896. }
  897. } else {
  898. // 加班时间在服务外定制时间之后
  899. // debugger
  900. let tempStartTime: any = proxyData.parseCusEndTime(
  901. custom.startTime
  902. );
  903. let tempEndTime: any = proxyData.parseCusEndTime(
  904. custom.endTime
  905. );
  906. if (
  907. timerArr[j].formatTimer >= tempStartTime &&
  908. timerArr[j].formatTimer < tempEndTime
  909. ) {
  910. timerArr[j].isCheck = true;
  911. }
  912. }
  913. }
  914. });
  915. spaceCustomContentList.map((spaceCustom: any) => {
  916. let startTime: any = proxyData.parseCusStartTime(
  917. spaceCustom.startTime
  918. );
  919. let endTime: any = proxyData.parseCusEndTime(spaceCustom.endTime);
  920. console.log("t==", endTime);
  921. // 是否在固定区域时间
  922. if (startTime && endTime) {
  923. // debugger
  924. timerArr.map((item: any) => {
  925. if (
  926. item.formatTimer >= startTime &&
  927. item.formatTimer < endTime
  928. ) {
  929. item.isServiceTime = true;
  930. }
  931. });
  932. }
  933. });
  934. proxyData.dateArr.push({
  935. date: date,
  936. isActive: false,
  937. equipmentList: data[i].equipmentList || [],
  938. oldDate: data[i].date,
  939. objectId: data[i].objectId,
  940. cusStartTime: data[i].cusStartTime,
  941. customSceneList: customSceneList,
  942. cusEndTime: data[i].cusEndTime,
  943. spaceCustomContentList: data[i].spaceCustomContentList || [],
  944. day: getDate(new Date(date)),
  945. week: week,
  946. timerArr: timerArr,
  947. });
  948. }
  949. // debugger
  950. proxyData.dateArr.map((item: any, index: any) => {
  951. if (index === proxyData.activeIndex) {
  952. proxyData.checkDate(item, index);
  953. return;
  954. }
  955. });
  956. },
  957. clearTimerBoxStyle() {
  958. proxyData.dateArr.map((elItem: any) => {
  959. elItem.isActive = false;
  960. });
  961. let timerArr: any = proxyData.nowTimerArr;
  962. let sliderBoxArr: any = document.querySelectorAll(".slider-box");
  963. for (let i = 0; i < timerArr.length; i++) {
  964. sliderBoxArr[i].style.background = `transparent`;
  965. }
  966. // 切换日期的时候取消绑定
  967. // proxyData.cancelRemoveListener();
  968. },
  969. /**
  970. * 切换日期
  971. */
  972. activeIndex: 0,
  973. // 点击审批的时候触发接口
  974. checkApprovalStatus(item: any, e: any) {
  975. if (e.target) {
  976. let targetWidth: any = e.target.offsetWidth * 0.7;
  977. let left: any = item.left - targetWidth * 1.5 + e.offsetX;
  978. let sliderBoxEl: any = document.querySelectorAll(".slider-box")[0];
  979. let sliderWidth: any = sliderBoxEl.offsetWidth;
  980. let index: any = Math.ceil(left / sliderWidth);
  981. proxyData.checkSlider({}, index);
  982. }
  983. },
  984. approvalData: approvalData,
  985. // 获取slider的宽度
  986. getSliderWapperWidth() {
  987. let slidersWrapper: any = document.querySelector("#slidersWrapperId");
  988. let slidersWrapperWidth: any =
  989. slidersWrapper.getBoundingClientRect().width;
  990. return slidersWrapperWidth;
  991. },
  992. // 格式化审批状态的数据位置
  993. formateApproveStatusPerstion() {
  994. if (proxyData.nowData) {
  995. let spaceCustomContentList: any =
  996. proxyData.nowData.customSceneList || [];
  997. let slidersWrapperWidth: any = proxyData.getSliderWapperWidth();
  998. proxyData.approvalData = [];
  999. for (let i = 0; i < spaceCustomContentList.length; i++) {
  1000. let item: any = spaceCustomContentList[i];
  1001. // 加班数据
  1002. let obj: any = {
  1003. left: 0,
  1004. bg: "",
  1005. index: 0,
  1006. approvalStatus: item.approvalStatus,
  1007. text: "",
  1008. };
  1009. if (item.approvalStatus == 0) {
  1010. obj.text = "待审批";
  1011. obj.bg = "rgba(65, 107, 255, 0.6)";
  1012. } else if (item.approvalStatus == 1) {
  1013. obj.text = "已通过";
  1014. obj.bg = "rgba(24, 196, 93, 0.6)";
  1015. } else if (item.approvalStatus == 2) {
  1016. obj.text = "已拒绝";
  1017. obj.bg = "rgba(255, 54, 54, 0.6)";
  1018. }
  1019. // else if (item.approvalStatus == 3) {
  1020. // obj.text = "已失效";
  1021. // obj.bg = "rgba(255, 54, 54, 0.6)";
  1022. // }
  1023. if (obj.text) {
  1024. let startTime: any = proxyData.parseCusStartTime(item.startTime);
  1025. let endTime: any = proxyData.parseCusEndTime(item.endTime);
  1026. let relNowTime: any = getRelNowTime();
  1027. let timerArr: any = proxyData.nowTimerArr;
  1028. let leftStart: any = 0;
  1029. let leftEnd: any = 0;
  1030. timerArr.map((timer: any, index: any) => {
  1031. if (timer.formatTimer == startTime) {
  1032. if (slidersWrapperWidth) {
  1033. leftStart = slidersWrapperWidth * index;
  1034. }
  1035. }
  1036. if (timer.formatTimer == endTime) {
  1037. if (slidersWrapperWidth) {
  1038. leftEnd = slidersWrapperWidth * index;
  1039. }
  1040. }
  1041. });
  1042. obj.left = leftStart + (leftEnd - leftStart) * 0.5 - 30;
  1043. if (relNowTime < endTime) {
  1044. proxyData.approvalData.push(obj);
  1045. }
  1046. }
  1047. }
  1048. }
  1049. },
  1050. checkDate(item: any, index: any) {
  1051. proxyData.clearTimerBoxStyle();
  1052. item.isActive = true;
  1053. proxyData.activeIndex = index;
  1054. proxyData.nowTimerArr = proxyData.dateArr[index].timerArr;
  1055. proxyData.nowData = proxyData.dateArr[index];
  1056. proxyData.formateEquipment();
  1057. nextTick(() => {
  1058. proxyData.setNowBarPerstion(proxyData.nowTimerArr);
  1059. let nowIndex: any = proxyData.getNowIndex();
  1060. // // 已经被选择的时间
  1061. proxyData.setCheckTimeStyle();
  1062. // // 固定服务时间
  1063. proxyData.setServiceTimerStyle();
  1064. if (proxyData.nowData.week === "今天") {
  1065. proxyData.setPastTime();
  1066. }
  1067. // 设置审批状态
  1068. proxyData.formateApproveStatusPerstion();
  1069. if (!proxyData.isEvent) {
  1070. proxyData.changeEl();
  1071. proxyData.isEvent = true;
  1072. }
  1073. });
  1074. },
  1075. /**
  1076. * dom的滚动功能设置
  1077. */
  1078. flag: false,
  1079. changeEl() {
  1080. // 事件解绑定
  1081. // proxyData.cancelRemoveListener();
  1082. proxyData.setScreennWidth();
  1083. proxyData.sliderSwiper();
  1084. proxyData.endBoxSwiper();
  1085. },
  1086. // 加班数据格式化=》后台需要的数据结构(添加加班逻辑)
  1087. formateAddTimer() {
  1088. let customSceneList: any = proxyData.nowData.customSceneList;
  1089. let timerArr: any = proxyData.nowData.timerArr;
  1090. let startTime: any = timerArr[proxyData.startIndex].formatTimer;
  1091. let endTime: any = timerArr[proxyData.endIndex].formatTimer;
  1092. // debugger;
  1093. let delTimerArr: any = [];
  1094. // 加班时间拼接
  1095. customSceneList.map((item: any, index: any) => {
  1096. // let itemStartTime:any=proxyData.parseCusStartTime(item.startTime)
  1097. // let itemEndTime:any=proxyData.parseCusStartTime(item.endTime)
  1098. // item时间段保护当前时间端
  1099. if (startTime < item.startTime) {
  1100. if (endTime < item.startTime) {
  1101. } else if (endTime >= item.startTime) {
  1102. // 时间段连续拼接上
  1103. let delObj: any = proxyData.formaTimeObj(
  1104. item,
  1105. "1",
  1106. item.startTime,
  1107. item.endTime
  1108. );
  1109. delTimerArr.push(delObj);
  1110. startTime = startTime;
  1111. endTime = endTime;
  1112. }
  1113. } else if (startTime >= item.startTime && startTime < item.endTime) {
  1114. if (endTime <= item.endTime) {
  1115. let delObj: any = proxyData.formaTimeObj(
  1116. item,
  1117. "1",
  1118. item.startTime,
  1119. item.endTime
  1120. );
  1121. delTimerArr.push(delObj);
  1122. startTime = startTime;
  1123. endTime = endTime;
  1124. } else if (endTime > item.endTime) {
  1125. let delObj: any = proxyData.formaTimeObj(
  1126. item,
  1127. "1",
  1128. item.startTime,
  1129. item.endTime
  1130. );
  1131. delTimerArr.push(delObj);
  1132. startTime = item.startTime;
  1133. endTime = endTime;
  1134. }
  1135. } else if (startTime >= item.endTime) {
  1136. if (startTime === item.endTime) {
  1137. let delObj: any = proxyData.formaTimeObj(
  1138. item,
  1139. "1",
  1140. item.startTime,
  1141. item.endTime
  1142. );
  1143. delTimerArr.push(delObj);
  1144. startTime = item.startTime;
  1145. endTime = endTime;
  1146. }
  1147. } else if (startTime === item.startTime && endTime === item.endTime) {
  1148. // 两个时间段一致
  1149. }
  1150. });
  1151. // 加班时间处理好后和服务定制时间做对比(处理时分秒的情况)
  1152. let cusStartTime: any = proxyData.parseCusStartTime(
  1153. proxyData.nowData.cusStartTime
  1154. );
  1155. let cusEndTime: any = proxyData.parseCusEndTime(
  1156. proxyData.nowData.cusEndTime
  1157. );
  1158. if (startTime < cusStartTime && endTime <= cusStartTime) {
  1159. if (endTime === cusStartTime) {
  1160. endTime = proxyData.nowData.cusStartTime;
  1161. }
  1162. } else if (startTime >= cusEndTime) {
  1163. if (startTime === cusEndTime) {
  1164. startTime = proxyData.nowData.cusEndTime;
  1165. }
  1166. }
  1167. let relNowTime: any = getRelNowTime();
  1168. let type = "0";
  1169. if (
  1170. proxyData.nowData.week === "今天" &&
  1171. relNowTime >= startTime &&
  1172. relNowTime <= endTime
  1173. ) {
  1174. type = "2";
  1175. }
  1176. // if()
  1177. let addObj: any = proxyData.formaTimeObj(
  1178. customSceneList[0],
  1179. type,
  1180. startTime,
  1181. endTime
  1182. );
  1183. delTimerArr.push(addObj);
  1184. let formTimeArr: any = delTimerArr;
  1185. return formTimeArr;
  1186. },
  1187. // 格式化加班单个数据
  1188. formaTimeObj(item: any, type: any, startTime: any, endTime: any) {
  1189. console.log(item);
  1190. let obj: any = {
  1191. projectId: proxyData.projectId, //类型:String 必有字段 备注:项目id
  1192. sceneEquipList:
  1193. item && item.sceneEquipList ? item.sceneEquipList : [],
  1194. objectId: proxyData.nowData.objectId, //类型:String 必有字段 备注:空间id
  1195. sourceType: proxyData.userInfo.pubname, //类型:String 必有字段 备注:sagacareAndtenantslink 来源
  1196. startDate: proxyData.nowData.oldDate, //类型:String 必有字段 备注://开始日期
  1197. endDate: proxyData.nowData.oldDate, //类型:String 必有字段 备注://结束日期
  1198. startTime: startTime, //类型:String 必有字段 备注://开始时间
  1199. endTime: endTime, //类型:String 必有字段 备注://结束时间
  1200. type: type, //类型:String 必有字段 备注://0 预约加班,1 取消,2 加班(我来了), 3 最后一个走
  1201. userId: proxyData.userInfo.userId, //类型:String 必有字段 备注://用户id
  1202. userPhone: proxyData.userInfo.userPhone, //类型:String 必有字段 备注://手机号
  1203. customSceneEqType: "ALL", //类型:String 必有字段 备注://来源 AC 空调入口, SE 灯入口 ALL 加班入口
  1204. userName: proxyData.userInfo.userName, //类型:String 必有字段 备注://名字
  1205. };
  1206. if (type === "1") {
  1207. obj.id = item.id; //类型:String 必有字段 备注:取消加班时必传
  1208. }
  1209. return obj;
  1210. },
  1211. // 加班数据格式化=》后台需要的数据结构(删除加班逻辑)
  1212. formateDelTimer() {
  1213. let timerArr: any = proxyData.nowData.timerArr;
  1214. let endIndex: any = proxyData.endIndex > 0 ? proxyData.endIndex - 1 : 0;
  1215. // debugger
  1216. // 如果当前选择的日期只在已经选中的范围内
  1217. if (
  1218. timerArr[proxyData.startIndex].isCheck &&
  1219. timerArr[endIndex].isCheck
  1220. ) {
  1221. let customSceneList: any = proxyData.nowData.customSceneList || [];
  1222. let startTime: any = timerArr[proxyData.startIndex].formatTimer;
  1223. let endTime: any = timerArr[proxyData.endIndex].formatTimer;
  1224. let delTimerArr: any = [];
  1225. let addTimeArr: any = [];
  1226. // 删除时间的数据拼接
  1227. for (let i = 0; i < customSceneList.length; i++) {
  1228. let item: any = customSceneList[i];
  1229. let index: any = i;
  1230. if (item.startTime === startTime && item.endTime === endTime) {
  1231. // 代表需要删除该段
  1232. // 整段删除
  1233. let delObj: any = proxyData.formaTimeObj(
  1234. item,
  1235. "1",
  1236. item.startTime,
  1237. item.endTime
  1238. );
  1239. delTimerArr.push(delObj);
  1240. break;
  1241. } else if (item.startTime < startTime) {
  1242. if (item.endTime <= endTime) {
  1243. let delObj: any = proxyData.formaTimeObj(
  1244. item,
  1245. "1",
  1246. item.startTime,
  1247. item.endTime
  1248. );
  1249. delTimerArr.push(delObj);
  1250. let addObj: any = proxyData.formaTimeObj(
  1251. customSceneList[0],
  1252. "0",
  1253. item.startTime,
  1254. startTime
  1255. );
  1256. addTimeArr.push(addObj);
  1257. } else if (item.endTime > endTime) {
  1258. let delObj: any = proxyData.formaTimeObj(
  1259. item,
  1260. "1",
  1261. item.startTime,
  1262. item.endTime
  1263. );
  1264. delTimerArr.push(delObj);
  1265. let addObj1: any = proxyData.formaTimeObj(
  1266. customSceneList[0],
  1267. "0",
  1268. item.startTime,
  1269. startTime
  1270. );
  1271. addTimeArr.push(addObj1);
  1272. let addObj2: any = proxyData.formaTimeObj(
  1273. customSceneList[0],
  1274. "0",
  1275. endTime,
  1276. item.endTime
  1277. );
  1278. addTimeArr.push(addObj2);
  1279. }
  1280. } else if (item.startTime === item.startTime) {
  1281. if (item.endTime <= endTime) {
  1282. // 整段删除
  1283. let delObj: any = proxyData.formaTimeObj(
  1284. item,
  1285. "1",
  1286. item.startTime,
  1287. item.endTime
  1288. );
  1289. delTimerArr.push(delObj);
  1290. } else if (item.endTime > endTime) {
  1291. let delObj: any = proxyData.formaTimeObj(
  1292. item,
  1293. "1",
  1294. item.startTime,
  1295. item.endTime
  1296. );
  1297. delTimerArr.push(delObj);
  1298. let addObj1: any = proxyData.formaTimeObj(
  1299. customSceneList[0],
  1300. "0",
  1301. endTime,
  1302. item.endTime
  1303. );
  1304. addTimeArr.push(addObj1);
  1305. }
  1306. } else if (item.startTime > startTime) {
  1307. if (item.endTime <= endTime) {
  1308. // 整段删除
  1309. let delObj: any = proxyData.formaTimeObj(
  1310. item,
  1311. "1",
  1312. item.startTime,
  1313. item.endTime
  1314. );
  1315. delTimerArr.push(delObj);
  1316. } else if (item.endTime > endTime) {
  1317. let delObj: any = proxyData.formaTimeObj(
  1318. item,
  1319. "1",
  1320. item.startTime,
  1321. item.endTime
  1322. );
  1323. delTimerArr.push(delObj);
  1324. let addObj1: any = proxyData.formaTimeObj(
  1325. customSceneList[0],
  1326. "0",
  1327. endTime,
  1328. item.endTime
  1329. );
  1330. addTimeArr.push(addObj1);
  1331. }
  1332. }
  1333. }
  1334. // 删除的时间为当时时间的时候
  1335. let delStartTime: any = 0;
  1336. let formTimeArr: any = addTimeArr.concat(delTimerArr);
  1337. let realTime: any = getRelNowTime();
  1338. formTimeArr.map((item: any, index: any) => {
  1339. if (item.type == "1") {
  1340. // 删除当前时间段
  1341. if (realTime >= item.startTime && realTime <= item.endTime) {
  1342. item.type = "3";
  1343. delStartTime = item.startTime;
  1344. item.endTimeReal = realTime;
  1345. }
  1346. }
  1347. });
  1348. formTimeArr.map((item: any, index: any) => {
  1349. if (item.type == "0" && delStartTime) {
  1350. if (item.startTime == delStartTime) {
  1351. formTimeArr.splice(index, 1);
  1352. }
  1353. }
  1354. });
  1355. return formTimeArr;
  1356. } else {
  1357. return [];
  1358. }
  1359. },
  1360. // 关闭加班弹窗
  1361. closeWorkTimer() {
  1362. proxyData.formBtn = false;
  1363. context.emit("closeWork");
  1364. },
  1365. // 数组去除重复
  1366. removeDuplicateObj(arr: any) {
  1367. let obj = {};
  1368. arr = arr.reduce((newArr: any, next: any) => {
  1369. obj[next.objectId]
  1370. ? ""
  1371. : (obj[next.objectId] = true && newArr.push(next));
  1372. return newArr;
  1373. }, []);
  1374. return arr;
  1375. },
  1376. checkEquipment(item: any) {
  1377. item.isCheck = !item.isCheck;
  1378. },
  1379. // 我来了删除不受服务定制控制的设备的开关灯
  1380. delSpaceNoCtrDevice(formTimerArr: any) {
  1381. formTimerArr.map((item: any) => {
  1382. let sceneEquipList: any = item.sceneEquipList || [];
  1383. let seviceEquipmentList: any = proxyData.seviceEquipmentList;
  1384. if (item.type == "2" && sceneEquipList.length) {
  1385. sceneEquipList.map((scene: any, index: any) => {
  1386. let flag: any = false;
  1387. for (let i = 0; i < seviceEquipmentList.length; i++) {
  1388. if (
  1389. scene.objectId == seviceEquipmentList[i].id &&
  1390. seviceEquipmentList[i].isExeSpaceTime
  1391. ) {
  1392. flag = true;
  1393. }
  1394. if (flag) {
  1395. break;
  1396. }
  1397. }
  1398. if (!flag) {
  1399. item.sceneEquipList.splice(index, 1);
  1400. }
  1401. });
  1402. }
  1403. });
  1404. },
  1405. // 提交申请
  1406. addWorkTimer() {
  1407. let formTimerArr: any = proxyData.formateAddTimer();
  1408. let sceneEquipList: any = [];
  1409. proxyData.nowData.equipmentList.map((item: any) => {
  1410. if (item.isCheck) {
  1411. let obj: any = {
  1412. projectId: item.projectId, //类型:String 必有字段 备注:无
  1413. objectId: item.id, //类型:String 必有字段 备注:设备id
  1414. type: item.equipmentCategory,
  1415. };
  1416. sceneEquipList.push(obj);
  1417. }
  1418. });
  1419. if (formTimerArr && formTimerArr.length == 2) {
  1420. if (
  1421. formTimerArr[1].startTime >= formTimerArr[0].startTime &&
  1422. formTimerArr[1].endTime <= formTimerArr[0].endTime
  1423. ) {
  1424. } else {
  1425. formTimerArr.map((item: any) => {
  1426. if (item.type == "1") {
  1427. if (item.sceneEquipList && item.sceneEquipList.length) {
  1428. item.sceneEquipList.map((scene: any) => {
  1429. let obj: any = {
  1430. projectId: scene.projectId, //类型:String 必有字段 备注:无
  1431. objectId: scene.objectId, //类型:String 必有字段 备注:设备id
  1432. type: scene.type,
  1433. };
  1434. sceneEquipList.push(obj);
  1435. });
  1436. }
  1437. }
  1438. });
  1439. }
  1440. }
  1441. sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
  1442. formTimerArr.map((item: any) => {
  1443. if (item.type == "0" || item.type == "2") {
  1444. item.sceneEquipList = sceneEquipList;
  1445. }
  1446. });
  1447. // 我来了过滤设备
  1448. proxyData.delSpaceNoCtrDevice(formTimerArr);
  1449. // 保存加班记录
  1450. proxyData.saveBatchCustomScene(formTimerArr);
  1451. // 如果在当前时间,需要手动开启设备(暂时不需要手动开启设备,后台已经把此逻辑合并)
  1452. // proxyData.openDeviceAll(formTimerArr);
  1453. },
  1454. // 手动控制开启设备
  1455. openDeviceAll(formTimerArr: any) {
  1456. let sceneEquipList: any = [];
  1457. formTimerArr.map((item: any) => {
  1458. if (item.type == "2") {
  1459. sceneEquipList = sceneEquipList.concat(item.sceneEquipList);
  1460. }
  1461. });
  1462. sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
  1463. // 改变设备状态
  1464. let airDevice: any = [];
  1465. let lightDevice: any = [];
  1466. sceneEquipList.map((item: any) => {
  1467. if (item.type == "SELTLT") {
  1468. let obj: any = {
  1469. id: item.objectId,
  1470. switch: true,
  1471. };
  1472. lightDevice.push(obj);
  1473. } else {
  1474. let obj: any = {
  1475. id: item.objectId, //类型:String 必有字段 备注:设备id
  1476. code: "EquipSwitchSet", //类型:String 必有字段 备注:编码 EquipSwtichSet
  1477. value: "1", //类型:String 必有字段 备注:值 0
  1478. };
  1479. airDevice.push(obj);
  1480. }
  1481. });
  1482. proxyData.setSpaceCondtioners(airDevice);
  1483. proxyData.setallLampHttp(lightDevice);
  1484. },
  1485. // 手动开空调
  1486. setSpaceCondtioners(data: any) {
  1487. setSpaceCondtioners(data)
  1488. .then((res) => {})
  1489. .catch(() => {});
  1490. },
  1491. // 手动开灯
  1492. setallLampHttp(data: any) {
  1493. setallLampHttp(data)
  1494. .then((res) => {})
  1495. .catch(() => {});
  1496. },
  1497. // 提交加班记录
  1498. saveBatchCustomScene(formTimerArr: any, type: any = 1) {
  1499. // proxyGlobal.proxy.$loadingStart(0);
  1500. proxyData.showLoading = true;
  1501. proxyData.formBtn = true;
  1502. saveBatchCustomScene(formTimerArr)
  1503. .then((res) => {
  1504. context.emit("closeWork");
  1505. proxyData.showLoading = false;
  1506. proxyData.formBtn = false;
  1507. })
  1508. .catch(() => {
  1509. // proxyGlobal.proxy.$loadinngEnd();
  1510. context.emit("closeWork");
  1511. proxyData.showLoading = false;
  1512. proxyData.formBtn = false;
  1513. });
  1514. },
  1515. // 删除
  1516. isUpdate: false, // 删除更新弹窗数据
  1517. triggerDelTime() {
  1518. let formTimeArr: any = proxyData.formateDelTimer();
  1519. console.log("需要删除的数据---");
  1520. console.log(formTimeArr);
  1521. if (formTimeArr && formTimeArr.length) {
  1522. // console.log(formTimeArr);
  1523. // alert("确定删除当前时间吗?");
  1524. // debugger;
  1525. Dialog.confirm({
  1526. title: "确认",
  1527. message: "确定删除当前时间吗?",
  1528. })
  1529. .then(() => {
  1530. let sceneEquipList: any = [];
  1531. formTimeArr.map((item: any) => {
  1532. if (item.type == "1") {
  1533. if (item.sceneEquipList) {
  1534. item.sceneEquipList.map((scene: any) => {
  1535. let obj: any = {
  1536. projectId: scene.projectId, //类型:String 必有字段 备注:无
  1537. objectId: scene.objectId, //类型:String 必有字段 备注:设备id
  1538. type: scene.type,
  1539. };
  1540. sceneEquipList.push(obj);
  1541. });
  1542. }
  1543. }
  1544. });
  1545. sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
  1546. formTimeArr.map((item: any) => {
  1547. if (item.type !== "1") {
  1548. item.sceneEquipList = sceneEquipList;
  1549. }
  1550. });
  1551. proxyData.saveBatchCustomScene(formTimeArr, 2);
  1552. })
  1553. .catch(() => {
  1554. // on cancel
  1555. });
  1556. }
  1557. },
  1558. });
  1559. watch(props, (newProps: any) => {
  1560. proxyData.workkArr = newProps.workkArr;
  1561. proxyData.projectId = newProps.projectId;
  1562. proxyData.enterType = newProps.enterType;
  1563. proxyData.deviceItem = newProps.deviceItem;
  1564. proxyData.seviceEquipmentList = newProps.seviceEquipmentList;
  1565. console.log("弹窗变化了-----==");
  1566. // proxyData.setWorkTimeList();
  1567. });
  1568. onMounted(() => {
  1569. // 设置dom最外层的宽
  1570. // console.log("弹窗变化了-----==");
  1571. // proxyData.formateManualWorkTime();
  1572. proxyData.setWorkTimeList();
  1573. });
  1574. return {
  1575. ...toRefs(proxyData),
  1576. };
  1577. },
  1578. });
  1579. </script>
  1580. <style lang="scss" scoped>
  1581. .work-content {
  1582. position: relative;
  1583. height: 100%;
  1584. width: 100%;
  1585. overflow: hidden;
  1586. background: #fff;
  1587. }
  1588. .work-space {
  1589. width: 100%;
  1590. // padding-left: 10px;
  1591. .space-title {
  1592. padding-bottom: 10px;
  1593. font-family: "Noto Sans SC";
  1594. font-style: normal;
  1595. font-weight: 500;
  1596. font-size: 22px;
  1597. line-height: 31px;
  1598. color: #000000;
  1599. }
  1600. .tip {
  1601. padding-bottom: 20px;
  1602. font-family: "Noto Sans SC";
  1603. font-style: normal;
  1604. font-weight: 400;
  1605. font-size: 12px;
  1606. line-height: 17px;
  1607. color: #8d9399;
  1608. }
  1609. }
  1610. .add-time {
  1611. width: 100%;
  1612. // height: 80%;
  1613. background: #fff;
  1614. box-sizing: border-box;
  1615. // padding: 10px;
  1616. overflow: hidden;
  1617. .date_box {
  1618. display: flex;
  1619. justify-content: space-between;
  1620. width: 100%;
  1621. padding-bottom: 5px;
  1622. .date-item {
  1623. padding-top: 10px;
  1624. width: 50px;
  1625. height: 60px;
  1626. box-sizing: border-box;
  1627. border: 1px solid #eff0f1;
  1628. border-radius: 16px;
  1629. span {
  1630. display: block;
  1631. width: 100%;
  1632. text-align: center;
  1633. &:nth-child(1) {
  1634. font-family: "Noto Sans SC";
  1635. padding-bottom: 6px;
  1636. font-style: normal;
  1637. font-weight: 400;
  1638. font-size: 14px;
  1639. line-height: 14px;
  1640. transform: scale(0.8);
  1641. text-align: center;
  1642. color: #8d9399;
  1643. }
  1644. &:nth-child(2) {
  1645. font-family: "Persagy";
  1646. font-style: normal;
  1647. font-weight: 700;
  1648. font-size: 16px;
  1649. // line-height: 19px;
  1650. text-align: center;
  1651. color: #000000;
  1652. }
  1653. }
  1654. }
  1655. .date-item-active {
  1656. background: rgba(206, 159, 39, 0.4);
  1657. border: none;
  1658. }
  1659. }
  1660. .sliders-list {
  1661. position: relative;
  1662. margin-top: 5px;
  1663. height: 135px;
  1664. white-space: nowrap;
  1665. overflow-x: auto;
  1666. overflow-y: hidden;
  1667. .approval-status {
  1668. position: absolute;
  1669. font-family: "Montserrat";
  1670. top: 64px;
  1671. z-index: 444;
  1672. height: 30px;
  1673. line-height: 30px;
  1674. border-radius: 10px;
  1675. font-size: 12px;
  1676. transform: scale(0.7);
  1677. font-weight: 500;
  1678. text-align: center;
  1679. color: #ffffff;
  1680. }
  1681. &::-webkit-scrollbar {
  1682. display: none;
  1683. }
  1684. .sliders-wrapper {
  1685. display: inline-block;
  1686. box-sizing: border-box;
  1687. width: 72px;
  1688. height: 135px;
  1689. //border-bottom: 1px solid #ECEFF4;
  1690. &:nth-child(2n + 1) {
  1691. border-left: 1px solid #eceff4;
  1692. }
  1693. .sliders {
  1694. position: relative;
  1695. // width: 36px;
  1696. width: 100%;
  1697. height: 100%;
  1698. .label {
  1699. position: absolute;
  1700. height: 34px;
  1701. left: 0px;
  1702. top: 5px;
  1703. font-family: "PingFang SC";
  1704. font-style: normal;
  1705. font-weight: 400;
  1706. font-size: 10px;
  1707. line-height: 14px;
  1708. padding-left: 5px;
  1709. color: #8d9399;
  1710. }
  1711. .slider-box {
  1712. position: absolute;
  1713. //width: 100%;
  1714. width: 72px;
  1715. height: 100px;
  1716. left: -1px;
  1717. // top:25px;
  1718. bottom: 0px;
  1719. //background: linear-gradient(0deg, rgba(255, 0, 0, 0.2), rgba(255, 0, 0, 0.2));
  1720. }
  1721. }
  1722. }
  1723. .slider-btn {
  1724. position: absolute;
  1725. height: 100px;
  1726. //left: 40px;
  1727. top: 35px;
  1728. .start {
  1729. position: absolute;
  1730. width: 2px;
  1731. top: 0;
  1732. height: 100px;
  1733. left: 0px;
  1734. //left: 176px;
  1735. background: #04b49c;
  1736. }
  1737. .end-box {
  1738. position: absolute;
  1739. top: 0;
  1740. width: 20px;
  1741. height: 100px;
  1742. right: -8px;
  1743. z-index: 999;
  1744. //left: 286px;
  1745. .end {
  1746. position: absolute;
  1747. top: 0;
  1748. left: 10px;
  1749. width: 2px;
  1750. height: 100px;
  1751. background: #04b49c;
  1752. }
  1753. .end-radio {
  1754. width: 22px;
  1755. position: absolute;
  1756. top: 37px;
  1757. left: -1px;
  1758. height: 22px;
  1759. background: #ffffff;
  1760. border-radius: 50%;
  1761. box-shadow: 0px 1px 2px rgba(4, 38, 0, 0.2);
  1762. }
  1763. }
  1764. }
  1765. }
  1766. }
  1767. .add-time-btn {
  1768. position: absolute;
  1769. bottom: 5px;
  1770. left: 50%;
  1771. transform: translateX(-50%);
  1772. display: flex;
  1773. justify-content: space-between;
  1774. // padding-top: 10px;
  1775. text-align: center;
  1776. .cancel-btn {
  1777. // width: 32%;
  1778. width: 170px;
  1779. height: 50px;
  1780. line-height: 50px;
  1781. background: #ffffff;
  1782. border: 1px solid #c3c7cb;
  1783. border-radius: 25px;
  1784. font-size: 16px;
  1785. margin-right: 20px;
  1786. font-weight: 400;
  1787. color: #1f2529;
  1788. }
  1789. .comfirm-btn {
  1790. // width: 52%;
  1791. width: 265px;
  1792. height: 50px;
  1793. line-height: 50px;
  1794. font-weight: 400;
  1795. font-size: 16px;
  1796. text-align: center;
  1797. background: #ce9f27;
  1798. border-radius: 25px;
  1799. color: #fff;
  1800. }
  1801. .comfirm-btn-diabled {
  1802. background: rgba(196, 196, 196, 0.2);
  1803. color: #1f2529;
  1804. }
  1805. }
  1806. .work-device {
  1807. // padding-top: 10px;
  1808. height: 36vh;
  1809. overflow-y: auto;
  1810. .device-tip {
  1811. padding-top: 20px;
  1812. font-weight: 400;
  1813. font-size: 12px;
  1814. color: #8d9399;
  1815. span {
  1816. display: inline-block;
  1817. padding-bottom: 10px;
  1818. }
  1819. p {
  1820. line-height: 24px;
  1821. }
  1822. }
  1823. }
  1824. .device-box {
  1825. // display: flex;
  1826. // justify-content: space-between;
  1827. .device-row {
  1828. display: inline-block;
  1829. width: 48%;
  1830. font-family: "PingFang SC";
  1831. font-style: normal;
  1832. font-weight: 400;
  1833. font-size: 14px;
  1834. padding: 10px;
  1835. color: #1b2129;
  1836. background: #f7f9fa;
  1837. border-radius: 4px;
  1838. margin-top: 10px;
  1839. margin-bottom: 10px;
  1840. line-height: 20px;
  1841. &:nth-child(2n + 1) {
  1842. margin-right: 2%;
  1843. }
  1844. .row-item {
  1845. display: flex;
  1846. justify-content: space-between;
  1847. }
  1848. span {
  1849. display: inline-block;
  1850. font-family: "PingFang SC";
  1851. font-style: normal;
  1852. font-weight: 400;
  1853. font-size: 12px;
  1854. }
  1855. img {
  1856. width: 25px;
  1857. height: 25px;
  1858. }
  1859. }
  1860. }
  1861. .row-title {
  1862. display: block;
  1863. font-weight: 500;
  1864. font-size: 14px;
  1865. line-height: 14px;
  1866. color: #000000;
  1867. padding-top: 4px;
  1868. }
  1869. .device-title {
  1870. display: flex;
  1871. justify-content: space-between;
  1872. padding-top: 20px;
  1873. padding-bottom: 5px;
  1874. text-align: center;
  1875. .line {
  1876. display: inline-block;
  1877. flex: 1;
  1878. height: 0px;
  1879. border: 1px solid #e1e5eb;
  1880. }
  1881. .text {
  1882. display: inline-block;
  1883. width: 142px;
  1884. vertical-align: middle;
  1885. font-family: "PingFang SC";
  1886. font-style: normal;
  1887. font-weight: 400;
  1888. font-size: 12px;
  1889. color: #8d9399;
  1890. text-align: center;
  1891. margin-top: -6px;
  1892. }
  1893. }
  1894. </style>