|  | @@ -0,0 +1,179 @@
 | 
	
		
			
				|  |  | +<template>
 | 
	
		
			
				|  |  | +  <div class="protection_list">
 | 
	
		
			
				|  |  | +    <nav-bar></nav-bar>
 | 
	
		
			
				|  |  | +    <van-row>
 | 
	
		
			
				|  |  | +      <van-col span="24">
 | 
	
		
			
				|  |  | +        <org-tree v-model="search.orgId" @changeItem="changeTree" @checked="orgCheckChanged" showChecked></org-tree>
 | 
	
		
			
				|  |  | +      </van-col>
 | 
	
		
			
				|  |  | +      <van-col>
 | 
	
		
			
				|  |  | +        <div></div>
 | 
	
		
			
				|  |  | +      </van-col>
 | 
	
		
			
				|  |  | +    </van-row>
 | 
	
		
			
				|  |  | +    <!-- <van-search v-model="search.key" placeholder="请输入搜索关键词" maxlength="50" /> -->
 | 
	
		
			
				|  |  | +    <van-dropdown-menu>
 | 
	
		
			
				|  |  | +      <!-- <van-dropdown-item :title="selectedOrgName" @open="onItemClick" /> -->
 | 
	
		
			
				|  |  | +      <van-dropdown-item v-model="search.status" :options="statusOptions" />
 | 
	
		
			
				|  |  | +      <van-dropdown-item v-model="search.hour" :options="hourOptions" />
 | 
	
		
			
				|  |  | +    </van-dropdown-menu>
 | 
	
		
			
				|  |  | +    <!-- <div>
 | 
	
		
			
				|  |  | +      <van-picker show-toolbar title="选择" :columns="statusOptions"/>
 | 
	
		
			
				|  |  | +    </div> -->
 | 
	
		
			
				|  |  | +    <!-- <van-popup v-model="showOrg" round position="bottom">
 | 
	
		
			
				|  |  | +      <van-cascader v-model="search.orgId" title="选择机构" :options="options" @close="showOrg = false" @change="changeTree"
 | 
	
		
			
				|  |  | +        @finish="onFinish" :field-names="fieldNames" />
 | 
	
		
			
				|  |  | +    </van-popup> -->
 | 
	
		
			
				|  |  | +    <div class="container">
 | 
	
		
			
				|  |  | +      <k-list :list="list" :params="search" :auto="false" ref="list">
 | 
	
		
			
				|  |  | +        <template slot-scope="{ data }">
 | 
	
		
			
				|  |  | +          <item :data="data" :statusOptions="getDictItem('protection_status')"></item>
 | 
	
		
			
				|  |  | +        </template>
 | 
	
		
			
				|  |  | +      </k-list>
 | 
	
		
			
				|  |  | +    </div>
 | 
	
		
			
				|  |  | +  </div>
 | 
	
		
			
				|  |  | +</template>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<script>
 | 
	
		
			
				|  |  | +import NavBar from '@/components/NavBar'
 | 
	
		
			
				|  |  | +// import Calendar from '@/components/Calendar';
 | 
	
		
			
				|  |  | +import { mapGetters } from 'vuex'
 | 
	
		
			
				|  |  | +import { deptTreeList } from '@/api/public'
 | 
	
		
			
				|  |  | +import { list } from '@/api/protection.js'
 | 
	
		
			
				|  |  | +import KList from '@/components/list/index.vue'
 | 
	
		
			
				|  |  | +import Item from './components/item.vue'
 | 
	
		
			
				|  |  | +import OrgTree from '@/components/orgTree'
 | 
	
		
			
				|  |  | +export default {
 | 
	
		
			
				|  |  | +  components: { NavBar, KList, Item ,OrgTree},
 | 
	
		
			
				|  |  | +  data() {
 | 
	
		
			
				|  |  | +    return {
 | 
	
		
			
				|  |  | +      options: [],
 | 
	
		
			
				|  |  | +      search: {
 | 
	
		
			
				|  |  | +        orgId: this.orgId,
 | 
	
		
			
				|  |  | +        checkSub:false,
 | 
	
		
			
				|  |  | +        deviceType: null,
 | 
	
		
			
				|  |  | +        state:null,
 | 
	
		
			
				|  |  | +        pageNum: 1,
 | 
	
		
			
				|  |  | +        pageSize: 10
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +     
 | 
	
		
			
				|  |  | +      fieldNames: {
 | 
	
		
			
				|  |  | +        text: 'shortName',
 | 
	
		
			
				|  |  | +        value: 'id',
 | 
	
		
			
				|  |  | +        children: 'children'
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      deviceTypeOptions:[{value:-1,label:'全部'},
 | 
	
		
			
				|  |  | +      {value:-1,label:'全部'},
 | 
	
		
			
				|  |  | +      {value:-1,label:''},
 | 
	
		
			
				|  |  | +      {value:-1,label:'全部'},
 | 
	
		
			
				|  |  | +      {value:-1,label:'全部'},
 | 
	
		
			
				|  |  | +      {value:-1,label:'全部'},
 | 
	
		
			
				|  |  | +      {value:-1,label:'全部'},
 | 
	
		
			
				|  |  | +    ],
 | 
	
		
			
				|  |  | +      dicts: ["protection_status"]
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  watch: {
 | 
	
		
			
				|  |  | +    // 'search.hour': {
 | 
	
		
			
				|  |  | +    //   handler(v) {
 | 
	
		
			
				|  |  | +    //     if (v) {
 | 
	
		
			
				|  |  | +    //       this.search.dateRange = []
 | 
	
		
			
				|  |  | +    //       this.search.dateRange[0] = dayjs(new Date(new Date().valueOf() - v * 60 * 60 * 1000)) .format("YYYY-MM-DD HH:mm:ss");
 | 
	
		
			
				|  |  | +    //       this.search.dateRange[1] =  dayjs(new Date(2099, 0,1)).format("YYYY-MM-DD HH:mm:ss");
 | 
	
		
			
				|  |  | +    //       console.info(this.search)
 | 
	
		
			
				|  |  | +    //     } else {
 | 
	
		
			
				|  |  | +    //       this.search.dateRange = []
 | 
	
		
			
				|  |  | +    //     }
 | 
	
		
			
				|  |  | +    //   }
 | 
	
		
			
				|  |  | +    // }
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  created() { },
 | 
	
		
			
				|  |  | +  mounted() {
 | 
	
		
			
				|  |  | +    this.getTreeList()
 | 
	
		
			
				|  |  | +    this.search.orgId = this.orgId
 | 
	
		
			
				|  |  | +    // this.orgOptions[0].value = this.orgId
 | 
	
		
			
				|  |  | +    // this.orgOptions[0].text = this.orgName
 | 
	
		
			
				|  |  | +    this.selectedOrgName = this.orgName
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  computed: {
 | 
	
		
			
				|  |  | +    ...mapGetters(['orgName', 'orgId', 'dictionary']),
 | 
	
		
			
				|  |  | +    statusOptions() {
 | 
	
		
			
				|  |  | +      let r = [
 | 
	
		
			
				|  |  | +        { value: null, text: '布撤防状态' }
 | 
	
		
			
				|  |  | +      ]
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      let dict = this.getDictItem('protection_status');
 | 
	
		
			
				|  |  | +      if (dict) {
 | 
	
		
			
				|  |  | +        dict.forEach(element => {
 | 
	
		
			
				|  |  | +          r.push({ value: element.dictValue, text: element.dictLabel })
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      return r;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  methods: {
 | 
	
		
			
				|  |  | +    list,
 | 
	
		
			
				|  |  | +    //获取机构树
 | 
	
		
			
				|  |  | +    getTreeList() {
 | 
	
		
			
				|  |  | +      deptTreeList(this.orgId).then(res => {
 | 
	
		
			
				|  |  | +        this.options = res.data
 | 
	
		
			
				|  |  | +        // this.orgInfo.orgId = this.orgId;
 | 
	
		
			
				|  |  | +        // this.orgInfo.orgName = this.orgName;
 | 
	
		
			
				|  |  | +        // console.log(res,'3333')
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onItemClick() {
 | 
	
		
			
				|  |  | +      this.showOrg = true
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    //改变机构后将重新发起请求
 | 
	
		
			
				|  |  | +    changeTree(node) {
 | 
	
		
			
				|  |  | +      // console.log(selectedOptions,'aaaaaa')
 | 
	
		
			
				|  |  | +      // this.search.orgId = selectedOptions[selectedOptions.length-1].id;
 | 
	
		
			
				|  |  | +      // let option = selectedOptions[selectedOptions.length - 1]
 | 
	
		
			
				|  |  | +      this.search.orgId = node.id
 | 
	
		
			
				|  |  | +      this.selectedOrgName = node.shortName
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    orgCheckChanged(v){
 | 
	
		
			
				|  |  | +      this.search.checkSub=v;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onFinish({ selectedOptions }) {
 | 
	
		
			
				|  |  | +      this.showOrg = false
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<style lang="scss" scoped>
 | 
	
		
			
				|  |  | +.protection_list {
 | 
	
		
			
				|  |  | +  background-color: transparent;
 | 
	
		
			
				|  |  | +  display: block;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  .container {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    // overflow: auto;
 | 
	
		
			
				|  |  | +    // height: calc(100vh - 11rem);
 | 
	
		
			
				|  |  | +    .k-content-repair {
 | 
	
		
			
				|  |  | +      display: flex;
 | 
	
		
			
				|  |  | +      flex-direction: column;
 | 
	
		
			
				|  |  | +      justify-content: space-between;
 | 
	
		
			
				|  |  | +      flex: 1;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +// .form-box {
 | 
	
		
			
				|  |  | +//   height: calc(100vh - 180px);
 | 
	
		
			
				|  |  | +//   padding: 0 30px 50px 30px;
 | 
	
		
			
				|  |  | +//   overflow: auto;
 | 
	
		
			
				|  |  | +// }
 | 
	
		
			
				|  |  | +// .radio-box {
 | 
	
		
			
				|  |  | +//   height: 100px;
 | 
	
		
			
				|  |  | +//   padding: 30px;
 | 
	
		
			
				|  |  | +// }
 | 
	
		
			
				|  |  | +// .org-name {
 | 
	
		
			
				|  |  | +//   font-size: 30px;
 | 
	
		
			
				|  |  | +//   line-height: 80px;
 | 
	
		
			
				|  |  | +//   height: 80px;
 | 
	
		
			
				|  |  | +//   text-align: center;
 | 
	
		
			
				|  |  | +// }
 | 
	
		
			
				|  |  | +</style>
 |