|
|
@ -1,170 +0,0 @@ |
|
|
|
<template> |
|
|
|
<el-dialog |
|
|
|
title="提示" |
|
|
|
model-value |
|
|
|
width="1440px" |
|
|
|
:before-close="handleClose" |
|
|
|
> |
|
|
|
<el-form :model="formData" ref="form" label-width="100px" class="demo-dynamic"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<div class="form-item-list-title"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="21">任务触发器:</el-col> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-button type="primary" @click.prevent="addDomain('Trigger')">添加</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<template v-for="(item, index) in formData.Trigger" :key="index"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item |
|
|
|
:label="'域名' + index" |
|
|
|
:prop="'TriggerType' + index + 'value'" |
|
|
|
:rules="{required: true, message: '域名不能为空', trigger: 'blur'}" |
|
|
|
> |
|
|
|
<el-input v-model="item.TriggerType" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item |
|
|
|
:prop="'Hour'+index" |
|
|
|
label="小时:" |
|
|
|
> |
|
|
|
<el-input-number v-model="item.Hour" :min="0" :max="24"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item |
|
|
|
:prop="'Minute'+index" |
|
|
|
label="分钟:" |
|
|
|
> |
|
|
|
<el-input-number v-model="item.Minute" :min="0" :max="59"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item |
|
|
|
:prop="'Second'+index" |
|
|
|
label="秒:" |
|
|
|
> |
|
|
|
<el-input-number v-model="item.Second" :min="0" :max="59"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-button type="danger" @click.prevent="removeDomain(domain)">删除</el-button> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<el-button @click="handleClose">取 消</el-button> |
|
|
|
<el-button type="primary" @click="submitForm('form')">确 定</el-button> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
export default { |
|
|
|
props:{ |
|
|
|
item:{ |
|
|
|
default:{} |
|
|
|
}, |
|
|
|
isShowDialog:{ |
|
|
|
default:'configuration' |
|
|
|
} |
|
|
|
}, |
|
|
|
data(){ |
|
|
|
return{ |
|
|
|
Trigger:{ |
|
|
|
TriggerType:'', |
|
|
|
Hour:'', |
|
|
|
Minute:'', |
|
|
|
Second:'' |
|
|
|
}, // 处发器模板 |
|
|
|
ETCDLock:{ |
|
|
|
Addr:'', |
|
|
|
Database:'', |
|
|
|
Table:'', |
|
|
|
LockType:'', |
|
|
|
Stage:'', |
|
|
|
Source:'' |
|
|
|
}, // etcd锁模板 |
|
|
|
ETCDLock:{ |
|
|
|
ShellName:'', |
|
|
|
Stage:'' |
|
|
|
}, // Shell模板 |
|
|
|
formData: { |
|
|
|
Trigger:[ |
|
|
|
{ |
|
|
|
TriggerType:'', |
|
|
|
Hour:'', |
|
|
|
Minute:'', |
|
|
|
Second:'' |
|
|
|
} |
|
|
|
], |
|
|
|
ETCDLock:[ |
|
|
|
{ |
|
|
|
Addr:'', |
|
|
|
Database:'', |
|
|
|
Table:'', |
|
|
|
LockType:'', |
|
|
|
Stage:'', |
|
|
|
Source:'' |
|
|
|
} |
|
|
|
], |
|
|
|
Shell:[ |
|
|
|
{ |
|
|
|
ShellName:'', |
|
|
|
Stage:'' |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
handleClose(){ |
|
|
|
this.$emit('update:isShowDialog','') |
|
|
|
}, |
|
|
|
submitForm(formName) { |
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
console.log(this.formData); |
|
|
|
debugger |
|
|
|
if (valid) { |
|
|
|
alert('submit!'); |
|
|
|
} else { |
|
|
|
console.log('error submit!!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
removeDomain(item) { |
|
|
|
var index = this.formData.domains.indexOf(item) |
|
|
|
if (index !== -1) { |
|
|
|
this.formData.domains.splice(index, 1) |
|
|
|
} |
|
|
|
}, |
|
|
|
addDomain(name) { |
|
|
|
this.formData[name].push(this[name]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|
.form-item-list-title{ |
|
|
|
width: 100%; |
|
|
|
height: 60px; |
|
|
|
line-height: 60px; |
|
|
|
border-bottom: 1px solid #C0C4CC; |
|
|
|
margin-bottom: 10px; |
|
|
|
.el-col-21{ |
|
|
|
font-size: 20px; |
|
|
|
font-weight: 600; |
|
|
|
} |
|
|
|
} |
|
|
|
.el-input-number{ |
|
|
|
width:140px; |
|
|
|
} |
|
|
|
</style> |