leftAssembly.vue 12 KB

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