<template>
  <app-base>
    <div id="content"></div>
  </app-base>
</template>

<script>
import Comp from "./comp"
import {HttpResetClass} from 'vue-client'
import Vue from "vue"

export default {
  data() {
    return {
      show: false
    }
  },

  events: {
    onFileUpload: function (file, res) {
      let data = {
        filepath: res.f_downloadpath
      }
      new HttpResetClass().load('POST','/rs/logic/upLoadBookFile', {data: data}, {
        resolveMsg: '导入成功',
        rejectMsg: '导入失败'
      }).then((res) => {
        this.show = false
      })
    },

  },
    ready() {

      // 设置模板为测试,,
      global.canvas = "TestDataComponent";
      global.myjson = Object.assign(global.myjson, {
        TestDataComponent:
          {"template":{"type":"Grid","Column":"@300,1*","Row":"@1*","Background":"@#f5f7f9","children":[{"StrokeStyle":"@#dce0e3","Classes":"@BorderRect","Name":"@左边","Background":"@#ffffff","children":[{"type":"Grid","Classes":"@BorderRect","PaddingLeft":"@5","PaddingRight":"@5","Name":"@上边","PaddingTop":"@3","Bottom":"@1","Column":"@*,1*,*","Row":"@*,*","Pos":"@Top","StrokeStyle":"@#dce0e3","PaddingBottom":"@4","children":[{"type":"Button","Text":"@查询","@Click":"stat.Popup($SearchPlan$,stat,this,e.draw)","Slots":{"item":{"Classes":"@SearchButtonImg","type":"Image","Path":"this.MouseIn:$searchhover$,$searchnormal$"}}},{"children":[{"type":"Text","Text":"@用户列表","HAlign":"@Center"}],"type":"Stack","PaddingBottom":"@4","Pos":"@Center","HAlign":"@Center","PaddingTop":"@8"},{"PaddingLeft":"@5","type":"Button","Text":"@使用帮助","VAlign":"@Center","FillStyle":"@#FFFFFF","PaddingRight":"@5","Classes":"@SearchButton BorderRound","HAlign":"@Center","@Click":"stat.Popup($NewPlan$,stat,this,e.draw)"}]},{"Column":"@1*","children":[{"type":"Scroll","Slots":{"item":{"Data":"stat.Data.userInfo.list.data","Name":"@安检计划","@Change":"stat.Call($openInfo$, e.Value.self)","Slots":{"item":{"Original":"@V","PaddingBottom":"@1","Width":"@300","children":[{"type":"Grid","PaddingBottom":"@20","PaddingRight":"@10","@DragOver":"stat.DragOver()","Column":"@42,1*,42,1*","PaddingLeft":"@10","Row":"@*,*,*,*,*","children":[{"ColSpan":"@4","Font":"@15px 微软雅黑","FillStyle":"@#4792de","type":"Text","Text":"$客户编号：{data.f_userinfo_code}$"},{"ColSpan":"@4","type":"Text","FillStyle":"@#4792de","Top":"@12","Text":"$客户姓名：{data.f_user_name}$"},{"Top":"@12","ColSpan":"@2","type":"Text","Classes":"@NormalFontHeavy","Text":"$表具数量：{data.num}$"},{"Left":"@10","Classes":"@NormalFontLighter","type":"Text","Text":"@结余","Top":"@12"},{"Text":"data.f_balance","type":"Text","Top":"@12","Classes":"@NormalFontHeavy","ColSpan":"@1","Name":"@总数"},{"type":"Text","Text":"@电话","Top":"@12","Classes":"@NormalFontLighter"},{"Classes":"@NormalFontHeavy","Top":"@12","type":"Text","Text":"data.f_user_phone","Left":"@5"},{"type":"Text","Text":"@状态","Classes":"@NormalFontLighter","Left":"@10","Top":"@12"},{"Text":"data.f_user_state","type":"Text","Top":"@12","Classes":"@NormalFontHeavy"},{"type":"Text","Top":"@12","Text":"@地址"},{"ColSpan":"@3","type":"Text","Text":"data.f_address","Top":"@12"}],"@Drop":"stat.Call($moveOneBook$,data.f_userinfo_id,stat.GetDrag())","PaddingTop":"@20"},{"Right":"@5","type":"Stack","StrokeStyle":"@#dce0e3","Classes":"@BorderRect","Left":"@5"}],"type":"Stack","Background":"data.f_userinfo_id==stat.Data.selectInfo.f_userinfo_id: $#d8eafb$, this.MouseIn: $#f5f6f7$, $$"}},"type":"List"}}},{"type":"Stack","Classes":"@BorderRect","Left":"@5","Right":"@5","StrokeStyle":"@#dfe4e7"},{"Row":"@1*","PaddingLeft":"@20","PaddingRight":"@20","PaddingTop":"@10","children":[{"type":"Text","Text":"$共{stat.Data.userInfo.list.count}条$"},{"@Click":"stat.Call($loadMore$,$userInfo$)","Slots":{"item":{"type":"Stack","Name":"LoadMoreButton_Stack","children":[{"type":"Image","VAlign":"@Bottom","Path":"@doubledown"},{"Left":"@4","type":"Text","Text":"@更多"}]}},"type":"Button","FillStyle":"this.MouseIn:$#000000$,$#666666$","HAlign":"@Right"}],"type":"Grid","PaddingBottom":"@10","Column":"@1*,1*"},{"Classes":"@BorderRect","StrokeStyle":"@#dfe4e7","type":"Stack","Right":"@5","Left":"@5"}],"type":"Grid","Row":"@1*,0,*,0,*","Pos":"@Center","Classes":"@NormalFontlight"}],"type":"Dock"},{"Name":"@右边","Background":"@#f5f7f9","Classes":"@BorderRect","children":[{"type":"Grid","Pos":"@Center","Row":"@1*,1*","Column":"@1*","children":[{"Classes":"@BorderRect","PaddingLeft":"@10","children":[{"type":"Stack","Bottom":"@17","children":[{"type":"Text","VAlign":"@Center","Text":"@用户所属表具列表"},{"type":"Input","Left":"@10","PlaceHolder":"@表号","Value":"stat.Data.userFiles.search.model.f_meternumber","Width":"@150","@Change":"stat.Call($setProperty$, $userFiles$, $f_meternumber$, e.Value)"},{"Width":"@150","PlaceHolder":"@安装位置","Classes":"@BorderRect","@Change":"stat.Call($setProperty$, $userFiles$, $f_position$, e.Value)","type":"Input","Value":"stat.Data.userFiles.search.model.f_position","Left":"@10"},{"Left":"@10","Width":"@150","Classes":"@BorderRect","PlaceHolder":"@户表编号","@Change":"stat.Call($setProperty$, $userFiles$, $f_user_id$, e.Value)","type":"Input","Value":"stat.Data.userFiles.search.model.f_user_id"},{"type":"Button","Left":"@10","Classes":"@SearchButton BorderRound","@Click":"stat.Call($searchUserFiles$)","Slots":{"item":{"Name":"SearchButton_Image","Classes":"@SearchButtonImg","type":"Image"}}}]},{"Slots":{"item":{"Row":"@1*","children":[{"HAlign":"@Center","IsSelected":"stat.Data.userFiles.check.Call($isChecked$, data.f_userfiles_id)","Classes":"@DataGridBody","@Change":"stat.Call($setCheck$, $userFiles$, data.f_userfiles_id)","type":"CheckBox"},{"type":"Text","Text":"data.f_meternumber","Name":"@用户编号","Classes":"@DataGridBody"},{"Classes":"@DataGridBody","Text":"data.f_position","type":"Text"},{"type":"Text","Text":"data.f_meter_brand","Classes":"@DataGridBody"},{"Text":"data.f_meter_style","type":"Text","Classes":"@DataGridBody"},{"Classes":"@DataGridBody","type":"Text","Text":"data.f_meter_base"},{"type":"Text","Text":"data.f_table_state","Classes":"@DataGridBody"},{"Classes":"@DataGridBody","type":"Text","Text":"data.f_price_name"},{"Text":"data.f_price_type","Classes":"@DataGridBody","type":"Text"},{"Text":"data.f_user_type","type":"Text","Classes":"@DataGridBody"},{"type":"Text","Text":"data.f_gasproperties","Classes":"@DataGridBody"}],"type":"Grid"},"head":{"children":[{"type":"Stack","Classes":"@DataGridHead","children":[{"Text":"@选择","type":"Text","Left":"@9"}]},{"Name":"@用户编号","Classes":"@DataGridHead","type":"Text","Text":"@表号"},{"Classes":"@DataGridHead","type":"Text","Text":"@安装位置"},{"Classes":"@DataGridHead","Text":"@品牌","type":"Text"},{"Text":"@型号","Classes":"@DataGridHead","type":"Text"},{"type":"Text","Text":"@表底数","Classes":"@DataGridHead"},{"Text":"@表具状态","Classes":"@DataGridHead","type":"Text"},{"type":"Text","Text":"@气价名称","Classes":"@DataGridHead"},{"type":"Text","Classes":"@DataGridHead","Text":"@气价类型"},{"Classes":"@DataGridHead","type":"Text","Text":"@用户类型"},{"Text":"@用气性质","Classes":"@DataGridHead","type":"Text"}],"type":"Grid","Row":"@1*"}},"type":"DataGrid","Data":"stat.Data.userFiles.list.data","Column":"@100,1*,1*,1*,1*,1*,1*,1*,1*,1*,1*","Classes":"@BorderRect","@DragOver":"stat.DragOver()","@Drop":"stat.Call($userInToBook$,stat.Data.selectInfo.f_userinfo_id,stat.GetDrag())","@DragStart":"stat.SetDrag($in$)"},{"type":"Grid","Top":"@12","Row":"@1*","Column":"@*,*,1*,*","PaddingTop":"@5","Classes":"@NormalFontlight","children":[{"type":"Text","Text":"@"},{"type":"Text","Text":"$共{stat.Data.userFiles.list.count}条$","Left":"@20","VAlign":"@Center"},{"type":"Text","Text":"@ "},{"type":"Button","FillStyle":"this.MouseIn:$#000000$,$#666666$","@Click":"stat.Call($loadMore$,$userFiles$)","Slots":{"item":{"children":[{"Path":"@doubledown","type":"Image","VAlign":"@Bottom"},{"Text":"@更多","type":"Text","Left":"@4"}],"type":"Stack","Name":"LoadMoreButton_Stack"}}}]}],"type":"Grid","PaddingTop":"@12","PaddingBottom":"@20","Row":"@*,1*,*","StrokeStyle":"@#dfe4e7","PaddingRight":"@24","Column":"@1*"},{"Row":"@*,1*,*","PaddingLeft":"@10","PaddingTop":"@12","Column":"@1*","children":[{"type":"Stack","Bottom":"@17","children":[{"type":"Text","VAlign":"@Center","Text":"@其他用户表具列表"},{"Left":"@10","PlaceHolder":"@表号","Value":"stat.Data.userFilesNo.search.model.f_meternumber","Width":"@150","@Change":"stat.Call($setProperty$, $userFilesNo$, $f_meternumber$, e.Value)","type":"Input"},{"PlaceHolder":"@安装位置","Value":"stat.Data.userFilesNo.search.model.f_position","Classes":"@BorderRect","Left":"@10","@Change":"stat.Call($setProperty$, $userFilesNo$, $f_position$, e.Value)","type":"Input","Width":"@150"},{"type":"Input","Left":"@10","Width":"@150","PlaceHolder":"@户表编号","Value":"stat.Data.userFilesNo.search.model.f_user_id","Classes":"@BorderRect","@Change":"stat.Call($setProperty$, $userFilesNo$, $f_user_id$, e.Value)"},{"type":"Input","Width":"@150","Left":"@10","PlaceHolder":"@客户编号","Value":"stat.Data.userFilesNo.search.model.f_userinfo_code","Classes":"@BorderRect","@Change":"stat.Call($setProperty$, $userFilesNo$, $f_userinfo_code$, e.Value)"},{"Left":"@10","Value":"stat.Data.userFilesNo.search.model.f_address","PlaceHolder":"@客户地址","Classes":"@BorderRect","Width":"@150","@Change":"stat.Call($setProperty$, $userFilesNo$, $f_address$, e.Value)","type":"Input"},{"PlaceHolder":"@客户姓名","Classes":"@BorderRect","@Change":"stat.Call($setProperty$, $userFilesNo$, $f_user_name$, e.Value)","type":"Input","Width":"@150","Left":"@10","Value":"stat.Data.userFilesNo.search.model.f_user_name"},{"type":"Button","Classes":"@SearchButton BorderRound","Left":"@10","@Click":"stat.Call($searchUserFilesNo$)","Slots":{"item":{"type":"Image","Name":"SearchButton_Image","Classes":"@SearchButtonImg"}}}]},{"type":"DataGrid","Data":"stat.Data.userFilesNo.list.data","Column":"@100,1*,1*,1*,1*,1*,1*,1*,1*,1*,1*","Classes":"@BorderRect","@DragStart":"stat.SetDrag($out$)","Slots":{"head":{"Row":"@*","children":[{"children":[{"Text":"@选择","type":"Text","Left":"@9"}],"type":"Stack","Classes":"@DataGridHead"},{"Classes":"@DataGridHead","Text":"@表号","type":"Text","Name":"@用户编号"},{"type":"Text","Classes":"@DataGridHead","Text":"@安装位置"},{"type":"Text","Text":"@品牌","Classes":"@DataGridHead"},{"Text":"@型号","type":"Text","Classes":"@DataGridHead"},{"Text":"@表底数","type":"Text","Classes":"@DataGridHead"},{"Classes":"@DataGridHead","type":"Text","Text":"@表具状态"},{"type":"Text","Text":"@气价名称","Classes":"@DataGridHead"},{"Classes":"@DataGridHead","Text":"@气价类型","type":"Text"},{"type":"Text","Classes":"@DataGridHead","Text":"@用户类型"},{"type":"Text","Classes":"@DataGridHead","Text":"@用气性质"}],"type":"Grid"},"item":{"children":[{"HAlign":"@Center","IsSelected":"stat.Data.userFilesNo.check.Call($isChecked$, data.f_userfiles_id)","@Change":"stat.Call($setCheck$, $userFilesNo$, data.f_userfiles_id)","type":"CheckBox","Classes":"@DataGridBody","VAlign":"@Center"},{"type":"Text","Name":"@用户编号","Classes":"@DataGridBody","Text":"data.f_meternumber"},{"Classes":"@DataGridBody","type":"Text","Text":"data.f_position"},{"type":"Text","Text":"data.f_meter_brand","Classes":"@DataGridBody"},{"Classes":"@DataGridBody","type":"Text","Text":"data.f_meter_style"},{"Text":"data.f_meter_base","type":"Text","Classes":"@DataGridBody"},{"Classes":"@DataGridBody","Text":"data.f_table_state","type":"Text"},{"Classes":"@DataGridBody","Text":"data.f_price_name","type":"Text"},{"Text":"data.f_price_type","type":"Text","Classes":"@DataGridBody"},{"Classes":"@DataGridBody","Text":"data.f_user_type","type":"Text"},{"type":"Text","Classes":"@DataGridBody","Text":"data.f_gasproperties"}],"type":"Grid","Row":"@*"}}},{"type":"Grid","Classes":"@NormalFontlight","Top":"@12","Row":"@1*","Column":"@*,*,1*,*","children":[{"type":"Text","Text":"@"},{"type":"Text","Left":"@20","Text":"$共{stat.Data.userFilesNo.list.count}条$"},{"type":"Text","Text":"@ "},{"@Click":"stat.Call($loadMore$,$userFilesNo$)","Slots":{"item":{"children":[{"Path":"@doubledown","VAlign":"@Bottom","type":"Image"},{"Text":"@更多","type":"Text","Left":"@4"}],"type":"Stack"}},"type":"Button","Text":"@加载更多","FillStyle":"this.MouseIn:$#000000$,$#666666$"}]}],"type":"Grid","Classes":"@BorderRect","StrokeStyle":"@#dfe4e7","PaddingBottom":"@20","PaddingRight":"@24"}]}],"type":"Dock"}]},"Drag":{"SearchPlan":{"children":[{"type":"Grid","Row":"@*,*,*,*,*,*","PaddingRight":"@20","Column":"@70,170","PaddingLeft":"@10","PaddingBottom":"@10","Classes":"@BorderRound NormalFont PopupSearch","children":[{"PaddingBottom":"@6","type":"Text","Classes":"@GridLabel","Text":"@客户编号"},{"Value":"stat.Data.userInfo.search.model.f_userinfo_code","@Change":"stat.Call($setProperty$, $userInfo$, $f_userinfo_code$, e.Value)","type":"Input"},{"PaddingTop":"@6","type":"Text","Text":"@用户地址","Classes":"@GridLabel","PaddingBottom":"@6"},{"PaddingTop":"@6","@Change":"stat.Call($setProperty$, $userInfo$, $f_address$, e.Value)","type":"Input","Value":"stat.Data.userInfo.search.model.f_address"},{"PaddingTop":"@6","type":"Text","PaddingBottom":"@6","Classes":"@GridLabel","Text":"@客户姓名"},{"@Change":"stat.Call($setProperty$, $userInfo$, $f_user_name$, e.Value)","type":"Input","Top":"@6","Value":"stat.Data.userInfo.search.model.f_user_name"},{"HAlign":"@Center","children":[{"@Click":"stat.RestorePopup(this,e.draw)","type":"Button","Text":"@取消","Classes":"@Button2","Right":"@50"},{"@Click":"stat.Call($searchUserInfo$),stat.RestorePopup(this,e.draw)","type":"Button","FillStyle":"@#ffffff","Classes":"@Button","Text":"@查询"}],"type":"Stack","Top":"@20","ColSpan":"@2"}],"PaddingTop":"@10"}],"type":"Grid","Row":"@1*","Column":"@1*","Classes":"@PopupSearch PopupShadow"},"drag":{"type":"Text","Text":"@"},"start":{"Path":"@drag","type":"Image"},"NewPlan":{"type":"Grid","Classes":"@PopupSearch PopupShadow","Row":"@*","Column":"@*","children":[{"PaddingBottom":"@5","Row":"@30,30,30,30,*","PaddingLeft":"@5","Column":"@*","PaddingTop":"@5","type":"Grid","PaddingRight":"@5","Background":"@#FFFFFF","FillStyle":"@#000000","children":[{"type":"Text","Text":"@一、A，B，C为列表，分别显示：用户、选中用户的表具、其他用户的表具；红框的①、②、③分别为对应列表的查询功能；绿色圈内是对应列表的加载更多数据。","VAlign":"@Center"},{"Text":"@二、在进入页面后，会加载出A(用户列表)、C(其他用户表具列表)，当在A中选择用户后，B(选中用户的表具列表)会加载出对应信息，且C中会剔除B中的数据。","VAlign":"@Center","type":"Text"},{"type":"Text","VAlign":"@Center","Text":"@三、在C区域选中表具(一次操作一条)并拖动到B区域，则会将C中选中的表具信息移动到A中选中的用户档案下，完成合并。"},{"VAlign":"@Center","Text":"@四、在B区域选中表具(一次操作一条)并拖动到A区域对应的用户上，则会将B中勾选的表具移动到对应的用户档案下，完成拆分。","type":"Text"},{"Clip":"false","type":"Image","Path":"@help","VAlign":"@Center","Width":"@1000","Height":"@500"}]}]},"deleteMsg":{"Row":"@*","children":[{"Background":"@#ffffff","Classes":"@NormalFontlight","HAlign":"@Center","VAlign":"@Center","Row":"@*","children":[{"Text":"$确认删除{stat.Data.deleteBookInfo.f_book_name}？$","HAlign":"@Center","PaddingLeft":"@100","PaddingRight":"@100","type":"Text","PaddingTop":"@70","PaddingBottom":"@70","VAlign":"@Center"}],"type":"Grid","Column":"@*"}],"type":"Grid","Column":"@*"},"upPlan":{"Column":"@*","Row":"@*","children":[{"PaddingBottom":"@20","type":"Grid","children":[{"type":"Text","Text":"@* 抄表册名","Right":"@10","HAlign":"@Right","VAlign":"@Center"},{"type":"Input","Value":"stat.Data.editBookInfo.f_book_name","@Change":"stat.Call($editBookInfos$,$f_book_name$,e.Value)"},{"Text":"@抄表员","Right":"@10","HAlign":"@Right","VAlign":"@Center","type":"Text"},{"type":"Select","Data":"stat.Data.inputtorInfo","Classes":"@SelectWhite BorderRound","Selected":"stat.Data.editBookInfo.f_inputtor","@Change":"stat.Call($editBookInfos$,$f_inputtor$,e.Value)"},{"Top":"@10","Text":"@所属公司","Right":"@10","HAlign":"@Right","VAlign":"@Center","type":"Text"},{"Top":"@10","Selected":"stat.Data.editBookInfo.f_filiale_name","Data":"stat.Data.orgInfo","@Change":"stat.Call($editBookInfos$,$f_filiale_name$,e.Value)","type":"Select","Classes":"@SelectWhite BorderRound"},{"HAlign":"@Right","VAlign":"@Center","type":"Text","Top":"@10","Text":"@备注","Right":"@10"},{"Top":"@10","@Change":"stat.Call($editBookInfos$,$f_book_remark$,e.Value)","type":"Input","Value":"stat.Data.editBookInfo.f_book_remark"}],"PaddingRight":"@36","Classes":"@NormalFontlight","Row":"@*,*","Column":"@80,170,80,170","PaddingLeft":"@20","Background":"@#ffffff","PaddingTop":"@20"}],"type":"Grid"}}}
      });
      let imgs = ["drag.png","help.png"];
      global.getImages(imgs, "./images/mergeUser/");
      loadWasm().then(() => {
        global.stat = new Comp()
        if (this.$login) {
          global.stat.loginInfo = this.$login.f
          console.log('登录信息', this.$login.f)
          console.log('stat',global.stat)
          console.log('login',global.stat.loginInfo)
        }
        global.stat.ready().then(() => {
          console.log(global.stat)
          run()
        })

      })
    }


}
</script>
