Showing
8 changed files
with
456 additions
and
0 deletions
@@ -23,6 +23,7 @@ layui.define(['xmSelect', 'md5'], function (exports) { | @@ -23,6 +23,7 @@ layui.define(['xmSelect', 'md5'], function (exports) { | ||
23 | domainInspectionURI: sessionStorage.getItem('domainInspectionURI'), // 巡检系统地址 | 23 | domainInspectionURI: sessionStorage.getItem('domainInspectionURI'), // 巡检系统地址 |
24 | domainAssetsManage: sessionStorage.getItem('domainAssetsManage'), // 资产系统地址 | 24 | domainAssetsManage: sessionStorage.getItem('domainAssetsManage'), // 资产系统地址 |
25 | graphEditorOrigin: sessionStorage.getItem('graphEditorOrigin'), // 拓扑系统地址 | 25 | graphEditorOrigin: sessionStorage.getItem('graphEditorOrigin'), // 拓扑系统地址 |
26 | + ajScreenStatement: sessionStorage.getItem('ajWeb'), //aj系统地址 | ||
26 | workflowName: sessionStorage.getItem('workflow'),//流程系统地址 | 27 | workflowName: sessionStorage.getItem('workflow'),//流程系统地址 |
27 | domainCMDBName: "http://80.12.147.24:8888/hgkjcmdb", //杭州咨源老cmdb系统地址 | 28 | domainCMDBName: "http://80.12.147.24:8888/hgkjcmdb", //杭州咨源老cmdb系统地址 |
28 | lineTimer: null,//性能曲线图全局定时器 | 29 | lineTimer: null,//性能曲线图全局定时器 |
@@ -1380,6 +1381,16 @@ layui.define(['xmSelect', 'md5'], function (exports) { | @@ -1380,6 +1381,16 @@ layui.define(['xmSelect', 'md5'], function (exports) { | ||
1380 | } | 1381 | } |
1381 | }); | 1382 | }); |
1382 | }, | 1383 | }, |
1384 | + viewAjView: function (reportCode) { | ||
1385 | + layer.load(2); | ||
1386 | + layer.open({ | ||
1387 | + type: 2, | ||
1388 | + content: obj.ajScreenStatement + "/#/bigscreen/viewer?reportCode=" + reportCode+"?access_token=" + localStorage.getItem('access_token'), | ||
1389 | + area: ['80%', '80%'], | ||
1390 | + title: '' | ||
1391 | + }); | ||
1392 | + layer.closeAll('loading'); | ||
1393 | + }, | ||
1383 | viewBizTopo: function (busId) { | 1394 | viewBizTopo: function (busId) { |
1384 | layer.load(2); | 1395 | layer.load(2); |
1385 | admin.req({ | 1396 | admin.req({ |
@@ -219,6 +219,13 @@ global.viewResTopo = (resId) => { | @@ -219,6 +219,13 @@ global.viewResTopo = (resId) => { | ||
219 | } | 219 | } |
220 | 220 | ||
221 | /** | 221 | /** |
222 | + * aj报表预览 | ||
223 | + */ | ||
224 | +global.viewAjView = (reportCode) => { | ||
225 | + let lyaui = global.layui; | ||
226 | + lyaui.common.viewAjView(reportCode) | ||
227 | +} | ||
228 | +/** | ||
222 | * 打开资产列表 | 229 | * 打开资产列表 |
223 | * @param topoId | 230 | * @param topoId |
224 | */ | 231 | */ |
@@ -18,6 +18,8 @@ url: | @@ -18,6 +18,8 @@ url: | ||
18 | mxgraph_editor: http://127.0.0.1:8085 | 18 | mxgraph_editor: http://127.0.0.1:8085 |
19 | tingyun: http://127.0.0.1:8088 | 19 | tingyun: http://127.0.0.1:8088 |
20 | bigScreen: http://127.0.0.1:8081 | 20 | bigScreen: http://127.0.0.1:8081 |
21 | + # aj配置 | ||
22 | + ajWeb: http://192.168.0.69:6677 | ||
21 | # 一体化视图 | 23 | # 一体化视图 |
22 | ythView: http://192.168.0.69:18089 | 24 | ythView: http://192.168.0.69:18089 |
23 | # cmdb | 25 | # cmdb |
@@ -40,6 +40,7 @@ | @@ -40,6 +40,7 @@ | ||
40 | sessionStorage.setItem('tingyun', res1[0].tingyun); | 40 | sessionStorage.setItem('tingyun', res1[0].tingyun); |
41 | sessionStorage.setItem('bigScreen', res1[0].bigScreen); | 41 | sessionStorage.setItem('bigScreen', res1[0].bigScreen); |
42 | sessionStorage.setItem('ythView', res1[0].ythView); | 42 | sessionStorage.setItem('ythView', res1[0].ythView); |
43 | + sessionStorage.setItem('ajWeb', res1[0].ajWeb); | ||
43 | //xwx add 读取业务健康度页面IP地址 2021-10-25 start | 44 | //xwx add 读取业务健康度页面IP地址 2021-10-25 start |
44 | sessionStorage.setItem('ywHealth', res1[0].ywHealth); | 45 | sessionStorage.setItem('ywHealth', res1[0].ywHealth); |
45 | //xwx add 读取业务健康度页面IP地址 2021-10-25 end | 46 | //xwx add 读取业务健康度页面IP地址 2021-10-25 end |
@@ -169,6 +169,11 @@ const routes = [{ | @@ -169,6 +169,11 @@ const routes = [{ | ||
169 | path: '/alarmsubscribe/excludeKpi', | 169 | path: '/alarmsubscribe/excludeKpi', |
170 | name: 'alarmSubscribeExcludeKpi', | 170 | name: 'alarmSubscribeExcludeKpi', |
171 | component: () => myImport('views/alarmsubscribe/index') | 171 | component: () => myImport('views/alarmsubscribe/index') |
172 | + }, | ||
173 | + { | ||
174 | + path: '/vue3/ajConfig', | ||
175 | + name: 'ajConfig', | ||
176 | + component: () => myImport('views/ajConfig/index') | ||
172 | } | 177 | } |
173 | ]; | 178 | ]; |
174 | 179 |
1 | +<div class="container" :style="{'height':height+'px','max-height':height+'px'}"> | ||
2 | + <div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%'}"> | ||
3 | + <div class="search"> | ||
4 | + <div class="btns" style="justify-content: left;padding-left: 0px"> | ||
5 | + <el-form-item> | ||
6 | + <el-button type="primary" @click="addAj()" style="margin-left: 10px">新增</el-button> | ||
7 | + </el-form-item> | ||
8 | + </div> | ||
9 | + <div class="design" style="float:right;padding-left: 1410px"> | ||
10 | + <el-form-item> | ||
11 | + <el-button type="primary" @click="handleView()" style="margin-left: 10px">设计</el-button> | ||
12 | + </el-form-item> | ||
13 | + </div> | ||
14 | + </div> | ||
15 | + | ||
16 | + <div class="search-table"> | ||
17 | + <cm-table-page v-if="tableDataList.length" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList" | ||
18 | + :showIndex="true" :total="count" :showSelection="true" | ||
19 | + :showBorder="true" :loading="false" :pageSize="pageSize" | ||
20 | + :showPage="true" :showTools="true" :height="(height - 130)" > | ||
21 | + <template #default="{row,prop,column}"> | ||
22 | + <div v-if="prop == 'type'"> | ||
23 | + <div v-if="row.type == 0"> | ||
24 | + <el-tag>菜单</el-tag> | ||
25 | + </div> | ||
26 | + | ||
27 | + <div v-if="row.type == 1"> | ||
28 | + <el-tag>按钮</el-tag> | ||
29 | + </div> | ||
30 | + | ||
31 | + <div v-if="row.type == 2"> | ||
32 | + <el-tag>详情页</el-tag> | ||
33 | + </div> | ||
34 | + </div> | ||
35 | + </template> | ||
36 | + <template #tools="{scope}"> | ||
37 | + <div class="list-handle"> | ||
38 | + <span class="icon-bg"> | ||
39 | + <i class="el-icon-delete" title="删除" @click="handleDelete(scope.row)"></i> | ||
40 | + </span> | ||
41 | + <span class="icon-bg"> | ||
42 | + <i class="el-icon-edit-outline" title="修改" @click="handleUpdate(scope.row)"></i> | ||
43 | + </span> | ||
44 | + <span class="icon-bg"> | ||
45 | + <i class="el-icon-view" title="预览" @click="handleView(scope.row)"></i> | ||
46 | + </span> | ||
47 | + </div> | ||
48 | + </template> | ||
49 | + </cm-table-page> | ||
50 | + </div> | ||
51 | + </div> | ||
52 | +</div> | ||
53 | + | ||
54 | +<!--新增编辑弹框--> | ||
55 | +<cm-dialog :title="titleName" width="40%" :showDialogVisible="cacheVisible" @hidedialog="cancelBtn" :showFooter="false"> | ||
56 | + <template v-slot> | ||
57 | + <el-form | ||
58 | + label-width="120px" | ||
59 | + ref="ruleForm" | ||
60 | + :model="ajConfigFrom" | ||
61 | + :rules="docRulesForm" | ||
62 | + label-position="right" | ||
63 | + label-width="120px"> | ||
64 | + | ||
65 | + <el-form-item label="编号" prop="id"> | ||
66 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.id" clearable></el-input> | ||
67 | + </el-form-item> | ||
68 | + | ||
69 | + | ||
70 | + <el-form-item label="类型" prop="type"> | ||
71 | + <el-radio v-model="ajConfigFrom.type" label="0" size="large">菜单</el-radio> | ||
72 | + <el-radio v-model="ajConfigFrom.type" label="1" size="large">按钮</el-radio> | ||
73 | + <el-radio v-model="ajConfigFrom.type" label="2" size="large">详情页</el-radio> | ||
74 | + <div> | ||
75 | + <span>示例:12345646 说明:12132123</span> | ||
76 | + </div> | ||
77 | + </el-form-item> | ||
78 | + | ||
79 | + | ||
80 | + <el-form-item label="父菜单" prop="menuPid" v-if="ajConfigFrom.type==0"> | ||
81 | + <el-select v-model="ajConfigFrom.menuPid" placeholder="请选择" style="width: 555px;"> | ||
82 | + <el-option | ||
83 | + v-for="item in menuOptions" | ||
84 | + :key="item.value" | ||
85 | + :label="item.label" | ||
86 | + :value="item.value" | ||
87 | + :disabled="item.disabled"> | ||
88 | + </el-option> | ||
89 | + </el-select> | ||
90 | + </el-form-item> | ||
91 | + | ||
92 | + <el-form-item label="菜单名称" prop="menuName" v-if="ajConfigFrom.type==0"> | ||
93 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.menuName" clearable></el-input> | ||
94 | + </el-form-item> | ||
95 | + | ||
96 | + <el-form-item label="设计页面" prop="designPage"> | ||
97 | + <el-select v-model="ajConfigFrom.designPage" placeholder="请选择" style="width: 510px;"> | ||
98 | + <el-option | ||
99 | + v-for="item in options" | ||
100 | + :key="item.value" | ||
101 | + :label="item.label" | ||
102 | + :value="item.value" | ||
103 | + :disabled="item.disabled"> | ||
104 | + </el-option> | ||
105 | + </el-select> | ||
106 | + <el-tag @click="preview(ajConfigFrom.designPage)">预览</el-tag> | ||
107 | + </el-form-item> | ||
108 | + | ||
109 | + <el-form-item label="传递参数" prop="param"> | ||
110 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.param" clearable></el-input> | ||
111 | + <span>示例:12345646 说明:12132123</span> | ||
112 | + </el-form-item> | ||
113 | + | ||
114 | + <el-form-item label="资源类型" prop="resType" v-if="ajConfigFrom.type==2"> | ||
115 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.resType" clearable></el-input> | ||
116 | + </el-form-item> | ||
117 | + | ||
118 | + <el-form-item label="厂商" prop="firm" v-if="ajConfigFrom.type==2"> | ||
119 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.firm" clearable></el-input> | ||
120 | + </el-form-item> | ||
121 | + | ||
122 | + <el-form-item label="绑定资源" prop="resource" v-if="ajConfigFrom.type==2"> | ||
123 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.resource" clearable></el-input> | ||
124 | + </el-form-item> | ||
125 | + | ||
126 | + <el-form-item label="备注" prop="remark"> | ||
127 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.remark" clearable></el-input> | ||
128 | + </el-form-item> | ||
129 | + | ||
130 | + <el-form-item> | ||
131 | + <el-button :size="$global.elementSize" type="primary" @click="addAjConfig('ruleForm')">保存</el-button> | ||
132 | + <el-button :size="$global.elementSize" @click="cancelBtn">取消</el-button> | ||
133 | + </el-form-item> | ||
134 | + </el-form> | ||
135 | + </template> | ||
136 | +</cm-dialog> | ||
137 | + |
1 | +export default { | ||
2 | + name: 'ajConfig', | ||
3 | + template: '', | ||
4 | + components: {}, | ||
5 | + props:[], | ||
6 | + data () { | ||
7 | + return { | ||
8 | + radio:'0', | ||
9 | + docRulesForm: { | ||
10 | + id: [ | ||
11 | + { | ||
12 | + required: true, | ||
13 | + message: '请填写文档编号!', | ||
14 | + trigger: 'blur', | ||
15 | + } | ||
16 | + ], | ||
17 | + type:[{ | ||
18 | + required: true, | ||
19 | + message: '请选择类型!', | ||
20 | + trigger: 'blur', | ||
21 | + }], | ||
22 | + designPage:[{ | ||
23 | + required: true, | ||
24 | + message: '请选择设计页面!', | ||
25 | + trigger: 'blur', | ||
26 | + }], | ||
27 | + resource:[{ | ||
28 | + required: true, | ||
29 | + message: '请填写绑定资源!', | ||
30 | + trigger: 'blur', | ||
31 | + }], | ||
32 | + } | ||
33 | + } | ||
34 | + | ||
35 | + }, | ||
36 | + setup(props, {attrs, slots, emit}){ | ||
37 | + const {proxy} = Vue.getCurrentInstance(); | ||
38 | + let height = Vue.ref(window.innerHeight - 10); | ||
39 | + //表格字段 | ||
40 | + let columns=Vue.ref([ | ||
41 | + { | ||
42 | + prop: 'id', | ||
43 | + label: '编号', | ||
44 | + sortable: true, | ||
45 | + align: 'center', | ||
46 | + width:'250' | ||
47 | + }, | ||
48 | + { | ||
49 | + prop: 'type', | ||
50 | + label: '类型', | ||
51 | + sortable: true, | ||
52 | + align: 'center', | ||
53 | + width:'250', | ||
54 | + }, | ||
55 | + { | ||
56 | + prop: 'resType', | ||
57 | + label: '资源类型', | ||
58 | + sortable: true, | ||
59 | + align: 'center', | ||
60 | + width:'250' | ||
61 | + },{ | ||
62 | + prop: 'firm', | ||
63 | + label: '品牌', | ||
64 | + sortable: true, | ||
65 | + align: 'center', | ||
66 | + width:'250' | ||
67 | + },{ | ||
68 | + prop: 'designPage', | ||
69 | + label: '设计器编码', | ||
70 | + sortable: true, | ||
71 | + align: 'center', | ||
72 | + width:'250' | ||
73 | + },{ | ||
74 | + prop: 'param', | ||
75 | + label: '参数', | ||
76 | + sortable: true, | ||
77 | + align: 'left' | ||
78 | + } | ||
79 | + ]) | ||
80 | + let currentPage=Vue.ref(1); | ||
81 | + let pageSize=Vue.ref(10); | ||
82 | + let keyword=Vue.ref(); | ||
83 | + let count=Vue.ref(0); | ||
84 | + let tableDataList=Vue.ref([]); | ||
85 | + let checkedId = Vue.ref(0); | ||
86 | + let titleName=Vue.ref('新增配置信息') | ||
87 | + let cacheVisible=Vue.ref(false); | ||
88 | + let viewData=Vue.ref(); | ||
89 | + let addOrUpdate=Vue.ref(false) | ||
90 | + let radio=Vue.ref(0); | ||
91 | + //下拉框 | ||
92 | + let options=Vue.ref([]); | ||
93 | + //菜单下拉框 | ||
94 | + let menuOptions=Vue.ref([]); | ||
95 | + let ajConfigFrom = Vue.ref({ | ||
96 | + id:'', | ||
97 | + type: 0, | ||
98 | + designPage: '', | ||
99 | + param: '', | ||
100 | + resType: '', | ||
101 | + firm:'', | ||
102 | + resource:'', | ||
103 | + remark:'', | ||
104 | + creatTime:'', | ||
105 | + createName:'', | ||
106 | + state:'', | ||
107 | + title:'', | ||
108 | + menuPid:'', | ||
109 | + menuName:'' | ||
110 | + }); | ||
111 | + //新增弹框 | ||
112 | + const addAj=()=>{ | ||
113 | + clearForm(); | ||
114 | + cacheVisible.value=true; | ||
115 | + pageList(); | ||
116 | + menuList(); | ||
117 | + | ||
118 | + } | ||
119 | + //新增或修改aj配置信息 | ||
120 | + let addAjConfig=(ruleForm)=>{ | ||
121 | + let params={}; | ||
122 | + params= ajConfigFrom.value; | ||
123 | + let msg = ''; | ||
124 | + if (addOrUpdate.value){ | ||
125 | + proxy.$http.post(`/api-web/ajConfig/updateAj`, params, function (res) { | ||
126 | + if (res && res.success == true) { | ||
127 | + msg = res.msg; | ||
128 | + cacheVisible.value=false; | ||
129 | + proxy.$global.showMsg(msg); | ||
130 | + } | ||
131 | + }) | ||
132 | + }else{ | ||
133 | + proxy.$http.post(`/api-web/ajConfig/addAj`, params, function (res) { | ||
134 | + if (res && res.success == true) { | ||
135 | + msg = res.msg; | ||
136 | + cacheVisible.value=false; | ||
137 | + proxy.$global.showMsg(msg); | ||
138 | + } | ||
139 | + }) | ||
140 | + } | ||
141 | + clearForm(); | ||
142 | + getDataList(); | ||
143 | + } | ||
144 | + //清理表单 | ||
145 | + let clearForm=()=>{ | ||
146 | + ajConfigFrom.value={ | ||
147 | + id:'', | ||
148 | + type: '0', | ||
149 | + designPage: '', | ||
150 | + param: '', | ||
151 | + resType: '', | ||
152 | + firm:'', | ||
153 | + resource:'', | ||
154 | + remark:'', | ||
155 | + creatTime:'', | ||
156 | + createName:'', | ||
157 | + state:'', | ||
158 | + title:'', | ||
159 | + menuPid:'', | ||
160 | + menuName:'' | ||
161 | + } | ||
162 | + addOrUpdate.value=false; | ||
163 | + } | ||
164 | + | ||
165 | + //删除 | ||
166 | + let handleDelete=(row)=>{ | ||
167 | + let param={ | ||
168 | + id:row.id | ||
169 | + } | ||
170 | + proxy.$http.get(`/api-web/ajConfig/deleteById`, param, function (res) { | ||
171 | + | ||
172 | + if (res && res.success == true) { | ||
173 | + let msg = res.msg; | ||
174 | + if (!msg) { | ||
175 | + msg = "删除失败"; | ||
176 | + } | ||
177 | + proxy.$global.showMsg(msg); | ||
178 | + getDataList(); | ||
179 | + } | ||
180 | + }) | ||
181 | + } | ||
182 | + let handleUpdate=(row)=>{ | ||
183 | + addOrUpdate.value =true; | ||
184 | + ajConfigFrom.value=row; | ||
185 | + cacheVisible.value=true; | ||
186 | + pageList(); | ||
187 | + menuList(); | ||
188 | + } | ||
189 | + | ||
190 | + //预览 | ||
191 | + let preview=(row)=>{ | ||
192 | + proxy.$global.viewAjView(row); | ||
193 | + } | ||
194 | + | ||
195 | + //aj报表管理信息 | ||
196 | + let pageList=()=>{ | ||
197 | + proxy.$http.get(`/api-web/ajConfig/pageList`, null, function (res) { | ||
198 | + if (res && res.success == true) { | ||
199 | + let params=res.object.data.records; | ||
200 | + params.forEach(function(e){ | ||
201 | + let report={} | ||
202 | + report.label=e.reportName; | ||
203 | + report.value=e.reportCode; | ||
204 | + options.value.push(report) | ||
205 | + }); | ||
206 | + } | ||
207 | + }) | ||
208 | + } | ||
209 | + | ||
210 | + //菜单 | ||
211 | + let menuList=()=>{ | ||
212 | + proxy.$http.get(`/api-user/menus/findAlls`, null, function (res) { | ||
213 | + if (res && res.count>0) { | ||
214 | + let params=res.data; | ||
215 | + params.forEach(function(e){ | ||
216 | + let menu={} | ||
217 | + menu.label=e.name; | ||
218 | + menu.value=e.id; | ||
219 | + menuOptions.value.push(menu) | ||
220 | + }); | ||
221 | + } | ||
222 | + }) | ||
223 | + | ||
224 | + } | ||
225 | + //AJ设计登录 | ||
226 | + let handleView=()=>{ | ||
227 | + window.open(sessionStorage.getItem("ajWeb") + '/#/login'); | ||
228 | + } | ||
229 | + | ||
230 | + | ||
231 | + //重新加载表格数据 | ||
232 | + let loadTableDataList = ({page, limit}) => { | ||
233 | + currentPage.value=page; | ||
234 | + pageSize.value=limit; | ||
235 | + getDataList() | ||
236 | + } | ||
237 | + | ||
238 | + //获取aj配置信息 | ||
239 | + let getDataList=()=>{ | ||
240 | + proxy.$http.get(`/api-web/ajConfig/ajConfigList`,null, function (res) { | ||
241 | + if (res && res.data) { | ||
242 | + count.value = res.data.length; | ||
243 | + tableDataList.value = res.data; | ||
244 | + }else{ | ||
245 | + tableDataList.value='暂无数据'; | ||
246 | + } | ||
247 | + }); | ||
248 | + | ||
249 | + } | ||
250 | + | ||
251 | + //关闭弹框 | ||
252 | + let cancelBtn=()=>{ | ||
253 | + cacheVisible.value=false; | ||
254 | + } | ||
255 | + // 挂载完 | ||
256 | + Vue.onMounted(() => { | ||
257 | + getDataList(); | ||
258 | + | ||
259 | + }) | ||
260 | + | ||
261 | + return { | ||
262 | + height, | ||
263 | + columns, | ||
264 | + currentPage, | ||
265 | + count, | ||
266 | + pageSize, | ||
267 | + keyword, | ||
268 | + tableDataList, | ||
269 | + checkedId, | ||
270 | + addAj, | ||
271 | + addAjConfig, | ||
272 | + loadTableDataList, | ||
273 | + getDataList, | ||
274 | + cacheVisible, | ||
275 | + titleName, | ||
276 | + viewData, | ||
277 | + cancelBtn, | ||
278 | + ajConfigFrom, | ||
279 | + handleDelete, | ||
280 | + handleUpdate, | ||
281 | + preview, | ||
282 | + handleView, | ||
283 | + pageList, | ||
284 | + radio, | ||
285 | + options, | ||
286 | + menuList, | ||
287 | + menuOptions | ||
288 | + } | ||
289 | + } | ||
290 | + | ||
291 | +} |
-
Please register or login to post a comment