<style>
  .bg {
    background-color: blue;
    height: 1px;
    border: 0;
  }
  .app-row {
    background-color: white;
    padding: 10px 10px 0 10px;
    border-bottom: 1px solid rgba(235, 235, 235, 0.5);
  }
  .search_input {
    border: 0;
    outline: none;
  }
  .font{
    font: 15px PingFang-SC-Medium;
    color: #666666;
  }
  .input-font{
    font: 15px PingFang-SC-Medium;
    color: #333333;
  }
  .btn-font{
    font:600 16px PingFang-SC-Bold;
    color: #499EDF;
  }
  .btn-color{
    background-color: #FFFFFF;
    border-radius: 10px ;
    border: 1px solid #499EDF;
  }
  .app-text {
    font-size: 12px;
  }
  .panel-self{
    border-radius: 10px;
    border:1px solid #499EDF;
    background-color: #F8F8F8;
  }
  .yybtn-color{
    background-color:#499edf;
    border-radius: 4px ;
    border: 1px solid #499EDF;
    color: #FFFFFF;
    font: 14px PingFang-SC-Bold;
  }
  .qxbtn-color{
    background-color: #FFFFFF;
    border-radius: 4px ;
    color: #499edf;
    font: 14px PingFang-SC-Bold;
    border: 1px solid #499EDF;
  }

</style>

<template>
  <div class="auto">
    <criteria-paged :model="model" v-ref:paged>
      <criteria partial='criteria' @condition-changed='search' v-ref:cri>
        <div partial>
          <form>
            <div class="row col-xs-12 col-sm-6 col-md-6 app-row">
              <div class="col-xs-4 col-sm-4 col-md-4">
                <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
                <label for="f_userinfo_code" class="font text-left">小区名称：</label>
              </div>
              <div class="col-xs-8 col-sm-8 col-md-8" >
                <input id="f_userinfo_code" class="search_input input-font"
                       v-model=model.f_residential_area condition="f_residential_area like '%{}%'" />
              </div>
            </div>
            <div class="row col-xs-12 col-sm-6 col-md-6 app-row">
              <div class="col-xs-4 col-sm-4 col-md-4">
                <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
                <label class="font text-left">街道：</label>
              </div>
              <div class="col-xs-8 col-sm-8 col-md-8" >
                <input class="search_input input-font"
                       v-model=model.f_street condition="f_street like '%{}%'" />
              </div>
            </div>
            <div class="row col-xs-12 col-sm-6 col-md-6 app-row">
              <div class="col-xs-4 col-sm-4 col-md-4">
                <img src="../../assets/上传状态.png" style="width: 20px;margin-bottom: 5px" alt="">
                <label for="f_upload_state" class="font text-left">上传状态：</label>
              </div>
              <div class="col-xs-8 col-sm-8 col-md-8" >
                <v-select id="f_upload_state" :value.sync="model.f_isupload" class="input-font"
                          :options='$parent.$parent.upload_states' placeholder='请选择上传状态'
                          v-model="model.f_isupload" condition="f_isupload='{}'" close-on-select clear-button></v-select>
              </div>
            </div>
            <div class="row col-xs-12 col-sm-12 col-md-6 text-center" style="margin-top: 20px;">
              <button type="button" class="btn btn-lg btn-font btn-color" style="width: 45%;" @click="search">查询</button>
            </div>
            <!--<div class="row col-xs-12 col-sm-6 col-md-6 app-btn">-->
              <!--<button class="btn btn-primary col-xs-6" type="button"  @click="search"><span class="glyphicon  glyphicon-search" style="margin-right: 20px;">查询</span></button>-->
            <!--</div>-->
            <div style="height:30px;"></div>
          </form>
        </div>
      </criteria>
      <list :model="model" partial='list'>
        <div partial>
          <div @click="$parent.$parent.$parent.inspect(row)" class="auto app-text" style="margin-top: 5px;">
            <div class="panel" style="padding: 10px 10px 5px 10px;">
              <div class="panel-body panel-self">
                <div class="row col-xs-12 col-sm-6 col-md-6">
                  <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">小区名称</p>
                  <p class="panel-title col-xs-8 col-sm-8 col-md-8 text-left input-font">{{ row.f_residential_area }}</p>
                </div>
                <div class="row col-xs-12 col-sm-6 col-md-6">
                  <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">街道</p>
                  <p class="panel-title col-xs-8 col-sm-8 col-md-8 text-left input-font">{{ row.f_street }}</p>
                </div>
                <div class="row col-xs-12 col-sm-6 col-md-6">
                  <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">上传状态</p>
                  <p class="panel-title col-xs-8 col-sm-8 col-md-8 text-left input-font">{{ row.f_upload_state }}</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </list>
    </criteria-paged>
    <back-page :need-back='true'  @flag="$back()"></back-page>
  </div>
</template>

<script>
  import LocalPagedList from './LocalPagedList'
  import Vue from 'vue'
  import { PagedList } from 'vue-client'
  import * as Util from '../Util'

  export default {
    title: '小区宣传单记录',
    data() {
      return {
        model:Vue.android? new LocalPagedList('androidGetAreaPublicityInfo',20): new PagedList( 'AndroidRest/rs/sql/androidGetAreaPublicityInfo',20),
        showModal: false,
        param: null,
        upload_states: [
          {label: '全部', value: ''},
          {label: '未上传', value: '未上传'},
          {label: '已上传', value: '已上传'}
        ],
      }
    },
    ready(){
    //  this.refresh()
    },
    methods: {
      refresh() {
        console.log("refresh items state")
        // hard code relationship
        this.$refs.paged.$refs.cri.search()
      },
      reload(){
        console.log('页面刷新 ')
        this.$refs.paged.loadPage(this.$refs.paged.model.pageIndex)
      },
      inspect(row) {
        console.log('rowrow:row',row)
        let value = this.$androidUtil.path({alias: 'getLocalAreaPub', data:{condition:`id = '${row.id}'`}})
        if(value.code == 200)
          this.$goto('take-photo',{row: row,pictureinfo:value.data},'self')
      },
    }
  }
</script>
