|
|
@ -1,8 +1,11 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="list-model"> |
|
|
|
<div class="list-model" style="position: relative;"> |
|
|
|
<div class="table-box"> |
|
|
|
<div class="table-box"> |
|
|
|
<table class="fixed"> |
|
|
|
<table class="fixed"> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
|
|
|
|
<th width="50"> |
|
|
|
|
|
|
|
<x-checkbox @on-change="_topCheckBoxClick" v-model="checkAll"></x-checkbox> |
|
|
|
|
|
|
|
</th> |
|
|
|
<th> |
|
|
|
<th> |
|
|
|
<span>{{$t('#')}}</span> |
|
|
|
<span>{{$t('#')}}</span> |
|
|
|
</th> |
|
|
|
</th> |
|
|
@ -29,6 +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> |
|
|
|
<td> |
|
|
|
<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> |
|
|
@ -60,11 +64,33 @@ |
|
|
|
<x-button type="error" shape="circle" size="xsmall" data-toggle="tooltip" :title="$t('offline')" @click="_downline(item)" v-if="item.releaseState === 'ONLINE'" v-ps="['GENERAL_USER']" icon="iconfont icon-erji-xiaxianjilu"><!--{{$t('下线')}}--></x-button> |
|
|
|
<x-button type="error" shape="circle" size="xsmall" data-toggle="tooltip" :title="$t('offline')" @click="_downline(item)" v-if="item.releaseState === 'ONLINE'" v-ps="['GENERAL_USER']" icon="iconfont icon-erji-xiaxianjilu"><!--{{$t('下线')}}--></x-button> |
|
|
|
<x-button type="warning" shape="circle" size="xsmall" data-toggle="tooltip" :title="$t('online')" @click="_poponline(item)" v-if="item.releaseState === 'OFFLINE'" v-ps="['GENERAL_USER']" icon="iconfont icon-erji-xiaxianjilu-copy"><!--{{$t('上线')}}--></x-button> |
|
|
|
<x-button type="warning" shape="circle" size="xsmall" data-toggle="tooltip" :title="$t('online')" @click="_poponline(item)" v-if="item.releaseState === 'OFFLINE'" v-ps="['GENERAL_USER']" icon="iconfont icon-erji-xiaxianjilu-copy"><!--{{$t('上线')}}--></x-button> |
|
|
|
<x-button type="info" shape="circle" size="xsmall" data-toggle="tooltip" :title="$t('Cron Manage')" @click="_timingManage(item)" :disabled="item.releaseState !== 'ONLINE'" v-ps="['GENERAL_USER']" icon="iconfont icon-paibanguanli"><!--{{$t('定时管理')}}--></x-button> |
|
|
|
<x-button type="info" shape="circle" size="xsmall" data-toggle="tooltip" :title="$t('Cron Manage')" @click="_timingManage(item)" :disabled="item.releaseState !== 'ONLINE'" v-ps="['GENERAL_USER']" icon="iconfont icon-paibanguanli"><!--{{$t('定时管理')}}--></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" |
|
|
|
|
|
|
|
data-toggle="tooltip" |
|
|
|
|
|
|
|
:title="$t('delete')" |
|
|
|
|
|
|
|
v-ps="['GENERAL_USER']"> |
|
|
|
|
|
|
|
</x-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</x-poptip> |
|
|
|
<x-button type="info" shape="circle" size="xsmall" data-toggle="tooltip" :title="$t('TreeView')" @click="_treeView(item)" icon="iconfont icon-juxingkaobei"><!--{{$t('树形图')}}--></x-button> |
|
|
|
<x-button type="info" shape="circle" size="xsmall" data-toggle="tooltip" :title="$t('TreeView')" @click="_treeView(item)" icon="iconfont icon-juxingkaobei"><!--{{$t('树形图')}}--></x-button> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<x-button style="position: absolute; bottom: -52px; left: 22px;" v-if="strDelete !== ''" @click="_batchDelete">批量删除</x-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
@ -78,7 +104,9 @@ |
|
|
|
name: 'definition-list', |
|
|
|
name: 'definition-list', |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
list: [] |
|
|
|
list: [], |
|
|
|
|
|
|
|
strDelete: '', |
|
|
|
|
|
|
|
checkAll: false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
props: { |
|
|
|
props: { |
|
|
@ -87,7 +115,7 @@ |
|
|
|
pageSize: Number |
|
|
|
pageSize: Number |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
...mapActions('dag', ['editProcessState', 'getStartCheck', 'getReceiver']), |
|
|
|
...mapActions('dag', ['editProcessState', 'getStartCheck', 'getReceiver', 'deleteDefinition', 'batchDeleteDefinition']), |
|
|
|
_rtPublishStatus (code) { |
|
|
|
_rtPublishStatus (code) { |
|
|
|
return _.filter(publishStatus, v => v.code === code)[0].desc |
|
|
|
return _.filter(publishStatus, v => v.code === code)[0].desc |
|
|
|
}, |
|
|
|
}, |
|
|
@ -179,6 +207,27 @@ |
|
|
|
_timingManage (item) { |
|
|
|
_timingManage (item) { |
|
|
|
this.$router.push({ path: `/projects/definition/list/timing/${item.id}` }) |
|
|
|
this.$router.push({ path: `/projects/definition/list/timing/${item.id}` }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Close the delete layer |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
_closeDelete (i) { |
|
|
|
|
|
|
|
this.$refs[`poptip-delete-${i}`][0].doClose() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* delete |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
_delete (item, i) { |
|
|
|
|
|
|
|
this.deleteDefinition({ |
|
|
|
|
|
|
|
processDefinitionId: item.id |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
this.$refs[`poptip-delete-${i}`][0].doClose() |
|
|
|
|
|
|
|
this._onUpdate() |
|
|
|
|
|
|
|
this.$message.success(res.msg) |
|
|
|
|
|
|
|
}).catch(e => { |
|
|
|
|
|
|
|
this.$refs[`poptip-delete-${i}`][0].doClose() |
|
|
|
|
|
|
|
this.$message.error(e.msg || '') |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* edit |
|
|
|
* edit |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -217,6 +266,45 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
_onUpdate () { |
|
|
|
_onUpdate () { |
|
|
|
this.$emit('on-update') |
|
|
|
this.$emit('on-update') |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* click the select-all checkbox |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
_topCheckBoxClick (v) { |
|
|
|
|
|
|
|
this.list.forEach((item, i) => { |
|
|
|
|
|
|
|
this.$set(this.list[i], 'isCheck', v) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this._arrDelChange() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* the array that to be delete |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
_arrDelChange (v) { |
|
|
|
|
|
|
|
let arr = [] |
|
|
|
|
|
|
|
this.list.forEach((item)=>{ |
|
|
|
|
|
|
|
if (item.isCheck) { |
|
|
|
|
|
|
|
arr.push(item.id) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.strDelete = _.join(arr, ',') |
|
|
|
|
|
|
|
if (v === false) { |
|
|
|
|
|
|
|
this.checkAll = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* batch delete |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
_batchDelete () { |
|
|
|
|
|
|
|
this.batchDeleteDefinition({ |
|
|
|
|
|
|
|
processDefinitionIds: this.strDelete |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
this._onUpdate() |
|
|
|
|
|
|
|
this.checkAll = false |
|
|
|
|
|
|
|
this.$message.success(res.msg) |
|
|
|
|
|
|
|
}).catch(e => { |
|
|
|
|
|
|
|
this.checkAll = false |
|
|
|
|
|
|
|
this.$message.error(e.msg || '') |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
@ -225,6 +313,10 @@ |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
this.list = a |
|
|
|
this.list = a |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
pageNo () { |
|
|
|
|
|
|
|
this.checkAll = false |
|
|
|
|
|
|
|
this.strDelete = '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created () { |
|
|
|
created () { |
|
|
|