leftAssembly.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <div class="leftAssembly">
  3. <el-select
  4. v-model="componentsValue"
  5. @change="changeSelect"
  6. class="saveColumn-select"
  7. >
  8. <el-option
  9. v-for="(item, index) in componentsSelect"
  10. :key="index"
  11. :label="item.lable"
  12. :value="item.model_id"
  13. ></el-option>
  14. </el-select>
  15. <div class="componentsBlock">
  16. <div
  17. class="moveBlock"
  18. :data-id="item.data_id"
  19. v-for="(item, index) in putCompArr"
  20. :key="index"
  21. draggable
  22. @dragstart="dragstart($event, item)"
  23. @dragend="dragend($event)"
  24. @drag="drag($event)"
  25. >
  26. <div class="moveBlock_titles">{{ item.title }}</div>
  27. <div class="moveBlock_img">
  28. <img
  29. :src="item.imgPng"
  30. :alt="item.title"
  31. />
  32. </div>
  33. <div class="moveBlock_icon">
  34. <img
  35. :src="item.imgIcon"
  36. :alt="item.title"
  37. />
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. export default {
  45. data () {
  46. return {
  47. componentsSelect: [
  48. {
  49. model_id: 0,
  50. lable: '全部'
  51. },
  52. {
  53. model_id: 1,
  54. lable: '房产管理'
  55. },
  56. {
  57. model_id: 2,
  58. lable: '住户管理'
  59. },
  60. {
  61. model_id: 3,
  62. lable: '收费管理'
  63. },
  64. {
  65. model_id: 4,
  66. lable: '设备管理'
  67. },
  68. {
  69. model_id: 5,
  70. lable: '告警管理'
  71. },
  72. {
  73. model_id: 6,
  74. lable: '运维工单'
  75. },
  76. {
  77. model_id: 7,
  78. lable: '设备巡检'
  79. },
  80. {
  81. model_id: 8,
  82. lable: '安保巡更'
  83. },
  84. {
  85. model_id: 9,
  86. lable: '客服服务'
  87. },
  88. {
  89. model_id: 10,
  90. lable: '商业管理'
  91. },
  92. {
  93. model_id: 11,
  94. lable: '社区运营'
  95. },
  96. {
  97. model_id: 12,
  98. lable: '绩效管理'
  99. },
  100. {
  101. model_id: 13,
  102. lable: '流程管理'
  103. }
  104. ],
  105. componentsArrar: [
  106. {
  107. data_id: 1,
  108. title: '高德地图',
  109. type: 0,
  110. imgPng: require('@assets/img/formulation/img_ditu@2x.png'),
  111. imgIcon: require('@assets/img/formulation/tag_4x@2x.png')
  112. },
  113. {
  114. data_id: 2,
  115. type: 9,
  116. title: '投诉建议',
  117. imgPng: require('@assets/img/formulation/img_bingzhuangtu@2x.png'),
  118. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  119. },
  120. {
  121. data_id: 3,
  122. type: 0,
  123. title: '常用功能',
  124. imgPng: require('@assets/img/formulation/img_changyonggongneng@2x.png'),
  125. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  126. },
  127. {
  128. data_id: 4,
  129. title: '服务满意度趋势',
  130. type: 9,
  131. imgPng: require('@assets/img/formulation/img_zhuzhuangtu@2x.png'),
  132. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  133. },
  134. {
  135. data_id: 5,
  136. title: '设备告警趋势',
  137. type: 5,
  138. imgPng: require('@assets/img/formulation/img_zhexiantu@2x.png'),
  139. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  140. },
  141. {
  142. data_id: 6,
  143. title: '房屋租售率',
  144. type: 10,
  145. imgPng: require('@assets/img/formulation/img_bing+baifenbi@2x.png'),
  146. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  147. },
  148. {
  149. data_id: 7,
  150. title: '收款率分析',
  151. type: 3,
  152. imgPng: require('@assets/img/formulation/img_bing+baifenbi@2x.png'),
  153. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  154. },
  155. {
  156. data_id: 8,
  157. title: '住户性别占比',
  158. type: 2,
  159. imgPng: require('@assets/img/formulation/img_bingzhuangtu@2x.png'),
  160. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  161. },
  162. {
  163. data_id: 9,
  164. title: '住户身份占比',
  165. type: 2,
  166. imgPng: require('@assets/img/formulation/img_bingzhuangtu@2x.png'),
  167. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  168. },
  169. {
  170. data_id: 10,
  171. title: '设备设施统计',
  172. type: 4,
  173. imgPng: require('@assets/img/formulation/img_zhuzhuangtu@2x.png'),
  174. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  175. },
  176. {
  177. data_id: 11,
  178. title: '业主审批',
  179. type: 2,
  180. imgPng: require('@assets/img/formulation/img_liebiao@2x.png'),
  181. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  182. },
  183. {
  184. data_id: 12,
  185. title: '待处理投诉',
  186. type: 9,
  187. imgPng: require('@assets/img/formulation/img_liebiao@2x.png'),
  188. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  189. },
  190. {
  191. data_id: 13,
  192. title: '投诉建议数量趋势',
  193. type: 9,
  194. imgPng: require('@assets/img/formulation/img_zhexiantu@2x.png'),
  195. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  196. },
  197. {
  198. data_id: 14,
  199. title: '巡更人员任务执行时长',
  200. type: 8,
  201. imgPng: require('@assets/img/formulation/img_zhuzhuangtu@2x.png'),
  202. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  203. },
  204. {
  205. data_id: 15,
  206. title: '社区公告',
  207. type: 9,
  208. imgPng: require('@assets/img/formulation/img_liebiao@2x.png'),
  209. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  210. },
  211. {
  212. data_id: 16,
  213. title: '运维人员评分',
  214. type: 12,
  215. imgPng: require('@assets/img/formulation/img_zhuzhuangtu@2x.png'),
  216. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  217. },
  218. {
  219. data_id: 17,
  220. title: '待收款账单',
  221. type: 3,
  222. imgPng: require('@assets/img/formulation/img_liebiao@2x.png'),
  223. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  224. },
  225. {
  226. data_id: 18,
  227. title: '合同签约',
  228. type: 10,
  229. imgPng: require('@assets/img/formulation/img_zhexiantu@2x.png'),
  230. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  231. },
  232. {
  233. data_id: 19,
  234. title: '待分派工单',
  235. type: 6,
  236. imgPng: require('@assets/img/formulation/img_liebiao@2x.png'),
  237. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  238. },
  239. {
  240. data_id: 20,
  241. title: '巡检任务类型分布',
  242. type: 7,
  243. imgPng: require('@assets/img/formulation/img_bingzhuangtu@2x.png'),
  244. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  245. },
  246. {
  247. data_id: 21,
  248. title: '设备告警信息',
  249. type: 5,
  250. imgPng: require('@assets/img/formulation/img_liebiao@2x.png'),
  251. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  252. },
  253. {
  254. data_id: 22,
  255. title: '社区总体情况统计',
  256. type: 1,
  257. imgPng: require('@assets/img/formulation/img_liebiao@2x.png'),
  258. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  259. },
  260. {
  261. data_id: 23,
  262. title: '本月房屋点击排名前十',
  263. type: 1,
  264. imgPng: require('@assets/img/formulation/img_tongji@2x.png'),
  265. imgIcon: require('@assets/img/formulation/tag_4x@2x.png')
  266. },
  267. {
  268. data_id: 24,
  269. title: '巡更人员任务执行情况',
  270. type: 8,
  271. imgPng: require('@assets/img/formulation/img_zhuzhuangtu@2x.png'),
  272. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  273. },
  274. {
  275. data_id: 25,
  276. title: '巡更任务完成率',
  277. type: 8,
  278. imgPng: require('@assets/img/formulation/img_bing+baifenbi@2x.png'),
  279. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  280. },
  281. {
  282. data_id: 26,
  283. title: '巡更任务分布',
  284. type: 8,
  285. imgPng: require('@assets/img/formulation/img_zhexiantu@2x.png'),
  286. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  287. },
  288. {
  289. data_id: 27,
  290. title: '运维人员任务执行情况',
  291. type: 6,
  292. imgPng: require('@assets/img/formulation/img_zhuzhuangtu@2x.png'),
  293. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  294. },
  295. {
  296. data_id: 28,
  297. title: '运维工单完成率',
  298. type: 6,
  299. imgPng: require('@assets/img/formulation/img_bing+baifenbi@2x.png'),
  300. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  301. },
  302. {
  303. data_id: 29,
  304. title: '运维工单分类',
  305. type: 6,
  306. imgPng: require('@assets/img/formulation/img_bingzhuangtu@2x.png'),
  307. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  308. },
  309. {
  310. data_id: 30,
  311. title: '巡检人员任务执行情况',
  312. type: 7,
  313. imgPng: require('@assets/img/formulation/img_zhuzhuangtu@2x.png'),
  314. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  315. },
  316. ],
  317. componentsValue: 0
  318. };
  319. },
  320. computed: {
  321. putCompArr () {
  322. let newArr = [];
  323. if (this.componentsValue == 0) {
  324. return this.componentsArrar;
  325. } else {
  326. this.componentsArrar.map((item) => {
  327. if (this.componentsValue == item.type) {
  328. newArr.push(item);
  329. }
  330. });
  331. }
  332. return newArr;
  333. }
  334. },
  335. watch: {},
  336. methods: {
  337. dragstart (e, item) {
  338. //拖拽开始时将item存入vuex
  339. this.$store.commit('setDragItem', item);
  340. },
  341. drag (e) {
  342. //拖拽中执行的事件
  343. // console.log('drag',e)s
  344. },
  345. dragend (e) {
  346. //拖拽结束执行的事件
  347. // console.log('dragend', e);
  348. }
  349. },
  350. destroyed () { },
  351. created () { }
  352. };
  353. </script>
  354. <style lang="scss" scoped>
  355. @import '@assets/css/public-style.scss';
  356. $BackColor: #171f32;
  357. .leftAssembly {
  358. width: 174px;
  359. background: $BackColor;
  360. border-radius: 4px;
  361. padding: rem(20) rem(8) rem(20) rem(20);
  362. .saveColumn-select {
  363. margin-bottom: rem(30);
  364. margin-right: rem(12);
  365. /deep/ .el-input__inner {
  366. background: transparent;
  367. color: white;
  368. border-color: rgba(255, 255, 255, 0.2);
  369. }
  370. }
  371. // 块级模块
  372. .componentsBlock {
  373. height: calc(100% - #{rem(62)});
  374. overflow-y: auto;
  375. overflow-x: hidden;
  376. &::-webkit-scrollbar {
  377. z-index: 11;
  378. width: rem(4);
  379. }
  380. &::-webkit-scrollbar-track,
  381. &::-webkit-scrollbar-corner {
  382. background: transparent;
  383. }
  384. &::-webkit-scrollbar-thumb {
  385. border-radius: 5px;
  386. width: rem(4);
  387. background: rgba(250, 250, 250, 0.09);
  388. }
  389. &::-webkit-scrollbar-track-piece {
  390. background: transparent;
  391. width: rem(4);
  392. }
  393. .moveBlock {
  394. font-size: 12px;
  395. width: rem(132);
  396. height: rem(132);
  397. background: rgba(0, 0, 0, 0.1);
  398. box-sizing: border-box;
  399. border-radius: 4px;
  400. border: 1px solid rgba(255, 255, 255, 0.2);
  401. padding: rem(10);
  402. margin-bottom: rem(20);
  403. text-align: center;
  404. position: relative;
  405. cursor: move;
  406. .moveBlock_titles {
  407. overflow: hidden;
  408. white-space: nowrap;
  409. text-overflow: ellipsis;
  410. width: 100%;
  411. }
  412. .moveBlock_img {
  413. width: rem(60);
  414. margin: auto;
  415. img {
  416. width: 100%;
  417. margin-top: rem(20);
  418. }
  419. }
  420. .moveBlock_icon {
  421. position: absolute;
  422. right: 0;
  423. bottom: 0;
  424. height: rem(20);
  425. img {
  426. width: rem(28);
  427. height: rem(20);
  428. }
  429. }
  430. }
  431. }
  432. }
  433. </style>