npmapps 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/Wscats.vue-1.0.26.vsix +0 -0
- package/app/febean.vue-format-0.1.8.vsix +0 -0
- package/app/wujie-vue3-child/.claude/settings.local.json +8 -0
- package/app/wujie-vue3-child/.vscode/extensions.json +3 -0
- package/app/wujie-vue3-child/PROJECT_MEMORY.md +427 -0
- package/app/wujie-vue3-child/README.md +5 -0
- package/app/wujie-vue3-child/index.html +13 -0
- package/app/wujie-vue3-child/package-lock.json +5744 -0
- package/app/wujie-vue3-child/package.json +28 -0
- package/app/wujie-vue3-child/public/vite.svg +1 -0
- package/app/wujie-vue3-child/src/App.vue +130 -0
- package/app/wujie-vue3-child/src/assets/vue.svg +1 -0
- package/app/wujie-vue3-child/src/components/HelloWorld.vue +43 -0
- package/app/wujie-vue3-child/src/components/tags-view.vue +193 -0
- package/app/wujie-vue3-child/src/components/tags-view1.vue +131 -0
- package/app/wujie-vue3-child/src/hooks/useClickOutside.js +11 -0
- package/app/wujie-vue3-child/src/hooks/useTableDragSort.js +28 -0
- package/app/wujie-vue3-child/src/main.js +15 -0
- package/app/wujie-vue3-child/src/router/index.js +104 -0
- package/app/wujie-vue3-child/src/store/tagsViewStroe.js +34 -0
- package/app/wujie-vue3-child/src/style.css +4 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/README.md +836 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/REFLEX_EXAMPLES.md +728 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.jsx +687 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.module.scss +560 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.jsx +570 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.module.scss +330 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.jsx +378 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.module.scss +228 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.jsx +399 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.module.scss +252 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.jsx +585 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.module.scss +331 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.jsx +392 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.module.scss +39 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/README.md +248 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/SelectorTrigger.jsx +194 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/index.jsx +1459 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/mockData.js +301 -0
- package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/dialogueSegment/index.jsx +28 -4
- package/app/wujie-vue3-child/src/views/aiCoach/index.jsx +32 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.jsx +121 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.module.scss +76 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/DonutChart/index.jsx +104 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.jsx +75 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.module.scss +12 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.jsx +62 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.module.scss +43 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.jsx +29 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.module.scss +5 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.jsx +58 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.module.scss +85 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.jsx +92 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.module.scss +56 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.jsx +40 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.module.scss +53 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsDonut.jsx +106 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsRankBar.jsx +132 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.jsx +176 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.module.scss +96 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.jsx +162 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.module.scss +16 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.jsx +29 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.module.scss +25 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.jsx +106 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.module.scss +164 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.jsx +182 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.module.scss +203 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.jsx +145 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.module.scss +126 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.jsx +67 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.module.scss +105 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.jsx +81 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.module.scss +47 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.jsx +64 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.module.scss +85 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.jsx +39 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.module.scss +44 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.jsx +83 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.module.scss +101 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.jsx +50 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.module.scss +25 -0
- package/app/wujie-vue3-child/src/views/child-to-parent.vue +117 -0
- package/app/wujie-vue3-child/src/views/home.vue +53 -0
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/btnSelect.vue +169 -0
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/index.vue +69 -0
- package/app/wujie-vue3-child/src/views/jsx/com.vue +44 -0
- package/app/wujie-vue3-child/src/views/jsx/dialog.jsx +66 -0
- package/app/wujie-vue3-child/src/views/jsx/index.vue +72 -0
- package/app/wujie-vue3-child/src/views/jsx/props.vue +33 -0
- package/app/wujie-vue3-child/src/views/parent-to-child.vue +225 -0
- package/app/wujie-vue3-child/src/views/phone-code.vue +318 -0
- package/app/wujie-vue3-child/src/views/router-jump.vue +123 -0
- package/app/wujie-vue3-child/src/views/test.vue +192 -0
- package/app/wujie-vue3-child/vite.config.js +15 -0
- package/package.json +1 -1
- package/app/aiCoach/index.jsx +0 -20
- package/npmapps-1.0.20.tgz +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/collapseExpand/index.jsx +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/collapseExpand/index.module.scss +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/dialogueSegment/index.module.scss +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/index.jsx +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/index.module.scss +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/inputColumn/index.jsx +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/inputColumn/index.module.scss +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wujie-vue3-child",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"dayjs": "^1.11.13",
|
|
13
|
+
"echarts": "^6.0.0",
|
|
14
|
+
"element-plus": "^2.9.1",
|
|
15
|
+
"lodash": "^4.17.21",
|
|
16
|
+
"pinia": "^2.3.0",
|
|
17
|
+
"pinia-plugin-persistedstate": "^4.2.0",
|
|
18
|
+
"sass": "^1.83.0",
|
|
19
|
+
"vue": "^3.5.13",
|
|
20
|
+
"vue-router": "^4.5.0",
|
|
21
|
+
"vuedraggable": "^4.1.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
25
|
+
"@vitejs/plugin-vue-jsx": "^4.2.0",
|
|
26
|
+
"vite": "^6.0.5"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from 'vue'
|
|
3
|
+
import { useRouter, useRoute } from 'vue-router'
|
|
4
|
+
import TagsView from './components/tags-view.vue'
|
|
5
|
+
const router = useRouter()
|
|
6
|
+
const route = useRoute()
|
|
7
|
+
|
|
8
|
+
// 从路由配置生成菜单项
|
|
9
|
+
const menuItems = computed(() =>
|
|
10
|
+
router.options.routes.map((route, index) => ({
|
|
11
|
+
index: String(index + 1),
|
|
12
|
+
path: route.path,
|
|
13
|
+
label: route.meta?.title || route.name,
|
|
14
|
+
children: route.children?.map((child, childIndex) => ({
|
|
15
|
+
index: `${index + 1}-${childIndex + 1}`,
|
|
16
|
+
path: child.path,
|
|
17
|
+
label: child.meta?.title || child.name
|
|
18
|
+
}))
|
|
19
|
+
}))
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
// 根据当前路由路径获取激活的菜单项
|
|
23
|
+
const activeIndex = computed(() => {
|
|
24
|
+
const currentPath = route.path
|
|
25
|
+
for (const item of menuItems.value) {
|
|
26
|
+
if (item.path === currentPath) return item.index
|
|
27
|
+
const child = item.children?.find(child => child.path === currentPath)
|
|
28
|
+
if (child) return child.index
|
|
29
|
+
}
|
|
30
|
+
return '1'
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const handleSelect = (key) => {
|
|
34
|
+
// 先查找主菜单项
|
|
35
|
+
const mainItem = menuItems.value.find(item => item.index === key)
|
|
36
|
+
if (mainItem && !mainItem.children) {
|
|
37
|
+
router.push(mainItem.path)
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 查找子菜单项
|
|
42
|
+
for (const item of menuItems.value) {
|
|
43
|
+
const childItem = item.children?.find(child => child.index === key)
|
|
44
|
+
if (childItem) {
|
|
45
|
+
router.push(childItem.path)
|
|
46
|
+
return
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
window.$wujie?.bus.$on('router-jump', (data) => {
|
|
52
|
+
console.log(data);
|
|
53
|
+
if(data.app === 'vue3-child'){
|
|
54
|
+
router.push({
|
|
55
|
+
path: data.path,
|
|
56
|
+
query: data.query
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
window.$wujie?.bus.$emit('loaded', 'vue3-child')
|
|
61
|
+
console.log('app.vue');
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<div class="app-container">
|
|
68
|
+
<el-menu
|
|
69
|
+
:default-active="activeIndex"
|
|
70
|
+
class="el-menu-demo"
|
|
71
|
+
mode="horizontal"
|
|
72
|
+
@select="handleSelect"
|
|
73
|
+
>
|
|
74
|
+
<template v-for="item in menuItems" :key="item.index">
|
|
75
|
+
<!-- 有子菜单的情况 -->
|
|
76
|
+
<el-sub-menu v-if="item.children?.length" :index="item.index">
|
|
77
|
+
<template #title>{{ item.label }}</template>
|
|
78
|
+
<el-menu-item
|
|
79
|
+
v-for="child in item.children"
|
|
80
|
+
:key="child.index"
|
|
81
|
+
:index="child.index"
|
|
82
|
+
>
|
|
83
|
+
{{ child.label }}
|
|
84
|
+
</el-menu-item>
|
|
85
|
+
</el-sub-menu>
|
|
86
|
+
<!-- 没有子菜单的情况 -->
|
|
87
|
+
<el-menu-item v-else :index="item.index">
|
|
88
|
+
{{ item.label }}
|
|
89
|
+
</el-menu-item>
|
|
90
|
+
</template>
|
|
91
|
+
</el-menu>
|
|
92
|
+
|
|
93
|
+
<tags-view></tags-view>
|
|
94
|
+
|
|
95
|
+
<div class="content-container">
|
|
96
|
+
<router-view></router-view>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</template>
|
|
100
|
+
|
|
101
|
+
<style scoped>
|
|
102
|
+
.app-container {
|
|
103
|
+
min-height: 100vh;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.el-menu-demo {
|
|
107
|
+
padding-left: 20px;
|
|
108
|
+
height: 40px; /* 减小菜单高度 */
|
|
109
|
+
line-height: 40px; /* 确保文字垂直居中 */
|
|
110
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* 添加阴影效果 */
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:deep(.el-menu-item) {
|
|
114
|
+
height: 40px; /* 减小菜单项高度 */
|
|
115
|
+
line-height: 40px; /* 确保文字垂直居中 */
|
|
116
|
+
padding: 0 20px; /* 调整内边距 */
|
|
117
|
+
font-size: 14px; /* 调整字体大小 */
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.content-container {
|
|
121
|
+
padding: 20px; /* 给内容区域添加内边距 */
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* 自定义菜单项悬停和激活状态的样式 */
|
|
125
|
+
:deep(.el-menu-item:hover),
|
|
126
|
+
:deep(.el-menu-item.is-active) {
|
|
127
|
+
background-color: #f5f7fa; /* 更柔和的背景色 */
|
|
128
|
+
color: #409eff; /* Element Plus 的主题蓝色 */
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
defineProps({
|
|
5
|
+
msg: String,
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
const count = ref(0)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<h1>{{ msg }}</h1>
|
|
13
|
+
|
|
14
|
+
<div class="card">
|
|
15
|
+
<button type="button" @click="count++">count is {{ count }}</button>
|
|
16
|
+
<p>
|
|
17
|
+
Edit
|
|
18
|
+
<code>components/HelloWorld.vue</code> to test HMR
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<p>
|
|
23
|
+
Check out
|
|
24
|
+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
|
|
25
|
+
>create-vue</a
|
|
26
|
+
>, the official Vue + Vite starter
|
|
27
|
+
</p>
|
|
28
|
+
<p>
|
|
29
|
+
Learn more about IDE Support for Vue in the
|
|
30
|
+
<a
|
|
31
|
+
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
|
|
32
|
+
target="_blank"
|
|
33
|
+
>Vue Docs Scaling up Guide</a
|
|
34
|
+
>.
|
|
35
|
+
</p>
|
|
36
|
+
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<style scoped>
|
|
40
|
+
.read-the-docs {
|
|
41
|
+
color: #888;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tags-container">
|
|
3
|
+
<draggable
|
|
4
|
+
:list="tagsViewList.list"
|
|
5
|
+
ghost-class="ghost"
|
|
6
|
+
chosen-class="chosenClass"
|
|
7
|
+
animation="300"
|
|
8
|
+
@start="onStart"
|
|
9
|
+
@end="onEnd"
|
|
10
|
+
>
|
|
11
|
+
<template #item="{ element }">
|
|
12
|
+
<div
|
|
13
|
+
:key="element.path"
|
|
14
|
+
class="tag"
|
|
15
|
+
@contextmenu.prevent="openContextMenu($event, element)"
|
|
16
|
+
@drag="dragging($event,element)"
|
|
17
|
+
>
|
|
18
|
+
{{ element.meta.title }}
|
|
19
|
+
<span class="close-btn" @click="closeTag(element)">✖</span>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
</draggable>
|
|
23
|
+
<div
|
|
24
|
+
v-if="contextMenuVisible"
|
|
25
|
+
class="context-menu"
|
|
26
|
+
:style="{ top: contextMenuPosition.y + 'px', left: contextMenuPosition.x + 'px' }"
|
|
27
|
+
>
|
|
28
|
+
<ul>
|
|
29
|
+
<li @click="closeTag(contextMenuItem)">关闭标签</li>
|
|
30
|
+
<li @click="closeOtherTag(contextMenuItem)">关闭其他标签</li>
|
|
31
|
+
<li @click="closeAllTag()">关闭所有标签</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="dragging-info" v-if="isDragging" :style="{top: clientY + 'px', left: clientX + 'px'}" >
|
|
35
|
+
<p>screenX: {{ clientX }}</p>
|
|
36
|
+
<p>screenY: {{ clientY }}</p>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script setup>
|
|
42
|
+
import { useTagsViewStore } from "../store/tagsViewStroe";
|
|
43
|
+
import { useRouter } from "vue-router";
|
|
44
|
+
import { ref, watch, reactive ,onMounted} from "vue";
|
|
45
|
+
import draggable from "vuedraggable";
|
|
46
|
+
import { throttle } from 'lodash';
|
|
47
|
+
const tagsViewStore = useTagsViewStore();
|
|
48
|
+
const router = useRouter();
|
|
49
|
+
|
|
50
|
+
const isDragging = ref(false);
|
|
51
|
+
|
|
52
|
+
const tagsViewList = reactive({
|
|
53
|
+
list: tagsViewStore.tagsViewList,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
watch(tagsViewList, (newVal) => {
|
|
57
|
+
console.log(newVal);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// 监听路由变化
|
|
61
|
+
router.afterEach((to, from) => {
|
|
62
|
+
tagsViewStore.addTagsView(to);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const closeTag = (tag) => {
|
|
66
|
+
tagsViewStore.removeTagsView(tag);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const closeOtherTag = (tag) => {
|
|
70
|
+
tagsViewStore.removeOtherTagsView(tag);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const closeAllTag = () => {
|
|
74
|
+
tagsViewStore.clearTagsView();
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const contextMenuVisible = ref(false);
|
|
78
|
+
const contextMenuPosition = ref({ x: 0, y: 0 });
|
|
79
|
+
const contextMenuItem = ref(null);
|
|
80
|
+
|
|
81
|
+
const openContextMenu = (event, item) => {
|
|
82
|
+
contextMenuPosition.value = { x: event.clientX, y: event.clientY };
|
|
83
|
+
contextMenuItem.value = item;
|
|
84
|
+
contextMenuVisible.value = true;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// 添加点击页面其他位置隐藏菜单的逻辑
|
|
88
|
+
window.addEventListener("click", () => {
|
|
89
|
+
contextMenuVisible.value = false;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const onStart = () => {
|
|
93
|
+
console.log("onStart");
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
onMounted(() => {
|
|
97
|
+
// window.addEventListener("mousemove", dragging);
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const clientX = ref(0);
|
|
101
|
+
const clientY = ref(0);
|
|
102
|
+
|
|
103
|
+
const dragging = throttle((e) => {
|
|
104
|
+
|
|
105
|
+
// 鼠标往下移动100px再显示
|
|
106
|
+
if(e.clientY > 120){
|
|
107
|
+
isDragging.value = true;
|
|
108
|
+
console.log("dragging", e);
|
|
109
|
+
clientX.value = e.clientX;
|
|
110
|
+
clientY.value = e.clientY;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
}, 1); // 更新频率设置为每100毫秒触发一次
|
|
115
|
+
|
|
116
|
+
const onEnd = () => {
|
|
117
|
+
console.log("onEnd");
|
|
118
|
+
isDragging.value = false;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<style scoped lang="scss">
|
|
124
|
+
.dragging-info{
|
|
125
|
+
position: absolute;
|
|
126
|
+
z-index: 1000;
|
|
127
|
+
background-color: #fff;
|
|
128
|
+
padding: 10px;
|
|
129
|
+
border: 1px solid #000;
|
|
130
|
+
}
|
|
131
|
+
.tags-container {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-wrap: wrap;
|
|
134
|
+
padding: 10px;
|
|
135
|
+
background-color: #f5f5f5;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.tag {
|
|
139
|
+
margin: 5px;
|
|
140
|
+
padding: 5px 10px;
|
|
141
|
+
background-color: #e0e0e0;
|
|
142
|
+
border-radius: 5px;
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
transition: background-color 0.3s;
|
|
145
|
+
user-select: none;
|
|
146
|
+
display: inline-block;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.tag:hover {
|
|
150
|
+
background-color: #d0d0d0;
|
|
151
|
+
.close-btn {
|
|
152
|
+
display: inline-block;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.close-btn {
|
|
157
|
+
margin-left: 5px;
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
display: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.context-menu {
|
|
163
|
+
position: absolute;
|
|
164
|
+
top: 0;
|
|
165
|
+
left: 0;
|
|
166
|
+
background-color: #fff;
|
|
167
|
+
z-index: 1000;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.context-menu ul {
|
|
171
|
+
list-style: none;
|
|
172
|
+
padding: 10px;
|
|
173
|
+
margin: 0;
|
|
174
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.context-menu li {
|
|
178
|
+
padding: 8px 12px;
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
&:hover {
|
|
181
|
+
background-color: #f0f0f0;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.ghost {
|
|
186
|
+
opacity: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.chosenClass {
|
|
190
|
+
background-color: #3FB37F !important;
|
|
191
|
+
border: 1px solid #3FB37F !important;
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tags-container">
|
|
3
|
+
<span v-for="item in tagsViewStore.getTagsViewList()" :key="item.path" draggable="true"
|
|
4
|
+
@dragstart="onDragStart($event,item)"
|
|
5
|
+
@dragend="onDragEnd($event,item)"
|
|
6
|
+
|
|
7
|
+
@drag="onDrop($event,item)"
|
|
8
|
+
class="tag" @contextmenu.prevent="openContextMenu($event, item)">
|
|
9
|
+
{{ item.meta.title }}
|
|
10
|
+
<span class="close-btn" @click="closeTag(item)">✖</span>
|
|
11
|
+
</span>
|
|
12
|
+
<div v-if="contextMenuVisible" class="context-menu" :style="{top: contextMenuPosition.y + 'px', left: contextMenuPosition.x + 'px'}">
|
|
13
|
+
<ul>
|
|
14
|
+
<li @click="closeTag(contextMenuItem)">关闭标签</li>
|
|
15
|
+
<li @click="closeOtherTag(contextMenuItem)">关闭其他标签</li>
|
|
16
|
+
<li @click="closeAllTag()">关闭所有标签</li>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
import { useTagsViewStore } from '../store/tagsViewStroe'
|
|
25
|
+
import { useRouter } from 'vue-router'
|
|
26
|
+
import { ref } from 'vue'
|
|
27
|
+
|
|
28
|
+
const tagsViewStore = useTagsViewStore()
|
|
29
|
+
const router = useRouter()
|
|
30
|
+
|
|
31
|
+
// 监听路由变化
|
|
32
|
+
router.afterEach((to, from) => {
|
|
33
|
+
tagsViewStore.addTagsView(to)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const closeTag = (tag) => {
|
|
37
|
+
tagsViewStore.removeTagsView(tag)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const closeOtherTag = (tag) => {
|
|
41
|
+
tagsViewStore.removeOtherTagsView(tag)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const closeAllTag = () => {
|
|
45
|
+
tagsViewStore.clearTagsView()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const contextMenuVisible = ref(false)
|
|
49
|
+
const contextMenuPosition = ref({ x: 0, y: 0 })
|
|
50
|
+
const contextMenuItem = ref(null)
|
|
51
|
+
|
|
52
|
+
const openContextMenu = (event, item) => {
|
|
53
|
+
contextMenuPosition.value = { x: event.clientX, y: event.clientY }
|
|
54
|
+
contextMenuItem.value = item
|
|
55
|
+
contextMenuVisible.value = true
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 添加点击页面其他位置隐藏菜单的逻辑
|
|
59
|
+
window.addEventListener('click', () => {
|
|
60
|
+
contextMenuVisible.value = false
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const onDragStart = (event,item) => {
|
|
64
|
+
console.log('onDragStart', event,item)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const onDragEnd = (event,item) => {
|
|
68
|
+
console.log('onDragEnd', event,item)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const onDrop = (event,item) => {
|
|
72
|
+
console.log('onDrop', event,item)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style scoped lang="scss">
|
|
78
|
+
.tags-container {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-wrap: wrap;
|
|
81
|
+
padding: 10px;
|
|
82
|
+
background-color: #f5f5f5;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tag {
|
|
86
|
+
margin: 5px;
|
|
87
|
+
padding: 5px 10px;
|
|
88
|
+
background-color: #e0e0e0;
|
|
89
|
+
border-radius: 5px;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
transition: background-color 0.3s;
|
|
92
|
+
user-select: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.tag:hover {
|
|
96
|
+
background-color: #d0d0d0;
|
|
97
|
+
.close-btn {
|
|
98
|
+
display: inline-block;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.close-btn {
|
|
103
|
+
margin-left: 5px;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.context-menu {
|
|
109
|
+
position: absolute;
|
|
110
|
+
top: 0;
|
|
111
|
+
left: 0;
|
|
112
|
+
background-color: #fff;
|
|
113
|
+
z-index: 1000;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.context-menu ul {
|
|
117
|
+
list-style: none;
|
|
118
|
+
padding: 10px;
|
|
119
|
+
margin: 0;
|
|
120
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.context-menu li {
|
|
124
|
+
padding: 8px 12px;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
&:hover {
|
|
127
|
+
background-color: #f0f0f0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
2
|
+
|
|
3
|
+
export function useClickOutside(elRef, handler) {
|
|
4
|
+
const listener = (e) => {
|
|
5
|
+
if (!elRef.value || elRef.value.contains(e.target)) return
|
|
6
|
+
handler(e)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
onMounted (() => document.addEventListener('click', listener))
|
|
10
|
+
onBeforeUnmount(() => document.removeEventListener('click', listener))
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// hooks/useTableDragSort.js
|
|
2
|
+
import Sortable from 'sortablejs'
|
|
3
|
+
import { nextTick, watch, onUnmounted } from 'vue'
|
|
4
|
+
|
|
5
|
+
export function useTableDragSort(tableRef, list, options = {}) {
|
|
6
|
+
let sortable = null
|
|
7
|
+
|
|
8
|
+
const init = async () => {
|
|
9
|
+
await nextTick()
|
|
10
|
+
const tbody = tableRef.value?.$el.querySelector('.el-table__body-wrapper tbody')
|
|
11
|
+
if (!tbody) return
|
|
12
|
+
sortable?.destroy()
|
|
13
|
+
sortable = Sortable.create(tbody, {
|
|
14
|
+
animation: 150,
|
|
15
|
+
handle: '.drag-cell', // 只有手柄能拖
|
|
16
|
+
onEnd: evt => {
|
|
17
|
+
const { oldIndex, newIndex } = evt
|
|
18
|
+
if (oldIndex === undefined || newIndex === undefined) return
|
|
19
|
+
const [removed] = list.value.splice(oldIndex, 1)
|
|
20
|
+
list.value.splice(newIndex, 0, removed)
|
|
21
|
+
},
|
|
22
|
+
...options
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
watch(list, init, { deep: true, immediate: true })
|
|
27
|
+
onUnmounted(() => sortable?.destroy())
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
import router from './router' // 更新导入路径
|
|
3
|
+
import './style.css'
|
|
4
|
+
import App from './App.vue'
|
|
5
|
+
import ElementPlus from 'element-plus'
|
|
6
|
+
import 'element-plus/dist/index.css'
|
|
7
|
+
import { createPinia } from 'pinia' // 引入 Pinia
|
|
8
|
+
|
|
9
|
+
const app = createApp(App)
|
|
10
|
+
const pinia = createPinia() // 创建 Pinia 实例
|
|
11
|
+
|
|
12
|
+
app.use(ElementPlus)
|
|
13
|
+
app.use(router)
|
|
14
|
+
app.use(pinia) // 使用 Pinia
|
|
15
|
+
app.mount('#app')
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
+
import Home from '../views/home.vue'
|
|
3
|
+
import Test from '../views/test.vue'
|
|
4
|
+
import PhoneCode from '../views/phone-code.vue'
|
|
5
|
+
import ChildToParent from '../views/child-to-parent.vue'
|
|
6
|
+
import ParentToChild from '../views/parent-to-child.vue'
|
|
7
|
+
import RouterJump from '../views/router-jump.vue'
|
|
8
|
+
// 定义路由配置
|
|
9
|
+
const router = createRouter({
|
|
10
|
+
history: createWebHistory(),
|
|
11
|
+
routes: [
|
|
12
|
+
{
|
|
13
|
+
path: '/',
|
|
14
|
+
name: 'home',
|
|
15
|
+
component: Home,
|
|
16
|
+
meta: {
|
|
17
|
+
title: '首页'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
// 通讯
|
|
23
|
+
{
|
|
24
|
+
path: '/contact',
|
|
25
|
+
name: 'contact',
|
|
26
|
+
meta: {
|
|
27
|
+
title: '通讯'
|
|
28
|
+
},
|
|
29
|
+
children: [
|
|
30
|
+
// 子通知父
|
|
31
|
+
{
|
|
32
|
+
path: '/contact/child-to-parent',
|
|
33
|
+
name: 'child-to-parent',
|
|
34
|
+
component: ChildToParent,
|
|
35
|
+
meta: {
|
|
36
|
+
title: '子通知父'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
// 父通知子
|
|
40
|
+
{
|
|
41
|
+
path: '/contact/parent-to-child',
|
|
42
|
+
name: 'parent-to-child',
|
|
43
|
+
component: ParentToChild,
|
|
44
|
+
meta: {
|
|
45
|
+
title: '父通知子'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// 手机验证码
|
|
52
|
+
{
|
|
53
|
+
path: '/phone-code',
|
|
54
|
+
name: 'phone-code',
|
|
55
|
+
component: PhoneCode,
|
|
56
|
+
meta: {
|
|
57
|
+
title: '手机验证码'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
// 路由跳转
|
|
63
|
+
{
|
|
64
|
+
path: '/router-jump',
|
|
65
|
+
name: 'router-jump',
|
|
66
|
+
component: RouterJump,
|
|
67
|
+
meta: {
|
|
68
|
+
title: '路由跳转'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
// jsx
|
|
72
|
+
{
|
|
73
|
+
path: '/jsx',
|
|
74
|
+
name: 'jsx',
|
|
75
|
+
component: () => import('../views/jsx/index.vue'),
|
|
76
|
+
meta: {
|
|
77
|
+
title: 'jsx'
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
// 智能教练
|
|
83
|
+
{
|
|
84
|
+
path: '/ai-coach',
|
|
85
|
+
name: 'ai-coach',
|
|
86
|
+
component: () => import('../views/aiCoach/index.jsx'),
|
|
87
|
+
meta: {
|
|
88
|
+
title: '智能教练'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
// 测试
|
|
93
|
+
{
|
|
94
|
+
path: '/test',
|
|
95
|
+
name: 'test',
|
|
96
|
+
component: Test,
|
|
97
|
+
meta: {
|
|
98
|
+
title: '测试'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
export default router
|