npmapps 1.2.0 → 1.3.1
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/README.md +41 -0
- package/files/part-002 +4 -0
- package/get.js +193 -0
- package/manifest.json +28 -0
- package/package.json +17 -10
- package/PUBLISH.md +0 -268
- package/app/wujie-wk/t.html +0 -90
- package/app/wujie-wk/wujie-vue2-child/.eslintrc.js +0 -19
- package/app/wujie-wk/wujie-vue2-child/README.md +0 -24
- package/app/wujie-wk/wujie-vue2-child/babel.config.js +0 -5
- package/app/wujie-wk/wujie-vue2-child/docs/superpowers/plans/2026-05-29-quill-editor.md +0 -836
- package/app/wujie-wk/wujie-vue2-child/docs/superpowers/specs/2026-05-29-quill-editor-design.md +0 -210
- package/app/wujie-wk/wujie-vue2-child/jsconfig.json +0 -19
- package/app/wujie-wk/wujie-vue2-child/package-lock.json +0 -21333
- package/app/wujie-wk/wujie-vue2-child/package.json +0 -63
- package/app/wujie-wk/wujie-vue2-child/postcss.config.js +0 -10
- package/app/wujie-wk/wujie-vue2-child/public/favicon.ico +0 -0
- package/app/wujie-wk/wujie-vue2-child/public/index.html +0 -17
- package/app/wujie-wk/wujie-vue2-child/public/rili.jpg +0 -0
- package/app/wujie-wk/wujie-vue2-child/public//344/270/200/351/224/256/351/273/221/346/232/227.html +0 -136
- package/app/wujie-wk/wujie-vue2-child/src/App.vue +0 -110
- package/app/wujie-wk/wujie-vue2-child/src/assets/bpmn-camunda.jpg +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/css/diagram.less +0 -17
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/Icon.less +0 -31
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app-codes.css +0 -26
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.eot +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.svg +0 -60
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.ttf +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.woff +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.woff2 +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/config.json +0 -248
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-bottom-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +0 -85
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-left-tool.svg +0 -84
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-right-tool.svg +0 -80
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-top-tool.svg +0 -84
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +0 -89
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +0 -95
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +0 -99
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/set-color-tool.svg +0 -111
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-bottom-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-left-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-right-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-top-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/set-color-tool.svg +0 -63
- package/app/wujie-wk/wujie-vue2-child/src/assets/logo.png +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/README.md +0 -70
- package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/article.md +0 -184
- package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/index.js +0 -213
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/CalendarSkeleton.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/CodeBlock.vue +0 -199
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/MonthSelect.vue +0 -376
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/README.md +0 -485
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/example.vue +0 -1747
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/index.vue +0 -2720
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/mockData.js +0 -475
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/recruitmentAdapter.js +0 -51
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/utils.js +0 -202
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/FunctionSelector.vue +0 -123
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/OperatorSelector.vue +0 -184
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/ParameterSelector.vue +0 -123
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/api.js +0 -69
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/index.vue +0 -435
- package/app/wujie-wk/wujie-vue2-child/src/components/HelloWorld.vue +0 -58
- package/app/wujie-wk/wujie-vue2-child/src/components/PageHeader/index.vue +0 -158
- package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/README.md +0 -144
- package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/example.vue +0 -84
- package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/index.vue +0 -203
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/ToolBar.vue +0 -357
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/customTranslate/customTranslate.js +0 -12
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/customTranslate/translationsGerman.js +0 -241
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/index.vue +0 -261
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/xmlData.js +0 -29
- package/app/wujie-wk/wujie-vue2-child/src/directives/filldown.js +0 -155
- package/app/wujie-wk/wujie-vue2-child/src/directives/filldownTable.js +0 -291
- package/app/wujie-wk/wujie-vue2-child/src/main.js +0 -40
- package/app/wujie-wk/wujie-vue2-child/src/router/index.js +0 -72
- package/app/wujie-wk/wujie-vue2-child/src/store/index.js +0 -23
- package/app/wujie-wk/wujie-vue2-child/src/utils/winBox.js +0 -23
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/A.vue +0 -12
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/B.vue +0 -10
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/MagicalComponentsForELFormItem.vue +0 -78
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/index.vue +0 -59
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/tableMouseHorizontalWheel.vue +0 -184
- package/app/wujie-wk/wujie-vue2-child/src/views/Home.vue +0 -27
- package/app/wujie-wk/wujie-vue2-child/src/views/RouterJump.vue +0 -145
- package/app/wujie-wk/wujie-vue2-child/src/views/calendar/index.vue +0 -19
- package/app/wujie-wk/wujie-vue2-child/src/views/css.vue +0 -57
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/EllipsisText.vue +0 -73
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/HoverCard.vue +0 -69
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/TableHover.vue +0 -130
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/inputSlo.vue +0 -42
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/tableFixed.vue +0 -148
- package/app/wujie-wk/wujie-vue2-child/src/views/echarts/echart-dome.vue +0 -73
- package/app/wujie-wk/wujie-vue2-child/src/views/echarts/index.vue +0 -118
- package/app/wujie-wk/wujie-vue2-child/src/views/echarts/pei3d.vue +0 -658
- package/app/wujie-wk/wujie-vue2-child/src/views/element/bpmn/index.vue +0 -15
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendanceCycle/index.vue +0 -131
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendanceGroup/index.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendancePersonnel/index.vue +0 -158
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/companyCalendar/index.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/shift/index.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/shiftRotationSystem/index.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/columnManagement.vue +0 -340
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/dialogInput.vue +0 -71
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/elTableJsx.vue +0 -1826
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/formTable.vue +0 -595
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/index.vue +0 -29
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/simpleTable.vue +0 -189
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx.zip +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/views/element/index.vue +0 -39
- package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/README.md +0 -163
- package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/example.vue +0 -307
- package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/index.vue +0 -409
- package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/toolbar.js +0 -122
- package/app/wujie-wk/wujie-vue2-child/vue.config.js +0 -15
|
@@ -1,435 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="formula-editor">
|
|
3
|
-
<!-- 顶部区域:公式编辑 + 提示 -->
|
|
4
|
-
<div class="top-area">
|
|
5
|
-
<!-- 左侧:公式编辑区域 -->
|
|
6
|
-
<div class="section formula-section">
|
|
7
|
-
<div class="section-header">
|
|
8
|
-
<h3 class="section-title">公式编辑</h3>
|
|
9
|
-
<el-popover
|
|
10
|
-
placement="bottom"
|
|
11
|
-
width="300"
|
|
12
|
-
trigger="hover"
|
|
13
|
-
content="点击右侧按钮输入数字和运算符,或直接在文本框输入。支持加减乘除及括号运算。"
|
|
14
|
-
>
|
|
15
|
-
<i slot="reference" class="el-icon-question help-icon"></i>
|
|
16
|
-
</el-popover>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="editor-container">
|
|
19
|
-
<!-- 左边:文本域输入框 -->
|
|
20
|
-
<div class="left-panel">
|
|
21
|
-
<el-input
|
|
22
|
-
ref="formulaInput"
|
|
23
|
-
type="textarea"
|
|
24
|
-
v-model="formula"
|
|
25
|
-
placeholder="在此输入公式..."
|
|
26
|
-
resize="none"
|
|
27
|
-
class="formula-textarea"
|
|
28
|
-
@drop.native="handleInputDrop"
|
|
29
|
-
@blur="recordCursorPos"
|
|
30
|
-
@click.native="recordCursorPos"
|
|
31
|
-
@keyup.native="recordCursorPos"
|
|
32
|
-
></el-input>
|
|
33
|
-
</div>
|
|
34
|
-
<!-- 右边:按钮区域 -->
|
|
35
|
-
<div class="right-panel">
|
|
36
|
-
<div class="btn-grid">
|
|
37
|
-
<el-button size="mini" plain @click="insertText('1')" @mousedown.native.prevent>1</el-button>
|
|
38
|
-
<el-button size="mini" plain @click="insertText('2')" @mousedown.native.prevent>2</el-button>
|
|
39
|
-
<el-button size="mini" plain @click="insertText('3')" @mousedown.native.prevent>3</el-button>
|
|
40
|
-
<el-button size="mini" type="primary" plain @click="insertText('+')" @mousedown.native.prevent>+</el-button>
|
|
41
|
-
|
|
42
|
-
<el-button size="mini" plain @click="insertText('4')" @mousedown.native.prevent>4</el-button>
|
|
43
|
-
<el-button size="mini" plain @click="insertText('5')" @mousedown.native.prevent>5</el-button>
|
|
44
|
-
<el-button size="mini" plain @click="insertText('6')" @mousedown.native.prevent>6</el-button>
|
|
45
|
-
<el-button size="mini" type="primary" plain @click="insertText('-')" @mousedown.native.prevent>-</el-button>
|
|
46
|
-
|
|
47
|
-
<el-button size="mini" plain @click="insertText('7')" @mousedown.native.prevent>7</el-button>
|
|
48
|
-
<el-button size="mini" plain @click="insertText('8')" @mousedown.native.prevent>8</el-button>
|
|
49
|
-
<el-button size="mini" plain @click="insertText('9')" @mousedown.native.prevent>9</el-button>
|
|
50
|
-
<el-button size="mini" type="primary" plain @click="insertText('*')" @mousedown.native.prevent>*</el-button>
|
|
51
|
-
|
|
52
|
-
<el-button size="mini" plain @click="insertText('0')" @mousedown.native.prevent>0</el-button>
|
|
53
|
-
<el-button size="mini" plain @click="insertText('.')" @mousedown.native.prevent>.</el-button>
|
|
54
|
-
<el-button size="mini" plain @click="insertText('(')" @mousedown.native.prevent>(</el-button>
|
|
55
|
-
<el-button size="mini" type="primary" plain @click="insertText('/')" @mousedown.native.prevent>/</el-button>
|
|
56
|
-
</div>
|
|
57
|
-
<div class="btn-actions">
|
|
58
|
-
<el-button size="mini" plain @click="insertText(')')" class="action-btn" @mousedown.native.prevent>)</el-button>
|
|
59
|
-
<el-button size="mini" type="danger" plain @click="clearFormula" class="action-btn" @mousedown.native.prevent>清空</el-button>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<!-- 底部区域:公式预选模块 -->
|
|
67
|
-
<div class="section selection-section">
|
|
68
|
-
<h3 class="section-title">参数预选</h3>
|
|
69
|
-
<div class="selection-container" :style="{ height: selectionHeight + 'px' }">
|
|
70
|
-
<div
|
|
71
|
-
v-for="(item, index) in selectorList"
|
|
72
|
-
:key="index"
|
|
73
|
-
class="selection-item card-shadow"
|
|
74
|
-
>
|
|
75
|
-
<component
|
|
76
|
-
:is="item.component"
|
|
77
|
-
v-bind="item.props"
|
|
78
|
-
@select="handleSelect"
|
|
79
|
-
:onlyLeafClickable="onlyLeafClickable"
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
<!-- 拖拽手柄 -->
|
|
84
|
-
<div class="resize-handle" @mousedown="startResize"></div>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
</template>
|
|
88
|
-
|
|
89
|
-
<script>
|
|
90
|
-
import FunctionSelector from "./FunctionSelector.vue";
|
|
91
|
-
import OperatorSelector from "./OperatorSelector.vue";
|
|
92
|
-
import ParameterSelector from "./ParameterSelector.vue";
|
|
93
|
-
|
|
94
|
-
export default {
|
|
95
|
-
name: "FormulaEditor",
|
|
96
|
-
components: {
|
|
97
|
-
FunctionSelector,
|
|
98
|
-
OperatorSelector,
|
|
99
|
-
ParameterSelector,
|
|
100
|
-
},
|
|
101
|
-
props: {
|
|
102
|
-
selectors: {
|
|
103
|
-
type: Array,
|
|
104
|
-
default: () => [
|
|
105
|
-
{ type: "function", props: { prefix: "F_" } },
|
|
106
|
-
{ type: "operator", props: { prefix: "" } },
|
|
107
|
-
{ type: "parameter", props: { prefix: "P_" } },
|
|
108
|
-
],
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
data() {
|
|
112
|
-
return {
|
|
113
|
-
formula: "",
|
|
114
|
-
selectionHeight: 300,
|
|
115
|
-
startY: 0,
|
|
116
|
-
startHeight: 0,
|
|
117
|
-
onlyLeafClickable: true, // 控制是否只能点击最底层的子数据
|
|
118
|
-
componentMap: {
|
|
119
|
-
function: "FunctionSelector",
|
|
120
|
-
operator: "OperatorSelector",
|
|
121
|
-
parameter: "ParameterSelector",
|
|
122
|
-
},
|
|
123
|
-
cursorPos: null,
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
computed: {
|
|
127
|
-
selectorList() {
|
|
128
|
-
return this.selectors.map((item) => {
|
|
129
|
-
// 兼容旧的字符串格式配置
|
|
130
|
-
if (typeof item === 'string') {
|
|
131
|
-
return {
|
|
132
|
-
component: this.componentMap[item],
|
|
133
|
-
props: {}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
// 新的对象格式配置
|
|
137
|
-
return {
|
|
138
|
-
component: this.componentMap[item.type],
|
|
139
|
-
props: item.props || {},
|
|
140
|
-
};
|
|
141
|
-
});
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
methods: {
|
|
145
|
-
insertText(text) {
|
|
146
|
-
const textarea = this.$refs.formulaInput.$refs.textarea;
|
|
147
|
-
let pos = this.cursorPos;
|
|
148
|
-
|
|
149
|
-
// 如果当前已经是聚焦状态,直接使用当前光标位置
|
|
150
|
-
if (document.activeElement === textarea) {
|
|
151
|
-
pos = textarea.selectionStart;
|
|
152
|
-
} else if (pos === null) {
|
|
153
|
-
// 如果没有记录位置且未聚焦,默认追加到最后
|
|
154
|
-
pos = this.formula.length;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const val = this.formula;
|
|
158
|
-
const newVal = val.slice(0, pos) + text + val.slice(pos);
|
|
159
|
-
this.formula = newVal;
|
|
160
|
-
|
|
161
|
-
// 计算新的光标位置
|
|
162
|
-
let newCursorPos = pos + text.length;
|
|
163
|
-
|
|
164
|
-
// 检查插入内容是否包含 "()"
|
|
165
|
-
// 如果包含,光标定位到第一个 "()" 的中间
|
|
166
|
-
const parenIndex = text.indexOf("()");
|
|
167
|
-
if (parenIndex !== -1) {
|
|
168
|
-
newCursorPos = pos + parenIndex + 1;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
this.cursorPos = newCursorPos;
|
|
172
|
-
|
|
173
|
-
// 聚焦并设置光标
|
|
174
|
-
this.$nextTick(() => {
|
|
175
|
-
textarea.focus();
|
|
176
|
-
textarea.setSelectionRange(this.cursorPos, this.cursorPos);
|
|
177
|
-
});
|
|
178
|
-
},
|
|
179
|
-
handleSelect(item) {
|
|
180
|
-
if (item && item.value) {
|
|
181
|
-
this.insertText(item.value);
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
recordCursorPos(e) {
|
|
185
|
-
// 记录光标位置
|
|
186
|
-
if (e.target && e.target.selectionStart !== undefined) {
|
|
187
|
-
this.cursorPos = e.target.selectionStart;
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
handleInputDrop(e) {
|
|
191
|
-
// 获取拖拽的文本内容 (必须在异步回调前获取)
|
|
192
|
-
const droppedText = (e.dataTransfer && e.dataTransfer.getData)
|
|
193
|
-
? e.dataTransfer.getData("text/plain")
|
|
194
|
-
: "";
|
|
195
|
-
|
|
196
|
-
// 拖拽释放后,自动聚焦文本域
|
|
197
|
-
// 增加延时,确保在浏览器默认行为(插入+选中)以及 Vue 的 DOM 更新完成后执行
|
|
198
|
-
setTimeout(() => {
|
|
199
|
-
if (this.$refs.formulaInput) {
|
|
200
|
-
const textarea = this.$refs.formulaInput.$refs.textarea;
|
|
201
|
-
this.$refs.formulaInput.focus();
|
|
202
|
-
|
|
203
|
-
// 获取选区结束位置(即插入文本的末尾)
|
|
204
|
-
let endPos = textarea.selectionEnd;
|
|
205
|
-
|
|
206
|
-
// 尝试根据拖拽文本定位光标
|
|
207
|
-
if (droppedText) {
|
|
208
|
-
const parenIndex = droppedText.indexOf("()");
|
|
209
|
-
if (parenIndex !== -1) {
|
|
210
|
-
// 光标应该在 startPos + parenIndex + 1
|
|
211
|
-
// 为了安全,校验一下长度是否足够
|
|
212
|
-
if (endPos >= droppedText.length) {
|
|
213
|
-
endPos = endPos - droppedText.length + parenIndex + 1;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
} else {
|
|
217
|
-
// 降级处理:检查插入内容是否以 "()" 结尾
|
|
218
|
-
const val = textarea.value;
|
|
219
|
-
if (endPos >= 2 && val.slice(endPos - 2, endPos) === '()') {
|
|
220
|
-
endPos -= 1;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// 强制移动光标到指定位置,取消选中状态
|
|
225
|
-
if (typeof textarea.setSelectionRange === 'function') {
|
|
226
|
-
textarea.setSelectionRange(endPos, endPos);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// 更新光标位置记录
|
|
230
|
-
this.cursorPos = endPos;
|
|
231
|
-
}
|
|
232
|
-
}, 50);
|
|
233
|
-
},
|
|
234
|
-
clearFormula() {
|
|
235
|
-
this.formula = "";
|
|
236
|
-
this.cursorPos = 0;
|
|
237
|
-
this.$nextTick(() => {
|
|
238
|
-
this.$refs.formulaInput.focus();
|
|
239
|
-
});
|
|
240
|
-
},
|
|
241
|
-
startResize(e) {
|
|
242
|
-
this.startY = e.clientY;
|
|
243
|
-
this.startHeight = this.selectionHeight;
|
|
244
|
-
document.addEventListener("mousemove", this.doResize);
|
|
245
|
-
document.addEventListener("mouseup", this.stopResize);
|
|
246
|
-
document.body.style.cursor = "ns-resize";
|
|
247
|
-
document.body.style.userSelect = "none";
|
|
248
|
-
},
|
|
249
|
-
doResize(e) {
|
|
250
|
-
const dy = e.clientY - this.startY;
|
|
251
|
-
this.selectionHeight = Math.max(150, this.startHeight + dy);
|
|
252
|
-
},
|
|
253
|
-
stopResize() {
|
|
254
|
-
document.removeEventListener("mousemove", this.doResize);
|
|
255
|
-
document.removeEventListener("mouseup", this.stopResize);
|
|
256
|
-
document.body.style.cursor = "";
|
|
257
|
-
document.body.style.userSelect = "";
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
};
|
|
261
|
-
</script>
|
|
262
|
-
|
|
263
|
-
<style scoped>
|
|
264
|
-
.formula-editor {
|
|
265
|
-
padding: 15px;
|
|
266
|
-
display: flex;
|
|
267
|
-
flex-direction: column;
|
|
268
|
-
gap: 15px;
|
|
269
|
-
height: 100%;
|
|
270
|
-
box-sizing: border-box;
|
|
271
|
-
background-color: #f5f7fa; /* 整体背景色 */
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.section {
|
|
275
|
-
background-color: #fff;
|
|
276
|
-
border-radius: 8px; /* 圆角增加 */
|
|
277
|
-
padding: 15px;
|
|
278
|
-
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05); /* 添加阴影 */
|
|
279
|
-
border: none; /* 去除边框 */
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.section-header {
|
|
283
|
-
display: flex;
|
|
284
|
-
align-items: center;
|
|
285
|
-
margin-bottom: 10px;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.section-title {
|
|
289
|
-
margin: 0;
|
|
290
|
-
font-size: 15px;
|
|
291
|
-
font-weight: 600;
|
|
292
|
-
color: #303133;
|
|
293
|
-
padding-left: 8px;
|
|
294
|
-
border-left: 4px solid #409eff; /* 左侧强调条 */
|
|
295
|
-
line-height: 1.2;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.help-icon {
|
|
299
|
-
margin-left: 8px;
|
|
300
|
-
color: #909399;
|
|
301
|
-
cursor: pointer;
|
|
302
|
-
font-size: 16px;
|
|
303
|
-
}
|
|
304
|
-
.help-icon:hover {
|
|
305
|
-
color: #409eff;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/* 顶部区域布局 */
|
|
309
|
-
.top-area {
|
|
310
|
-
flex-shrink: 0;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.editor-container {
|
|
314
|
-
display: flex;
|
|
315
|
-
gap: 15px;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.left-panel {
|
|
319
|
-
flex: 1;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/* 文本域样式优化 */
|
|
323
|
-
.formula-textarea ::v-deep .el-textarea__inner {
|
|
324
|
-
height: 180px; /* 稍微增加高度适应按钮网格 */
|
|
325
|
-
max-height: 180px;
|
|
326
|
-
font-family: 'Consolas', 'Monaco', monospace; /* 更好看的等宽字体 */
|
|
327
|
-
font-size: 16px;
|
|
328
|
-
border-radius: 4px;
|
|
329
|
-
border: 1px solid #dcdfe6;
|
|
330
|
-
padding: 10px;
|
|
331
|
-
transition: border-color 0.2s;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.formula-textarea ::v-deep .el-textarea__inner:focus {
|
|
335
|
-
border-color: #409eff;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.right-panel {
|
|
339
|
-
width: 200px;
|
|
340
|
-
flex-shrink: 0;
|
|
341
|
-
display: flex;
|
|
342
|
-
flex-direction: column;
|
|
343
|
-
gap: 8px;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/* 按钮网格布局 */
|
|
347
|
-
.btn-grid {
|
|
348
|
-
display: grid;
|
|
349
|
-
grid-template-columns: repeat(4, 1fr);
|
|
350
|
-
gap: 6px;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.btn-grid .el-button {
|
|
354
|
-
margin: 0;
|
|
355
|
-
padding: 10px 0;
|
|
356
|
-
font-weight: bold;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.btn-actions {
|
|
360
|
-
display: flex;
|
|
361
|
-
gap: 6px;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.action-btn {
|
|
365
|
-
flex: 1;
|
|
366
|
-
margin: 0;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/* 底部预选区域布局 */
|
|
370
|
-
.selection-section {
|
|
371
|
-
display: flex;
|
|
372
|
-
flex-direction: column;
|
|
373
|
-
padding-bottom: 5px; /* 调整底部间距 */
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.selection-container {
|
|
377
|
-
display: flex;
|
|
378
|
-
gap: 15px;
|
|
379
|
-
/* height 由 inline style 控制 */
|
|
380
|
-
overflow-x: auto;
|
|
381
|
-
overflow-y: hidden;
|
|
382
|
-
padding: 5px 2px; /* 增加一点padding避免阴影被截断 */
|
|
383
|
-
min-height: 150px;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.resize-handle {
|
|
387
|
-
height: 12px;
|
|
388
|
-
cursor: ns-resize;
|
|
389
|
-
display: flex;
|
|
390
|
-
justify-content: center;
|
|
391
|
-
align-items: center;
|
|
392
|
-
margin-top: 5px;
|
|
393
|
-
border-radius: 4px;
|
|
394
|
-
transition: background-color 0.2s;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
.resize-handle:hover {
|
|
398
|
-
background-color: #f0f2f5;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.resize-handle::after {
|
|
402
|
-
content: '';
|
|
403
|
-
width: 40px;
|
|
404
|
-
height: 4px;
|
|
405
|
-
background-color: #dcdfe6;
|
|
406
|
-
border-radius: 2px;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
.selection-item {
|
|
410
|
-
width: 220px; /* 稍微加宽 */
|
|
411
|
-
flex-shrink: 0;
|
|
412
|
-
height: 100%;
|
|
413
|
-
background-color: #fff;
|
|
414
|
-
border: 1px solid #ebeef5;
|
|
415
|
-
border-radius: 4px;
|
|
416
|
-
overflow: hidden;
|
|
417
|
-
transition: box-shadow 0.3s;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.card-shadow:hover {
|
|
421
|
-
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/* 滚动条样式美化 */
|
|
425
|
-
.selection-container::-webkit-scrollbar {
|
|
426
|
-
height: 8px;
|
|
427
|
-
}
|
|
428
|
-
.selection-container::-webkit-scrollbar-thumb {
|
|
429
|
-
background: #dcdfe6;
|
|
430
|
-
border-radius: 4px;
|
|
431
|
-
}
|
|
432
|
-
.selection-container::-webkit-scrollbar-track {
|
|
433
|
-
background: #f5f7fa;
|
|
434
|
-
}
|
|
435
|
-
</style>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="hello">
|
|
3
|
-
<h1>{{ msg }}</h1>
|
|
4
|
-
<p>
|
|
5
|
-
For a guide and recipes on how to configure / customize this project,<br>
|
|
6
|
-
check out the
|
|
7
|
-
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
|
8
|
-
</p>
|
|
9
|
-
<h3>Installed CLI Plugins</h3>
|
|
10
|
-
<ul>
|
|
11
|
-
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
|
|
12
|
-
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
|
|
13
|
-
</ul>
|
|
14
|
-
<h3>Essential Links</h3>
|
|
15
|
-
<ul>
|
|
16
|
-
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
|
|
17
|
-
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
|
|
18
|
-
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
|
|
19
|
-
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
|
|
20
|
-
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
|
|
21
|
-
</ul>
|
|
22
|
-
<h3>Ecosystem</h3>
|
|
23
|
-
<ul>
|
|
24
|
-
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
|
|
25
|
-
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
|
|
26
|
-
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
|
|
27
|
-
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
|
|
28
|
-
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
|
|
29
|
-
</ul>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script>
|
|
34
|
-
export default {
|
|
35
|
-
name: 'HelloWorld',
|
|
36
|
-
props: {
|
|
37
|
-
msg: String
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
43
|
-
<style scoped>
|
|
44
|
-
h3 {
|
|
45
|
-
margin: 40px 0 0;
|
|
46
|
-
}
|
|
47
|
-
ul {
|
|
48
|
-
list-style-type: none;
|
|
49
|
-
padding: 0;
|
|
50
|
-
}
|
|
51
|
-
li {
|
|
52
|
-
display: inline-block;
|
|
53
|
-
margin: 0 10px;
|
|
54
|
-
}
|
|
55
|
-
a {
|
|
56
|
-
color: #42b983;
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="page-header">
|
|
3
|
-
<div class="header-content" ref="contentRef">
|
|
4
|
-
<div class="header-text">
|
|
5
|
-
<span class="text-description">{{ description }}</span>
|
|
6
|
-
<span v-if="usage" class="text-usage">使用方法:{{ usage }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
<el-button v-if="isOverflow" type="text" size="small" class="expand-btn" @click="showDialog">
|
|
9
|
-
查看全部
|
|
10
|
-
<i class="el-icon-arrow-right"></i>
|
|
11
|
-
</el-button>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<el-dialog :title="title || '使用说明'" :visible.sync="dialogVisible" width="640px">
|
|
15
|
-
<div class="dialog-body">
|
|
16
|
-
<div class="dialog-section">
|
|
17
|
-
<div class="dialog-label">功能说明</div>
|
|
18
|
-
<div class="dialog-value">{{ description }}</div>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="dialog-section" v-if="usage">
|
|
21
|
-
<div class="dialog-label">使用方法</div>
|
|
22
|
-
<div class="dialog-value usage-box" v-html="usage"></div>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</el-dialog>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
export default {
|
|
31
|
-
name: 'PageHeader',
|
|
32
|
-
props: {
|
|
33
|
-
title: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: ''
|
|
36
|
-
},
|
|
37
|
-
description: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: ''
|
|
40
|
-
},
|
|
41
|
-
usage: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: ''
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
data() {
|
|
47
|
-
return {
|
|
48
|
-
isOverflow: false,
|
|
49
|
-
dialogVisible: false
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
methods: {
|
|
53
|
-
checkOverflow() {
|
|
54
|
-
this.$nextTick(() => {
|
|
55
|
-
const el = this.$refs.contentRef
|
|
56
|
-
if (el) {
|
|
57
|
-
this.isOverflow = el.scrollHeight > el.clientHeight
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
},
|
|
61
|
-
showDialog() {
|
|
62
|
-
this.dialogVisible = true
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
mounted() {
|
|
66
|
-
this.checkOverflow()
|
|
67
|
-
},
|
|
68
|
-
updated() {
|
|
69
|
-
this.checkOverflow()
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
<style scoped>
|
|
75
|
-
.page-header {
|
|
76
|
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
77
|
-
border-radius: 8px;
|
|
78
|
-
padding: 14px 16px;
|
|
79
|
-
margin-bottom: 20px;
|
|
80
|
-
}
|
|
81
|
-
.header-content {
|
|
82
|
-
display: flex;
|
|
83
|
-
align-items: flex-start;
|
|
84
|
-
justify-content: space-between;
|
|
85
|
-
gap: 12px;
|
|
86
|
-
max-height: 44px;
|
|
87
|
-
overflow: hidden;
|
|
88
|
-
}
|
|
89
|
-
.header-text {
|
|
90
|
-
flex: 1;
|
|
91
|
-
display: flex;
|
|
92
|
-
flex-direction: column;
|
|
93
|
-
gap: 4px;
|
|
94
|
-
overflow: hidden;
|
|
95
|
-
}
|
|
96
|
-
.text-description {
|
|
97
|
-
font-size: 14px;
|
|
98
|
-
color: #ffffff;
|
|
99
|
-
line-height: 1.6;
|
|
100
|
-
overflow: hidden;
|
|
101
|
-
text-overflow: ellipsis;
|
|
102
|
-
display: -webkit-box;
|
|
103
|
-
-webkit-line-clamp: 1;
|
|
104
|
-
-webkit-box-orient: vertical;
|
|
105
|
-
}
|
|
106
|
-
.text-usage {
|
|
107
|
-
font-size: 13px;
|
|
108
|
-
color: rgba(255, 255, 255, 0.75);
|
|
109
|
-
line-height: 1.5;
|
|
110
|
-
overflow: hidden;
|
|
111
|
-
text-overflow: ellipsis;
|
|
112
|
-
display: -webkit-box;
|
|
113
|
-
-webkit-line-clamp: 1;
|
|
114
|
-
-webkit-box-orient: vertical;
|
|
115
|
-
}
|
|
116
|
-
.expand-btn {
|
|
117
|
-
color: rgba(255, 255, 255, 0.9);
|
|
118
|
-
flex-shrink: 0;
|
|
119
|
-
padding: 4px 8px;
|
|
120
|
-
}
|
|
121
|
-
.expand-btn:hover {
|
|
122
|
-
color: #fff;
|
|
123
|
-
}
|
|
124
|
-
.dialog-body {
|
|
125
|
-
font-size: 14px;
|
|
126
|
-
line-height: 1.8;
|
|
127
|
-
}
|
|
128
|
-
.dialog-section {
|
|
129
|
-
margin-bottom: 20px;
|
|
130
|
-
}
|
|
131
|
-
.dialog-section:last-child {
|
|
132
|
-
margin-bottom: 0;
|
|
133
|
-
}
|
|
134
|
-
.dialog-label {
|
|
135
|
-
font-weight: 600;
|
|
136
|
-
color: #303133;
|
|
137
|
-
margin-bottom: 8px;
|
|
138
|
-
}
|
|
139
|
-
.dialog-value {
|
|
140
|
-
color: #606266;
|
|
141
|
-
background: #f5f7fa;
|
|
142
|
-
padding: 10px 14px;
|
|
143
|
-
border-radius: 6px;
|
|
144
|
-
line-height: 1.7;
|
|
145
|
-
}
|
|
146
|
-
.usage-box {
|
|
147
|
-
font-family: Consolas, Monaco, monospace;
|
|
148
|
-
font-size: 13px;
|
|
149
|
-
background: #f8f9fb;
|
|
150
|
-
word-break: break-all;
|
|
151
|
-
}
|
|
152
|
-
.usage-box :deep(code) {
|
|
153
|
-
background: #e4e7ea;
|
|
154
|
-
padding: 2px 6px;
|
|
155
|
-
border-radius: 3px;
|
|
156
|
-
font-size: 12px;
|
|
157
|
-
}
|
|
158
|
-
</style>
|