index.vue 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953
  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="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. // debugger
  770. proxyData.isLight = false;
  771. proxyData.isAir = false;
  772. proxyData.lightNum = 0;
  773. proxyData.airNum = 0;
  774. if (
  775. proxyData.nowData &&
  776. proxyData.nowData.equipmentList &&
  777. proxyData.nowData.equipmentList.length
  778. ) {
  779. if (proxyData.enterType === 1) {
  780. // debugger
  781. proxyData.nowData.equipmentList.map((item: any) => {
  782. item.isCheck = true;
  783. });
  784. } else if (proxyData.enterType === 2) {
  785. // 空调
  786. if (proxyData.deviceItem && proxyData.deviceItem.id) {
  787. proxyData.nowData.equipmentList.map((item: any) => {
  788. if (
  789. item.equipmentCategory !== "SELTLT" &&
  790. proxyData.deviceItem.id == item.id
  791. ) {
  792. item.isCheck = true;
  793. } else {
  794. item.isCheck = false;
  795. }
  796. });
  797. } else {
  798. proxyData.nowData.equipmentList.map((item: any) => {
  799. if (item.equipmentCategory !== "SELTLT") {
  800. item.isCheck = true;
  801. } else {
  802. item.isCheck = false;
  803. }
  804. });
  805. }
  806. } else {
  807. // 灯
  808. if (proxyData.deviceItem && proxyData.deviceItem.id) {
  809. proxyData.nowData.equipmentList.map((item: any) => {
  810. if (
  811. item.equipmentCategory === "SELTLT" &&
  812. proxyData.deviceItem.id == item.id
  813. ) {
  814. item.isCheck = true;
  815. } else {
  816. item.isCheck = false;
  817. }
  818. });
  819. } else {
  820. proxyData.nowData.equipmentList.map((item: any) => {
  821. if (item.equipmentCategory === "SELTLT") {
  822. item.isCheck = true;
  823. } else {
  824. item.isCheck = false;
  825. }
  826. });
  827. }
  828. }
  829. // 判断是否有空调和灯
  830. proxyData.nowData.equipmentList.map((item: any) => {
  831. if (item.equipmentCategory == "SELTLT") {
  832. proxyData.isLight = true;
  833. proxyData.lightNum++;
  834. }
  835. if (item.equipmentCategory !== "SELTLT") {
  836. proxyData.isAir = true;
  837. proxyData.airNum++;
  838. }
  839. });
  840. }
  841. },
  842. // 加班时间是否在所有的服务定制时间之前
  843. isCusTimeBefore(spaceCustomContentList: any, time: any) {
  844. let flag: any = false;
  845. spaceCustomContentList.map((item: any) => {
  846. if (time < item.startTime) {
  847. flag = true;
  848. }
  849. });
  850. return flag;
  851. },
  852. // 设置加班选中区域
  853. setWorkTimeList() {
  854. proxyData.isUpdate = false;
  855. proxyGlobal.proxy.$loadinngEnd();
  856. let data: any = proxyData.workkArr;
  857. proxyData.dateArr = [];
  858. let nowDate: any = formatDate("YYYY-MM-DD");
  859. for (let i = 0; i < data.length; i++) {
  860. let date: any = formatDateStr(data[i].date);
  861. let spaceCustomContentList: any =
  862. data[i].spaceCustomContentList || []; // 固定服务定制时间
  863. let week: any = getWeekDate(new Date(date).getDay());
  864. if (date === nowDate) {
  865. week = "今天";
  866. }
  867. let timerArr: any = [];
  868. for (let i = 0; i < proxyData.timerArr.length; i++) {
  869. let obj: any = {
  870. timer: proxyData.timerArr[i],
  871. isCheck: false,
  872. isServiceTime: false,
  873. formatTimer: proxyData.timerArr[i].replace(/[:]/g, "") + "00",
  874. };
  875. timerArr.push(obj);
  876. }
  877. let customSceneList: any = data[i]?.customSceneList ?? [];
  878. customSceneList.map((custom: any) => {
  879. for (let j = 0; j < timerArr.length; j++) {
  880. if (
  881. proxyData.isCusTimeBefore(
  882. spaceCustomContentList,
  883. custom.endTime
  884. )
  885. ) {
  886. // 加班时间在服务定制时间之前
  887. let tempStartTime: any = proxyData.parseCusStartTime(
  888. custom.startTime
  889. );
  890. let tempEndTime: any = proxyData.parseCusStartTime(
  891. custom.endTime
  892. );
  893. if (
  894. timerArr[j].formatTimer >= tempStartTime &&
  895. timerArr[j].formatTimer < tempEndTime
  896. ) {
  897. timerArr[j].isCheck = true;
  898. }
  899. } else {
  900. // 加班时间在服务外定制时间之后
  901. // debugger
  902. let tempStartTime: any = proxyData.parseCusEndTime(
  903. custom.startTime
  904. );
  905. let tempEndTime: any = proxyData.parseCusEndTime(
  906. custom.endTime
  907. );
  908. if (
  909. timerArr[j].formatTimer >= tempStartTime &&
  910. timerArr[j].formatTimer < tempEndTime
  911. ) {
  912. timerArr[j].isCheck = true;
  913. }
  914. }
  915. }
  916. });
  917. spaceCustomContentList.map((spaceCustom: any) => {
  918. let startTime: any = proxyData.parseCusStartTime(
  919. spaceCustom.startTime
  920. );
  921. let endTime: any = proxyData.parseCusEndTime(spaceCustom.endTime);
  922. console.log("t==", endTime);
  923. // 是否在固定区域时间
  924. if (startTime && endTime) {
  925. // debugger
  926. timerArr.map((item: any) => {
  927. if (
  928. item.formatTimer >= startTime &&
  929. item.formatTimer < endTime
  930. ) {
  931. item.isServiceTime = true;
  932. }
  933. });
  934. }
  935. });
  936. proxyData.dateArr.push({
  937. date: date,
  938. isActive: false,
  939. equipmentList: data[i].equipmentList || [],
  940. oldDate: data[i].date,
  941. objectId: data[i].objectId,
  942. cusStartTime: data[i].cusStartTime,
  943. customSceneList: customSceneList,
  944. cusEndTime: data[i].cusEndTime,
  945. spaceCustomContentList: data[i].spaceCustomContentList || [],
  946. day: getDate(new Date(date)),
  947. week: week,
  948. timerArr: timerArr,
  949. });
  950. }
  951. // debugger
  952. proxyData.dateArr.map((item: any, index: any) => {
  953. if (index === proxyData.activeIndex) {
  954. proxyData.checkDate(item, index);
  955. return;
  956. }
  957. });
  958. },
  959. clearTimerBoxStyle() {
  960. proxyData.dateArr.map((elItem: any) => {
  961. elItem.isActive = false;
  962. });
  963. let timerArr: any = proxyData.nowTimerArr;
  964. let sliderBoxArr: any = document.querySelectorAll(".slider-box");
  965. for (let i = 0; i < timerArr.length; i++) {
  966. sliderBoxArr[i].style.background = `transparent`;
  967. }
  968. // 切换日期的时候取消绑定
  969. // proxyData.cancelRemoveListener();
  970. },
  971. /**
  972. * 切换日期
  973. */
  974. activeIndex: 0,
  975. // 点击审批的时候触发接口
  976. checkApprovalStatus(item: any, e: any) {
  977. if (e.target) {
  978. let targetWidth: any = e.target.offsetWidth * 0.7;
  979. let left: any = item.left - targetWidth * 1.5 + e.offsetX;
  980. let sliderBoxEl: any = document.querySelectorAll(".slider-box")[0];
  981. let sliderWidth: any = sliderBoxEl.offsetWidth;
  982. let index: any = Math.ceil(left / sliderWidth);
  983. proxyData.checkSlider({}, index);
  984. }
  985. },
  986. approvalData: approvalData,
  987. // 获取slider的宽度
  988. getSliderWapperWidth() {
  989. let slidersWrapper: any = document.querySelector("#slidersWrapperId");
  990. let slidersWrapperWidth: any =
  991. slidersWrapper.getBoundingClientRect().width;
  992. return slidersWrapperWidth;
  993. },
  994. // 格式化审批状态的数据位置
  995. formateApproveStatusPerstion() {
  996. if (proxyData.nowData) {
  997. let spaceCustomContentList: any =
  998. proxyData.nowData.customSceneList || [];
  999. let slidersWrapperWidth: any = proxyData.getSliderWapperWidth();
  1000. proxyData.approvalData = [];
  1001. for (let i = 0; i < spaceCustomContentList.length; i++) {
  1002. let item: any = spaceCustomContentList[i];
  1003. // 加班数据
  1004. let obj: any = {
  1005. left: 0,
  1006. bg: "",
  1007. index: 0,
  1008. approvalStatus: item.approvalStatus,
  1009. text: "",
  1010. };
  1011. if (item.approvalStatus == 0) {
  1012. obj.text = "待审批";
  1013. obj.bg = "rgba(65, 107, 255, 0.6)";
  1014. } else if (item.approvalStatus == 1) {
  1015. obj.text = "已通过";
  1016. obj.bg = "rgba(24, 196, 93, 0.6)";
  1017. } else if (item.approvalStatus == 2) {
  1018. obj.text = "已拒绝";
  1019. obj.bg = "rgba(255, 54, 54, 0.6)";
  1020. }
  1021. // else if (item.approvalStatus == 3) {
  1022. // obj.text = "已失效";
  1023. // obj.bg = "rgba(255, 54, 54, 0.6)";
  1024. // }
  1025. if (obj.text) {
  1026. let startTime: any = proxyData.parseCusStartTime(item.startTime);
  1027. let endTime: any = proxyData.parseCusEndTime(item.endTime);
  1028. let relNowTime: any = getRelNowTime();
  1029. let timerArr: any = proxyData.nowTimerArr;
  1030. let leftStart: any = 0;
  1031. let leftEnd: any = 0;
  1032. timerArr.map((timer: any, index: any) => {
  1033. if (timer.formatTimer == startTime) {
  1034. if (slidersWrapperWidth) {
  1035. leftStart = slidersWrapperWidth * index;
  1036. }
  1037. }
  1038. if (timer.formatTimer == endTime) {
  1039. if (slidersWrapperWidth) {
  1040. leftEnd = slidersWrapperWidth * index;
  1041. }
  1042. }
  1043. });
  1044. obj.left = leftStart + (leftEnd - leftStart) * 0.5 - 30;
  1045. if (relNowTime < endTime) {
  1046. proxyData.approvalData.push(obj);
  1047. }
  1048. }
  1049. }
  1050. }
  1051. },
  1052. checkDate(item: any, index: any) {
  1053. proxyData.clearTimerBoxStyle();
  1054. item.isActive = true;
  1055. proxyData.activeIndex = index;
  1056. proxyData.nowTimerArr = proxyData.dateArr[index].timerArr;
  1057. proxyData.nowData = proxyData.dateArr[index];
  1058. // debugger
  1059. proxyData.formateEquipment();
  1060. nextTick(() => {
  1061. proxyData.setNowBarPerstion(proxyData.nowTimerArr);
  1062. let nowIndex: any = proxyData.getNowIndex();
  1063. // // 已经被选择的时间
  1064. proxyData.setCheckTimeStyle();
  1065. // // 固定服务时间
  1066. proxyData.setServiceTimerStyle();
  1067. if (proxyData.nowData.week === "今天") {
  1068. proxyData.setPastTime();
  1069. }
  1070. // 设置审批状态
  1071. proxyData.formateApproveStatusPerstion();
  1072. if (!proxyData.isEvent) {
  1073. proxyData.changeEl();
  1074. proxyData.isEvent = true;
  1075. }
  1076. });
  1077. },
  1078. /**
  1079. * dom的滚动功能设置
  1080. */
  1081. flag: false,
  1082. changeEl() {
  1083. // 事件解绑定
  1084. // proxyData.cancelRemoveListener();
  1085. proxyData.setScreennWidth();
  1086. proxyData.sliderSwiper();
  1087. proxyData.endBoxSwiper();
  1088. },
  1089. // 加班数据格式化=》后台需要的数据结构(添加加班逻辑)
  1090. formateAddTimer() {
  1091. let customSceneList: any = proxyData.nowData.customSceneList;
  1092. let timerArr: any = proxyData.nowData.timerArr;
  1093. let startTime: any = timerArr[proxyData.startIndex].formatTimer;
  1094. let endTime: any = timerArr[proxyData.endIndex].formatTimer;
  1095. // debugger;
  1096. let delTimerArr: any = [];
  1097. // 加班时间拼接
  1098. customSceneList.map((item: any, index: any) => {
  1099. // let itemStartTime:any=proxyData.parseCusStartTime(item.startTime)
  1100. // let itemEndTime:any=proxyData.parseCusStartTime(item.endTime)
  1101. // item时间段保护当前时间端
  1102. if (startTime < item.startTime) {
  1103. if (endTime < item.startTime) {
  1104. } else if (endTime >= item.startTime) {
  1105. // 时间段连续拼接上
  1106. let delObj: any = proxyData.formaTimeObj(
  1107. item,
  1108. "1",
  1109. item.startTime,
  1110. item.endTime
  1111. );
  1112. delTimerArr.push(delObj);
  1113. startTime = startTime;
  1114. endTime = endTime;
  1115. }
  1116. } else if (startTime >= item.startTime && startTime < item.endTime) {
  1117. if (endTime <= item.endTime) {
  1118. let delObj: any = proxyData.formaTimeObj(
  1119. item,
  1120. "1",
  1121. item.startTime,
  1122. item.endTime
  1123. );
  1124. delTimerArr.push(delObj);
  1125. startTime = startTime;
  1126. endTime = endTime;
  1127. } else if (endTime > item.endTime) {
  1128. let delObj: any = proxyData.formaTimeObj(
  1129. item,
  1130. "1",
  1131. item.startTime,
  1132. item.endTime
  1133. );
  1134. delTimerArr.push(delObj);
  1135. startTime = item.startTime;
  1136. endTime = endTime;
  1137. }
  1138. } else if (startTime >= item.endTime) {
  1139. if (startTime === item.endTime) {
  1140. let delObj: any = proxyData.formaTimeObj(
  1141. item,
  1142. "1",
  1143. item.startTime,
  1144. item.endTime
  1145. );
  1146. delTimerArr.push(delObj);
  1147. startTime = item.startTime;
  1148. endTime = endTime;
  1149. }
  1150. } else if (startTime === item.startTime && endTime === item.endTime) {
  1151. // 两个时间段一致
  1152. }
  1153. });
  1154. // 加班时间处理好后和服务定制时间做对比(处理时分秒的情况)
  1155. let cusStartTime: any = proxyData.parseCusStartTime(
  1156. proxyData.nowData.cusStartTime
  1157. );
  1158. let cusEndTime: any = proxyData.parseCusEndTime(
  1159. proxyData.nowData.cusEndTime
  1160. );
  1161. if (startTime < cusStartTime && endTime <= cusStartTime) {
  1162. if (endTime === cusStartTime) {
  1163. endTime = proxyData.nowData.cusStartTime;
  1164. }
  1165. } else if (startTime >= cusEndTime) {
  1166. if (startTime === cusEndTime) {
  1167. startTime = proxyData.nowData.cusEndTime;
  1168. }
  1169. }
  1170. let relNowTime: any = getRelNowTime();
  1171. let type = "0";
  1172. if (
  1173. proxyData.nowData.week === "今天" &&
  1174. relNowTime >= startTime &&
  1175. relNowTime <= endTime
  1176. ) {
  1177. type = "2";
  1178. }
  1179. // if()
  1180. let addObj: any = proxyData.formaTimeObj(
  1181. customSceneList[0],
  1182. type,
  1183. startTime,
  1184. endTime
  1185. );
  1186. delTimerArr.push(addObj);
  1187. let formTimeArr: any = delTimerArr;
  1188. return formTimeArr;
  1189. },
  1190. // 格式化加班单个数据
  1191. formaTimeObj(item: any, type: any, startTime: any, endTime: any) {
  1192. console.log(item);
  1193. let obj: any = {
  1194. projectId: proxyData.projectId, //类型:String 必有字段 备注:项目id
  1195. sceneEquipList:
  1196. item && item.sceneEquipList ? item.sceneEquipList : [],
  1197. objectId: proxyData.nowData.objectId, //类型:String 必有字段 备注:空间id
  1198. sourceType: proxyData.userInfo.pubname, //类型:String 必有字段 备注:sagacareAndtenantslink 来源
  1199. startDate: proxyData.nowData.oldDate, //类型:String 必有字段 备注://开始日期
  1200. endDate: proxyData.nowData.oldDate, //类型:String 必有字段 备注://结束日期
  1201. startTime: startTime, //类型:String 必有字段 备注://开始时间
  1202. endTime: endTime, //类型:String 必有字段 备注://结束时间
  1203. type: type, //类型:String 必有字段 备注://0 预约加班,1 取消,2 加班(我来了), 3 最后一个走
  1204. userId: proxyData.userInfo.userId, //类型:String 必有字段 备注://用户id
  1205. userPhone: proxyData.userInfo.userPhone, //类型:String 必有字段 备注://手机号
  1206. customSceneEqType: "ALL", //类型:String 必有字段 备注://来源 AC 空调入口, SE 灯入口 ALL 加班入口
  1207. userName: proxyData.userInfo.userName, //类型:String 必有字段 备注://名字
  1208. };
  1209. if (type === "1") {
  1210. obj.id = item.id; //类型:String 必有字段 备注:取消加班时必传
  1211. }
  1212. return obj;
  1213. },
  1214. // 加班数据格式化=》后台需要的数据结构(删除加班逻辑)
  1215. formateDelTimer() {
  1216. let timerArr: any = proxyData.nowData.timerArr;
  1217. let endIndex: any = proxyData.endIndex > 0 ? proxyData.endIndex - 1 : 0;
  1218. // debugger
  1219. // 如果当前选择的日期只在已经选中的范围内
  1220. if (
  1221. timerArr[proxyData.startIndex].isCheck &&
  1222. timerArr[endIndex].isCheck
  1223. ) {
  1224. let customSceneList: any = proxyData.nowData.customSceneList || [];
  1225. let startTime: any = timerArr[proxyData.startIndex].formatTimer;
  1226. let endTime: any = timerArr[proxyData.endIndex].formatTimer;
  1227. let delTimerArr: any = [];
  1228. let addTimeArr: any = [];
  1229. // 删除时间的数据拼接
  1230. for (let i = 0; i < customSceneList.length; i++) {
  1231. let item: any = customSceneList[i];
  1232. let index: any = i;
  1233. if (item.startTime === startTime && item.endTime === endTime) {
  1234. // 代表需要删除该段
  1235. // 整段删除
  1236. let delObj: any = proxyData.formaTimeObj(
  1237. item,
  1238. "1",
  1239. item.startTime,
  1240. item.endTime
  1241. );
  1242. delTimerArr.push(delObj);
  1243. break;
  1244. } else if (item.startTime < startTime) {
  1245. if (item.endTime <= endTime) {
  1246. let delObj: any = proxyData.formaTimeObj(
  1247. item,
  1248. "1",
  1249. item.startTime,
  1250. item.endTime
  1251. );
  1252. delTimerArr.push(delObj);
  1253. let addObj: any = proxyData.formaTimeObj(
  1254. customSceneList[0],
  1255. "0",
  1256. item.startTime,
  1257. startTime
  1258. );
  1259. addTimeArr.push(addObj);
  1260. } else if (item.endTime > endTime) {
  1261. let delObj: any = proxyData.formaTimeObj(
  1262. item,
  1263. "1",
  1264. item.startTime,
  1265. item.endTime
  1266. );
  1267. delTimerArr.push(delObj);
  1268. let addObj1: any = proxyData.formaTimeObj(
  1269. customSceneList[0],
  1270. "0",
  1271. item.startTime,
  1272. startTime
  1273. );
  1274. addTimeArr.push(addObj1);
  1275. let addObj2: any = proxyData.formaTimeObj(
  1276. customSceneList[0],
  1277. "0",
  1278. endTime,
  1279. item.endTime
  1280. );
  1281. addTimeArr.push(addObj2);
  1282. }
  1283. } else if (item.startTime === item.startTime) {
  1284. if (item.endTime <= endTime) {
  1285. // 整段删除
  1286. let delObj: any = proxyData.formaTimeObj(
  1287. item,
  1288. "1",
  1289. item.startTime,
  1290. item.endTime
  1291. );
  1292. delTimerArr.push(delObj);
  1293. } else if (item.endTime > endTime) {
  1294. let delObj: any = proxyData.formaTimeObj(
  1295. item,
  1296. "1",
  1297. item.startTime,
  1298. item.endTime
  1299. );
  1300. delTimerArr.push(delObj);
  1301. let addObj1: any = proxyData.formaTimeObj(
  1302. customSceneList[0],
  1303. "0",
  1304. endTime,
  1305. item.endTime
  1306. );
  1307. addTimeArr.push(addObj1);
  1308. }
  1309. } else if (item.startTime > startTime) {
  1310. if (item.endTime <= endTime) {
  1311. // 整段删除
  1312. let delObj: any = proxyData.formaTimeObj(
  1313. item,
  1314. "1",
  1315. item.startTime,
  1316. item.endTime
  1317. );
  1318. delTimerArr.push(delObj);
  1319. } else if (item.endTime > endTime) {
  1320. let delObj: any = proxyData.formaTimeObj(
  1321. item,
  1322. "1",
  1323. item.startTime,
  1324. item.endTime
  1325. );
  1326. delTimerArr.push(delObj);
  1327. let addObj1: any = proxyData.formaTimeObj(
  1328. customSceneList[0],
  1329. "0",
  1330. endTime,
  1331. item.endTime
  1332. );
  1333. addTimeArr.push(addObj1);
  1334. }
  1335. }
  1336. }
  1337. // 删除的时间为当时时间的时候
  1338. let delStartTime: any = 0;
  1339. let formTimeArr: any = addTimeArr.concat(delTimerArr);
  1340. let realTime: any = getRelNowTime();
  1341. formTimeArr.map((item: any, index: any) => {
  1342. if (item.type == "1") {
  1343. // 删除当前时间段
  1344. if (realTime >= item.startTime && realTime <= item.endTime) {
  1345. item.type = "3";
  1346. delStartTime = item.startTime;
  1347. item.endTimeReal = realTime;
  1348. }
  1349. }
  1350. });
  1351. formTimeArr.map((item: any, index: any) => {
  1352. if (item.type == "0" && delStartTime) {
  1353. if (item.startTime == delStartTime) {
  1354. formTimeArr.splice(index, 1);
  1355. }
  1356. }
  1357. });
  1358. return formTimeArr;
  1359. } else {
  1360. return [];
  1361. }
  1362. },
  1363. // 关闭加班弹窗
  1364. closeWorkTimer() {
  1365. proxyData.formBtn = false;
  1366. context.emit("closeWork");
  1367. },
  1368. // 数组去除重复
  1369. removeDuplicateObj(arr: any) {
  1370. let obj = {};
  1371. arr = arr.reduce((newArr: any, next: any) => {
  1372. obj[next.objectId]
  1373. ? ""
  1374. : (obj[next.objectId] = true && newArr.push(next));
  1375. return newArr;
  1376. }, []);
  1377. return arr;
  1378. },
  1379. checkEquipment(item: any) {
  1380. item.isCheck = !item.isCheck;
  1381. },
  1382. // 我来了删除不受服务定制控制的设备的开关灯
  1383. delSpaceNoCtrDevice(formTimerArr: any) {
  1384. formTimerArr.map((item: any) => {
  1385. let sceneEquipList: any = item.sceneEquipList || [];
  1386. let seviceEquipmentList: any = proxyData.seviceEquipmentList;
  1387. if (item.type == "2" && sceneEquipList.length) {
  1388. sceneEquipList.map((scene: any, index: any) => {
  1389. let flag: any = false;
  1390. for (let i = 0; i < seviceEquipmentList.length; i++) {
  1391. if (
  1392. scene.objectId == seviceEquipmentList[i].id &&
  1393. seviceEquipmentList[i].isExeSpaceTime
  1394. ) {
  1395. flag = true;
  1396. }
  1397. if (flag) {
  1398. break;
  1399. }
  1400. }
  1401. if (!flag) {
  1402. item.sceneEquipList.splice(index, 1);
  1403. }
  1404. });
  1405. }
  1406. });
  1407. },
  1408. // 提交申请
  1409. addWorkTimer() {
  1410. let formTimerArr: any = proxyData.formateAddTimer();
  1411. let sceneEquipList: any = [];
  1412. proxyData.nowData.equipmentList.map((item: any) => {
  1413. if (item.isCheck) {
  1414. let obj: any = {
  1415. projectId: item.projectId, //类型:String 必有字段 备注:无
  1416. objectId: item.id, //类型:String 必有字段 备注:设备id
  1417. type: item.equipmentCategory,
  1418. };
  1419. sceneEquipList.push(obj);
  1420. }
  1421. });
  1422. if (formTimerArr && formTimerArr.length == 2) {
  1423. if (
  1424. formTimerArr[1].startTime >= formTimerArr[0].startTime &&
  1425. formTimerArr[1].endTime <= formTimerArr[0].endTime
  1426. ) {
  1427. } else {
  1428. formTimerArr.map((item: any) => {
  1429. if (item.type == "1") {
  1430. if (item.sceneEquipList && item.sceneEquipList.length) {
  1431. item.sceneEquipList.map((scene: any) => {
  1432. let obj: any = {
  1433. projectId: scene.projectId, //类型:String 必有字段 备注:无
  1434. objectId: scene.objectId, //类型:String 必有字段 备注:设备id
  1435. type: scene.type,
  1436. };
  1437. sceneEquipList.push(obj);
  1438. });
  1439. }
  1440. }
  1441. });
  1442. }
  1443. }
  1444. sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
  1445. formTimerArr.map((item: any) => {
  1446. if (item.type == "0" || item.type == "2") {
  1447. item.sceneEquipList = sceneEquipList;
  1448. }
  1449. });
  1450. // 我来了过滤设备
  1451. proxyData.delSpaceNoCtrDevice(formTimerArr);
  1452. // 保存加班记录
  1453. proxyData.saveBatchCustomScene(formTimerArr);
  1454. // 如果在当前时间,需要手动开启设备(暂时不需要手动开启设备,后台已经把此逻辑合并)
  1455. // proxyData.openDeviceAll(formTimerArr);
  1456. },
  1457. // 手动控制开启设备
  1458. openDeviceAll(formTimerArr: any) {
  1459. let sceneEquipList: any = [];
  1460. formTimerArr.map((item: any) => {
  1461. if (item.type == "2") {
  1462. sceneEquipList = sceneEquipList.concat(item.sceneEquipList);
  1463. }
  1464. });
  1465. sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
  1466. // 改变设备状态
  1467. let airDevice: any = [];
  1468. let lightDevice: any = [];
  1469. sceneEquipList.map((item: any) => {
  1470. if (item.type == "SELTLT") {
  1471. let obj: any = {
  1472. id: item.objectId,
  1473. switch: true,
  1474. };
  1475. lightDevice.push(obj);
  1476. } else {
  1477. let obj: any = {
  1478. id: item.objectId, //类型:String 必有字段 备注:设备id
  1479. code: "EquipSwitchSet", //类型:String 必有字段 备注:编码 EquipSwtichSet
  1480. value: "1", //类型:String 必有字段 备注:值 0
  1481. };
  1482. airDevice.push(obj);
  1483. }
  1484. });
  1485. proxyData.setSpaceCondtioners(airDevice);
  1486. proxyData.setallLampHttp(lightDevice);
  1487. },
  1488. // 手动开空调
  1489. setSpaceCondtioners(data: any) {
  1490. setSpaceCondtioners(data)
  1491. .then((res) => {})
  1492. .catch(() => {});
  1493. },
  1494. // 手动开灯
  1495. setallLampHttp(data: any) {
  1496. setallLampHttp(data)
  1497. .then((res) => {})
  1498. .catch(() => {});
  1499. },
  1500. // 提交加班记录
  1501. saveBatchCustomScene(formTimerArr: any, type: any = 1) {
  1502. // proxyGlobal.proxy.$loadingStart(0);
  1503. proxyData.showLoading = true;
  1504. proxyData.formBtn = true;
  1505. saveBatchCustomScene(formTimerArr)
  1506. .then((res) => {
  1507. context.emit("closeWork");
  1508. proxyData.showLoading = false;
  1509. proxyData.formBtn = false;
  1510. })
  1511. .catch(() => {
  1512. // proxyGlobal.proxy.$loadinngEnd();
  1513. context.emit("closeWork");
  1514. proxyData.showLoading = false;
  1515. proxyData.formBtn = false;
  1516. });
  1517. },
  1518. // 删除
  1519. isUpdate: false, // 删除更新弹窗数据
  1520. triggerDelTime() {
  1521. let formTimeArr: any = proxyData.formateDelTimer();
  1522. console.log("需要删除的数据---");
  1523. console.log(formTimeArr);
  1524. if (formTimeArr && formTimeArr.length) {
  1525. // console.log(formTimeArr);
  1526. // alert("确定删除当前时间吗?");
  1527. // debugger;
  1528. Dialog.confirm({
  1529. title: "确认",
  1530. message: "确定删除当前时间吗?",
  1531. })
  1532. .then(() => {
  1533. let sceneEquipList: any = [];
  1534. formTimeArr.map((item: any) => {
  1535. if (item.type == "1") {
  1536. if (item.sceneEquipList) {
  1537. item.sceneEquipList.map((scene: any) => {
  1538. let obj: any = {
  1539. projectId: scene.projectId, //类型:String 必有字段 备注:无
  1540. objectId: scene.objectId, //类型:String 必有字段 备注:设备id
  1541. type: scene.type,
  1542. };
  1543. sceneEquipList.push(obj);
  1544. });
  1545. }
  1546. }
  1547. });
  1548. sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
  1549. formTimeArr.map((item: any) => {
  1550. if (item.type !== "1") {
  1551. item.sceneEquipList = sceneEquipList;
  1552. }
  1553. });
  1554. proxyData.saveBatchCustomScene(formTimeArr, 2);
  1555. })
  1556. .catch(() => {
  1557. // on cancel
  1558. });
  1559. }
  1560. },
  1561. });
  1562. watch(
  1563. props,
  1564. (newProps: any) => {
  1565. proxyData.workkArr = newProps.workkArr;
  1566. proxyData.projectId = newProps.projectId;
  1567. proxyData.enterType = newProps.enterType;
  1568. proxyData.deviceItem = newProps.deviceItem;
  1569. proxyData.seviceEquipmentList = newProps.seviceEquipmentList;
  1570. console.log("弹窗变化了-----==");
  1571. // proxyData.setWorkTimeList();
  1572. },
  1573. {
  1574. deep: true,
  1575. immediate: true,
  1576. }
  1577. );
  1578. onMounted(() => {
  1579. // 设置dom最外层的宽
  1580. // console.log("弹窗变化了-----==");
  1581. // proxyData.formateManualWorkTime();
  1582. proxyData.setWorkTimeList();
  1583. });
  1584. return {
  1585. ...toRefs(proxyData),
  1586. };
  1587. },
  1588. });
  1589. </script>
  1590. <style lang="scss" scoped>
  1591. .work-content {
  1592. position: relative;
  1593. height: 100%;
  1594. width: 100%;
  1595. overflow: hidden;
  1596. background: #fff;
  1597. }
  1598. .work-space {
  1599. width: 100%;
  1600. // padding-left: 10px;
  1601. .space-title {
  1602. padding-bottom: 10px;
  1603. font-family: "Noto Sans SC";
  1604. font-style: normal;
  1605. font-weight: 500;
  1606. font-size: 22px;
  1607. line-height: 31px;
  1608. color: #000000;
  1609. }
  1610. .tip {
  1611. padding-bottom: 20px;
  1612. font-family: "Noto Sans SC";
  1613. font-style: normal;
  1614. font-weight: 400;
  1615. font-size: 12px;
  1616. line-height: 17px;
  1617. color: #8d9399;
  1618. }
  1619. }
  1620. .add-time {
  1621. width: 100%;
  1622. // height: 80%;
  1623. background: #fff;
  1624. box-sizing: border-box;
  1625. // padding: 10px;
  1626. overflow: hidden;
  1627. .date_box {
  1628. display: flex;
  1629. justify-content: space-between;
  1630. width: 100%;
  1631. padding-bottom: 5px;
  1632. .date-item {
  1633. padding-top: 10px;
  1634. width: 50px;
  1635. height: 60px;
  1636. box-sizing: border-box;
  1637. border: 1px solid #eff0f1;
  1638. border-radius: 16px;
  1639. span {
  1640. display: block;
  1641. width: 100%;
  1642. text-align: center;
  1643. &:nth-child(1) {
  1644. font-family: "Noto Sans SC";
  1645. padding-bottom: 6px;
  1646. font-style: normal;
  1647. font-weight: 400;
  1648. font-size: 14px;
  1649. line-height: 14px;
  1650. transform: scale(0.8);
  1651. text-align: center;
  1652. color: #8d9399;
  1653. }
  1654. &:nth-child(2) {
  1655. font-family: "Persagy";
  1656. font-style: normal;
  1657. font-weight: 700;
  1658. font-size: 16px;
  1659. // line-height: 19px;
  1660. text-align: center;
  1661. color: #000000;
  1662. }
  1663. }
  1664. }
  1665. .date-item-active {
  1666. background: rgba(206, 159, 39, 0.4);
  1667. border: none;
  1668. }
  1669. }
  1670. .sliders-list {
  1671. position: relative;
  1672. margin-top: 5px;
  1673. height: 135px;
  1674. white-space: nowrap;
  1675. overflow-x: auto;
  1676. overflow-y: hidden;
  1677. .approval-status {
  1678. position: absolute;
  1679. font-family: "Montserrat";
  1680. top: 64px;
  1681. z-index: 444;
  1682. height: 30px;
  1683. line-height: 30px;
  1684. border-radius: 10px;
  1685. font-size: 12px;
  1686. transform: scale(0.7);
  1687. font-weight: 500;
  1688. text-align: center;
  1689. color: #ffffff;
  1690. }
  1691. &::-webkit-scrollbar {
  1692. display: none;
  1693. }
  1694. .sliders-wrapper {
  1695. display: inline-block;
  1696. box-sizing: border-box;
  1697. width: 72px;
  1698. height: 135px;
  1699. //border-bottom: 1px solid #ECEFF4;
  1700. &:nth-child(2n + 1) {
  1701. border-left: 1px solid #eceff4;
  1702. }
  1703. .sliders {
  1704. position: relative;
  1705. // width: 36px;
  1706. width: 100%;
  1707. height: 100%;
  1708. .label {
  1709. position: absolute;
  1710. height: 34px;
  1711. left: 0px;
  1712. top: 5px;
  1713. font-family: "PingFang SC";
  1714. font-style: normal;
  1715. font-weight: 400;
  1716. font-size: 10px;
  1717. line-height: 14px;
  1718. padding-left: 5px;
  1719. color: #8d9399;
  1720. }
  1721. .slider-box {
  1722. position: absolute;
  1723. //width: 100%;
  1724. width: 72px;
  1725. height: 100px;
  1726. left: -1px;
  1727. // top:25px;
  1728. bottom: 0px;
  1729. //background: linear-gradient(0deg, rgba(255, 0, 0, 0.2), rgba(255, 0, 0, 0.2));
  1730. }
  1731. }
  1732. }
  1733. .slider-btn {
  1734. position: absolute;
  1735. height: 100px;
  1736. //left: 40px;
  1737. top: 35px;
  1738. .start {
  1739. position: absolute;
  1740. width: 2px;
  1741. top: 0;
  1742. height: 100px;
  1743. left: 0px;
  1744. //left: 176px;
  1745. background: #04b49c;
  1746. }
  1747. .end-box {
  1748. position: absolute;
  1749. top: 0;
  1750. width: 20px;
  1751. height: 100px;
  1752. right: -8px;
  1753. z-index: 999;
  1754. //left: 286px;
  1755. .end {
  1756. position: absolute;
  1757. top: 0;
  1758. left: 10px;
  1759. width: 2px;
  1760. height: 100px;
  1761. background: #04b49c;
  1762. }
  1763. .end-radio {
  1764. width: 22px;
  1765. position: absolute;
  1766. top: 37px;
  1767. left: -1px;
  1768. height: 22px;
  1769. background: #ffffff;
  1770. border-radius: 50%;
  1771. box-shadow: 0px 1px 2px rgba(4, 38, 0, 0.2);
  1772. }
  1773. }
  1774. }
  1775. }
  1776. }
  1777. .add-time-btn {
  1778. position: absolute;
  1779. bottom: 5px;
  1780. left: 50%;
  1781. transform: translateX(-50%);
  1782. display: flex;
  1783. justify-content: space-between;
  1784. // padding-top: 10px;
  1785. text-align: center;
  1786. .cancel-btn {
  1787. // width: 32%;
  1788. width: 170px;
  1789. height: 50px;
  1790. line-height: 50px;
  1791. background: #ffffff;
  1792. border: 1px solid #c3c7cb;
  1793. border-radius: 25px;
  1794. font-size: 16px;
  1795. margin-right: 20px;
  1796. font-weight: 400;
  1797. color: #1f2529;
  1798. }
  1799. .comfirm-btn {
  1800. // width: 52%;
  1801. width: 265px;
  1802. height: 50px;
  1803. line-height: 50px;
  1804. font-weight: 400;
  1805. font-size: 16px;
  1806. text-align: center;
  1807. background: #ce9f27;
  1808. border-radius: 25px;
  1809. color: #fff;
  1810. }
  1811. .comfirm-btn-diabled {
  1812. background: rgba(196, 196, 196, 0.2);
  1813. color: #1f2529;
  1814. }
  1815. }
  1816. .work-device {
  1817. // padding-top: 10px;
  1818. height: 36vh;
  1819. overflow-y: auto;
  1820. .device-tip {
  1821. padding-top: 20px;
  1822. font-weight: 400;
  1823. font-size: 12px;
  1824. color: #8d9399;
  1825. span {
  1826. display: inline-block;
  1827. padding-bottom: 10px;
  1828. }
  1829. p {
  1830. line-height: 24px;
  1831. }
  1832. }
  1833. }
  1834. .device-box {
  1835. // display: flex;
  1836. // justify-content: space-between;
  1837. .device-row {
  1838. display: inline-block;
  1839. width: 48%;
  1840. font-family: "PingFang SC";
  1841. font-style: normal;
  1842. font-weight: 400;
  1843. font-size: 14px;
  1844. padding: 10px;
  1845. color: #1b2129;
  1846. background: #f7f9fa;
  1847. border-radius: 4px;
  1848. margin-top: 10px;
  1849. margin-bottom: 10px;
  1850. line-height: 20px;
  1851. &:nth-child(2n + 1) {
  1852. margin-right: 2%;
  1853. }
  1854. .row-item {
  1855. display: flex;
  1856. justify-content: space-between;
  1857. }
  1858. span {
  1859. display: inline-block;
  1860. font-family: "PingFang SC";
  1861. font-style: normal;
  1862. font-weight: 400;
  1863. font-size: 12px;
  1864. }
  1865. img {
  1866. width: 25px;
  1867. height: 25px;
  1868. }
  1869. }
  1870. }
  1871. .row-title {
  1872. display: block;
  1873. font-weight: 500;
  1874. font-size: 14px;
  1875. line-height: 14px;
  1876. color: #000000;
  1877. padding-top: 4px;
  1878. }
  1879. .device-title {
  1880. display: flex;
  1881. justify-content: space-between;
  1882. padding-top: 20px;
  1883. padding-bottom: 5px;
  1884. text-align: center;
  1885. .line {
  1886. display: inline-block;
  1887. flex: 1;
  1888. height: 0px;
  1889. border: 1px solid #e1e5eb;
  1890. }
  1891. .text {
  1892. display: inline-block;
  1893. width: 142px;
  1894. vertical-align: middle;
  1895. font-family: "PingFang SC";
  1896. font-style: normal;
  1897. font-weight: 400;
  1898. font-size: 12px;
  1899. color: #8d9399;
  1900. text-align: center;
  1901. margin-top: -6px;
  1902. }
  1903. }
  1904. </style>