@@ -256,6 +327,7 @@
current_site_url:'',
timezone:'',
default_cabinet_usize:'',
+ query_max_series:''
},
basicCopy:null,
basicRules:{
@@ -267,6 +339,7 @@
storage_local_retention:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}],
timezone:[{required:true,message:this.$t('validate.required'),trigger:'blur'}],
default_cabinet_usize:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'},{validator:uSize,trigger:'blur'}],
+ query_max_series:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
},
basicRules2:{
system_name:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
@@ -276,6 +349,7 @@
storage_local_retention:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}],
timezone:[{required:true,message:this.$t('validate.required'),trigger:'blur'}],
default_cabinet_usize:[{validator:positiveInteger,trigger:'blur'},{validator:uSize,trigger:'blur'}],
+ query_max_series:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
},
timezoneOption:[
{label:'UTC-12:00',value:'-12'},
@@ -376,6 +450,22 @@
// { type: 'url', message: this.$t('config.system.link.uriRequired'), trigger: 'blur' } /*检验网址是否正确*/
]
},
+ notificationTemp:{
+ name:'',filePath:''
+ },
+ notification:[],
+ notificationReserved:[],
+ notificationRules:{
+ name:[
+ { required: true, message: this.$t('validate.required'), trigger: 'blur' },
+ { max: 64, message: this.$t('config.system.link.nameMaxLength'), trigger: 'blur' }
+ ],
+ filePath:[
+ { required: true, message: this.$t('validate.required'), trigger: 'blur' },
+ { pattern: /^\/(\w+\/?)+$/, message: this.$t('config.system.notification.filePathReg') }
+ // { type: 'url', message: this.$t('config.system.link.uriRequired'), trigger: 'blur' } /*检验网址是否正确*/
+ ]
+ },
resetRules:{
type:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
password:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
@@ -413,6 +503,10 @@
this.getLinkData();
return
}
+ if(type == 'notification'){
+ this.getNotificationData();
+ return
+ }
this.$get('sysConfig?type='+type).then(response=>{
if(response.code == 200){
let sets=response.data[type];
@@ -537,6 +631,28 @@
start: function (evt) {
// console.log(evt)
},
+ notificationEnd: function (evt) {
+ let length=this.notification.length;
+ if(evt.newIndex==evt.oldIndex){ // 如果没有移动返回
+ return
+ }
+ let parmas={
+ id:this.notification[evt.newIndex].id,
+ prev:0,
+ next:-1
+ }
+ if(evt.newIndex==length-1){
+ parmas.prev=this.notification[evt.newIndex-1].id;
+ }else if(evt.newIndex==0){
+ parmas.next=this.notification[evt.newIndex+1].id;
+ }else{
+ parmas.prev=this.notification[evt.newIndex-1].id;
+ parmas.next=this.notification[evt.newIndex+1].id;
+ }
+ this.$put('/alert/script/modify',parmas).then((response)=>{
+ // this.$store.commit('setLinkData',this.link);
+ })
+ },
end: function (evt) {
let length=this.link.length;
if(evt.newIndex==evt.oldIndex){ // 如果没有移动返回
@@ -645,6 +761,90 @@
}
});
},
+
+ getNotificationData(){
+ this.notificationTemp={name:'',filePath:''};
+ this.$refs['notificationTempForm'].clearValidate();
+ this.$get('/alert/script').then(response=>{
+ this.notification=response.data.list;
+ console.log(this.notification);
+ this.notificationReserved=[...this.notification];
+ });
+ },
+ // link add
+ notificationAdd(){
+ this.$refs['notificationTempForm'].validate((valid) => {
+ if (valid) {
+ this.$post('/alert/script',this.notificationTemp).then(response=>{//新增link
+ if(response.code == 200){
+ this.notificationTemp={name:'',filePath:''};
+ this.notificationAddCallBack();
+ this.$message({duration: 2000, type: 'success', message: this.$t("tip.addSuccess")});
+ }else{
+ this.$message.error(response.msg);
+ }
+ })
+ } else {
+ return false;
+ }
+ });
+ },
+ notificationAddCallBack(){
+ this.$get('/link').then(response=>{
+ this.notification.push(response.data[response.data.length-1]);
+ this.notificationReserved.push(response.data[response.data.length-1]);
+ // this.$store.commit('setLinkData',this.link);
+ });
+ },
+ // link edit
+ notificationEdit(item){
+ let index=this.notification.findIndex((item1)=>item.id==item1.id);
+ this.$set(this.notification,index,{...this.notification[index],isEdit:true});
+ },
+ // link update
+ notificationUpdate(item){
+ this.$refs['notificationForm'+item.id][0].validate((valid) => {
+ if (valid) {
+ let params={
+ id:item.id,
+ name:item.name,
+ filePath:item.filePath,
+ };
+ this.$put('/alert/script',params).then(response=>{
+ if(response.code == 200){
+ let index=this.notification.findIndex((item1)=>item.id==item1.id);
+ this.$set(this.notification,index,{...this.notification[index],isEdit:false});
+ this.notificationReserved=[...this.notification];
+ // this.$store.commit('setLinkData',this.notification);
+ this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
+ }else{
+ this.$message.error(response.msg);
+ }
+ })
+ } else {
+ return false;
+ }
+ });
+ },
+ // link cancel
+ notificationCancel(item){
+ let index=this.notification.findIndex((item1)=>item.id==item1.id);
+ let indexReserved=this.notificationReserved.findIndex((item1)=>item.id==item1.id);
+ this.$set(this.notification,index,{...this.notificationReserved[indexReserved],isEdit:false});
+ },
+ // link del
+ notificationDel(item){
+ this.$delete('/alert/script?ids='+item.id).then((response)=>{
+ if(response.code == 200){
+ this.notification=this.notification.filter((item1)=>item.id!==item1.id);
+ this.notificationReserved=this.notificationReserved.filter((item1)=>item.id!==item1.id);
+ // this.$store.commit('setLinkData',this.link);
+ this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
+ }else{
+ this.$message.error(response.msg);
+ }
+ });
+ },
//openUrl 跳转页面
openUrl(item){
// window.open(item.url)
@@ -765,6 +965,9 @@
.system-config-form.terminal /deep/ .el-input-number--small{
width: 512px;
}
+ .system-config-form.basicForm /deep/ .el-input-number--small{
+ width: 512px;
+ }
.system-config-form /deep/ .el-input input{
text-align: left;
}