c4011d0146d4f70f39a5f16f5cd609b822492ae0.svn-base 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <!-- -->
  2. <template>
  3. <div >
  4. <div class="superviseObject" :style="'height:' + compHeight +'px'">
  5. <!-- <ul>
  6. <li class="myTag" v-for="(item,index) in transferUseLists"
  7. :key="index"
  8. @click="changeObjtypeEvent(index,item)">
  9. <el-tag
  10. :disable-transitions="true"
  11. style="width: 100%;"
  12. :type="checkedThis(item) ? '': 'info'">
  13. <template slot-scope="scope">
  14. <span class="childSpan" style="">{{item.name}}</span>
  15. <div style="float:right;">
  16. <span>{{item.total}}</span>
  17. <span>{{barsChooseUnit}}</span>
  18. </div>
  19. </template>
  20. </el-tag>
  21. </li>
  22. </ul> -->
  23. <!-- <ul>
  24. <li v-for="(item,index) in transferUseLists"
  25. :key="index" :class="checkedThis(item) ? 'childLi_checked': 'childLi_normal'"
  26. @click="changeObjtypeEvent(index,item)">
  27. <span class="childSpan" style="">{{item.name}}</span>
  28. <div style="float:right;">
  29. <span>{{item.total}}</span>
  30. <span>{{barsChooseUnit}}</span>
  31. </div>
  32. </li>
  33. </ul> -->
  34. <el-collapse accordion class="myCollapse">
  35. <el-collapse-item v-for="(item,index) in transferUseLists" :key="index">
  36. <template slot="title">
  37. <el-row style="width:100%">
  38. <el-col :span="spanNumLeft" style="padding: 0 0 0 10px;"><span class="childSpan" style="">{{item.name}}</span></el-col>
  39. <el-col :span="spanNumRight">
  40. <div style="float:right;">
  41. <span>{{item.total}}</span>
  42. <span>{{barsChooseUnit}}</span>
  43. </div>
  44. </el-col>
  45. </el-row>
  46. </template>
  47. <li v-for="(itemChild,indexChild) in item.children"
  48. :key="indexChild" :class="checkedThis(itemChild) ? 'childLi_checked': 'childLi_normal'"
  49. @click="changeObjtypeEvent(indexChild,itemChild)">
  50. <span class="childSpan" style="margin-left:.8vw">{{itemChild.name}}</span>
  51. <div style="float:right;">
  52. <span>{{itemChild.total}}</span>
  53. <span>{{barsChooseUnit}}</span>
  54. </div>
  55. </li>
  56. </el-collapse-item>
  57. </el-collapse>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  63. //例如:import 《组件名称》 from '《组件路径》';
  64. import {BarsDczNums} from "../../api/homeMainView.js";
  65. export default {
  66. //import引入的组件需要注入到对象中才能使用
  67. props:['barsChooseType','barsChooseUnit','transferUseLists','requestEntmTime','requestOrgId','requestObjectType','requestSttmTime'],
  68. components: {},
  69. data() {
  70. //这里存放数据
  71. return {
  72. tabPosition: 'left',
  73. // compHeight:window.innerHeight - 228,
  74. checkedLists:"",
  75. cheked:true,
  76. // spanNumLeft:18,
  77. // spanNumRight:6,
  78. };
  79. },
  80. //监听属性 类似于data概念
  81. computed: {
  82. compHeight(){
  83. if(window.screen.height <= 768){
  84. return window.innerHeight - 443;
  85. }else if(window.screen.height > 1080){
  86. return window.innerHeight - 609;
  87. }else{
  88. return window.innerHeight - 569;
  89. }
  90. },
  91. spanNumLeft(){
  92. if(window.innerWidth <= 1366){
  93. return 16;
  94. }else{
  95. return 16;
  96. }
  97. },
  98. spanNumRight(){
  99. if(window.innerWidth <= 1366){
  100. return 8;
  101. }else{
  102. return 8;
  103. }
  104. },
  105. },
  106. //监控data中的数据变化
  107. watch: {
  108. barsChooseType(newValue,oldValue){
  109. this.barsChooseType = newValue;
  110. },
  111. barsChooseUnit(newValue,oldValue){
  112. this.barsChooseUnit = newValue;
  113. },
  114. transferUseLists(newValue,oldValue){
  115. this.transferUseLists = newValue;
  116. }
  117. },
  118. //方法集合
  119. methods: {
  120. //初始化请求督查组数据
  121. getDczData:function(){
  122. let _self = this;
  123. let searchParmas = {
  124. endTime: this.requestEntmTime,
  125. orgIds: this.requestOrgId,
  126. pTypes: this.requestObjectType,
  127. startTime: this.requestSttmTime
  128. };
  129. BarsDczNums(searchParmas).then((res)=>{
  130. this.transferUseLists = res.data;
  131. });
  132. },
  133. //li点击处理选中督查对象类型
  134. changeObjtypeEvent(index,item){
  135. // if(this.checkedLists == ""){
  136. this.checkedLists = item.objType;
  137. // }else{
  138. // let have = false;
  139. // this.checkedLists.forEach((element,index) => {
  140. // if(element == item.objType ){
  141. // this.checkedLists.splice(index,1);
  142. // have = true;
  143. // }
  144. // });
  145. // if(have == false){
  146. // this.checkedLists.push(item.objType);
  147. // }
  148. // }
  149. this.$emit('objTypeChangeEvent',this.checkedLists);
  150. },
  151. //控制li选中样式
  152. checkedThis:function(item){
  153. let have = false;
  154. // this.checkedLists.forEach((element,index) => {
  155. if(this.checkedLists == item.objType ){
  156. have = true;
  157. }
  158. // });
  159. return have;
  160. }
  161. },
  162. //生命周期 - 创建完成(可以访问当前this实例)
  163. created() {
  164. },
  165. //生命周期 - 挂载完成(可以访问DOM元素)
  166. mounted() {
  167. // this.getDczData();
  168. // alert(window.screen.width);
  169. // alert(window.screen.height);
  170. },
  171. beforeCreate() {}, //生命周期 - 创建之前
  172. beforeMount() {}, //生命周期 - 挂载之前
  173. beforeUpdate() {}, //生命周期 - 更新之前
  174. updated() {}, //生命周期 - 更新之后
  175. beforeDestroy() {}, //生命周期 - 销毁之前
  176. destroyed() {}, //生命周期 - 销毁完成
  177. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  178. }
  179. </script>
  180. <style lang="scss">
  181. @media screen and (min-width: 1024px) and (max-width:1920px){
  182. @import "@scss/home";
  183. }
  184. @media screen and (width: 1920px) {
  185. @import "@scss/home1920";
  186. }
  187. //暗色主题浅灰色字体
  188. @mixin fontColor_dark_gray{
  189. [data-theme="dark"] & {
  190. color:rgba(177, 210, 254, 1);
  191. }
  192. }
  193. //暗色主题透明背景
  194. //暗色主题 div透明背景
  195. @mixin leftButtonBackg{
  196. [data-theme="dark"] & {
  197. background:transparent;
  198. // border: 1px solid rgba(54,162,252,1);
  199. }
  200. }
  201. .childLi_normal{
  202. cursor: pointer;
  203. margin-top: 0;
  204. padding: .5vh .5vw !important;
  205. // border-radius: 4px;
  206. // border: 1px solid rgba(161,213,255,1);
  207. // color: #36A2FC;
  208. color: rgba(51, 51, 51, 1);
  209. // background:rgba(236,245,255,1);
  210. list-style: none;
  211. @include leftButtonBackg;
  212. }
  213. .childLi_checked{
  214. cursor: pointer;
  215. margin-top: 0;
  216. padding: .5vh .5vw !important;
  217. // border-radius: 4px;
  218. // border: 1px solid rgba(161,213,255,1);
  219. // color: #fff;
  220. // color: #36A2FC;
  221. list-style: none;
  222. background:rgba(64,159,255,0.15);
  223. }
  224. .myTag .el-tag--mini{
  225. background-color: transparent;
  226. }
  227. .myTag .el-tag--info{
  228. // border: none;
  229. color:#313F66;
  230. @include fontColor_dark_gray;
  231. }
  232. .myCollapse{
  233. background: rgba(242,243,247,1);
  234. border: 1px solid #DCDEE3;
  235. border-radius: 3px;
  236. @include leftButtonBackg;
  237. }
  238. .myCollapse .el-collapse-item__header{
  239. background: transparent;
  240. height: 32px;
  241. line-height: 32px;
  242. }
  243. .myCollapse .el-collapse-item:last-child{
  244. margin-bottom: 0px;
  245. }
  246. .myCollapse .el-collapse-item__wrap{
  247. background: transparent;
  248. }
  249. .myCollapse .el-collapse-item__header.is-active{
  250. background: #409FFF;
  251. color:#fff;
  252. }
  253. .myCollapse .el-collapse-item__content{
  254. padding-bottom: 10px;
  255. }
  256. // @import url('../../assets/sass/homeForElementUI.css');
  257. </style>
  258. <style>
  259. </style>