From 78e85be24b02d6fdb4eafc10d229efc88dd0f693 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期三, 20 十月 2021 16:48:12 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-LayUI
---
WebTM/layuiadmin/Scripts/webConfig.js | 4
WebTM/WebTM.csproj | 1
WebTM/layuiadmin/PubCustom.js | 41 +++++++++++++
WebTM/views/test/testRenderAutomationList.html | 93 +++++++++++++++++++++++++++++++
4 files changed, 136 insertions(+), 3 deletions(-)
diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj
index 76483f8..9612aea 100644
--- a/WebTM/WebTM.csproj
+++ b/WebTM/WebTM.csproj
@@ -111,6 +111,7 @@
<Content Include="views\PublicPage\Gy_Maintain.html" />
<Content Include="views\PublicPage\Organizations.html" />
<Content Include="views\ReportHtml.html" />
+ <Content Include="views\test\testRenderAutomationList.html" />
<Content Include="views\鍩虹璧勬枡\鍏敤鍩虹璧勬枡\Add_Edit_Gy_Warehouse.html" />
<Content Include="views\鍩虹璧勬枡\鍏敤鍩虹璧勬枡\Add_Edit_Xt_ORGANIZATIONSList.html" />
<Content Include="views\鍩虹璧勬枡\鍏敤鍩虹璧勬枡\Add_Edit_Gy_Department.html" />
diff --git a/WebTM/layuiadmin/PubCustom.js b/WebTM/layuiadmin/PubCustom.js
index ec9209f..4b6ad42 100644
--- a/WebTM/layuiadmin/PubCustom.js
+++ b/WebTM/layuiadmin/PubCustom.js
@@ -240,4 +240,43 @@
//#region 鎶樺彔娉ㄩ噴
-//#endregion
\ No newline at end of file
+//#endregion
+
+
+/**
+ *閫掑叆鎺ュ彛result杩斿洖list浣滀负option鐨刢ols
+ *by zgq
+ *
+ */
+function Pub_backTableHead(result) {
+ var resultTableHead = [];
+ var cols_arr = [];
+ for (var key in result.list) {
+ resultTableHead.push({ "name": result.list[key].ColmName, "Type": result.list[key].ColmType });
+ }
+ //濉厖琛ㄦ牸澶存暟缁�
+ var data = resultTableHead;
+ cols_arr[0] = [];
+ cols_arr[0][0] = { checkbox: true, fixed: true, totalRowText: '鍚堣' };
+ cols_arr[0][1] = { type: 'numbers', title: '搴忓彿' };
+ for (var i = 0; i < data.length; i++) {
+ if (data[i].name.indexOf("H") ? 0 : -1 ) {
+ cols_arr[0][i + 2] = { field: data[i].name, title: data[i].name, align: 'center', hide: true };
+ }
+ else {
+ switch (data[i].Type) {
+ //int
+ case 'Int32':
+ cols_arr[0][i + 2] = { field: data[i].name, title: data[i].name, align: 'center', totalRow: true, sort: true };
+ break;
+ //Decimal
+ case 'Decimal':
+ cols_arr[0][i + 2] = { field: data[i].name, title: data[i].name, align: 'center', totalRow: true, sort: true };
+ break;
+ default:
+ cols_arr[0][i + 2] = { field: data[i].name, title: data[i].name, align: 'center', sort: true };
+ }
+ }
+ }
+ return cols_arr
+}
\ No newline at end of file
diff --git a/WebTM/layuiadmin/Scripts/webConfig.js b/WebTM/layuiadmin/Scripts/webConfig.js
index f6d4f0e..c0f42d2 100644
--- a/WebTM/layuiadmin/Scripts/webConfig.js
+++ b/WebTM/layuiadmin/Scripts/webConfig.js
@@ -6,13 +6,13 @@
//var WEBURL = "http://localhost:8080/API/"; //棰滄檽鍐涙湰鍦伴厤缃�
//var WEBURL = "http://localhost:8082/lubao"; //棰滄檽鍐涙湰鍦伴厤缃�
//var WEBURL = "http://localhost:8082/LuBaoAPI/"; //鏉ㄩ湶鏈湴閰嶇疆
- var WEBURL = "http://localhost:8082/LuBaoAPI/"; //绔犵传鏌旀湰鍦伴厤缃�
+ //var WEBURL = "http://localhost:8082/LuBaoAPI/"; //绔犵传鏌旀湰鍦伴厤缃�
//var WEBURL = "http://10.1.4.155/API/"; //姹熶赴瀹㈡埛NEW
//var WEBURL = "http://47.96.97.237/API/"; //鏅轰簯鏈嶅姟鍣�
//var WEBURL = "http://183.129.128.86:9090/API/"; //鍑礉濂堢壒瀹㈡埛鏈嶅姟鍣ㄥ缃�
//var WEBURL = "http://192.168.1.253:8080/API/"; //鍑礉濂堢壒瀹㈡埛鏈嶅姟鍣ㄥ唴缃�
//var WEBURL = "http://220.189.218.154:8092/API/"; //涓镐簳鍥涚淮灏旀湇鍔″櫒
- //var WEBURL = "http://localhost/API/";
+ var WEBURL = "http://localhost/API/";
return WEBURL
}
diff --git a/WebTM/views/test/testRenderAutomationList.html b/WebTM/views/test/testRenderAutomationList.html
new file mode 100644
index 0000000..99f1bed
--- /dev/null
+++ b/WebTM/views/test/testRenderAutomationList.html
@@ -0,0 +1,93 @@
+锘�<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>娴嬭瘯鑷姩娓叉煋鍒楄〃</title>
+ <meta name="renderer" content="webkit">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
+ <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
+ <script src="../../../layuiadmin/layui/layui.js"></script>
+ <script src="../../../layuiadmin/Scripts/json2.js"></script>
+ <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
+ <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+ <script src="../../layuiadmin/PubCustom.js"></script>
+
+</head>
+<body>
+ <div class="layui-fluid">
+ <div class="layui-col-md12">
+ <div class="layui-card" style="padding: 1px">
+ <div class="layui-card-body" style="padding: 1px;">
+ <form class="layui-form" action="" lay-filter="component-form-group">
+ <table class="" id="mainTable" lay-filter="mainTable"></table>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ layui.config({
+ base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
+ }).extend({
+ index: 'lib/index', //涓诲叆鍙fā鍧�
+ }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
+ var $ = layui.$
+ , layer = layui.layer
+ , table = layui.table
+
+ var option = [];
+ var cols_arr = [];
+
+ get_Display();
+
+ //#region 鏌ヨ
+ function get_Display() {
+ var wait = layer.load();
+ $.ajax({
+ url: GetWEBURL() + '/Sc_MESReportFrom/ReportFromBillList2',
+ type: "GET",
+ data: { "sWhere": "" },
+ success: function (result) {
+ if (result.code == 1) {
+ cols_arr = Pub_backTableHead(result);
+ set_InitGrid(cols_arr);
+ option.data = result.data;
+ table.render(option);
+ layer.close(wait);
+ } else {
+ layer.close(wait);
+ layer.alert(result.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.close(wait);
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ //#endregion
+
+ //#region 鍒濆鍖栬〃鏍兼柟娉�
+ function set_InitGrid(cols_arr) {
+ option = {
+ elem: '#mainTable'
+ //, toolbar: '#toolbarDemo'
+ , height: 'full-50'
+ , page: true
+ , cellMinWidth: 90
+ , cols: cols_arr
+ , totalRow: true
+ , limit: 10
+ , limits: [10, 15, 20, 30, 40, 50, 100, 1000]
+ };
+ }
+ //#endregion
+
+
+
+ });
+ </script>
+
+</body>
+</html>
\ No newline at end of file
--
Gitblit v1.9.1