export default class TestData {

  async ready() {
  }

  selected = null

  addFlow = {}
  components = [{name:"component1"},{name:"component2"},{name:"component3"},{name:"component4"}]

  setSelected(v,f){
    this.selected = v
    f()
  }

  selects = ["ab", "cd", "ef", "gh", ]
  tests = [1,2,3,4,5,6,7,8,9,0,11,22,33,44,55,66,77,88,99,0,111,222,333]
  name = "测试"
  count = 100

  changeBeginValue(name,value){
    this.addFlow[name]=value
  }

  // 根据选中的待办项确定模板
  getTemplate() {
    console.log("getTemplate" )
    if (this.selected == null) {
      return ""
    } else {
      return this.selected.name
    }
  }

  jumptodefault(select, f){
    // this.selected = {name:"defaultPage"}
    this.setSelected({name:"defaultPage"},f)
    console.log("jump" , select)
    f()
  }

  temporary = {}

  t1 = "temp1"
  t2 = "temp2"
  t3 = "temp3"
  t4 = "temp4"

  isAndNot = ["是", "否"]

  user = {
    list: {
      data: [
        {
          "f_user_type": "工业",
          "f_building": null,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": null,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": null,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": null,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": null,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": null,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": null,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": null,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
      ]
    }
  }

  checkplanitems = {
    list: {
      data: [
        {
          "f_user_type": "工业",
          "f_building": 3,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": 3,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": 3,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": 3,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": 3,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": 3,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": 3,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
        {
          "f_user_type": "工业",
          "f_building": 3,
          "f_last_sellinggas_date": null,
          "f_last_check_state": "入户",
          "f_residential_area": "阳光小区",
          "f_last_check_result": "{\"result\":\"有隐患\",\"data\":[{\"阀门\":\"无阀门\"}]}",
          "f_area": "安宁区",
          "f_user_phone": "12312312312",
          "f_address": "xx省xx市xx县xx路xx号",
          "f_unit": 5,
          "f_last_check_date": "2020-4-24",
          "f_depid": "1561",
          "f_floor": 3,
          "f_userinfo_code": "00000001",
          "f_room": 303,
          "f_user_state": "正常",
          "f_credentials": "营业执照",
          "f_user_name": "奥德",
        },
      ]
    }
  }

  checkplan = {
    list: {
      count:44,
      data: [
        {
          f_plan_name: "阳光小区2020年安检计划",
          f_checker: "安检员1",
          f_plan_year: 2019,
          f_plan_month: 11,
          count: 100,
          check: 80,
          nocheck: 20
        },
        {f_plan_name: "快乐小区安检计划", f_checker: "", f_plan_year: 2020, f_plan_month: 3, count: 120, check: 80, nocheck: 40},
        {f_plan_name: "快乐小区安检计划", f_checker: "新疆买买提", f_plan_year: 2020, f_plan_month: 9, count: 120, check: 80, nocheck: 40},
        {f_plan_name: "快乐小区安检计划", f_checker: "张三李四", f_plan_year: 2020, f_plan_month: 9, count: 120, check: 80, nocheck: 40},
        {
          f_plan_name: "幸福小区2019年二次安检计划",
          f_checker: "3号安检员",
          f_plan_year: 2020,
          f_plan_month: 6,
          count: 120,
          check: 80,
          nocheck: 40
        },
        {
          f_plan_name: "安检计划4",
          f_checker: null,
          f_plan_year: 2020,
          f_plan_month: 777,
          count: 120,
          check: 80,
          nocheck: 40
        },
        {
          f_plan_name: "安检计划5",
          f_checker: "安检员5",
          f_plan_year: 2020,
          f_plan_month: 3,
          count: 120,
          check: 80,
          nocheck: 40
        },
        {f_plan_name: "安检计划6", f_checker: "6号", f_plan_year: 2020, f_plan_month: 3, count: 90, check: 80, nocheck: 10}
      ]
    }
  }
  //点击全选按钮事件      user-用户列表       planitem-计划项列表
  changeCheckAll = function (modulename) {
    if (modulename == 'user') {
      user.check.setCheckAll()
    } else if (modulename == 'planitem') {
      checkplanitems.check.setCheckAll()
    }
  }

  //当选中列表中某项时触发
  addParam(modulename, id) {
    if (modulename == 'user') {
      user.check.setCheckes(id)
    } else if (modulename == 'planitem') {
      checkplanitems.check.setCheckes(id)
    }
  }

  //加载改分公司下的所有安检计划
  async loadCheckPlan() {

  }

  addNewPlan(){
    console.log("添加新计划")
  }

  cancel(){
    console.log("取消")
  }

  //设置属性值
  setProperty = function (modulename, property, value) {
    if (modulename == 'user') {
      user.search.setField(property, value)
    } else if (modulename == 'planitem') {
      checkplanitems.search.setField(property, value)
    }
  }
  //将客户信息拖至计划中
  dragtoPlanItem = function (userinfoid, checkplanid) {
    user.searchList("/rs/path/safeServicePath", {"name": "username={}"})
  }
  //将某个计划下的一项拖到另一个计划
  dragtouser = function (itemid, checkplanid) {
    checkplanitems.searchList("/rs/path/safeServicePath", {"name": "username={}"})
  }

  //删除计划项
  delPlanItem = function () {
    console.log("开始执行删除")
  }
  //新建计划
  addCheckPlan = function () {

  }

}
