|
|
@@ -20,12 +20,13 @@
|
|
20
|
20
|
<el-form-item>
|
|
21
|
21
|
<el-button type="primary" @click="handlerQuery">{{ T('Filter') }}</el-button>
|
|
22
|
22
|
<el-button type="danger" @click="toAdd">{{ T('Add') }}</el-button>
|
|
|
23
|
+ <el-button type="primary" @click="showBatchEditTags">{{ T('BatchEditTags') }}</el-button>
|
|
23
|
24
|
</el-form-item>
|
|
24
|
25
|
</el-form>
|
|
25
|
26
|
</el-card>
|
|
26
|
27
|
<el-card class="list-body" shadow="hover">
|
|
27
|
|
- <!-- <el-tag type="danger" style="margin-bottom: 10px">不建议在此操作地址簿,可能会造成数据不同步</el-tag>-->
|
|
28
|
|
- <el-table :data="listRes.list" v-loading="listRes.loading" border>
|
|
|
28
|
+ <el-table :data="listRes.list" v-loading="listRes.loading" border @selection-change="handleSelectionChange">
|
|
|
29
|
+ <el-table-column type="selection" width="50" align="center"></el-table-column>
|
|
29
|
30
|
<el-table-column prop="id" label="ID" align="center" width="200">
|
|
30
|
31
|
<template #default="{row}">
|
|
31
|
32
|
<div>
|
|
|
@@ -151,13 +152,31 @@
|
|
151
|
152
|
@cancel="shareToWebClientVisible=false"
|
|
152
|
153
|
@success=""/>
|
|
153
|
154
|
</el-dialog>
|
|
|
155
|
+ <el-dialog v-model="batchEditTagVisible" width="800">
|
|
|
156
|
+ <el-form :model="batchEditTagsFormData" label-width="120px" class="dialog-form">
|
|
|
157
|
+ <el-form-item :label="T('Tags')" prop="tags">
|
|
|
158
|
+ <el-select v-model="batchEditTagsFormData.tags" multiple>
|
|
|
159
|
+ <el-option
|
|
|
160
|
+ v-for="item in tagListResForBatchEdit.list"
|
|
|
161
|
+ :key="item.name"
|
|
|
162
|
+ :label="item.name"
|
|
|
163
|
+ :value="item.name"
|
|
|
164
|
+ ></el-option>
|
|
|
165
|
+ </el-select>
|
|
|
166
|
+ </el-form-item>
|
|
|
167
|
+ <el-form-item>
|
|
|
168
|
+ <el-button @click="batchEditTagVisible = false">{{ T('Cancel') }}</el-button>
|
|
|
169
|
+ <el-button @click="submitBatchEditTags" type="primary">{{ T('Submit') }}</el-button>
|
|
|
170
|
+ </el-form-item>
|
|
|
171
|
+ </el-form>
|
|
|
172
|
+ </el-dialog>
|
|
154
|
173
|
</div>
|
|
155
|
174
|
</template>
|
|
156
|
175
|
|
|
157
|
176
|
<script setup>
|
|
158
|
177
|
import { onActivated, onMounted, ref, watch } from 'vue'
|
|
159
|
178
|
import { list as fetchTagList } from '@/api/tag'
|
|
160
|
|
- import { useRepositories } from '@/views/address_book'
|
|
|
179
|
+ import { useBatchUpdateTagsRepositories, useRepositories } from '@/views/address_book'
|
|
161
|
180
|
import { toWebClientLink } from '@/utils/webclient'
|
|
162
|
181
|
import { T } from '@/utils/i18n'
|
|
163
|
182
|
import shareByWebClient from '@/views/address_book/components/shareByWebClient.vue'
|
|
|
@@ -166,6 +185,9 @@
|
|
166
|
185
|
import { handleClipboard } from '@/utils/clipboard'
|
|
167
|
186
|
import { CopyDocument } from '@element-plus/icons'
|
|
168
|
187
|
import PlatformIcons from '@/components/icons/platform.vue'
|
|
|
188
|
+ import { batchUpdateTags } from '@/api/address_book'
|
|
|
189
|
+ import { ElMessage } from 'element-plus'
|
|
|
190
|
+ import { useRepositories as useTagRepositories } from '@/views/tag'
|
|
169
|
191
|
|
|
170
|
192
|
const is_my = 1
|
|
171
|
193
|
const appStore = useAppStore()
|
|
|
@@ -199,6 +221,31 @@
|
|
199
|
221
|
watch(() => listQuery.page, getList)
|
|
200
|
222
|
|
|
201
|
223
|
watch(() => listQuery.page_size, handlerQuery)
|
|
|
224
|
+
|
|
|
225
|
+ const {
|
|
|
226
|
+ tagListRes: tagListResForBatchEdit,
|
|
|
227
|
+ getTagList: getTagListForBatchEdit,
|
|
|
228
|
+ visible: batchEditTagVisible,
|
|
|
229
|
+ show: showBatchEditTags,
|
|
|
230
|
+ formData: batchEditTagsFormData,
|
|
|
231
|
+ submit: _submitBatchEditTags,
|
|
|
232
|
+ } = useBatchUpdateTagsRepositories(is_my)
|
|
|
233
|
+ onMounted(getTagListForBatchEdit)
|
|
|
234
|
+ const submitBatchEditTags = async () => {
|
|
|
235
|
+ const res = await _submitBatchEditTags().catch(_ => false)
|
|
|
236
|
+ if (res) {
|
|
|
237
|
+ getList()
|
|
|
238
|
+ }
|
|
|
239
|
+ }
|
|
|
240
|
+
|
|
|
241
|
+ const multipleSelection = ref([])
|
|
|
242
|
+ const handleSelectionChange = (val) => {
|
|
|
243
|
+ multipleSelection.value = val
|
|
|
244
|
+
|
|
|
245
|
+ batchEditTagsFormData.value.row_ids = val.map(v => v.row_id)
|
|
|
246
|
+ }
|
|
|
247
|
+
|
|
|
248
|
+
|
|
202
|
249
|
</script>
|
|
203
|
250
|
|
|
204
|
251
|
<style scoped lang="scss">
|