index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. <template>
  2. <!-- 右侧固定栏 -->
  3. <div
  4. class="v-widget-window syno-sds-widget v-window"
  5. style="
  6. position: absolute;
  7. width: 344px;
  8. height: 466px;
  9. min-height: 164px !important;
  10. "
  11. :style="{
  12. zIndex: zIndex,
  13. display: display,
  14. top: top ? top : '',
  15. bottom: bottom ? bottom : '',
  16. left: left ? left : '',
  17. right: right ? right : '',
  18. }"
  19. :class="cls"
  20. @click="clickFixWindow"
  21. >
  22. <div
  23. class="v-window-header-wrapper draggable"
  24. @mousedown="mousedownWidgetHeader"
  25. >
  26. <div class="v-widget-header">
  27. <div class="v-widget-header-left">
  28. <button
  29. type="button"
  30. class="v-btn v-btn-styleless v-btn-grey v-btn-dropdown"
  31. >
  32. <span>
  33. <div
  34. class="v-widget-header-tool-icon add"
  35. @click.stop="selectWidgetItem"
  36. ></div>
  37. </span>
  38. </button>
  39. </div>
  40. <div class="v-widget-header-right">
  41. <div
  42. class="v-widget-header-tool-icon minimize"
  43. @click.stop="minimizeFixWndow"
  44. ></div>
  45. <div
  46. class="v-widget-header-tool-icon pin"
  47. @click.stop="pinFixWndow"
  48. ></div>
  49. <button
  50. type="button"
  51. class="v-btn v-btn-styleless v-btn-grey v-btn-dropdown"
  52. >
  53. <span>
  54. <div
  55. class="v-widget-header-tool-icon dock"
  56. @click.stop="selectWidgetPosition"
  57. ></div>
  58. </span>
  59. </button>
  60. </div>
  61. </div>
  62. </div>
  63. <div tabindex="-1" class="v-window-body">
  64. <div tabindex="0" class="v-trap-focus-indicator"></div>
  65. <div class="v-trap-focus-body">
  66. <div
  67. tabindex="0"
  68. role="application"
  69. class="v-trap-focus-indicator"
  70. ></div>
  71. <div class="v-widget-items-wrapper">
  72. <div
  73. class="v-ps show ps--active-y"
  74. @scroll="scrollList"
  75. style="overflow: scroll"
  76. >
  77. <!-- <div class="v-widget-list" style="overflow-y:scroll;height:100%" @scroll="scrollList"> -->
  78. <div class="v-widget-list">
  79. <RunningState></RunningState>
  80. <ResourceMonitor></ResourceMonitor>
  81. <Storage></Storage>
  82. <ConnectedUser></ConnectedUser>
  83. <ScheduledTask></ScheduledTask>
  84. <ChangeLog></ChangeLog>
  85. <NewLog></NewLog>
  86. <Copy></Copy>
  87. <!-- 当打开窗口个数为零时显示 -->
  88. <!-- <div class="v-widget-list-empty" :style="{display: selectedNum ? 'none':'flex'}"> -->
  89. <div class="v-widget-list-empty" v-show="!selectedNum">
  90. <div class="v-widget-list-empty-img"></div>
  91. <div class="v-widget-list-empty-content">
  92. 单击 + 按钮可添加小工具。
  93. </div>
  94. </div>
  95. </div>
  96. <div class="ps__rail-x" style="left: 0px; bottom: 0px">
  97. <div
  98. class="ps__thumb-x"
  99. tabindex="0"
  100. style="left: 0px; width: 0px"
  101. ></div>
  102. </div>
  103. <div class="ps__rail-y" style="top: 0px; right: 0px; height: 424px">
  104. <div
  105. class="ps__thumb-y"
  106. tabindex="0"
  107. style="top: 0px;"
  108. :style="{height:thumbYHeight,display:thumbYDisplay}"
  109. @mousedown="mousedownProgress"
  110. ></div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <div tabindex="0" class="v-trap-focus-indicator"></div>
  116. </div>
  117. <div class="v-window-resizable">
  118. <div class="handler v-window-resizable-n"></div>
  119. <div class="handler v-window-resizable-s"></div>
  120. </div>
  121. <!-- 弹出小窗口选择框 -->
  122. <PortalSelectDialogWindow></PortalSelectDialogWindow>
  123. <!-- 弹出位置选择框 -->
  124. <PortaSelectPosition></PortaSelectPosition>
  125. </div>
  126. </template>
  127. <script>
  128. import RunningState from "./RunningState";
  129. import ResourceMonitor from "./ResourceMonitor";
  130. import Storage from "./Storage";
  131. import ConnectedUser from "./ConnectedUser";
  132. import ScheduledTask from "./ScheduledTask";
  133. import ChangeLog from "./ChangeLog";
  134. import NewLog from "./NewLog";
  135. import Copy from "./Copy";
  136. // 弹出小窗口选择框
  137. import PortalSelectDialogWindow from "../PortalSelectDialogWindow";
  138. // 弹出位置选择框
  139. import PortaSelectPosition from "../PortaSelectPosition";
  140. export default {
  141. props: ["defaultZIndex"],
  142. data() {
  143. return {
  144. zIndex: 9040,
  145. cls: "",
  146. selectedNum: 2,
  147. display: "block",
  148. top: 0,
  149. bottom: "10px",
  150. right: "10px",
  151. left: 0,
  152. progrecssFirstClick: {
  153. lastY: 0,
  154. clickY: 0,
  155. clientY: 0,
  156. moveY: 0,
  157. thumbStyletop: 0,
  158. },
  159. widgetFirstClick: {
  160. lastX: 0,
  161. lastY: 0,
  162. clickX: 0,
  163. clickY: 0,
  164. clientX: 0,
  165. clientY: 0,
  166. offsetX: 0,
  167. offsetY: 0,
  168. screenX: 0,
  169. screenY: 0,
  170. moveX: 0,
  171. moveY: 0,
  172. },
  173. widgetListIsBottom: false,
  174. thumbYHeight: '104px',
  175. thumbYDisplay: 'none',
  176. portalDetail: {
  177. display: "none",
  178. detailMessageList: [
  179. {
  180. id: 0,
  181. title: "系统状况",
  182. cls: "v-menu-item-select-selected selected active",
  183. },
  184. {
  185. id: 1,
  186. title: "资源监控",
  187. cls: "v-menu-item-select-selected selected",
  188. },
  189. {
  190. id: 2,
  191. title: "存储",
  192. cls: "",
  193. },
  194. {
  195. id: 3,
  196. title: "已连接用户",
  197. cls: "",
  198. },
  199. {
  200. id: 4,
  201. title: "计划的任务",
  202. cls: "",
  203. },
  204. {
  205. id: 5,
  206. title: "文件更改日志",
  207. cls: "",
  208. },
  209. {
  210. id: 6,
  211. title: "最新日志",
  212. cls: "",
  213. },
  214. {
  215. id: 7,
  216. title: "备份",
  217. cls: "",
  218. },
  219. ],
  220. },
  221. portalDetail1: {
  222. display: "none",
  223. detailMessageList: [
  224. {
  225. id: 0,
  226. title: "右上角",
  227. cls: "active",
  228. top: "47px",
  229. bottom: 0,
  230. left: 0,
  231. right: "10px",
  232. },
  233. {
  234. id: 1,
  235. title: "右下角",
  236. cls: "v-menu-item-select-selected selected",
  237. top: 0,
  238. bottom: "10px",
  239. left: 0,
  240. right: "10px",
  241. },
  242. {
  243. id: 2,
  244. title: "左上角",
  245. top: "47px",
  246. bottom: 0,
  247. right: 0,
  248. left: "10px",
  249. cls: "",
  250. },
  251. {
  252. id: 3,
  253. title: "左下角",
  254. top: 0,
  255. bottom: "10px",
  256. left: "10px",
  257. right: 0,
  258. cls: "",
  259. },
  260. ],
  261. },
  262. };
  263. },
  264. components: {
  265. RunningState,
  266. ResourceMonitor,
  267. Storage,
  268. ConnectedUser,
  269. ScheduledTask,
  270. ChangeLog,
  271. NewLog,
  272. Copy,
  273. // 弹出小窗口选择框
  274. PortalSelectDialogWindow,
  275. // 弹出位置选择框
  276. PortaSelectPosition,
  277. },
  278. mounted() {
  279. this.$bus.on("changeFixWindowZIndex", this.changeFixWindowZIndex);
  280. this.$bus.on("showOrHiddenWidgetItem", this.showOrHiddenWidgetItem);
  281. this.$bus.on("changeThumbHeight", this.changeThumbHeight);
  282. this.$bus.on("showOrHiddenWidget", this.showOrHiddenWidget);
  283. this.$bus.on(
  284. "changeOrHiddenWidgetPosition",
  285. this.changeOrHiddenWidgetPosition
  286. );
  287. this.$bus.on("dialogWindowZIndexIsMax", this.dialogWindowZIndexIsMax);
  288. let el = document.querySelector(".ps__thumb-y");
  289. let el1 = document.querySelector(".v-window-header-wrapper");
  290. el.addEventListener("mouseup", this.mouseupProgress);
  291. el1.addEventListener("mouseup", this.mouseupWidgetHeader);
  292. let el2 = document.querySelector(".v-widget-list");
  293. let el3 = document.querySelector(".ps__rail-y");
  294. if(el2.offsetHeight > el3.offsetHeight){
  295. this.thumbYDisplay = 'block'
  296. this.thumbYHeight = 'calc((100vh - 52px) / 2)'
  297. }
  298. window.onresize = ()=>{
  299. if(el2.offsetHeight > el3.offsetHeight){
  300. this.thumbYDisplay = 'block'
  301. this.thumbYHeight = 'calc((100vh - 52px) / 2)'
  302. }
  303. }
  304. },
  305. methods: {
  306. //点击固定窗口
  307. clickFixWindow() {
  308. if (this.zIndex < this.defaultZIndex) {
  309. this.zIndex = this.defaultZIndex + 10;
  310. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex + 10);
  311. this.$bus.emit("changeMinDefaultZindexWindowCls");
  312. this.$bus.emit("fixWindowZIndexMax", true);
  313. }
  314. this.dialogWindowZIndexIsMax(false);
  315. },
  316. // 修改changeFixWindow
  317. changeFixWindowZIndex() {
  318. if (this.zIndex != 999999999) {
  319. this.zIndex = 9040;
  320. }
  321. if (this.cls != "") this.cls = "";
  322. this.dialogWindowZIndexIsMax(true);
  323. },
  324. //点击进度条
  325. mousedownProgress(e) {
  326. let el = document.querySelector(".ps__thumb-y");
  327. let el1 = document.querySelector(".v-widget-window");
  328. el.addEventListener("mousemove", this.moveProgress);
  329. if(el.style.top && el.style.top.includes('px')){
  330. let top = parseInt(el.style.top.replace('px',''))
  331. this.progrecssFirstClick.thumbStyletop = top
  332. }
  333. this.progrecssFirstClick.lastY = el1.offsetTop + 31;
  334. this.progrecssFirstClick.clickY = e.offsetY;
  335. console.log(el.style.top,e.offsetY,this.progrecssFirstClick.lastY,e.clientY)
  336. },
  337. //移动进度条
  338. moveProgress(e) {
  339. let el = document.querySelector(".ps__thumb-y");
  340. let el1 = document.querySelector(".ps__rail-y");
  341. let el2 = document.querySelector(".v-widget-list");
  342. let moveY;
  343. console.log(this.progrecssFirstClick.clientY)
  344. if (e.clientY >= this.progrecssFirstClick.clientY) {
  345. moveY = e.clientY - e.offsetY - this.progrecssFirstClick.lastY;
  346. if(this.progrecssFirstClick.thumbStyletop){
  347. console.log(moveY)
  348. moveY = this.progrecssFirstClick.thumbStyletop + 1
  349. this.progrecssFirstClick.thumbStyletop = 0
  350. }
  351. } else {
  352. moveY = this.moveY + (e.clientY - this.progrecssFirstClick.clientY);
  353. if(this.progrecssFirstClick.thumbStyletop){
  354. moveY = this.progrecssFirstClick.thumbStyletop + 1
  355. this.progrecssFirstClick.thumbStyletop = 0
  356. }
  357. }
  358. if (moveY < 0) {
  359. moveY = 0;
  360. } else if (moveY > el1.offsetHeight - el.offsetHeight) {
  361. moveY = el1.offsetHeight - el.offsetHeight;
  362. this.widgetListIsBottom = true
  363. }
  364. let moveY2 =
  365. -(
  366. (el2.offsetHeight - el1.offsetHeight) /
  367. (el1.offsetHeight - el.offsetHeight)
  368. ) * moveY;
  369. el.style.top = moveY + "px";
  370. el2.style.top = moveY2 + "px";
  371. el.addEventListener("mouseup", this.mouseupProgress);
  372. el1.addEventListener("mouseleave", this.mouseupProgress);
  373. this.progrecssFirstClick.clientY = e.clientY;
  374. this.moveY = moveY;
  375. console.log('moveY',moveY)
  376. },
  377. // 进度条鼠标抬起/离开
  378. mouseupProgress() {
  379. let el = document.querySelector(".ps__thumb-y");
  380. let el1 = document.querySelector(".ps__rail-y");
  381. let el2 = document.querySelector(".v-widget-list");
  382. el.removeEventListener("mousemove", this.moveProgress);
  383. if(el2.offsetHeight > el1.offsetHeight){
  384. console.log('')
  385. this.thumbYDisplay = 'block'
  386. this.thumbYHeight = 'calc((100vh - 52px) / 2)'
  387. }
  388. // this.clearProgressMArk();
  389. },
  390. // 滚动窗口列表
  391. scrollList(e) {
  392. console.log(e, e.target.scrollTop);
  393. let el = document.querySelector(".ps__thumb-y");
  394. let el1 = document.querySelector(".ps__rail-y");
  395. let el2 = document.querySelector(".ps--active-y");
  396. console.log(e.target.scrollTop)
  397. // if(! this.widgetListIsBottom){
  398. let moveY =
  399. ((el1.offsetHeight - el.offsetHeight)/(e.target.scrollHeight - el2.offsetHeight)) * e.target.scrollTop
  400. console.log( ((el1.offsetHeight - el.offsetHeight)/(e.target.scrollHeight - el2.offsetHeight)) * e.target.scrollTop
  401. );
  402. el.style.top = moveY + e.target.scrollTop + 'px'
  403. // }
  404. },
  405. // 点击勾选小窗口的加号
  406. selectWidgetItem() {
  407. this.$bus.emit("showOrHiddenSelectWidgetItem", this.portalDetail);
  408. window.onclick = (e) => {
  409. e.stopPropagation();
  410. this.$bus.emit("showOrHiddenSelectWidgetItem", "none");
  411. };
  412. },
  413. // 点击小窗口选择框的每一项
  414. showOrHiddenWidgetItem(obj) {
  415. let widgetItemArray = document.querySelectorAll(".v-widget-item");
  416. Array.from(widgetItemArray)[obj.index].className = obj.cls;
  417. this.portalDetail.detailMessageList[obj.index].cls = obj.cls1;
  418. this.portalDetail.detailMessageList.forEach((item) => {
  419. if (item.cls && item.cls.includes(" active")) {
  420. item.cls = item.cls.replace(" active");
  421. } else if (item.cls && item.cls.includes("active")) {
  422. item.cls = item.cls.replace("active");
  423. }
  424. });
  425. let cls = this.portalDetail.detailMessageList[0].cls;
  426. if (cls && !cls.includes("active")) {
  427. this.portalDetail.detailMessageList[0].cls = cls + " active";
  428. }
  429. },
  430. // 跟随可视小窗口的个数改变进度条高度
  431. changeThumbHeight(selectedNum) {
  432. if (selectedNum > 2) {
  433. if (selectedNum >= 6) {
  434. selectedNum = 6;
  435. }
  436. this.thumbYDisplay = "block";
  437. this.thumbYHeight = (7 - selectedNum) * 70 + "px";
  438. } else {
  439. console.log('none')
  440. this.thumbYDisplay = "none";
  441. }
  442. if(window.screenY <= 250){
  443. this.bottom = '0'
  444. this.thumbYDisplay = 'block'
  445. this.thumbYHeight = 'calc((100vh - 52px) / 2)'
  446. }
  447. this.selectedNum = selectedNum;
  448. },
  449. // 将记住的进度条坐标重置
  450. // clearProgressMArk() {
  451. // this.progrecssFirstClick.clientY = 0
  452. // this.moveY = 0
  453. // this.progrecssFirstClick = {
  454. // lastY: 0,
  455. // clickY: 0,
  456. // };
  457. // },
  458. //点击固定窗口头部
  459. mousedownWidgetHeader(e) {
  460. let el = document.querySelector(".v-window-header-wrapper");
  461. let el1 = document.querySelector(".v-widget-window");
  462. this.widgetFirstClick.clientX = e.clientX;
  463. this.widgetFirstClick.offsetX = e.offsetX;
  464. this.widgetFirstClick.screenX = document.documentElement.clientWidth;
  465. this.widgetFirstClick.clientY = e.clientY;
  466. this.widgetFirstClick.offsetY = e.offsetY;
  467. this.widgetFirstClick.screenY = document.documentElement.clientHeight;
  468. el.addEventListener("mousemove", this.mousemoveWidgetHeader);
  469. console.dir(el1);
  470. },
  471. //移动固定窗口头部
  472. mousemoveWidgetHeader(e) {
  473. let el = document.querySelector(".v-window-header-wrapper");
  474. let el1 = document.querySelector(".v-widget-window");
  475. let el2 = document.querySelector(".v-widget-list");
  476. el2.style.display = "none";
  477. // X轴
  478. let moveX = 0;
  479. moveX = e.clientX - this.widgetFirstClick.offsetX;
  480. if (moveX < 0) {
  481. moveX = 0;
  482. }
  483. if (moveX > this.widgetFirstClick.screenX - el1.offsetWidth) {
  484. moveX = this.widgetFirstClick.screenX - el1.offsetWidth;
  485. }
  486. // Y轴
  487. let moveY = 0;
  488. moveY = e.clientY - this.widgetFirstClick.offsetY;
  489. if (moveY < 0) {
  490. moveY = 0;
  491. }
  492. if (moveY > this.widgetFirstClick.screenY - el1.offsetHeight) {
  493. moveY = this.widgetFirstClick.screenY - el1.offsetHeight;
  494. }
  495. el1.style.left = moveX + "px";
  496. el1.style.top = moveY + "px";
  497. if(!el1.className.includes(' active')){
  498. el1.className = el1.className + " active";
  499. }
  500. el.addEventListener("mouseleave", this.mouseupWidgetHeader);
  501. },
  502. //鼠标抬起固定窗口头部
  503. mouseupWidgetHeader() {
  504. let el = document.querySelector(".v-window-header-wrapper");
  505. let el1 = document.querySelector(".v-widget-list");
  506. let el2 = document.querySelector(".v-widget-window");
  507. el.removeEventListener("mousemove", this.mousemoveWidgetHeader);
  508. el1.style.display = "flex";
  509. el2.className = "v-widget-window syno-sds-widget v-window";
  510. },
  511. //显示或隐藏固定窗口
  512. showOrHiddenWidget() {
  513. let el = document.querySelector(".v-widget-header-tool-icon.pin");
  514. if (this.display === "block") {
  515. this.display = "none";
  516. this.zIndex = this.defaultZIndex - 10;
  517. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex - 10);
  518. this.$bus.emit("fixWindowZIndexMax", false);
  519. } else {
  520. this.display = "block";
  521. this.zIndex = this.defaultZIndex + 10;
  522. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex + 10);
  523. this.$bus.emit("fixWindowZIndexMax", true);
  524. }
  525. },
  526. //最小化固定窗口
  527. minimizeFixWndow() {
  528. this.display = "none";
  529. console.log("this.defaultZIndex", this.defaultZIndex);
  530. this.zIndex = this.defaultZIndex - 10;
  531. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex - 10);
  532. this.$bus.emit("fixWindowZIndexMax", false);
  533. },
  534. // 显示或隐藏位置选择框
  535. selectWidgetPosition() {
  536. this.$bus.emit("showOrHiddenSelectWidgetPosition", this.portalDetail1);
  537. window.onclick = (e) => {
  538. e.stopPropagation();
  539. this.$bus.emit("showOrHiddenSelectWidgetPosition", "none");
  540. };
  541. },
  542. //改变固定弹出框的位置
  543. changeOrHiddenWidgetPosition(obj) {
  544. this.portalDetail1.detailMessageList = obj.detailMessageList;
  545. this.portalDetail1.detailMessageList.forEach((item) => {
  546. if (item.cls && item.cls.includes("active")) {
  547. item.cls.replace("active", "");
  548. }
  549. });
  550. let detailMessageItem = this.portalDetail1.detailMessageList[obj.index];
  551. this.top = detailMessageItem.top;
  552. this.bottom = detailMessageItem.bottom;
  553. this.left = detailMessageItem.left;
  554. this.right = detailMessageItem.right;
  555. let el = document.querySelector(".v-widget-header-tool-icon.dock");
  556. el.className = el.className + " active";
  557. console.log(el.className);
  558. let cls = this.portalDetail1.detailMessageList[0].cls;
  559. if (cls && !cls.includes("active")) {
  560. this.portalDetail1.detailMessageList[0].cls = cls + " active";
  561. }
  562. // sds-desktop .v-widget-window .v-widget-items-wrapper{
  563. // height: calc(100vh - 42px) !important;
  564. // }
  565. // #sds-desktop .v-widget-window{
  566. // height: calc(100vh - 10px) !important;
  567. // }
  568. console.log(obj.index);
  569. if (obj.index == 0) {
  570. let el1 = document.querySelector(".v-widget-window");
  571. let el2 = document.querySelector(".v-widget-items-wrapper");
  572. el1.style.height = "calc(100vh - 47px) !important";
  573. el2.style.height = "calc(100vh - 120px) !important";
  574. }
  575. },
  576. //点击小钉子
  577. pinFixWndow() {
  578. let el = document.querySelector(".v-widget-header-tool-icon.pin");
  579. if (el.className.includes("active")) {
  580. el.className = el.className.replace(" active", "");
  581. this.$bus.emit("fixWindowZIndexMax", false);
  582. this.zIndex = this.defaultZIndex;
  583. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex - 10);
  584. this.$bus.emit("fixWindowZIndexMax", true);
  585. } else {
  586. el.className = el.className + " active";
  587. this.zIndex = 999999999;
  588. // this.$bus.emit("changeDefaultZIndex", this.defaultZIndex - 10);
  589. this.$bus.emit("fixWindowZIndexMax", true);
  590. }
  591. },
  592. //判断弹出窗ZIndex是不是比较大
  593. dialogWindowZIndexIsMax(bol) {
  594. console.log(bol);
  595. if (bol) {
  596. this.cls = "deactive-win";
  597. } else {
  598. this.cls = "active-win";
  599. }
  600. },
  601. //节流函数
  602. throttle(fn, time, e) {
  603. var lastTime = 0;
  604. console.log("throttle");
  605. return function () {
  606. var nowTime = Date.now();
  607. if (nowTime - lastTime > time) {
  608. fn.call(this, e);
  609. lastTime = nowTime;
  610. }
  611. };
  612. },
  613. },
  614. beforeDestroy() {
  615. this.$bus.off("changeFixWindowZIndex", this.changeFixWindowZIndex);
  616. },
  617. name: "FixWindow",
  618. };
  619. </script>
  620. <style scoped lang="css">
  621. .v-widget-window .v-ps.show::-webkit-scrollbar {
  622. display: none;
  623. }
  624. .v-ps{
  625. height: 424px;
  626. }
  627. input:-moz-placeholder,
  628. textarea:-moz-placeholder {
  629. color: #fff!important;
  630. }
  631. input:-ms-input-placeholder,
  632. textarea:-ms-input-placeholder {
  633. color: #fff!important;
  634. }
  635. input::-webkit-input-placeholder,
  636. textarea::-webkit-input-placeholder {
  637. color: #fff!important;
  638. }
  639. </style>