Showing
10 changed files
with
266 additions
and
99 deletions
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | <link href="public/lib/vant/index.css" rel="stylesheet"> | 17 | <link href="public/lib/vant/index.css" rel="stylesheet"> |
18 | <script src="public/lib/vant/vant.min.js"></script> | 18 | <script src="public/lib/vant/vant.min.js"></script> |
19 | <script src="public/lib/axios/axios.min.js"></script> | 19 | <script src="public/lib/axios/axios.min.js"></script> |
20 | - <!-- <script src="public/lib/dayjs/dayjs.min.js"></script> --> | 20 | + <script src="public/lib/dayjs/dayjs.min.js"></script> |
21 | <script src="public/lib/jquery/jquery.min.js"></script> | 21 | <script src="public/lib/jquery/jquery.min.js"></script> |
22 | 22 | ||
23 | <script src="public/lib/echarts/echarts.min.js"></script> | 23 | <script src="public/lib/echarts/echarts.min.js"></script> |
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | display: flex; | 38 | display: flex; |
39 | } | 39 | } |
40 | 40 | ||
41 | -.container .cm-card .search>button { | 41 | +.container .cm-card .search > button { |
42 | margin-left: 10px; | 42 | margin-left: 10px; |
43 | } | 43 | } |
44 | 44 | ||
@@ -129,17 +129,19 @@ custom-class="config-dialog" | @@ -129,17 +129,19 @@ custom-class="config-dialog" | ||
129 | cursor: pointer; | 129 | cursor: pointer; |
130 | } | 130 | } |
131 | 131 | ||
132 | -.margin-top-bottom-30{ | ||
133 | - margin:30px 0; | 132 | +.margin-top-bottom-30 { |
133 | + margin: 30px 0; | ||
134 | } | 134 | } |
135 | -.margin-top-bottom-10{ | ||
136 | - margin:10px 0; | 135 | + |
136 | +.margin-top-bottom-10 { | ||
137 | + margin: 10px 0; | ||
137 | } | 138 | } |
138 | 139 | ||
139 | /* 边框闪烁 */ | 140 | /* 边框闪烁 */ |
140 | -.arrowBox{ | 141 | +.arrowBox { |
141 | animation: glow 300ms ease-out infinite alternate; | 142 | animation: glow 300ms ease-out infinite alternate; |
142 | } | 143 | } |
144 | + | ||
143 | /*@keyframes glow { | 145 | /*@keyframes glow { |
144 | 0% { | 146 | 0% { |
145 | box-shadow: 0 0 5px rgba(245,166,35,.2), inset 0 0 5px rgba(245,166,35,.1), 0 0px 2px #f5a623; | 147 | box-shadow: 0 0 5px rgba(245,166,35,.2), inset 0 0 5px rgba(245,166,35,.1), 0 0px 2px #f5a623; |
@@ -158,11 +160,35 @@ custom-class="config-dialog" | @@ -158,11 +160,35 @@ custom-class="config-dialog" | ||
158 | box-shadow: 0 0 20px red, inset 0 0 10px red, 0 0px 5px red; | 160 | box-shadow: 0 0 20px red, inset 0 0 10px red, 0 0px 5px red; |
159 | } | 161 | } |
160 | } | 162 | } |
161 | -.tree-table .el-table td.el-table__cell div{ | 163 | + |
164 | +.tree-table .el-table td.el-table__cell div { | ||
162 | display: flex; | 165 | display: flex; |
163 | align-items: center; | 166 | align-items: center; |
164 | } | 167 | } |
165 | -.tree-table .el-table .el-table__cell.is-center div{ | 168 | + |
169 | +.tree-table .el-table .el-table__cell.is-center div { | ||
166 | justify-content: center; | 170 | justify-content: center; |
167 | } | 171 | } |
168 | 172 | ||
173 | + | ||
174 | +.p-6{ | ||
175 | + padding: 6px; | ||
176 | +} | ||
177 | + | ||
178 | +.m-l-6 { | ||
179 | + margin-left: 6px; | ||
180 | +} | ||
181 | + | ||
182 | +.m-r-6 { | ||
183 | + margin-right: 6px; | ||
184 | +} | ||
185 | + | ||
186 | +.m-b-6 { | ||
187 | + margin-bottom: 6px; | ||
188 | +} | ||
189 | + | ||
190 | +.m-t-6 { | ||
191 | + margin-top: 6px; | ||
192 | +} | ||
193 | + | ||
194 | + |
1 | -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs=e()}(this,function(){"use strict";const t=60,e=60*t,s=24*e,r=7*s,n=(t,e,s)=>!t||t.length>=e?t:`${Array(e+1-t.length).join(s)}${t}`;class i{constructor(t){this.utc=!1;const e=this.parseConfig(t);this.date=new Date(e),this.timeZone=this.date.getTimezoneOffset()/60,this.timeZoneString=n(String(-1*this.timeZone).replace(/^(.)?(\d)/,"$10$200"),5,"+"),this.mYear=this.date.getFullYear(),this.mMonth=this.date.getMonth(),this.mDay=this.date.getDate(),this.mWeek=this.date.getDay(),this.mHour=this.date.getHours(),this.mMinute=this.date.getMinutes(),this.mSecond=this.date.getSeconds()}parseConfig(t){if(!t)return new Date;if(t instanceof Date)return t;if(/^(\d){8}$/.test(t)){return this.utc=!0,`${t.substr(0,4)}-${t.substr(4,2)}-${t.substr(6,2)}`}return t}year(){return this.mYear}month(){return this.mMonth}unix(){const t=this.utc?60*this.timeZone*60*1e3:0;return Math.floor((this.date.getTime()+t)/1e3)}toString(){return this.date.toUTCString()}startOf(t){switch(t){case"year":return new i(new Date(this.year(),0,1));case"month":return new i(new Date(this.year(),this.month(),1));default:return this}}add(n,a){let h;switch(a){case"m":case"minutes":h=t;break;case"h":case"hours":h=e;break;case"d":case"days":h=s;break;case"w":case"weeks":h=r;break;default:h=1}const u=this.unix()+n*h;return new i(1e3*u)}subtract(t,e){return this.add(-1*t,e)}format(t="YYYY-MM-DDTHH:mm:ssZ"){const e=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];return t.replace(/Y{2,4}|M{1,2}|D{1,2}|d{1,4}|H{1,2}|m{1,2}|s{1,2}|Z{1,2}/g,t=>{switch(t){case"YY":return String(this.mYear).slice(-2);case"YYYY":return String(this.mYear);case"M":return String(this.mMonth+1);case"MM":return n(String(this.mMonth+1),2,"0");case"D":return String(this.mDay);case"DD":return n(String(this.mDay),2,"0");case"d":return String(this.mWeek);case"dddd":return e[this.mWeek];case"H":return String(this.mHour);case"HH":return n(String(this.mHour),2,"0");case"m":return String(this.mMinute);case"mm":return n(String(this.mMinute),2,"0");case"s":return String(this.mSecond);case"ss":return n(String(this.mSecond),2,"0");case"Z":return`${this.timeZoneString.slice(0,-2)}:00`;case"ZZ":return this.timeZoneString;default:return t}})}}return t=>new i(t)}); | 1 | +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){"use strict";var t="millisecond",n="second",e="minute",r="hour",i="day",s="week",u="month",o="quarter",a="year",h=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,f=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var r=String(t);return!r||r.length>=n?t:""+Array(n+1-r.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),r=Math.floor(e/60),i=e%60;return(n<=0?"+":"-")+c(r,2,"0")+":"+c(i,2,"0")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(e,u),i=n-r<0,s=t.clone().add(e+(i?-1:1),u);return Number(-(e+(n-r)/(i?r-s:s-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:a,w:s,d:i,D:"date",h:r,m:e,s:n,ms:t,Q:o}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},$={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},l="en",m={};m[l]=$;var y=function(t){return t instanceof v},M=function(t,n,e){var r;if(!t)return l;if("string"==typeof t)m[t]&&(r=t),n&&(m[t]=n,r=t);else{var i=t.name;m[i]=t,r=i}return e||(l=r),r},g=function(t,n,e){if(y(t))return t.clone();var r=n?"string"==typeof n?{format:n,pl:e}:n:{};return r.date=t,new v(r)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u,$offset:n.$offset})};var v=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0),this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if("string"==typeof n&&!/Z$/i.test(n)){var r=n.match(h);if(r)return e?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t)<this.startOf(n)},d.isBefore=function(t,n){return this.endOf(n)<g(t)},d.$g=function(t,n,e){return D.u(t)?this[n]:this.set(e,t)},d.year=function(t){return this.$g(t,"$y",a)},d.month=function(t){return this.$g(t,"$M",u)},d.day=function(t){return this.$g(t,"$W",i)},d.date=function(t){return this.$g(t,"$D","date")},d.hour=function(t){return this.$g(t,"$H",r)},d.minute=function(t){return this.$g(t,"$m",e)},d.second=function(t){return this.$g(t,"$s",n)},d.millisecond=function(n){return this.$g(n,"$ms",t)},d.unix=function(){return Math.floor(this.valueOf()/1e3)},d.valueOf=function(){return this.$d.getTime()},d.startOf=function(t,o){var h=this,f=!!D.u(o)||o,c=D.p(t),d=function(t,n){var e=D.w(h.$u?Date.UTC(h.$y,n,t):new Date(h.$y,n,t),h);return f?e:e.endOf(i)},$=function(t,n){return D.w(h.toDate()[t].apply(h.toDate(),(f?[0,0,0,0]:[23,59,59,999]).slice(n)),h)},l=this.$W,m=this.$M,y=this.$D,M="set"+(this.$u?"UTC":"");switch(c){case a:return f?d(1,0):d(31,11);case u:return f?d(1,m):d(0,m+1);case s:var g=this.$locale().weekStart||0,v=(l<g?l+7:l)-g;return d(f?y-v:y+(6-v),m);case i:case"date":return $(M+"Hours",0);case r:return $(M+"Minutes",1);case e:return $(M+"Seconds",2);case n:return $(M+"Milliseconds",3);default:return this.clone()}},d.endOf=function(t){return this.startOf(t,!1)},d.$set=function(s,o){var h,f=D.p(s),c="set"+(this.$u?"UTC":""),d=(h={},h[i]=c+"Date",h.date=c+"Date",h[u]=c+"Month",h[a]=c+"FullYear",h[r]=c+"Hours",h[e]=c+"Minutes",h[n]=c+"Seconds",h[t]=c+"Milliseconds",h)[f],$=f===i?this.$D+(o-this.$W):o;if(f===u||f===a){var l=this.clone().set("date",1);l.$d[d]($),l.init(),this.$d=l.set("date",Math.min(this.$D,l.daysInMonth())).toDate()}else d&&this.$d[d]($);return this.init(),this},d.set=function(t,n){return this.clone().$set(t,n)},d.get=function(t){return this[D.p(t)]()},d.add=function(t,o){var h,f=this;t=Number(t);var c=D.p(o),d=function(n){var e=g(f);return D.w(e.date(e.date()+Math.round(n*t)),f)};if(c===u)return this.set(u,this.$M+t);if(c===a)return this.set(a,this.$y+t);if(c===i)return d(1);if(c===s)return d(7);var $=(h={},h[e]=6e4,h[r]=36e5,h[n]=1e3,h)[c]||1,l=this.$d.getTime()+t*$;return D.w(l,this)},d.subtract=function(t,n){return this.add(-1*t,n)},d.format=function(t){var n=this;if(!this.isValid())return"Invalid Date";var e=t||"YYYY-MM-DDTHH:mm:ssZ",r=D.z(this),i=this.$locale(),s=this.$H,u=this.$m,o=this.$M,a=i.weekdays,h=i.months,c=function(t,r,i,s){return t&&(t[r]||t(n,e))||i[r].substr(0,s)},d=function(t){return D.s(s%12||12,t,"0")},$=i.meridiem||function(t,n,e){var r=t<12?"AM":"PM";return e?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:o+1,MM:D.s(o+1,2,"0"),MMM:c(i.monthsShort,o,h,3),MMMM:h[o]||h(this,e),D:this.$D,DD:D.s(this.$D,2,"0"),d:String(this.$W),dd:c(i.weekdaysMin,this.$W,a,2),ddd:c(i.weekdaysShort,this.$W,a,3),dddd:a[this.$W],H:String(s),HH:D.s(s,2,"0"),h:d(1),hh:d(2),a:$(s,u,!0),A:$(s,u,!1),m:String(u),mm:D.s(u,2,"0"),s:String(this.$s),ss:D.s(this.$s,2,"0"),SSS:D.s(this.$ms,3,"0"),Z:r};return e.replace(f,function(t,n){return n||l[t]||r.replace(":","")})},d.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},d.diff=function(t,h,f){var c,d=D.p(h),$=g(t),l=6e4*($.utcOffset()-this.utcOffset()),m=this-$,y=D.m(this,$);return y=(c={},c[a]=y/12,c[u]=y,c[o]=y/3,c[s]=(m-l)/6048e5,c[i]=(m-l)/864e5,c[r]=m/36e5,c[e]=m/6e4,c[n]=m/1e3,c)[d]||m,f?y:D.a(y)},d.daysInMonth=function(){return this.endOf(u).$D},d.$locale=function(){return m[this.$L]},d.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),r=M(t,n,!0);return r&&(e.$L=r),e},d.clone=function(){return D.w(this.$d,this)},d.toDate=function(){return new Date(this.valueOf())},d.toJSON=function(){return this.isValid()?this.toISOString():null},d.toISOString=function(){return this.$d.toISOString()},d.toString=function(){return this.$d.toUTCString()},c}();return g.prototype=v.prototype,g.extend=function(t,n){return t(n,v,g),g},g.locale=M,g.isDayjs=y,g.unix=function(t){return g(1e3*t)},g.en=m[l],g.Ls=m,g}); |
1 | -import {get} from './BaseApi.js' | 1 | +import {get,post} from './BaseApi.js' |
2 | 2 | ||
3 | 3 | ||
4 | /** | 4 | /** |
@@ -15,8 +15,30 @@ let getFaultList = (params) => { | @@ -15,8 +15,30 @@ let getFaultList = (params) => { | ||
15 | return get('/api-web/fault/result/tableList', params); | 15 | return get('/api-web/fault/result/tableList', params); |
16 | } | 16 | } |
17 | 17 | ||
18 | +/** | ||
19 | + * 新增或修改故障配置 定义高级规则 | ||
20 | + * http://192.168.0.59:3000/project/78/interface/api/3921 | ||
21 | + * @param params | ||
22 | + * @returns {Promise<*>} | ||
23 | + */ | ||
24 | +let saveOrUpdateRuleAdvanced = (params) => { | ||
25 | + return post('/api-web/fault/conf/rule/saveOrUpdateRuleAdvanced', params); | ||
26 | +} | ||
27 | + | ||
28 | +/** | ||
29 | + * 删除故障配置 定义高级规则 | ||
30 | + * http://192.168.0.59:3000/project/78/interface/api/3926 | ||
31 | + * @param idList 逗号分隔 | ||
32 | + * @returns {Promise<*>} | ||
33 | + */ | ||
34 | +let delRuleAdvanced = (idList) => { | ||
35 | + return get('/api-web/fault/conf/rule/delRuleAdvanced', {idList:idList}); | ||
36 | +} | ||
37 | + | ||
18 | 38 | ||
19 | export default { | 39 | export default { |
20 | getRuleAdvanced, | 40 | getRuleAdvanced, |
21 | - getFaultList | 41 | + getFaultList, |
42 | + saveOrUpdateRuleAdvanced, | ||
43 | + delRuleAdvanced | ||
22 | } | 44 | } |
@@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
44 | </template> | 44 | </template> |
45 | </el-table-column> | 45 | </el-table-column> |
46 | 46 | ||
47 | - <el-table-column v-if="showTools && columns.length > 0" label="操作" width="80" align="center"> | 47 | + <el-table-column v-if="showTools && columns.length > 0" label="操作" :width="toolsWith" align="center"> |
48 | <template #default="scope"> | 48 | <template #default="scope"> |
49 | <slot name="tools" :scope="scope" ></slot> | 49 | <slot name="tools" :scope="scope" ></slot> |
50 | </template> | 50 | </template> |
@@ -79,6 +79,10 @@ export default { | @@ -79,6 +79,10 @@ export default { | ||
79 | type: Boolean, | 79 | type: Boolean, |
80 | default: false | 80 | default: false |
81 | }, | 81 | }, |
82 | + toolsWith:{ | ||
83 | + type: Number, | ||
84 | + default: 80 | ||
85 | + }, | ||
82 | // medium / small / mini | 86 | // medium / small / mini |
83 | size:{ | 87 | size:{ |
84 | type: String, | 88 | type: String, |
@@ -16,6 +16,13 @@ export default { | @@ -16,6 +16,13 @@ export default { | ||
16 | }, | 16 | }, |
17 | getFaultList(context, params) { | 17 | getFaultList(context, params) { |
18 | return faultDiagnosisApi.getFaultList(params); | 18 | return faultDiagnosisApi.getFaultList(params); |
19 | - } | 19 | + }, |
20 | + saveOrUpdateRuleAdvanced(context, params) { | ||
21 | + return faultDiagnosisApi.saveOrUpdateRuleAdvanced(params); | ||
22 | + }, | ||
23 | + delRuleAdvanced(context, ids) { | ||
24 | + return faultDiagnosisApi.delRuleAdvanced(ids); | ||
25 | + }, | ||
26 | + | ||
20 | } | 27 | } |
21 | }; | 28 | }; |
@@ -12,7 +12,8 @@ server: | @@ -12,7 +12,8 @@ server: | ||
12 | key-store-password: Hg0801.. | 12 | key-store-password: Hg0801.. |
13 | key-password: Hg0801.. | 13 | key-password: Hg0801.. |
14 | url: | 14 | url: |
15 | - gateway: https://192.168.0.69:8080 | 15 | +# gateway: https://192.168.0.69:8080 |
16 | + gateway: http://192.168.0.123:8080 | ||
16 | inspection_web: http://127.0.0.1:8082 | 17 | inspection_web: http://127.0.0.1:8082 |
17 | assetsweb: http://127.0.0.1:8082 | 18 | assetsweb: http://127.0.0.1:8082 |
18 | mxgraph_editor: http://127.0.0.1:8085 | 19 | mxgraph_editor: http://127.0.0.1:8085 |
@@ -109,13 +109,27 @@ | @@ -109,13 +109,27 @@ | ||
109 | <el-col :span="6"> | 109 | <el-col :span="6"> |
110 | <div class="title-text"> | 110 | <div class="title-text"> |
111 | <i class="iconfont icon-liebiao"></i> | 111 | <i class="iconfont icon-liebiao"></i> |
112 | - <span>高级规则</span> | 112 | + <span class="m-r-6">高级规则</span> |
113 | </div> | 113 | </div> |
114 | </el-col> | 114 | </el-col> |
115 | </el-row> | 115 | </el-row> |
116 | - <el-row> | ||
117 | - <el-col :span="6"> | ||
118 | 116 | ||
117 | + <el-row> | ||
118 | + <el-col :span="8" class="align-left"> | ||
119 | + <div class="d-flex m-b-6"> | ||
120 | + <el-date-picker | ||
121 | + :size="$global.elementConfig.size.input" | ||
122 | + v-model="durationTimeObj.params.startTime" | ||
123 | + type="datetimerange" | ||
124 | + format="YYYY-MM-DD HH:mm:ss" | ||
125 | + unlink-panels | ||
126 | + range-separator=" 至 " | ||
127 | + start-placeholder="开始时间" | ||
128 | + end-placeholder="结束时间" | ||
129 | + /> | ||
130 | + <el-button type="primary" class="m-l-6" :size="$global.elementConfig.size.button" @click="addRule">新增</el-button> | ||
131 | + <el-button class="m-l-6" :size="$global.elementConfig.size.button" @click="getRuleList">刷新</el-button> | ||
132 | + </div> | ||
119 | </el-col> | 133 | </el-col> |
120 | </el-row> | 134 | </el-row> |
121 | <el-row > | 135 | <el-row > |
@@ -130,11 +144,30 @@ | @@ -130,11 +144,30 @@ | ||
130 | :showBorder="true" | 144 | :showBorder="true" |
131 | :loading="loading" | 145 | :loading="loading" |
132 | :showPage="false" | 146 | :showPage="false" |
133 | - :showTools="false" | 147 | + :showTools="true" |
134 | :getRowKeys="'busId'" | 148 | :getRowKeys="'busId'" |
135 | :defaultExpand="true" | 149 | :defaultExpand="true" |
136 | - :height="400"> | 150 | + :toolsWith="150" |
151 | + :height="300"> | ||
137 | <template #default="{row,prop,column}"> | 152 | <template #default="{row,prop,column}"> |
153 | + <div v-if="(prop == 'startTime' || prop == 'endTime') && row.editFlag && row.editFlag == true"> | ||
154 | + <el-date-picker | ||
155 | + v-model="row[prop]" | ||
156 | + type="datetime" | ||
157 | + @change="changeRule(row)" | ||
158 | + placeholder="请选择" | ||
159 | + :size="$global.elementConfig.size.input" | ||
160 | + /> | ||
161 | + </div> | ||
162 | + <div v-if="prop == 'status'"> | ||
163 | + <el-switch v-model="row[prop]" active-text="启用" inactive-text="禁用" @change="changeRule(row)"/> | ||
164 | + </div> | ||
165 | + </template> | ||
166 | + <template #tools="{scope}" > | ||
167 | + <div> | ||
168 | + <el-button text @click="changeRule(scope.row,'edit')">编辑</el-button> | ||
169 | + <el-button text @click="changeRule(scope.row,'delete')">删除</el-button> | ||
170 | + </div> | ||
138 | </template> | 171 | </template> |
139 | </cm-table-page> | 172 | </cm-table-page> |
140 | </el-col> | 173 | </el-col> |
@@ -107,6 +107,56 @@ export default { | @@ -107,6 +107,56 @@ export default { | ||
107 | subscriptionReportVisible: false,//订阅人员弹框 | 107 | subscriptionReportVisible: false,//订阅人员弹框 |
108 | bizName: '',//业务名称 | 108 | bizName: '',//业务名称 |
109 | ruleData: [],//故障规则定义数据 | 109 | ruleData: [],//故障规则定义数据 |
110 | + // 2022-7-26 10.47 故障功能优化新增功能 | ||
111 | + durationTimeObj: { | ||
112 | + params: { | ||
113 | + ruleId: '', // 故障定义规则ID1aa9e18147e54f0bb8b24b7c96ad60ae | ||
114 | + startTime: '', | ||
115 | + endTime: '', | ||
116 | + status: 1, // 状态0禁用1启用 | ||
117 | + }, | ||
118 | + data: { | ||
119 | + columns: [{ | ||
120 | + prop: 'startTime', | ||
121 | + label: '开始时间', | ||
122 | + sortable: true, | ||
123 | + align: 'center', | ||
124 | + render: function (row) { | ||
125 | + if (row && row.startTime) { | ||
126 | + return dayjs(row.startTime).format('YYYY-MM-DD HH:mm:ss') | ||
127 | + } | ||
128 | + } | ||
129 | + }, { | ||
130 | + prop: 'endTime', | ||
131 | + label: '结束时间', | ||
132 | + sortable: true, | ||
133 | + align: 'center', | ||
134 | + render: function (row) { | ||
135 | + if (row && row.endTime) { | ||
136 | + return dayjs(row.endTime).format('YYYY-MM-DD HH:mm:ss') | ||
137 | + } | ||
138 | + } | ||
139 | + }, { | ||
140 | + prop: 'createTime', | ||
141 | + label: '创建时间', | ||
142 | + sortable: true, | ||
143 | + align: 'center', | ||
144 | + render: function (row) { | ||
145 | + if (row && row.createTime) { | ||
146 | + return dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') | ||
147 | + } | ||
148 | + } | ||
149 | + }, { | ||
150 | + prop: 'status', | ||
151 | + label: '状态', | ||
152 | + sortable: true, | ||
153 | + align: 'center' | ||
154 | + }], | ||
155 | + list: [], | ||
156 | + total: 0 | ||
157 | + } | ||
158 | + | ||
159 | + } | ||
110 | } | 160 | } |
111 | }, | 161 | }, |
112 | setup(props) { | 162 | setup(props) { |
@@ -206,82 +256,7 @@ export default { | @@ -206,82 +256,7 @@ export default { | ||
206 | proxy.baseList = val; | 256 | proxy.baseList = val; |
207 | } | 257 | } |
208 | 258 | ||
209 | - | ||
210 | - // 2022-7-26 10.47 故障功能优化新增功能 --start | ||
211 | - let durationTimeObj = Vue.ref({ | ||
212 | - params: { | ||
213 | - ruleId: '1aa9e18147e54f0bb8b24b7c96ad60ae', // 故障定义规则ID | ||
214 | - startTime: '', | ||
215 | - endTime: '', | ||
216 | - status: '', // 状态0禁用1启用 | ||
217 | - }, | ||
218 | - data: { | ||
219 | - columns: [{ | ||
220 | - prop: 'startTime', | ||
221 | - label: '开始时间', | ||
222 | - sortable: true, | ||
223 | - align: 'center', | ||
224 | - click: function (row) { | ||
225 | - | ||
226 | - }, | ||
227 | - render: function (row) { | ||
228 | - } | ||
229 | - }, { | ||
230 | - prop: 'endTime', | ||
231 | - label: '结束时间', | ||
232 | - sortable: true, | ||
233 | - align: 'center', | ||
234 | - click: function (row) { | ||
235 | - | ||
236 | - }, | ||
237 | - render: function (row) { | ||
238 | - } | ||
239 | - }, { | ||
240 | - prop: 'status', | ||
241 | - label: '状态', | ||
242 | - sortable: true, | ||
243 | - align: 'center', | ||
244 | - click: function (row) { | ||
245 | - | ||
246 | - }, | ||
247 | - render: function (row) { | ||
248 | - } | ||
249 | - }], | ||
250 | - list: [], | ||
251 | - total: 0 | ||
252 | - } | ||
253 | - }); | ||
254 | - | ||
255 | - // 获取列表 | ||
256 | - const getRuleList = () => { | ||
257 | - debugger | ||
258 | - // store.dispatch('getFaultList', {}).then((res) => { | ||
259 | - // debugger | ||
260 | - // if (res && res.success) { | ||
261 | - // durationTimeObj.value.data.list = res.data; | ||
262 | - // } | ||
263 | - // }).catch(e => { | ||
264 | - // debugger | ||
265 | - // console.log(e); | ||
266 | - // }) | ||
267 | - store.dispatch('getRuleAdvanced', durationTimeObj.value.params.ruleId).then((res) => { | ||
268 | - debugger | ||
269 | - if (res && res.success) { | ||
270 | - durationTimeObj.value.data.list = res.data; | ||
271 | - } | ||
272 | - }).catch(e => { | ||
273 | - console.log(e); | ||
274 | - }) | ||
275 | - } | ||
276 | - | ||
277 | - Vue.onMounted(() => { | ||
278 | - getRuleList(); | ||
279 | - }) | ||
280 | - | ||
281 | - // 2022-7-26 10.47 故障功能优化新增功能 --end | ||
282 | - | ||
283 | return { | 259 | return { |
284 | - durationTimeObj, | ||
285 | baseList, | 260 | baseList, |
286 | callbackBaseList, | 261 | callbackBaseList, |
287 | count, | 262 | count, |
@@ -329,6 +304,104 @@ export default { | @@ -329,6 +304,104 @@ export default { | ||
329 | } | 304 | } |
330 | }) | 305 | }) |
331 | }, | 306 | }, |
307 | + getRuleList() { | ||
308 | + store.dispatch('getRuleAdvanced', this.durationTimeObj.params.ruleId).then((res) => { | ||
309 | + if (res && res.success) { | ||
310 | + res.data.forEach(function (v) { | ||
311 | + if (v.status == 1) { | ||
312 | + v.status = true; | ||
313 | + } else if (v.status == 2) { | ||
314 | + v.status = false; | ||
315 | + } | ||
316 | + v.editFlag = false; | ||
317 | + }) | ||
318 | + this.durationTimeObj.data.list = res.data; | ||
319 | + } | ||
320 | + }); | ||
321 | + }, | ||
322 | + checkDateTime(row){ | ||
323 | + if(!row.ruleId){ | ||
324 | + this.$global.showMsg("请先保存配置!","warning"); | ||
325 | + return false; | ||
326 | + } | ||
327 | + if(!row.startTime || !dayjs(row.startTime).isValid()){ | ||
328 | + this.$global.showMsg("请选择开始时间!","warning"); | ||
329 | + return false; | ||
330 | + } else { | ||
331 | + row.startTime = dayjs(row.startTime).format('YYYY-MM-DD HH:mm:ss') | ||
332 | + } | ||
333 | + | ||
334 | + if(!row.endTime || !dayjs(row.endTime).isValid()){ | ||
335 | + this.$global.showMsg("请选择开始时间!","warning"); | ||
336 | + return false; | ||
337 | + } else { | ||
338 | + row.endTime = dayjs(row.endTime).format('YYYY-MM-DD HH:mm:ss') | ||
339 | + } | ||
340 | + | ||
341 | + return true; | ||
342 | + }, | ||
343 | + addRule() { | ||
344 | + var that = this; | ||
345 | + var timeArr = that.durationTimeObj.params.startTime; | ||
346 | + that.durationTimeObj.params.startTime = timeArr[0]; | ||
347 | + that.durationTimeObj.params.endTime = timeArr[1]; | ||
348 | + | ||
349 | + if(!that.checkDateTime(that.durationTimeObj.params)){ | ||
350 | + return; | ||
351 | + } | ||
352 | + store.dispatch('saveOrUpdateRuleAdvanced', that.durationTimeObj.params).then((res) => { | ||
353 | + that.durationTimeObj.params.startTime = ''; | ||
354 | + that.durationTimeObj.params.endTime = ''; | ||
355 | + if (res && res.success) { | ||
356 | + // 刷新列表 | ||
357 | + that.getRuleList(); | ||
358 | + that.$global.showMsg(res.msg); | ||
359 | + return; | ||
360 | + } | ||
361 | + that.$global.showMsg(res.msg,'warning'); | ||
362 | + }); | ||
363 | + }, | ||
364 | + changeRule(row, type) { | ||
365 | + var that = this; | ||
366 | + | ||
367 | + if (type == 'delete') { | ||
368 | + that.$global.confirm("您确认删除该记录吗?", function () { | ||
369 | + store.dispatch('delRuleAdvanced', row.id).then((res) => { | ||
370 | + if (res && res.success) { | ||
371 | + // 刷新列表 | ||
372 | + that.getRuleList(); | ||
373 | + } | ||
374 | + }); | ||
375 | + }); | ||
376 | + return; | ||
377 | + } | ||
378 | + if (type == 'edit') { | ||
379 | + row.editFlag = true; | ||
380 | + return; | ||
381 | + } | ||
382 | + | ||
383 | + if(!that.checkDateTime(row)){ | ||
384 | + return; | ||
385 | + } | ||
386 | + | ||
387 | + if (row.status === true) { | ||
388 | + row.status = 1; | ||
389 | + } else { | ||
390 | + row.status = 2; | ||
391 | + } | ||
392 | + | ||
393 | + | ||
394 | + delete row['editFlag']; | ||
395 | + store.dispatch('saveOrUpdateRuleAdvanced', row).then((res) => { | ||
396 | + if (res && res.success) { | ||
397 | + // 刷新列表 | ||
398 | + that.getRuleList(); | ||
399 | + that.$global.showMsg(res.msg); | ||
400 | + return; | ||
401 | + } | ||
402 | + that.$global.showMsg(res.msg,'warning'); | ||
403 | + }); | ||
404 | + }, | ||
332 | hiddenAll() { | 405 | hiddenAll() { |
333 | this.faultDefinitionHide = false; | 406 | this.faultDefinitionHide = false; |
334 | this.networkMonitorHide = false; | 407 | this.networkMonitorHide = false; |
@@ -902,7 +975,6 @@ export default { | @@ -902,7 +975,6 @@ export default { | ||
902 | }, | 975 | }, |
903 | //获取故障规则定义的详情 | 976 | //获取故障规则定义的详情 |
904 | getRuleDetail() { | 977 | getRuleDetail() { |
905 | - | ||
906 | let that = this; | 978 | let that = this; |
907 | let params = {} | 979 | let params = {} |
908 | this.$http.get('/api-web/fault/conf/rule/' + this.docId, params, function (res) { | 980 | this.$http.get('/api-web/fault/conf/rule/' + this.docId, params, function (res) { |
@@ -912,9 +984,10 @@ export default { | @@ -912,9 +984,10 @@ export default { | ||
912 | that.kpiId = that.ruleData[0].kpiId; | 984 | that.kpiId = that.ruleData[0].kpiId; |
913 | that.triggerValue = that.ruleData[0].triggerValue; | 985 | that.triggerValue = that.ruleData[0].triggerValue; |
914 | that.ruleId = that.ruleData[0].id; | 986 | that.ruleId = that.ruleData[0].id; |
987 | + // 加载规则列表 | ||
988 | + that.durationTimeObj.params.ruleId = that.ruleId; | ||
989 | + that.getRuleList(); | ||
915 | } | 990 | } |
916 | - | ||
917 | - | ||
918 | } | 991 | } |
919 | 992 | ||
920 | }) | 993 | }) |
@@ -1128,6 +1201,8 @@ export default { | @@ -1128,6 +1201,8 @@ export default { | ||
1128 | that.faultConfId = res.map.bFaultRule.faultConfig.id; | 1201 | that.faultConfId = res.map.bFaultRule.faultConfig.id; |
1129 | that.$global.showMsg('保存成功') | 1202 | that.$global.showMsg('保存成功') |
1130 | // that.alarmList=res.data; | 1203 | // that.alarmList=res.data; |
1204 | + that.durationTimeObj.params.ruleId = res.map.bFaultRule.id; | ||
1205 | + that.getRuleList() | ||
1131 | } else { | 1206 | } else { |
1132 | that.$global.showMsg('保存失败', 'warning') | 1207 | that.$global.showMsg('保存失败', 'warning') |
1133 | 1208 | ||
@@ -1142,7 +1217,6 @@ export default { | @@ -1142,7 +1217,6 @@ export default { | ||
1142 | if (that.faultEnvironmentRadio == 1 && that.count == 0) { | 1217 | if (that.faultEnvironmentRadio == 1 && that.count == 0) { |
1143 | this.$global.showMsg('暂无环境数据,不能启用模块', 'warning') | 1218 | this.$global.showMsg('暂无环境数据,不能启用模块', 'warning') |
1144 | that.isLoading = false; | 1219 | that.isLoading = false; |
1145 | - | ||
1146 | } else { | 1220 | } else { |
1147 | this.getTargetId('base') | 1221 | this.getTargetId('base') |
1148 | that.saveConfigDetailOther(); | 1222 | that.saveConfigDetailOther(); |
-
Please register or login to post a comment