From 65090d8dcf4dc9d7a09eeb1d72b492273fb71b40 Mon Sep 17 00:00:00 2001
From: liangdong <1789719643@qq.com>
Date: Tue, 6 Jan 2026 19:18:38 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=8C=E5=96=84=E8=AF=84=E8=AE=BA?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components.d.ts | 1 +
index.html | 2 +-
package.json | 1 +
pnpm-lock.yaml | 3 +
src/components/nameAvatar/index.vue | 8 +-
src/modules/Comment/index.scss | 255 +++++++
src/modules/Comment/index.vue | 686 ++++++++----------
src/modules/Comment/mentionEditor.vue | 181 ++++-
.../origanization/OrganizationDetail.vue | 5 +-
src/pages/stage/personnel/index.vue | 29 +-
10 files changed, 761 insertions(+), 410 deletions(-)
create mode 100644 src/modules/Comment/index.scss
diff --git a/components.d.ts b/components.d.ts
index 6409fd4..9e46a16 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -33,6 +33,7 @@ declare module 'vue' {
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
+ ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
diff --git a/index.html b/index.html
index 66c5580..fd56d45 100644
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
-
智视界
+ 智服链
diff --git a/package.json b/package.json
index c948ce4..2fd8263 100644
--- a/package.json
+++ b/package.json
@@ -23,6 +23,7 @@
"@vue/tsconfig": "^0.8.1",
"axios": "^1.13.2",
"dayjs": "^1.11.19",
+ "lodash-es": "^4.17.22",
"sass": "^1.97.1",
"typescript": "~5.9.3",
"unicode-emoji-json": "^0.8.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1d3e39e..62af595 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -45,6 +45,9 @@ importers:
dayjs:
specifier: ^1.11.19
version: 1.11.19
+ lodash-es:
+ specifier: ^4.17.22
+ version: 4.17.22
sass:
specifier: ^1.97.1
version: 1.97.1
diff --git a/src/components/nameAvatar/index.vue b/src/components/nameAvatar/index.vue
index dbdc516..5446ca0 100644
--- a/src/components/nameAvatar/index.vue
+++ b/src/components/nameAvatar/index.vue
@@ -2,7 +2,7 @@
{{ displayText }}
@@ -22,6 +22,10 @@ const displayText = computed(() => {
return props.name ? props.name.charAt(0) : '';
});
+const fontSize = computed(() => {
+ return `${Math.max(props.size * 0.4, 12)}px`;
+});
+
const bgColor = computed(() => {
if (!props.name) return '#409EFF';
let hash = 0;
@@ -49,7 +53,7 @@ const bgColor = computed(() => {
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
.avatar-text {
color: var(--el-avatar-text-color);
- font-size: 16px;
+ font-size: var(--avatar-text-size);
letter-spacing: -0.5px;
line-height: 1;
}
diff --git a/src/modules/Comment/index.scss b/src/modules/Comment/index.scss
new file mode 100644
index 0000000..0fa968b
--- /dev/null
+++ b/src/modules/Comment/index.scss
@@ -0,0 +1,255 @@
+$color-blue: #409eff;
+$color-blue-bg: #f5f8ff;
+$color-text-main: #303133;
+$color-text-sub: #99a2aa;
+$color-border: #e4e7ed;
+$color-white: #fff;
+
+.comment-app {
+ font-family: -apple-system, sans-serif;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ position: relative;
+
+ height: calc(100vh - 170px);
+
+ // 评论的样式
+ .main-publisher{
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ z-index: 200;
+ }
+ .input-wrapper {
+ flex-shrink: 0;
+ border: 1px solid $color-border;
+ border-radius: 12px;
+ padding: 12px;
+ position: relative;
+ transition: border-color 0.2s;
+ background-color: $color-white;
+
+ &:focus-within {
+ border-color: $color-blue;
+ }
+
+ :deep(.el-textarea__inner) {
+ border: none;
+ padding: 0;
+ box-shadow: none;
+ font-size: 15px;
+ }
+
+ .input-tools {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ margin-top: 8px;
+
+ .left-icons {
+ display: flex;
+ gap: 5px;
+ .el-button {
+ color: $color-text-sub;
+ font-size: 18px;
+ padding: 4px;
+ }
+ .el-button + .el-button {
+ margin-left: 0;
+ }
+ }
+
+ .send-btn {
+ margin-left: 8px;
+ color: $color-blue;
+ }
+ }
+ }
+
+ // 2. 评论列表样式
+ .comment-list {
+ overflow-y: auto;
+ flex: 0 0 calc(100% - 120px);
+
+ .comment-group {
+ margin-bottom: 30px;
+
+ .parent-node {
+ display: flex;
+ gap: 12px;
+
+ .user-avatar {
+ background-color: $color-blue;
+ color: #fff;
+ font-weight: bold;
+ }
+
+ .node-main {
+ flex: 1;
+ .user-info {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ .nickname {
+ font-weight: bold;
+ color: $color-text-main;
+ }
+ .createTime {
+ font-size: 13px;
+ color: $color-text-sub;
+ }
+ }
+ .content {
+ margin: 8px 0;
+ font-size: 15px;
+ color: $color-text-main;
+ }
+
+ .actions {
+ display: flex;
+ margin-bottom: 12px;
+ .el-button {
+ font-size: 13px;
+ color: $color-text-sub;
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ &:hover {
+ color: $color-blue;
+ }
+ }
+ .delete-btn:hover {
+ color: #f56c6c;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // 3. 子评论卡片样式
+ .sub-container {
+ background-color: $color-blue-bg;
+ border-radius: 8px;
+ border-left: 3px solid #d9e5ff;
+ padding: 16px;
+ margin-top: 10px;
+
+ .sub-node {
+ display: flex;
+ gap: 10px;
+ margin-bottom: 15px;
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ .sub-main {
+ flex: 1;
+ .sub-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 4px;
+
+ .sub-user-info {
+ font-size: 14px;
+ .nickname {
+ font-weight: bold;
+ }
+ .reply-text {
+ margin: 0 6px;
+ color: $color-text-sub;
+ }
+ .target-name {
+ color: $color-blue;
+ font-weight: 500;
+ }
+ }
+ .createTime {
+ font-size: 12px;
+ color: $color-text-sub;
+ }
+ }
+ .content-body {
+ font-size: 14px;
+ color: $color-text-main;
+ margin-bottom: 3px;
+ }
+ }
+ }
+
+ // 展开收起样式
+ .sub-list-controls {
+ display: flex;
+ align-items: center;
+ margin-top: 12px;
+ padding-left: 46px; // 与头像对齐的偏移量
+
+ .expand-line {
+ width: 20px;
+ height: 1px;
+ background-color: #dcdfe6;
+ margin-right: 8px;
+ }
+
+ .el-button {
+ font-size: 13px;
+ color: $color-text-sub;
+ font-weight: 500;
+
+ &:hover {
+ color: $color-blue;
+ }
+
+ .el-icon {
+ margin-left: 4px;
+ transition: transform 0.3s;
+ }
+ }
+ }
+ }
+
+ :deep(.mention-highlight) {
+ background-color: rgba(64, 158, 255, 0.1);
+ color: #409eff;
+ padding: 2px 4px;
+ border-radius: 4px;
+ font-weight: 500;
+ margin: 0 2px;
+ cursor: pointer;
+ display: inline-block;
+
+ &:hover {
+ background-color: rgba(64, 158, 255, 0.2);
+ }
+ }
+}
+
+// 评论组件骨架屏
+.skeleton-comment-parent-node {
+ display: flex;
+ gap: 12px;
+ width: 100%;
+ .skeleton-avatar {
+ width: 36px;
+ height: 36px;
+ flex-shrink: 0;
+ }
+
+ .skeleton-node-main {
+ flex: 1;
+
+ .skeleton-user-info {
+ display: flex;
+ align-items: center;
+ margin-bottom: 8px;
+ }
+
+ .skeleton-actions {
+ display: flex;
+ margin-bottom: 12px;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/modules/Comment/index.vue b/src/modules/Comment/index.vue
index 3e4ae7b..4621391 100644
--- a/src/modules/Comment/index.vue
+++ b/src/modules/Comment/index.vue
@@ -1,44 +1,6 @@