uudev 1.0.0 → 1.1.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/apptemplate/office/package-lock.json +1648 -51
- package/apptemplate/office/package.json +3 -3
- package/apptemplate/office/src_excel/App.vue +13 -0
- package/apptemplate/office/src_excel/demo/demo.vue +51 -0
- package/apptemplate/office/src_excel/router/index.ts +19 -0
- package/apptemplate/office/src_ppt/App.vue +13 -0
- package/apptemplate/office/src_ppt/demo/demo.vue +63 -0
- package/apptemplate/office/src_ppt/main.ts +9 -0
- package/apptemplate/office/src_ppt/router/index.ts +19 -0
- package/apptemplate/office/src_word/App.vue +13 -0
- package/apptemplate/office/src_word/demo/demo.vue +51 -0
- package/apptemplate/office/src_word/main.ts +9 -0
- package/apptemplate/office/src_word/router/index.ts +19 -0
- package/apptemplate/office/tsconfig.app.json +2 -0
- package/apptemplate/office/tsconfig.node.json +1 -1
- package/apptemplate/office/vite.config.ts +3 -4
- package/dtstype/base.d.ts +5 -0
- package/dtstype/enum/excel_enum.d.ts +4727 -0
- package/dtstype/enum/mso_enum.d.ts +6452 -0
- package/dtstype/enum/ppt_enum.d.ts +2656 -0
- package/dtstype/enum/word_enum.d.ts +7862 -0
- package/dtstype/excel.d.ts +8358 -0
- package/dtstype/mso.d.ts +3107 -0
- package/dtstype/ppt.d.ts +3224 -0
- package/dtstype/word.d.ts +6786 -0
- package/main.js +4 -3
- package/package.json +14 -2
- package/apptemplate/office/src/App.vue +0 -11
- package/apptemplate/office/src/router/index.ts +0 -19
- /package/apptemplate/office/{src → src_excel}/main.ts +0 -0
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
"author": "uuer",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"dev": "vite --port 41260",
|
|
11
|
-
"build": "run-p type-check \"build-only {@}\" --",
|
|
12
10
|
"debug": "uudev debug",
|
|
13
|
-
"
|
|
11
|
+
"makezip": "uudev makezip",
|
|
12
|
+
"dev": "vite",
|
|
13
|
+
"build": "run-p type-check \"build-only {@}\" --",
|
|
14
14
|
"preview": "vite preview",
|
|
15
15
|
"build-only": "vite build",
|
|
16
16
|
"type-check": "vue-tsc --build",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<h1>欢迎使用uudev系列工具</h1>
|
|
5
|
+
<p>
|
|
6
|
+
uudev是一个基于TypeScript的Office开发工具集,提供了丰富的类型定义和开发支持,帮助开发者更高效地构建Office插件和应用。
|
|
7
|
+
</p>
|
|
8
|
+
<h3>Excel运行示例</h3>
|
|
9
|
+
<div>
|
|
10
|
+
<a class="demoHref" @click="putCellValue">给选中的单元格赋值</a>(代码:Application.ActiveCell.Formula = 'Hello, uudev!')
|
|
11
|
+
</div>
|
|
12
|
+
<div>
|
|
13
|
+
<a class="demoHref" @click="getDocInfo">取文档信息</a>
|
|
14
|
+
<a class="demoHref" @click="clearDocInfo">清除文档信息</a>
|
|
15
|
+
<span>{{ docName }}</span>(代码:Application.ActiveWorkbook.Name)
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ref } from 'vue';
|
|
21
|
+
const putCellValue = () => {
|
|
22
|
+
const activeCell = Application.ActiveCell;
|
|
23
|
+
if (activeCell) {
|
|
24
|
+
activeCell.Formula = 'Hello, uudev!';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var docName = ref('');
|
|
29
|
+
const getDocInfo=() => {
|
|
30
|
+
const doc = Application.ActiveWorkbook
|
|
31
|
+
if (doc) {
|
|
32
|
+
docName.value = `文档名称: ${doc.Name}`;
|
|
33
|
+
const info = `文档名称: ${doc.Name}\n文档路径: ${doc.FullName}`;
|
|
34
|
+
console.log(info);
|
|
35
|
+
} else {
|
|
36
|
+
docName.value = '';
|
|
37
|
+
alert('没有打开的文档');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const clearDocInfo = () => {
|
|
41
|
+
docName.value = '';
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
<style scoped>
|
|
45
|
+
.demoHref {
|
|
46
|
+
color: #42b983;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
margin-right: 50px;
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
2
|
+
|
|
3
|
+
const router = createRouter({
|
|
4
|
+
history: createWebHashHistory(import.meta.env.BASE_URL),
|
|
5
|
+
routes: [
|
|
6
|
+
{
|
|
7
|
+
path: '/',
|
|
8
|
+
name: 'home',
|
|
9
|
+
redirect: 'demo'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
path: '/demo',
|
|
13
|
+
name: 'demo',
|
|
14
|
+
component: () => import('../demo/demo.vue')
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export default router
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<h1>欢迎使用uudev系列工具</h1>
|
|
5
|
+
<p>
|
|
6
|
+
uudev是一个基于TypeScript的Office开发工具集,提供了丰富的类型定义和开发支持,帮助开发者更高效地构建Office插件和应用。
|
|
7
|
+
</p>
|
|
8
|
+
<h3>Ppt运行示例</h3>
|
|
9
|
+
<div>
|
|
10
|
+
<a class="demoHref" @click="putShapeValue">给形状赋值</a>(代码:Application.ActivePresentation.Slides.Item(1).Shapes.Item(1).TextFrame.TextRange.Text = 'Hello, uudev!')
|
|
11
|
+
</div>
|
|
12
|
+
<div>
|
|
13
|
+
<a class="demoHref" @click="getDocInfo">取文档信息</a>
|
|
14
|
+
<a class="demoHref" @click="clearDocInfo">清除文档信息</a>
|
|
15
|
+
<span>{{ docName }}</span>(代码:Application.ActivePresentation.Name)
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ref } from 'vue';
|
|
21
|
+
const putShapeValue = () => {
|
|
22
|
+
let doc = Application.ActivePresentation
|
|
23
|
+
if (doc){
|
|
24
|
+
if (doc.Slides.Item(1)){
|
|
25
|
+
let shapes = doc.Slides.Item(1).Shapes
|
|
26
|
+
let shape = null
|
|
27
|
+
if (shapes.Count > 0){
|
|
28
|
+
shape = shapes.Item(1)
|
|
29
|
+
}else{
|
|
30
|
+
shape = shapes.AddTextbox(3, 25,30,350,350)
|
|
31
|
+
}
|
|
32
|
+
if (shape){
|
|
33
|
+
shape.TextFrame.TextRange.Text="Hello, uudev!" + shape.TextFrame.TextRange.Text
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var docName = ref('');
|
|
41
|
+
const getDocInfo=() => {
|
|
42
|
+
const doc = Application.ActivePresentation;
|
|
43
|
+
if (doc) {
|
|
44
|
+
docName.value = `文档名称: ${doc.Name}`;
|
|
45
|
+
const info = `文档名称: ${doc.Name}\n文档路径: ${doc.FullName}`;
|
|
46
|
+
console.log(info);
|
|
47
|
+
} else {
|
|
48
|
+
docName.value = '';
|
|
49
|
+
alert('没有打开的文档');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const clearDocInfo = () => {
|
|
53
|
+
docName.value = '';
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
<style scoped>
|
|
57
|
+
.demoHref {
|
|
58
|
+
color: #42b983;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
text-decoration: underline;
|
|
61
|
+
margin-right: 50px;
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
2
|
+
|
|
3
|
+
const router = createRouter({
|
|
4
|
+
history: createWebHashHistory(import.meta.env.BASE_URL),
|
|
5
|
+
routes: [
|
|
6
|
+
{
|
|
7
|
+
path: '/',
|
|
8
|
+
name: 'home',
|
|
9
|
+
redirect: 'demo'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
path: '/demo',
|
|
13
|
+
name: 'demo',
|
|
14
|
+
component: () => import('../demo/demo.vue')
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export default router
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<h1>欢迎使用uudev系列工具</h1>
|
|
5
|
+
<p>
|
|
6
|
+
uudev是一个基于TypeScript的Office开发工具集,提供了丰富的类型定义和开发支持,帮助开发者更高效地构建Office插件和应用。
|
|
7
|
+
</p>
|
|
8
|
+
<h3>Word运行示例</h3>
|
|
9
|
+
<div>
|
|
10
|
+
<a class="demoHref" @click="putRangeValue">给文档开头赋值</a>(代码:Application.ActiveDocument.Range(0).Text = "Hello, uudev!')
|
|
11
|
+
</div>
|
|
12
|
+
<div>
|
|
13
|
+
<a class="demoHref" @click="getDocInfo">取文档信息</a>
|
|
14
|
+
<a class="demoHref" @click="clearDocInfo">清除文档信息</a>
|
|
15
|
+
<span>{{ docName }}</span>(代码:Application.ActiveDocument.Name)
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ref } from 'vue';
|
|
21
|
+
const putRangeValue = () => {
|
|
22
|
+
const doc = Application.ActiveDocument;
|
|
23
|
+
if (doc) {
|
|
24
|
+
doc.Range(0, 0).Text = "Hello, uudev!";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var docName = ref('');
|
|
29
|
+
const getDocInfo=() => {
|
|
30
|
+
const doc = Application.ActiveDocument
|
|
31
|
+
if (doc) {
|
|
32
|
+
docName.value = `文档名称: ${doc.Name}`;
|
|
33
|
+
const info = `文档名称: ${doc.Name}\n文档路径: ${doc.FullName}`;
|
|
34
|
+
console.log(info);
|
|
35
|
+
} else {
|
|
36
|
+
docName.value = '';
|
|
37
|
+
alert('没有打开的文档');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const clearDocInfo = () => {
|
|
41
|
+
docName.value = '';
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
<style scoped>
|
|
45
|
+
.demoHref {
|
|
46
|
+
color: #42b983;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
margin-right: 50px;
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
2
|
+
|
|
3
|
+
const router = createRouter({
|
|
4
|
+
history: createWebHashHistory(import.meta.env.BASE_URL),
|
|
5
|
+
routes: [
|
|
6
|
+
{
|
|
7
|
+
path: '/',
|
|
8
|
+
name: 'home',
|
|
9
|
+
redirect: 'demo'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
path: '/demo',
|
|
13
|
+
name: 'demo',
|
|
14
|
+
component: () => import('../demo/demo.vue')
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export default router
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { fileURLToPath, URL } from 'node:url'
|
|
2
2
|
|
|
3
3
|
import { defineConfig } from 'vite'
|
|
4
|
-
import vue from '
|
|
5
|
-
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
4
|
+
import vue from './node_modules/@vitejs/plugin-vue'
|
|
6
5
|
|
|
7
6
|
// https://vite.dev/config/
|
|
8
7
|
export default defineConfig({
|
|
8
|
+
base: './',
|
|
9
9
|
plugins: [
|
|
10
10
|
vue(),
|
|
11
|
-
vueDevTools(),
|
|
12
11
|
],
|
|
13
12
|
server: {
|
|
14
13
|
port: 41260,
|
|
15
|
-
strictPort:
|
|
14
|
+
strictPort: false,
|
|
16
15
|
open: false,
|
|
17
16
|
host: '0.0.0.0'
|
|
18
17
|
},
|