SearchVue.cshtml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>@ViewBag.Title</title>
  5. <meta charset="utf-8">
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  9. <link href="~/Content/Scripts/plugins/layui/css/layui.css" rel="stylesheet" />
  10. <link href="~/Content/Style/font-awesome/ico-font/iconfont.css" rel="stylesheet" />
  11. <link href="~/Content/Style/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
  12. <link href="~/Content/SysFrame/common.css" rel="stylesheet" />
  13. <script src="~/Content/Scripts/jquery.min.js"></script>
  14. <script src="~/Content/Scripts/plugins/layui/layui.js"></script>
  15. <script src="~/Content/Scripts/plugins/easyui/jquery.easyui.min.js"></script>
  16. <script src="~/Content/Scripts/plugins/easyui/easyui-lang-zh_CN.js"></script>
  17. <script src="~/Content/Scripts/CookieManage.js?v=1.22"></script>
  18. <script src="~/Content/Scripts/SysFrame/Zlsoft.UI-1.0.js?v=1.33"></script>
  19. <script src="~/Content/Scripts/zlpms.js?v=2.916"></script>
  20. <script src="~/Content/Scripts/vue.js"></script>
  21. <script src="~/Content/Scripts/plugins/element/element-ui.js"></script>
  22. <link href="~/Content/Scripts/plugins/element/element-ui.css" rel="stylesheet" />
  23. <script src="~/Content/Scripts/makePinyin.js"></script>
  24. <script type="text/javascript">
  25. //var index = top.ZLPMS.Loading2('页面加载中...');
  26. function _PageLoadingTip_Closes() {
  27. $("#PageLoadingTip").fadeOut("normal", function () {
  28. $(this).remove();
  29. });
  30. //top.ZLPMS.CloseWindow(index);
  31. }
  32. var _pageloding_pc;
  33. $.parser.onComplete = function () {
  34. if (_pageloding_pc)
  35. clearTimeout(_pageloding_pc);
  36. _pageloding_pc = setTimeout(_PageLoadingTip_Closes, 50);
  37. }
  38. treeViewProcessTable = function (data, idField, foreignKey, rootLevel, callback, removeId) {
  39. //判断数据是否为空
  40. if (data === undefined || data === null || data.length <= 0) {
  41. callback([]);
  42. } else {
  43. //定义返回数据
  44. let hash = {};
  45. for (var i = 0; i < data.length; i++) {
  46. var item = data[i];
  47. var id = item[idField];
  48. var parentId = item[foreignKey];
  49. if (removeId && id === removeId) {
  50. continue;
  51. }
  52. hash[id] = hash[id] || [];
  53. hash[parentId] = hash[parentId] || [];
  54. item.items = hash[id];
  55. hash[parentId].push(item);
  56. }
  57. let result = {
  58. data: hash[rootLevel]
  59. };
  60. callback(result);
  61. }
  62. }
  63. parseJson = function (jsonObj, parentName = null, isArray = false) {
  64. let nodes = [];
  65. for (let key in jsonObj) {
  66. if (jsonObj.hasOwnProperty(key)) {
  67. const value = jsonObj[key];
  68. const dataType = typeof value;
  69. if (Array.isArray(value)) {
  70. // 如果值是数组,判断数组元素类型是否为对象,如果是,则递归解析每个元素
  71. const firstElement = value[0];
  72. const elementType = typeof firstElement;
  73. if (elementType === 'object') {
  74. nodes.push({
  75. 参数名称: key,
  76. 父节点: parentName,
  77. 是否数组: 1,
  78. 数据类型: ''
  79. });
  80. nodes = nodes.concat(parseJson(firstElement, key));
  81. } else {
  82. // 如果数组元素是基本类型,则不需要识别子节点
  83. nodes.push({
  84. 参数名称: key,
  85. 父节点: parentName,
  86. 是否数组: 1,
  87. 数据类型: ''
  88. });
  89. }
  90. }
  91. else if (dataType === 'object') {
  92. // 如果值是对象,则递归解析对象
  93. nodes.push({
  94. 参数名称: key,
  95. 父节点: parentName,
  96. 是否数组: 0,
  97. 数据类型: dataType
  98. });
  99. nodes = nodes.concat(parseJson(value, key));
  100. }
  101. else {
  102. // 否则,将值添加为节点
  103. nodes.push({
  104. 参数名称: key,
  105. 父节点: parentName,
  106. 是否数组: 0,
  107. 数据类型: dataType
  108. });
  109. }
  110. }
  111. }
  112. return nodes;
  113. }
  114. convertToJsonObject = function (tableData) {
  115. let jsonObj = {};
  116. tableData.forEach(row => {
  117. let { 参数名称, 数据类型, 是否数组, 父节点 } = row;
  118. let value;
  119. // 根据数据类型设置默认值
  120. if (数据类型 === 'number') {
  121. value = 0;
  122. } else if (数据类型 === 'boolean') {
  123. value = false;
  124. } else {
  125. value = '';
  126. }
  127. if (是否数组 == 1) {
  128. value = [];
  129. }
  130. if (父节点) {
  131. if (!jsonObj[父节点]) {
  132. if (是否数组 == 1) {
  133. jsonObj[父节点] = [];
  134. jsonObj[父节点].push({});
  135. } else {
  136. jsonObj[父节点] = {};
  137. }
  138. }
  139. if (Array.isArray(jsonObj[父节点])) {
  140. if (typeof jsonObj[父节点][0] !== 'object') {
  141. jsonObj[父节点][0] = {};
  142. }
  143. jsonObj[父节点][0][参数名称] = value;
  144. } else {
  145. jsonObj[父节点][参数名称] = value;
  146. }
  147. } else {
  148. jsonObj[参数名称] = value;
  149. }
  150. });
  151. return jsonObj;
  152. };
  153. </script>
  154. <style>
  155. ::-webkit-scrollbar {
  156. width: 5px;
  157. height: 10px;
  158. }
  159. ::-webkit-scrollbar-track-piece {
  160. background-color: rgba(0, 0, 0, 0.2);
  161. -webkit-border-radius: 6px;
  162. }
  163. ::-webkit-scrollbar-thumb:vertical {
  164. height: 6px;
  165. background-color: rgba(125, 125, 125, 0.7);
  166. -webkit-border-radius: 6px;
  167. }
  168. ::-webkit-scrollbar-thumb:horizontal {
  169. width: 5px;
  170. background-color: rgba(125, 125, 125, 0.7);
  171. -webkit-border-radius: 6px;
  172. }
  173. .mt-10 {
  174. margin-top: 10px !important;
  175. }
  176. .mr-10 {
  177. margin-right: 10px !important;
  178. }
  179. .mt-20 {
  180. margin-top: 20px !important;
  181. }
  182. .delete-button {
  183. color: red !important;
  184. }
  185. .el-table .el-table__cell {
  186. padding: 5px 0 !important;
  187. }
  188. .el-dialog__header {
  189. padding: 10px 10px 10px 20px !important;
  190. }
  191. .el-dialog__footer {
  192. padding: 10px 20px !important;
  193. }
  194. .el-dialog__body {
  195. padding: 10px 20px !important;
  196. }
  197. </style>
  198. </head>
  199. <body style="padding:3px;">
  200. <div id='PageLoadingTip' style='position: absolute; z-index:1000; top: 0px; left: 0px; width: 100%; height: 100%; background: #fff; text-align: center;'><h6 style='top:48%; position: relative; color:#808080;'>请稍候,正在加载中···</h6></div>
  201. @RenderBody()
  202. </body>
  203. </html>