npmapps 1.0.24 → 1.0.26
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/.codegraph/daemon.pid +6 -0
- package/app/.eslintrc.js +19 -0
- package/app/README.md +24 -0
- package/app/babel.config.js +5 -0
- package/app/devtool-windows-amd64.zip +0 -0
- package/app/docs/superpowers/plans/2026-05-29-quill-editor.md +836 -0
- package/app/docs/superpowers/specs/2026-05-29-quill-editor-design.md +210 -0
- package/app/docs/superpowers/specs/2026-06-06-lazy-cascader-design.md +400 -0
- package/app/jsconfig.json +19 -0
- package/app/package-lock.json +21347 -0
- package/app/package.json +63 -0
- package/app/postcss.config.js +10 -0
- package/app/public/favicon.ico +0 -0
- package/app/public/index.html +17 -0
- package/app/public//344/270/200/351/224/256/351/273/221/346/232/227.html +136 -0
- package/app/src/App.vue +110 -0
- package/app/src/assets/bpmn-camunda.jpg +0 -0
- package/app/src/assets/css/diagram.less +17 -0
- package/app/src/assets/icon/Icon.less +31 -0
- package/app/src/assets/icon/font/app-codes.css +26 -0
- package/app/src/assets/icon/font/app.eot +0 -0
- package/app/src/assets/icon/font/app.svg +60 -0
- package/app/src/assets/icon/font/app.ttf +0 -0
- package/app/src/assets/icon/font/app.woff +0 -0
- package/app/src/assets/icon/font/app.woff2 +0 -0
- package/app/src/assets/icon/font/config.json +248 -0
- package/app/src/assets/icon/font/source/raw/align-bottom-tool.svg +30 -0
- package/app/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +85 -0
- package/app/src/assets/icon/font/source/raw/align-left-tool.svg +84 -0
- package/app/src/assets/icon/font/source/raw/align-right-tool.svg +80 -0
- package/app/src/assets/icon/font/source/raw/align-top-tool.svg +84 -0
- package/app/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +89 -0
- package/app/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +95 -0
- package/app/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +99 -0
- package/app/src/assets/icon/font/source/raw/set-color-tool.svg +111 -0
- package/app/src/assets/icon/font/source/symbols/align-bottom-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-left-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-right-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-top-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/set-color-tool.svg +63 -0
- package/app/src/assets/logo.png +0 -0
- package/app/src/components/EllTable/README.md +70 -0
- package/app/src/components/EllTable/article.md +184 -0
- package/app/src/components/EllTable/index.js +213 -0
- package/app/src/components/FormulaEditor/FunctionSelector.vue +123 -0
- package/app/src/components/FormulaEditor/OperatorSelector.vue +184 -0
- package/app/src/components/FormulaEditor/ParameterSelector.vue +123 -0
- package/app/src/components/FormulaEditor/api.js +69 -0
- package/app/src/components/FormulaEditor/index.vue +435 -0
- package/app/src/components/HelloWorld.vue +58 -0
- package/app/src/components/PageHeader/index.vue +158 -0
- package/app/src/components/Splitter/README.md +144 -0
- package/app/src/components/Splitter/example.vue +88 -0
- package/app/src/components/Splitter/index.vue +203 -0
- package/app/src/components/diagram/ToolBar.vue +357 -0
- package/app/src/components/diagram/customTranslate/customTranslate.js +12 -0
- package/app/src/components/diagram/customTranslate/translationsGerman.js +241 -0
- package/app/src/components/diagram/index.vue +261 -0
- package/app/src/components/diagram/xmlData.js +29 -0
- package/app/src/directives/filldown.js +155 -0
- package/app/src/directives/filldownTable.js +291 -0
- package/app/src/main.js +40 -0
- package/app/src/router/index.js +63 -0
- package/app/src/store/index.js +23 -0
- package/app/src/utils/winBox.js +23 -0
- package/app/src/views/Extend/A.vue +12 -0
- package/app/src/views/Extend/B.vue +10 -0
- package/app/src/views/Extend/MagicalComponentsForELFormItem.vue +87 -0
- package/app/src/views/Extend/index.vue +59 -0
- package/app/src/views/Extend/tableMouseHorizontalWheel.vue +193 -0
- package/app/src/views/Home.vue +37 -0
- package/app/src/views/RouterJump.vue +155 -0
- package/app/src/views/css.vue +57 -0
- package/app/src/views/cssComponents/EllipsisText.vue +83 -0
- package/app/src/views/cssComponents/HoverCard.vue +79 -0
- package/app/src/views/cssComponents/TableHover.vue +140 -0
- package/app/src/views/cssComponents/inputSlo.vue +52 -0
- package/app/src/views/cssComponents/tableFixed.vue +158 -0
- package/app/src/views/echarts/echart-dome.vue +82 -0
- package/app/src/views/echarts/index.vue +118 -0
- package/app/src/views/echarts/pei3d.vue +667 -0
- package/app/src/views/element/bpmn/index.vue +18 -0
- package/app/src/views/element/components/attendanceCycle/index.vue +131 -0
- package/app/src/views/element/components/attendanceGroup/index.vue +147 -0
- package/app/src/views/element/components/attendancePersonnel/index.vue +158 -0
- package/app/src/views/element/components/companyCalendar/index.vue +147 -0
- package/app/src/views/element/components/shift/index.vue +147 -0
- package/app/src/views/element/components/shiftRotationSystem/index.vue +147 -0
- package/app/src/views/element/elTableJsx/columnManagement.vue +340 -0
- package/app/src/views/element/elTableJsx/dialogInput.vue +71 -0
- package/app/src/views/element/elTableJsx/elTableJsx.vue +1826 -0
- package/app/src/views/element/elTableJsx/formTable.vue +598 -0
- package/app/src/views/element/elTableJsx/index.vue +29 -0
- package/app/src/views/element/elTableJsx/simpleTable.vue +192 -0
- package/app/src/views/element/elTableJsx.zip +0 -0
- package/app/src/views/element/index.vue +44 -0
- package/app/src/views/element/lazyCascader/LazyCascader.vue +302 -0
- package/app/src/views/element/lazyCascader/data.js +205 -0
- package/app/src/views/element/lazyCascader/index.vue +315 -0
- package/app/src/views/element/quillEditor/README.md +163 -0
- package/app/src/views/element/quillEditor/example.vue +314 -0
- package/app/src/views/element/quillEditor/index.vue +409 -0
- package/app/src/views/element/quillEditor/toolbar.js +122 -0
- package/app/vue.config.js +15 -0
- package/package.json +1 -1
- package/app/wujie-vue3-child/.claude/settings.local.json +0 -8
- package/app/wujie-vue3-child/.vscode/extensions.json +0 -3
- package/app/wujie-vue3-child/PROJECT_MEMORY.md +0 -427
- package/app/wujie-vue3-child/README.md +0 -5
- package/app/wujie-vue3-child/index.html +0 -13
- package/app/wujie-vue3-child/package-lock.json +0 -5744
- package/app/wujie-vue3-child/package.json +0 -28
- package/app/wujie-vue3-child/public/vite.svg +0 -1
- package/app/wujie-vue3-child/src/App.vue +0 -130
- package/app/wujie-vue3-child/src/assets/vue.svg +0 -1
- package/app/wujie-vue3-child/src/components/HelloWorld.vue +0 -43
- package/app/wujie-vue3-child/src/components/tags-view.vue +0 -193
- package/app/wujie-vue3-child/src/components/tags-view1.vue +0 -131
- package/app/wujie-vue3-child/src/directives/aiLoading.js +0 -182
- package/app/wujie-vue3-child/src/hooks/useClickOutside.js +0 -11
- package/app/wujie-vue3-child/src/hooks/useTableDragSort.js +0 -28
- package/app/wujie-vue3-child/src/main.js +0 -18
- package/app/wujie-vue3-child/src/router/index.js +0 -104
- package/app/wujie-vue3-child/src/store/tagsViewStroe.js +0 -34
- package/app/wujie-vue3-child/src/style.css +0 -171
- package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.jsx +0 -108
- package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.module.scss +0 -97
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/README.md +0 -836
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/REFLEX_EXAMPLES.md +0 -728
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.jsx +0 -687
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.module.scss +0 -560
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.jsx +0 -570
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.module.scss +0 -330
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.jsx +0 -378
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.module.scss +0 -228
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.jsx +0 -399
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.module.scss +0 -252
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.jsx +0 -585
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.module.scss +0 -331
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.jsx +0 -392
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.module.scss +0 -39
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/README.md +0 -248
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/SelectorTrigger.jsx +0 -194
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/index.jsx +0 -1459
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/mockData.js +0 -301
- package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.jsx +0 -182
- package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.module.scss +0 -28
- package/app/wujie-vue3-child/src/views/aiCoach/index.jsx +0 -293
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.jsx +0 -121
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.module.scss +0 -76
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/DonutChart/index.jsx +0 -104
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.jsx +0 -75
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.module.scss +0 -12
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.jsx +0 -62
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.module.scss +0 -43
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.jsx +0 -29
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.module.scss +0 -5
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.jsx +0 -58
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.module.scss +0 -85
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.jsx +0 -92
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.module.scss +0 -56
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.jsx +0 -40
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.module.scss +0 -53
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsDonut.jsx +0 -106
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsRankBar.jsx +0 -132
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.jsx +0 -176
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.module.scss +0 -96
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.jsx +0 -162
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.module.scss +0 -16
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.jsx +0 -29
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.module.scss +0 -25
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.jsx +0 -106
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.module.scss +0 -164
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.jsx +0 -182
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.module.scss +0 -203
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.jsx +0 -145
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.module.scss +0 -126
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.jsx +0 -67
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.module.scss +0 -105
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.jsx +0 -81
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.module.scss +0 -47
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.jsx +0 -64
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.module.scss +0 -85
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.jsx +0 -39
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.module.scss +0 -44
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.jsx +0 -83
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.module.scss +0 -101
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.jsx +0 -50
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.module.scss +0 -25
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.jsx +0 -196
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.module.scss +0 -41
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.jsx +0 -183
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.module.scss +0 -115
- package/app/wujie-vue3-child/src/views/child-to-parent.vue +0 -117
- package/app/wujie-vue3-child/src/views/home.vue +0 -53
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/btnSelect.vue +0 -169
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/index.vue +0 -69
- package/app/wujie-vue3-child/src/views/jsx/com.vue +0 -44
- package/app/wujie-vue3-child/src/views/jsx/dialog.jsx +0 -66
- package/app/wujie-vue3-child/src/views/jsx/index.vue +0 -72
- package/app/wujie-vue3-child/src/views/jsx/props.vue +0 -33
- package/app/wujie-vue3-child/src/views/parent-to-child.vue +0 -225
- package/app/wujie-vue3-child/src/views/phone-code.vue +0 -318
- package/app/wujie-vue3-child/src/views/router-jump.vue +0 -123
- package/app/wujie-vue3-child/src/views/test.vue +0 -192
- package/app/wujie-vue3-child/vite.config.js +0 -15
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="selector-container">
|
|
3
|
+
<div class="header">操作符</div>
|
|
4
|
+
<div class="tree-wrapper">
|
|
5
|
+
<el-tree
|
|
6
|
+
:data="operatorData"
|
|
7
|
+
:props="defaultProps"
|
|
8
|
+
@node-click="handleNodeClick"
|
|
9
|
+
default-expand-all
|
|
10
|
+
:expand-on-click-node="false"
|
|
11
|
+
>
|
|
12
|
+
<span
|
|
13
|
+
class="custom-tree-node"
|
|
14
|
+
slot-scope="{ node, data }"
|
|
15
|
+
:draggable="!onlyLeafClickable || !data.children"
|
|
16
|
+
@dragstart="handleDragStart(node, data, $event)"
|
|
17
|
+
>
|
|
18
|
+
<span>{{ node.label }}</span>
|
|
19
|
+
<span v-if="!data.children && data.value" class="node-value">{{ data.value }}</span>
|
|
20
|
+
</span>
|
|
21
|
+
</el-tree>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
export default {
|
|
28
|
+
name: "OperatorSelector",
|
|
29
|
+
props: {
|
|
30
|
+
onlyLeafClickable: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true,
|
|
33
|
+
},
|
|
34
|
+
prefix: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
defaultProps: {
|
|
42
|
+
children: "children",
|
|
43
|
+
label: "label",
|
|
44
|
+
},
|
|
45
|
+
operatorData: [
|
|
46
|
+
{
|
|
47
|
+
label: "关键字",
|
|
48
|
+
children: [
|
|
49
|
+
{ label: "如果", value: "if" },
|
|
50
|
+
{ label: "否则", value: "else" },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: "计算运算符",
|
|
55
|
+
children: [
|
|
56
|
+
{ label: "加", value: "+" },
|
|
57
|
+
{ label: "减", value: "-" },
|
|
58
|
+
{ label: "乘", value: "*" },
|
|
59
|
+
{ label: "除", value: "/" },
|
|
60
|
+
{ label: "取余", value: "%" },
|
|
61
|
+
{ label: "左括号", value: "(" },
|
|
62
|
+
{ label: "右括号", value: ")" },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: "比较运算符",
|
|
67
|
+
children: [
|
|
68
|
+
{ label: "大于", value: ">" },
|
|
69
|
+
{ label: "小于", value: "<" },
|
|
70
|
+
{ label: "等于", value: "==" },
|
|
71
|
+
{ label: "不等于", value: "!=" },
|
|
72
|
+
{ label: "大于等于", value: ">=" },
|
|
73
|
+
{ label: "小于等于", value: "<=" },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: "逻辑运算符",
|
|
78
|
+
children: [
|
|
79
|
+
{ label: "并且", value: "&&" },
|
|
80
|
+
{ label: "或者", value: "||" },
|
|
81
|
+
{ label: "非", value: "!" },
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
methods: {
|
|
88
|
+
handleNodeClick(data) {
|
|
89
|
+
// 如果配置了只允许点击叶子节点,且当前节点有子节点,则不处理
|
|
90
|
+
if (this.onlyLeafClickable && data.children) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 处理特殊关键字
|
|
95
|
+
if (data.value === 'if') {
|
|
96
|
+
this.$emit("select", { label: data.label, value: `${this.prefix}如果(){\n \n}` });
|
|
97
|
+
} else if (data.value === 'else') {
|
|
98
|
+
this.$emit("select", { label: data.label, value: `${this.prefix}否则{\n \n}` });
|
|
99
|
+
} else {
|
|
100
|
+
this.$emit("select", { ...data, value: `${this.prefix}${data.value}` });
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
handleDragStart(node, data, e) {
|
|
104
|
+
if (this.onlyLeafClickable && data.children) {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let value = '';
|
|
110
|
+
if (data.value === 'if') {
|
|
111
|
+
value = `${this.prefix}如果(){\n \n}`;
|
|
112
|
+
} else if (data.value === 'else') {
|
|
113
|
+
value = `${this.prefix}否则{\n \n}`;
|
|
114
|
+
} else {
|
|
115
|
+
value = `${this.prefix}${data.value}`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
e.dataTransfer.setData("text/plain", value);
|
|
119
|
+
e.dataTransfer.effectAllowed = "copy";
|
|
120
|
+
|
|
121
|
+
// 设置自定义拖拽镜像
|
|
122
|
+
const div = document.createElement('div');
|
|
123
|
+
div.innerText = value;
|
|
124
|
+
div.style.position = 'absolute';
|
|
125
|
+
div.style.top = '-9999px';
|
|
126
|
+
div.style.padding = '5px 10px';
|
|
127
|
+
div.style.background = '#fff';
|
|
128
|
+
div.style.border = '1px solid #409eff';
|
|
129
|
+
div.style.borderRadius = '4px';
|
|
130
|
+
div.style.fontSize = '14px';
|
|
131
|
+
div.style.color = '#303133';
|
|
132
|
+
div.style.boxShadow = '0 2px 12px 0 rgba(0,0,0,0.1)';
|
|
133
|
+
div.style.zIndex = '9999';
|
|
134
|
+
// 保持换行
|
|
135
|
+
div.style.whiteSpace = 'pre';
|
|
136
|
+
document.body.appendChild(div);
|
|
137
|
+
|
|
138
|
+
e.dataTransfer.setDragImage(div, 0, 0);
|
|
139
|
+
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
document.body.removeChild(div);
|
|
142
|
+
}, 0);
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<style scoped>
|
|
149
|
+
.selector-container {
|
|
150
|
+
width: 100%;
|
|
151
|
+
height: 100%;
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: column;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.header {
|
|
157
|
+
padding: 10px;
|
|
158
|
+
background-color: #f5f7fa;
|
|
159
|
+
border-bottom: 1px solid #ebeef5;
|
|
160
|
+
font-weight: bold;
|
|
161
|
+
text-align: center;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.tree-wrapper {
|
|
165
|
+
flex: 1;
|
|
166
|
+
overflow-y: auto;
|
|
167
|
+
padding: 5px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.custom-tree-node {
|
|
171
|
+
flex: 1;
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: space-between;
|
|
175
|
+
font-size: 14px;
|
|
176
|
+
padding-right: 8px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.node-value {
|
|
180
|
+
color: #909399;
|
|
181
|
+
font-size: 12px;
|
|
182
|
+
font-family: monospace;
|
|
183
|
+
}
|
|
184
|
+
</style>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="selector-container">
|
|
3
|
+
<div class="header">参数</div>
|
|
4
|
+
<div class="tree-wrapper">
|
|
5
|
+
<el-tree
|
|
6
|
+
:data="treeData"
|
|
7
|
+
:props="defaultProps"
|
|
8
|
+
@node-click="handleNodeClick"
|
|
9
|
+
default-expand-all
|
|
10
|
+
highlight-current
|
|
11
|
+
>
|
|
12
|
+
<span
|
|
13
|
+
class="custom-tree-node"
|
|
14
|
+
slot-scope="{ node, data }"
|
|
15
|
+
:draggable="!onlyLeafClickable || node.isLeaf"
|
|
16
|
+
@dragstart="handleDragStart(node, data, $event)"
|
|
17
|
+
>
|
|
18
|
+
{{ node.label }}
|
|
19
|
+
</span>
|
|
20
|
+
</el-tree>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import { getParameters } from "./api";
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: "ParameterSelector",
|
|
30
|
+
props: {
|
|
31
|
+
onlyLeafClickable: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true,
|
|
34
|
+
},
|
|
35
|
+
prefix: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "P_",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
treeData: [],
|
|
43
|
+
defaultProps: {
|
|
44
|
+
children: "children",
|
|
45
|
+
label: "label",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
mounted() {
|
|
50
|
+
this.fetchData();
|
|
51
|
+
},
|
|
52
|
+
methods: {
|
|
53
|
+
async fetchData() {
|
|
54
|
+
this.treeData = await getParameters();
|
|
55
|
+
},
|
|
56
|
+
handleNodeClick(data, node) {
|
|
57
|
+
if (this.onlyLeafClickable && !node.isLeaf) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.$emit("select", { ...data, value: `${this.prefix}${data.name}` });
|
|
61
|
+
},
|
|
62
|
+
handleDragStart(node, data, e) {
|
|
63
|
+
if (this.onlyLeafClickable && !node.isLeaf) {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const value = `${this.prefix}${data.name}`;
|
|
68
|
+
e.dataTransfer.setData("text/plain", value);
|
|
69
|
+
e.dataTransfer.effectAllowed = "copy";
|
|
70
|
+
|
|
71
|
+
// 设置自定义拖拽镜像
|
|
72
|
+
const div = document.createElement('div');
|
|
73
|
+
div.innerText = value;
|
|
74
|
+
div.style.position = 'absolute';
|
|
75
|
+
div.style.top = '-9999px';
|
|
76
|
+
div.style.padding = '5px 10px';
|
|
77
|
+
div.style.background = '#fff';
|
|
78
|
+
div.style.border = '1px solid #409eff';
|
|
79
|
+
div.style.borderRadius = '4px';
|
|
80
|
+
div.style.fontSize = '14px';
|
|
81
|
+
div.style.color = '#303133';
|
|
82
|
+
div.style.boxShadow = '0 2px 12px 0 rgba(0,0,0,0.1)';
|
|
83
|
+
div.style.zIndex = '9999';
|
|
84
|
+
document.body.appendChild(div);
|
|
85
|
+
|
|
86
|
+
e.dataTransfer.setDragImage(div, 0, 0);
|
|
87
|
+
|
|
88
|
+
setTimeout(() => {
|
|
89
|
+
document.body.removeChild(div);
|
|
90
|
+
}, 0);
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<style scoped>
|
|
97
|
+
.custom-tree-node {
|
|
98
|
+
flex: 1;
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
font-size: 14px;
|
|
102
|
+
}
|
|
103
|
+
.selector-container {
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.header {
|
|
111
|
+
padding: 10px;
|
|
112
|
+
background-color: #f5f7fa;
|
|
113
|
+
border-bottom: 1px solid #ebeef5;
|
|
114
|
+
font-weight: bold;
|
|
115
|
+
text-align: center;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.tree-wrapper {
|
|
119
|
+
flex: 1;
|
|
120
|
+
overflow-y: auto;
|
|
121
|
+
padding: 10px;
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export const getFunctions = () => {
|
|
2
|
+
return new Promise((resolve) => {
|
|
3
|
+
setTimeout(() => {
|
|
4
|
+
resolve([
|
|
5
|
+
{
|
|
6
|
+
id: 1,
|
|
7
|
+
label: '数学函数',
|
|
8
|
+
children: [
|
|
9
|
+
{ id: 11, label: '求和', name: '求和' },
|
|
10
|
+
{ id: 12, label: '平均值', name: '平均值' },
|
|
11
|
+
{ id: 13, label: '最大值', name: '最大值' },
|
|
12
|
+
{ id: 14, label: '最小值', name: '最小值' }
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 2,
|
|
17
|
+
label: '逻辑函数',
|
|
18
|
+
children: [
|
|
19
|
+
{ id: 21, label: '条件判断', name: '条件判断' },
|
|
20
|
+
{ id: 22, label: '与', name: '与' },
|
|
21
|
+
{ id: 23, label: '或', name: '或' }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 3,
|
|
26
|
+
label: '文本函数',
|
|
27
|
+
children: [
|
|
28
|
+
{ id: 31, label: '拼接', name: '拼接' },
|
|
29
|
+
{ id: 32, label: '截取', name: '截取' }
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]);
|
|
33
|
+
}, 500);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const getParameters = () => {
|
|
38
|
+
return new Promise((resolve) => {
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
resolve([
|
|
41
|
+
{
|
|
42
|
+
id: 100,
|
|
43
|
+
label: '基础信息',
|
|
44
|
+
children: [
|
|
45
|
+
{ id: 101, label: '员工姓名', name: '员工姓名' },
|
|
46
|
+
{ id: 102, label: '入职日期', name: '入职日期' },
|
|
47
|
+
{ id: 103, label: '部门', name: '部门' }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 200,
|
|
52
|
+
label: '薪资数据',
|
|
53
|
+
children: [
|
|
54
|
+
{
|
|
55
|
+
id: 210,
|
|
56
|
+
label: '基本工资',
|
|
57
|
+
children: [
|
|
58
|
+
{ id: 211, label: '岗位工资', name: '岗位工资' },
|
|
59
|
+
{ id: 212, label: '绩效基数', name: '绩效基数' }
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{ id: 220, label: '奖金', name: '奖金' },
|
|
63
|
+
{ id: 230, label: '补贴', name: '补贴' }
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]);
|
|
67
|
+
}, 500);
|
|
68
|
+
});
|
|
69
|
+
};
|