fix issue

pull/410/head
vapao 2021-10-14 17:56:19 +08:00
parent ffa4b841b5
commit 76b5ea39de
3 changed files with 46 additions and 3 deletions

View File

@ -28,6 +28,20 @@ export default observer(function Ext1Setup1() {
}, [])
const info = store.deploy;
let modePlaceholder;
switch (info['rst_notify']['mode']) {
case '0':
modePlaceholder = '已关闭'
break
case '1':
modePlaceholder = 'https://oapi.dingtalk.com/robot/send?access_token=xxx'
break
case '3':
modePlaceholder = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx'
break
default:
modePlaceholder = '请输入'
}
return (
<Form labelCol={{span: 6}} wrapperCol={{span: 14}}>
<Form.Item required label="发布环境" style={{marginBottom: 0}}>
@ -88,7 +102,7 @@ export default observer(function Ext1Setup1() {
disabled={store.isReadOnly || info['rst_notify']['mode'] === '0'}
value={info['rst_notify']['value']}
onChange={e => info['rst_notify']['value'] = e.target.value}
placeholder="请输入"/>
placeholder={modePlaceholder}/>
</Form.Item>
<Form.Item wrapperCol={{span: 14, offset: 6}}>
<Button

View File

@ -29,6 +29,20 @@ export default observer(function Ext2Setup1() {
}, [])
const info = store.deploy;
let modePlaceholder;
switch (info['rst_notify']['mode']) {
case '0':
modePlaceholder = '已关闭'
break
case '1':
modePlaceholder = 'https://oapi.dingtalk.com/robot/send?access_token=xxx'
break
case '3':
modePlaceholder = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx'
break
default:
modePlaceholder = '请输入'
}
return (
<Form labelCol={{span: 6}} wrapperCol={{span: 14}}>
<Form.Item required label="发布环境" style={{marginBottom: 0}}>
@ -84,7 +98,7 @@ export default observer(function Ext2Setup1() {
disabled={store.isReadOnly || info['rst_notify']['mode'] === '0'}
value={info['rst_notify']['value']}
onChange={e => info['rst_notify']['value'] = e.target.value}
placeholder="请输入"/>
placeholder={modePlaceholder}/>
</Form.Item>
<Form.Item wrapperCol={{span: 14, offset: 6}}>
<Button

View File

@ -43,6 +43,21 @@ export default observer(function () {
Object.assign(store.record, form.getFieldsValue(), {command: cleanCommand(command)})
}
let modePlaceholder;
switch (store.record.rst_notify.mode) {
case '0':
modePlaceholder = '已关闭'
break
case '1':
modePlaceholder = 'https://oapi.dingtalk.com/robot/send?access_token=xxx'
break
case '3':
modePlaceholder = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx'
break
default:
modePlaceholder = '请输入'
}
return (
<Form form={form} initialValues={store.record} labelCol={{span: 6}} wrapperCol={{span: 14}}>
<Form.Item required label="任务类型" style={{marginBottom: 0}}>
@ -82,7 +97,7 @@ export default observer(function () {
</Select>
)}
disabled={store.record.rst_notify.mode === '0'}
placeholder="请输入"/>
placeholder={modePlaceholder}/>
</Form.Item>
<Form.Item name="desc" label="备注信息">
<Input.TextArea placeholder="请输入模板备注信息"/>