|  | @@ -6,7 +6,6 @@
 | 
	
		
			
				|  |  |  import { ElMessage } from 'element-plus';
 | 
	
		
			
				|  |  |  import { useResponse } from '/@/utils/useResponse';
 | 
	
		
			
				|  |  |  import * as api from '../api';
 | 
	
		
			
				|  |  | -import { getStaffsOptions } from '../api';
 | 
	
		
			
				|  |  |  import { Close, Finished } from '@element-plus/icons-vue';
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -28,7 +27,7 @@ const currentRow: any = ref(null);
 | 
	
		
			
				|  |  |  onBeforeMount(() => {
 | 
	
		
			
				|  |  |    fetchStaffsOptions();
 | 
	
		
			
				|  |  |    fetchExistingStaff();
 | 
	
		
			
				|  |  | -})
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  function handleClose(done: any) {
 | 
	
		
			
				|  |  |    staffSelect.value = '';
 | 
	
	
		
			
				|  | @@ -70,29 +69,27 @@ async function fetchExistingStaff() {
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  async function addStaffs() {
 | 
	
		
			
				|  |  | -  staffLoading.value = true;
 | 
	
		
			
				|  |  |    const body = {
 | 
	
		
			
				|  |  | -    id: currentRow.id,
 | 
	
		
			
				|  |  | -    user_ids: staffTags.map((tag: any) => tag.id)
 | 
	
		
			
				|  |  | +    id: rowData?.id,
 | 
	
		
			
				|  |  | +    user_ids: staffTags.value.map((tag: any) => tag.id)
 | 
	
		
			
				|  |  |    };
 | 
	
		
			
				|  |  |    try {
 | 
	
		
			
				|  |  | -    // const resp = await api.postStaffs(body);
 | 
	
		
			
				|  |  | -    // if (resp.code === 2000) {
 | 
	
		
			
				|  |  | -    //   ElMessage.error('编辑成功!');
 | 
	
		
			
				|  |  | -    //   await fetchExistingStaff(currentRow);
 | 
	
		
			
				|  |  | -    // }
 | 
	
		
			
				|  |  | +    const resp = await useResponse(api.postStaffs, body, staffLoading)
 | 
	
		
			
				|  |  | +    if (resp.code === 2000) {
 | 
	
		
			
				|  |  | +      ElMessage.success('编辑成功!');
 | 
	
		
			
				|  |  | +      fetchExistingStaff();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |    } catch (error) {
 | 
	
		
			
				|  |  |      ElMessage.error('编辑失败!');
 | 
	
		
			
				|  |  |    } finally {
 | 
	
		
			
				|  |  |      staffSelect.value = '';
 | 
	
		
			
				|  |  | -    staffLoading.value = false;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  function cancelDialog() {
 | 
	
		
			
				|  |  |    staffSelect.value = '';
 | 
	
		
			
				|  |  |    staffTags.value = [];
 | 
	
		
			
				|  |  | -  noticeDialog.value.visible = false
 | 
	
		
			
				|  |  | +  noticeDialog.value.visible = false;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -130,21 +127,26 @@ function cancelDialog() {
 | 
	
		
			
				|  |  |            <span class="ml-1" style="color: #909399">仅可添加已绑定邮箱的用户</span>
 | 
	
		
			
				|  |  |          </el-col>
 | 
	
		
			
				|  |  |        </el-row>
 | 
	
		
			
				|  |  | -      <div class="flex flex-wrap gap-1.5">
 | 
	
		
			
				|  |  | +      <div class="flex flex-wrap gap-1.5 min-h-6">
 | 
	
		
			
				|  |  |          <el-tag
 | 
	
		
			
				|  |  |              v-for="tag in staffTags"
 | 
	
		
			
				|  |  |              :key="tag.id"
 | 
	
		
			
				|  |  |              closable
 | 
	
		
			
				|  |  | +            round
 | 
	
		
			
				|  |  | +            effect="plain"
 | 
	
		
			
				|  |  |              @close="removeTag(tag)">
 | 
	
		
			
				|  |  |            {{ tag.username }}
 | 
	
		
			
				|  |  |          </el-tag>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  | -      
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        <el-divider style="margin: 12px 0 20px 0"></el-divider>
 | 
	
		
			
				|  |  | -      <span slot="footer" class="dialog-footer">
 | 
	
		
			
				|  |  | +      <template #footer>
 | 
	
		
			
				|  |  |          <el-button :icon="Close" @click="cancelDialog">取 消</el-button>
 | 
	
		
			
				|  |  |          <el-button :icon="Finished" :loading="staffLoading" type="primary" @click="addStaffs">确 定</el-button>
 | 
	
		
			
				|  |  | -      </span>
 | 
	
		
			
				|  |  | +      </template>
 | 
	
		
			
				|  |  | +      <!--<span slot="footer" class="dialog-footer">-->
 | 
	
		
			
				|  |  | +      <!--  -->
 | 
	
		
			
				|  |  | +      <!--</span>-->
 | 
	
		
			
				|  |  |      </el-dialog>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 |