Browse Source

Merge pull request #358 from millionfor/branch-1.0.2

add remove Timing
pull/2/head
millionfor 6 years ago committed by GitHub
parent
commit
a52ce69d2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      escheduler-ui/.env
  2. 3
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue
  3. 47
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue
  4. 12
      escheduler-ui/src/js/conf/home/store/dag/actions.js

4
escheduler-ui/.env

@ -1,7 +1,7 @@
# 后端接口地址
#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

3
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue

@ -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']">

47
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue

@ -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
*/

12
escheduler-ui/src/js/conf/home/store/dag/actions.js

@ -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)
})
})
}
}

Loading…
Cancel
Save