index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="page_list">
  3. <nav-bar :go="{ type: 'push', path: '/menu' }"></nav-bar>
  4. <van-row>
  5. <van-col span="24">
  6. <org-tree v-model="search.orgId" @changeItem="changeTree" @checked="orgCheckChanged" showChecked defaultChecked></org-tree>
  7. </van-col>
  8. </van-row>
  9. <van-row>
  10. <van-col span="24">
  11. <van-cell title="通道状态" @click="showStatus = true" is-link arrow-direction="down" :value="defaultStatus" />
  12. <van-popup v-model="showStatus" round position="bottom">
  13. <van-picker
  14. title="通道状态"
  15. show-toolbar
  16. :columns="statusOptions"
  17. @confirm="onStatusConfirm"
  18. @cancel="onCancel"
  19. default-index="0"
  20. :close-on-click-overlay="false"
  21. />
  22. </van-popup>
  23. </van-col>
  24. </van-row>
  25. <div class="container">
  26. <k-list :list="list" :params="search" :auto="false" ref="list">
  27. <template slot-scope="{ data }">
  28. <item :data="data" :defaultExpanded="!search.checkSub"></item>
  29. </template>
  30. </k-list>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import NavBar from '@/components/NavBar'
  36. import { mapGetters } from 'vuex'
  37. import { deptTreeList } from '@/api/public'
  38. import { list } from '@/api/iot/videoDiagnosis.js'
  39. import KList from '@/components/list/index.vue'
  40. import Item from './components/item.vue'
  41. import OrgTree from '@/components/orgTree'
  42. export default {
  43. components: { NavBar, KList, Item, OrgTree },
  44. name:'iot_videoDiagnosis',
  45. data() {
  46. return {
  47. search: {
  48. orgId: this.orgId,
  49. checkSub: true,
  50. state: null,
  51. pageNum: 1,
  52. pageSize: 10
  53. },
  54. showStatus:false,
  55. defaultStatus:'全部',
  56. dicts: ["app_video_diagnosis_status"]
  57. }
  58. },
  59. watch: {},
  60. created() {},
  61. mounted() {
  62. this.search.orgId = this.orgId
  63. },
  64. computed: {
  65. ...mapGetters(['orgName', 'orgId', 'dictionary']),
  66. statusOptions() {
  67. let r = [
  68. { value: null, text: '全部' }
  69. ]
  70. let dict = this.getDictItem('app_video_diagnosis_status');
  71. if (dict) {
  72. dict.forEach(element => {
  73. r.push({ value: element.dictValue, text: element.dictLabel })
  74. });
  75. }
  76. return r;
  77. }
  78. },
  79. methods: {
  80. list,
  81. // refreshData(){
  82. // this.search.pageNum=0;
  83. // },
  84. //改变机构后将重新发起请求
  85. changeTree(node) {
  86. this.search.orgId = node.id
  87. },
  88. orgCheckChanged(v) {
  89. this.search.checkSub = v
  90. },
  91. onStatusConfirm(opt) {
  92. this.defaultStatus=opt.text;
  93. this.search.state = opt.value
  94. this.showStatus = false
  95. },
  96. onCancel(){
  97. this.showStatus=false;
  98. }
  99. // onStatusChanged(state) {
  100. // if(this.search.state===state){
  101. // this.search.state=null;
  102. // }else{
  103. // this.search.state = state
  104. // }
  105. // }
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .page_list {
  111. background-color: transparent;
  112. display: block;
  113. .container {
  114. // overflow: auto;
  115. // height: calc(100vh - 11rem);
  116. .k-content-repair {
  117. display: flex;
  118. flex-direction: column;
  119. justify-content: space-between;
  120. flex: 1;
  121. }
  122. }
  123. }
  124. // .search-state {
  125. // width: 100%;
  126. // > span {
  127. // width: 33.333333%;
  128. // border: solid 1px rgb(196,196,196);
  129. // display: inline-block;
  130. // text-align: center;
  131. // padding-top: 1.2vw;
  132. // padding-bottom: 1.2vw;
  133. // }
  134. // }
  135. // .alarm_state_selected {
  136. // background-color: #409eff;
  137. // border-color: #409eff;
  138. // color: white;
  139. // font-weight: 700;
  140. // }
  141. </style>