jiazx0107@163.com
2023-11-09 eebab358e2882fc7e3aeec152db5151a6bd0be02
src/main/java/com/fzzy/gateway/view/GatewayDevice.view.xml
@@ -123,12 +123,45 @@
        <Property name="label">筒仓层规则</Property>
      </PropertyDef>
    </DataType>
    <DataType name="dtParam" parent="Map">
      <PropertyDef name="start">
        <Property name="dataType">DateTime</Property>
      </PropertyDef>
      <PropertyDef name="end">
        <Property name="dataType">DateTime</Property>
      </PropertyDef>
      <PropertyDef name="dayTime">
        <Property name="dataType">Date</Property>
        <Property name="label">选择时间</Property>
      </PropertyDef>
      <PropertyDef name="weight">
        <Property name="label">重量</Property>
        <Property name="dataType">Double</Property>
        <Property name="defaultValue">0.0</Property>
      </PropertyDef>
      <PropertyDef name="carNumber">
        <Property name="label">车牌</Property>
      </PropertyDef>
      <PropertyDef name="deviceId">
        <Property></Property>
        <Property name="label">设备ID</Property>
        <Property name="required">true</Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="regionPadding:10">
    <Property name="packages">font-awesome,css-common</Property>
    <Property name="styleSheetFile">./static/lib/jquery/jquery-3.4.1.min.js</Property>
    <DataSet id="dsMain">
      <Property name="dataType">[dtMain]</Property>
      <Property name="dataProvider">gatewayDeviceService#listAll</Property>
    </DataSet>
    <DataSet id="dsQuery">
      <ClientEvent name="onReady">self.insert({&#xD;
   weight:2500,&#xD;
   carNumber:&quot;川A15U7M&quot;&#xD;
});</ClientEvent>
      <Property name="dataType">dtParam</Property>
    </DataSet>
    <ToolBar>
      <ToolBarLabel>
@@ -183,19 +216,38 @@
      </ToolBarButton>
      <Separator/>
      <ToolBarButton>
        <ClientEvent name="onClick">var cur = view.get(&quot;#dgMain&quot;).getCurrentItem();&#xD;
view.get(&quot;#ajaxTestGrain&quot;).set(&quot;parameter&quot;,cur).execute(function(result){&#xD;
   $alert(result);&#xD;
});&#xD;
        <ClientEvent name="onClick">view.get(&quot;#dialogGrain&quot;).show();</ClientEvent>
        <Property name="caption">kafka粮情推送调试</Property>
        <Property name="iconClass">fa fa-wrench</Property>
        <Property name="exClassName">toolbar-button-push</Property>
      </ToolBarButton>
      <ToolBarButton>
        <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
var param = {&#xD;
   deviceId:data.get(&quot;deviceId&quot;),&#xD;
   bizType:&quot;testGrain&quot;&#xD;
}&#xD;
testDevice(param);</ClientEvent>
        <Property name="caption">粮情调试</Property>
        <Property name="iconClass">fa fa-wrench</Property>
        <Property name="exClassName">toolbar-button-push</Property>
      </ToolBarButton>
      <ToolBarButton>
        <ClientEvent name="onClick">view.get(&quot;#dialogWeight&quot;).show();</ClientEvent>
        <Property name="caption">地磅调试</Property>
        <Property name="iconClass">fa fa-wrench</Property>
        <Property name="exClassName">toolbar-button-push</Property>
      </ToolBarButton>
      <ToolBarButton>
        <ClientEvent name="onClick">view.get(&quot;#dialogLpr&quot;).show();&#xD;
</ClientEvent>
        <Property name="caption">测试粮情</Property>
        <Property name="iconClass">fa fa-minus</Property>
        <Property name="exClassName">toolbar-button-warn</Property>
        <Property name="caption">车牌识别调试</Property>
        <Property name="iconClass">fa fa-wrench</Property>
        <Property name="exClassName">toolbar-button-push</Property>
      </ToolBarButton>
    </ToolBar>
    <DataGrid id="dgMain">
      <Property name="dataSet">dsMain</Property>
      <Property name="selectionMode">multiRows</Property>
      <Property name="readOnly">true</Property>
      <RowNumColumn/>
      <DataColumn name="deviceName">
@@ -367,7 +419,7 @@
      <Tools/>
    </Dialog>
    <UpdateAction id="updateSave">
      <Property name="dataResolver">gatewayDeviceService2#updateSave</Property>
      <Property name="dataResolver">gatewayDeviceService#updateSave</Property>
      <UpdateItem>
        <Property name="dataPath">[#current]</Property>
        <Property name="dataSet">dsMain</Property>
@@ -378,9 +430,108 @@
      <Property name="service">gatewayDeviceService#delData</Property>
      <Property name="confirmMessage">确定要删除么?</Property>
    </AjaxAction>
    <AjaxAction id="ajaxTestGrain">
      <Property name="service">gatewayDeviceService2#ajaxTestGrain2</Property>
      <Property name="confirmMessage">确定要手动执行粮情么?</Property>
    </AjaxAction>
    <Dialog id="dialogGrain">
      <Property name="width">400</Property>
      <Property name="height">300</Property>
      <Property name="caption">选择条件</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
var query = view.get(&quot;#dsQuery.data&quot;);&#xD;
var param = {&#xD;
   deviceId:data.get(&quot;deviceId&quot;),&#xD;
   dayTime:query.get(&quot;dayTime&quot;),&#xD;
   bizType:&quot;ajaxTestKafkaGrain&quot;&#xD;
}&#xD;
testDevice(param);</ClientEvent>
          <Property name="caption">确定执行</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dialogGrain&quot;).hide();</ClientEvent>
          <Property name="caption">取消执行</Property>
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsQuery</Property>
          <Property name="cols">*</Property>
          <AutoFormElement>
            <Property name="name">dayTime</Property>
            <Property name="property">dayTime</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <Dialog id="dialogWeight">
      <Property name="width">400</Property>
      <Property name="height">300</Property>
      <Property name="caption">输入重量</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
var query = view.get(&quot;#dsQuery.data&quot;);&#xD;
var param = {&#xD;
   deviceId:data.get(&quot;deviceId&quot;),&#xD;
   weight:query.get(&quot;weight&quot;),&#xD;
   bizType:&quot;ajaxTestWeight&quot;&#xD;
}&#xD;
testDevice(param);</ClientEvent>
          <Property name="caption">确定执行</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dialogWeight&quot;).hide();</ClientEvent>
          <Property name="caption">取消执行</Property>
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsQuery</Property>
          <Property name="cols">*</Property>
          <AutoFormElement>
            <Property name="name">weight</Property>
            <Property name="property">weight</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <Dialog id="dialogLpr">
      <Property name="width">400</Property>
      <Property name="height">300</Property>
      <Property name="caption">输入车牌</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
var query = view.get(&quot;#dsQuery.data&quot;);&#xD;
var param = {&#xD;
   deviceId:data.get(&quot;deviceId&quot;),&#xD;
   carNumber:query.get(&quot;carNumber&quot;),&#xD;
   bizType:&quot;ajaxTestLpr&quot;&#xD;
}&#xD;
testDevice(param);</ClientEvent>
          <Property name="caption">确定执行</Property>
          <Property name="action">updateAction1</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dialogLpr&quot;).hide();</ClientEvent>
          <Property name="caption">取消执行</Property>
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsQuery</Property>
          <Property name="cols">*</Property>
          <AutoFormElement>
            <Property name="name">carNumber</Property>
            <Property name="property">carNumber</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
  </View>
</ViewConfig>