leftAssembly.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. componentsValue: 0
  198. };
  199. },
  200. computed: {
  201. putCompArr() {
  202. let newArr = [];
  203. if (this.componentsValue == 0) {
  204. return this.componentsArrar;
  205. } else {
  206. this.componentsArrar.map((item) => {
  207. if (this.componentsValue == item.type) {
  208. newArr.push(item);
  209. }
  210. });
  211. }
  212. return newArr;
  213. }
  214. },
  215. watch: {},
  216. methods: {
  217. dragstart(e, item) {
  218. //拖拽开始时将item存入vuex
  219. this.$store.commit('setDragItem', item);
  220. },
  221. drag(e) {
  222. //拖拽中执行的事件
  223. // console.log('drag',e)s
  224. },
  225. dragend(e) {
  226. //拖拽结束执行的事件
  227. // console.log('dragend', e);
  228. }
  229. },
  230. destroyed() {},
  231. created() {}
  232. };
  233. </script>
  234. <style lang="scss" scoped>
  235. @import '@assets/css/public-style.scss';
  236. $BackColor: #171f32;
  237. .leftAssembly {
  238. width: 174px;
  239. background: $BackColor;
  240. border-radius: 4px;
  241. padding: rem(20) rem(8) rem(20) rem(20);
  242. .saveColumn-select {
  243. margin-bottom: rem(30);
  244. margin-right: rem(12);
  245. /deep/ .el-input__inner {
  246. background: transparent;
  247. color: white;
  248. border-color: rgba(255, 255, 255, 0.2);
  249. }
  250. }
  251. // 块级模块
  252. .componentsBlock {
  253. height: calc(100% - #{rem(62)});
  254. overflow-y: auto;
  255. overflow-x: hidden;
  256. &::-webkit-scrollbar {
  257. z-index: 11;
  258. width: rem(4);
  259. }
  260. &::-webkit-scrollbar-track,
  261. &::-webkit-scrollbar-corner {
  262. background: transparent;
  263. }
  264. &::-webkit-scrollbar-thumb {
  265. border-radius: 5px;
  266. width: rem(4);
  267. background: rgba(250, 250, 250, 0.09);
  268. }
  269. &::-webkit-scrollbar-track-piece {
  270. background: transparent;
  271. width: rem(4);
  272. }
  273. .moveBlock {
  274. font-size: 12px;
  275. width: rem(132);
  276. height: rem(132);
  277. background: rgba(0, 0, 0, 0.1);
  278. box-sizing: border-box;
  279. border-radius: 4px;
  280. border: 1px solid rgba(255, 255, 255, 0.2);
  281. padding: rem(10);
  282. margin-bottom: rem(20);
  283. text-align: center;
  284. position: relative;
  285. cursor: move;
  286. .moveBlock_titles {
  287. overflow: hidden;
  288. white-space: nowrap;
  289. text-overflow: ellipsis;
  290. width: 100%;
  291. }
  292. .moveBlock_img {
  293. width: rem(60);
  294. margin: auto;
  295. img {
  296. width: 100%;
  297. margin-top: rem(20);
  298. }
  299. }
  300. .moveBlock_icon {
  301. position: absolute;
  302. right: 0;
  303. bottom: 0;
  304. height: rem(20);
  305. img {
  306. width: rem(28);
  307. height: rem(20);
  308. }
  309. }
  310. }
  311. }
  312. }
  313. </style>