@@ -132,44 +132,26 @@ const handleSelectionChange = (val: any[]) => {
132132}
133133
134134function batchDelete() {
135- MsgConfirm (t (' views.document.tag.deleteConfirm' ), t (' views.document.tag.deleteTip' ), {
136- confirmButtonText: t (' common.delete' ),
137- confirmButtonClass: ' danger' ,
138- })
135+ const tagsToDelete = multipleSelection .value .reduce ((acc , item ) => {
136+ // 找出当前选中项的key对应的所有value id
137+ const sameKeyItems = tableData .value .filter ((data ) => data .key === item .key )
138+ const sameKeyIds = sameKeyItems .map ((data ) => data .id )
139+ return [... acc , ... sameKeyIds ]
140+ }, [] as string [])
141+
142+ loadSharedApi ({ type: ' document' , systemType: apiType .value })
143+ .delMulDocumentTag (id , document_id .value , tagsToDelete , loading )
139144 .then (() => {
140- const tagsToDelete = multipleSelection .value .reduce ((acc , item ) => {
141- // 找出当前选中项的key对应的所有value id
142- const sameKeyItems = tableData .value .filter ((data ) => data .key === item .key )
143- const sameKeyIds = sameKeyItems .map ((data ) => data .id )
144- return [... acc , ... sameKeyIds ]
145- }, [] as string [])
146-
147- loadSharedApi ({ type: ' document' , systemType: apiType .value })
148- .delMulDocumentTag (id , document_id .value , tagsToDelete , loading )
149- .then (() => {
150- getList ()
151- })
145+ getList ()
152146 })
153- .catch (() => {})
154147}
155148
156149function delTagValue(row : any ) {
157- MsgConfirm (
158- t (' views.document.tag.deleteConfirm' ) + row .key + ' -' + row .value ,
159- t (' views.document.tag.deleteTip' ),
160- {
161- confirmButtonText: t (' common.delete' ),
162- confirmButtonClass: ' danger' ,
163- },
164- )
150+ loadSharedApi ({ type: ' document' , systemType: apiType .value })
151+ .delMulDocumentTag (id , document_id .value , [row .id ], loading )
165152 .then (() => {
166- loadSharedApi ({ type: ' document' , systemType: apiType .value })
167- .delMulDocumentTag (id , document_id .value , [row .id ], loading )
168- .then (() => {
169- getList ()
170- })
153+ getList ()
171154 })
172- .catch (() => {})
173155}
174156
175157function getList() {
0 commit comments