123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>@ViewBag.Title</title>
- <meta charset="utf-8">
- <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 href="~/Content/Scripts/plugins/layui/css/layui.css" rel="stylesheet" />
- <link href="~/Content/Style/font-awesome/ico-font/iconfont.css" rel="stylesheet" />
- <link href="~/Content/Style/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
- <link href="~/Content/SysFrame/common.css" rel="stylesheet" />
- <script src="~/Content/Scripts/jquery.min.js"></script>
- <script src="~/Content/Scripts/plugins/layui/layui.js"></script>
- <script src="~/Content/Scripts/plugins/easyui/jquery.easyui.min.js"></script>
- <script src="~/Content/Scripts/plugins/easyui/easyui-lang-zh_CN.js"></script>
- <script src="~/Content/Scripts/CookieManage.js?v=1.22"></script>
- <script src="~/Content/Scripts/SysFrame/Zlsoft.UI-1.0.js?v=1.33"></script>
- <script src="~/Content/Scripts/zlpms.js?v=2.916"></script>
- <script src="~/Content/Scripts/vue.js"></script>
- <script src="~/Content/Scripts/plugins/element/element-ui.js"></script>
- <link href="~/Content/Scripts/plugins/element/element-ui.css" rel="stylesheet" />
- <script src="~/Content/Scripts/makePinyin.js"></script>
- <script type="text/javascript">
- //var index = top.ZLPMS.Loading2('页面加载中...');
- function _PageLoadingTip_Closes() {
- $("#PageLoadingTip").fadeOut("normal", function () {
- $(this).remove();
- });
- //top.ZLPMS.CloseWindow(index);
- }
- var _pageloding_pc;
- $.parser.onComplete = function () {
- if (_pageloding_pc)
- clearTimeout(_pageloding_pc);
- _pageloding_pc = setTimeout(_PageLoadingTip_Closes, 50);
- }
- treeViewProcessTable = function (data, idField, foreignKey, rootLevel, callback, removeId) {
- //判断数据是否为空
- if (data === undefined || data === null || data.length <= 0) {
- callback([]);
- } else {
- //定义返回数据
- let hash = {};
- for (var i = 0; i < data.length; i++) {
- var item = data[i];
- var id = item[idField];
- var parentId = item[foreignKey];
- if (removeId && id === removeId) {
- continue;
- }
- hash[id] = hash[id] || [];
- hash[parentId] = hash[parentId] || [];
- item.items = hash[id];
- hash[parentId].push(item);
- }
- let result = {
- data: hash[rootLevel]
- };
- callback(result);
- }
- }
- parseJson = function (jsonObj, parentName = null, isArray = false) {
- let nodes = [];
- for (let key in jsonObj) {
- if (jsonObj.hasOwnProperty(key)) {
- const value = jsonObj[key];
- const dataType = typeof value;
- if (Array.isArray(value)) {
- // 如果值是数组,判断数组元素类型是否为对象,如果是,则递归解析每个元素
- const firstElement = value[0];
- const elementType = typeof firstElement;
- if (elementType === 'object') {
- nodes.push({
- 参数名称: key,
- 父节点: parentName,
- 是否数组: 1,
- 数据类型: ''
- });
- nodes = nodes.concat(parseJson(firstElement, key));
- } else {
- // 如果数组元素是基本类型,则不需要识别子节点
- nodes.push({
- 参数名称: key,
- 父节点: parentName,
- 是否数组: 1,
- 数据类型: ''
- });
- }
- }
- else if (dataType === 'object') {
- // 如果值是对象,则递归解析对象
- nodes.push({
- 参数名称: key,
- 父节点: parentName,
- 是否数组: 0,
- 数据类型: dataType
- });
- nodes = nodes.concat(parseJson(value, key));
- }
- else {
- // 否则,将值添加为节点
- nodes.push({
- 参数名称: key,
- 父节点: parentName,
- 是否数组: 0,
- 数据类型: dataType
- });
- }
- }
- }
- return nodes;
- }
- convertToJsonObject = function (tableData) {
- let jsonObj = {};
- tableData.forEach(row => {
- let { 参数名称, 数据类型, 是否数组, 父节点 } = row;
- let value;
- // 根据数据类型设置默认值
- if (数据类型 === 'number') {
- value = 0;
- } else if (数据类型 === 'boolean') {
- value = false;
- } else {
- value = '';
- }
- if (是否数组 == 1) {
- value = [];
- }
- if (父节点) {
- if (!jsonObj[父节点]) {
- if (是否数组 == 1) {
- jsonObj[父节点] = [];
- jsonObj[父节点].push({});
- } else {
- jsonObj[父节点] = {};
- }
- }
- if (Array.isArray(jsonObj[父节点])) {
- if (typeof jsonObj[父节点][0] !== 'object') {
- jsonObj[父节点][0] = {};
- }
- jsonObj[父节点][0][参数名称] = value;
- } else {
- jsonObj[父节点][参数名称] = value;
- }
- } else {
- jsonObj[参数名称] = value;
- }
- });
- return jsonObj;
- };
- </script>
- <style>
- ::-webkit-scrollbar {
- width: 5px;
- height: 10px;
- }
- ::-webkit-scrollbar-track-piece {
- background-color: rgba(0, 0, 0, 0.2);
- -webkit-border-radius: 6px;
- }
- ::-webkit-scrollbar-thumb:vertical {
- height: 6px;
- background-color: rgba(125, 125, 125, 0.7);
- -webkit-border-radius: 6px;
- }
- ::-webkit-scrollbar-thumb:horizontal {
- width: 5px;
- background-color: rgba(125, 125, 125, 0.7);
- -webkit-border-radius: 6px;
- }
- .mt-10 {
- margin-top: 10px !important;
- }
- .mr-10 {
- margin-right: 10px !important;
- }
- .mt-20 {
- margin-top: 20px !important;
- }
- .delete-button {
- color: red !important;
- }
- .el-table .el-table__cell {
- padding: 5px 0 !important;
- }
- .el-dialog__header {
- padding: 10px 10px 10px 20px !important;
- }
- .el-dialog__footer {
- padding: 10px 20px !important;
- }
- .el-dialog__body {
- padding: 10px 20px !important;
- }
- </style>
- </head>
- <body style="padding:3px;">
- <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>
- @RenderBody()
- </body>
- </html>
|