Browse Source

修复信件标签不显示已选中标签

master
21819 2 years ago
parent
commit
8f5538bf69
  1. 2
      src/api/org/label.ts
  2. 2
      src/views/work/Query.vue
  3. 20
      src/views/work/components/MailLabel.vue

2
src/api/org/label.ts

@ -16,5 +16,5 @@ export function labelInsert(params?: any) {
}
export function labelDetail(params?: any){
return request.get({ url: '/system/label/detail', params })
return request.post({ url: '/system/label/detail', params })
}

2
src/views/work/Query.vue

@ -169,7 +169,7 @@
</main>
</div>
<MailDialog v-model:show="showModel" :mail-id="activeMailId" :disabled="true" @update="getList" />
<MailLabel v-model:if="showLabel" :mail-id="activeMailId" @close="showLabel = false" @update="getList" />
<MailLabel v-if="showLabel" v-model="showLabel" :mail-id="activeMailId" @close="showLabel = false" @update="getList" />
<MailCheck v-model:show="showCheck" @close="showCheck = false" />
</template>
<script lang="ts" setup>

20
src/views/work/components/MailLabel.vue

@ -34,8 +34,7 @@
</el-dialog>
</template>
<script lang="ts" setup>
import { ref, defineProps } from 'vue'
import { watch, onMounted } from 'vue'
import { ref, defineProps, watch, onMounted, defineEmits } from 'vue'
import { labelLists } from '@/api/org/label'
import { labelInsert, labelDetail, labelAdd } from '@/api/org/label'
import { ElMessage } from 'element-plus'
@ -47,7 +46,7 @@ const props = defineProps({
},
mailId: {
type: String,
default: '2233'
default: ''
}
})
const visible = ref(props.show)
@ -57,21 +56,20 @@ watch(
visible.value = val;
}
);
onMounted(() => {
handleDetail()
})
const handleDetail = () => {
labelDetail(props.mailId).then((res: any) => {
const mailId = JSON.stringify({ mailId: props.mailId })
labelDetail(JSON.parse(mailId)).then((res: any) => {
console.log(res)
form.mainLabels.value = res.data.map((item: any) => {
return { labelName: item.labelName }
})
form.value.mainLabels = res
}).catch((err: any) => {
console.log(err)
})
}
// onMounted(() => {
// handleDetail()
// })
interface MailLabel {
id: number,
labelName: string

Loading…
Cancel
Save