(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2b25b4be"],{
/***/"376d":
/***/function(e,t,a){"use strict";
/* harmony import */a("adbb");
/* harmony import */},
/***/6260:
/***/function(e,t,a){"use strict";
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"411544a2-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/CodeEditor/index.vue?vue&type=template&id=4c0d1130&scoped=true
a("7db0"),a("a9e3"),a("d3b7"),a("0643"),a("fffc"),a("a7be"),a("8c2e"),a("7393"),a("f9d4"),a("959b"),a("ffda"),a("44d5"),a("db91"),a("02f0"),a("9da3"),a("6a70"),a("6d78");var i=a("56b3"),o={name:"CommonEditor",props:{value:{type:String,default:""},language:{type:String,default:null},dHeight:{type:Number,default:300}},data:function(){return{CommonEditor:!1,code:"",coder:null,mode:"javascript",theme:"default",modes:[{value:"javascript",label:"Javascript"},{value:"x-java",label:"Java"},{value:"x-python",label:"Python"},{value:"x-sql",label:"SQL"},{value:"x-shell",label:"Shell"},{value:"x-powershell",label:"PowerShell"},{value:"x-php",label:"PHP"}]}},watch:{language:{handler:function(e){var t=this;this.getCoder().then((function(){
// 尝试从父容器获取语法类型
if(e){
// 获取具体的语法类型对象
var a=t.getLanguage(e);
// 判断父容器传入的语法是否被支持
a&&(t.mode=a.label,t.coder.setOption("mode","text/".concat(a.value)))}}))},immediate:!0}},computed:{coderOptions:function(){return{line:!0,styleActiveLine:!0,mode:"application/json",
// json数据高亮
theme:"blackboard",
//设置主题 记得引入对应主题才有显示   import 'codemirror/theme/blackboard.css'
tabSize:1,fullScreen:!1,lineNumbers:!0,
// 显示行号
cursorHeight:.8,
//光标高度，默认是1
autoCloseBrackets:!0,autoComplete:!1,matchBrackets:!0,
// 括号匹配
lineWrapping:"wrap",
// 文字过长时，是换行(wrap)还是滚动(scroll),默认是滚动
showCursorWhenSelecting:!0,
// 文本选中时显示光标
smartIndent:!0,
// 智能缩进
completeSingle:!1}}},mounted:function(){
// 初始化
this.initialize()},methods:{
// 初始化
initialize:function(){var e=this;
// 初始化编辑器实例，传入需要被实例化的文本域对象和默认配置
this.coder=i.fromTextArea(this.$refs.textarea,this.coderOptions),
// this.coder.setSize("auto",  this.dHeight)
this.coder.on("inputRead",(function(){e.coder.showHint()})),
// 编辑器赋值
this.value||this.code?this.setCodeContent(this.value||this.code):this.coder.setValue(""),
// 支持双向绑定
this.coder.on("change",(function(t){e.code=t.getValue(),e.$emit&&e.$emit("input",e.code)}))},setCodeContent:function(e){var t=this;setTimeout((function(){e?t.coder.setValue(e):t.coder.setValue("")}),300)},getCoder:function(){var e=this;return new Promise((function(t){!function a(){e.coder?t(e.coder):setTimeout(a,10)}()}))},getLanguage:function(e){
// 在支持的语法类型列表中寻找传入的语法类型
return this.modes.find((function(t){
// 所有的值都忽略大小写，方便比较
var a=e.toLowerCase(),i=t.label.toLowerCase(),o=t.value.toLowerCase();
// 由于真实值可能不规范，例如 java 的真实值是 x-java ，所以讲 value 和 label 同时和传入语法进行比较
return i===a||o===a}))},changeMode:function(e){
// 修改编辑器的语法配置
this.coder.setOption("mode","text/".concat(e));
// 获取修改后的语法
var t=this.getLanguage(e).label.toLowerCase();
// 允许父容器通过以下函数监听当前的语法值
this.$emit("language-change",t)}}},r=(a("884c"),a("2877")),n=Object(r.a)(o,(function(){var e=this,t=e._self._c;return t("div",{attrs:{className:"common-editor"}},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],ref:"textarea",domProps:{value:e.value},on:{input:function(t){t.target.composing||(e.value=t.target.value)}}})])}),[],!1,null,"4c0d1130",null)
/* harmony default export */;t.a=n.exports},
/***/6878:
/***/function(e,t,a){"use strict";
/* harmony export (binding) */a.d(t,"e",(function(){return s})),
/* harmony export (binding) */a.d(t,"a",(function(){return l})),
/* harmony export (binding) */a.d(t,"b",(function(){return u})),
/* harmony export (binding) */a.d(t,"c",(function(){return m})),
/* harmony export (binding) */a.d(t,"d",(function(){return h})),
/* harmony export (binding) */a.d(t,"f",(function(){return g}));
/* harmony import */var i=a("c7eb"),o=a("1da1"),r=a("7424"),n=a("b775");
/* harmony import */
//历史告警
function s(e){return c.apply(this,arguments)}
//历史数据
function c(){return(c=Object(o.a)(Object(i.a)().mark((function e(t){return Object(i.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(n.g)(r.GETSQLREPORTTEMPLETE,n.b.POST,t,{timeout:6e8}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e){return d.apply(this,arguments)}
//自定义数据
function d(){return(d=Object(o.a)(Object(i.a)().mark((function e(t){return Object(i.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(n.g)(r.ADDSQLREPORTTEMPLETE,n.b.POST,t,{timeout:6e8}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function u(e){return p.apply(this,arguments)}function p(){return(p=Object(o.a)(Object(i.a)().mark((function e(t){return Object(i.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(n.g)(r.DelSQLREPORTTEMPLETE,n.b.POST,t,{timeout:6e8}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e){return f.apply(this,arguments)}function f(){return(f=Object(o.a)(Object(i.a)().mark((function e(t){return Object(i.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(n.g)(r.EDITSQLREPORTTEMPLETE,n.b.POST,t,{timeout:6e8}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e){return b.apply(this,arguments)}function b(){return(b=Object(o.a)(Object(i.a)().mark((function e(t){return Object(i.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(n.g)(r.EXPORTSQLREPORTTEMPLETE,n.b.POST,t,{timeout:6e8}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return v.apply(this,arguments)}function v(){return(v=Object(o.a)(Object(i.a)().mark((function e(t){return Object(i.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(n.g)(r.VIEWSQLREPORTTEMPLETE,n.b.POST,t,{timeout:6e8}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}
/* unused harmony default export */},
/***/"71da":
/***/function(e,t,a){"use strict";
/* harmony import */a("d3be");
/* harmony import */},
/***/"884c":
/***/function(e,t,a){"use strict";
/* harmony import */a("9541");
/* harmony import */},
/***/9541:
/***/function(e,t,a){
// extracted by mini-css-extract-plugin
/***/},
/***/adbb:
/***/function(e,t,a){
// extracted by mini-css-extract-plugin
/***/},
/***/ccb5:
/***/function(e,t,a){"use strict";
// ESM COMPAT FLAG
a.r(t);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"411544a2-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/reporting/sqlReport/SqlReportTemplate.vue?vue&type=template&id=1766f053&scoped=true
a("b0c0"),a("d3b7");var i=a("cf45"),o=a("daf8"),r=a("6878"),n=a("7424"),s=a("6260"),c={name:"SQLDataHistoryTemplete",i18n:a("89fe"),components:{Mtextarea:o.a,codeEditor:s.a},data:function(){return{messageShowLoad:!1,pagination:{pageSize:15,showSizeChanger:!0},isFullscreen:!1,codePopUpValue:"",sqlVisible:!1,textAreValue:"",editVisible:!1,addVisible:!1,SelectAlarmData:7,SelectPeriod:3,IsExport:!1,upFileUrl:n.UPDATESQLREPORTTEMPLETE,AddForm:this.$form.createForm(this),EditForm:this.$form.createForm(this),columns:[{slotName:"diyReportTemplete.SQLReportName",width:"30%",scopedSlots:{customRender:"Name",title:"diyReportTemplete.SQLReportName"},dataIndex:"Name"},{width:"30%",slotName:"diyReportTemplete.SQLReportDes",scopedSlots:{customRender:"Describe",title:"diyReportTemplete.SQLReportDes"},dataIndex:"Describe"},{slotName:"configComponent.video.TableVideoOpt",width:"40%",scopedSlots:{customRender:"Opt",title:"configComponent.video.TableVideoOpt"}}],dataSource:[],SelectDevice:[],deviceTreeData:[]}},authorize:{},mounted:function(){this.GetSQLReportTemplates()},activated:function(){},filters:{formatDate:function(e){var t=new Date(e);return Object(i.a)(t,"yyyy-MM-dd hh:mm:ss")}},created:function(){},watch:{},methods:{changeCodeTextarea:function(e){this.codePopUpValue=e},localUpgradeCharge:function(e){if(this.messageShowLoad=!0,"done"===e.file.status){var t=e.file.response;0==t.Code?this.$message.success("".concat(e.file.name," ")+this.$t("dataModel.importSuccess")):-2==t.Code?this.$message.error("".concat(e.file.name," ")+this.$t("dataModel.FormatError")):this.$message.error("".concat(e.file.name," ")+this.$t("SystemUpgrade.UpgradeFileSaveError"))}else e.file.status;this.messageShowLoad=!1},ExportReport:function(e){var t=this,a={uuid:e.Uuid};t.$message.loading({content:t.$t("diyReportTemplete.ExportLoading"),duration:0}),t.IsExport=!0,Object(r.d)(a).then((function(a){if(0==a.data.code){t.$message.destroy();var i=document.createElement("a");i.href=a.data.path,i.setAttribute("download",e.Name+".zip"),i.style.display="none",document.body.appendChild(i),setTimeout((function(){i.click(),document.body.removeChild(i)}),66)}else t.IsExport=!1,t.$message.destroy(),t.$message.error(t.$t("diyReportTemplete.HandExportFailed"))})).finally((function(e){t.IsExport=!1}))},SQLAddTemplateAction:function(){var e=this,t=this;this.AddForm.validateFields((function(a){if(!a){var i={Name:e.AddForm.getFieldValue("Name"),Describe:e.textAreValue};Object(r.a)(i).then((function(e){0==e.data.code?(t.GetSQLReportTemplates(),t.addVisible=!1):t.$message.success(t.$t("alarm.trigger.AddFailed"))}))}}))},EditSQLTemplateAction:function(){var e=this,t=this;this.EditForm.validateFields((function(a){if(!a){var i={uuid:t.editUuid,data:{Name:e.EditForm.getFieldValue("Name"),Describe:e.textAreValue}};Object(r.c)(i).then((function(e){0==e.data.code?(t.GetSQLReportTemplates(),t.$message.success(t.$t("alarm.trigger.EditSuccess")),t.editVisible=!1):t.$message.success(t.$t("VideoManager.EditFailed"))}))}}))},goToEdit:function(e){this.editUuid=e.Uuid,this.textAreValue=e.Describe;var t=this;this.editVisible=!0,this.$message.loading(this.$t("monitor.loading"),.5),setTimeout((function(){t.EditForm.setFieldsValue({Name:e.Name,Describe:e.Describe})}),200)},goToEditSql:function(e){this.editUuid=e.Uuid,this.codePopUpValue=e.SqlScript;this.sqlVisible=!0},DelSQLTemplateAction:function(e){var t=this,a={Uuid:e};Object(r.b)(a).then((function(e){0==e.data.code?(t.GetSQLReportTemplates(),t.$message.success(t.$t("component.systemImageModel.delImageSuccess")),t.addVisible=!1):t.$message.error(t.$t("component.systemImageModel.delImageFailed"))}))},GetSQLReportTemplates:function(){var e=this;e.loading=!0,this.dataSource=[],Object(r.e)().then((function(t){e.loading=!1,0==t.data.code&&(null==t.data.list?e.dataSource=[]:e.dataSource=t.data.list)})).finally((function(t){e.loading=!1}))},EditSQLTemplateQuery:function(){var e=this,t={uuid:e.editUuid,data:{SqlScript:this.codePopUpValue}};Object(r.c)(t).then((function(t){0==t.data.code?(e.GetSQLReportTemplates(),e.$message.success(e.$t("alarm.trigger.EditSuccess")),e.sqlVisible=!1):e.$message.success(e.$t("VideoManager.EditFailed"))}))}}},l=(a("71da"),a("2877")),d=Object(l.a)(c,(function(){var e=this,t=e._self._c;return t("a-card",[t("a-button",{attrs:{type:"primary"},on:{click:function(t){e.addVisible=!0,e.textAreValue="",e.SelectDevice=[],e.SelectAlarmData=7,e.SelectPeriod=3}}},[e._v(" "+e._s(e.$t("configComponent.video.AddVideo"))+" ")]),t("a-divider",{attrs:{type:"vertical"}}),t("a-button",{attrs:{disabled:e.messageShowLoad,type:"default"},on:{click:function(t){return e.GetSQLReportTemplates()}}},[e._v(" "+e._s(e.$t("configComponent.video.VideoRefresh"))+" ")]),t("div",{staticStyle:{"margin-top":"5px"}},[t("a-table",{attrs:{rowKey:"Name",pagination:e.pagination,columns:e.columns,"data-source":e.dataSource},scopedSlots:e._u([{key:"Status",fn:function(a){return t("span",{},[1==a?t("div",{staticStyle:{color:"#74f808"}},[e._v(" "+e._s(e.$t("configComponent.video.VideoOnline"))+" ")]):0==a?t("div",{staticStyle:{color:"#ea1111"}},[e._v(" "+e._s(e.$t("configComponent.video.VideoOffline"))+" ")]):e._e()])}},{key:"Opt",fn:function(a,i){return t("div",{},[t("a-button",{staticStyle:{"margin-right":"2px",padding:"0",cursor:"pointer",color:"#13C2C2"},attrs:{type:"link",disabled:e.IsExport},on:{click:function(t){return e.goToEdit(i)}}},[t("a-icon",{attrs:{type:"edit"}}),t("span",{staticStyle:{"margin-left":"2px"}},[e._v(e._s(e.$t("monitor.nodeEdit")))])],1),t("a-divider",{attrs:{type:"vertical"}}),t("a-upload",{attrs:{name:"file",multiple:!1,action:e.upFileUrl+"/"+i.Uuid,showUploadList:!1},on:{change:e.localUpgradeCharge}},[t("a-button",{attrs:{type:"link"}},[t("icon-font",{attrs:{type:"icon-SQLjiaoben"}}),e._v(" "+e._s(e.$t("diyReportTemplete.SQLImportTemplate"))+" ")],1)],1),t("a-divider",{attrs:{type:"vertical"}}),t("a-button",{staticStyle:{"margin-right":"2px",padding:"0",cursor:"pointer",color:"#13C2C2"},attrs:{type:"link"},on:{click:function(t){return e.goToEditSql(i)}}},[t("a-icon",{attrs:{type:"export"}}),t("span",{staticStyle:{"margin-left":"2px"}},[e._v(e._s(e.$t("diyReportTemplete.SQLQuery")))])],1),t("a-divider",{attrs:{type:"vertical"}}),t("a-button",{staticStyle:{"margin-right":"2px",padding:"0",cursor:"pointer",color:"#13C2C2"},attrs:{type:"link"},on:{click:function(t){return e.ExportReport(i)}}},[t("a-icon",{attrs:{type:"export"}}),t("span",{staticStyle:{"margin-left":"2px"}},[e._v(e._s(e.$t("diyReportTemplete.ExportReport")))])],1),t("a-divider",{attrs:{type:"vertical"}}),t("a-popconfirm",{attrs:{disabled:e.IsExport,title:e.$t("configComponent.video.DelVideoConfirm"),"ok-text":e.$t("component.systemImageModel.delImageYes"),"cancel-text":e.$t("component.systemImageModel.delImageNo")},on:{confirm:function(t){return e.DelSQLTemplateAction(i.Uuid)}}},[t("a-icon",{staticStyle:{color:"red"},attrs:{slot:"icon",type:"question-circle-o"},slot:"icon"}),t("a-icon",{attrs:{type:"delete",theme:"twoTone","two-tone-color":"#eb2f96"}}),t("a",{staticStyle:{color:"#eb2f96"}},[e._v(e._s(e.$t("configComponent.video.DelVideo")))])],1)],1)}}])},[e._l(e.columns,(function(a,i){return t("template",{slot:a.slotName},[t("span",{key:i},[e._v(e._s(e.$t(a.slotName)))])])}))],2)],1),t("a-modal",{attrs:{title:e.$t("configComponent.video.AddVideo")},on:{ok:e.SQLAddTemplateAction},model:{value:e.addVisible,callback:function(t){e.addVisible=t},expression:"addVisible"}},[t("a-form",{attrs:{form:e.AddForm,"label-col":{span:4},"wrapper-col":{span:19}}},[t("a-form-item",{attrs:{label:e.$t("diyReportTemplete.Name")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["Name",{rules:[{required:!0}]}],expression:"[\n              'Name',\n              { rules: [{ required: true}] },\n            ]"}]})],1),t("a-form-item",{attrs:{label:e.$t("diyReportTemplete.Describe")}},[t("Mtextarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["Describe",{rules:[{required:!0,message:e.$t("diyReportTemplete.Describe")}]}],expression:"['Describe', { rules: [{ required: true, message: $t('diyReportTemplete.Describe') }] }]"}],attrs:{rows:"4",showWordLimit:!0,maxLength:100,autoSize:!1},model:{value:e.textAreValue,callback:function(t){e.textAreValue=t},expression:"textAreValue"}})],1)],1)],1),t("a-modal",{attrs:{title:e.$t("configComponent.video.AddVideo")},on:{ok:e.EditSQLTemplateAction},model:{value:e.editVisible,callback:function(t){e.editVisible=t},expression:"editVisible"}},[t("a-form",{attrs:{form:e.EditForm,"label-col":{span:4},"wrapper-col":{span:19}}},[t("a-form-item",{attrs:{label:e.$t("diyReportTemplete.Name")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["Name",{rules:[{required:!0}]}],expression:"[\n              'Name',\n              { rules: [{ required: true}] },\n            ]"}]})],1),t("a-form-item",{attrs:{label:e.$t("diyReportTemplete.Describe")}},[t("Mtextarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["Describe",{rules:[{required:!0,message:e.$t("diyReportTemplete.Describe")}]}],expression:"['Describe', { rules: [{ required: true, message: $t('diyReportTemplete.Describe') }] }]"}],attrs:{rows:"4",showWordLimit:!0,maxLength:100,autoSize:!1},model:{value:e.textAreValue,callback:function(t){e.textAreValue=t},expression:"textAreValue"}})],1)],1)],1),t("a-modal",{attrs:{visible:e.sqlVisible,title:e.$t("displayConfig.Properties.CodeEditDig"),width:600,height:800,destroyOnClose:!0,maskClosable:!1,maskStyle:{},mask:!1},on:{cancel:function(t){e.sqlVisible=!1},ok:e.EditSQLTemplateQuery}},[t("div",[e.sqlVisible?t("code-editor",{attrs:{value:e.codePopUpValue,language:"javascript"},on:{input:function(t){return e.changeCodeTextarea(t)}}}):e._e()],1)])],1)}),[],!1,null,"1766f053",null)
/* harmony default export */;t.default=d.exports},
/***/d3be:
/***/function(e,t,a){
// extracted by mini-css-extract-plugin
/***/},
/***/daf8:
/***/function(e,t,a){"use strict";
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"411544a2-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/textarea/index.vue?vue&type=template&id=b9c09c60&scoped=true
var i={props:{
// 是否展示字数统
showWordLimit:{type:Boolean,default:!1}},
// v-model处理
model:{prop:"value",event:"change"},computed:{
// 长度控制
textLength:function(){return(this.$attrs.value||"").length}},methods:{onChange:function(e){
// v-model 回调函数
this.$emit("change",e.target.value)}}},o=(a("376d"),a("2877")),r=Object(o.a)(i,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"textarea-wrapper"},[t("a-textarea",e._b({staticClass:"m-textarea",on:{change:e.onChange},model:{value:e.$attrs.value,callback:function(t){e.$set(e.$attrs,"value",t)},expression:"$attrs.value"}},"a-textarea",e.$attrs,!1)),e.showWordLimit?t("span",{staticClass:"m-count"},[e._v(e._s(e.textLength)+"/"),e.$attrs.maxLength?[e._v(e._s(e.$attrs.maxLength))]:e._e()],2):e._e()],1)}),[],!1,null,"b9c09c60",null)
/* harmony default export */;t.a=r.exports}}]);