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

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

export default {

  ready() {

    // 设置模板为测试,,
    global.canvas = "ParamSet";
    global.myjson = Object.assign(global.myjson, {
      ParamSet:
        {"template":{"type":"Grid","Column":"@2*,1*","PaddingLeft":"@10","PaddingBottom":"@20","children":[{"Row":"@50,1*,30","children":[{"Column":"@65,1*,60,1*,40,1*,50","VAlign":"@Center","Row":"@1*","children":[{"type":"Text","VAlign":"@Center","FillStyle":"@red","Text":"@气表品牌*"},{"Right":"@5","Data":"stat.Data.brands","@Change":"stat.Call($setSearchValue$, $f_gasbrand$, e.Value.self)","Slots":{"item":{"Text":"data.f_meter_brand","type":"Text","PaddingTop":"@10","PaddingBottom":"@10","HAlign":"@Center"}},"type":"Select","Left":"@5","Classes":"@SelectGray","Selected":"stat.Data.f_gasbrand","Text":"this.Selected.f_meter_brand"},{"VAlign":"@Center","Text":"@客户编号","type":"Text"},{"Value":"stat.Data.f_userinfo_code","Left":"@5","@Change":"stat.Call($setSearchValue$, $f_userinfo_code$, e.Value)","type":"Input","Right":"@5"},{"type":"Text","VAlign":"@Center","Text":"@地址"},{"type":"Input","Right":"@5","Value":"stat.Data.f_address","@Change":"stat.Call($setSearchValue$, $f_address$, e.Value)"},{"Text":"@查询","Classes":"@Button","@Click":"stat.Call($search$)","type":"Button","Enabled":"stat.Data.f_gasbrand.f_gasbrand_id!= $$"}],"type":"Grid"},{"type":"DataGrid","Column":"@100,100,100,100,100,100,100,1*","Data":"stat.Data.clients.list.data","Slots":{"head":{"children":[{"children":[{"type":"CheckBox","@Change":"stat.Call($checkAll$)"},{"Text":"@全选","Left":"@9","type":"Text"}],"type":"Stack","Classes":"@DataGridHead"},{"Text":"@用户编号","type":"Text","Classes":"@DataGridHead"},{"Classes":"@DataGridHead","Text":"@用户名称","type":"Text"},{"type":"Text","Classes":"@DataGridHead","Text":"@表号"},{"Text":"@用户类型","type":"Text","Classes":"@DataGridHead"},{"type":"Text","Classes":"@DataGridHead","Text":"@用气性质"},{"type":"Text","Classes":"@DataGridHead","Text":"@气表品牌"},{"Text":"@用户地址","Classes":"@DataGridHead","type":"Text"}],"type":"Grid","Row":"@*"},"item":{"Row":"@*","children":[{"Classes":"@DataGridBody","HAlign":"@Center","IsSelected":"stat.Data.clients.check.Call($isChecked$, data.f_userfiles_id)","@Change":"stat.Call($setCheck$,data.f_userfiles_id)","type":"CheckBox"},{"type":"Text","Classes":"@DataGridBody","Text":"data.f_userinfo_code"},{"Classes":"@DataGridBody","type":"Text","Text":"data.f_user_name"},{"Classes":"@DataGridBody","Text":"data.f_meternumber","type":"Text"},{"type":"Text","Classes":"@DataGridBody","Text":"data.f_user_type"},{"type":"Text","Classes":"@DataGridBody","Text":"data.f_gasproperties"},{"Classes":"@DataGridBody","Text":"data.f_meter_brand","type":"Text"},{"Text":"data.f_address","Classes":"@DataGridBody","type":"Text"}],"type":"Grid"}}},{"type":"Grid","VAlign":"@Center","Column":"@*,*,1*,*","Row":"@*","Top":"@15","children":[{"Text":"$当前{global.Length(stat.Data.clients.list.data)}条$","type":"Text"},{"type":"Text","Text":"$共{stat.Data.clients.list.count}条$","Left":"@20"},{"type":"Text","Text":"@ "},{"type":"Button","@Click":"stat.Call($loadMore$)","Slots":{"item":{"FillStyle":"this.MouseIn:$#000000$,$#666666$","children":[{"Path":"@doubledown","VAlign":"@Bottom","type":"Image"},{"Left":"@4","type":"Text","Text":"@更多"}],"type":"Stack","Name":"LoadMoreButton_Stack"}}}]}],"type":"Grid","Column":"@1*"},{"Left":"@20","Row":"@50,1*","children":[{"type":"Stack","VAlign":"@Center","children":[{"type":"Text","Text":"@设置","Classes":"@Button2"}]},{"Data":"stat.Data","type":"Component","TemplateName":"stat.Data.Call($getTemplate$)"}],"type":"Grid","Column":"@1*"}],"PaddingTop":"@10","Row":"@1*","Background":"@#FFF","PaddingRight":"@10"},"Drag":{}}
        ,
      SetParam:
        {"template":{"type":"Grid","Row":"@1*,50","Column":"@1*","children":[{"type":"Scroll","Slots":{"item":{"Slots":{"item":{"Background":"@#FFFFFF","Column":"@120,1*","Row":"@*","Bottom":"@20","children":[{"Text":"data.name","PaddingTop":"@8","type":"Text"},{"type":"List","Data":"data.params","Slots":{"item":{"Background":"@#FFF","Column":"@130,1*","children":[{"type":"Text","VAlign":"@Center","Text":"data.name","Right":"@10"},{"if":"data.type!=$option$","@Change":"stat.Call($setValue$,data.self,e.Value)","type":"Input","Tips":"data.type==$number$:$请输入数字,范围：{data.min}~{data.max}！$,$请输入长度小于{data.size}的内容！$"},{"type":"Select","Classes":"@SelectGray","Data":"data.params","Text":"this.Selected.label","if":"data.type==$option$","@Change":"stat.Call($setValue$,data.self,e.Value.value)","Slots":{"item":{"type":"Text","Text":"data.label","PaddingTop":"@10","PaddingBottom":"@10","HAlign":"@Center"}}}],"type":"Grid","Bottom":"@10","Row":"@30","PaddingRight":"@5"}}}],"type":"Grid"}},"type":"List","Data":"stat.Data.paramJsons"}}},{"type":"Grid","HAlign":"@Right","VAlign":"@Center","Row":"@1*","Column":"@1*,1*","children":[{"type":"Button","VAlign":"@Center","HAlign":"@Right","Right":"@30","Classes":"@Button","Text":"@保存","@Click":"stat.Call($save$)"}]}]},"Drag":{}}
    });
    loadWasm().then(() => {
      global.stat = new Comp()

      if (this.$login) {
        global.stat.loginInfo = this.$login.f
      }
      global.stat.ready().then(() => {
        console.log(global.stat, "this:", this)
        run()
      })
    })
  }


}
</script>
