uudev 1.1.7 → 1.1.9
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/apptemplate/office/package.json +8 -8
- package/apptemplate/office/public/menifest.json +8 -8
- package/apptemplate/office/public/readme.html +11 -11
- package/apptemplate/office/src_excel/App.vue +1 -2
- package/apptemplate/office/src_excel/demo/demo.vue +125 -121
- package/apptemplate/office/src_ppt/App.vue +1 -2
- package/apptemplate/office/src_ppt/demo/demo.vue +166 -70
- package/apptemplate/office/src_word/App.vue +1 -2
- package/apptemplate/office/src_word/demo/demo.vue +158 -58
- package/dtstype/enum/mso_enum.d.ts +6451 -6451
- package/main.js +4 -4
- package/package.json +2 -3
- package/apptemplate/office/package-lock.json +0 -4002
|
@@ -1,58 +1,158 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<template>
|
|
4
|
-
<h1>欢迎使用uudev开发工具</h1>
|
|
5
|
-
<p>
|
|
6
|
-
uudev是一个基于Office的web化开发工具集,提供了从开发、调试到部署的一站式解决方案,帮助开发者更高效地构建Office的web化插件应用。
|
|
7
|
-
</p>
|
|
8
|
-
<p style="font-weight: bold;">
|
|
9
|
-
这是一个html页面,点击本页面后,按<span style="border: 2px solid;">F11</span>可以打开调试工具。
|
|
10
|
-
</p>
|
|
11
|
-
<
|
|
12
|
-
<div>
|
|
13
|
-
|
|
14
|
-
</div>
|
|
15
|
-
<div>
|
|
16
|
-
<a class="demoHref" @click="getDocInfo">取文档信息</a>
|
|
17
|
-
<a class="demoHref" @click="clearDocInfo"
|
|
18
|
-
<span>{{ docName }}</span>(代码:Application.ActiveDocument.Name)
|
|
19
|
-
</div>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<h1>欢迎使用uudev开发工具</h1>
|
|
5
|
+
<p>
|
|
6
|
+
uudev是一个基于Office的web化开发工具集,提供了从开发、调试到部署的一站式解决方案,帮助开发者更高效地构建Office的web化插件应用。
|
|
7
|
+
</p>
|
|
8
|
+
<p style="font-weight: bold;">
|
|
9
|
+
这是一个html页面,点击本页面后,按<span style="border: 2px solid;">F11</span>可以打开调试工具。
|
|
10
|
+
</p>
|
|
11
|
+
<h2>Word示例</h2>
|
|
12
|
+
<div>
|
|
13
|
+
<a class="demoHref" @click="putRangeValue">给文档开头赋值</a>(代码:Application.ActiveDocument.Range(0, 0).Text = "Hello, uudev!")
|
|
14
|
+
</div>
|
|
15
|
+
<div>
|
|
16
|
+
<a class="demoHref" @click="getDocInfo">取文档信息</a>
|
|
17
|
+
<a class="demoHref" @click="clearDocInfo">清除</a>
|
|
18
|
+
<span style="color: red;">{{ docName }}</span>(代码:Application.ActiveDocument.Name)
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<a class="demoHref" @click="appendParagraph">追加段落</a>(代码:Application.ActiveDocument.Content.Paragraphs.Add())
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<a class="demoHref" @click="deleteCurrentParagraph">删除当前段落</a><span style="color: red;">{{ deleteParaErrInfo }}</span>
|
|
25
|
+
</div>
|
|
26
|
+
<div>
|
|
27
|
+
<a class="demoHref" @click="selectAllContent">选中全文</a><span style="color: red;">{{ selectAllInfo }}</span>
|
|
28
|
+
</div>
|
|
29
|
+
<h2>事件通知示例</h2>
|
|
30
|
+
<div>
|
|
31
|
+
<label class="demoHref">
|
|
32
|
+
<input type="checkbox" v-model="isWindowSelectionChangeRegister" @change="regWindowSelectionChange" /> 注册选中区域改变事件
|
|
33
|
+
</label>
|
|
34
|
+
<span style="color: red;">{{ WindowSelectionChangeInfo }}</span>
|
|
35
|
+
</div>
|
|
36
|
+
<div>
|
|
37
|
+
<label class="demoHref">
|
|
38
|
+
<input type="checkbox" v-model="isNewDocumentEventRegister" @change="regNewDocumentEvent" /> 注册新建文档事件
|
|
39
|
+
</label>
|
|
40
|
+
<span style="color: red;">{{ NewDocumentEventInfo }}</span>
|
|
41
|
+
</div>
|
|
42
|
+
<div>
|
|
43
|
+
<span>更多其他事件类型(ewdWindowActivate、ewdWindowDeactivate等),请查看帮助文档</span>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { ref } from 'vue';
|
|
49
|
+
|
|
50
|
+
defineOptions({
|
|
51
|
+
name: 'DemoPage',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const docName = ref('');
|
|
55
|
+
const deleteParaErrInfo = ref('');
|
|
56
|
+
const selectAllInfo = ref('');
|
|
57
|
+
|
|
58
|
+
const isWindowSelectionChangeRegister = ref(false);
|
|
59
|
+
const WindowSelectionChangeInfo = ref('');
|
|
60
|
+
|
|
61
|
+
const isNewDocumentEventRegister = ref(false);
|
|
62
|
+
const NewDocumentEventInfo = ref('');
|
|
63
|
+
|
|
64
|
+
const putRangeValue = () => {
|
|
65
|
+
const doc = Application.ActiveDocument;
|
|
66
|
+
if (doc) {
|
|
67
|
+
doc.Range(0, 0).Text = "Hello, uudev!";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const getDocInfo = () => {
|
|
72
|
+
const doc = Application.ActiveDocument;
|
|
73
|
+
if (doc) {
|
|
74
|
+
docName.value = `文档名称: ${doc.Name}`;
|
|
75
|
+
const info = `文档名称: ${doc.Name}\n文档路径: ${doc.FullName}`;
|
|
76
|
+
console.log(info);
|
|
77
|
+
} else {
|
|
78
|
+
docName.value = '';
|
|
79
|
+
alert('没有打开的文档');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const clearDocInfo = () => {
|
|
84
|
+
docName.value = '';
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const appendParagraph = () => {
|
|
88
|
+
const doc = Application.ActiveDocument;
|
|
89
|
+
if (doc) {
|
|
90
|
+
doc.Content.Paragraphs.Add();
|
|
91
|
+
deleteParaErrInfo.value = '';
|
|
92
|
+
} else {
|
|
93
|
+
alert('没有打开的文档');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const deleteCurrentParagraph = () => {
|
|
98
|
+
const doc = Application.ActiveDocument;
|
|
99
|
+
if (!doc) {
|
|
100
|
+
alert('没有打开的文档');
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const sel = Application.Selection;
|
|
104
|
+
if (sel && sel.Paragraphs.Count > 0) {
|
|
105
|
+
if (doc.Paragraphs.Count > 1) {
|
|
106
|
+
sel.Paragraphs.Item(1).Range.Delete();
|
|
107
|
+
deleteParaErrInfo.value = '';
|
|
108
|
+
} else {
|
|
109
|
+
deleteParaErrInfo.value = '文档中至少保留一个段落,不能删除';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const selectAllContent = () => {
|
|
115
|
+
const doc = Application.ActiveDocument;
|
|
116
|
+
if (doc) {
|
|
117
|
+
doc.Content.Select();
|
|
118
|
+
selectAllInfo.value = '已选中全文内容';
|
|
119
|
+
} else {
|
|
120
|
+
selectAllInfo.value = '';
|
|
121
|
+
alert('没有打开的文档');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const regWindowSelectionChange = () => {
|
|
126
|
+
if (isWindowSelectionChangeRegister.value) {
|
|
127
|
+
Application.MountEvent(ewdWindowSelectionChange, (sel: Selection) => {
|
|
128
|
+
const doc = Application.ActiveDocument;
|
|
129
|
+
if (doc && sel) {
|
|
130
|
+
WindowSelectionChangeInfo.value = `选中了内容: "${sel.Text.substring(0, 20)}" (段落: ${sel.Paragraphs.Count})`;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
} else {
|
|
134
|
+
Application.UnMountEvent(ewdWindowSelectionChange);
|
|
135
|
+
WindowSelectionChangeInfo.value = '';
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const regNewDocumentEvent = () => {
|
|
140
|
+
const onNewDocument = (doc: Document) => {
|
|
141
|
+
NewDocumentEventInfo.value = `新建了文档:${doc.Name}`;
|
|
142
|
+
};
|
|
143
|
+
if (isNewDocumentEventRegister.value) {
|
|
144
|
+
Application.MountEvent(ewdNewDocument, onNewDocument);
|
|
145
|
+
} else {
|
|
146
|
+
Application.UnMountEvent(ewdNewDocument, onNewDocument);
|
|
147
|
+
NewDocumentEventInfo.value = '';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
</script>
|
|
151
|
+
<style scoped>
|
|
152
|
+
.demoHref {
|
|
153
|
+
color: #42b983;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
text-decoration: underline;
|
|
156
|
+
margin-right: 50px;
|
|
157
|
+
}
|
|
158
|
+
</style>
|