From be865f78f107484ba689b09aab3adb1f78bd024b Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 31 三月 2022 11:26:24 +0800
Subject: [PATCH] 完善
---
WebTM/layuiadmin/PubCustom.js | 43 +++++++++++++++++++++++++++++++++++++++++--
1 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/WebTM/layuiadmin/PubCustom.js b/WebTM/layuiadmin/PubCustom.js
index ec9209f..760b295 100644
--- a/WebTM/layuiadmin/PubCustom.js
+++ b/WebTM/layuiadmin/PubCustom.js
@@ -212,7 +212,7 @@
// , btn: ['纭畾', '鍙栨秷']
// , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
// var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
-// var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//鑾峰彇table鐨別lem:"#test"
+// var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
// if (checkStatus.data.length === 0) {
// return layer.msg('璇烽�夋嫨鏁版嵁');
// }
@@ -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
--
Gitblit v1.9.1