editWorkbench.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <div class="workbench">
  3. <div class="ComponentSave">
  4. <div class="saveColumn">
  5. <span class="title">工作台-自拟定</span>
  6. <el-select v-model="model" clearable @change="changeSelect" class="saveColumn-select">
  7. <el-option v-for="(item, index) in modelSelect" :key="index" :label="item.lable" :value="item.model_id"></el-option>
  8. </el-select>
  9. </div>
  10. <div class="saveColumn-buttons">
  11. <el-button>取消</el-button>
  12. <el-button type="primary">保存并使用</el-button>
  13. </div>
  14. </div>
  15. <div class="operation">
  16. <div class="leftAssembly">
  17. <el-select v-model="componentsValue" clearable @change="changeSelect" class="saveColumn-select">
  18. <el-option
  19. v-for="(item, index) in componentsSelect"
  20. :key="index"
  21. :label="item.lable"
  22. :value="item.model_id"
  23. ></el-option>
  24. </el-select>
  25. <div class="componentsBlock">
  26. <template v-for="(item, index) in componentsArrar">
  27. <div class="moveBlock" :data-id="item.data_id" @mousedown="moveBlock($event, item.data_id)" :key="index">
  28. <div class="moveBlock_titles">{{ item.title }}</div>
  29. <div class="moveBlock_img">
  30. <img :src="item.imgPng" :alt="item.title" />
  31. </div>
  32. <div class="moveBlock_icon">
  33. <img :src="item.imgIcon" :alt="item.title" />
  34. </div>
  35. </div>
  36. </template>
  37. </div>
  38. </div>
  39. <model-one v-if="model == 1"></model-one>
  40. <model-two v-if="model == 2"></model-two>
  41. <model-three v-if="model == 3"></model-three>
  42. <model-four v-if="model == 4"></model-four>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. import workcommonFcuntion from './template/index.js';
  48. export default {
  49. mixins: [workcommonFcuntion],
  50. data() {
  51. return {
  52. model: 1,
  53. modelSelect: [
  54. {
  55. model_id: 1,
  56. lable: '模板一'
  57. },
  58. {
  59. model_id: 2,
  60. lable: '模板二'
  61. },
  62. {
  63. model_id: 3,
  64. lable: '模板三'
  65. },
  66. {
  67. model_id: 4,
  68. lable: '模板四'
  69. }
  70. ],
  71. componentsSelect: [
  72. {
  73. model_id: 0,
  74. lable: '全部'
  75. }
  76. ],
  77. componentsArrar: [
  78. {
  79. data_id: 1,
  80. title: '高德地图',
  81. imgPng: require('@assets/img/formulation/img_ditu@2x.png'),
  82. imgIcon: require('@assets/img/formulation/tag_4x@2x.png')
  83. },
  84. {
  85. data_id: 2,
  86. title: '社区总体情况统计',
  87. imgPng: require('@assets/img/formulation/img_tongji@2x.png'),
  88. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  89. },
  90. {
  91. data_id: 3,
  92. title: '常用功能',
  93. imgPng: require('@assets/img/formulation/img_changyonggongneng@2x.png'),
  94. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  95. },
  96. {
  97. data_id: 4,
  98. title: '运维人员评分系统',
  99. imgPng: require('@assets/img/formulation/img_zhuzhuangtu@2x.png'),
  100. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  101. },
  102. {
  103. data_id: 5,
  104. title: '巡更任务完成率',
  105. imgPng: require('@assets/img/formulation/img_bingzhuangtu@2x.png'),
  106. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  107. },
  108. {
  109. data_id: 6,
  110. title: '设备告警趋势',
  111. imgPng: require('@assets/img/formulation/img_zhexiantu@2x.png'),
  112. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  113. },
  114. {
  115. data_id: 7,
  116. title: '销售漏斗',
  117. imgPng: require('@assets/img/formulation/img_loudou@2x.png'),
  118. imgIcon: require('@assets/img/formulation/tag_1x@2x.png')
  119. },
  120. {
  121. data_id: 8,
  122. title: '待收款账户',
  123. imgPng: require('@assets/img/formulation/img_liebiao@2x.png'),
  124. imgIcon: require('@assets/img/formulation/tag_2x@2x.png')
  125. }
  126. ],
  127. componentsValue: 0,
  128. isEdit: false,
  129. dataId: null
  130. };
  131. },
  132. watch: {
  133. $route(to, from) {
  134. if (to.query.editWorkbench) {
  135. this.isEdit = true;
  136. }
  137. }
  138. },
  139. methods: {
  140. moveBlock(e, num) {
  141. this.dataId = num;
  142. },
  143. communityNameList() {
  144. this.$http.get('/sc-community/assets/community/list').then(({ data, msg, status }) => {
  145. if (status == 0) {
  146. this.$store.commit('setAreaSelect', data);
  147. }
  148. });
  149. }
  150. },
  151. created() {
  152. this.communityNameList();
  153. }
  154. };
  155. </script>
  156. <style lang="scss" scoped>
  157. @import '@assets/css/public-style.scss';
  158. $BackColor: #171f32;
  159. .overflowHidden {
  160. overflow: hidden;
  161. }
  162. .list_border {
  163. border: 1px solid $BackColor;
  164. border-radius: 4px;
  165. }
  166. .mr10 {
  167. margin: rem(10);
  168. }
  169. .workbench {
  170. background: #2c354a;
  171. height: 100%;
  172. min-height: rem(700);
  173. overflow: auto;
  174. color: white;
  175. &::-webkit-scrollbar {
  176. display: none;
  177. }
  178. .ComponentSave {
  179. height: rem(60);
  180. min-height: 60px;
  181. background: $BackColor;
  182. border-radius: 4px;
  183. margin-bottom: rem(20);
  184. padding: 0 rem(20);
  185. display: flex;
  186. justify-content: space-between;
  187. .saveColumn {
  188. display: flex;
  189. align-items: center;
  190. .saveColumn-select {
  191. margin-left: rem(20);
  192. /deep/ .el-input__inner {
  193. background: transparent;
  194. color: white;
  195. }
  196. }
  197. }
  198. .saveColumn-buttons {
  199. display: flex;
  200. align-items: center;
  201. /deep/ .el-button {
  202. padding: rem(8) rem(20);
  203. }
  204. /deep/ .el-button--default {
  205. background: transparent;
  206. border-color: #0eaeff;
  207. color: white;
  208. &:active {
  209. opacity: 0.8;
  210. }
  211. }
  212. }
  213. }
  214. .operation {
  215. height: rem(794);
  216. min-height: 794px;
  217. display: flex;
  218. justify-content: space-between;
  219. .leftAssembly {
  220. width: 174px;
  221. background: $BackColor;
  222. border-radius: 4px;
  223. padding: rem(20) rem(8) rem(20) rem(20);
  224. .saveColumn-select {
  225. margin-bottom: rem(30);
  226. margin-right: rem(12);
  227. /deep/ .el-input__inner {
  228. background: transparent;
  229. color: white;
  230. border-color: rgba(255, 255, 255, 0.2);
  231. }
  232. }
  233. // 块级模块
  234. .componentsBlock {
  235. height: calc(100% - #{rem(62)});
  236. overflow-y: auto;
  237. overflow-x: hidden;
  238. &::-webkit-scrollbar {
  239. z-index: 11;
  240. width: rem(4);
  241. }
  242. &::-webkit-scrollbar-track,
  243. &::-webkit-scrollbar-corner {
  244. background: transparent;
  245. }
  246. &::-webkit-scrollbar-thumb {
  247. border-radius: 5px;
  248. width: rem(4);
  249. background: rgba(250, 250, 250, 0.09);
  250. }
  251. &::-webkit-scrollbar-track-piece {
  252. background: transparent;
  253. width: rem(4);
  254. }
  255. .moveBlock {
  256. font-size: 12px;
  257. width: rem(132);
  258. height: rem(132);
  259. background: rgba(0, 0, 0, 0.1);
  260. box-sizing: border-box;
  261. border-radius: 4px;
  262. border: 1px solid rgba(255, 255, 255, 0.2);
  263. padding: rem(10);
  264. margin-bottom: rem(20);
  265. text-align: center;
  266. position: relative;
  267. cursor: move;
  268. .moveBlock_titles {
  269. overflow: hidden;
  270. white-space: nowrap;
  271. text-overflow: ellipsis;
  272. width: 100%;
  273. }
  274. .moveBlock_img {
  275. width: rem(60);
  276. margin: auto;
  277. img {
  278. width: 100%;
  279. margin-top: rem(20);
  280. }
  281. }
  282. .moveBlock_icon {
  283. position: absolute;
  284. right: 0;
  285. bottom: 0;
  286. height: rem(20);
  287. img {
  288. width: rem(28);
  289. height: rem(20);
  290. }
  291. }
  292. }
  293. }
  294. }
  295. }
  296. }
  297. </style>