Merge branch 'master-mj-yjpnew' into 'master-mj'
fix:山西信息化资产核对辅助 运维管理草稿箱功能,新增,工作日志文本框样式优化 See merge request !1229
Showing
31 changed files
with
4857 additions
and
0 deletions
Too many changes to show.
To preserve performance only 31 of 31+ files are displayed.
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationDatabase', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + //发送状态 | ||
12 | + // 下拉框改变搜索 | ||
13 | + //form.on('select(slt-information-database)', reloadAllChange); | ||
14 | + | ||
15 | + // 加载查询条件下拉框 | ||
16 | + function loadConditionSelect() { | ||
17 | + //绑定业务下拉选择数据 | ||
18 | + common.bizTypeSelect("slt-information-database", function () { | ||
19 | + form.render("select"); | ||
20 | + }); | ||
21 | + } | ||
22 | + //下载 | ||
23 | + $('#database_download').on('click', function () { | ||
24 | + var id ='1e34cd608aa111ee93f9005056aae0ca'; | ||
25 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
26 | + window.open(url); | ||
27 | + }) | ||
28 | + $("#orgSearchBtn").on("click",function () { | ||
29 | + renderInformationDatabaseListTable(); | ||
30 | + }); | ||
31 | + $("#database_temp_import").on("click", function () { | ||
32 | + var loadIndex = ''; | ||
33 | + var $content = $("#database-import-form"); | ||
34 | + layer.open({ | ||
35 | + type: 1 | ||
36 | + , title: '导入数据库信息' | ||
37 | + , area: ['600px', '300px'] | ||
38 | + , shade: 0.8 | ||
39 | + , id: 'database-import-form-id' //设定一个id,防止重复弹出 | ||
40 | + , btn: ['上传', '取消'] | ||
41 | + , content: $content.html() | ||
42 | + , yes: function (index, layero) { | ||
43 | + if ($("#database-display-file-name").val()) { | ||
44 | + loadIndex = layer.load(2); | ||
45 | + uploadFile.upload(); | ||
46 | + } else { | ||
47 | + layer.msg('请选择要导入的文件!', { | ||
48 | + icon: 7, time: 3000 | ||
49 | + }); | ||
50 | + return false; | ||
51 | + } | ||
52 | + } | ||
53 | + }); | ||
54 | + | ||
55 | + var uploadFile = upload.render({ | ||
56 | + elem: '#database-display-file-name' | ||
57 | + , url: common.domainName + '/api-web/informationAsset/database/importExcel?accessToken=' + accessToken | ||
58 | + , auto: false | ||
59 | + , accept: 'file' | ||
60 | + , exts: 'xlsx|xls' | ||
61 | + , choose: function (obj) { | ||
62 | + this.files = obj.pushFile(); | ||
63 | + //读取本地文件 | ||
64 | + obj.preview(function (index, file, result) { | ||
65 | + $("#database-display-file-name").val(file.name); | ||
66 | + }); | ||
67 | + } | ||
68 | + , done: function (res) { | ||
69 | + layer.closeAll(); | ||
70 | + layer.msg('导入成功!', { | ||
71 | + icon: 1, time: 3000 | ||
72 | + }); | ||
73 | + } | ||
74 | + , error: function (res) { | ||
75 | + layer.closeAll(); | ||
76 | + } | ||
77 | + }); | ||
78 | + }); | ||
79 | + $("#btn-database-export-excel").on('click', function () { | ||
80 | + var href = common.domainName + "/api-web/informationAsset/exportInformationDatabaseList?accessToken=" + accessToken + "&busId=" + $("#slt-information-database").val(); | ||
81 | + window.open(href) | ||
82 | + }); | ||
83 | + $('#addDatabaseBtn').on('click', function () { | ||
84 | + openAddDatabaseForm() | ||
85 | + }); | ||
86 | + | ||
87 | + function openAddDatabaseForm(id) { | ||
88 | + let title = id ? '编辑' : '新增'; | ||
89 | + common.openWin('informationAsset/databaseAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
90 | + $("#database-form-save-id").trigger("click"); | ||
91 | + form.render(); | ||
92 | + }, null, ['90%', '90%'], null, { | ||
93 | + end: function () { | ||
94 | + reloadAllChange(); | ||
95 | + } | ||
96 | + }) | ||
97 | + } | ||
98 | + | ||
99 | + //表格数据 | ||
100 | + function renderInformationDatabaseListTable() { | ||
101 | + let url = common.domainName + '/api-web/informationAsset/informationDatabaseList'; | ||
102 | + let conditions = form.val('database-index-form'); | ||
103 | + Object.assign(conditions, { | ||
104 | + accessToken: accessToken | ||
105 | + }); | ||
106 | + table.render({ | ||
107 | + elem: '#database_table_id', | ||
108 | + url: url, | ||
109 | + where: conditions, | ||
110 | + height: 'full-360', | ||
111 | + page: { | ||
112 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
113 | + theme: '#1E9FFF' | ||
114 | + }, | ||
115 | + end: function (e) { | ||
116 | + form.render() | ||
117 | + }, | ||
118 | + limit: common.limit, | ||
119 | + limits: common.limits, | ||
120 | + even: true, | ||
121 | + cols: [[{ | ||
122 | + type: 'numbers', title: '序号' | ||
123 | + }, { | ||
124 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
125 | + }, { | ||
126 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
127 | + },{ | ||
128 | + field: 'databaseCode', title: '登记编号', align: 'center', | ||
129 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-database-code" >{{d.databaseCode}}</span></div>' | ||
130 | + }, { | ||
131 | + field: 'databaseName', title: '数据库名称', align: 'center' | ||
132 | + }, { | ||
133 | + field: 'appCode', title: '所属应用系统编号', align: 'center' | ||
134 | + },{ | ||
135 | + field: 'purpose', title: '数据库用途', align: 'center' | ||
136 | + },{ | ||
137 | + field: 'brandName', title: '数据库品牌', align: 'center' | ||
138 | + } ,{ | ||
139 | + field: 'version', title: '数据库版本', align: 'center' | ||
140 | + }, { | ||
141 | + field: 'typeName', title: '数据库类型', align: 'center' | ||
142 | + }, { | ||
143 | + field: 'nodes', title: '节点数量', align: 'center' | ||
144 | + }, { | ||
145 | + field: 'serverAddress', title: '服务地址', align: 'center' | ||
146 | + }, { | ||
147 | + field: 'manageAddress', title: '管理地址', align: 'center' | ||
148 | + }, { | ||
149 | + field: 'serviceTypeName', title: '服务类型', align: 'center' | ||
150 | + }, { | ||
151 | + field: 'spaceCapacity', title: '表空间总容量(GB)', align: 'center' | ||
152 | + }, { | ||
153 | + field: 'excluded', title: '已占用容量(GB)', align: 'center' | ||
154 | + }, { | ||
155 | + field: 'dba', title: '数据库管理员', align: 'center' | ||
156 | + },{ | ||
157 | + field: 'phone', title: '联系方式', align: 'center' | ||
158 | + },{ | ||
159 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
160 | + let env = d.env == '1' ?'生产':'预生产'; | ||
161 | + return env; | ||
162 | + } | ||
163 | + }, { | ||
164 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
165 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
166 | + return monitorStatus; | ||
167 | + } | ||
168 | + }, { | ||
169 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
170 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
171 | + return backStatus; | ||
172 | + } | ||
173 | + } | ||
174 | + ]], | ||
175 | + done: function () { | ||
176 | + $('.view-database-code').on('click', function () { | ||
177 | + openAddDatabaseForm($(this).data('id')) | ||
178 | + }) | ||
179 | + } | ||
180 | + }); | ||
181 | + | ||
182 | + } | ||
183 | + | ||
184 | + // 图表,表格重新加载 | ||
185 | + function reloadAllChange() { | ||
186 | + renderInformationDatabaseListTable(); | ||
187 | + loadConditionSelect(); | ||
188 | + } | ||
189 | + }); | ||
190 | + | ||
191 | +}); |
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationDatabaseAdd', function(data){ | ||
13 | + var accessToken = common.getMjToken(); | ||
14 | + //渲染表单 | ||
15 | + form.render(null, 'add-informationdatabase-form') | ||
16 | + init(); | ||
17 | + | ||
18 | + //保存 | ||
19 | + form.on('submit(database-form-save-id)', function (res) { | ||
20 | + saveForm() | ||
21 | + }); | ||
22 | + | ||
23 | + //保存 | ||
24 | + function saveForm() { | ||
25 | + layer.load(2) | ||
26 | + var data = form.val('add-informationdatabase-form'); | ||
27 | + admin.req({ | ||
28 | + url: domainName + '/api-web/informationAsset/saveDatabase', | ||
29 | + data: JSON.stringify(data), | ||
30 | + type: 'post', | ||
31 | + contentType: "application/json; charset=utf-8", | ||
32 | + done: function (res) { | ||
33 | + if (res.success) { | ||
34 | + layer.msg(res.msg, { | ||
35 | + offset: '15px', | ||
36 | + icon: 1, | ||
37 | + time: 1000, | ||
38 | + }, function () { | ||
39 | + layer.closeAll() | ||
40 | + table.reload('database_table_id', { | ||
41 | + where: { | ||
42 | + accessToken: accessToken, | ||
43 | + }, | ||
44 | + }); | ||
45 | + }) | ||
46 | + } else { | ||
47 | + layer.msg(res.msg, { | ||
48 | + offset: '15px', | ||
49 | + icon: 7, | ||
50 | + time: 1000, | ||
51 | + }) | ||
52 | + } | ||
53 | + } | ||
54 | + }) | ||
55 | + return false | ||
56 | + } | ||
57 | + | ||
58 | + //页面初始化 | ||
59 | + function init() { | ||
60 | + loadSelect(); | ||
61 | + } | ||
62 | + // 初始化下拉框 | ||
63 | + function loadSelect() { | ||
64 | + let brandurl = `${domainName}/mj/sys/conf/getSelectCN/dbBrand?accessToken=${accessToken}`; | ||
65 | + $.ajax({ | ||
66 | + url: brandurl, | ||
67 | + async: false, | ||
68 | + success: function (res) { | ||
69 | + var selects = res.data.options; | ||
70 | + var $sel = $("form#add-informationdatabase-form").find("select[name='brand']"); | ||
71 | + $.each(selects, function (i, e) { | ||
72 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
73 | + }); | ||
74 | + form.render(); | ||
75 | + } | ||
76 | + }); | ||
77 | + | ||
78 | + let typeurl = `${domainName}/mj/sys/conf/getSelectCN/DBTYPE?accessToken=${accessToken}`; | ||
79 | + $.ajax({ | ||
80 | + url: typeurl, | ||
81 | + async: false, | ||
82 | + success: function (res) { | ||
83 | + var selects = res.data.options; | ||
84 | + var $sel = $("form#add-informationdatabase-form").find("select[name='type']"); | ||
85 | + $.each(selects, function (i, e) { | ||
86 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
87 | + }); | ||
88 | + form.render(); | ||
89 | + } | ||
90 | + }); | ||
91 | + let serviceTypeurl = `${domainName}/mj/sys/conf/getSelectCN/serviceType?accessToken=${accessToken}`; | ||
92 | + $.ajax({ | ||
93 | + url: serviceTypeurl, | ||
94 | + async: false, | ||
95 | + success: function (res) { | ||
96 | + var selects = res.data.options; | ||
97 | + var $sel = $("form#add-informationdatabase-form").find("select[name='serviceType']"); | ||
98 | + $.each(selects, function (i, e) { | ||
99 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
100 | + }); | ||
101 | + form.render(); | ||
102 | + } | ||
103 | + }); | ||
104 | + //绑定业务下拉选择数据 | ||
105 | + common.bizTypeSelect("add-information-database", function () { | ||
106 | + fromAssignment(); | ||
107 | + form.render("select"); | ||
108 | + }); | ||
109 | + | ||
110 | + } | ||
111 | + | ||
112 | + form.verify({ | ||
113 | + account: function(value, item){ | ||
114 | + var max = item.getAttribute('maxlength'); | ||
115 | + if(value.length > max){ | ||
116 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
117 | + } | ||
118 | + } | ||
119 | + }); | ||
120 | + | ||
121 | + | ||
122 | + //表单赋值 | ||
123 | + function fromAssignment() { | ||
124 | + if (data && data.id) { | ||
125 | + var loading =layer.load(2); | ||
126 | + admin.req({ | ||
127 | + url: domainName + `/api-web/informationAsset/findDatabaseById`, | ||
128 | + data: {id: data.id}, | ||
129 | + async: false, | ||
130 | + }).done(function (res) { | ||
131 | + layer.close(loading) | ||
132 | + form.val('add-informationdatabase-form', res.object); | ||
133 | + form.render('select'); | ||
134 | + }) | ||
135 | + }else{ | ||
136 | + form.render('select'); | ||
137 | + } | ||
138 | + } | ||
139 | + | ||
140 | + | ||
141 | + | ||
142 | + | ||
143 | + }) | ||
144 | +}) |
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationDbInstance', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + //发送状态 | ||
12 | + // 下拉框改变搜索 | ||
13 | + //form.on('select(slt-information-dbInstance)', reloadAllChange); | ||
14 | + | ||
15 | + // 加载查询条件下拉框 | ||
16 | + function loadConditionSelect() { | ||
17 | + //绑定业务下拉选择数据 | ||
18 | + common.bizTypeSelect("slt-information-dbInstance", function () { | ||
19 | + form.render("select"); | ||
20 | + }); | ||
21 | + } | ||
22 | + //下载 | ||
23 | + $('#dbInstance_download').on('click', function () { | ||
24 | + var id ='a6fbb82b8d0911ee93f9005056aae0ca'; | ||
25 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
26 | + window.open(url); | ||
27 | + }) | ||
28 | + $("#orgSearchBtn").on("click",function () { | ||
29 | + renderInformationdbInstanceListTable(); | ||
30 | + }); | ||
31 | + $("#dbInstance_temp_import").on("click", function () { | ||
32 | + var loadIndex = ''; | ||
33 | + var $content = $("#dbInstance-import-form"); | ||
34 | + layer.open({ | ||
35 | + type: 1 | ||
36 | + , title: '导入数据库实例信息' | ||
37 | + , area: ['600px', '300px'] | ||
38 | + , shade: 0.8 | ||
39 | + , id: 'dbInstance-import-form-id' //设定一个id,防止重复弹出 | ||
40 | + , btn: ['上传', '取消'] | ||
41 | + , content: $content.html() | ||
42 | + , yes: function (index, layero) { | ||
43 | + if ($("#dbInstance-display-file-name").val()) { | ||
44 | + loadIndex = layer.load(2); | ||
45 | + uploadFile.upload(); | ||
46 | + } else { | ||
47 | + layer.msg('请选择要导入的文件!', { | ||
48 | + icon: 7, time: 3000 | ||
49 | + }); | ||
50 | + return false; | ||
51 | + } | ||
52 | + } | ||
53 | + }); | ||
54 | + | ||
55 | + var uploadFile = upload.render({ | ||
56 | + elem: '#dbInstance-display-file-name' | ||
57 | + , url: common.domainName + '/api-web/informationAsset/dbInstance/importExcel?accessToken=' + accessToken | ||
58 | + , auto: false | ||
59 | + , accept: 'file' | ||
60 | + , exts: 'xlsx|xls' | ||
61 | + , choose: function (obj) { | ||
62 | + this.files = obj.pushFile(); | ||
63 | + //读取本地文件 | ||
64 | + obj.preview(function (index, file, result) { | ||
65 | + $("#dbInstance-display-file-name").val(file.name); | ||
66 | + }); | ||
67 | + } | ||
68 | + , done: function (res) { | ||
69 | + layer.closeAll(); | ||
70 | + layer.msg('导入成功!', { | ||
71 | + icon: 1, time: 3000 | ||
72 | + }); | ||
73 | + } | ||
74 | + , error: function (res) { | ||
75 | + layer.closeAll(); | ||
76 | + } | ||
77 | + }); | ||
78 | + }); | ||
79 | + $("#btn-dbInstance-export-excel").on('click', function () { | ||
80 | + var href = common.domainName + "/api-web/informationAsset/exportInformationDbInstanceList?accessToken=" + accessToken + "&busId=" + $("#slt-information-dbInstance").val(); | ||
81 | + window.open(href) | ||
82 | + }); | ||
83 | + $('#addDbInstanceBtn').on('click', function () { | ||
84 | + openAddDbInstanceForm() | ||
85 | + }); | ||
86 | + | ||
87 | + function openAddDbInstanceForm(id) { | ||
88 | + let title = id ? '编辑' : '新增'; | ||
89 | + common.openWin('informationAsset/dbInstanceAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
90 | + $("#dbInstance-form-save-id").trigger("click"); | ||
91 | + form.render(); | ||
92 | + }, null, ['90%', '90%'], null, { | ||
93 | + end: function () { | ||
94 | + reloadAllChange(); | ||
95 | + } | ||
96 | + }) | ||
97 | + } | ||
98 | + | ||
99 | + //表格数据 | ||
100 | + function renderInformationdbInstanceListTable() { | ||
101 | + let url = common.domainName + '/api-web/informationAsset/informationDbInstanceList'; | ||
102 | + let conditions = form.val('dbInstance-index-form'); | ||
103 | + Object.assign(conditions, { | ||
104 | + accessToken: accessToken | ||
105 | + }); | ||
106 | + table.render({ | ||
107 | + elem: '#dbInstance_table_id', | ||
108 | + url: url, | ||
109 | + where: conditions, | ||
110 | + height: 'full-360', | ||
111 | + page: { | ||
112 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
113 | + theme: '#1E9FFF' | ||
114 | + }, | ||
115 | + end: function (e) { | ||
116 | + form.render() | ||
117 | + }, | ||
118 | + limit: common.limit, | ||
119 | + limits: common.limits, | ||
120 | + even: true, | ||
121 | + cols: [[{ | ||
122 | + type: 'numbers', title: '序号' | ||
123 | + }, { | ||
124 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
125 | + }, { | ||
126 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
127 | + },{ | ||
128 | + field: 'instanceCode', title: '登记编号', align: 'center', | ||
129 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-dbInstance-code" >{{d.instanceCode}}</span></div>' | ||
130 | + }, { | ||
131 | + field: 'instanceName', title: '实例名称', align: 'center' | ||
132 | + }, { | ||
133 | + field: 'databaseCode', title: '所属数据库编号', align: 'center' | ||
134 | + },{ | ||
135 | + field: 'nodeFunctionName', title: '节点功能', align: 'center' | ||
136 | + },{ | ||
137 | + field: 'databaseName', title: '数据库名称', align: 'center' | ||
138 | + } ,{ | ||
139 | + field: 'osIp', title: '操作系统IP地址', align: 'center' | ||
140 | + }, { | ||
141 | + field: 'resTypeName', title: '资源类型', align: 'center' | ||
142 | + }, { | ||
143 | + field: 'resCode', title: '所属资源编号', align: 'center' | ||
144 | + }, { | ||
145 | + field: 'port', title: '服务端口', align: 'center' | ||
146 | + }, { | ||
147 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
148 | + let env = d.env == '1' ?'生产':'预生产'; | ||
149 | + return env; | ||
150 | + } | ||
151 | + }, { | ||
152 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
153 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
154 | + return monitorStatus; | ||
155 | + } | ||
156 | + }, { | ||
157 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
158 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
159 | + return backStatus; | ||
160 | + } | ||
161 | + } | ||
162 | + ]], | ||
163 | + done: function () { | ||
164 | + $('.view-dbInstance-code').on('click', function () { | ||
165 | + openAddDbInstanceForm($(this).data('id')) | ||
166 | + }) | ||
167 | + } | ||
168 | + }); | ||
169 | + | ||
170 | + } | ||
171 | + | ||
172 | + // 图表,表格重新加载 | ||
173 | + function reloadAllChange() { | ||
174 | + renderInformationdbInstanceListTable(); | ||
175 | + loadConditionSelect(); | ||
176 | + } | ||
177 | + }); | ||
178 | + | ||
179 | +}); |
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationDbInstanceAdd', function(data){ | ||
13 | + var accessToken = common.getMjToken(); | ||
14 | + //渲染表单 | ||
15 | + form.render(null, 'add-informationdbInstance-form') | ||
16 | + init(); | ||
17 | + | ||
18 | + //保存 | ||
19 | + form.on('submit(dbInstance-form-save-id)', function (res) { | ||
20 | + saveForm() | ||
21 | + }); | ||
22 | + | ||
23 | + //保存 | ||
24 | + function saveForm() { | ||
25 | + layer.load(2) | ||
26 | + var data = form.val('add-informationdbInstance-form'); | ||
27 | + admin.req({ | ||
28 | + url: domainName + '/api-web/informationAsset/saveDbInstance', | ||
29 | + data: JSON.stringify(data), | ||
30 | + type: 'post', | ||
31 | + contentType: "application/json; charset=utf-8", | ||
32 | + done: function (res) { | ||
33 | + if (res.success) { | ||
34 | + layer.msg(res.msg, { | ||
35 | + offset: '15px', | ||
36 | + icon: 1, | ||
37 | + time: 1000, | ||
38 | + }, function () { | ||
39 | + layer.closeAll() | ||
40 | + table.reload('dbInstance_table_id', { | ||
41 | + where: { | ||
42 | + accessToken: accessToken, | ||
43 | + }, | ||
44 | + }); | ||
45 | + }) | ||
46 | + } else { | ||
47 | + layer.msg(res.msg, { | ||
48 | + offset: '15px', | ||
49 | + icon: 7, | ||
50 | + time: 1000, | ||
51 | + }) | ||
52 | + } | ||
53 | + } | ||
54 | + }) | ||
55 | + return false | ||
56 | + } | ||
57 | + | ||
58 | + //页面初始化 | ||
59 | + function init() { | ||
60 | + loadSelect(); | ||
61 | + } | ||
62 | + // 初始化下拉框 | ||
63 | + function loadSelect() { | ||
64 | + let nodeFunctionurl = `${domainName}/mj/sys/conf/getSelectCN/nodeFunction?accessToken=${accessToken}`; | ||
65 | + $.ajax({ | ||
66 | + url: nodeFunctionurl, | ||
67 | + async: false, | ||
68 | + success: function (res) { | ||
69 | + var selects = res.data.options; | ||
70 | + var $sel = $("form#add-informationdbInstance-form").find("select[name='nodeFunction']"); | ||
71 | + $.each(selects, function (i, e) { | ||
72 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
73 | + }); | ||
74 | + form.render(); | ||
75 | + } | ||
76 | + }); | ||
77 | + | ||
78 | + let typeurl = `${domainName}/mj/sys/conf/getSelectCN/insResType?accessToken=${accessToken}`; | ||
79 | + $.ajax({ | ||
80 | + url: typeurl, | ||
81 | + async: false, | ||
82 | + success: function (res) { | ||
83 | + var selects = res.data.options; | ||
84 | + var $sel = $("form#add-informationdbInstance-form").find("select[name='resType']"); | ||
85 | + $.each(selects, function (i, e) { | ||
86 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
87 | + }); | ||
88 | + form.render(); | ||
89 | + } | ||
90 | + }); | ||
91 | + let databaseCodeUrl = `${domainName}/api-web/informationAsset/informationDatabaseList?accessToken=${accessToken}`; | ||
92 | + $.ajax({ | ||
93 | + url: databaseCodeUrl, | ||
94 | + async: false, | ||
95 | + success: function (res) { | ||
96 | + var selects = res.data; | ||
97 | + var $sel = $("form#add-informationdbInstance-form").find("select[name='databaseCode']"); | ||
98 | + $.each(selects, function (i, e) { | ||
99 | + $sel.append(`<option value="${e.databaseCode}"> ${e.databaseName}</option>`) | ||
100 | + }) | ||
101 | + form.render(); | ||
102 | + } | ||
103 | + }); | ||
104 | + //绑定业务下拉选择数据 | ||
105 | + common.bizTypeSelect("add-information-dbInstance", function () { | ||
106 | + fromAssignment(); | ||
107 | + form.render("select"); | ||
108 | + }); | ||
109 | + | ||
110 | + } | ||
111 | + | ||
112 | + form.verify({ | ||
113 | + account: function(value, item){ | ||
114 | + var max = item.getAttribute('maxlength'); | ||
115 | + if(value.length > max){ | ||
116 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
117 | + } | ||
118 | + } | ||
119 | + }); | ||
120 | + | ||
121 | + | ||
122 | + //表单赋值 | ||
123 | + function fromAssignment() { | ||
124 | + if (data && data.id) { | ||
125 | + var loading =layer.load(2); | ||
126 | + admin.req({ | ||
127 | + url: domainName + `/api-web/informationAsset/findDbInstanceById`, | ||
128 | + data: {id: data.id}, | ||
129 | + async: false, | ||
130 | + }).done(function (res) { | ||
131 | + layer.close(loading) | ||
132 | + form.val('add-informationdbInstance-form', res.object); | ||
133 | + form.render('select'); | ||
134 | + }) | ||
135 | + }else{ | ||
136 | + form.render('select'); | ||
137 | + } | ||
138 | + } | ||
139 | + | ||
140 | + | ||
141 | + | ||
142 | + | ||
143 | + }) | ||
144 | +}) |
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationHost', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + //发送状态 | ||
12 | + // 下拉框改变搜索 | ||
13 | + //form.on('select(slt-information-host)', reloadAllChange); | ||
14 | + | ||
15 | + // 加载查询条件下拉框 | ||
16 | + function loadConditionSelect() { | ||
17 | + //绑定业务下拉选择数据 | ||
18 | + common.bizTypeSelect("slt-information-host", function () { | ||
19 | + form.render("select"); | ||
20 | + }); | ||
21 | + } | ||
22 | + //下载 | ||
23 | + $('#host_download').on('click', function () { | ||
24 | + var id ='4e54acd688e011ee93f9005056aae0ca'; | ||
25 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
26 | + window.open(url); | ||
27 | + }) | ||
28 | + $("#orgSearchBtn").on("click",function () { | ||
29 | + renderInformationHostListTable(); | ||
30 | + }); | ||
31 | + $("#host_temp_import").on("click", function () { | ||
32 | + var loadIndex = ''; | ||
33 | + var $content = $("#host-import-form"); | ||
34 | + layer.open({ | ||
35 | + type: 1 | ||
36 | + , title: '导入PC服务器信息' | ||
37 | + , area: ['600px', '300px'] | ||
38 | + , shade: 0.8 | ||
39 | + , id: 'host-import-form-id' //设定一个id,防止重复弹出 | ||
40 | + , btn: ['上传', '取消'] | ||
41 | + , content: $content.html() | ||
42 | + , yes: function (index, layero) { | ||
43 | + if ($("#host-display-file-name").val()) { | ||
44 | + loadIndex = layer.load(2); | ||
45 | + uploadFile.upload(); | ||
46 | + } else { | ||
47 | + layer.msg('请选择要导入的文件!', { | ||
48 | + icon: 7, time: 3000 | ||
49 | + }); | ||
50 | + return false; | ||
51 | + } | ||
52 | + } | ||
53 | + }); | ||
54 | + | ||
55 | + var uploadFile = upload.render({ | ||
56 | + elem: '#host-display-file-name' | ||
57 | + , url: common.domainName + '/api-web/informationAsset/host/importExcel?accessToken=' + accessToken | ||
58 | + , auto: false | ||
59 | + , accept: 'file' | ||
60 | + , exts: 'xlsx|xls' | ||
61 | + , choose: function (obj) { | ||
62 | + this.files = obj.pushFile(); | ||
63 | + //读取本地文件 | ||
64 | + obj.preview(function (index, file, result) { | ||
65 | + $("#host-display-file-name").val(file.name); | ||
66 | + }); | ||
67 | + } | ||
68 | + , done: function (res) { | ||
69 | + layer.closeAll(); | ||
70 | + layer.msg('导入成功!', { | ||
71 | + icon: 1, time: 3000 | ||
72 | + }); | ||
73 | + } | ||
74 | + , error: function (res) { | ||
75 | + layer.closeAll(); | ||
76 | + } | ||
77 | + }); | ||
78 | + }); | ||
79 | + $("#btn-host-export-excel").on('click', function () { | ||
80 | + var href = common.domainName + "/api-web/informationAsset/exportInformationHostList?accessToken=" + accessToken + "&busId=" + $("#slt-information-host").val(); | ||
81 | + window.open(href) | ||
82 | + }); | ||
83 | + $('#addHostBtn').on('click', function () { | ||
84 | + openAddHostForm() | ||
85 | + }); | ||
86 | + | ||
87 | + function openAddHostForm(id) { | ||
88 | + let title = id ? '编辑' : '新增'; | ||
89 | + common.openWin('informationAsset/hostAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
90 | + $("#host-form-save-id").trigger("click"); | ||
91 | + form.render(); | ||
92 | + }, null, ['90%', '90%'], null, { | ||
93 | + end: function () { | ||
94 | + reloadAllChange(); | ||
95 | + } | ||
96 | + }) | ||
97 | + } | ||
98 | + //表格数据 | ||
99 | + function renderInformationHostListTable(){ | ||
100 | + let url = common.domainName + '/api-web/informationAsset/informationHostList'; | ||
101 | + let conditions = form.val('host-index-form'); | ||
102 | + Object.assign(conditions, { | ||
103 | + accessToken: accessToken | ||
104 | + }); | ||
105 | + table.render({ | ||
106 | + elem: '#host_table_id', | ||
107 | + url: url, | ||
108 | + where: conditions, | ||
109 | + height: 'full-360', | ||
110 | + page: { | ||
111 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
112 | + theme: '#1E9FFF' | ||
113 | + }, | ||
114 | + end: function (e) { | ||
115 | + form.render() | ||
116 | + }, | ||
117 | + limit: common.limit, | ||
118 | + limits: common.limits, | ||
119 | + even: true, | ||
120 | + cols: [[ { | ||
121 | + type: 'numbers', title: '序号' | ||
122 | + }, { | ||
123 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
124 | + }, { | ||
125 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
126 | + },{ | ||
127 | + field: 'hostCode', title: '登记编号', align: 'center', | ||
128 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-host-code" >{{d.hostCode}}</span></div>' | ||
129 | + }, { | ||
130 | + field: 'hostName', title: '服务器名称', align: 'center' | ||
131 | + }, { | ||
132 | + field: 'deviceNo', title: '设备编号', align: 'center' | ||
133 | + },{ | ||
134 | + field: 'ip', title: 'IP地址', align: 'center' | ||
135 | + },{ | ||
136 | + field: 'capacity', title: '硬盘容量(GB)', align: 'center' | ||
137 | + } ,{ | ||
138 | + field: 'raidLevel', title: 'raid级别', align: 'center' | ||
139 | + }, { | ||
140 | + field: 'isHyper', title: '是否超线程', align: 'center',templet:function (d) { | ||
141 | + let isHyper = d.isHyper == '1'?'是':'否'; | ||
142 | + return isHyper; | ||
143 | + } | ||
144 | + }, { | ||
145 | + field: 'osCode', title: '操作系统编号', align: 'center' | ||
146 | + }, { | ||
147 | + field: 'installDate', title: '安装日期', align: 'center' | ||
148 | + }, { | ||
149 | + field: 'hostStatusName', title: '使用状态', align: 'center' | ||
150 | + }, { | ||
151 | + field: 'orgName', title: '运维管理单位', align: 'center' | ||
152 | + }, { | ||
153 | + field: 'factoryName', title: '运维公司', align: 'center' | ||
154 | + }, { | ||
155 | + field: 'factoryUser', title: '运维联系人', align: 'center' | ||
156 | + }, { | ||
157 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
158 | + let env = d.env == '1' ?'生产':'预生产'; | ||
159 | + return env; | ||
160 | + } | ||
161 | + }, { | ||
162 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
163 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
164 | + return monitorStatus; | ||
165 | + } | ||
166 | + }, { | ||
167 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
168 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
169 | + return backStatus; | ||
170 | + } | ||
171 | + } | ||
172 | + ]], | ||
173 | + done: function () { | ||
174 | + $('.view-host-code').on('click', function () { | ||
175 | + openAddHostForm($(this).data('id')) | ||
176 | + }) | ||
177 | + } | ||
178 | + }); | ||
179 | + | ||
180 | + } | ||
181 | + | ||
182 | + // 图表,表格重新加载 | ||
183 | + function reloadAllChange() { | ||
184 | + renderInformationHostListTable(); | ||
185 | + loadConditionSelect(); | ||
186 | + } | ||
187 | + }); | ||
188 | + | ||
189 | +}); |
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'laydate', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var laydate = layui.laydate; | ||
10 | + var domainName = common.domainName; | ||
11 | + | ||
12 | + //对外暴露的接口 | ||
13 | + exports('informationHostAdd', function (data) { | ||
14 | + var accessToken = common.getMjToken(); | ||
15 | + let installDate = {}; | ||
16 | + //渲染表单 | ||
17 | + form.render(null, 'add-informationhost-form') | ||
18 | + init(); | ||
19 | + | ||
20 | + //保存 | ||
21 | + form.on('submit(host-form-save-id)', function (res) { | ||
22 | + saveForm() | ||
23 | + }); | ||
24 | + | ||
25 | + //保存 | ||
26 | + function saveForm() { | ||
27 | + layer.load(2) | ||
28 | + var data = form.val('add-informationhost-form'); | ||
29 | + admin.req({ | ||
30 | + url: domainName + '/api-web/informationAsset/saveHost', | ||
31 | + data: JSON.stringify(data), | ||
32 | + type: 'post', | ||
33 | + contentType: "application/json; charset=utf-8", | ||
34 | + done: function (res) { | ||
35 | + if (res.success) { | ||
36 | + layer.msg(res.msg, { | ||
37 | + offset: '15px', | ||
38 | + icon: 1, | ||
39 | + time: 1000, | ||
40 | + }, function () { | ||
41 | + layer.closeAll() | ||
42 | + table.reload('host_table_id', { | ||
43 | + where: { | ||
44 | + accessToken: accessToken, | ||
45 | + }, | ||
46 | + }); | ||
47 | + }) | ||
48 | + } else { | ||
49 | + layer.msg(res.msg, { | ||
50 | + offset: '15px', | ||
51 | + icon: 7, | ||
52 | + time: 1000, | ||
53 | + }) | ||
54 | + } | ||
55 | + } | ||
56 | + }) | ||
57 | + return false | ||
58 | + } | ||
59 | + | ||
60 | + //页面初始化 | ||
61 | + function init() { | ||
62 | + loadSelect(); | ||
63 | + initDatePlus(); | ||
64 | + } | ||
65 | + //初始化日期插件 | ||
66 | + function initDatePlus() { | ||
67 | + installDate = laydate.render({ | ||
68 | + elem: '#installDate', //指定元素 | ||
69 | + value: new Date(), | ||
70 | + isInitValue: true, | ||
71 | + }); | ||
72 | + } | ||
73 | + // 初始化下拉框 | ||
74 | + function loadSelect() { | ||
75 | + let osurl = `${domainName}/mj/sys/conf/getSelectCN/hostStatus?accessToken=${accessToken}`; | ||
76 | + $.ajax({ | ||
77 | + url: osurl, | ||
78 | + async: false, | ||
79 | + success: function (res) { | ||
80 | + var selects = res.data.options; | ||
81 | + var $sel = $("form#add-informationhost-form").find("select[name='hostStatus']"); | ||
82 | + $.each(selects, function (i, e) { | ||
83 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
84 | + }); | ||
85 | + form.render(); | ||
86 | + } | ||
87 | + }); | ||
88 | + admin.req({ | ||
89 | + url: domainName + '/mj/sysOrg/page?orgType=1' | ||
90 | + }).done(function (response) { | ||
91 | + var options = "<option value=''>运维管理单位</option>"; | ||
92 | + $.each(response.data.rows, function (i, v) { | ||
93 | + options += "<option value='" + v.orgId + "'>" + v.orgName + "</option>" | ||
94 | + }); | ||
95 | + $('#orgId').html(options); | ||
96 | + form.render(); | ||
97 | + }); | ||
98 | + let osCodeUrl = `${domainName}/api-web/informationAsset/informationosList?accessToken=${accessToken}`; | ||
99 | + $.ajax({ | ||
100 | + url: osCodeUrl, | ||
101 | + async: false, | ||
102 | + success: function (res) { | ||
103 | + var selects = res.data; | ||
104 | + var $sel = $("form#add-informationhost-form").find("select[name='osCode']"); | ||
105 | + $.each(selects, function (i, e) { | ||
106 | + $sel.append(`<option value="${e.osCode}"> ${e.osBrand}-${e.osVersion}</option>`) | ||
107 | + }) | ||
108 | + form.render(); | ||
109 | + } | ||
110 | + }); | ||
111 | + //绑定业务下拉选择数据 | ||
112 | + common.bizTypeSelect("add-information-host", function () { | ||
113 | + form.render("select"); | ||
114 | + }); | ||
115 | + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`; | ||
116 | + $.ajax({ | ||
117 | + url: url, | ||
118 | + success: function (res) { | ||
119 | + var options = "<option value=''>运维公司</option>"; | ||
120 | + $.each(res.data, function (i, v) { | ||
121 | + options += "<option value='" + v.id + "'>" + v.shortName + "</option>" | ||
122 | + }); | ||
123 | + options += "<option value='0'>其他</option>"; | ||
124 | + $('#factoryId').html(options); | ||
125 | + form.render(); | ||
126 | + fromAssignment(); | ||
127 | + } | ||
128 | + }); | ||
129 | + | ||
130 | + } | ||
131 | + | ||
132 | + form.verify({ | ||
133 | + account: function(value, item){ | ||
134 | + var max = item.getAttribute('maxlength'); | ||
135 | + if(value.length > max){ | ||
136 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
137 | + } | ||
138 | + } | ||
139 | + }); | ||
140 | + | ||
141 | + | ||
142 | + //表单赋值 | ||
143 | + function fromAssignment() { | ||
144 | + if (data && data.id) { | ||
145 | + var loading =layer.load(2); | ||
146 | + admin.req({ | ||
147 | + url: domainName + `/api-web/informationAsset/findHostById`, | ||
148 | + data: {id: data.id}, | ||
149 | + async: false, | ||
150 | + }).done(function (res) { | ||
151 | + layer.close(loading) | ||
152 | + form.val('add-informationhost-form', res.object); | ||
153 | + form.render('select'); | ||
154 | + }) | ||
155 | + }else{ | ||
156 | + form.render('select'); | ||
157 | + } | ||
158 | + } | ||
159 | + | ||
160 | + | ||
161 | + | ||
162 | + | ||
163 | + }) | ||
164 | +}) |
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationIp', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + //发送状态 | ||
12 | + // 下拉框改变搜索 | ||
13 | + //form.on('select(slt-information-ip)', reloadAllChange); | ||
14 | + | ||
15 | + // 加载查询条件下拉框 | ||
16 | + function loadConditionSelect() { | ||
17 | + //绑定业务下拉选择数据 | ||
18 | + common.bizTypeSelect("slt-information-ip", function () { | ||
19 | + form.render("select"); | ||
20 | + }); | ||
21 | + } | ||
22 | + //下载 | ||
23 | + $('#ip_download').on('click', function () { | ||
24 | + var id ='821c4d24878611ee93f9005056aae0ca'; | ||
25 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
26 | + window.open(url); | ||
27 | + }) | ||
28 | + $("#orgSearchBtn").on("click",function () { | ||
29 | + renderInformationIpListTable(); | ||
30 | + }); | ||
31 | + $("#ip_temp_import").on("click", function () { | ||
32 | + var loadIndex = ''; | ||
33 | + var $content = $("#ip-import-form"); | ||
34 | + layer.open({ | ||
35 | + type: 1 | ||
36 | + , title: '导入IP信息' | ||
37 | + , area: ['600px', '300px'] | ||
38 | + , shade: 0.8 | ||
39 | + , id: 'ip-import-form-id' //设定一个id,防止重复弹出 | ||
40 | + , btn: ['上传', '取消'] | ||
41 | + , content: $content.html() | ||
42 | + , yes: function (index, layero) { | ||
43 | + if ($("#ip-display-file-name").val()) { | ||
44 | + loadIndex = layer.load(2); | ||
45 | + uploadFile.upload(); | ||
46 | + } else { | ||
47 | + layer.msg('请选择要导入的文件!', { | ||
48 | + icon: 7, time: 3000 | ||
49 | + }); | ||
50 | + return false; | ||
51 | + } | ||
52 | + } | ||
53 | + }); | ||
54 | + | ||
55 | + var uploadFile = upload.render({ | ||
56 | + elem: '#ip-display-file-name' | ||
57 | + , url: common.domainName + '/api-web/informationAsset/ip/importExcel?accessToken=' + accessToken | ||
58 | + , auto: false | ||
59 | + , accept: 'file' | ||
60 | + , exts: 'xlsx|xls' | ||
61 | + , choose: function (obj) { | ||
62 | + this.files = obj.pushFile(); | ||
63 | + //读取本地文件 | ||
64 | + obj.preview(function (index, file, result) { | ||
65 | + $("#ip-display-file-name").val(file.name); | ||
66 | + }); | ||
67 | + } | ||
68 | + , done: function (res) { | ||
69 | + layer.closeAll(); | ||
70 | + layer.msg('导入成功!', { | ||
71 | + icon: 1, time: 3000 | ||
72 | + }); | ||
73 | + } | ||
74 | + , error: function (res) { | ||
75 | + layer.closeAll(); | ||
76 | + } | ||
77 | + }); | ||
78 | + }); | ||
79 | + $("#btn-ip-export-excel").on('click', function () { | ||
80 | + var href = common.domainName + "/api-web/informationAsset/exportInformationIpList?accessToken=" + accessToken + "&busId=" + $("#slt-information-ip").val(); | ||
81 | + window.open(href) | ||
82 | + }); | ||
83 | + $('#addIpBtn').on('click', function () { | ||
84 | + openAddIpForm() | ||
85 | + }); | ||
86 | + | ||
87 | + function openAddIpForm(id) { | ||
88 | + let title = id ? '编辑' : '新增'; | ||
89 | + common.openWin('informationAsset/ipAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
90 | + $("#ip-form-save-id").trigger("click"); | ||
91 | + form.render(); | ||
92 | + }, null, ['90%', '90%'], null, { | ||
93 | + end: function () { | ||
94 | + reloadAllChange(); | ||
95 | + } | ||
96 | + }) | ||
97 | + } | ||
98 | + | ||
99 | + //表格数据 | ||
100 | + function renderInformationIpListTable() { | ||
101 | + let url = common.domainName + '/api-web/informationAsset/informationipList'; | ||
102 | + let conditions = form.val('ip-index-form'); | ||
103 | + Object.assign(conditions, { | ||
104 | + accessToken: accessToken | ||
105 | + }); | ||
106 | + table.render({ | ||
107 | + elem: '#ip_table_id', | ||
108 | + url: url, | ||
109 | + where: conditions, | ||
110 | + height: 'full-360', | ||
111 | + page: { | ||
112 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
113 | + theme: '#1E9FFF' | ||
114 | + }, | ||
115 | + end: function (e) { | ||
116 | + form.render() | ||
117 | + }, | ||
118 | + limit: common.limit, | ||
119 | + limits: common.limits, | ||
120 | + even: true, | ||
121 | + cols: [[ { | ||
122 | + type: 'numbers', title: '序号' | ||
123 | + }, { | ||
124 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
125 | + }, { | ||
126 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
127 | + },{ | ||
128 | + field: 'ipCode', title: '登记编号', align: 'center', | ||
129 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-ip-code" >{{d.ipCode}}</span></div>' | ||
130 | + }, { | ||
131 | + field: 'ip', title: 'IP地址', align: 'center' | ||
132 | + }, { | ||
133 | + field: 'desc', title: '应用说明', align: 'center' | ||
134 | + },{ | ||
135 | + field: 'isUse', title: 'IP是否使用', align: 'center',templet:function (d) { | ||
136 | + let isUse = d.isUse == '1' ?'是':'否'; | ||
137 | + return isUse; | ||
138 | + } | ||
139 | + | ||
140 | + },{ | ||
141 | + field: 'isAssociation', title: '是否关联设备', align: 'center',templet:function (d) { | ||
142 | + let isAssociation = d.isAssociation == '1' ?'是':'否'; | ||
143 | + return isAssociation; | ||
144 | + } | ||
145 | + } ,{ | ||
146 | + field: 'applyUser', title: '申请人', align: 'center' | ||
147 | + },{ | ||
148 | + field: 'allocationTime', title: '分配日期', align: 'center' | ||
149 | + }, { | ||
150 | + field: 'allocationLeader', title: '分配人员', align: 'center' | ||
151 | + }, { | ||
152 | + field: 'orgCode', title: '单位编码', align: 'center' | ||
153 | + }, { | ||
154 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
155 | + let env = d.env == '1' ?'生产':'预生产'; | ||
156 | + return env; | ||
157 | + } | ||
158 | + }, { | ||
159 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
160 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
161 | + return monitorStatus; | ||
162 | + } | ||
163 | + }, { | ||
164 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
165 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
166 | + return backStatus; | ||
167 | + } | ||
168 | + } | ||
169 | + ]], | ||
170 | + done: function () { | ||
171 | + $('.view-ip-code').on('click', function () { | ||
172 | + openAddIpForm($(this).data('id')) | ||
173 | + }) | ||
174 | + } | ||
175 | + }); | ||
176 | + | ||
177 | + } | ||
178 | + | ||
179 | + // 图表,表格重新加载 | ||
180 | + function reloadAllChange() { | ||
181 | + renderInformationIpListTable(); | ||
182 | + loadConditionSelect(); | ||
183 | + } | ||
184 | + }); | ||
185 | + | ||
186 | +}); |
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'laydate','common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + var laydate = layui.laydate; | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationIpAdd', function (data) { | ||
13 | + let accessToken = common.getMjToken(); | ||
14 | + let allocationTime = {}; | ||
15 | + //渲染表单 | ||
16 | + form.render(null, 'add-informationip-form') | ||
17 | + init(); | ||
18 | + | ||
19 | + //保存 | ||
20 | + form.on('submit(ip-form-save-id)', function (res) { | ||
21 | + saveForm() | ||
22 | + }); | ||
23 | + | ||
24 | + //保存 | ||
25 | + function saveForm() { | ||
26 | + layer.load(2) | ||
27 | + var data = form.val('add-informationip-form'); | ||
28 | + admin.req({ | ||
29 | + url: domainName + '/api-web/informationAsset/saveIp', | ||
30 | + data: JSON.stringify(data), | ||
31 | + type: 'post', | ||
32 | + contentType: "application/json; charset=utf-8", | ||
33 | + done: function (res) { | ||
34 | + if (res.success) { | ||
35 | + layer.msg(res.msg, { | ||
36 | + offset: '15px', | ||
37 | + icon: 1, | ||
38 | + time: 1000, | ||
39 | + }, function () { | ||
40 | + layer.closeAll() | ||
41 | + table.reload('ip_table_id', { | ||
42 | + where: { | ||
43 | + accessToken: accessToken, | ||
44 | + }, | ||
45 | + }); | ||
46 | + }) | ||
47 | + } else { | ||
48 | + layer.msg(res.msg, { | ||
49 | + offset: '15px', | ||
50 | + icon: 7, | ||
51 | + time: 1000, | ||
52 | + }) | ||
53 | + } | ||
54 | + } | ||
55 | + }) | ||
56 | + return false | ||
57 | + } | ||
58 | + | ||
59 | + //页面初始化 | ||
60 | + function init() { | ||
61 | + loadSelect() | ||
62 | + initDatePlus(); | ||
63 | + } | ||
64 | + //初始化日期插件 | ||
65 | + function initDatePlus() { | ||
66 | + allocationTime = laydate.render({ | ||
67 | + elem: '#allocationTime', //指定元素 | ||
68 | + value: new Date(), | ||
69 | + type: 'datetime', | ||
70 | + isInitValue: true, | ||
71 | + }); | ||
72 | + } | ||
73 | + // 初始化下拉框 | ||
74 | + function loadSelect() { | ||
75 | + //绑定业务下拉选择数据 | ||
76 | + common.bizTypeSelect("add-information-ip", function () { | ||
77 | + form.render("select"); | ||
78 | + fromAssignment(); | ||
79 | + }); | ||
80 | + | ||
81 | + | ||
82 | + } | ||
83 | + | ||
84 | + form.verify({ | ||
85 | + account: function(value, item){ | ||
86 | + var max = item.getAttribute('maxlength'); | ||
87 | + if(value.length > max){ | ||
88 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
89 | + } | ||
90 | + } | ||
91 | + }); | ||
92 | + | ||
93 | + | ||
94 | + //表单赋值 | ||
95 | + function fromAssignment() { | ||
96 | + if (data && data.id) { | ||
97 | + var loading =layer.load(2); | ||
98 | + admin.req({ | ||
99 | + url: domainName + `/api-web/informationAsset/findIpById`, | ||
100 | + data: {id: data.id}, | ||
101 | + async: false, | ||
102 | + }).done(function (res) { | ||
103 | + layer.close(loading) | ||
104 | + form.val('add-informationip-form', res.object); | ||
105 | + form.render('select'); | ||
106 | + }) | ||
107 | + }else{ | ||
108 | + form.render('select'); | ||
109 | + } | ||
110 | + } | ||
111 | + | ||
112 | + | ||
113 | + | ||
114 | + | ||
115 | + }) | ||
116 | +}) |
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationMcp', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + | ||
12 | + // 加载查询条件下拉框 | ||
13 | + function loadConditionSelect() { | ||
14 | + //绑定业务下拉选择数据 | ||
15 | + common.bizTypeSelect("slt-information-mcp", function () { | ||
16 | + form.render("select"); | ||
17 | + }); | ||
18 | + } | ||
19 | + //下载 | ||
20 | + $('#mcp_download').on('click', function () { | ||
21 | + var id ='8f5f9fcf89e211ee93f9005056aae0ca'; | ||
22 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
23 | + window.open(url); | ||
24 | + }) | ||
25 | + $("#orgSearchBtn").on("click",function () { | ||
26 | + renderInformationMcpListTable(); | ||
27 | + }); | ||
28 | + $("#mcp_temp_import").on("click", function () { | ||
29 | + var loadIndex = ''; | ||
30 | + var $content = $("#mcp-import-form"); | ||
31 | + layer.open({ | ||
32 | + type: 1 | ||
33 | + , title: '导入小型机分区信息' | ||
34 | + , area: ['600px', '300px'] | ||
35 | + , shade: 0.8 | ||
36 | + , id: 'mcp-import-form-id' //设定一个id,防止重复弹出 | ||
37 | + , btn: ['上传', '取消'] | ||
38 | + , content: $content.html() | ||
39 | + , yes: function (index, layero) { | ||
40 | + if ($("#mcp-display-file-name").val()) { | ||
41 | + loadIndex = layer.load(2); | ||
42 | + uploadFile.upload(); | ||
43 | + } else { | ||
44 | + layer.msg('请选择要导入的文件!', { | ||
45 | + icon: 7, time: 3000 | ||
46 | + }); | ||
47 | + return false; | ||
48 | + } | ||
49 | + } | ||
50 | + }); | ||
51 | + | ||
52 | + var uploadFile = upload.render({ | ||
53 | + elem: '#mcp-display-file-name' | ||
54 | + , url: common.domainName + '/api-web/informationAsset/mcp/importExcel?accessToken=' + accessToken | ||
55 | + , auto: false | ||
56 | + , accept: 'file' | ||
57 | + , exts: 'xlsx|xls' | ||
58 | + , choose: function (obj) { | ||
59 | + this.files = obj.pushFile(); | ||
60 | + //读取本地文件 | ||
61 | + obj.preview(function (index, file, result) { | ||
62 | + $("#mcp-display-file-name").val(file.name); | ||
63 | + }); | ||
64 | + } | ||
65 | + , done: function (res) { | ||
66 | + layer.closeAll(); | ||
67 | + layer.msg('导入成功!', { | ||
68 | + icon: 1, time: 3000 | ||
69 | + }); | ||
70 | + } | ||
71 | + , error: function (res) { | ||
72 | + layer.closeAll(); | ||
73 | + } | ||
74 | + }); | ||
75 | + }); | ||
76 | + $("#btn-mcp-export-excel").on('click', function () { | ||
77 | + var href = common.domainName + "/api-web/informationAsset/exportInformationMcpList?accessToken=" + accessToken + "&busId=" + $("#slt-information-mcp").val(); | ||
78 | + window.open(href) | ||
79 | + }); | ||
80 | + $('#addMcpBtn').on('click', function () { | ||
81 | + openAddMcpForm() | ||
82 | + }); | ||
83 | + | ||
84 | + function openAddMcpForm(id) { | ||
85 | + let title = id ? '编辑' : '新增'; | ||
86 | + common.openWin('informationAsset/mcpAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
87 | + $("#mcp-form-save-id").trigger("click"); | ||
88 | + form.render(); | ||
89 | + }, null, ['90%', '90%'], null, { | ||
90 | + end: function () { | ||
91 | + reloadAllChange(); | ||
92 | + } | ||
93 | + }) | ||
94 | + } | ||
95 | + | ||
96 | + //表格数据 | ||
97 | + function renderInformationMcpListTable() { | ||
98 | + let url = common.domainName + '/api-web/informationAsset/informationMcpList'; | ||
99 | + let conditions = form.val('mcp-index-form'); | ||
100 | + Object.assign(conditions, { | ||
101 | + accessToken: accessToken | ||
102 | + }); | ||
103 | + table.render({ | ||
104 | + elem: '#mcp_table_id', | ||
105 | + url: url, | ||
106 | + where: conditions, | ||
107 | + height: 'full-360', | ||
108 | + page: { | ||
109 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
110 | + theme: '#1E9FFF' | ||
111 | + }, | ||
112 | + end: function (e) { | ||
113 | + form.render() | ||
114 | + }, | ||
115 | + limit: common.limit, | ||
116 | + limits: common.limits, | ||
117 | + even: true, | ||
118 | + cols: [[{ | ||
119 | + type: 'numbers', title: '序号' | ||
120 | + }, { | ||
121 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
122 | + }, { | ||
123 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
124 | + },{ | ||
125 | + field: 'mcpCode', title: '登记编号', align: 'center', | ||
126 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-mcp-code" >{{d.mcpCode}}</span></div>' | ||
127 | + }, { | ||
128 | + field: 'mcCode', title: '所属小型机编号', align: 'center' | ||
129 | + }, { | ||
130 | + field: 'mcpName', title: '分区名称', align: 'center' | ||
131 | + },{ | ||
132 | + field: 'osCode', title: '操作系统编号', align: 'center' | ||
133 | + },{ | ||
134 | + field: 'mcpStatusName', title: '状态', align: 'center' | ||
135 | + } ,{ | ||
136 | + field: 'purpose', title: '用途', align: 'center' | ||
137 | + }, { | ||
138 | + field: 'ip1', title: '网卡1IP地址', align: 'center' | ||
139 | + }, { | ||
140 | + field: 'cpuCount', title: 'CPU数量', align: 'center' | ||
141 | + }, { | ||
142 | + field: 'mem', title: '内存(GB)', align: 'center' | ||
143 | + }, { | ||
144 | + field: 'diskCapacity', title: '磁盘总容量(GB)', align: 'center' | ||
145 | + }, { | ||
146 | + field: 'networkCards', title: '网卡数量', align: 'center' | ||
147 | + }, { | ||
148 | + field: 'hbaCards', title: 'HBA卡数量', align: 'center' | ||
149 | + }, { | ||
150 | + field: 'disks', title: '磁盘数量', align: 'center' | ||
151 | + }, { | ||
152 | + field: 'applyUser', title: '申请人', align: 'center' | ||
153 | + },{ | ||
154 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
155 | + let env = d.env == '1' ?'生产':'预生产'; | ||
156 | + return env; | ||
157 | + } | ||
158 | + }, { | ||
159 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
160 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
161 | + return monitorStatus; | ||
162 | + } | ||
163 | + }, { | ||
164 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
165 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
166 | + return backStatus; | ||
167 | + } | ||
168 | + } | ||
169 | + ]], | ||
170 | + done: function () { | ||
171 | + $('.view-mcp-code').on('click', function () { | ||
172 | + openAddMcpForm($(this).data('id')) | ||
173 | + }) | ||
174 | + } | ||
175 | + }); | ||
176 | + | ||
177 | + } | ||
178 | + | ||
179 | + // 图表,表格重新加载 | ||
180 | + function reloadAllChange() { | ||
181 | + renderInformationMcpListTable(); | ||
182 | + loadConditionSelect(); | ||
183 | + } | ||
184 | + }); | ||
185 | + | ||
186 | +}); |
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationMcpAdd', function (data) { | ||
13 | + var accessToken = common.getMjToken(); | ||
14 | + //渲染表单 | ||
15 | + form.render(null, 'add-informationmcp-form') | ||
16 | + init(); | ||
17 | + | ||
18 | + //保存 | ||
19 | + form.on('submit(mcp-form-save-id)', function (res) { | ||
20 | + saveForm() | ||
21 | + }); | ||
22 | + | ||
23 | + //保存 | ||
24 | + function saveForm() { | ||
25 | + layer.load(2) | ||
26 | + var data = form.val('add-informationmcp-form'); | ||
27 | + admin.req({ | ||
28 | + url: domainName + '/api-web/informationAsset/saveMcp', | ||
29 | + data: JSON.stringify(data), | ||
30 | + type: 'post', | ||
31 | + contentType: "application/json; charset=utf-8", | ||
32 | + done: function (res) { | ||
33 | + if (res.success) { | ||
34 | + layer.msg(res.msg, { | ||
35 | + offset: '15px', | ||
36 | + icon: 1, | ||
37 | + time: 1000, | ||
38 | + }, function () { | ||
39 | + layer.closeAll() | ||
40 | + table.reload('mcp_table_id', { | ||
41 | + where: { | ||
42 | + accessToken: accessToken, | ||
43 | + }, | ||
44 | + }); | ||
45 | + }) | ||
46 | + } else { | ||
47 | + layer.msg(res.msg, { | ||
48 | + offset: '15px', | ||
49 | + icon: 7, | ||
50 | + time: 1000, | ||
51 | + }) | ||
52 | + } | ||
53 | + } | ||
54 | + }) | ||
55 | + return false | ||
56 | + } | ||
57 | + | ||
58 | + //页面初始化 | ||
59 | + function init() { | ||
60 | + loadSelect(); | ||
61 | + } | ||
62 | + // 初始化下拉框 | ||
63 | + function loadSelect() { | ||
64 | + let osurl = `${domainName}/mj/sys/conf/getSelectCN/hostStatus?accessToken=${accessToken}`; | ||
65 | + $.ajax({ | ||
66 | + url: osurl, | ||
67 | + async: false, | ||
68 | + success: function (res) { | ||
69 | + var selects = res.data.options; | ||
70 | + var $sel = $("form#add-informationmcp-form").find("select[name='mcpStatus']"); | ||
71 | + $.each(selects, function (i, e) { | ||
72 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
73 | + }); | ||
74 | + form.render(); | ||
75 | + | ||
76 | + } | ||
77 | + }); | ||
78 | + | ||
79 | + | ||
80 | + let osCodeUrl = `${domainName}/api-web/informationAsset/informationosList?accessToken=${accessToken}`; | ||
81 | + $.ajax({ | ||
82 | + url: osCodeUrl, | ||
83 | + async: false, | ||
84 | + success: function (res) { | ||
85 | + var selects = res.data; | ||
86 | + var $sel = $("form#add-informationmcp-form").find("select[name='osCode']"); | ||
87 | + $.each(selects, function (i, e) { | ||
88 | + $sel.append(`<option value="${e.osCode}"> ${e.osBrand}-${e.osVersion}</option>`) | ||
89 | + }) | ||
90 | + form.render(); | ||
91 | + } | ||
92 | + }); | ||
93 | + //绑定业务下拉选择数据 | ||
94 | + common.bizTypeSelect("add-information-mcp", function () { | ||
95 | + fromAssignment(); | ||
96 | + form.render("select"); | ||
97 | + }); | ||
98 | + | ||
99 | + } | ||
100 | + | ||
101 | + form.verify({ | ||
102 | + account: function(value, item){ | ||
103 | + var max = item.getAttribute('maxlength'); | ||
104 | + if(value.length > max){ | ||
105 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
106 | + } | ||
107 | + } | ||
108 | + }); | ||
109 | + | ||
110 | + | ||
111 | + //表单赋值 | ||
112 | + function fromAssignment() { | ||
113 | + if (data && data.id) { | ||
114 | + var loading =layer.load(2); | ||
115 | + admin.req({ | ||
116 | + url: domainName + `/api-web/informationAsset/findMcpById`, | ||
117 | + data: {id: data.id}, | ||
118 | + async: false, | ||
119 | + }).done(function (res) { | ||
120 | + layer.close(loading) | ||
121 | + form.val('add-informationmcp-form', res.object); | ||
122 | + form.render('select'); | ||
123 | + }) | ||
124 | + }else{ | ||
125 | + form.render('select'); | ||
126 | + } | ||
127 | + } | ||
128 | + | ||
129 | + | ||
130 | + | ||
131 | + | ||
132 | + }) | ||
133 | +}) |
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationMiddleware', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + | ||
12 | + // 加载查询条件下拉框 | ||
13 | + function loadConditionSelect() { | ||
14 | + //绑定业务下拉选择数据 | ||
15 | + common.bizTypeSelect("slt-information-middleware", function () { | ||
16 | + form.render("select"); | ||
17 | + }); | ||
18 | + } | ||
19 | + //下载 | ||
20 | + $('#middleware_download').on('click', function () { | ||
21 | + var id ='14a8c9b7902511ee93f9005056aae0ca'; | ||
22 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
23 | + window.open(url); | ||
24 | + }) | ||
25 | + $("#orgSearchBtn").on("click",function () { | ||
26 | + renderInformationMiddlewareListTable(); | ||
27 | + }); | ||
28 | + $("#middleware_temp_import").on("click", function () { | ||
29 | + var loadIndex = ''; | ||
30 | + var $content = $("#middleware-import-form"); | ||
31 | + layer.open({ | ||
32 | + type: 1 | ||
33 | + , title: '导入应用系统中间件信息' | ||
34 | + , area: ['600px', '300px'] | ||
35 | + , shade: 0.8 | ||
36 | + , id: 'middleware-import-form-id' //设定一个id,防止重复弹出 | ||
37 | + , btn: ['上传', '取消'] | ||
38 | + , content: $content.html() | ||
39 | + , yes: function (index, layero) { | ||
40 | + if ($("#middleware-display-file-name").val()) { | ||
41 | + loadIndex = layer.load(2); | ||
42 | + uploadFile.upload(); | ||
43 | + } else { | ||
44 | + layer.msg('请选择要导入的文件!', { | ||
45 | + icon: 7, time: 3000 | ||
46 | + }); | ||
47 | + return false; | ||
48 | + } | ||
49 | + } | ||
50 | + }); | ||
51 | + | ||
52 | + var uploadFile = upload.render({ | ||
53 | + elem: '#middleware-display-file-name' | ||
54 | + , url: common.domainName + '/api-web/informationAsset/middleware/importExcel?accessToken=' + accessToken | ||
55 | + , auto: false | ||
56 | + , accept: 'file' | ||
57 | + , exts: 'xlsx|xls' | ||
58 | + , choose: function (obj) { | ||
59 | + this.files = obj.pushFile(); | ||
60 | + //读取本地文件 | ||
61 | + obj.preview(function (index, file, result) { | ||
62 | + $("#middleware-display-file-name").val(file.name); | ||
63 | + }); | ||
64 | + } | ||
65 | + , done: function (res) { | ||
66 | + layer.closeAll(); | ||
67 | + layer.msg('导入成功!', { | ||
68 | + icon: 1, time: 3000 | ||
69 | + }); | ||
70 | + } | ||
71 | + , error: function (res) { | ||
72 | + layer.closeAll(); | ||
73 | + } | ||
74 | + }); | ||
75 | + }); | ||
76 | + $("#btn-middleware-export-excel").on('click', function () { | ||
77 | + var href = common.domainName + "/api-web/informationAsset/exportInformationMiddlewareList?accessToken=" + accessToken + "&busId=" + $("#slt-information-middleware").val(); | ||
78 | + window.open(href) | ||
79 | + }); | ||
80 | + $('#addMiddlewareBtn').on('click', function () { | ||
81 | + openAddMiddlewareForm() | ||
82 | + }); | ||
83 | + | ||
84 | + function openAddMiddlewareForm(id) { | ||
85 | + let title = id ? '编辑' : '新增'; | ||
86 | + common.openWin('informationAsset/middlewareAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
87 | + $("#middleware-form-save-id").trigger("click"); | ||
88 | + form.render(); | ||
89 | + }, null, ['90%', '90%'], null, { | ||
90 | + end: function () { | ||
91 | + reloadAllChange(); | ||
92 | + } | ||
93 | + }) | ||
94 | + } | ||
95 | + | ||
96 | + //表格数据 | ||
97 | + function renderInformationMiddlewareListTable() { | ||
98 | + let url = common.domainName + '/api-web/informationAsset/informationMiddlewareList'; | ||
99 | + let conditions = form.val('middleware-index-form'); | ||
100 | + Object.assign(conditions, { | ||
101 | + accessToken: accessToken | ||
102 | + }); | ||
103 | + table.render({ | ||
104 | + elem: '#middleware_table_id', | ||
105 | + url: url, | ||
106 | + where: conditions, | ||
107 | + height: 'full-360', | ||
108 | + page: { | ||
109 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
110 | + theme: '#1E9FFF' | ||
111 | + }, | ||
112 | + end: function (e) { | ||
113 | + form.render() | ||
114 | + }, | ||
115 | + limit: common.limit, | ||
116 | + limits: common.limits, | ||
117 | + even: true, | ||
118 | + cols: [[{ | ||
119 | + type: 'numbers', title: '序号' | ||
120 | + }, { | ||
121 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
122 | + }, { | ||
123 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
124 | + },{ | ||
125 | + field: 'middlewareCode', title: '登记编号', align: 'center', | ||
126 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-middleware-code" >{{d.middlewareCode}}</span></div>' | ||
127 | + }, { | ||
128 | + field: 'middlewareName', title: '应用集群名称', align: 'center' | ||
129 | + }, { | ||
130 | + field: 'appCode', title: '所属应用系统编号', align: 'center' | ||
131 | + },{ | ||
132 | + field: 'purpose', title: '应用集群用途', align: 'center' | ||
133 | + },{ | ||
134 | + field: 'middlewareBrandName', title: '应用中间件品牌', align: 'center' | ||
135 | + } ,{ | ||
136 | + field: 'serviceTypeName', title: '服务类型', align: 'center' | ||
137 | + }, { | ||
138 | + field: 'version', title: '版本', align: 'center' | ||
139 | + }, { | ||
140 | + field: 'nodes', title: '节点数量', align: 'center' | ||
141 | + }, { | ||
142 | + field: 'javaVersion', title: 'JAVA版本', align: 'center' | ||
143 | + }, { | ||
144 | + field: 'nodeAddress', title: '管理节点地址', align: 'center' | ||
145 | + }, { | ||
146 | + field: 'admin', title: '管理人', align: 'center' | ||
147 | + }, { | ||
148 | + field: 'factoryUser', title: '乙方运维人员', align: 'center' | ||
149 | + }, { | ||
150 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
151 | + let env = d.env == '1' ?'生产':'预生产'; | ||
152 | + return env; | ||
153 | + } | ||
154 | + }, { | ||
155 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
156 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
157 | + return monitorStatus; | ||
158 | + } | ||
159 | + }, { | ||
160 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
161 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
162 | + return backStatus; | ||
163 | + } | ||
164 | + } | ||
165 | + ]], | ||
166 | + done: function () { | ||
167 | + $('.view-middleware-code').on('click', function () { | ||
168 | + openAddMiddlewareForm($(this).data('id')) | ||
169 | + }) | ||
170 | + } | ||
171 | + }); | ||
172 | + } | ||
173 | + | ||
174 | + // 图表,表格重新加载 | ||
175 | + function reloadAllChange() { | ||
176 | + renderInformationMiddlewareListTable(); | ||
177 | + loadConditionSelect(); | ||
178 | + } | ||
179 | + }); | ||
180 | + | ||
181 | +}); |
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationMiddlewareAdd', function(data){ | ||
13 | + var accessToken = common.getMjToken(); | ||
14 | + //渲染表单 | ||
15 | + form.render(null, 'add-informationmiddleware-form') | ||
16 | + init(); | ||
17 | + | ||
18 | + //保存 | ||
19 | + form.on('submit(middleware-form-save-id)', function (res) { | ||
20 | + saveForm() | ||
21 | + }); | ||
22 | + | ||
23 | + //保存 | ||
24 | + function saveForm() { | ||
25 | + layer.load(2) | ||
26 | + var data = form.val('add-informationmiddleware-form'); | ||
27 | + admin.req({ | ||
28 | + url: domainName + '/api-web/informationAsset/saveMiddleware', | ||
29 | + data: JSON.stringify(data), | ||
30 | + type: 'post', | ||
31 | + contentType: "application/json; charset=utf-8", | ||
32 | + done: function (res) { | ||
33 | + if (res.success) { | ||
34 | + layer.msg(res.msg, { | ||
35 | + offset: '15px', | ||
36 | + icon: 1, | ||
37 | + time: 1000, | ||
38 | + }, function () { | ||
39 | + layer.closeAll() | ||
40 | + table.reload('middleware_table_id', { | ||
41 | + where: { | ||
42 | + accessToken: accessToken, | ||
43 | + }, | ||
44 | + }); | ||
45 | + }) | ||
46 | + } else { | ||
47 | + layer.msg(res.msg, { | ||
48 | + offset: '15px', | ||
49 | + icon: 7, | ||
50 | + time: 1000, | ||
51 | + }) | ||
52 | + } | ||
53 | + } | ||
54 | + }) | ||
55 | + return false | ||
56 | + } | ||
57 | + | ||
58 | + //页面初始化 | ||
59 | + function init() { | ||
60 | + loadSelect(); | ||
61 | + } | ||
62 | + // 初始化下拉框 | ||
63 | + function loadSelect() { | ||
64 | + let middlewareBrandUrl = `${domainName}/mj/sys/conf/getSelectCN/middlewareBrand?accessToken=${accessToken}`; | ||
65 | + $.ajax({ | ||
66 | + url: middlewareBrandUrl, | ||
67 | + async: false, | ||
68 | + success: function (res) { | ||
69 | + var selects = res.data.options; | ||
70 | + var $sel = $("form#add-informationmiddleware-form").find("select[name='middlewareBrand']"); | ||
71 | + $.each(selects, function (i, e) { | ||
72 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
73 | + }); | ||
74 | + form.render(); | ||
75 | + } | ||
76 | + }); | ||
77 | + | ||
78 | + let typeurl = `${domainName}/mj/sys/conf/getSelectCN/serviceType?accessToken=${accessToken}`; | ||
79 | + $.ajax({ | ||
80 | + url: typeurl, | ||
81 | + async: false, | ||
82 | + success: function (res) { | ||
83 | + var selects = res.data.options; | ||
84 | + var $sel = $("form#add-informationmiddleware-form").find("select[name='serviceType']"); | ||
85 | + $.each(selects, function (i, e) { | ||
86 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
87 | + }); | ||
88 | + form.render(); | ||
89 | + } | ||
90 | + }); | ||
91 | + | ||
92 | + //绑定业务下拉选择数据 | ||
93 | + common.bizTypeSelect("add-information-middleware", function () { | ||
94 | + fromAssignment(); | ||
95 | + form.render("select"); | ||
96 | + }); | ||
97 | + | ||
98 | + } | ||
99 | + | ||
100 | + form.verify({ | ||
101 | + account: function(value, item){ | ||
102 | + var max = item.getAttribute('maxlength'); | ||
103 | + if(value.length > max){ | ||
104 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
105 | + } | ||
106 | + } | ||
107 | + }); | ||
108 | + | ||
109 | + | ||
110 | + //表单赋值 | ||
111 | + function fromAssignment() { | ||
112 | + if (data && data.id) { | ||
113 | + var loading =layer.load(2); | ||
114 | + admin.req({ | ||
115 | + url: domainName + `/api-web/informationAsset/findMiddlewareById`, | ||
116 | + data: {id: data.id}, | ||
117 | + async: false, | ||
118 | + }).done(function (res) { | ||
119 | + layer.close(loading) | ||
120 | + form.val('add-informationmiddleware-form', res.object); | ||
121 | + form.render('select'); | ||
122 | + }) | ||
123 | + }else{ | ||
124 | + form.render('select'); | ||
125 | + } | ||
126 | + } | ||
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | ||
131 | + }) | ||
132 | +}) |
hg-monitor-web-base/src/main/resources/static/src/controller/informationMiddlewareInstance.js
0 → 100644
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationMiddlewareInstance', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + | ||
12 | + // 加载查询条件下拉框 | ||
13 | + function loadConditionSelect() { | ||
14 | + //绑定业务下拉选择数据 | ||
15 | + common.bizTypeSelect("slt-information-middlewareInstance", function () { | ||
16 | + form.render("select"); | ||
17 | + }); | ||
18 | + } | ||
19 | + //下载 | ||
20 | + $('#middlewareInstance_download').on('click', function () { | ||
21 | + var id ='0092ebf593ea11ee8dea005056aae0ca'; | ||
22 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
23 | + window.open(url); | ||
24 | + }) | ||
25 | + $("#orgSearchBtn").on("click",function () { | ||
26 | + renderInformationMiddlewareInstanceListTable(); | ||
27 | + }); | ||
28 | + $("#middlewareInstance_temp_import").on("click", function () { | ||
29 | + var loadIndex = ''; | ||
30 | + var $content = $("#middlewareInstance-import-form"); | ||
31 | + layer.open({ | ||
32 | + type: 1 | ||
33 | + , title: '导入应用系统中间件实例信息' | ||
34 | + , area: ['600px', '300px'] | ||
35 | + , shade: 0.8 | ||
36 | + , id: 'middlewareInstance-import-form-id' //设定一个id,防止重复弹出 | ||
37 | + , btn: ['上传', '取消'] | ||
38 | + , content: $content.html() | ||
39 | + , yes: function (index, layero) { | ||
40 | + if ($("#middlewareInstance-display-file-name").val()) { | ||
41 | + loadIndex = layer.load(2); | ||
42 | + uploadFile.upload(); | ||
43 | + } else { | ||
44 | + layer.msg('请选择要导入的文件!', { | ||
45 | + icon: 7, time: 3000 | ||
46 | + }); | ||
47 | + return false; | ||
48 | + } | ||
49 | + } | ||
50 | + }); | ||
51 | + | ||
52 | + var uploadFile = upload.render({ | ||
53 | + elem: '#middlewareInstance-display-file-name' | ||
54 | + , url: common.domainName + '/api-web/informationAsset/middlewareInstance/importExcel?accessToken=' + accessToken | ||
55 | + , auto: false | ||
56 | + , accept: 'file' | ||
57 | + , exts: 'xlsx|xls' | ||
58 | + , choose: function (obj) { | ||
59 | + this.files = obj.pushFile(); | ||
60 | + //读取本地文件 | ||
61 | + obj.preview(function (index, file, result) { | ||
62 | + $("#middlewareInstance-display-file-name").val(file.name); | ||
63 | + }); | ||
64 | + } | ||
65 | + , done: function (res) { | ||
66 | + layer.closeAll(); | ||
67 | + layer.msg('导入成功!', { | ||
68 | + icon: 1, time: 3000 | ||
69 | + }); | ||
70 | + } | ||
71 | + , error: function (res) { | ||
72 | + layer.closeAll(); | ||
73 | + } | ||
74 | + }); | ||
75 | + }); | ||
76 | + $("#btn-middlewareInstance-export-excel").on('click', function () { | ||
77 | + var href = common.domainName + "/api-web/informationAsset/exportInformationMiddlewareInstanceList?accessToken=" + accessToken + "&busId=" + $("#slt-information-middlewareInstance").val(); | ||
78 | + window.open(href) | ||
79 | + }); | ||
80 | + $('#addMiddlewareInstanceBtn').on('click', function () { | ||
81 | + openAddMiddlewareInstanceForm() | ||
82 | + }); | ||
83 | + | ||
84 | + function openAddMiddlewareInstanceForm(id) { | ||
85 | + let title = id ? '编辑' : '新增'; | ||
86 | + common.openWin('informationAsset/middlewareInstanceAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
87 | + $("#middlewareInstance-form-save-id").trigger("click"); | ||
88 | + form.render(); | ||
89 | + }, null, ['90%', '90%'], null, { | ||
90 | + end: function () { | ||
91 | + reloadAllChange(); | ||
92 | + } | ||
93 | + }) | ||
94 | + } | ||
95 | + | ||
96 | + //表格数据 | ||
97 | + function renderInformationMiddlewareInstanceListTable() { | ||
98 | + let url = common.domainName + '/api-web/informationAsset/informationMiddlewareInstanceList'; | ||
99 | + let conditions = form.val('middlewareInstance-index-form'); | ||
100 | + Object.assign(conditions, { | ||
101 | + accessToken: accessToken | ||
102 | + }); | ||
103 | + table.render({ | ||
104 | + elem: '#middlewareInstance_table_id', | ||
105 | + url: url, | ||
106 | + where: conditions, | ||
107 | + height: 'full-360', | ||
108 | + page: { | ||
109 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
110 | + theme: '#1E9FFF' | ||
111 | + }, | ||
112 | + end: function (e) { | ||
113 | + form.render() | ||
114 | + }, | ||
115 | + limit: common.limit, | ||
116 | + limits: common.limits, | ||
117 | + even: true, | ||
118 | + cols: [[{ | ||
119 | + type: 'numbers', title: '序号' | ||
120 | + }, { | ||
121 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
122 | + }, { | ||
123 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
124 | + },{ | ||
125 | + field: 'mwiCode', title: '登记编号', align: 'center', | ||
126 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-middlewareInstance-code" >{{d.mwiCode}}</span></div>' | ||
127 | + }, { | ||
128 | + field: 'middlewareCode', title: '所属应用集群编号', align: 'center' | ||
129 | + }, { | ||
130 | + field: 'nodeCode', title: '节点编号', align: 'center' | ||
131 | + },{ | ||
132 | + field: 'nodesName', title: '节点名称', align: 'center' | ||
133 | + },{ | ||
134 | + field: 'osIp', title: '操作系统IP地址', align: 'center' | ||
135 | + },{ | ||
136 | + field: 'nodeFunction', title: '节点功能', align: 'center' | ||
137 | + } , { | ||
138 | + field: 'resTypeName', title: '资源类型', align: 'center' | ||
139 | + }, { | ||
140 | + field: 'resCode', title: '所属资源编号', align: 'center' | ||
141 | + }, { | ||
142 | + field: 'port', title: '服务端口', align: 'center' | ||
143 | + }, { | ||
144 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
145 | + let env = d.env == '1' ?'生产':'预生产'; | ||
146 | + return env; | ||
147 | + } | ||
148 | + }, { | ||
149 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
150 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
151 | + return monitorStatus; | ||
152 | + } | ||
153 | + }, { | ||
154 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
155 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
156 | + return backStatus; | ||
157 | + } | ||
158 | + } | ||
159 | + ]], | ||
160 | + done: function () { | ||
161 | + $('.view-middlewareInstance-code').on('click', function () { | ||
162 | + openAddMiddlewareInstanceForm($(this).data('id')) | ||
163 | + }) | ||
164 | + } | ||
165 | + }); | ||
166 | + } | ||
167 | + | ||
168 | + // 图表,表格重新加载 | ||
169 | + function reloadAllChange() { | ||
170 | + renderInformationMiddlewareInstanceListTable(); | ||
171 | + loadConditionSelect(); | ||
172 | + } | ||
173 | + }); | ||
174 | + | ||
175 | +}); |
hg-monitor-web-base/src/main/resources/static/src/controller/informationMiddlewareInstanceAdd.js
0 → 100644
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationMiddlewareInstanceAdd', function(data){ | ||
13 | + var accessToken = common.getMjToken(); | ||
14 | + //渲染表单 | ||
15 | + form.render(null, 'add-informationmiddlewareInstance-form') | ||
16 | + init(); | ||
17 | + | ||
18 | + //保存 | ||
19 | + form.on('submit(middlewareInstance-form-save-id)', function (res) { | ||
20 | + saveForm() | ||
21 | + }); | ||
22 | + | ||
23 | + //保存 | ||
24 | + function saveForm() { | ||
25 | + layer.load(2) | ||
26 | + var data = form.val('add-informationmiddlewareInstance-form'); | ||
27 | + admin.req({ | ||
28 | + url: domainName + '/api-web/informationAsset/saveMiddlewareInstance', | ||
29 | + data: JSON.stringify(data), | ||
30 | + type: 'post', | ||
31 | + contentType: "application/json; charset=utf-8", | ||
32 | + done: function (res) { | ||
33 | + if (res.success) { | ||
34 | + layer.msg(res.msg, { | ||
35 | + offset: '15px', | ||
36 | + icon: 1, | ||
37 | + time: 1000, | ||
38 | + }, function () { | ||
39 | + layer.closeAll() | ||
40 | + table.reload('middlewareInstance_table_id', { | ||
41 | + where: { | ||
42 | + accessToken: accessToken, | ||
43 | + }, | ||
44 | + }); | ||
45 | + }) | ||
46 | + } else { | ||
47 | + layer.msg(res.msg, { | ||
48 | + offset: '15px', | ||
49 | + icon: 7, | ||
50 | + time: 1000, | ||
51 | + }) | ||
52 | + } | ||
53 | + } | ||
54 | + }) | ||
55 | + return false | ||
56 | + } | ||
57 | + | ||
58 | + //页面初始化 | ||
59 | + function init() { | ||
60 | + loadSelect(); | ||
61 | + } | ||
62 | + // 初始化下拉框 | ||
63 | + function loadSelect() { | ||
64 | + let typeurl = `${domainName}/mj/sys/conf/getSelectCN/insResType?accessToken=${accessToken}`; | ||
65 | + $.ajax({ | ||
66 | + url: typeurl, | ||
67 | + async: false, | ||
68 | + success: function (res) { | ||
69 | + var selects = res.data.options; | ||
70 | + var $sel = $("form#add-informationmiddlewareInstance-form").find("select[name='resType']"); | ||
71 | + $.each(selects, function (i, e) { | ||
72 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
73 | + }); | ||
74 | + form.render(); | ||
75 | + } | ||
76 | + }); | ||
77 | + let middlewareCodeUrl = `${domainName}/api-web/informationAsset/informationMiddlewareList?accessToken=${accessToken}`; | ||
78 | + $.ajax({ | ||
79 | + url: middlewareCodeUrl, | ||
80 | + async: false, | ||
81 | + success: function (res) { | ||
82 | + var selects = res.data; | ||
83 | + var $sel = $("form#add-informationdbInstance-form").find("select[name='middlewareCode']"); | ||
84 | + $.each(selects, function (i, e) { | ||
85 | + $sel.append(`<option value="${e.middlewareCode}"> ${e.middlewareName}</option>`) | ||
86 | + }) | ||
87 | + form.render(); | ||
88 | + } | ||
89 | + }); | ||
90 | + //绑定业务下拉选择数据 | ||
91 | + common.bizTypeSelect("add-information-middlewareInstance", function () { | ||
92 | + fromAssignment(); | ||
93 | + form.render("select"); | ||
94 | + }); | ||
95 | + | ||
96 | + } | ||
97 | + | ||
98 | + form.verify({ | ||
99 | + account: function(value, item){ | ||
100 | + var max = item.getAttribute('maxlength'); | ||
101 | + if(value.length > max){ | ||
102 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
103 | + } | ||
104 | + } | ||
105 | + }); | ||
106 | + | ||
107 | + | ||
108 | + //表单赋值 | ||
109 | + function fromAssignment() { | ||
110 | + if (data && data.id) { | ||
111 | + var loading =layer.load(2); | ||
112 | + admin.req({ | ||
113 | + url: domainName + `/api-web/informationAsset/findMiddlewareInstanceById`, | ||
114 | + data: {id: data.id}, | ||
115 | + async: false, | ||
116 | + }).done(function (res) { | ||
117 | + layer.close(loading) | ||
118 | + form.val('add-informationmiddlewareInstance-form', res.object); | ||
119 | + form.render('select'); | ||
120 | + }) | ||
121 | + }else{ | ||
122 | + form.render('select'); | ||
123 | + } | ||
124 | + } | ||
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | ||
129 | + }) | ||
130 | +}) |
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationOsAdd', function (data) { | ||
13 | + var accessToken = common.getMjToken(); | ||
14 | + | ||
15 | + //渲染表单 | ||
16 | + form.render(null, 'add-informationos-form') | ||
17 | + init(); | ||
18 | + | ||
19 | + //保存 | ||
20 | + form.on('submit(os-form-save-id)', function (res) { | ||
21 | + saveForm() | ||
22 | + }); | ||
23 | + | ||
24 | + //保存 | ||
25 | + function saveForm() { | ||
26 | + layer.load(2) | ||
27 | + var data = form.val('add-informationos-form'); | ||
28 | + admin.req({ | ||
29 | + url: domainName + '/api-web/informationAsset/saveOs', | ||
30 | + data: JSON.stringify(data), | ||
31 | + type: 'post', | ||
32 | + contentType: "application/json; charset=utf-8", | ||
33 | + done: function (res) { | ||
34 | + if (res.success) { | ||
35 | + layer.msg(res.msg, { | ||
36 | + offset: '15px', | ||
37 | + icon: 1, | ||
38 | + time: 1000, | ||
39 | + }, function () { | ||
40 | + layer.closeAll() | ||
41 | + table.reload('os_table_id', { | ||
42 | + where: { | ||
43 | + accessToken: accessToken, | ||
44 | + }, | ||
45 | + }); | ||
46 | + }) | ||
47 | + } else { | ||
48 | + layer.msg(res.msg, { | ||
49 | + offset: '15px', | ||
50 | + icon: 7, | ||
51 | + time: 1000, | ||
52 | + }) | ||
53 | + } | ||
54 | + } | ||
55 | + }) | ||
56 | + return false | ||
57 | + } | ||
58 | + | ||
59 | + //页面初始化 | ||
60 | + function init() { | ||
61 | + loadSelect() | ||
62 | + | ||
63 | + } | ||
64 | + | ||
65 | + // 初始化下拉框 | ||
66 | + function loadSelect() { | ||
67 | + let osurl = `${domainName}/mj/sys/conf/getSelectCN/os?accessToken=${accessToken}`; | ||
68 | + $.ajax({ | ||
69 | + url: osurl, | ||
70 | + async: false, | ||
71 | + success: function (res) { | ||
72 | + var selects = res.data.options; | ||
73 | + var $sel = $("form#add-informationos-form").find("select[name='osBrand']"); | ||
74 | + $.each(selects, function (i, e) { | ||
75 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
76 | + }); | ||
77 | + | ||
78 | + form.render(); | ||
79 | + } | ||
80 | + }); | ||
81 | + let serviceTypeUrl = `${domainName}/mj/sys/conf/getSelectCN/serviceType?accessToken=${accessToken}`; | ||
82 | + $.ajax({ | ||
83 | + url: serviceTypeUrl, | ||
84 | + async: false, | ||
85 | + success: function (res) { | ||
86 | + var selects = res.data.options; | ||
87 | + var $sel = $("form#add-informationos-form").find("select[name='serviceType']"); | ||
88 | + $.each(selects, function (i, e) { | ||
89 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
90 | + }) | ||
91 | + form.render(); | ||
92 | + } | ||
93 | + }); | ||
94 | + let deviceTypeUrl = `${domainName}/mj/sys/conf/getSelectCN/deviceType?accessToken=${accessToken}`; | ||
95 | + $.ajax({ | ||
96 | + url: deviceTypeUrl, | ||
97 | + async: false, | ||
98 | + success: function (res) { | ||
99 | + var selects = res.data.options; | ||
100 | + var $sel = $("form#add-informationos-form").find("select[name='deviceType']"); | ||
101 | + $.each(selects, function (i, e) { | ||
102 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
103 | + }) | ||
104 | + form.render(); | ||
105 | + | ||
106 | + } | ||
107 | + }); | ||
108 | + //绑定业务下拉选择数据 | ||
109 | + common.bizTypeSelect("add-information-os", function () { | ||
110 | + | ||
111 | + form.render("select"); | ||
112 | + }); | ||
113 | + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`; | ||
114 | + $.ajax({ | ||
115 | + url: url, | ||
116 | + success: function (res) { | ||
117 | + var options = "<option value=''>申请单位</option>"; | ||
118 | + $.each(res.data, function (i, v) { | ||
119 | + options += "<option value='" + v.id + "'>" + v.shortName + "</option>" | ||
120 | + }); | ||
121 | + options += "<option value='0'>其他</option>"; | ||
122 | + $('#factoryId').html(options); | ||
123 | + form.render(); | ||
124 | + fromAssignment(); | ||
125 | + } | ||
126 | + }); | ||
127 | + | ||
128 | + } | ||
129 | + | ||
130 | + form.verify({ | ||
131 | + account: function(value, item){ | ||
132 | + var max = item.getAttribute('maxlength'); | ||
133 | + if(value.length > max){ | ||
134 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
135 | + } | ||
136 | + } | ||
137 | + }); | ||
138 | + | ||
139 | + | ||
140 | + //表单赋值 | ||
141 | + function fromAssignment() { | ||
142 | + if (data && data.id) { | ||
143 | + var loading =layer.load(2); | ||
144 | + admin.req({ | ||
145 | + url: domainName + `/api-web/informationAsset/findOsById`, | ||
146 | + data: {id: data.id}, | ||
147 | + async: false, | ||
148 | + }).done(function (res) { | ||
149 | + layer.close(loading) | ||
150 | + form.val('add-informationos-form', res.object); | ||
151 | + form.render('select'); | ||
152 | + }) | ||
153 | + }else{ | ||
154 | + form.render('select'); | ||
155 | + } | ||
156 | + } | ||
157 | + | ||
158 | + | ||
159 | + | ||
160 | + | ||
161 | + }) | ||
162 | +}) |
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationOthersoftware', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + //发送状态 | ||
12 | + // 下拉框改变搜索 | ||
13 | + //form.on('select(slt-information-othersoftware)', reloadAllChange); | ||
14 | + | ||
15 | + // 加载查询条件下拉框 | ||
16 | + function loadConditionSelect() { | ||
17 | + //绑定业务下拉选择数据 | ||
18 | + common.bizTypeSelect("slt-information-othersoftware", function () { | ||
19 | + form.render("select"); | ||
20 | + }); | ||
21 | + } | ||
22 | + //下载 | ||
23 | + $('#othersoftware_download').on('click', function () { | ||
24 | + var id ='a30fc4b993ea11ee8dea005056aae0ca'; | ||
25 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
26 | + window.open(url); | ||
27 | + }) | ||
28 | + $("#orgSearchBtn").on("click",function () { | ||
29 | + renderInformationOthersoftwareListTable(); | ||
30 | + }); | ||
31 | + $("#othersoftware_temp_import").on("click", function () { | ||
32 | + var loadIndex = ''; | ||
33 | + var $content = $("#othersoftware-import-form"); | ||
34 | + layer.open({ | ||
35 | + type: 1 | ||
36 | + , title: '导入其他软件信息' | ||
37 | + , area: ['600px', '300px'] | ||
38 | + , shade: 0.8 | ||
39 | + , id: 'othersoftware-import-form-id' //设定一个id,防止重复弹出 | ||
40 | + , btn: ['上传', '取消'] | ||
41 | + , content: $content.html() | ||
42 | + , yes: function (index, layero) { | ||
43 | + if ($("#othersoftware-display-file-name").val()) { | ||
44 | + loadIndex = layer.load(2); | ||
45 | + uploadFile.upload(); | ||
46 | + } else { | ||
47 | + layer.msg('请选择要导入的文件!', { | ||
48 | + icon: 7, time: 3000 | ||
49 | + }); | ||
50 | + return false; | ||
51 | + } | ||
52 | + } | ||
53 | + }); | ||
54 | + | ||
55 | + var uploadFile = upload.render({ | ||
56 | + elem: '#othersoftware-display-file-name' | ||
57 | + , url: common.domainName + '/api-web/informationAsset/othersoftware/importExcel?accessToken=' + accessToken | ||
58 | + , auto: false | ||
59 | + , accept: 'file' | ||
60 | + , exts: 'xlsx|xls' | ||
61 | + , choose: function (obj) { | ||
62 | + this.files = obj.pushFile(); | ||
63 | + //读取本地文件 | ||
64 | + obj.preview(function (index, file, result) { | ||
65 | + $("#othersoftware-display-file-name").val(file.name); | ||
66 | + }); | ||
67 | + } | ||
68 | + , done: function (res) { | ||
69 | + layer.closeAll(); | ||
70 | + layer.msg('导入成功!', { | ||
71 | + icon: 1, time: 3000 | ||
72 | + }); | ||
73 | + } | ||
74 | + , error: function (res) { | ||
75 | + layer.closeAll(); | ||
76 | + } | ||
77 | + }); | ||
78 | + }); | ||
79 | + $("#btn-othersoftware-export-excel").on('click', function () { | ||
80 | + var href = common.domainName + "/api-web/informationAsset/exportInformatioOthersoftwareList?accessToken=" + accessToken + "&busId=" + $("#slt-information-othersoftware").val(); | ||
81 | + window.open(href) | ||
82 | + }); | ||
83 | + $('#addOthersoftwareBtn').on('click', function () { | ||
84 | + openAddOthersoftwareForm() | ||
85 | + }); | ||
86 | + | ||
87 | + function openAddOthersoftwareForm(id) { | ||
88 | + let title = id ? '编辑' : '新增'; | ||
89 | + common.openWin('informationAsset/othersoftwareAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
90 | + $("#othersoftware-form-save-id").trigger("click"); | ||
91 | + form.render(); | ||
92 | + }, null, ['90%', '90%'], null, { | ||
93 | + end: function () { | ||
94 | + reloadAllChange(); | ||
95 | + } | ||
96 | + }) | ||
97 | + } | ||
98 | + | ||
99 | + //表格数据 | ||
100 | + function renderInformationOthersoftwareListTable(){ | ||
101 | + let url = common.domainName + '/api-web/informationAsset/informationOthersoftwareList'; | ||
102 | + let conditions = form.val('othersoftware-index-form'); | ||
103 | + Object.assign(conditions, { | ||
104 | + accessToken: accessToken | ||
105 | + }); | ||
106 | + table.render({ | ||
107 | + elem: '#othersoftware_table_id', | ||
108 | + url: url, | ||
109 | + where: conditions, | ||
110 | + height: 'full-360', | ||
111 | + page: { | ||
112 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
113 | + theme: '#1E9FFF' | ||
114 | + }, | ||
115 | + end: function (e) { | ||
116 | + form.render() | ||
117 | + }, | ||
118 | + limit: common.limit, | ||
119 | + limits: common.limits, | ||
120 | + even: true, | ||
121 | + cols: [[{ | ||
122 | + type: 'numbers', title: '序号' | ||
123 | + }, { | ||
124 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
125 | + }, { | ||
126 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
127 | + },{ | ||
128 | + field: 'othCode', title: '登记编号', align: 'center', | ||
129 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-othersoftware-code" >{{d.othCode}}</span></div>' | ||
130 | + }, { | ||
131 | + field: 'appCode', title: '所属应用系统编号', align: 'center' | ||
132 | + }, { | ||
133 | + field: 'softCode', title: '软件编号', align: 'center' | ||
134 | + },{ | ||
135 | + field: 'softName', title: '软件名称', align: 'center' | ||
136 | + },{ | ||
137 | + field: 'manageIp', title: '管理IP', align: 'center' | ||
138 | + } ,{ | ||
139 | + field: 'softTypeName', title: '软件类型', align: 'center' | ||
140 | + }, { | ||
141 | + field: 'softBrandName', title: '品牌', align: 'center' | ||
142 | + }, { | ||
143 | + field: 'version', title: '版本', align: 'center' | ||
144 | + }, { | ||
145 | + field: 'manageUrl', title: '管理URL', align: 'center' | ||
146 | + }, { | ||
147 | + field: 'serviceTypeName', title: '服务类型', align: 'center' | ||
148 | + }, { | ||
149 | + field: 'nodes', title: '节点数量', align: 'center' | ||
150 | + }, { | ||
151 | + field: 'softPurpose', title: '软件用途', align: 'center' | ||
152 | + }, { | ||
153 | + field: 'admin', title: '管理人', align: 'center' | ||
154 | + }, { | ||
155 | + field: 'factoryUser', title: '乙方运维人员', align: 'center' | ||
156 | + }, { | ||
157 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
158 | + let env = d.env == '1' ?'生产':'预生产'; | ||
159 | + return env; | ||
160 | + } | ||
161 | + }, { | ||
162 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
163 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
164 | + return monitorStatus; | ||
165 | + } | ||
166 | + }, { | ||
167 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
168 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
169 | + return backStatus; | ||
170 | + } | ||
171 | + } | ||
172 | + ]], | ||
173 | + done: function () { | ||
174 | + $('.view-othersoftware-code').on('click', function () { | ||
175 | + openAddOthersoftwareForm($(this).data('id')) | ||
176 | + }) | ||
177 | + } | ||
178 | + }); | ||
179 | + | ||
180 | + } | ||
181 | + | ||
182 | + // 图表,表格重新加载 | ||
183 | + function reloadAllChange() { | ||
184 | + renderInformationOthersoftwareListTable(); | ||
185 | + loadConditionSelect(); | ||
186 | + } | ||
187 | + }); | ||
188 | + | ||
189 | +}); |
hg-monitor-web-base/src/main/resources/static/src/controller/informationOthersoftwareAdd.js
0 → 100644
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationOthersoftwareAdd', function(data){ | ||
13 | + var accessToken = common.getMjToken(); | ||
14 | + //渲染表单 | ||
15 | + form.render(null, 'add-informationothersoftware-form') | ||
16 | + init(); | ||
17 | + | ||
18 | + //保存 | ||
19 | + form.on('submit(othersoftware-form-save-id)', function (res) { | ||
20 | + saveForm() | ||
21 | + }); | ||
22 | + | ||
23 | + //保存 | ||
24 | + function saveForm() { | ||
25 | + layer.load(2) | ||
26 | + var data = form.val('add-informationothersoftware-form'); | ||
27 | + admin.req({ | ||
28 | + url: domainName + '/api-web/informationAsset/saveOthersoftware', | ||
29 | + data: JSON.stringify(data), | ||
30 | + type: 'post', | ||
31 | + contentType: "application/json; charset=utf-8", | ||
32 | + done: function (res) { | ||
33 | + if (res.success) { | ||
34 | + layer.msg(res.msg, { | ||
35 | + offset: '15px', | ||
36 | + icon: 1, | ||
37 | + time: 1000, | ||
38 | + }, function () { | ||
39 | + layer.closeAll() | ||
40 | + table.reload('othersoftware_table_id', { | ||
41 | + where: { | ||
42 | + accessToken: accessToken, | ||
43 | + }, | ||
44 | + }); | ||
45 | + }) | ||
46 | + } else { | ||
47 | + layer.msg(res.msg, { | ||
48 | + offset: '15px', | ||
49 | + icon: 7, | ||
50 | + time: 1000, | ||
51 | + }) | ||
52 | + } | ||
53 | + } | ||
54 | + }) | ||
55 | + return false | ||
56 | + } | ||
57 | + | ||
58 | + //页面初始化 | ||
59 | + function init() { | ||
60 | + loadSelect(); | ||
61 | + } | ||
62 | + // 初始化下拉框 | ||
63 | + function loadSelect() { | ||
64 | + let softBrandUrl = `${domainName}/mj/sys/conf/getSelectCN/softBrand?accessToken=${accessToken}`; | ||
65 | + $.ajax({ | ||
66 | + url: softBrandUrl, | ||
67 | + async: false, | ||
68 | + success: function (res) { | ||
69 | + var selects = res.data.options; | ||
70 | + var $sel = $("form#add-informationothersoftware-form").find("select[name='softBrand']"); | ||
71 | + $.each(selects, function (i, e) { | ||
72 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
73 | + }); | ||
74 | + form.render(); | ||
75 | + } | ||
76 | + }); | ||
77 | + | ||
78 | + let typeurl = `${domainName}/mj/sys/conf/getSelectCN/serviceType?accessToken=${accessToken}`; | ||
79 | + $.ajax({ | ||
80 | + url: typeurl, | ||
81 | + async: false, | ||
82 | + success: function (res) { | ||
83 | + var selects = res.data.options; | ||
84 | + var $sel = $("form#add-informationothersoftware-form").find("select[name='serviceType']"); | ||
85 | + $.each(selects, function (i, e) { | ||
86 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
87 | + }); | ||
88 | + form.render(); | ||
89 | + } | ||
90 | + }); | ||
91 | + let softTypeurl = `${domainName}/mj/sys/conf/getSelectCN/softType?accessToken=${accessToken}`; | ||
92 | + $.ajax({ | ||
93 | + url: softTypeurl, | ||
94 | + async: false, | ||
95 | + success: function (res) { | ||
96 | + var selects = res.data.options; | ||
97 | + var $sel = $("form#add-informationothersoftware-form").find("select[name='softType']"); | ||
98 | + $.each(selects, function (i, e) { | ||
99 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
100 | + }); | ||
101 | + form.render(); | ||
102 | + } | ||
103 | + }); | ||
104 | + //绑定业务下拉选择数据 | ||
105 | + common.bizTypeSelect("add-information-othersoftware", function () { | ||
106 | + fromAssignment(); | ||
107 | + form.render("select"); | ||
108 | + }); | ||
109 | + | ||
110 | + } | ||
111 | + | ||
112 | + form.verify({ | ||
113 | + account: function(value, item){ | ||
114 | + var max = item.getAttribute('maxlength'); | ||
115 | + if(value.length > max){ | ||
116 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
117 | + } | ||
118 | + } | ||
119 | + }); | ||
120 | + | ||
121 | + | ||
122 | + //表单赋值 | ||
123 | + function fromAssignment() { | ||
124 | + if (data && data.id) { | ||
125 | + var loading =layer.load(2); | ||
126 | + admin.req({ | ||
127 | + url: domainName + `/api-web/informationAsset/findOthersoftwareById`, | ||
128 | + data: {id: data.id}, | ||
129 | + async: false, | ||
130 | + }).done(function (res) { | ||
131 | + layer.close(loading) | ||
132 | + form.val('add-informationothersoftware-form', res.object); | ||
133 | + form.render('select'); | ||
134 | + }) | ||
135 | + }else{ | ||
136 | + form.render('select'); | ||
137 | + } | ||
138 | + } | ||
139 | + | ||
140 | + | ||
141 | + | ||
142 | + | ||
143 | + }) | ||
144 | +}) |
hg-monitor-web-base/src/main/resources/static/src/controller/informationOthersoftwareInstance.js
0 → 100644
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationOthersoftwareInstance', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + //发送状态 | ||
12 | + // 下拉框改变搜索 | ||
13 | + //form.on('select(slt-information-othersoftwareInstance)', reloadAllChange); | ||
14 | + | ||
15 | + // 加载查询条件下拉框 | ||
16 | + function loadConditionSelect() { | ||
17 | + //绑定业务下拉选择数据 | ||
18 | + common.bizTypeSelect("slt-information-othersoftwareInstance", function () { | ||
19 | + form.render("select"); | ||
20 | + }); | ||
21 | + } | ||
22 | + //下载 | ||
23 | + $('#othersoftwareInstance_download').on('click', function () { | ||
24 | + var id ='4d36ba6e93eb11ee8dea005056aae0ca'; | ||
25 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
26 | + window.open(url); | ||
27 | + }) | ||
28 | + $("#orgSearchBtn").on("click",function () { | ||
29 | + renderInformationOthersoftwareInstanceListTable(); | ||
30 | + }); | ||
31 | + $("#othersoftwareInstance_temp_import").on("click", function () { | ||
32 | + var loadIndex = ''; | ||
33 | + var $content = $("#othersoftwareInstance-import-form"); | ||
34 | + layer.open({ | ||
35 | + type: 1 | ||
36 | + , title: '导入其他软件实例信息' | ||
37 | + , area: ['600px', '300px'] | ||
38 | + , shade: 0.8 | ||
39 | + , id: 'othersoftwareInstance-import-form-id' //设定一个id,防止重复弹出 | ||
40 | + , btn: ['上传', '取消'] | ||
41 | + , content: $content.html() | ||
42 | + , yes: function (index, layero) { | ||
43 | + if ($("#othersoftwareInstance-display-file-name").val()) { | ||
44 | + loadIndex = layer.load(2); | ||
45 | + uploadFile.upload(); | ||
46 | + } else { | ||
47 | + layer.msg('请选择要导入的文件!', { | ||
48 | + icon: 7, time: 3000 | ||
49 | + }); | ||
50 | + return false; | ||
51 | + } | ||
52 | + } | ||
53 | + }); | ||
54 | + | ||
55 | + var uploadFile = upload.render({ | ||
56 | + elem: '#othersoftwareInstance-display-file-name' | ||
57 | + , url: common.domainName + '/api-web/informationAsset/othersoftwareInstance/importExcel?accessToken=' + accessToken | ||
58 | + , auto: false | ||
59 | + , accept: 'file' | ||
60 | + , exts: 'xlsx|xls' | ||
61 | + , choose: function (obj) { | ||
62 | + this.files = obj.pushFile(); | ||
63 | + //读取本地文件 | ||
64 | + obj.preview(function (index, file, result) { | ||
65 | + $("#othersoftwareInstance-display-file-name").val(file.name); | ||
66 | + }); | ||
67 | + } | ||
68 | + , done: function (res) { | ||
69 | + layer.closeAll(); | ||
70 | + layer.msg('导入成功!', { | ||
71 | + icon: 1, time: 3000 | ||
72 | + }); | ||
73 | + } | ||
74 | + , error: function (res) { | ||
75 | + layer.closeAll(); | ||
76 | + } | ||
77 | + }); | ||
78 | + }); | ||
79 | + $("#btn-othersoftwareInstance-export-excel").on('click', function () { | ||
80 | + var href = common.domainName + "/api-web/informationAsset/exportInformatioOthersoftwareInstanceList?accessToken=" + accessToken + "&busId=" + $("#slt-information-othersoftwareInstance").val(); | ||
81 | + window.open(href) | ||
82 | + }); | ||
83 | + $('#addOthersoftwareInstanceBtn').on('click', function () { | ||
84 | + openAddOthersoftwareInstanceForm() | ||
85 | + }); | ||
86 | + | ||
87 | + function openAddOthersoftwareInstanceForm(id) { | ||
88 | + let title = id ? '编辑' : '新增'; | ||
89 | + common.openWin('informationAsset/othersoftwareInstanceAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
90 | + $("#othersoftwareInstance-form-save-id").trigger("click"); | ||
91 | + form.render(); | ||
92 | + }, null, ['90%', '90%'], null, { | ||
93 | + end: function () { | ||
94 | + reloadAllChange(); | ||
95 | + } | ||
96 | + }) | ||
97 | + } | ||
98 | + | ||
99 | + //表格数据 | ||
100 | + function renderInformationOthersoftwareInstanceListTable() { | ||
101 | + let url = common.domainName + '/api-web/informationAsset/informationOthersoftwareInstanceList'; | ||
102 | + let conditions = form.val('othersoftwareInstance-index-form'); | ||
103 | + Object.assign(conditions, { | ||
104 | + accessToken: accessToken | ||
105 | + }); | ||
106 | + table.render({ | ||
107 | + elem: '#othersoftwareInstance_table_id', | ||
108 | + url: url, | ||
109 | + where: conditions, | ||
110 | + height: 'full-360', | ||
111 | + page: { | ||
112 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
113 | + theme: '#1E9FFF' | ||
114 | + }, | ||
115 | + end: function (e) { | ||
116 | + form.render() | ||
117 | + }, | ||
118 | + limit: common.limit, | ||
119 | + limits: common.limits, | ||
120 | + even: true, | ||
121 | + cols: [[{ | ||
122 | + type: 'numbers', title: '序号' | ||
123 | + }, { | ||
124 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
125 | + }, { | ||
126 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
127 | + },{ | ||
128 | + field: 'othiCode', title: '登记编号', align: 'center', | ||
129 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-othersoftwareInstance-code" >{{d.othiCode}}</span></div>' | ||
130 | + }, { | ||
131 | + field: 'othCode', title: '所属其他软件编号', align: 'center' | ||
132 | + }, { | ||
133 | + field: 'nodeCode', title: '实例编号', align: 'center' | ||
134 | + },{ | ||
135 | + field: 'nodesName', title: '实例名称', align: 'center' | ||
136 | + },{ | ||
137 | + field: 'osIp', title: '操作系统IP地址', align: 'center' | ||
138 | + },{ | ||
139 | + field: 'nodeFunction', title: '实例功能', align: 'center' | ||
140 | + } , { | ||
141 | + field: 'resTypeName', title: '资源类型', align: 'center' | ||
142 | + }, { | ||
143 | + field: 'resCode', title: '所属资源编号', align: 'center' | ||
144 | + }, { | ||
145 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
146 | + let env = d.env == '1' ?'生产':'预生产'; | ||
147 | + return env; | ||
148 | + } | ||
149 | + }, { | ||
150 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
151 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
152 | + return monitorStatus; | ||
153 | + } | ||
154 | + }, { | ||
155 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
156 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
157 | + return backStatus; | ||
158 | + } | ||
159 | + } | ||
160 | + ]], | ||
161 | + done: function () { | ||
162 | + $('.view-othersoftwareInstance-code').on('click', function () { | ||
163 | + openAddOthersoftwareInstanceForm($(this).data('id')) | ||
164 | + }) | ||
165 | + } | ||
166 | + }); | ||
167 | + | ||
168 | + } | ||
169 | + | ||
170 | + // 图表,表格重新加载 | ||
171 | + function reloadAllChange() { | ||
172 | + renderInformationOthersoftwareInstanceListTable(); | ||
173 | + loadConditionSelect(); | ||
174 | + } | ||
175 | + }); | ||
176 | + | ||
177 | +}); |
hg-monitor-web-base/src/main/resources/static/src/controller/informationOthersoftwareInstanceAdd.js
0 → 100644
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationOthersoftwareInstanceAdd', function(data){ | ||
13 | + var accessToken = common.getMjToken(); | ||
14 | + //渲染表单 | ||
15 | + form.render(null, 'add-informationothersoftwareInstance-form') | ||
16 | + init(); | ||
17 | + | ||
18 | + //保存 | ||
19 | + form.on('submit(othersoftwareInstance-form-save-id)', function (res) { | ||
20 | + saveForm() | ||
21 | + }); | ||
22 | + | ||
23 | + //保存 | ||
24 | + function saveForm() { | ||
25 | + layer.load(2) | ||
26 | + var data = form.val('add-informationothersoftwareInstance-form'); | ||
27 | + admin.req({ | ||
28 | + url: domainName + '/api-web/informationAsset/saveOthersoftwareInstance', | ||
29 | + data: JSON.stringify(data), | ||
30 | + type: 'post', | ||
31 | + contentType: "application/json; charset=utf-8", | ||
32 | + done: function (res) { | ||
33 | + if (res.success) { | ||
34 | + layer.msg(res.msg, { | ||
35 | + offset: '15px', | ||
36 | + icon: 1, | ||
37 | + time: 1000, | ||
38 | + }, function () { | ||
39 | + layer.closeAll() | ||
40 | + table.reload('othersoftwareInstance_table_id', { | ||
41 | + where: { | ||
42 | + accessToken: accessToken, | ||
43 | + }, | ||
44 | + }); | ||
45 | + }) | ||
46 | + } else { | ||
47 | + layer.msg(res.msg, { | ||
48 | + offset: '15px', | ||
49 | + icon: 7, | ||
50 | + time: 1000, | ||
51 | + }) | ||
52 | + } | ||
53 | + } | ||
54 | + }) | ||
55 | + return false | ||
56 | + } | ||
57 | + | ||
58 | + //页面初始化 | ||
59 | + function init() { | ||
60 | + loadSelect(); | ||
61 | + } | ||
62 | + // 初始化下拉框 | ||
63 | + function loadSelect() { | ||
64 | + let typeurl = `${domainName}/mj/sys/conf/getSelectCN/insResType?accessToken=${accessToken}`; | ||
65 | + $.ajax({ | ||
66 | + url: typeurl, | ||
67 | + async: false, | ||
68 | + success: function (res) { | ||
69 | + var selects = res.data.options; | ||
70 | + var $sel = $("form#add-informationothersoftwareInstance-form").find("select[name='resType']"); | ||
71 | + $.each(selects, function (i, e) { | ||
72 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
73 | + }); | ||
74 | + form.render(); | ||
75 | + } | ||
76 | + }); | ||
77 | + let otherSoftCodeUrl = `${domainName}/api-web/informationAsset/informationOthersoftwareList?accessToken=${accessToken}`; | ||
78 | + $.ajax({ | ||
79 | + url: otherSoftCodeUrl, | ||
80 | + async: false, | ||
81 | + success: function (res) { | ||
82 | + var selects = res.data; | ||
83 | + var $sel = $("form#add-informationothersoftwareInstance-form").find("select[name='othCode']"); | ||
84 | + $.each(selects, function (i, e) { | ||
85 | + $sel.append(`<option value="${e.othCode}"> ${e.softName}</option>`) | ||
86 | + }) | ||
87 | + form.render(); | ||
88 | + } | ||
89 | + }); | ||
90 | + | ||
91 | + //绑定业务下拉选择数据 | ||
92 | + common.bizTypeSelect("add-information-othersoftwareInstance", function () { | ||
93 | + fromAssignment(); | ||
94 | + form.render("select"); | ||
95 | + }); | ||
96 | + | ||
97 | + } | ||
98 | + | ||
99 | + form.verify({ | ||
100 | + account: function(value, item){ | ||
101 | + var max = item.getAttribute('maxlength'); | ||
102 | + if(value.length > max){ | ||
103 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
104 | + } | ||
105 | + } | ||
106 | + }); | ||
107 | + | ||
108 | + | ||
109 | + //表单赋值 | ||
110 | + function fromAssignment() { | ||
111 | + if (data && data.id) { | ||
112 | + var loading =layer.load(2); | ||
113 | + admin.req({ | ||
114 | + url: domainName + `/api-web/informationAsset/findOthersoftwareInstanceById`, | ||
115 | + data: {id: data.id}, | ||
116 | + async: false, | ||
117 | + }).done(function (res) { | ||
118 | + layer.close(loading) | ||
119 | + form.val('add-informationothersoftwareInstance-form', res.object); | ||
120 | + form.render('select'); | ||
121 | + }) | ||
122 | + }else{ | ||
123 | + form.render('select'); | ||
124 | + } | ||
125 | + } | ||
126 | + | ||
127 | + | ||
128 | + | ||
129 | + | ||
130 | + }) | ||
131 | +}) |
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationProject', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + | ||
12 | + // 加载查询条件下拉框 | ||
13 | + function loadConditionSelect(){ | ||
14 | + //绑定业务下拉选择数据 | ||
15 | + common.bizTypeSelect("slt-information-project", function () { | ||
16 | + form.render("select"); | ||
17 | + }); | ||
18 | + } | ||
19 | + //下载 | ||
20 | + $('#project_download').on('click', function () { | ||
21 | + var id ='f9ef9533940211ee8dea005056aae0ca'; | ||
22 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
23 | + window.open(url); | ||
24 | + }) | ||
25 | + $("#orgSearchBtn").on("click",function () { | ||
26 | + renderInformationProjectListTable(); | ||
27 | + }); | ||
28 | + $("#project_temp_import").on("click", function () { | ||
29 | + var loadIndex = ''; | ||
30 | + var $content = $("#project-import-form"); | ||
31 | + layer.open({ | ||
32 | + type: 1 | ||
33 | + , title: '导入应用项目信息' | ||
34 | + , area: ['600px', '300px'] | ||
35 | + , shade: 0.8 | ||
36 | + , id: 'project-import-form-id' //设定一个id,防止重复弹出 | ||
37 | + , btn: ['上传', '取消'] | ||
38 | + , content: $content.html() | ||
39 | + , yes: function (index, layero) { | ||
40 | + if ($("#project-display-file-name").val()) { | ||
41 | + loadIndex = layer.load(2); | ||
42 | + uploadFile.upload(); | ||
43 | + } else { | ||
44 | + layer.msg('请选择要导入的文件!', { | ||
45 | + icon: 7, time: 3000 | ||
46 | + }); | ||
47 | + return false; | ||
48 | + } | ||
49 | + } | ||
50 | + }); | ||
51 | + | ||
52 | + var uploadFile = upload.render({ | ||
53 | + elem: '#project-display-file-name' | ||
54 | + , url: common.domainName + '/api-web/informationAsset/project/importExcel?accessToken=' + accessToken | ||
55 | + , auto: false | ||
56 | + , accept: 'file' | ||
57 | + , exts: 'xlsx|xls' | ||
58 | + , choose: function (obj) { | ||
59 | + this.files = obj.pushFile(); | ||
60 | + //读取本地文件 | ||
61 | + obj.preview(function (index, file, result) { | ||
62 | + $("#project-display-file-name").val(file.name); | ||
63 | + }); | ||
64 | + } | ||
65 | + , done: function (res) { | ||
66 | + layer.closeAll(); | ||
67 | + layer.msg('导入成功!', { | ||
68 | + icon: 1, time: 3000 | ||
69 | + }); | ||
70 | + } | ||
71 | + , error: function (res) { | ||
72 | + layer.closeAll(); | ||
73 | + } | ||
74 | + }); | ||
75 | + }); | ||
76 | + $("#btn-project-export-excel").on('click', function () { | ||
77 | + var href = common.domainName + "/api-web/informationAsset/exportInformationProjectList?accessToken=" + accessToken + "&projectName=" + $("#projectName").val(); | ||
78 | + window.open(href) | ||
79 | + }); | ||
80 | + $('#addProjectBtn').on('click', function () { | ||
81 | + openAddProjectForm() | ||
82 | + }); | ||
83 | + | ||
84 | + function openAddProjectForm(id) { | ||
85 | + let title = id ? '编辑' : '新增' | ||
86 | + common.openWin('informationAsset/projectAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
87 | + $("#project-form-save-id").trigger("click"); | ||
88 | + form.render(); | ||
89 | + }, null, ['90%', '90%'], null, { | ||
90 | + end: function () { | ||
91 | + reloadAllChange(); | ||
92 | + } | ||
93 | + }) | ||
94 | + } | ||
95 | + | ||
96 | + //表格数据 | ||
97 | + function renderInformationProjectListTable() { | ||
98 | + var url = common.domainName + '/api-web/informationAsset/informationProjectList'; | ||
99 | + var conditions = form.val('project-index-form'); | ||
100 | + Object.assign(conditions, { | ||
101 | + accessToken: accessToken | ||
102 | + }); | ||
103 | + table.render({ | ||
104 | + elem: '#project_table_id', | ||
105 | + url: url, | ||
106 | + where: conditions, | ||
107 | + height: 'full-360', | ||
108 | + page: { | ||
109 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
110 | + theme: '#1E9FFF' | ||
111 | + }, | ||
112 | + end: function (e) { | ||
113 | + form.render() | ||
114 | + }, | ||
115 | + limit: common.limit, | ||
116 | + limits: common.limits, | ||
117 | + even: true, | ||
118 | + cols: [[ { | ||
119 | + type: 'numbers', title: '序号' | ||
120 | + }, { | ||
121 | + field: 'projectSource', title: '项目来源', align: 'center' | ||
122 | + }, { | ||
123 | + field: 'projectCode', title: '项目编号', align: 'center', | ||
124 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-project-code" >{{d.projectCode}}</span></div>' | ||
125 | + }, { | ||
126 | + field: 'projectName', title: '省一级显示项目名称', align: 'center' | ||
127 | + }, { | ||
128 | + field: 'launchTime', title: '项目启动时间', align: 'center' | ||
129 | + },{ | ||
130 | + field: 'usageStatus', title: '使用状态', align: 'center', | ||
131 | + templet: ` | ||
132 | + <div> | ||
133 | + {{# | ||
134 | + var usageStatusEnum = { | ||
135 | + '0': '否', | ||
136 | + '1': '是' | ||
137 | + | ||
138 | + }; | ||
139 | + var usageStatusStr = usageStatusEnum[d.usageStatus]; | ||
140 | + usageStatusStr = usageStatusStr ? usageStatusStr : d.usageStatus; | ||
141 | + }} | ||
142 | + {{usageStatusStr}} | ||
143 | + </div> | ||
144 | + ` | ||
145 | + },{ | ||
146 | + field: 'bizOrgName', title: '主管业务单位', align: 'center' | ||
147 | + } ,{ | ||
148 | + field: 'bizAdmin', title: '系统负责人', align: 'center' | ||
149 | + },{ | ||
150 | + field: 'opOrgName', title: '运维管理单位', align: 'center' | ||
151 | + }, { | ||
152 | + field: 'opAdmin', title: '运维负责人', align: 'center' | ||
153 | + }, { | ||
154 | + field: 'factoryName', title: '合同乙方单位', align: 'center' | ||
155 | + }, { | ||
156 | + field: 'factoryUser', title: '运维联系人', align: 'center' | ||
157 | + }, { | ||
158 | + field: 'org', title: '所属单位', align: 'center' | ||
159 | + }, { | ||
160 | + field: 'remark', title: '备注', align: 'center' | ||
161 | + }, { | ||
162 | + field: 'orgCode', title: '单位编码', align: 'center' | ||
163 | + } | ||
164 | + ]], | ||
165 | + done: function () { | ||
166 | + $('.view-project-code').on('click', function () { | ||
167 | + openAddProjectForm($(this).data('id')) | ||
168 | + }) | ||
169 | + } | ||
170 | + }); | ||
171 | + } | ||
172 | + | ||
173 | + // 图表,表格重新加载 | ||
174 | + function reloadAllChange() { | ||
175 | + renderInformationProjectListTable(); | ||
176 | + loadConditionSelect(); | ||
177 | + } | ||
178 | + }); | ||
179 | + | ||
180 | +}); |
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'laydate', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var laydate = layui.laydate; | ||
10 | + var domainName = common.domainName; | ||
11 | + | ||
12 | + //对外暴露的接口 | ||
13 | + exports('informationProjectAdd', function (data) { | ||
14 | + var accessToken = common.getMjToken(); | ||
15 | + let launchTime = {}; | ||
16 | + //渲染表单 | ||
17 | + form.render(null, 'add-informationproject-form') | ||
18 | + init(); | ||
19 | + | ||
20 | + //保存 | ||
21 | + form.on('submit(project-form-save-id)', function (res) { | ||
22 | + saveForm() | ||
23 | + }); | ||
24 | + | ||
25 | + //保存 | ||
26 | + function saveForm() { | ||
27 | + layer.load(2) | ||
28 | + var data = form.val('add-informationproject-form'); | ||
29 | + admin.req({ | ||
30 | + url: domainName + '/api-web/informationAsset/saveProject', | ||
31 | + data: JSON.stringify(data), | ||
32 | + type: 'post', | ||
33 | + contentType: "application/json; charset=utf-8", | ||
34 | + done: function (res) { | ||
35 | + if (res.success) { | ||
36 | + layer.msg(res.msg, { | ||
37 | + offset: '15px', | ||
38 | + icon: 1, | ||
39 | + time: 1000, | ||
40 | + }, function () { | ||
41 | + layer.closeAll() | ||
42 | + table.reload('project_table_id', { | ||
43 | + where: { | ||
44 | + accessToken: accessToken, | ||
45 | + projectName: '' | ||
46 | + }, | ||
47 | + }); | ||
48 | + }) | ||
49 | + } else { | ||
50 | + layer.msg(res.msg, { | ||
51 | + offset: '15px', | ||
52 | + icon: 7, | ||
53 | + time: 1000, | ||
54 | + }) | ||
55 | + } | ||
56 | + } | ||
57 | + }) | ||
58 | + return false | ||
59 | + } | ||
60 | + | ||
61 | + //页面初始化 | ||
62 | + function init() { | ||
63 | + loadSelect(); | ||
64 | + initDatePlus(); | ||
65 | + } | ||
66 | + //初始化日期插件 | ||
67 | + function initDatePlus() { | ||
68 | + launchTime = laydate.render({ | ||
69 | + elem: '#launchTime', //指定元素 | ||
70 | + value: new Date(), | ||
71 | + isInitValue: true, | ||
72 | + }); | ||
73 | + } | ||
74 | + // 初始化下拉框 | ||
75 | + function loadSelect() { | ||
76 | + | ||
77 | + admin.req({ | ||
78 | + url: domainName + '/mj/sysOrg/page?orgType=1' | ||
79 | + }).done(function (response) { | ||
80 | + let bizOptions = "<option value=''>主管业务单位</option>"; | ||
81 | + let opOptions = "<option value=''>运维管理单位</option>"; | ||
82 | + | ||
83 | + $.each(response.data.rows, function (i, v) { | ||
84 | + bizOptions += "<option value='" + v.orgId + "'>" + v.orgName + "</option>" | ||
85 | + opOptions += "<option value='" + v.orgId + "'>" + v.orgName + "</option>" | ||
86 | + }); | ||
87 | + $('#bizOrgId').html(bizOptions); | ||
88 | + $('#opOrgId').html(opOptions); | ||
89 | + form.render(); | ||
90 | + }); | ||
91 | + //绑定业务下拉选择数据 | ||
92 | + common.bizTypeSelect("add-information-project", function () { | ||
93 | + form.render("select"); | ||
94 | + }); | ||
95 | + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&accessToken=${accessToken}`; | ||
96 | + $.ajax({ | ||
97 | + url: url, | ||
98 | + success: function (res) { | ||
99 | + var options = "<option value=''>合同乙方单位</option>"; | ||
100 | + $.each(res.data, function (i, v) { | ||
101 | + options += "<option value='" + v.id + "'>" + v.shortName + "</option>" | ||
102 | + }); | ||
103 | + options += "<option value='0'>其他</option>"; | ||
104 | + $('#factoryId').html(options); | ||
105 | + form.render(); | ||
106 | + fromAssignment(); | ||
107 | + } | ||
108 | + }); | ||
109 | + | ||
110 | + } | ||
111 | + | ||
112 | + form.verify({ | ||
113 | + account: function(value, item){ | ||
114 | + var max = item.getAttribute('maxlength'); | ||
115 | + if(value.length > max){ | ||
116 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
117 | + } | ||
118 | + } | ||
119 | + }); | ||
120 | + | ||
121 | + | ||
122 | + //表单赋值 | ||
123 | + function fromAssignment() { | ||
124 | + if (data && data.id) { | ||
125 | + var loading =layer.load(2); | ||
126 | + admin.req({ | ||
127 | + url: domainName + `/api-web/informationAsset/findProjectById`, | ||
128 | + data: {id: data.id}, | ||
129 | + async: false, | ||
130 | + }).done(function (res) { | ||
131 | + layer.close(loading) | ||
132 | + form.val('add-informationproject-form', res.object); | ||
133 | + form.render('select'); | ||
134 | + }) | ||
135 | + }else{ | ||
136 | + form.render('select'); | ||
137 | + } | ||
138 | + } | ||
139 | + | ||
140 | + | ||
141 | + | ||
142 | + | ||
143 | + }) | ||
144 | +}) |
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationVirtual', function () { | ||
9 | + let accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + //发送状态 | ||
12 | + // 下拉框改变搜索 | ||
13 | + //form.on('select(slt-information-virtual)', reloadAllChange); | ||
14 | + | ||
15 | + // 加载查询条件下拉框 | ||
16 | + function loadConditionSelect() { | ||
17 | + //绑定业务下拉选择数据 | ||
18 | + common.bizTypeSelect("slt-information-virtual", function () { | ||
19 | + form.render("select"); | ||
20 | + }); | ||
21 | + } | ||
22 | + //下载 | ||
23 | + $('#virtual_download').on('click', function () { | ||
24 | + var id ='4490b4b489a511ee93f9005056aae0ca'; | ||
25 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
26 | + window.open(url); | ||
27 | + }) | ||
28 | + $("#orgSearchBtn").on("click",function () { | ||
29 | + renderInformationVirtualListTable(); | ||
30 | + }); | ||
31 | + $("#virtual_temp_import").on("click", function () { | ||
32 | + var loadIndex = ''; | ||
33 | + var $content = $("#virtual-import-form"); | ||
34 | + layer.open({ | ||
35 | + type: 1 | ||
36 | + , title: '导入虚拟资源信息' | ||
37 | + , area: ['600px', '300px'] | ||
38 | + , shade: 0.8 | ||
39 | + , id: 'virtual-import-form-id' //设定一个id,防止重复弹出 | ||
40 | + , btn: ['上传', '取消'] | ||
41 | + , content: $content.html() | ||
42 | + , yes: function (index, layero) { | ||
43 | + if ($("#virtual-display-file-name").val()) { | ||
44 | + loadIndex = layer.load(2); | ||
45 | + uploadFile.upload(); | ||
46 | + } else { | ||
47 | + layer.msg('请选择要导入的文件!', { | ||
48 | + icon: 7, time: 3000 | ||
49 | + }); | ||
50 | + return false; | ||
51 | + } | ||
52 | + } | ||
53 | + }); | ||
54 | + | ||
55 | + var uploadFile = upload.render({ | ||
56 | + elem: '#virtual-display-file-name' | ||
57 | + , url: common.domainName + '/api-web/informationAsset/virtual/importExcel?accessToken=' + accessToken | ||
58 | + , auto: false | ||
59 | + , accept: 'file' | ||
60 | + , exts: 'xlsx|xls' | ||
61 | + , choose: function (obj) { | ||
62 | + this.files = obj.pushFile(); | ||
63 | + //读取本地文件 | ||
64 | + obj.preview(function (index, file, result) { | ||
65 | + $("#virtual-display-file-name").val(file.name); | ||
66 | + }); | ||
67 | + } | ||
68 | + , done: function (res) { | ||
69 | + layer.closeAll(); | ||
70 | + layer.msg('导入成功!', { | ||
71 | + icon: 1, time: 3000 | ||
72 | + }); | ||
73 | + } | ||
74 | + , error: function (res) { | ||
75 | + layer.closeAll(); | ||
76 | + } | ||
77 | + }); | ||
78 | + }); | ||
79 | + $("#btn-virtual-export-excel").on('click', function () { | ||
80 | + var href = common.domainName + "/api-web/informationAsset/exportInformationVirtualList?accessToken=" + accessToken + "&busId=" + $("#slt-information-virtual").val(); | ||
81 | + window.open(href) | ||
82 | + }); | ||
83 | + $('#addVirtualBtn').on('click', function () { | ||
84 | + openAddVirtualForm() | ||
85 | + }); | ||
86 | + | ||
87 | + function openAddVirtualForm(id) { | ||
88 | + let title = id ? '编辑' : '新增'; | ||
89 | + common.openWin('informationAsset/virtualAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
90 | + $("#virtual-form-save-id").trigger("click"); | ||
91 | + form.render(); | ||
92 | + }, null, ['90%', '90%'], null, { | ||
93 | + end: function () { | ||
94 | + reloadAllChange(); | ||
95 | + } | ||
96 | + }) | ||
97 | + } | ||
98 | + | ||
99 | + //表格数据 | ||
100 | + function renderInformationVirtualListTable() { | ||
101 | + let url = common.domainName + '/api-web/informationAsset/informationVirtualList'; | ||
102 | + let conditions = form.val('virtual-index-form'); | ||
103 | + Object.assign(conditions, { | ||
104 | + accessToken: accessToken | ||
105 | + }); | ||
106 | + table.render({ | ||
107 | + elem: '#virtual_table_id', | ||
108 | + url: url, | ||
109 | + where: conditions, | ||
110 | + height: 'full-360', | ||
111 | + page: { | ||
112 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
113 | + theme: '#1E9FFF' | ||
114 | + }, | ||
115 | + end: function (e) { | ||
116 | + form.render() | ||
117 | + }, | ||
118 | + limit: common.limit, | ||
119 | + limits: common.limits, | ||
120 | + even: true, | ||
121 | + cols: [[{ | ||
122 | + type: 'numbers', title: '序号' | ||
123 | + }, { | ||
124 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
125 | + }, { | ||
126 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
127 | + },{ | ||
128 | + field: 'virtualCode', title: '登记编号', align: 'center', | ||
129 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-virtual-code" >{{d.virtualCode}}</span></div>' | ||
130 | + }, { | ||
131 | + field: 'virtualName', title: '虚拟机名称', align: 'center' | ||
132 | + }, { | ||
133 | + field: 'ip', title: '虚拟机IP', align: 'center' | ||
134 | + },{ | ||
135 | + field: 'version', title: '虚拟机版本', align: 'center' | ||
136 | + },{ | ||
137 | + field: 'resTypeName', title: '虚拟资源类型', align: 'center' | ||
138 | + } ,{ | ||
139 | + field: 'resBrand', title: '虚拟资源品牌', align: 'center' | ||
140 | + }, { | ||
141 | + field: 'cpuCores', title: 'CPU核数', align: 'center' | ||
142 | + }, { | ||
143 | + field: 'mem', title: '内存(GB)', align: 'center' | ||
144 | + }, { | ||
145 | + field: 'reserve', title: '置备空间(GB)', align: 'center' | ||
146 | + }, { | ||
147 | + field: 'used', title: '已用空间(GB)', align: 'center' | ||
148 | + }, { | ||
149 | + field: 'virtualStatusName', title: '使用状态', align: 'center' | ||
150 | + }, { | ||
151 | + field: 'orgName', title: '运维管理单位', align: 'center' | ||
152 | + }, { | ||
153 | + field: 'factoryName', title: '运维公司', align: 'center' | ||
154 | + }, { | ||
155 | + field: 'factoryUser', title: '运维联系人', align: 'center' | ||
156 | + },{ | ||
157 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
158 | + let env = d.env == '1' ?'生产':'预生产'; | ||
159 | + return env; | ||
160 | + } | ||
161 | + }, { | ||
162 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
163 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
164 | + return monitorStatus; | ||
165 | + } | ||
166 | + }, { | ||
167 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
168 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
169 | + return backStatus; | ||
170 | + } | ||
171 | + } | ||
172 | + ]], | ||
173 | + done: function () { | ||
174 | + $('.view-virtual-code').on('click', function () { | ||
175 | + openAddVirtualForm($(this).data('id')) | ||
176 | + }) | ||
177 | + } | ||
178 | + }); | ||
179 | + | ||
180 | + } | ||
181 | + | ||
182 | + // 图表,表格重新加载 | ||
183 | + function reloadAllChange() { | ||
184 | + renderInformationVirtualListTable(); | ||
185 | + loadConditionSelect(); | ||
186 | + } | ||
187 | + }); | ||
188 | + | ||
189 | +}); |
1 | + | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var domainName = common.domainName; | ||
10 | + | ||
11 | + //对外暴露的接口 | ||
12 | + exports('informationVirtualAdd', function (data) { | ||
13 | + var accessToken = common.getMjToken(); | ||
14 | + //渲染表单 | ||
15 | + form.render(null, 'add-informationvirtual-form') | ||
16 | + init(); | ||
17 | + | ||
18 | + //保存 | ||
19 | + form.on('submit(virtual-form-save-id)', function (res) { | ||
20 | + saveForm() | ||
21 | + }); | ||
22 | + | ||
23 | + //保存 | ||
24 | + function saveForm() { | ||
25 | + layer.load(2) | ||
26 | + var data = form.val('add-informationvirtual-form'); | ||
27 | + admin.req({ | ||
28 | + url: domainName + '/api-web/informationAsset/saveVirtual', | ||
29 | + data: JSON.stringify(data), | ||
30 | + type: 'post', | ||
31 | + contentType: "application/json; charset=utf-8", | ||
32 | + done: function (res) { | ||
33 | + if (res.success) { | ||
34 | + layer.msg(res.msg, { | ||
35 | + offset: '15px', | ||
36 | + icon: 1, | ||
37 | + time: 1000, | ||
38 | + }, function () { | ||
39 | + layer.closeAll() | ||
40 | + table.reload('virtual_table_id', { | ||
41 | + where: { | ||
42 | + accessToken: accessToken, | ||
43 | + }, | ||
44 | + }); | ||
45 | + }) | ||
46 | + } else { | ||
47 | + layer.msg(res.msg, { | ||
48 | + offset: '15px', | ||
49 | + icon: 7, | ||
50 | + time: 1000, | ||
51 | + }) | ||
52 | + } | ||
53 | + } | ||
54 | + }) | ||
55 | + return false | ||
56 | + } | ||
57 | + | ||
58 | + //页面初始化 | ||
59 | + function init() { | ||
60 | + loadSelect(); | ||
61 | + } | ||
62 | + // 初始化下拉框 | ||
63 | + function loadSelect() { | ||
64 | + let resTypeurl = `${domainName}/mj/sys/conf/getSelectCN/virtualResType?accessToken=${accessToken}`; | ||
65 | + $.ajax({ | ||
66 | + url: resTypeurl, | ||
67 | + async: false, | ||
68 | + success: function (res) { | ||
69 | + var selects = res.data.options; | ||
70 | + var $sel = $("form#add-informationvirtual-form").find("select[name='resType']"); | ||
71 | + $.each(selects, function (i, e) { | ||
72 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
73 | + }); | ||
74 | + form.render(); | ||
75 | + } | ||
76 | + }); | ||
77 | + let osurl = `${domainName}/mj/sys/conf/getSelectCN/virtualStatus?accessToken=${accessToken}`; | ||
78 | + $.ajax({ | ||
79 | + url: osurl, | ||
80 | + async: false, | ||
81 | + success: function (res) { | ||
82 | + var selects = res.data.options; | ||
83 | + var $sel = $("form#add-informationvirtual-form").find("select[name='virtualStatus']"); | ||
84 | + $.each(selects, function (i, e) { | ||
85 | + $sel.append(`<option value="${e.value}"> ${e.label}</option>`) | ||
86 | + }); | ||
87 | + form.render(); | ||
88 | + } | ||
89 | + }); | ||
90 | + admin.req({ | ||
91 | + url: domainName + '/mj/sysOrg/page?orgType=1' | ||
92 | + }).done(function (response) { | ||
93 | + var options = "<option value=''>运维管理单位</option>"; | ||
94 | + $.each(response.data.rows, function (i, v) { | ||
95 | + options += "<option value='" + v.orgId + "'>" + v.orgName + "</option>" | ||
96 | + }); | ||
97 | + $('#orgId').html(options); | ||
98 | + form.render(); | ||
99 | + }); | ||
100 | + let osCodeUrl = `${domainName}/api-web/informationAsset/informationosList?accessToken=${accessToken}`; | ||
101 | + $.ajax({ | ||
102 | + url: osCodeUrl, | ||
103 | + async: false, | ||
104 | + success: function (res) { | ||
105 | + var selects = res.data; | ||
106 | + var $sel = $("form#add-informationvirtual-form").find("select[name='osCode']"); | ||
107 | + $.each(selects, function (i, e) { | ||
108 | + $sel.append(`<option value="${e.osCode}"> ${e.osBrand}-${e.osVersion}</option>`) | ||
109 | + }) | ||
110 | + form.render(); | ||
111 | + } | ||
112 | + }); | ||
113 | + //绑定业务下拉选择数据 | ||
114 | + common.bizTypeSelect("add-information-virtual", function () { | ||
115 | + form.render("select"); | ||
116 | + }); | ||
117 | + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`; | ||
118 | + $.ajax({ | ||
119 | + url: url, | ||
120 | + success: function (res) { | ||
121 | + var options = "<option value=''>运维公司</option>"; | ||
122 | + $.each(res.data, function (i, v) { | ||
123 | + options += "<option value='" + v.id + "'>" + v.shortName + "</option>" | ||
124 | + }); | ||
125 | + options += "<option value='0'>其他</option>"; | ||
126 | + $('#factoryId').html(options); | ||
127 | + form.render(); | ||
128 | + fromAssignment(); | ||
129 | + } | ||
130 | + }); | ||
131 | + | ||
132 | + } | ||
133 | + | ||
134 | + form.verify({ | ||
135 | + account: function(value, item){ | ||
136 | + var max = item.getAttribute('maxlength'); | ||
137 | + if(value.length > max){ | ||
138 | + layer.msg('不能大于'+ max +'个字符的长度') ; | ||
139 | + } | ||
140 | + } | ||
141 | + }); | ||
142 | + | ||
143 | + | ||
144 | + //表单赋值 | ||
145 | + function fromAssignment() { | ||
146 | + if (data && data.id) { | ||
147 | + var loading =layer.load(2); | ||
148 | + admin.req({ | ||
149 | + url: domainName + `/api-web/informationAsset/findVirtualById`, | ||
150 | + data: {id: data.id}, | ||
151 | + async: false, | ||
152 | + }).done(function (res) { | ||
153 | + layer.close(loading) | ||
154 | + form.val('add-informationvirtual-form', res.object); | ||
155 | + form.render('select'); | ||
156 | + }) | ||
157 | + }else{ | ||
158 | + form.render('select'); | ||
159 | + } | ||
160 | + } | ||
161 | + | ||
162 | + | ||
163 | + | ||
164 | + | ||
165 | + }) | ||
166 | +}) |
1 | +layui.define(['table', 'admin', 'form', 'common', 'element','upload'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + var upload =layui.upload; | ||
7 | + //对外暴露的接口 | ||
8 | + exports('informationos', function () { | ||
9 | + var accessToken = common.getMjToken(); | ||
10 | + reloadAllChange(); | ||
11 | + | ||
12 | + // 加载查询条件下拉框 | ||
13 | + function loadConditionSelect() { | ||
14 | + //绑定业务下拉选择数据 | ||
15 | + common.bizTypeSelect("slt-information-os", function () { | ||
16 | + form.render("select"); | ||
17 | + }); | ||
18 | + } | ||
19 | + //下载 | ||
20 | + $('#os_download').on('click', function () { | ||
21 | + var id ='03959616874c11ee93f9005056aae0ca'; | ||
22 | + var url = common.domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
23 | + window.open(url); | ||
24 | + }) | ||
25 | + $("#orgSearchBtn").on("click",function () { | ||
26 | + renderInformationosListTable(); | ||
27 | + }); | ||
28 | + $("#os_temp_import").on("click", function () { | ||
29 | + var loadIndex = ''; | ||
30 | + var $content = $("#os-import-form"); | ||
31 | + layer.open({ | ||
32 | + type: 1 | ||
33 | + , title: '导入操作系统信息' | ||
34 | + , area: ['600px', '300px'] | ||
35 | + , shade: 0.8 | ||
36 | + , id: 'os-import-form-id' //设定一个id,防止重复弹出 | ||
37 | + , btn: ['上传', '取消'] | ||
38 | + , content: $content.html() | ||
39 | + , yes: function (index, layero) { | ||
40 | + if ($("#os-display-file-name").val()) { | ||
41 | + loadIndex = layer.load(2); | ||
42 | + uploadFile.upload(); | ||
43 | + } else { | ||
44 | + layer.msg('请选择要导入的文件!', { | ||
45 | + icon: 7, time: 3000 | ||
46 | + }); | ||
47 | + return false; | ||
48 | + } | ||
49 | + } | ||
50 | + }); | ||
51 | + | ||
52 | + var uploadFile = upload.render({ | ||
53 | + elem: '#os-display-file-name' | ||
54 | + , url: common.domainName + '/api-web/informationAsset/os/importExcel?accessToken=' + accessToken | ||
55 | + , auto: false | ||
56 | + , accept: 'file' | ||
57 | + , exts: 'xlsx|xls' | ||
58 | + , choose: function (obj) { | ||
59 | + this.files = obj.pushFile(); | ||
60 | + //读取本地文件 | ||
61 | + obj.preview(function (index, file, result) { | ||
62 | + $("#os-display-file-name").val(file.name); | ||
63 | + }); | ||
64 | + } | ||
65 | + , done: function (res) { | ||
66 | + layer.closeAll(); | ||
67 | + layer.msg('导入成功!', { | ||
68 | + icon: 1, time: 3000 | ||
69 | + }); | ||
70 | + } | ||
71 | + , error: function (res) { | ||
72 | + layer.closeAll(); | ||
73 | + } | ||
74 | + }); | ||
75 | + }); | ||
76 | + $("#btn-os-export-excel").on('click', function () { | ||
77 | + var href = common.domainName + "/api-web/informationAsset/exportInformationosList?accessToken=" + accessToken + "&busId=" + $("#slt-information-os").val(); | ||
78 | + window.open(href) | ||
79 | + }); | ||
80 | + $('#addOsBtn').on('click', function () { | ||
81 | + openAddOsForm() | ||
82 | + }); | ||
83 | + | ||
84 | + function openAddOsForm(id) { | ||
85 | + let title = id ? '编辑' : '新增' | ||
86 | + common.openWin('informationAsset/osAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
87 | + $("#os-form-save-id").trigger("click"); | ||
88 | + form.render(); | ||
89 | + }, null, ['90%', '90%'], null, { | ||
90 | + end: function () { | ||
91 | + reloadAllChange(); | ||
92 | + } | ||
93 | + }) | ||
94 | + } | ||
95 | + | ||
96 | + //表格数据 | ||
97 | + function renderInformationosListTable() { | ||
98 | + | ||
99 | + let url = common.domainName + '/api-web/informationAsset/informationosList'; | ||
100 | + let conditions = form.val('os-index-form'); | ||
101 | + Object.assign(conditions, { | ||
102 | + accessToken: accessToken | ||
103 | + }); | ||
104 | + table.render({ | ||
105 | + elem: '#os_table_id', | ||
106 | + url: url, | ||
107 | + where: conditions, | ||
108 | + height: 'full-360', | ||
109 | + page: { | ||
110 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
111 | + theme: '#1E9FFF' | ||
112 | + }, | ||
113 | + end: function (e) { | ||
114 | + form.render() | ||
115 | + }, | ||
116 | + limit: common.limit, | ||
117 | + limits: common.limits, | ||
118 | + even: true, | ||
119 | + cols: [[ { | ||
120 | + type: 'numbers', title: '序号' | ||
121 | + }, { | ||
122 | + field: 'busTypeName', title: '业务系统', align: 'center' | ||
123 | + }, { | ||
124 | + field: 'busTypeName', title: '业务子系统', align: 'center' | ||
125 | + },{ | ||
126 | + field: 'osCode', title: '登记编号', align: 'center', | ||
127 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-os-code" >{{d.osCode}}</span></div>' | ||
128 | + }, { | ||
129 | + field: 'osBrandName', title: '品牌', align: 'center' | ||
130 | + }, { | ||
131 | + field: 'osVersion', title: '版本', align: 'center' | ||
132 | + },{ | ||
133 | + field: 'serviceTypeName', title: '服务类型', align: 'center' | ||
134 | + | ||
135 | + },{ | ||
136 | + field: 'ip1', title: '网卡1IP', align: 'center' | ||
137 | + } ,{ | ||
138 | + field: 'sc', title: '存储容量(GB)', align: 'center',templet: function (d) { | ||
139 | + let sc = Number(d.sc).toFixed(2); | ||
140 | + return sc; | ||
141 | + } | ||
142 | + },{ | ||
143 | + field: 'deviceTypeName', title: '安装设备类型', align: 'center' | ||
144 | + }, { | ||
145 | + field: 'factoryName', title: '申请单位', align: 'center' | ||
146 | + }, { | ||
147 | + field: 'factoryUser', title: '申请人', align: 'center' | ||
148 | + }, { | ||
149 | + field: 'osAdmin', title: '管理员', align: 'center' | ||
150 | + }, { | ||
151 | + field: 'env', title: '环境', align: 'center',templet:function (d) { | ||
152 | + let env = d.env == '1' ?'生产':'预生产'; | ||
153 | + return env; | ||
154 | + } | ||
155 | + }, { | ||
156 | + field: 'monitorStatus', title: '是否监控', align: 'center',templet:function (d) { | ||
157 | + let monitorStatus = d.monitorStatus == '1'?'是':'否'; | ||
158 | + return monitorStatus; | ||
159 | + } | ||
160 | + }, { | ||
161 | + field: 'backStatus', title: '是否备份', align: 'center',templet:function (d) { | ||
162 | + let backStatus = d.backStatus == '1' ?'是':'否'; | ||
163 | + return backStatus; | ||
164 | + } | ||
165 | + } | ||
166 | + ]], | ||
167 | + done: function () { | ||
168 | + $('.view-os-code').on('click', function () { | ||
169 | + openAddOsForm($(this).data('id')) | ||
170 | + }) | ||
171 | + } | ||
172 | + }); | ||
173 | + | ||
174 | + } | ||
175 | + | ||
176 | + // 图表,表格重新加载 | ||
177 | + function reloadAllChange() { | ||
178 | + renderInformationosListTable(); | ||
179 | + loadConditionSelect(); | ||
180 | + } | ||
181 | + }); | ||
182 | + | ||
183 | +}); |
1 | +<title>数据库管理</title> | ||
2 | +<article class="page-container template"> | ||
3 | + <div class="page-panel"> | ||
4 | + <div class="main"> | ||
5 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
6 | + <div style="display: flex;justify-content: space-between;align-items: center;"> | ||
7 | + <form class="layui-form layui-card-header" onsubmit="return false" | ||
8 | + lay-filter="database-index-form"> | ||
9 | + <div class="layui-form-item"> | ||
10 | + <div class="layui-inline"> | ||
11 | + <div class="layui-input-inline"> | ||
12 | + <select name="busId" id="slt-information-database" | ||
13 | + lay-filter="slt-information-database" lay-search> | ||
14 | + <option value="">=业务系统=</option> | ||
15 | + </select> | ||
16 | + </div> | ||
17 | + </div> | ||
18 | + <button class="layui-inline layui-btn layui-btn-sm layui-btn-normal active" | ||
19 | + id="orgSearchBtn" >搜索 | ||
20 | + </button> | ||
21 | + </div> | ||
22 | + </form> | ||
23 | + | ||
24 | + </div> | ||
25 | + <div style="margin-bottom: 10px;margin-top: 10px;"> | ||
26 | + <button id="addDatabaseBtn" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i | ||
27 | + class="layui-icon"></i>新增 | ||
28 | + </button> | ||
29 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="database_download" > | ||
30 | + <i class="layui-icon"></i>模板下载 | ||
31 | + </button> | ||
32 | + <button id="database_temp_import" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i | ||
33 | + class="layui-icon"></i>导入 | ||
34 | + </button> | ||
35 | + <button class="layui-btn layui-btn-sm layui-btn-normal" | ||
36 | + id="btn-database-export-excel"> | ||
37 | + <i class="layui-icon"></i>导出 | ||
38 | + </button> | ||
39 | + </div> | ||
40 | + <table id="database_table_id" class="layui-table"> | ||
41 | + </table> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | +</article> | ||
46 | +<!--导入信息窗口--> | ||
47 | +<script id="database-import-form" type="text/html"> | ||
48 | + <div class="upload-area-content"> | ||
49 | + <form class="layui-form layui-form-pane" action=""> | ||
50 | + <div class="layui-form-item"> | ||
51 | + <div class="layui-inline"> | ||
52 | + <label class="layui-form-label">文件选择</label> | ||
53 | + <div class="layui-upload"> | ||
54 | + <div class="layui-input-block"> | ||
55 | + <input id="database-display-file-name" type="text" name="title" lay-verify="title" | ||
56 | + autocomplete="off" | ||
57 | + placeholder="请选择文件" class="layui-input layui-icon-read " readonly="readonly"> | ||
58 | + </div> | ||
59 | + <div class="upload-tips-info" > | ||
60 | + <p> 提示:只支持xlsx|xls格式导入</p> | ||
61 | + </div> | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + <div class="layui-inline"> | ||
65 | + <button style="display: none" type="button" class="layui-btn layui-btn-normal" id="uploadActionBtn"> | ||
66 | + 上传 | ||
67 | + </button> | ||
68 | + </div> | ||
69 | + </div> | ||
70 | + </form> | ||
71 | + </div> | ||
72 | +</script> | ||
73 | +<script> | ||
74 | + layui.use('informationDatabase', function (fn) { | ||
75 | + fn(); | ||
76 | + }); | ||
77 | +</script> | ||
78 | +<style type="text/css"> | ||
79 | + td input:not([type=button]) { | ||
80 | + width: 80px; | ||
81 | + } | ||
82 | + div.upload-tips-info{ | ||
83 | + margin-top: 20px; | ||
84 | + font-weight: 800; | ||
85 | + } | ||
86 | + div.upload-tips-info p{ | ||
87 | + color: red!important; | ||
88 | + } | ||
89 | +</style> |
hg-monitor-web-base/src/main/resources/static/src/views/informationAsset/databaseAdd.html
0 → 100644
1 | +<article> | ||
2 | + <div class="layui-card-body"> | ||
3 | + <fieldset class="layui-elem-field layui-field-title"> | ||
4 | + <legend>数据库信息</legend> | ||
5 | + </fieldset> | ||
6 | + <form class="layui-form layui-form-pane" lay-filter="add-informationdatabase-form" | ||
7 | + id="add-informationdatabase-form" onsubmit="return false;"> | ||
8 | + <input hidden name="id" id="id" lay-verify="checkReportIsExist"> | ||
9 | + <div class="layui-form-item"> | ||
10 | + <div class="layui-inline inline-onethird"> | ||
11 | + <label class="layui-form-label"><span>*</span>业务类型</label> | ||
12 | + <div class="layui-input-inline"> | ||
13 | + <select name="bizId" id="add-information-database" | ||
14 | + lay-filter="add-information-database" lay-verify="required"> | ||
15 | + <option value="">业务类型</option> | ||
16 | + </select> | ||
17 | + </div> | ||
18 | + </div> | ||
19 | + <div class="layui-inline inline-onethird"> | ||
20 | + <label class="layui-form-label">数据库登记编号</label> | ||
21 | + <div class="layui-input-inline"> | ||
22 | + <input type="text" class="layui-input" name="databaseCode" id="databaseCode" placeholder="数据库登记编号,只做展示" | ||
23 | + readonly="readonly"> | ||
24 | + </div> | ||
25 | + </div> | ||
26 | + <div class="layui-inline inline-onethird"> | ||
27 | + <label class="layui-form-label"><span>*</span>数据库名称</label> | ||
28 | + <div class="layui-input-inline"> | ||
29 | + <input type="text" class="layui-input" name="databaseName" id="databaseName" lay-verify="required"> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + | ||
33 | + </div> | ||
34 | + <div class="layui-form-item"> | ||
35 | + <div class="layui-inline inline-onethird"> | ||
36 | + <label class="layui-form-label">所属应用系统编号</label> | ||
37 | + <div class="layui-input-inline"> | ||
38 | + <input type="text" class="layui-input" name="appCode" id="appCode" > | ||
39 | + | ||
40 | + </div> | ||
41 | + </div> | ||
42 | + <div class="layui-inline inline-onethird"> | ||
43 | + <label class="layui-form-label"><span>*</span>数据库用途</label> | ||
44 | + <div class="layui-input-inline"> | ||
45 | + <input type="text" class="layui-input" name="purpose" id="purpose" lay-verify="required"> | ||
46 | + </div> | ||
47 | + </div> | ||
48 | + <div class="layui-inline inline-onethird"> | ||
49 | + <label class="layui-form-label"><span>*</span>数据库品牌</label> | ||
50 | + <div class="layui-input-inline"> | ||
51 | + <select name="brand" id="brand" | ||
52 | + lay-filter="brand" lay-verify="required"> | ||
53 | + <option value="">数据库品牌</option> | ||
54 | + </select> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + </div> | ||
58 | + <div class="layui-form-item"> | ||
59 | + <div class="layui-inline inline-onethird"> | ||
60 | + <label class="layui-form-label"><span>*</span>数据库版本</label> | ||
61 | + <div class="layui-input-inline"> | ||
62 | + <input type="text" class="layui-input" name="version" id="version" lay-verify="required"> | ||
63 | + </div> | ||
64 | + </div> | ||
65 | + <div class="layui-inline inline-onethird"> | ||
66 | + <label class="layui-form-label"><span>*</span>数据库类型</label> | ||
67 | + <div class="layui-input-inline"> | ||
68 | + <select name="type" id="type" | ||
69 | + lay-filter="type" lay-verify="required"> | ||
70 | + <option value="">数据库类型</option> | ||
71 | + </select> | ||
72 | + </div> | ||
73 | + </div> | ||
74 | + <div class="layui-inline inline-onethird"> | ||
75 | + <label class="layui-form-label"><span>*</span>节点数量</label> | ||
76 | + <div class="layui-input-inline"> | ||
77 | + <input type="text" class="layui-input" name="nodes" id="nodes" lay-verify="required"> | ||
78 | + </div> | ||
79 | + </div> | ||
80 | + </div> | ||
81 | + <div class="layui-form-item"> | ||
82 | + <div class="layui-inline inline-onethird"> | ||
83 | + <label class="layui-form-label"><span>*</span>服务地址</label> | ||
84 | + <div class="layui-input-inline"> | ||
85 | + <input type="text" class="layui-input" name="serverAddress" id="serverAddress" lay-verify="required" > | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + <div class="layui-inline inline-onethird"> | ||
89 | + <label class="layui-form-label"><span>*</span>管理地址</label> | ||
90 | + <div class="layui-input-inline"> | ||
91 | + <input type="text" class="layui-input" name="manageAddress" id="manageAddress" lay-verify="required"> | ||
92 | + | ||
93 | + </div> | ||
94 | + </div> | ||
95 | + <div class="layui-inline inline-onethird"> | ||
96 | + <label class="layui-form-label">服务类型</label> | ||
97 | + <div class="layui-input-inline"> | ||
98 | + <select name="serviceType" id="serviceType" | ||
99 | + lay-filter="serviceType" > | ||
100 | + <option value="">服务类型</option> | ||
101 | + </select> | ||
102 | + </div> | ||
103 | + </div> | ||
104 | + </div> | ||
105 | + <div class="layui-form-item"> | ||
106 | + <div class="layui-inline inline-onethird"> | ||
107 | + <label class="layui-form-label"><span>*</span>表空间总容量(GB)</label> | ||
108 | + <div class="layui-input-inline"> | ||
109 | + <input type="text" class="layui-input" name="spaceCapacity" id="spaceCapacity" lay-verify="required"> | ||
110 | + </div> | ||
111 | + </div> | ||
112 | + <div class="layui-inline inline-onethird"> | ||
113 | + <label class="layui-form-label">已占用容量(GB)</label> | ||
114 | + <div class="layui-input-inline"> | ||
115 | + <input type="text" class="layui-input" name="excluded" id="excluded" > | ||
116 | + </div> | ||
117 | + </div> | ||
118 | + <div class="layui-inline inline-onethird"> | ||
119 | + <label class="layui-form-label">数据库管理员</label> | ||
120 | + <div class="layui-input-inline"> | ||
121 | + <input type="text" class="layui-input" name="dba" id="dba"> | ||
122 | + </div> | ||
123 | + </div> | ||
124 | + | ||
125 | + </div> | ||
126 | + | ||
127 | + <div class="layui-form-item"> | ||
128 | + | ||
129 | + <div class="layui-inline inline-onethird"> | ||
130 | + <label class="layui-form-label">联系方式</label> | ||
131 | + <div class="layui-input-inline"> | ||
132 | + <input type="text" class="layui-input" name="phone" id="phone"> | ||
133 | + </div> | ||
134 | + </div> | ||
135 | + <div class="layui-inline inline-onethird"> | ||
136 | + <label class="layui-form-label">单位编码</label> | ||
137 | + <div class="layui-input-inline"> | ||
138 | + <input type="text" class="layui-input" name="orgCode" id ="orgCode" > | ||
139 | + </div> | ||
140 | + </div> | ||
141 | + <div class="layui-inline inline-onethird"> | ||
142 | + <label class="layui-form-label">环境</label> | ||
143 | + <div class="layui-input-inline"> | ||
144 | + <select name="env" id="env" | ||
145 | + lay-filter="env"> | ||
146 | + <option value="">环境</option> | ||
147 | + <option value="1">生产</option> | ||
148 | + <option value="2">预生产</option> | ||
149 | + </select> | ||
150 | + </div> | ||
151 | + </div> | ||
152 | + </div> | ||
153 | + <div class="layui-form-item"> | ||
154 | + <div class="layui-inline inline-onethird"> | ||
155 | + <label class="layui-form-label">是否监控</label> | ||
156 | + <div class="layui-input-inline"> | ||
157 | + <select name="monitorStatus" id="monitorStatus" | ||
158 | + lay-filter="monitorStatus" > | ||
159 | + <option value="">是否监控</option> | ||
160 | + <option value="0">未监控</option> | ||
161 | + <option value="1">已监控</option> | ||
162 | + </select> | ||
163 | + </div> | ||
164 | + </div> | ||
165 | + <div class="layui-inline inline-onethird"> | ||
166 | + <label class="layui-form-label">是否备份</label> | ||
167 | + <div class="layui-input-inline"> | ||
168 | + <select name="backStatus" id="backStatus" | ||
169 | + lay-filter="backStatus"> | ||
170 | + <option value="">是否备份</option> | ||
171 | + <option value="0">未备份</option> | ||
172 | + <option value="1">已备份</option> | ||
173 | + </select> | ||
174 | + </div> | ||
175 | + </div> | ||
176 | + </div> | ||
177 | + <button type="submit" lay-submit lay-filter="database-form-save-id" class="layui-btn hide" | ||
178 | + id="database-form-save-id">保存 | ||
179 | + </button> | ||
180 | + </form> | ||
181 | + </div> | ||
182 | +</article> | ||
183 | +<script> | ||
184 | + layui.use('informationDatabaseAdd', function (fn) { | ||
185 | + fn({{d}}) | ||
186 | + }) | ||
187 | +</script> |
1 | +<title>数据库实例管理</title> | ||
2 | +<article class="page-container template"> | ||
3 | + <div class="page-panel"> | ||
4 | + <div class="main"> | ||
5 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
6 | + <div style="display: flex;justify-content: space-between;align-items: center;"> | ||
7 | + <form class="layui-form layui-card-header" onsubmit="return false" | ||
8 | + lay-filter="dbInstance-index-form"> | ||
9 | + <div class="layui-form-item"> | ||
10 | + <div class="layui-inline"> | ||
11 | + <div class="layui-input-inline"> | ||
12 | + <select name="busId" id="slt-information-dbInstance" | ||
13 | + lay-filter="slt-information-dbInstance" lay-search> | ||
14 | + <option value="">=业务系统=</option> | ||
15 | + </select> | ||
16 | + </div> | ||
17 | + </div> | ||
18 | + <button class="layui-inline layui-btn layui-btn-sm layui-btn-normal active" | ||
19 | + id="orgSearchBtn" >搜索 | ||
20 | + </button> | ||
21 | + </div> | ||
22 | + </form> | ||
23 | + | ||
24 | + </div> | ||
25 | + <div style="margin-bottom: 10px;margin-top: 10px;"> | ||
26 | + <button id="addDbInstanceBtn" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i | ||
27 | + class="layui-icon"></i>新增 | ||
28 | + </button> | ||
29 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="dbInstance_download" > | ||
30 | + <i class="layui-icon"></i>模板下载 | ||
31 | + </button> | ||
32 | + <button id="dbInstance_temp_import" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i | ||
33 | + class="layui-icon"></i>导入 | ||
34 | + </button> | ||
35 | + <button class="layui-btn layui-btn-sm layui-btn-normal" | ||
36 | + id="btn-dbInstance-export-excel"> | ||
37 | + <i class="layui-icon"></i>导出 | ||
38 | + </button> | ||
39 | + </div> | ||
40 | + <table id="dbInstance_table_id" class="layui-table"> | ||
41 | + </table> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | +</article> | ||
46 | +<!--导入信息窗口--> | ||
47 | +<script id="dbInstance-import-form" type="text/html"> | ||
48 | + <div class="upload-area-content"> | ||
49 | + <form class="layui-form layui-form-pane" action=""> | ||
50 | + <div class="layui-form-item"> | ||
51 | + <div class="layui-inline"> | ||
52 | + <label class="layui-form-label">文件选择</label> | ||
53 | + <div class="layui-upload"> | ||
54 | + <div class="layui-input-block"> | ||
55 | + <input id="dbInstance-display-file-name" type="text" name="title" lay-verify="title" | ||
56 | + autocomplete="off" | ||
57 | + placeholder="请选择文件" class="layui-input layui-icon-read " readonly="readonly"> | ||
58 | + </div> | ||
59 | + <div class="upload-tips-info" > | ||
60 | + <p> 提示:只支持xlsx|xls格式导入</p> | ||
61 | + </div> | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + <div class="layui-inline"> | ||
65 | + <button style="display: none" type="button" class="layui-btn layui-btn-normal" id="uploadActionBtn"> | ||
66 | + 上传 | ||
67 | + </button> | ||
68 | + </div> | ||
69 | + </div> | ||
70 | + </form> | ||
71 | + </div> | ||
72 | +</script> | ||
73 | +<script> | ||
74 | + layui.use('informationDbInstance', function (fn) { | ||
75 | + fn(); | ||
76 | + }); | ||
77 | +</script> | ||
78 | +<style type="text/css"> | ||
79 | + td input:not([type=button]) { | ||
80 | + width: 80px; | ||
81 | + } | ||
82 | + div.upload-tips-info{ | ||
83 | + margin-top: 20px; | ||
84 | + font-weight: 800; | ||
85 | + } | ||
86 | + div.upload-tips-info p{ | ||
87 | + color: red!important; | ||
88 | + } | ||
89 | +</style> |
hg-monitor-web-base/src/main/resources/static/src/views/informationAsset/dbInstanceAdd.html
0 → 100644
1 | +<article> | ||
2 | + <div class="layui-card-body"> | ||
3 | + <fieldset class="layui-elem-field layui-field-title"> | ||
4 | + <legend>数据库实例信息</legend> | ||
5 | + </fieldset> | ||
6 | + <form class="layui-form layui-form-pane" lay-filter="add-informationdbInstance-form" | ||
7 | + id="add-informationdbInstance-form" onsubmit="return false;"> | ||
8 | + <input hidden name="id" id="id" lay-verify="checkReportIsExist"> | ||
9 | + <div class="layui-form-item"> | ||
10 | + <div class="layui-inline inline-onethird"> | ||
11 | + <label class="layui-form-label"><span>*</span>业务类型</label> | ||
12 | + <div class="layui-input-inline"> | ||
13 | + <select name="bizId" id="add-information-dbInstance" | ||
14 | + lay-filter="add-information-dbInstance" lay-verify="required"> | ||
15 | + <option value="">业务类型</option> | ||
16 | + </select> | ||
17 | + </div> | ||
18 | + </div> | ||
19 | + <div class="layui-inline inline-onethird"> | ||
20 | + <label class="layui-form-label">数据库实例登记编号</label> | ||
21 | + <div class="layui-input-inline"> | ||
22 | + <input type="text" class="layui-input" name="instanceCode" id="instanceCode" placeholder="应用中间件登记编号,只做展示" | ||
23 | + readonly="readonly"> | ||
24 | + </div> | ||
25 | + </div> | ||
26 | + <div class="layui-inline inline-onethird"> | ||
27 | + <label class="layui-form-label"><span>*</span>实例名称</label> | ||
28 | + <div class="layui-input-inline"> | ||
29 | + <input type="text" class="layui-input" name="instanceName" id="instanceName" lay-verify="required"> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + | ||
33 | + </div> | ||
34 | + <div class="layui-form-item"> | ||
35 | + <div class="layui-inline inline-onethird"> | ||
36 | + <label class="layui-form-label">所属数据库编号</label> | ||
37 | + <div class="layui-input-inline"> | ||
38 | + <input type="text" class="layui-input" name="databaseCode" id="databaseCode" > | ||
39 | + | ||
40 | + </div> | ||
41 | + </div> | ||
42 | + <div class="layui-inline inline-onethird"> | ||
43 | + <label class="layui-form-label"><span>*</span>节点功能</label> | ||
44 | + <div class="layui-input-inline"> | ||
45 | + <select name="nodeFunction" id="nodeFunction" | ||
46 | + lay-filter="nodeFunction" lay-verify="required"> | ||
47 | + <option value="">节点功能</option> | ||
48 | + </select> | ||
49 | + </div> | ||
50 | + </div> | ||
51 | + <div class="layui-inline inline-onethird"> | ||
52 | + <label class="layui-form-label"><span>*</span>数据库名称</label> | ||
53 | + <div class="layui-input-inline"> | ||
54 | + <input type="text" class="layui-input" name="databaseName" id="databaseName" lay-verify="required"> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + </div> | ||
58 | + <div class="layui-form-item"> | ||
59 | + <div class="layui-inline inline-onethird"> | ||
60 | + <label class="layui-form-label"><span>*</span>操作系统IP地址</label> | ||
61 | + <div class="layui-input-inline"> | ||
62 | + <input type="text" class="layui-input" name="osIp" id="osIp" lay-verify="required"> | ||
63 | + </div> | ||
64 | + </div> | ||
65 | + <div class="layui-inline inline-onethird"> | ||
66 | + <label class="layui-form-label">单位编码</label> | ||
67 | + <div class="layui-input-inline"> | ||
68 | + <input type="text" class="layui-input" name="orgCode" id="orgCode"> | ||
69 | + | ||
70 | + </div> | ||
71 | + </div> | ||
72 | + <div class="layui-inline inline-onethird"> | ||
73 | + <label class="layui-form-label"><span>*</span>资源类型</label> | ||
74 | + <div class="layui-input-inline"> | ||
75 | + <select name="resType" id="resType" | ||
76 | + lay-filter="resType" lay-verify="required"> | ||
77 | + <option value="">资源类型</option> | ||
78 | + </select> | ||
79 | + </div> | ||
80 | + </div> | ||
81 | + </div> | ||
82 | + <div class="layui-form-item"> | ||
83 | + <div class="layui-inline inline-onethird"> | ||
84 | + <label class="layui-form-label">所属资源编号</label> | ||
85 | + <div class="layui-input-inline"> | ||
86 | + <input type="text" class="layui-input" name="resCode" id="resCode" > | ||
87 | + </div> | ||
88 | + </div> | ||
89 | + <div class="layui-inline inline-onethird"> | ||
90 | + <label class="layui-form-label">服务端口</label> | ||
91 | + <div class="layui-input-inline"> | ||
92 | + <input type="text" class="layui-input" name="port" id="port"> | ||
93 | + </div> | ||
94 | + </div> | ||
95 | + <div class="layui-inline inline-onethird"> | ||
96 | + <label class="layui-form-label">环境</label> | ||
97 | + <div class="layui-input-inline"> | ||
98 | + <select name="env" id="env" | ||
99 | + lay-filter="env" > | ||
100 | + <option value="">环境</option> | ||
101 | + <option value="1">生产</option> | ||
102 | + <option value="2">预生产</option> | ||
103 | + </select> | ||
104 | + </div> | ||
105 | + </div> | ||
106 | + </div> | ||
107 | + <div class="layui-form-item"> | ||
108 | + <div class="layui-inline inline-onethird"> | ||
109 | + <label class="layui-form-label">是否监控</label> | ||
110 | + <div class="layui-input-inline"> | ||
111 | + <select name="monitorStatus" id="monitorStatus" | ||
112 | + lay-filter="monitorStatus" > | ||
113 | + <option value="">是否监控</option> | ||
114 | + <option value="0">未监控</option> | ||
115 | + <option value="1">已监控</option> | ||
116 | + </select> | ||
117 | + </div> | ||
118 | + </div> | ||
119 | + <div class="layui-inline inline-onethird"> | ||
120 | + <label class="layui-form-label">是否备份</label> | ||
121 | + <div class="layui-input-inline"> | ||
122 | + <select name="backStatus" id="backStatus" | ||
123 | + lay-filter="backStatus" > | ||
124 | + <option value="">是否备份</option> | ||
125 | + <option value="0">未备份</option> | ||
126 | + <option value="1">已备份</option> | ||
127 | + </select> | ||
128 | + </div> | ||
129 | + </div> | ||
130 | + </div> | ||
131 | + <button type="submit" lay-submit lay-filter="dbInstance-form-save-id" class="layui-btn hide" | ||
132 | + id="dbInstance-form-save-id">保存 | ||
133 | + </button> | ||
134 | + </form> | ||
135 | + </div> | ||
136 | +</article> | ||
137 | +<script> | ||
138 | + layui.use('informationDbInstanceAdd', function (fn) { | ||
139 | + fn({{d}}) | ||
140 | + }) | ||
141 | +</script> |
1 | +<title>PC服务器管理</title> | ||
2 | +<article class="page-container template"> | ||
3 | + <div class="page-panel"> | ||
4 | + <div class="main"> | ||
5 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
6 | + <div style="display: flex;justify-content: space-between;align-items: center;"> | ||
7 | + <form class="layui-form layui-card-header" onsubmit="return false" | ||
8 | + lay-filter="host-index-form"> | ||
9 | + <div class="layui-form-item"> | ||
10 | + <div class="layui-inline"> | ||
11 | + <div class="layui-input-inline"> | ||
12 | + <select name="busId" id="slt-information-host" | ||
13 | + lay-filter="slt-information-host" lay-search> | ||
14 | + <option value="">=业务系统=</option> | ||
15 | + </select> | ||
16 | + </div> | ||
17 | + </div> | ||
18 | + <button class="layui-inline layui-btn layui-btn-sm layui-btn-normal active" | ||
19 | + id="orgSearchBtn" >搜索 | ||
20 | + </button> | ||
21 | + </div> | ||
22 | + </form> | ||
23 | + | ||
24 | + </div> | ||
25 | + <div style="margin-bottom: 10px;margin-top: 10px;"> | ||
26 | + <button id="addHostBtn" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i | ||
27 | + class="layui-icon"></i>新增 | ||
28 | + </button> | ||
29 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="host_download" > | ||
30 | + <i class="layui-icon"></i>模板下载 | ||
31 | + </button> | ||
32 | + <button id="host_temp_import" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i | ||
33 | + class="layui-icon"></i>导入 | ||
34 | + </button> | ||
35 | + <button class="layui-btn layui-btn-sm layui-btn-normal" | ||
36 | + id="btn-host-export-excel"> | ||
37 | + <i class="layui-icon"></i>导出 | ||
38 | + </button> | ||
39 | + </div> | ||
40 | + <table id="host_table_id" class="layui-table"> | ||
41 | + | ||
42 | + </table> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | + </div> | ||
46 | +</article> | ||
47 | +<!--导入信息窗口--> | ||
48 | +<script id="host-import-form" type="text/html"> | ||
49 | + <div class="upload-area-content"> | ||
50 | + <form class="layui-form layui-form-pane" action=""> | ||
51 | + <div class="layui-form-item"> | ||
52 | + <div class="layui-inline"> | ||
53 | + <label class="layui-form-label">文件选择</label> | ||
54 | + <div class="layui-upload"> | ||
55 | + <div class="layui-input-block"> | ||
56 | + <input id="host-display-file-name" type="text" name="title" lay-verify="title" | ||
57 | + autocomplete="off" | ||
58 | + placeholder="请选择文件" class="layui-input layui-icon-read " readonly="readonly"> | ||
59 | + </div> | ||
60 | + <div class="upload-tips-info" > | ||
61 | + <p> 提示:只支持xlsx|xls格式导入</p> | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + </div> | ||
65 | + <div class="layui-inline"> | ||
66 | + <button style="display: none" type="button" class="layui-btn layui-btn-normal" id="uploadActionBtn"> | ||
67 | + 上传 | ||
68 | + </button> | ||
69 | + </div> | ||
70 | + </div> | ||
71 | + </form> | ||
72 | + </div> | ||
73 | +</script> | ||
74 | +<script> | ||
75 | + layui.use('informationHost', function (fn) { | ||
76 | + fn(); | ||
77 | + }); | ||
78 | +</script> | ||
79 | +<style type="text/css"> | ||
80 | + td input:not([type=button]) { | ||
81 | + width: 80px; | ||
82 | + } | ||
83 | + div.upload-tips-info{ | ||
84 | + margin-top: 20px; | ||
85 | + font-weight: 800; | ||
86 | + } | ||
87 | + div.upload-tips-info p{ | ||
88 | + color: red!important; | ||
89 | + } | ||
90 | +</style> |
1 | +<article> | ||
2 | + <div class="layui-card-body"> | ||
3 | + <fieldset class="layui-elem-field layui-field-title"> | ||
4 | + <legend>PC服务器信息</legend> | ||
5 | + </fieldset> | ||
6 | + <form class="layui-form layui-form-pane" lay-filter="add-informationhost-form" | ||
7 | + id="add-informationhost-form" onsubmit="return false;"> | ||
8 | + <input hidden name="id" id="id" lay-verify="checkReportIsExist"> | ||
9 | + <div class="layui-form-item"> | ||
10 | + <div class="layui-inline inline-onethird"> | ||
11 | + <label class="layui-form-label"><span>*</span>业务类型</label> | ||
12 | + <div class="layui-input-inline"> | ||
13 | + <select name="bizId" id="add-information-host" | ||
14 | + lay-filter="add-information-host" lay-verify="required"> | ||
15 | + <option value="">业务类型</option> | ||
16 | + </select> | ||
17 | + </div> | ||
18 | + </div> | ||
19 | + <div class="layui-inline inline-onethird"> | ||
20 | + <label class="layui-form-label">PC服务器编号</label> | ||
21 | + <div class="layui-input-inline"> | ||
22 | + <input type="text" class="layui-input" name="hostCode" id="hostCode" placeholder="操作系统编号,只做展示" | ||
23 | + readonly="readonly"> | ||
24 | + </div> | ||
25 | + </div> | ||
26 | + <div class="layui-inline inline-onethird"> | ||
27 | + <label class="layui-form-label"><span>*</span>服务器名称</label> | ||
28 | + <div class="layui-input-inline"> | ||
29 | + <input type="text" class="layui-input" name="hostName" id="hostName" lay-verify="required"> | ||
30 | + | ||
31 | + </div> | ||
32 | + </div> | ||
33 | + </div> | ||
34 | + <div class="layui-form-item"> | ||
35 | + <div class="layui-inline inline-onethird"> | ||
36 | + <label class="layui-form-label">设备编号</label> | ||
37 | + <div class="layui-input-inline"> | ||
38 | + <input type="text" class="layui-input" name="deviceNo" id="deviceNo"> | ||
39 | + </div> | ||
40 | + </div> | ||
41 | + <div class="layui-inline inline-onethird"> | ||
42 | + <label class="layui-form-label"><span>*</span>IP地址</label> | ||
43 | + <div class="layui-input-inline"> | ||
44 | + <input type="text" class="layui-input" name="ip" id="ip" lay-verify="required"> | ||
45 | + | ||
46 | + </div> | ||
47 | + </div> | ||
48 | + <div class="layui-inline inline-onethird"> | ||
49 | + <label class="layui-form-label">带外管理IP地址</label> | ||
50 | + <div class="layui-input-inline"> | ||
51 | + <input type="text" class="layui-input" name="obmIp" id="obmIp"> | ||
52 | + | ||
53 | + </div> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + <div class="layui-form-item"> | ||
57 | + <div class="layui-inline inline-onethird"> | ||
58 | + <label class="layui-form-label"><span>*</span>硬盘容量</label> | ||
59 | + <div class="layui-input-inline"> | ||
60 | + <input type="text" class="layui-input" name="capacity" id="capacity" lay-verify="required"> | ||
61 | + </div> | ||
62 | + </div> | ||
63 | + <div class="layui-inline inline-onethird"> | ||
64 | + <label class="layui-form-label"><span>*</span>raid级别</label> | ||
65 | + <div class="layui-input-inline"> | ||
66 | + <input type="text" class="layui-input" name="raidLevel" id="raidLevel" lay-verify="required"> | ||
67 | + </div> | ||
68 | + </div> | ||
69 | + <div class="layui-inline inline-onethird"> | ||
70 | + <label class="layui-form-label"><span>*</span>物理CPU数量</label> | ||
71 | + <div class="layui-input-inline"> | ||
72 | + <input type="text" class="layui-input" name="cpuCount" id="cpuCount" lay-verify="required"> | ||
73 | + </div> | ||
74 | + </div> | ||
75 | + </div> | ||
76 | + <div class="layui-form-item"> | ||
77 | + <div class="layui-inline inline-onethird"> | ||
78 | + <label class="layui-form-label"><span>*</span>核数</label> | ||
79 | + <div class="layui-input-inline"> | ||
80 | + <input type="text" class="layui-input" name="cores" id="cores" lay-verify="required"> | ||
81 | + </div> | ||
82 | + </div> | ||
83 | + <div class="layui-inline inline-onethird"> | ||
84 | + <label class="layui-form-label"><span>*</span>是否超线程</label> | ||
85 | + <div class="layui-input-inline"> | ||
86 | + <select name="isHyper" id="isHyper" | ||
87 | + lay-filter="isHyper" lay-verify="required"> | ||
88 | + <option value="">是否超线程</option> | ||
89 | + <option value="0">否</option> | ||
90 | + <option value="1">是</option> | ||
91 | + </select> | ||
92 | + </div> | ||
93 | + </div> | ||
94 | + <div class="layui-inline inline-onethird"> | ||
95 | + <label class="layui-form-label"><span>*</span>内存总量(GB)</label> | ||
96 | + <div class="layui-input-inline"> | ||
97 | + <input type="text" class="layui-input" name="totalMem" id="totalMem" lay-verify="required"> | ||
98 | + </div> | ||
99 | + </div> | ||
100 | + </div> | ||
101 | + <div class="layui-form-item"> | ||
102 | + <div class="layui-inline inline-onethird"> | ||
103 | + <label class="layui-form-label">操作系统编号</label> | ||
104 | + <div class="layui-input-inline"> | ||
105 | + <select name="osCode" id="osCode" | ||
106 | + lay-filter="osCode"> | ||
107 | + <option value="">操作系统编号</option> | ||
108 | + </select> | ||
109 | + </div> | ||
110 | + </div> | ||
111 | + <div class="layui-inline inline-onethird"> | ||
112 | + <label class="layui-form-label">安装日期</label> | ||
113 | + <div class="layui-input-inline"> | ||
114 | + <input type="text" class="layui-input" name="installDate" id="installDate"> | ||
115 | + </div> | ||
116 | + </div> | ||
117 | + <div class="layui-inline inline-onethird"> | ||
118 | + <label class="layui-form-label"><span>*</span>使用状态</label> | ||
119 | + <div class="layui-input-inline"> | ||
120 | + <select name="hostStatus" id="hostStatus" | ||
121 | + lay-filter="hostStatus" lay-verify="required"> | ||
122 | + <option value="">使用状态</option> | ||
123 | + </select> | ||
124 | + </div> | ||
125 | + </div> | ||
126 | + | ||
127 | + </div> | ||
128 | + <div class="layui-form-item"> | ||
129 | + <div class="layui-inline inline-onethird"> | ||
130 | + <label class="layui-form-label"><span>*</span>磁盘阵列磁盘容量</label> | ||
131 | + <div class="layui-input-inline"> | ||
132 | + <input type="text" class="layui-input" name="externalCapacity" id="externalCapacity" | ||
133 | + lay-verify="required"> | ||
134 | + </div> | ||
135 | + </div> | ||
136 | + <div class="layui-inline inline-onethird"> | ||
137 | + <label class="layui-form-label"><span>*</span>共享节点数量</label> | ||
138 | + <div class="layui-input-inline"> | ||
139 | + <input type="text" class="layui-input" name="sharedNodes" id="sharedNodes" | ||
140 | + lay-verify="required"> | ||
141 | + </div> | ||
142 | + </div> | ||
143 | + <div class="layui-inline inline-onethird"> | ||
144 | + <label class="layui-form-label"><span>*</span>本地可用存储容量</label> | ||
145 | + <div class="layui-input-inline"> | ||
146 | + <input type="text" class="layui-input" name="availableCapacity" id="availableCapacity" lay-verify="required"> | ||
147 | + </div> | ||
148 | + </div> | ||
149 | + </div> | ||
150 | + <div class="layui-form-item"> | ||
151 | + <div class="layui-inline inline-onethird"> | ||
152 | + <label class="layui-form-label"><span>*</span>本地磁盘分布节点数</label> | ||
153 | + <div class="layui-input-inline"> | ||
154 | + <input type="text" class="layui-input" name="distributionNodes" id="distributionNodes" lay-verify="required"> | ||
155 | + </div> | ||
156 | + </div> | ||
157 | + <div class="layui-inline inline-onethird"> | ||
158 | + <label class="layui-form-label">运维管理单位</label> | ||
159 | + <div class="layui-input-inline"> | ||
160 | + <select name="orgId" id="orgId" | ||
161 | + lay-filter="orgId" > | ||
162 | + <option value="">运维管理单位</option> | ||
163 | + </select> | ||
164 | + </div> | ||
165 | + </div> | ||
166 | + <div class="layui-inline inline-onethird"> | ||
167 | + <label class="layui-form-label">运维管理单位联系电话</label> | ||
168 | + <div class="layui-input-inline"> | ||
169 | + <input type="text" class="layui-input" name="orgPhone" id ="orgPhone" > | ||
170 | + </div> | ||
171 | + </div> | ||
172 | + </div> | ||
173 | + <div class="layui-form-item"> | ||
174 | + | ||
175 | + <div class="layui-inline inline-onethird"> | ||
176 | + <label class="layui-form-label">运维公司</label> | ||
177 | + <div class="layui-input-inline"> | ||
178 | + <select name="factoryId" id="factoryId" | ||
179 | + lay-filter="factoryId" > | ||
180 | + <option value="">运维公司</option> | ||
181 | + </select> | ||
182 | + </div> | ||
183 | + </div> | ||
184 | + <div class="layui-inline inline-onethird"> | ||
185 | + <label class="layui-form-label">运维联系人</label> | ||
186 | + <div class="layui-input-inline"> | ||
187 | + <input type="text" class="layui-input" name="factoryUser" id="factoryUser" > | ||
188 | + </div> | ||
189 | + </div> | ||
190 | + <div class="layui-inline inline-onethird"> | ||
191 | + <label class="layui-form-label">运维联系人电话</label> | ||
192 | + <div class="layui-input-inline"> | ||
193 | + <input type="text" class="layui-input" name="factoryPhone" id ="factoryPhone" > | ||
194 | + </div> | ||
195 | + </div> | ||
196 | + </div> | ||
197 | + <div class="layui-form-item"> | ||
198 | + <div class="layui-inline inline-onethird"> | ||
199 | + <label class="layui-form-label">备注</label> | ||
200 | + <div class="layui-input-inline"> | ||
201 | + <input type="text" class="layui-input" name="remark" id ="remark" > | ||
202 | + </div> | ||
203 | + </div> | ||
204 | + <div class="layui-inline inline-onethird"> | ||
205 | + <label class="layui-form-label">单位编码</label> | ||
206 | + <div class="layui-input-inline"> | ||
207 | + <input type="text" class="layui-input" name="orgCode" id ="orgCode" > | ||
208 | + </div> | ||
209 | + </div> | ||
210 | + <div class="layui-inline inline-onethird"> | ||
211 | + <label class="layui-form-label">环境</label> | ||
212 | + <div class="layui-input-inline"> | ||
213 | + <select name="env" id="env" | ||
214 | + lay-filter="env" > | ||
215 | + <option value="">环境</option> | ||
216 | + <option value="1">生产</option> | ||
217 | + <option value="2">预生产</option> | ||
218 | + </select> | ||
219 | + </div> | ||
220 | + </div> | ||
221 | + </div> | ||
222 | + <div class="layui-form-item"> | ||
223 | + <div class="layui-inline inline-onethird"> | ||
224 | + <label class="layui-form-label">是否监控</label> | ||
225 | + <div class="layui-input-inline"> | ||
226 | + <select name="monitorStatus" id="monitorStatus" | ||
227 | + lay-filter="monitorStatus" > | ||
228 | + <option value="">是否监控</option> | ||
229 | + <option value="0">未监控</option> | ||
230 | + <option value="1">已监控</option> | ||
231 | + </select> | ||
232 | + </div> | ||
233 | + </div> | ||
234 | + <div class="layui-inline inline-onethird"> | ||
235 | + <label class="layui-form-label">是否备份</label> | ||
236 | + <div class="layui-input-inline"> | ||
237 | + <select name="backStatus" id="backStatus" | ||
238 | + lay-filter="backStatus" > | ||
239 | + <option value="">是否备份</option> | ||
240 | + <option value="0">未备份</option> | ||
241 | + <option value="1">已备份</option> | ||
242 | + </select> | ||
243 | + </div> | ||
244 | + </div> | ||
245 | + </div> | ||
246 | + <button type="submit" lay-submit lay-filter="host-form-save-id" class="layui-btn hide" | ||
247 | + id="host-form-save-id">保存 | ||
248 | + </button> | ||
249 | + </form> | ||
250 | + </div> | ||
251 | +</article> | ||
252 | +<script> | ||
253 | + layui.use('informationHostAdd', function (fn) { | ||
254 | + fn({{d}}) | ||
255 | + }) | ||
256 | +</script> |
1 | +<title>IP管理</title> | ||
2 | +<article class="page-container template"> | ||
3 | + <div class="page-panel"> | ||
4 | + <div class="main"> | ||
5 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
6 | + <div style="display: flex;justify-content: space-between;align-items: center;"> | ||
7 | + <form class="layui-form layui-card-header" onsubmit="return false" | ||
8 | + lay-filter="ip-index-form"> | ||
9 | + <div class="layui-form-item"> | ||
10 | + <div class="layui-inline"> | ||
11 | + <div class="layui-input-inline"> | ||
12 | + <select name="busId" id="slt-information-ip" | ||
13 | + lay-filter="slt-information-ip" lay-search> | ||
14 | + <option value="">=业务系统=</option> | ||
15 | + </select> | ||
16 | + </div> | ||
17 | + </div> | ||
18 | + <button class="layui-inline layui-btn layui-btn-sm layui-btn-normal active" | ||
19 | + id="orgSearchBtn" >搜索 | ||
20 | + </button> | ||
21 | + </div> | ||
22 | + </form> | ||
23 | + | ||
24 | + </div> | ||
25 | + <div style="margin-bottom: 10px;margin-top: 10px;"> | ||
26 | + <button id="addIpBtn" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i | ||
27 | + class="layui-icon"></i>新增 | ||
28 | + </button> | ||
29 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="ip_download" > | ||
30 | + <i class="layui-icon"></i>模板下载 | ||
31 | + </button> | ||
32 | + <button id="ip_temp_import" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i | ||
33 | + class="layui-icon"></i>导入 | ||
34 | + </button> | ||
35 | + <button class="layui-btn layui-btn-sm layui-btn-normal" | ||
36 | + id="btn-ip-export-excel"> | ||
37 | + <i class="layui-icon"></i>导出 | ||
38 | + </button> | ||
39 | + </div> | ||
40 | + <table id="ip_table_id" class="layui-table"> | ||
41 | + | ||
42 | + </table> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | + </div> | ||
46 | +</article> | ||
47 | +<!--导入信息窗口--> | ||
48 | +<script id="ip-import-form" type="text/html"> | ||
49 | + <div class="upload-area-content"> | ||
50 | + <form class="layui-form layui-form-pane" action=""> | ||
51 | + <div class="layui-form-item"> | ||
52 | + <div class="layui-inline"> | ||
53 | + <label class="layui-form-label">文件选择</label> | ||
54 | + <div class="layui-upload"> | ||
55 | + <div class="layui-input-block"> | ||
56 | + <input id="ip-display-file-name" type="text" name="title" lay-verify="title" | ||
57 | + autocomplete="off" | ||
58 | + placeholder="请选择文件" class="layui-input layui-icon-read " readonly="readonly"> | ||
59 | + </div> | ||
60 | + <div class="upload-tips-info" > | ||
61 | + <p> 提示:只支持xlsx|xls格式导入</p> | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + </div> | ||
65 | + <div class="layui-inline"> | ||
66 | + <button style="display: none" type="button" class="layui-btn layui-btn-normal" id="uploadActionBtn"> | ||
67 | + 上传 | ||
68 | + </button> | ||
69 | + </div> | ||
70 | + </div> | ||
71 | + </form> | ||
72 | + </div> | ||
73 | +</script> | ||
74 | +<script> | ||
75 | + layui.use('informationIp', function (fn) { | ||
76 | + fn(); | ||
77 | + }); | ||
78 | +</script> | ||
79 | +<style type="text/css"> | ||
80 | + td input:not([type=button]) { | ||
81 | + width: 80px; | ||
82 | + } | ||
83 | + div.upload-tips-info{ | ||
84 | + margin-top: 20px; | ||
85 | + font-weight: 800; | ||
86 | + } | ||
87 | + div.upload-tips-info p{ | ||
88 | + color: red!important; | ||
89 | + } | ||
90 | +</style> |
-
Please register or login to post a comment