Merge branch 'master' of http://192.168.1.136:82/monitor_v3/hg-monitor-web
Conflicts: hg-monitor-web-base/src/main/resources/static/src/controller/commonDetail.js
Showing
11 changed files
with
849 additions
and
6 deletions
@@ -2288,7 +2288,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -2288,7 +2288,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
2288 | * @param resId | 2288 | * @param resId |
2289 | */ | 2289 | */ |
2290 | renderActiveAlarms: function (tableId, resId) { | 2290 | renderActiveAlarms: function (tableId, resId) { |
2291 | - //$('#'+tableId).prev().text('实时告警Top5') | 2291 | + $('#'+tableId).prev().text('实时告警Top5') |
2292 | var alarmlist = table.render({ | 2292 | var alarmlist = table.render({ |
2293 | elem: '#' + tableId | 2293 | elem: '#' + tableId |
2294 | , url: common.domainName + '/api-web/home/alarm/alarmListPage' | 2294 | , url: common.domainName + '/api-web/home/alarm/alarmListPage' |
@@ -2298,7 +2298,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -2298,7 +2298,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
2298 | } | 2298 | } |
2299 | , height: 'auto' | 2299 | , height: 'auto' |
2300 | , page: { | 2300 | , page: { |
2301 | - layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'] | 2301 | + layout: ['count', 'prev', 'page', 'next', 'skip'] |
2302 | ,theme: '#1E9FFF' | 2302 | ,theme: '#1E9FFF' |
2303 | } | 2303 | } |
2304 | , limit: 5 | 2304 | , limit: 5 |
@@ -134,11 +134,35 @@ layui.extend({ | @@ -134,11 +134,35 @@ layui.extend({ | ||
134 | 134 | ||
135 | } | 135 | } |
136 | }); | 136 | }); |
137 | + var tabName; | ||
138 | + //start lsq 页面刷新后名称改变,把aj得存储到localStorage中 2022-04-18 | ||
139 | + let routerPath=router.path; | ||
140 | + if(routerPath.indexOf('ajConfig')!=-1 && routerPath.indexOf('view')!=-1 && !localStorage.getItem(router.search.ajConfig)){ | ||
141 | + localStorage.setItem(router.search.ajConfig,admin.tabsPage.elem.text()); | ||
142 | + } | ||
143 | + try { | ||
144 | + let el = admin.tabsPage.elem; | ||
145 | + if(el && el.attr('lay-href-type')){ | ||
146 | + if(el.attr('lay-href-type') == 'menu' && !matchTo){ | ||
147 | + tabName= admin.tabsPage.elem.text(); | ||
148 | + } | ||
149 | + } | ||
150 | + } catch (e){ | ||
151 | + } | ||
152 | + if(!tabName){ | ||
137 | 153 | ||
154 | + if(routerPath.indexOf('ajConfig')!=-1 && routerPath.indexOf('view')!=-1){ | ||
155 | + tabName=localStorage.getItem(router.search.ajConfig); | ||
156 | + }else{ | ||
157 | + tabName= res.title | ||
158 | + | ||
159 | + } | ||
160 | + } | ||
161 | + //end lsq 页面刷新后名称改变 2022-04-18 | ||
138 | //如果未在选项卡中匹配到,则追加选项卡 | 162 | //如果未在选项卡中匹配到,则追加选项卡 |
139 | if(setter.pageTabs && pathURL !== '/'){ | 163 | if(setter.pageTabs && pathURL !== '/'){ |
140 | if(!matchTo){ | 164 | if(!matchTo){ |
141 | - var tabName='' // tab标签名 | 165 | + /*var tabName='' // tab标签名 |
142 | var url=pathURL.substring(1) | 166 | var url=pathURL.substring(1) |
143 | tabList.forEach((e) =>{ | 167 | tabList.forEach((e) =>{ |
144 | if(url === e.path){ | 168 | if(url === e.path){ |
@@ -147,7 +171,7 @@ layui.extend({ | @@ -147,7 +171,7 @@ layui.extend({ | ||
147 | }); | 171 | }); |
148 | if(!tabName){ | 172 | if(!tabName){ |
149 | tabName= res.title | 173 | tabName= res.title |
150 | - } | 174 | + }*/ |
151 | $(APP_BODY).append('<div class="layadmin-tabsbody-item layui-show"></div>'); | 175 | $(APP_BODY).append('<div class="layadmin-tabsbody-item layui-show"></div>'); |
152 | tabsPage.index = tabs.length; | 176 | tabsPage.index = tabs.length; |
153 | element.tabAdd(FILTER_TAB_TBAS, { | 177 | element.tabAdd(FILTER_TAB_TBAS, { |
@@ -164,6 +188,8 @@ layui.extend({ | @@ -164,6 +188,8 @@ layui.extend({ | ||
164 | 188 | ||
165 | //定位当前tabs | 189 | //定位当前tabs |
166 | element.tabChange(FILTER_TAB_TBAS, pathURL); | 190 | element.tabChange(FILTER_TAB_TBAS, pathURL); |
191 | + // 修改为当前菜单名称 lsq 2022-04-18 | ||
192 | + $('* [lay-id="' + pathURL + '"] span').text(tabName) | ||
167 | admin.tabsBodyChange(tabsPage.index); | 193 | admin.tabsBodyChange(tabsPage.index); |
168 | 194 | ||
169 | }).done(function(){ | 195 | }).done(function(){ |
1 | +<title>设计器预览</title> | ||
2 | +<script type="text/html" template> | ||
3 | + {{# | ||
4 | + | ||
5 | + | ||
6 | + var viewURL = window.location.origin + '/vue3/index.html#/ajConfig/view'; | ||
7 | + layui.use(['sessions','common','admin'], function () { | ||
8 | + var $ = layui.$; | ||
9 | + var common = layui.common; | ||
10 | + var admin = layui.admin; | ||
11 | + var arr = []; | ||
12 | + window.location.hash.split('/').forEach(function (v, i) { | ||
13 | + if (v.indexOf('=') != -1) { | ||
14 | + arr.push(v); | ||
15 | + } | ||
16 | + }); | ||
17 | + | ||
18 | + if (arr.length > 0) { | ||
19 | + viewURL += "?" + arr.join("&"); | ||
20 | + } | ||
21 | + $('#actionListIframe').attr('src',viewURL); | ||
22 | + }); | ||
23 | + }} | ||
24 | + <iframe id="actionListIframe" src="{{viewURL}}" frameborder="0" class="layadmin-iframe" style="height: 99.5%!important;"></iframe> | ||
25 | +</script> |
@@ -68,6 +68,16 @@ const routes = [{ | @@ -68,6 +68,16 @@ const routes = [{ | ||
68 | name: 'cacheData', | 68 | name: 'cacheData', |
69 | component: () => myImport('views/cacheData/index') | 69 | component: () => myImport('views/cacheData/index') |
70 | }, | 70 | }, |
71 | + { | ||
72 | + path: '/vue3/ajConfig', | ||
73 | + name: 'ajConfig', | ||
74 | + component: () => myImport('views/ajConfig/index') | ||
75 | + }, | ||
76 | + { | ||
77 | + path: '/ajConfig/view', | ||
78 | + name: 'ajConfigView', | ||
79 | + component: () => myImport('views/ajConfig/view/index') | ||
80 | + }, | ||
71 | ]; | 81 | ]; |
72 | 82 | ||
73 | // hash模式: createWebHashHistory | 83 | // hash模式: createWebHashHistory |
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="keyword" style="padding-left: 10px"> | ||
5 | + <el-form-item > | ||
6 | + <el-input v-model="search.keyword" placeholder="请输入关键字,回车搜索" @keydown.enter.native="getDataList"></el-input> | ||
7 | + </el-form-item> | ||
8 | + </div> | ||
9 | + <div class="selectType" style="padding-left: 10px;width: 120px;"> | ||
10 | + <el-select v-model="couponSelected" class="m-2" placeholder="请选择" size="large" @change="onChangeStripe"> | ||
11 | + <el-option | ||
12 | + v-for="item in typeOptions" | ||
13 | + :key="item.value" | ||
14 | + :label="item.label" | ||
15 | + :value="item.value" | ||
16 | + /> | ||
17 | + </el-select> | ||
18 | + </div> | ||
19 | + <div class="adds" style=""> | ||
20 | + <el-form-item> | ||
21 | + <el-button @click="addAj()" style="margin-left: 10px">新增</el-button> | ||
22 | + </el-form-item> | ||
23 | + </div> | ||
24 | + <div class="design" style="float:right;padding-left: 1200px"> | ||
25 | + <el-form-item> | ||
26 | + <el-button type="primary" @click="handleView()" style="margin-left: 10px">设计</el-button> | ||
27 | + </el-form-item> | ||
28 | + </div> | ||
29 | + </div> | ||
30 | + | ||
31 | + <div class="search-table"> | ||
32 | + <cm-table-page :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList" | ||
33 | + :showIndex="true" :total="count" :showSelection="true" | ||
34 | + :showBorder="true" :loading="false" :pageSize="pageSize" | ||
35 | + :showPage="true" :showTools="true" :height="(height - 130)" > | ||
36 | + <template #default="{row,prop,column}"> | ||
37 | + <div v-if="prop == 'type'"> | ||
38 | + <div v-if="row.type == 0"> | ||
39 | + <el-tag>菜单</el-tag> | ||
40 | + </div> | ||
41 | + | ||
42 | + <div v-if="row.type == 1"> | ||
43 | + <el-tag>按钮</el-tag> | ||
44 | + </div> | ||
45 | + | ||
46 | + <div v-if="row.type == 2"> | ||
47 | + <el-tag>详情页</el-tag> | ||
48 | + </div> | ||
49 | + </div> | ||
50 | + </template> | ||
51 | + <template #tools="{scope}"> | ||
52 | + <div class="list-handle"> | ||
53 | + <span class="icon-bg"> | ||
54 | + <i class="el-icon-delete" title="删除" @click="handleDelete(scope.row)"></i> | ||
55 | + </span> | ||
56 | + <span class="icon-bg"> | ||
57 | + <i class="el-icon-edit-outline" title="修改" @click="handleUpdate(scope.row)"></i> | ||
58 | + </span> | ||
59 | + <span class="icon-bg"> | ||
60 | + <i class="el-icon-view" title="预览" @click="preview(scope.row)"></i> | ||
61 | + </span> | ||
62 | + </div> | ||
63 | + </template> | ||
64 | + </cm-table-page> | ||
65 | + </div> | ||
66 | + </div> | ||
67 | +</div> | ||
68 | + | ||
69 | +<!--新增编辑弹框--> | ||
70 | +<cm-dialog :title="titleName" width="40%" :showDialogVisible="cacheVisible" @hidedialog="cancelBtn" :showFooter="false"> | ||
71 | + <template v-slot> | ||
72 | + <el-form | ||
73 | + label-width="120px" | ||
74 | + ref="ruleForm" | ||
75 | + :model="ajConfigFrom" | ||
76 | + :rules="docRulesForm" | ||
77 | + label-position="right" | ||
78 | + label-width="120px"> | ||
79 | + | ||
80 | + <el-form-item label="编号" prop="id"> | ||
81 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.id" clearable></el-input> | ||
82 | + </el-form-item> | ||
83 | + | ||
84 | + | ||
85 | + <el-form-item label="类型" prop="type"> | ||
86 | + <div style="width: 240px"> | ||
87 | + <el-radio v-model="ajConfigFrom.type" label="0" size="large">菜单</el-radio> | ||
88 | + <el-radio v-model="ajConfigFrom.type" label="1" size="large">按钮</el-radio> | ||
89 | + <el-radio v-model="ajConfigFrom.type" label="2" size="large">详情页</el-radio> | ||
90 | + </div> | ||
91 | + <!-- <div style="height: 15px; color: darkgrey">说明:参数中间用'&'拼接</div>--> | ||
92 | + </el-form-item> | ||
93 | + | ||
94 | + | ||
95 | + <el-form-item label="父菜单" prop="menuPid" v-if="ajConfigFrom.type==0"> | ||
96 | + <el-select v-model="ajConfigFrom.menuPid" | ||
97 | + filterable | ||
98 | + allow-create | ||
99 | + default-first-option | ||
100 | + :reserve-keyword="false" | ||
101 | + placeholder="请选择" style="width: 555px;"> | ||
102 | + <el-option | ||
103 | + v-for="item in menuOptions" | ||
104 | + :key="item.value" | ||
105 | + :label="item.label" | ||
106 | + :value="item.value" | ||
107 | + :disabled="item.disabled"> | ||
108 | + </el-option> | ||
109 | + </el-select> | ||
110 | + </el-form-item> | ||
111 | + | ||
112 | + <el-form-item label="菜单名称" prop="menuName" v-if="ajConfigFrom.type==0"> | ||
113 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.menuName" clearable></el-input> | ||
114 | + </el-form-item> | ||
115 | + | ||
116 | + <el-form-item label="弹框标题" prop="title" v-if="ajConfigFrom.type==1"> | ||
117 | + <el-input :size="$global.title" v-model="ajConfigFrom.title" clearable></el-input> | ||
118 | + </el-form-item> | ||
119 | + | ||
120 | + <el-form-item label="设计页面" prop="designPage"> | ||
121 | + <el-select v-model="ajConfigFrom.designPage" | ||
122 | + filterable | ||
123 | + allow-create | ||
124 | + default-first-option | ||
125 | + :reserve-keyword="false" | ||
126 | + placeholder="请选择" style="width: 510px;"> | ||
127 | + <el-option | ||
128 | + v-for="item in options" | ||
129 | + :key="item.value" | ||
130 | + :label="item.label" | ||
131 | + :value="item.value" | ||
132 | + :disabled="item.disabled"> | ||
133 | + </el-option> | ||
134 | + </el-select> | ||
135 | + <el-tag @click="preview(ajConfigFrom.designPage)" style="padding-top:4px;height: 38px; cursor:pointer">预览</el-tag> | ||
136 | + </el-form-item> | ||
137 | + | ||
138 | + <el-form-item label="传递参数" prop="param"> | ||
139 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.param" clearable></el-input> | ||
140 | + <div style="color: darkgrey"> | ||
141 | + <div> | ||
142 | + <el-collapse> | ||
143 | + <el-collapse-item name="1"> | ||
144 | + <template #title> | ||
145 | + 示例:&resId=#resId&access_token=#access_token | ||
146 | + </el-icon> | ||
147 | + </template> | ||
148 | + <div style="font-size: 12px;text-align: left">可配置字段:</div> | ||
149 | + <el-descriptions :column="2" size="mini" border > | ||
150 | + <el-descriptions-item v-for="item in configs"> | ||
151 | + <template #label> | ||
152 | + <div class="cell-item"> | ||
153 | + {{ item.desc }} | ||
154 | + </div> | ||
155 | + </template> | ||
156 | + {{ item.name }} | ||
157 | + </el-descriptions-item> | ||
158 | + </el-descriptions> | ||
159 | + </el-collapse-item> | ||
160 | + </el-collapse> | ||
161 | + </div> | ||
162 | + </div> | ||
163 | + </el-form-item> | ||
164 | + | ||
165 | + <el-form-item label="资源类型" prop="resType" v-if="ajConfigFrom.type==2" style="text-align: left"> | ||
166 | + <!--<el-input :size="$global.elementSize" v-model="ajConfigFrom.resType" clearable></el-input>--> | ||
167 | + <el-dropdown> | ||
168 | + <cm-res-type-tree-input multiple clearable collapseTags @callback="getResType"/> | ||
169 | + </el-dropdown> | ||
170 | + </el-form-item> | ||
171 | + | ||
172 | + <el-form-item label="厂商" prop="provider" v-if="ajConfigFrom.type==2" style="text-align: left"> | ||
173 | + <!--<el-input :size="$global.elementSize" v-model="ajConfigFrom.firm" clearable></el-input>--> | ||
174 | + <el-select v-model="ajConfigFrom.provider" filterable clearable collapse-tags placeholder="请选择厂商" style="width: 550px"> | ||
175 | + <el-option | ||
176 | + v-for="item in ddicProvider" | ||
177 | + :label="item.ddicName" :value="item.ddicCode"></el-option> | ||
178 | + </el-select> | ||
179 | + </el-form-item> | ||
180 | + | ||
181 | + | ||
182 | + <el-form-item label="操作系统" prop="os" v-if="ajConfigFrom.type==2" style="text-align: left"> | ||
183 | + <!--<el-input :size="$global.elementSize" v-model="ajConfigFrom.firm" clearable></el-input>--> | ||
184 | + <el-select v-model="ajConfigFrom.os" filterable clearable collapse-tags placeholder="请选择操作类型" style="width: 550px"> | ||
185 | + <el-option | ||
186 | + v-for="item in ddicOS" | ||
187 | + :label="item.ddicName" :value="item.ddicCode"></el-option> | ||
188 | + </el-select> | ||
189 | + </el-form-item> | ||
190 | + | ||
191 | + <!--<el-form-item label="绑定资源" prop="resource" v-if="ajConfigFrom.type==2"> | ||
192 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.resource" clearable></el-input> | ||
193 | + </el-form-item>--> | ||
194 | + | ||
195 | + <el-form-item label="备注" prop="remark"> | ||
196 | + <el-input :size="$global.elementSize" v-model="ajConfigFrom.remark" clearable></el-input> | ||
197 | + </el-form-item> | ||
198 | + | ||
199 | + <el-form-item> | ||
200 | + <el-button :size="$global.elementSize" type="primary" @click="addAjConfig('ruleForm')">保存</el-button> | ||
201 | + <el-button :size="$global.elementSize" @click="cancelBtn">取消</el-button> | ||
202 | + </el-form-item> | ||
203 | + </el-form> | ||
204 | + </template> | ||
205 | +</cm-dialog> | ||
206 | + |
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 | + menuPid:[{ | ||
23 | + required: true, | ||
24 | + message: '请选择父菜单!', | ||
25 | + trigger: 'blur', | ||
26 | + }], | ||
27 | + menuName:[{ | ||
28 | + required: true, | ||
29 | + message: '请填写菜单名称!', | ||
30 | + trigger: 'blur', | ||
31 | + }], | ||
32 | + title:[{ | ||
33 | + required: true, | ||
34 | + message: '请填写弹框标题!', | ||
35 | + trigger: 'blur', | ||
36 | + }], | ||
37 | + designPage:[{ | ||
38 | + required: true, | ||
39 | + message: '请选择设计页面!', | ||
40 | + trigger: 'blur', | ||
41 | + }], | ||
42 | + resType:[{ | ||
43 | + required: true, | ||
44 | + message: '请选择资源类型!', | ||
45 | + trigger: 'blur', | ||
46 | + }], | ||
47 | + /*resource:[{ | ||
48 | + required: true, | ||
49 | + message: '请填写绑定资源!', | ||
50 | + trigger: 'blur', | ||
51 | + }],*/ | ||
52 | + } | ||
53 | + } | ||
54 | + | ||
55 | + }, | ||
56 | + setup(props, {attrs, slots, emit}){ | ||
57 | + const {proxy} = Vue.getCurrentInstance(); | ||
58 | + let height = Vue.ref(window.innerHeight - 10); | ||
59 | + let configs = Vue.ref([{ | ||
60 | + name:'resId', | ||
61 | + desc:'资源ID(资源列表可用)' | ||
62 | + },{ | ||
63 | + name:'access_token', | ||
64 | + desc:'Token' | ||
65 | + },{ | ||
66 | + name:'lgn', | ||
67 | + desc:'登录账号' | ||
68 | + },{ | ||
69 | + name:'user_id', | ||
70 | + desc:'用户id' | ||
71 | + }]); | ||
72 | + //表格字段 | ||
73 | + let columns=Vue.ref([]); | ||
74 | + let detailColumns=Vue.ref([ | ||
75 | + { | ||
76 | + prop: 'id', | ||
77 | + label: '编号', | ||
78 | + sortable: true, | ||
79 | + align: 'center', | ||
80 | + width:'250' | ||
81 | + }, | ||
82 | + { | ||
83 | + prop: 'type', | ||
84 | + label: '类型', | ||
85 | + sortable: true, | ||
86 | + align: 'center', | ||
87 | + width:'250', | ||
88 | + }, | ||
89 | + { | ||
90 | + prop: 'resType', | ||
91 | + label: '资源类型', | ||
92 | + sortable: true, | ||
93 | + align: 'center', | ||
94 | + width:'250' | ||
95 | + },{ | ||
96 | + prop: 'provider', | ||
97 | + label: '品牌', | ||
98 | + sortable: true, | ||
99 | + align: 'center', | ||
100 | + width:'250' | ||
101 | + },{ | ||
102 | + prop: 'designPage', | ||
103 | + label: '设计器编码', | ||
104 | + sortable: true, | ||
105 | + align: 'center', | ||
106 | + width:'250' | ||
107 | + },{ | ||
108 | + prop: 'param', | ||
109 | + label: '参数', | ||
110 | + sortable: true, | ||
111 | + align: 'left' | ||
112 | + } | ||
113 | + ]) | ||
114 | + let menuColumns=Vue.ref([ | ||
115 | + { | ||
116 | + prop: 'id', | ||
117 | + label: '编号', | ||
118 | + sortable: true, | ||
119 | + align: 'center', | ||
120 | + width:'250' | ||
121 | + }, | ||
122 | + { | ||
123 | + prop: 'type', | ||
124 | + label: '类型', | ||
125 | + sortable: true, | ||
126 | + align: 'center', | ||
127 | + width:'250', | ||
128 | + }, | ||
129 | + { | ||
130 | + prop: 'menuName', | ||
131 | + label: '菜单名称', | ||
132 | + sortable: true, | ||
133 | + align: 'center', | ||
134 | + width:'250' | ||
135 | + }, | ||
136 | + { | ||
137 | + prop: 'designPage', | ||
138 | + label: '设计器编码', | ||
139 | + sortable: true, | ||
140 | + align: 'center', | ||
141 | + width:'250' | ||
142 | + },{ | ||
143 | + prop: 'param', | ||
144 | + label: '参数', | ||
145 | + sortable: true, | ||
146 | + align: 'center', | ||
147 | + width:'300' | ||
148 | + },{ | ||
149 | + prop: 'creatTime', | ||
150 | + label: '创建时间', | ||
151 | + sortable: true, | ||
152 | + align: 'left' | ||
153 | + } | ||
154 | + ]) | ||
155 | + let butColumns=Vue.ref([ | ||
156 | + { | ||
157 | + prop: 'id', | ||
158 | + label: '编号', | ||
159 | + sortable: true, | ||
160 | + align: 'center', | ||
161 | + width:'250' | ||
162 | + }, | ||
163 | + { | ||
164 | + prop: 'type', | ||
165 | + label: '类型', | ||
166 | + sortable: true, | ||
167 | + align: 'center', | ||
168 | + width:'250', | ||
169 | + }, | ||
170 | + { | ||
171 | + prop: 'title', | ||
172 | + label: '弹框标题', | ||
173 | + sortable: true, | ||
174 | + align: 'center', | ||
175 | + width:'250' | ||
176 | + }, | ||
177 | + { | ||
178 | + prop: 'designPage', | ||
179 | + label: '设计器编码', | ||
180 | + sortable: true, | ||
181 | + align: 'center', | ||
182 | + width:'250' | ||
183 | + },{ | ||
184 | + prop: 'param', | ||
185 | + label: '参数', | ||
186 | + sortable: true, | ||
187 | + align: 'center', | ||
188 | + width:'300' | ||
189 | + },{ | ||
190 | + prop: 'creatTime', | ||
191 | + label: '创建时间', | ||
192 | + sortable: true, | ||
193 | + align: 'left' | ||
194 | + } | ||
195 | + ]) | ||
196 | + let currentPage=Vue.ref(1); | ||
197 | + let pageSize=Vue.ref(10); | ||
198 | + let keyword=Vue.ref(); | ||
199 | + let count=Vue.ref(0); | ||
200 | + let tableDataList=Vue.ref([]); | ||
201 | + let checkedId = Vue.ref(0); | ||
202 | + let titleName=Vue.ref('新增配置信息') | ||
203 | + let cacheVisible=Vue.ref(false); | ||
204 | + let viewData=Vue.ref(); | ||
205 | + let addOrUpdate=Vue.ref(false) | ||
206 | + let radio=Vue.ref(0); | ||
207 | + //下拉框 | ||
208 | + let options=Vue.ref([]); | ||
209 | + //菜单下拉框 | ||
210 | + let menuOptions=Vue.ref([]); | ||
211 | + let search = Vue.ref({ | ||
212 | + keyword:'', | ||
213 | + type:'', | ||
214 | + page:1, | ||
215 | + limit:10, | ||
216 | + }); | ||
217 | + //按钮下拉框 | ||
218 | + let typeOptions=Vue.ref([ | ||
219 | + { | ||
220 | + value: '0', | ||
221 | + label: '菜单', | ||
222 | + }, | ||
223 | + { | ||
224 | + value: '1', | ||
225 | + label: '按钮', | ||
226 | + }, | ||
227 | + { | ||
228 | + value: '2', | ||
229 | + label: '详情页', | ||
230 | + }]); | ||
231 | + let couponSelected = Vue.ref(); | ||
232 | + let ajConfigFrom = Vue.ref({ | ||
233 | + id:'', | ||
234 | + type: 0, | ||
235 | + designPage: '', | ||
236 | + param: '&resId=#resId&access_token=#access_token', | ||
237 | + resType: '', | ||
238 | + remark:'', | ||
239 | + creatTime:'', | ||
240 | + createName:'', | ||
241 | + state:'', | ||
242 | + title:'', | ||
243 | + menuPid:'', | ||
244 | + menuName:'' | ||
245 | + }); | ||
246 | + //新增弹框 | ||
247 | + const addAj=()=>{ | ||
248 | + clearForm(); | ||
249 | + cacheVisible.value=true; | ||
250 | + pageList(); | ||
251 | + menuList(); | ||
252 | + | ||
253 | + } | ||
254 | + //新增或修改aj配置信息 | ||
255 | + let addAjConfig=(ruleForm)=>{ | ||
256 | + let params={}; | ||
257 | + params= ajConfigFrom.value; | ||
258 | + let msg = ''; | ||
259 | + if (addOrUpdate.value){ | ||
260 | + proxy.$http.post(`/api-web/ajConfig/updateAj`, params, function (res) { | ||
261 | + if (res && res.success == true) { | ||
262 | + msg = res.msg; | ||
263 | + cacheVisible.value=false; | ||
264 | + proxy.$global.showMsg(msg); | ||
265 | + clearForm(); | ||
266 | + getDataList(); | ||
267 | + } | ||
268 | + }) | ||
269 | + }else{ | ||
270 | + proxy.$http.post(`/api-web/ajConfig/addAj`, params, function (res) { | ||
271 | + if (res && res.success == true) { | ||
272 | + msg = res.msg; | ||
273 | + cacheVisible.value=false; | ||
274 | + proxy.$global.showMsg(msg); | ||
275 | + if (params.type==0){ | ||
276 | + window.history.go(0); | ||
277 | + } | ||
278 | + clearForm(); | ||
279 | + getDataList(); | ||
280 | + | ||
281 | + } | ||
282 | + }) | ||
283 | + } | ||
284 | + } | ||
285 | + //清理表单 | ||
286 | + let clearForm=()=>{ | ||
287 | + ajConfigFrom.value={ | ||
288 | + id:'', | ||
289 | + type: '0', | ||
290 | + designPage: '', | ||
291 | + param: '', | ||
292 | + resType: '', | ||
293 | + remark:'', | ||
294 | + creatTime:'', | ||
295 | + createName:'', | ||
296 | + state:'', | ||
297 | + title:'', | ||
298 | + menuPid:'', | ||
299 | + menuName:'' | ||
300 | + } | ||
301 | + addOrUpdate.value=false; | ||
302 | + } | ||
303 | + | ||
304 | + //删除 | ||
305 | + let handleDelete=(row)=>{ | ||
306 | + let param={ | ||
307 | + id:row.id | ||
308 | + } | ||
309 | + proxy.$http.get(`/api-web/ajConfig/deleteById`, param, function (res) { | ||
310 | + | ||
311 | + if (res && res.success == true) { | ||
312 | + let msg = res.msg; | ||
313 | + if (!msg) { | ||
314 | + msg = "删除失败"; | ||
315 | + } | ||
316 | + if (row.type==0){ | ||
317 | + history.go(0); | ||
318 | + } | ||
319 | + proxy.$global.showMsg(msg); | ||
320 | + getDataList(); | ||
321 | + } | ||
322 | + }) | ||
323 | + } | ||
324 | + let handleUpdate=(row)=>{ | ||
325 | + addOrUpdate.value =true; | ||
326 | + ajConfigFrom.value=row; | ||
327 | + cacheVisible.value=true; | ||
328 | + pageList(); | ||
329 | + menuList(); | ||
330 | + } | ||
331 | + | ||
332 | + //预览 | ||
333 | + let preview=(row)=>{ | ||
334 | + if (row instanceof Object){ | ||
335 | + proxy.$global.viewAjView(row.id,'80%','80%'); | ||
336 | + }else if (row){ | ||
337 | + proxy.$global.viewAjView(row,'80%','80%'); | ||
338 | + } | ||
339 | + | ||
340 | + } | ||
341 | + | ||
342 | + //aj报表管理信息 | ||
343 | + let pageList=()=>{ | ||
344 | + proxy.$http.get(`/api-web/ajConfig/pageList`, null, function (res) { | ||
345 | + if (res && res.success == true) { | ||
346 | + let params=res.object.data.records; | ||
347 | + params.forEach(function(e){ | ||
348 | + let report={} | ||
349 | + report.label=e.reportName; | ||
350 | + report.value=e.reportCode; | ||
351 | + options.value.push(report) | ||
352 | + }); | ||
353 | + } | ||
354 | + }) | ||
355 | + } | ||
356 | + | ||
357 | + //菜单 | ||
358 | + let menuList=()=>{ | ||
359 | + proxy.$http.get(`/api-user/menus/findAlls`, null, function (res) { | ||
360 | + if (res && res.count>0) { | ||
361 | + let params=res.data; | ||
362 | + params.forEach(function(e){ | ||
363 | + let menu={} | ||
364 | + menu.label=e.name; | ||
365 | + menu.value=e.id; | ||
366 | + menuOptions.value.push(menu) | ||
367 | + }); | ||
368 | + } | ||
369 | + }) | ||
370 | + | ||
371 | + } | ||
372 | + //AJ设计登录 | ||
373 | + let handleView=()=>{ | ||
374 | + window.open(sessionStorage.getItem("ajWeb") + '/#/login?access_token=' + localStorage.getItem("access_token")); | ||
375 | + } | ||
376 | + | ||
377 | + | ||
378 | + //重新加载表格数据 | ||
379 | + let loadTableDataList = ({page, limit}) => { | ||
380 | + search.value.page = page; | ||
381 | + search.value.limit = limit; | ||
382 | + getDataList() | ||
383 | + } | ||
384 | + | ||
385 | + let onChangeStripe = (e)=>{ | ||
386 | + if(e =='0'){ | ||
387 | + columns.value=menuColumns.value; | ||
388 | + } | ||
389 | + if (e =='1'){ | ||
390 | + columns.value=butColumns.value; | ||
391 | + } | ||
392 | + if (e =='2'){ | ||
393 | + columns.value=detailColumns.value; | ||
394 | + } | ||
395 | + search.value.type=e; | ||
396 | + getDataList() | ||
397 | + } | ||
398 | + | ||
399 | + //获取aj配置信息 | ||
400 | + let getDataList=()=>{ | ||
401 | + let params={ | ||
402 | + page:search.value.page, | ||
403 | + limit:search.value.limit, | ||
404 | + type:search.value.type, | ||
405 | + keyword:search.value.keyword | ||
406 | + } | ||
407 | + proxy.$http.get(`/api-web/ajConfig/ajConfigList`,params, function (res) { | ||
408 | + if (res && res.data) { | ||
409 | + count.value = res.count; | ||
410 | + tableDataList.value = res.data; | ||
411 | + }else{ | ||
412 | + count.value = 0; | ||
413 | + tableDataList.value='暂无数据'; | ||
414 | + } | ||
415 | + }); | ||
416 | + | ||
417 | + } | ||
418 | + | ||
419 | + //关闭弹框 | ||
420 | + let cancelBtn=()=>{ | ||
421 | + cacheVisible.value=false; | ||
422 | + } | ||
423 | + // 挂载完 | ||
424 | + Vue.onMounted(() => { | ||
425 | + couponSelected.value = typeOptions.value[0].label; | ||
426 | + columns.value=menuColumns.value; | ||
427 | + search.value.type=typeOptions.value[0].value; | ||
428 | + getDataList(); | ||
429 | + }) | ||
430 | + | ||
431 | + | ||
432 | + let getResType = (arr) => { | ||
433 | + | ||
434 | + var types = arr.map(function (v) { | ||
435 | + return v.id; | ||
436 | + }); | ||
437 | + ajConfigFrom.value.resType = types[0]; | ||
438 | + } | ||
439 | + | ||
440 | + // 加载字典项 | ||
441 | + let ddicProvider = Vue.ref([]); | ||
442 | + let ddicOS = Vue.ref([]); | ||
443 | + // let ddicProvider = Vue.ref([]); | ||
444 | + | ||
445 | + proxy.$http.post(`/api-web/manage/ddic/findSucDdics/provider`, {}, function (res) { | ||
446 | + if (res && res.data) { | ||
447 | + ddicProvider.value = res.data; | ||
448 | + } | ||
449 | + }); | ||
450 | + | ||
451 | + proxy.$http.post(`/api-web/manage/ddic/findSucDdics/os`, {}, function (res) { | ||
452 | + if (res && res.data) { | ||
453 | + ddicOS.value = res.data; | ||
454 | + } | ||
455 | + }); | ||
456 | + | ||
457 | + return { | ||
458 | + ddicProvider, | ||
459 | + ddicOS, | ||
460 | + height, | ||
461 | + columns, | ||
462 | + currentPage, | ||
463 | + count, | ||
464 | + pageSize, | ||
465 | + keyword, | ||
466 | + tableDataList, | ||
467 | + checkedId, | ||
468 | + addAj, | ||
469 | + addAjConfig, | ||
470 | + loadTableDataList, | ||
471 | + getDataList, | ||
472 | + cacheVisible, | ||
473 | + titleName, | ||
474 | + viewData, | ||
475 | + cancelBtn, | ||
476 | + ajConfigFrom, | ||
477 | + handleDelete, | ||
478 | + handleUpdate, | ||
479 | + preview, | ||
480 | + handleView, | ||
481 | + pageList, | ||
482 | + radio, | ||
483 | + options, | ||
484 | + menuList, | ||
485 | + menuOptions, | ||
486 | + getResType, | ||
487 | + configs, | ||
488 | + typeOptions, | ||
489 | + onChangeStripe, | ||
490 | + search, | ||
491 | + butColumns, | ||
492 | + detailColumns, | ||
493 | + couponSelected | ||
494 | + } | ||
495 | + } | ||
496 | + | ||
497 | +} |
1 | +export default { | ||
2 | + name: 'ajConfigViewIndex', | ||
3 | + template: '', | ||
4 | + components: {}, | ||
5 | + setup() { | ||
6 | + const {proxy} = Vue.getCurrentInstance(); | ||
7 | + let getSrc = Vue.ref(''); | ||
8 | + let height = Vue.ref(window.innerHeight - 10); | ||
9 | + let ajConfig = proxy.$global.getQueryVariable('ajConfig'); | ||
10 | + | ||
11 | + let getUrl=()=>{ | ||
12 | + let param={ | ||
13 | + id:ajConfig | ||
14 | + } | ||
15 | + let params=''; | ||
16 | + let designPage=''; | ||
17 | + proxy.$http.get(`/api-web/ajConfig/findOneById`, param, function (res) { | ||
18 | + if (res && res.success == true && res.object) { | ||
19 | + // 参数替换 | ||
20 | + params = replaceParams(res.object.param); | ||
21 | + designPage = res.object.designPage; | ||
22 | + } | ||
23 | + getSrc.value=sessionStorage.getItem("ajWeb")+'/#/bigscreen/viewer?reportCode='+designPage+params+'&access_token=' + localStorage.getItem("access_token"); | ||
24 | + | ||
25 | + }) | ||
26 | + } | ||
27 | + | ||
28 | + const replaceParams = (params) => { | ||
29 | + let userId = sessionStorage.getItem('user_id'); | ||
30 | + if(!userId){ | ||
31 | + userId = localStorage.getItem('user_id'); | ||
32 | + } | ||
33 | + return params.replace(/#lgn/g,localStorage.getItem('lgn')).replace(/#user_id/g,userId).replace(/#access_token/g,localStorage.getItem("access_token")) | ||
34 | + } | ||
35 | + | ||
36 | + const getParamValue = (code) => { | ||
37 | + // 获取url参数 | ||
38 | + // 获取路由参数 | ||
39 | + // 获取sessionStorage | ||
40 | + // 获取localStorage | ||
41 | + } | ||
42 | + | ||
43 | + // 挂载完 | ||
44 | + Vue.onMounted(() => { | ||
45 | + getUrl(); | ||
46 | + //start lsq 监听跨域iframe子页面向父页面发送数据(子页面点击名称进入详情页) 2022-03-15 | ||
47 | + window.addEventListener('message',function(e){ | ||
48 | + if(e.data.type=='detail'){ | ||
49 | + proxy.$global.openDetail(e.data.data.resId, e.data.data.resType, proxy); | ||
50 | + }else if(e.data.type=='topology'){ | ||
51 | + //子页面点击拓扑图标进入拓扑页面 | ||
52 | + proxy.$global.viewResTopo(e.data.data.resId); | ||
53 | + }else{ | ||
54 | + | ||
55 | + } | ||
56 | + | ||
57 | + }) | ||
58 | + //end lsq 2022-03-15 | ||
59 | + }) | ||
60 | + | ||
61 | + return { | ||
62 | + height, | ||
63 | + getSrc, | ||
64 | + } | ||
65 | + } | ||
66 | +} |
@@ -39,6 +39,7 @@ | @@ -39,6 +39,7 @@ | ||
39 | sessionStorage.setItem('graphEditorOrigin', res1[0].mxgraph_editor); | 39 | sessionStorage.setItem('graphEditorOrigin', res1[0].mxgraph_editor); |
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('ajWeb', res1[0].ajWeb);//lsq 2022-04-07 设置ajWeb的地址 | ||
42 | sessionStorage.setItem('sxView', res1[0].sxView); | 43 | sessionStorage.setItem('sxView', res1[0].sxView); |
43 | sessionStorage.setItem('workflow', res1[0].workflow); | 44 | sessionStorage.setItem('workflow', res1[0].workflow); |
44 | sessionStorage.setItem('mp3', res2[0].mp3); | 45 | sessionStorage.setItem('mp3', res2[0].mp3); |
@@ -20,6 +20,8 @@ export default { | @@ -20,6 +20,8 @@ export default { | ||
20 | let kpiName = Vue.ref('');//指标名称 | 20 | let kpiName = Vue.ref('');//指标名称 |
21 | let startTime=Vue.ref(''); | 21 | let startTime=Vue.ref(''); |
22 | let endTime=Vue.ref(''); | 22 | let endTime=Vue.ref(''); |
23 | + let startSlide=Vue.ref(0); | ||
24 | + let endSlide=Vue.ref(100); | ||
23 | let colorsArr=Vue.ref([ | 25 | let colorsArr=Vue.ref([ |
24 | { | 26 | { |
25 | start: '#46d6d8', | 27 | start: '#46d6d8', |
@@ -226,6 +228,11 @@ export default { | @@ -226,6 +228,11 @@ export default { | ||
226 | 228 | ||
227 | const changeInterval=(val)=>{ | 229 | const changeInterval=(val)=>{ |
228 | interval.value=val; | 230 | interval.value=val; |
231 | + if (val=='DAY'){ | ||
232 | + startSlide.value=0; | ||
233 | + }else { | ||
234 | + startSlide.value=75; | ||
235 | + } | ||
229 | if(val=='custom'){ | 236 | if(val=='custom'){ |
230 | }else{ | 237 | }else{ |
231 | getLineChart(); | 238 | getLineChart(); |
@@ -372,8 +379,8 @@ export default { | @@ -372,8 +379,8 @@ export default { | ||
372 | type: "slider", | 379 | type: "slider", |
373 | realtime: true, //拖动滚动条时是否动态的更新图表数据 | 380 | realtime: true, //拖动滚动条时是否动态的更新图表数据 |
374 | height: 25, //滚动条高度 | 381 | height: 25, //滚动条高度 |
375 | - start: 40, //滚动条开始位置(共100等份) | ||
376 | - end: 65 //结束位置(共100等份) | 382 | + start: startSlide, //滚动条开始位置(共100等份) |
383 | + end: endSlide //结束位置(共100等份) | ||
377 | } | 384 | } |
378 | ], | 385 | ], |
379 | series:series.value | 386 | series:series.value |
-
Please register or login to post a comment