未验证 提交 a52ce69d 编写于 作者: millionfor's avatar millionfor 提交者: GitHub

Merge pull request #358 from millionfor/branch-1.0.2

add remove Timing
# 后端接口地址
#API_BASE = http://192.168.221.188:12345
API_BASE = http://192.168.221.188:12345
API_BASE = http://192.168.220.154:12345
#API_BASE = http://192.168.220.154:12345
# 本地开发如需ip访问项目把"#"号去掉
#DEV_HOST = 192.168.xx.xx
......@@ -32,7 +32,7 @@
</th>
</tr>
<tr v-for="(item, $index) in list" :key="item.id">
<td width="50"><x-checkbox v-model="item.isCheck" @on-change="_arrDelChange"></x-checkbox></td>
<td width="50"><x-checkbox v-model="item.isCheck" :disabled="item.releaseState === 'OFFLINE'" @on-change="_arrDelChange"></x-checkbox></td>
<td width="50">
<span>{{parseInt(pageNo === 1 ? ($index + 1) : (($index + 1) + (pageSize * (pageNo - 1))))}}</span>
</td>
......@@ -79,6 +79,7 @@
type="error"
shape="circle"
size="xsmall"
:disabled="item.releaseState === 'OFFLINE'"
data-toggle="tooltip"
:title="$t('delete')"
v-ps="['GENERAL_USER']">
......
......@@ -35,7 +35,7 @@
<th>
<span>{{$t('Update Time')}}</span>
</th>
<th width="80">
<th width="120">
<span>{{$t('Operation')}}</span>
</th>
</tr>
......@@ -98,6 +98,28 @@
@click="_offline(item)"
v-if="item.releaseState === 'ONLINE'">
</x-button>
<x-poptip
:ref="'poptip-delete-' + $index"
placement="bottom-end"
width="90">
<p>{{$t('Delete?')}}</p>
<div style="text-align: right; margin: 0;padding-top: 4px;">
<x-button type="text" size="xsmall" shape="circle" @click="_closeDelete($index)">{{$t('Cancel')}}</x-button>
<x-button type="primary" size="xsmall" shape="circle" @click="_delete(item,$index)">{{$t('Confirm')}}</x-button>
</div>
<template slot="reference">
<x-button
icon="iconfont icon-shanchu"
type="error"
shape="circle"
size="xsmall"
:disabled="item.releaseState === 'ONLINE'"
data-toggle="tooltip"
:title="$t('delete')"
v-ps="['GENERAL_USER']">
</x-button>
</template>
</x-poptip>
</td>
</tr>
</table>
......@@ -135,7 +157,28 @@
props: {
},
methods: {
...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'getReceiver']),
...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'getReceiver','deleteTiming']),
/**
* delete
*/
_delete (item, i) {
this.deleteTiming({
scheduleId: item.id
}).then(res => {
this.$refs[`poptip-delete-${i}`][0].doClose()
this.$message.success(res.msg)
this.$router.push({ name: 'projects-definition-list' })
}).catch(e => {
this.$refs[`poptip-delete-${i}`][0].doClose()
this.$message.error(e.msg || '')
})
},
/**
* Close the delete layer
*/
_closeDelete (i) {
this.$refs[`poptip-delete-${i}`][0].doClose()
},
/**
* return state
*/
......
......@@ -589,5 +589,17 @@ export default {
reject(e)
})
})
},
/**
* remove timing
*/
deleteTiming({ state }, payload){
return new Promise((resolve, reject) => {
io.get(`projects/${state.projectName}/schedule/delete`, payload, res => {
resolve(res)
}).catch(e => {
reject(e)
})
})
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册