Repository navigation
Expand file tree
/
Copy pathexclude.vue
More file actions
149 lines (132 loc) · 3.49 KB
/
Copy pathexclude.vue
File metadata and controls
149 lines (132 loc) · 3.49 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<template>
<div class="exclude-page fade-in">
<!-- Info Alerts -->
<div class="alerts-section">
<el-alert :title="$t('exclude_tips1')" type="info" :closable="false" show-icon class="modern-alert" />
<el-alert :title="$t('exclude_tips2')" type="warning" :closable="false" show-icon class="modern-alert warning" />
</div>
<!-- Main Card -->
<div class="content-card">
<div class="card-header-custom">
<div class="header-left">
<span>{{ $t('exclude_tips3') }}</span>
</div>
<el-tag type="info" effect="dark" size="small">{{ (cfg.Excludes || []).length }} {{ $t('items') }}</el-tag>
</div>
<!-- Empty State -->
<div v-if="!(cfg.Excludes && cfg.Excludes.length)" class="empty-state">
<p>{{ $t('no_data') }}</p>
</div>
<!-- Exclude List -->
<div v-else class="exclude-list">
<div
v-for="(exclude, index) in cfg.Excludes"
:key="exclude"
class="exclude-item"
>
<div class="item-content">
<span class="item-text">{{ exclude }}</span>
</div>
<el-button
type="danger"
:icon="Delete"
circle
size="small"
class="delete-btn"
@click="remove(index)"
/>
</div>
</div>
<!-- Add Section -->
<div class="add-section">
<div class="add-input-wrapper">
<el-input
v-model="value"
:placeholder="$t('placeholder_exclude') || 'Photoshop.exe'"
@keyup.enter="add"
clearable
class="add-input"
/>
</div>
<el-button type="primary" :icon="Plus" @click="add" class="add-btn">
{{ $t('add') }}
</el-button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { useStore } from 'vuex'
import { useI18n } from 'vue-i18n'
import { ElMessage } from 'element-plus'
import { Plus, Delete } from '@element-plus/icons-vue'
const store = useStore()
const { t } = useI18n()
const value = ref('')
const cfg = computed(() => store.getters.cfg)
const remove = (index: number) => {
if (cfg.value.Excludes) {
cfg.value.Excludes.splice(index, 1)
}
}
const add = () => {
if (value.value.indexOf('.') === -1) {
ElMessage.error(t('exclude_warning'))
return
}
if (!cfg.value.Excludes) {
cfg.value.Excludes = []
}
cfg.value.Excludes.push(value.value)
value.value = ''
}
</script>
<style lang="less" scoped>
.exclude-page {
&:extend(.page-container);
}
// Exclude List
.exclude-list {
padding: 16px;
display: flex;
flex-direction: column;
gap: 10px;
max-height: 400px;
overflow-y: auto;
}
.exclude-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 16px;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: 10px;
transition: all 0.25s ease;
&:hover {
border-color: var(--border-light);
transform: translateX(4px);
}
.item-content {
display: flex;
align-items: center;
gap: 12px;
}
.item-text {
font-size: 14px;
color: var(--text-primary);
font-family: 'Courier New', monospace;
}
.delete-btn {
background: rgba(248, 81, 73, 0.1);
border: 1px solid rgba(248, 81, 73, 0.3);
color: var(--accent-red);
&:hover {
background: var(--accent-red);
border-color: var(--accent-red);
color: white;
}
}
}
</style>