holder.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <template>
  2. <el-container class="container">
  3. <el-header class="header">
  4. <el-row>
  5. <el-col :span="20">云台操作</el-col>
  6. <el-col :span="4">
  7. <i v-show="fold" class="hide-icon pointer" @click="fold = !fold"></i>
  8. <i v-show="!fold" class="show-icon pointer" @click="fold = !fold"></i>
  9. </el-col>
  10. </el-row>
  11. </el-header>
  12. <el-main class="main" v-show="!fold">
  13. <!-- 云台圆盘 -->
  14. <div class="holder-disc">
  15. <div class="s1" :class="brand !== 'lechange' ? 'box' : 'disable-box'">
  16. <!-- 左上 -->
  17. <i v-show="brand !== 'lechange'" class="north-west-icon" @mousedown="holderClick(false, '4')" @mouseup="holderClick(true, '4')"></i>
  18. </div>
  19. <div class="s2 box">
  20. <!-- 上 -->
  21. <i class="north-west-icon" @mousedown="holderClick(false, '0')" @mouseup="holderClick(true, '0')"></i>
  22. </div>
  23. <div class="s3" :class="brand !== 'lechange' ? 'box' : 'disable-box'">
  24. <!-- 右上 -->
  25. <i v-show="brand !== 'lechange'" class="north-west-icon" @mousedown="holderClick(false, '6')" @mouseup="holderClick(true, '6')"></i>
  26. </div>
  27. <div class="s4 box">
  28. <!-- 右 -->
  29. <i class="north-west-icon" @mousedown="holderClick(false, '3')" @mouseup="holderClick(true, '3')"></i>
  30. </div>
  31. <div class="s5 box">
  32. <!-- 左 -->
  33. <i class="north-west-icon" @mousedown="holderClick(false, '2')" @mouseup="holderClick(true, '2')"></i>
  34. </div>
  35. <div class="s6" :class="brand !== 'lechange' ? 'box' : 'disable-box'">
  36. <!-- 左下 -->
  37. <i v-show="brand !== 'lechange'" class="north-west-icon" @mousedown="holderClick(false, '5')" @mouseup="holderClick(true, '5')"></i>
  38. </div>
  39. <div class="s7 box">
  40. <!-- 下 -->
  41. <i class="north-west-icon" @mousedown="holderClick(false, '1')" @mouseup="holderClick(true, '1')"></i>
  42. </div>
  43. <div class="s8" :class="brand !== 'lechange' ? 'box' : 'disable-box'">
  44. <!-- 右下 -->
  45. <i v-show="brand !== 'lechange'" class="north-west-icon" @mousedown="holderClick(false, '7')" @mouseup="holderClick(true, '7')"></i>
  46. </div>
  47. <div class="center center-icon"></div>
  48. </div>
  49. <!-- 云台步长 -->
  50. <div class="holder-step-length">
  51. <el-row>
  52. <el-col :span="4" class="lh38 text-right">步长</el-col>
  53. <el-col :span="12" :offset="2">
  54. <el-slider
  55. v-model="stepLength"
  56. :min="1"
  57. :max="8"
  58. :show-tooltip="false"
  59. ></el-slider>
  60. </el-col>
  61. <el-col :span="4" :offset="2" class="lh38">{{ stepLength }}</el-col>
  62. </el-row>
  63. </div>
  64. <!-- 云台操作 -->
  65. <div class="holder-operate">
  66. <el-row class="operate-row">
  67. <el-col :span="8" class="border-right-ccc">
  68. <i
  69. class="focus-up-icon"
  70. title="聚焦+"
  71. @mousedown="holderHandle('ptzFocusOperation', true, false)"
  72. @mouseup="holderHandle('ptzFocusOperation', true, true)"
  73. ></i>
  74. <i
  75. class="focus-down-icon"
  76. title="聚焦-"
  77. @mousedown="holderHandle('ptzFocusOperation', false, false)"
  78. @mouseup="holderHandle('ptzFocusOperation', false, true)"
  79. ></i>
  80. </el-col>
  81. <el-col :span="8" class="border-right-ccc">
  82. <i
  83. class="scale-add-icon"
  84. title="变倍+"
  85. @mousedown="holderHandle('ptzZoomOperation', true, false)"
  86. @mouseup="holderHandle('ptzZoomOperation', true, true)"
  87. ></i>
  88. <i
  89. class="scale-minus-icon"
  90. title="变倍-"
  91. @mousedown="holderHandle('ptzZoomOperation', false, false)"
  92. @mouseup="holderHandle('ptzZoomOperation', false, true)"
  93. ></i>
  94. </el-col>
  95. <el-col :span="8">
  96. <i
  97. class="aperture-up-icon"
  98. title="光圈+"
  99. @mousedown="holderHandle('ptzApertureOperation', true, false)"
  100. @mouseup="holderHandle('ptzApertureOperation', true, true)"
  101. ></i>
  102. <i
  103. class="aperture-down-icon"
  104. title="光圈-"
  105. @mousedown="holderHandle('ptzApertureOperation', false, false)"
  106. @mouseup="holderHandle('ptzApertureOperation', false, true)"
  107. ></i>
  108. </el-col>
  109. </el-row>
  110. </div>
  111. </el-main>
  112. </el-container>
  113. </template>
  114. <script>
  115. module.exports = {
  116. data() {
  117. return {
  118. data: [],
  119. value: [1, 4],
  120. cruiseForm: {
  121. num: "",
  122. name: "",
  123. },
  124. fold: true,
  125. moreFold: true,
  126. stepLength: 1,
  127. searchKey: "",
  128. prepointDialogVisible: false,
  129. cruiseDialogVisible: false,
  130. num: ""
  131. };
  132. },
  133. watch: {
  134. fold(val) {
  135. this.$emit("switch-fold", val)
  136. }
  137. },
  138. props: {
  139. brand: {
  140. type: String,
  141. default: 'general'
  142. }
  143. },
  144. methods: {
  145. holderClick(bStop, direct) {
  146. this.$emit("holder-click", {
  147. direct: direct,
  148. stepLength: this.stepLength,
  149. bStop: bStop,
  150. });
  151. },
  152. holderHandle(method, add, bStop) {
  153. this.$emit("holder-handle", {
  154. method: method,
  155. bStop: bStop,
  156. add: add,
  157. });
  158. },
  159. },
  160. };
  161. </script>
  162. <style scoped>
  163. /deep/ .el-transfer-panel {
  164. width: 260px;
  165. }
  166. /deep/ .cruise-dialog-div .el-transfer__button {
  167. border-color: #ee371f;
  168. background-color: #ee371f;
  169. }
  170. /deep/ .cruise-dialog-div .el-transfer__button.is-disabled {
  171. background-color: #fab6b6;
  172. border-color: #fab6b6;
  173. }
  174. /deep/ .cruise-dialog-div .el-form-item {
  175. margin-bottom: 15px;
  176. }
  177. .empty-prepoint-list {
  178. height: 200px;
  179. padding-top: 80px;
  180. text-align: center;
  181. color: #888;
  182. }
  183. .prepoint-list-row {
  184. padding: 5px 10px;
  185. border-bottom: 1px solid #ddd;
  186. }
  187. .prepoint-title {
  188. width: 60px;
  189. line-height: 28px;
  190. }
  191. .h200 {
  192. height: 200px;
  193. }
  194. .mgl70 {
  195. margin-left: 70px;
  196. }
  197. .mgt5 {
  198. margin-top: 5px;
  199. }
  200. .pt5 {
  201. padding-top: 5px;
  202. }
  203. .mgr30 {
  204. margin-right: 30px;
  205. }
  206. .mgr5 {
  207. margin-right: 5px;
  208. }
  209. .mgr10 {
  210. margin-right: 10px;
  211. }
  212. .pdt5 {
  213. padding-top: 5px;
  214. }
  215. .pdb5 {
  216. padding-bottom: 5px;
  217. }
  218. .header {
  219. color: #000;
  220. font-size: 20px;
  221. }
  222. .show-icon {
  223. background: url("../img/ptz/show.png");
  224. background-size: 100% 100%;
  225. width: 16px;
  226. height: 16px;
  227. display: inline-block;
  228. }
  229. .hide-icon {
  230. background: url("../img/ptz/hide.png");
  231. background-size: 100% 100%;
  232. width: 16px;
  233. height: 16px;
  234. display: inline-block;
  235. }
  236. .add-icon {
  237. background: url("../img/ptz/ptzEx2/add-n.png");
  238. background-size: 100% 100%;
  239. width: 14px;
  240. height: 14px;
  241. display: inline-block;
  242. vertical-align: middle;
  243. }
  244. .add-icon:hover {
  245. background: url("../img/ptz/ptzEx2/add-h.png");
  246. }
  247. .center-icon {
  248. background: url("../img/ptz/center.png") no-repeat top left;
  249. width: 48px;
  250. height: 48px;
  251. display: inline-block;
  252. }
  253. .operate-row {
  254. border-top: 1px solid #ccc;
  255. border-bottom: 1px solid #ccc;
  256. padding: 5px 0px;
  257. }
  258. .operate-row .el-col {
  259. text-align: center;
  260. }
  261. .border-right-ccc {
  262. border-right: 1px solid #ccc;
  263. }
  264. .focus-up-icon {
  265. background: url("../img/ptz/ptzEx2/FocusUp_n.png");
  266. background-size: 100% 100%;
  267. width: 20px;
  268. height: 20px;
  269. display: inline-block;
  270. margin-right: 4px;
  271. }
  272. .focus-up-icon:hover {
  273. background: url("../img/ptz/ptzEx2/FocusUp_h.png");
  274. background-size: 100% 100%;
  275. }
  276. .focus-down-icon {
  277. background: url("../img/ptz/ptzEx2/FocusDown_n.png");
  278. background-size: 100% 100%;
  279. width: 20px;
  280. height: 20px;
  281. display: inline-block;
  282. }
  283. .focus-down-icon:hover {
  284. background: url("../img/ptz/ptzEx2/FocusDown_h.png");
  285. background-size: 100% 100%;
  286. }
  287. .scale-add-icon {
  288. background: url("../img/ptz/ptzEx2/scaleAdd_n.png");
  289. background-size: 100% 100%;
  290. width: 20px;
  291. height: 20px;
  292. display: inline-block;
  293. margin-right: 4px;
  294. }
  295. .scale-add-icon:hover {
  296. background: url("../img/ptz/ptzEx2/scaleAdd_h.png");
  297. background-size: 100% 100%;
  298. }
  299. .scale-minus-icon {
  300. background: url("../img/ptz/ptzEx2/scaleMinus_n.png");
  301. background-size: 100% 100%;
  302. width: 20px;
  303. height: 20px;
  304. display: inline-block;
  305. }
  306. .scale-minus-icon:hover {
  307. background: url("../img/ptz/ptzEx2/scaleMinus_h.png");
  308. background-size: 100% 100%;
  309. }
  310. .aperture-up-icon {
  311. background: url("../img/ptz/ptzEx2/ApertureUp_n.png");
  312. background-size: 100% 100%;
  313. width: 20px;
  314. height: 20px;
  315. display: inline-block;
  316. margin-right: 4px;
  317. }
  318. .aperture-up-icon:hover {
  319. background: url("../img/ptz/ptzEx2/ApertureUp_h.png");
  320. background-size: 100% 100%;
  321. }
  322. .aperture-down-icon {
  323. background: url("../img/ptz/ptzEx2/ApertureDown_n.png");
  324. background-size: 100% 100%;
  325. width: 20px;
  326. height: 20px;
  327. display: inline-block;
  328. }
  329. .aperture-down-icon:hover {
  330. background: url("../img/ptz/ptzEx2/ApertureDown_h.png");
  331. background-size: 100% 100%;
  332. }
  333. .p5-10 {
  334. padding: 5px 10px;
  335. }
  336. .holder-more-row {
  337. border-bottom: 1px solid #ccc;
  338. }
  339. .prepoint-h-icon {
  340. background: url("../img/ptz/ptzEx2/Prepoint-h.png");
  341. background-size: 100% 100%;
  342. width: 16px;
  343. height: 16px;
  344. display: inline-block;
  345. }
  346. .prepoint-n-icon {
  347. background: url("../img/ptz/ptzEx2/prepoint-n.png");
  348. background-size: 100% 100%;
  349. width: 16px;
  350. height: 16px;
  351. display: inline-block;
  352. }
  353. .prepoint-n-icon:hover {
  354. background: url("../img/ptz/ptzEx2/Prepoint-h.png");
  355. background-size: 100% 100%;
  356. }
  357. .modify-n-icon {
  358. background: url("../img/ptz/ptzEx2/modify-n.png");
  359. background-size: 100% 100%;
  360. width: 14px;
  361. height: 14px;
  362. display: inline-block;
  363. margin-right: 3px;
  364. }
  365. .modify-n-icon:hover {
  366. background: url("../img/ptz/ptzEx2/modify-h.png");
  367. background-size: 100% 100%;
  368. }
  369. .delete-n-icon {
  370. background: url("../img/ptz/ptzEx2/delete-n.png");
  371. background-size: 100% 100%;
  372. width: 14px;
  373. height: 14px;
  374. display: inline-block;
  375. margin-right: 3px;
  376. }
  377. .delete-n-icon:hover {
  378. background: url("../img/ptz/ptzEx2/delete-h.png");
  379. background-size: 100% 100%;
  380. }
  381. .play-n-icon {
  382. background: url("../img/ptz/ptzEx2/play-n.png");
  383. background-size: 100% 100%;
  384. width: 14px;
  385. height: 14px;
  386. display: inline-block;
  387. margin-right: 3px;
  388. }
  389. .play-n-icon:hover {
  390. background: url("../img/ptz/ptzEx2/play-h.png");
  391. background-size: 100% 100%;
  392. }
  393. .cruise-h-icon {
  394. background: url("../img/ptz/ptzEx2/Cruise-h.png");
  395. background-size: 100% 100%;
  396. width: 16px;
  397. height: 16px;
  398. display: inline-block;
  399. }
  400. .cruise-n-icon {
  401. background: url("../img/ptz/ptzEx2/Cruise-n.png");
  402. background-size: 100% 100%;
  403. width: 16px;
  404. height: 16px;
  405. display: inline-block;
  406. }
  407. .cruise-n-icon:hover {
  408. background: url("../img/ptz/ptzEx2/Cruise-h.png");
  409. background-size: 100% 100%;
  410. }
  411. .el-icon-caret-top {
  412. position: relative;
  413. top: 32px;
  414. left: 8px;
  415. transform: rotate(-64deg);
  416. font-size: x-large;
  417. }
  418. .container {
  419. position: absolute;
  420. bottom: 0px;
  421. background: #fff;
  422. width: 100%;
  423. height: auto;
  424. }
  425. .el-header {
  426. background: #ddd;
  427. }
  428. .holder-disc {
  429. width: 132px;
  430. height: 132px;
  431. border-radius: 50%;
  432. margin-left: 37px;
  433. margin-top: 10px;
  434. }
  435. .holder-disc .box, .holder-disc .disable-box {
  436. position: absolute;
  437. width: 130px;
  438. height: 130px;
  439. border-radius: 50%;
  440. clip: rect(0px, 65px, 65px, 0);
  441. clip-path: polygon(0px 0px, 65px 65px, 0px 65px);
  442. }
  443. .holder-disc .box {
  444. transition: 0.5s;
  445. background: #e6e6e6;
  446. cursor: pointer;
  447. }
  448. .holder-disc .disable-box {
  449. background: #e6e6e6;
  450. }
  451. .holder-disc .box:hover {
  452. background: #ccc;
  453. }
  454. .north-west-icon {
  455. background: url("../img/ptz/northWest.png") no-repeat top left;
  456. width: 13px;
  457. height: 13px;
  458. display: inline-block;
  459. position: relative;
  460. top: 40px;
  461. left: 16px;
  462. transform: rotate(-23deg);
  463. }
  464. .north-west-icon:hover {
  465. background: url("../img/ptz/northWest_hover.png");
  466. }
  467. .holder-disc .s1 {
  468. transform: rotate(22.5deg);
  469. }
  470. .holder-disc .s2 {
  471. transform: rotate(67.5deg);
  472. }
  473. .holder-disc .s3 {
  474. transform: rotate(112.5deg);
  475. }
  476. .holder-disc .s4 {
  477. transform: rotate(157.5deg);
  478. }
  479. .holder-disc .s5 {
  480. transform: rotate(-22.5deg);
  481. }
  482. .holder-disc .s6 {
  483. transform: rotate(-67.5deg);
  484. }
  485. .holder-disc .s7 {
  486. transform: rotate(-112.5deg);
  487. }
  488. .holder-disc .s8 {
  489. transform: rotate(-157.5deg);
  490. }
  491. .holder-disc .center {
  492. position: absolute;
  493. left: 78px;
  494. top: 112px;
  495. border-radius: 50%;
  496. }
  497. .lh38 {
  498. line-height: 38px;
  499. }
  500. </style>