From d52795fc5de0b6ed748cd2ef217dcd1371e4b8e9 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期五, 10 十一月 2023 01:06:13 +0800
Subject: [PATCH] 重新调整代码结构和实现方式

---
 src/main/java/com/fzzy/gateway/view/GatewayDevice.view.xml |  211 +++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 190 insertions(+), 21 deletions(-)

diff --git a/src/main/java/com/fzzy/gateway/view/GatewayDevice.view.xml b/src/main/java/com/fzzy/gateway/view/GatewayDevice.view.xml
index cccd044..e9db492 100644
--- a/src/main/java/com/fzzy/gateway/view/GatewayDevice.view.xml
+++ b/src/main/java/com/fzzy/gateway/view/GatewayDevice.view.xml
@@ -48,9 +48,9 @@
         <Property></Property>
         <Property name="label">瑙嗛RTSP</Property>
       </PropertyDef>
-      <PropertyDef name="provinceProtocol">
+      <PropertyDef name="pushProtocol">
         <Property></Property>
-        <Property name="label">鐪佸钩鍙板崗璁�</Property>
+        <Property name="label">涓婅鍗忚</Property>
         <Property name="mapping">
           <Property name="mapValues">${dorado.getDataProvider(&quot;apiTriggerService#triggerPushProtocol&quot;).getResult()}</Property>
           <Property name="keyProperty">code</Property>
@@ -58,19 +58,9 @@
         </Property>
         <Property name="required">true</Property>
       </PropertyDef>
-      <PropertyDef name="pushProtocol">
-        <Property></Property>
-        <Property name="label">涓庣郴缁熼�氳鍗忚</Property>
-        <Property name="mapping">
-          <Property name="mapValues">${dorado.getDataProvider(&quot;apiTriggerService#triggerGatewayProtocol&quot;).getResult()}</Property>
-          <Property name="keyProperty">code</Property>
-          <Property name="valueProperty">name</Property>
-        </Property>
-        <Property name="required">true</Property>
-      </PropertyDef>
       <PropertyDef name="syncProtocol">
         <Property></Property>
-        <Property name="label">涓庤澶囬�氳鍗忚</Property>
+        <Property name="label">涓嬭鍗忚</Property>
         <Property name="mapping">
           <Property name="keyProperty">code</Property>
           <Property name="valueProperty">name</Property>
@@ -111,16 +101,57 @@
         <Property name="label">鑷畾涔変粨搴撶紪鐮�</Property>
       </PropertyDef>
       <PropertyDef name="productId">
-        <Property/>
+        <Property></Property>
         <Property name="label">璁惧绫诲瀷KEY</Property>
+      </PropertyDef>
+      <PropertyDef name="cableRule">
+        <Property></Property>
+        <Property name="label">甯冪嚎瑙勫垯</Property>
+      </PropertyDef>
+      <PropertyDef name="cableCir">
+        <Property></Property>
+        <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;宸滱15U7M&quot;&#xD;
+});</ClientEvent>
+      <Property name="dataType">dtParam</Property>
     </DataSet>
     <ToolBar>
       <ToolBarLabel>
@@ -173,10 +204,40 @@
         <Property name="width">90</Property>
         <Property name="exClassName">toolbar-button-warn</Property>
       </ToolBarButton>
+      <Separator/>
+      <ToolBarButton>
+        <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-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">
@@ -296,11 +357,6 @@
               <Editor/>
             </AutoFormElement>
             <AutoFormElement>
-              <Property name="name">provinceProtocol</Property>
-              <Property name="property">provinceProtocol</Property>
-              <Editor/>
-            </AutoFormElement>
-            <AutoFormElement>
               <Property name="name">pushProtocol</Property>
               <Property name="property">pushProtocol</Property>
               <Editor/>
@@ -332,13 +388,23 @@
               <Property name="editorType">TextArea</Property>
               <Editor/>
             </AutoFormElement>
+            <AutoFormElement>
+              <Property name="name">cableRule</Property>
+              <Property name="property">cableRule</Property>
+              <Editor/>
+            </AutoFormElement>
+            <AutoFormElement>
+              <Property name="name">cableCir</Property>
+              <Property name="property">cableCir</Property>
+              <Editor/>
+            </AutoFormElement>
           </AutoForm>
         </Container>
       </Children>
       <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>
@@ -349,5 +415,108 @@
       <Property name="service">gatewayDeviceService#delData</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>

--
Gitblit v1.9.3