forked from WeBankFinTech/Scriptis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.vue
More file actions
74 lines (74 loc) · 1.68 KB
/
index.vue
File metadata and controls
74 lines (74 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<template>
<Modal
v-model="show"
width="360"
class-name="delete-modal">
<p
slot="header"
class="delete-modal-header">
<Icon type="ios-information-circle"/>
<span>{{ label }}警告</span>
</p>
<div class="delete-modal-content">
<p>
<span>此操作将{{ label }}</span>
<span class="delete-modal-content-type">{{ type }}</span>
<span class="delete-modal-content-name">{{ name }}</span>
</p>
<p>是否继续?</p>
</div>
<div slot="footer">
<Button
:loading="loading"
type="error"
size="large"
long
@click="del">{{ ['引擎', '任务', '引擎和任务'].indexOf(type) !== -1 ? `结束${type}` : '删除' }}</Button>
</div>
</Modal>
</template>
<script>
export default {
props: {
loading: {
type: Boolean,
default: false,
},
},
data() {
return {
show: false,
type: '',
name: '',
};
},
computed: {
label() {
return ['引擎', '任务', '引擎和任务'].indexOf(this.type) !== -1 ? '结束该' : '删除';
},
},
watch: {
'loading': function(val) {
if (!val) {
this.show = false;
}
},
},
methods: {
open(opt) {
this.show = true;
let { type, name } = opt;
this.type = type;
this.name = name;
},
close() {
this.show = false;
},
del() {
this.$emit('delete', this.type);
},
},
};
</script>
<style lang="scss" src="./index.scss">
</style>