提交 3b4c3251 编写于 作者: G gongzijian

add remove Timing

上级 7b3ab01e
# 后端接口地址 # 后端接口地址
#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访问项目把"#"号去掉 # 本地开发如需ip访问项目把"#"号去掉
#DEV_HOST = 192.168.xx.xx #DEV_HOST = 192.168.xx.xx
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</th> </th>
</tr> </tr>
<tr v-for="(item, $index) in list" :key="item.id"> <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"> <td width="50">
<span>{{parseInt(pageNo === 1 ? ($index + 1) : (($index + 1) + (pageSize * (pageNo - 1))))}}</span> <span>{{parseInt(pageNo === 1 ? ($index + 1) : (($index + 1) + (pageSize * (pageNo - 1))))}}</span>
</td> </td>
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
type="error" type="error"
shape="circle" shape="circle"
size="xsmall" size="xsmall"
:disabled="item.releaseState === 'OFFLINE'"
data-toggle="tooltip" data-toggle="tooltip"
:title="$t('delete')" :title="$t('delete')"
v-ps="['GENERAL_USER']"> v-ps="['GENERAL_USER']">
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<th> <th>
<span>{{$t('Update Time')}}</span> <span>{{$t('Update Time')}}</span>
</th> </th>
<th width="80"> <th width="120">
<span>{{$t('Operation')}}</span> <span>{{$t('Operation')}}</span>
</th> </th>
</tr> </tr>
...@@ -98,6 +98,28 @@ ...@@ -98,6 +98,28 @@
@click="_offline(item)" @click="_offline(item)"
v-if="item.releaseState === 'ONLINE'"> v-if="item.releaseState === 'ONLINE'">
</x-button> </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> </td>
</tr> </tr>
</table> </table>
...@@ -135,7 +157,28 @@ ...@@ -135,7 +157,28 @@
props: { props: {
}, },
methods: { 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 * return state
*/ */
......
...@@ -589,5 +589,17 @@ export default { ...@@ -589,5 +589,17 @@ export default {
reject(e) 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.
先完成此消息的编辑!
想要评论请 注册