|
@@ -0,0 +1,149 @@
|
|
|
+<template>
|
|
|
+ <div class="flex radius-base overflow-hidden message-list-modal">
|
|
|
+ <div v-show="showCheckUser" class="flex direction-column p-base fill-lighter tree-box">
|
|
|
+ <el-input v-model="filterText" placeholder="输入评卷员账号或名称筛选" clearable></el-input>
|
|
|
+ <div class="flex-1 m-t-base scroll-y-auto">
|
|
|
+ <el-tree
|
|
|
+ ref="treeRef"
|
|
|
+ v-model="markerIds"
|
|
|
+ show-checkbox
|
|
|
+ :filter-node-method="filterTree"
|
|
|
+ :data="markerTree"
|
|
|
+ :props="treeProp"
|
|
|
+ ></el-tree>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="message-info-container">
|
|
|
+ <div class="flex direction-column message-info">
|
|
|
+ <div class="flex items-center p-base message-info-header">
|
|
|
+ <div class="flex items-center send-user">
|
|
|
+ <span class="m-r-mini">收件人</span>
|
|
|
+ <span class="flex items-center justify-between radius-base user-name">
|
|
|
+ <span> {{ checkedUsers }}</span>
|
|
|
+ <el-button size="small" type="primary" @click="toggleCheckUser"> 选择收件人 </el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="grid pointer m-l-auto close-icon" @click="$emit('close')">
|
|
|
+ <el-icon><close /></el-icon>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex-1 p-base overflow-hidden">
|
|
|
+ <div class="full-h radius-base p-extra-base scroll-y-auto message-info-content">
|
|
|
+ <el-input v-model="messageContent" type="textarea"></el-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="p-base flex items-center justify-end">
|
|
|
+ <el-button size="small" plain @click="sendCurrentPaper">发送当前试卷</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="onSendMessage">发送</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts" name="MessageSend">
|
|
|
+import { reactive, ref, computed } from 'vue'
|
|
|
+import { ElInput, ElButton, ElTree, ElIcon } from 'element-plus'
|
|
|
+import { Close } from '@element-plus/icons-vue'
|
|
|
+import useFetch from '@/hooks/useFetch'
|
|
|
+
|
|
|
+import type { ExtractApiResponse } from 'api-type'
|
|
|
+
|
|
|
+type MarkerItem = ExtractArrayValue<ExtractArrayValue<ExtractApiResponse<'getMarkerTree'>>['markers']>
|
|
|
+
|
|
|
+defineEmits(['close'])
|
|
|
+
|
|
|
+const showCheckUser = ref<boolean>(false)
|
|
|
+
|
|
|
+const messageContent = ref<string>()
|
|
|
+const markerIds = ref<number[]>()
|
|
|
+
|
|
|
+const filterText = ref<string>('')
|
|
|
+const treeRef = ref<InstanceType<typeof ElTree>>()
|
|
|
+
|
|
|
+const checkedUsers = computed(() => {
|
|
|
+ return 'xxx'
|
|
|
+})
|
|
|
+
|
|
|
+const toggleCheckUser = () => {
|
|
|
+ showCheckUser.value = !showCheckUser.value
|
|
|
+}
|
|
|
+
|
|
|
+function isMarker(x: any): x is MarkerItem {
|
|
|
+ return !!x.loginName
|
|
|
+}
|
|
|
+
|
|
|
+const treeProp = {
|
|
|
+ children: 'markers',
|
|
|
+ label(treeNode: ExtractArrayValue<ExtractApiResponse<'getMarkerTree'>>) {
|
|
|
+ if (isMarker(treeNode)) {
|
|
|
+ return treeNode.name || treeNode.loginName
|
|
|
+ }
|
|
|
+ return `第${treeNode.markingGroupNumber}组`
|
|
|
+ },
|
|
|
+} as unknown as InstanceType<typeof ElTree>['props']
|
|
|
+
|
|
|
+const filterTree = ((value: string, data: MarkerItem) => {
|
|
|
+ if (!value) return true
|
|
|
+ return data.name?.includes(value) || data.loginName?.includes(value)
|
|
|
+}) as unknown as InstanceType<typeof ElTree>['filterNodeMethod']
|
|
|
+
|
|
|
+const { fetch: getMarkerTree, result: markerTree } = useFetch('getMarkerTree')
|
|
|
+
|
|
|
+/** 发送当前试卷 */
|
|
|
+const sendCurrentPaper = () => {
|
|
|
+ console.log('发送当前试卷')
|
|
|
+}
|
|
|
+/** 发送消息 */
|
|
|
+const onSendMessage = () => {
|
|
|
+ console.log('发消息')
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+.message-list-modal {
|
|
|
+ width: 880px;
|
|
|
+ background-color: transparent;
|
|
|
+ .tree-box {
|
|
|
+ }
|
|
|
+ .message-list {
|
|
|
+ width: 280px;
|
|
|
+ height: 446px;
|
|
|
+ background: #fafafa;
|
|
|
+ box-shadow: 0px 6px 6px 0px rgba(0, 0, 0, 0.1);
|
|
|
+ }
|
|
|
+ .message-info-container {
|
|
|
+ width: 600px;
|
|
|
+ .message-info {
|
|
|
+ height: 446px;
|
|
|
+ background-color: $color--white;
|
|
|
+ .message-info-header {
|
|
|
+ border-bottom: $OnePixelLine;
|
|
|
+ .send-user {
|
|
|
+ font-size: $SmallFont;
|
|
|
+ color: $RegularFontColor;
|
|
|
+ .user-name {
|
|
|
+ min-width: 320px;
|
|
|
+ padding: 10px 12px;
|
|
|
+ border: $OnePixelLine;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .close-icon {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ place-items: center;
|
|
|
+ font-size: 18px;
|
|
|
+ color: $RegularFontColor;
|
|
|
+ &:hover {
|
|
|
+ color: $NormalColor;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .message-info-content {
|
|
|
+ border: $OnePixelLine;
|
|
|
+ font-size: $SmallFont;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|