|
@@ -5,22 +5,22 @@
|
|
|
<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"
|
|
|
+ @check-change="onCheckChange"
|
|
|
></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">
|
|
|
+ <div class="flex flex-1 items-center overflow-hidden 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 class="flex flex-1 overflow-hidden items-center justify-between radius-base user-name">
|
|
|
+ <span class="flex-1 checked-users"> {{ viewCheckedUser }}</span>
|
|
|
+ <el-button class="m-l-base" size="small" type="primary" @click="toggleCheckUser"> 选择收件人 </el-button>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="grid pointer m-l-auto close-icon" @click="$emit('close')">
|
|
@@ -28,8 +28,15 @@
|
|
|
</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 class="full-h radius-base scroll-y-auto message-info-content">
|
|
|
+ <el-input
|
|
|
+ v-model="messageContent"
|
|
|
+ type="textarea"
|
|
|
+ class="full-h"
|
|
|
+ resize="none"
|
|
|
+ :maxlength="1000"
|
|
|
+ show-word-limit
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="p-base flex items-center justify-end">
|
|
@@ -42,7 +49,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="MessageSend">
|
|
|
-import { reactive, ref, computed } from 'vue'
|
|
|
+import { reactive, ref, computed, watch } from 'vue'
|
|
|
import { ElInput, ElButton, ElTree, ElIcon } from 'element-plus'
|
|
|
import { Close } from '@element-plus/icons-vue'
|
|
|
import useFetch from '@/hooks/useFetch'
|
|
@@ -57,13 +64,15 @@ defineEmits(['close'])
|
|
|
const showCheckUser = ref<boolean>(false)
|
|
|
|
|
|
const messageContent = ref<string>()
|
|
|
-const markerIds = ref<number[]>()
|
|
|
+
|
|
|
+const checkedUsers = ref<MarkerItem[]>()
|
|
|
|
|
|
const filterText = ref<string>('')
|
|
|
+
|
|
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
|
|
|
|
|
-const checkedUsers = computed(() => {
|
|
|
- return 'xxx'
|
|
|
+const viewCheckedUser = computed(() => {
|
|
|
+ return checkedUsers?.value?.map((d) => `${d.loginName}-${d.name}`)?.join(';')
|
|
|
})
|
|
|
|
|
|
const toggleCheckUser = () => {
|
|
@@ -89,6 +98,10 @@ const filterTree = ((value: string, data: MarkerItem) => {
|
|
|
return data.name?.includes(value) || data.loginName?.includes(value)
|
|
|
}) as unknown as InstanceType<typeof ElTree>['filterNodeMethod']
|
|
|
|
|
|
+watch(filterText, () => {
|
|
|
+ treeRef?.value?.filter(filterText.value)
|
|
|
+})
|
|
|
+
|
|
|
const { fetch: getUserGroup, result: userGroup } = useFetch('getUserGroup')
|
|
|
|
|
|
const markerTree = computed<TreeNode[]>(() => {
|
|
@@ -103,6 +116,10 @@ const markerTree = computed<TreeNode[]>(() => {
|
|
|
] as TreeNode[]
|
|
|
})
|
|
|
|
|
|
+const onCheckChange = () => {
|
|
|
+ checkedUsers.value = (treeRef?.value?.getCheckedNodes(true) as MarkerItem[]) || []
|
|
|
+}
|
|
|
+
|
|
|
/** 发送当前试卷 */
|
|
|
const sendCurrentPaper = () => {
|
|
|
console.log('发送当前试卷')
|
|
@@ -117,9 +134,13 @@ getUserGroup()
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.message-list-modal {
|
|
|
- width: 880px;
|
|
|
background-color: transparent;
|
|
|
.tree-box {
|
|
|
+ width: 280px;
|
|
|
+ height: 446px;
|
|
|
+ ::v-deep(.el-tree) {
|
|
|
+ min-height: 100%;
|
|
|
+ }
|
|
|
}
|
|
|
.message-list {
|
|
|
width: 280px;
|
|
@@ -141,6 +162,10 @@ getUserGroup()
|
|
|
min-width: 320px;
|
|
|
padding: 10px 12px;
|
|
|
border: $OnePixelLine;
|
|
|
+ .checked-users {
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.close-icon {
|
|
@@ -155,8 +180,11 @@ getUserGroup()
|
|
|
}
|
|
|
}
|
|
|
.message-info-content {
|
|
|
- border: $OnePixelLine;
|
|
|
+ // border: $OnePixelLine;
|
|
|
font-size: $SmallFont;
|
|
|
+ ::v-deep(textarea.el-textarea__inner) {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|