uudev 1.1.9 → 1.2.0

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.
@@ -0,0 +1,11 @@
1
+
2
+ <template>
3
+ <RouterView />
4
+ </template>
5
+
6
+ <script setup lang="ts">
7
+ import { RouterView } from 'vue-router'
8
+ </script>
9
+ <style scoped>
10
+
11
+ </style>
@@ -0,0 +1,128 @@
1
+
2
+ <template>
3
+ <h1>欢迎使用uudev开发工具</h1>
4
+ <p>
5
+ uudev是一个基于Office的web化开发工具集,提供了从开发、调试到部署的一站式解决方案,帮助开发者更高效地构建Office的web化插件应用。
6
+ </p>
7
+ <p style="font-weight: bold;">
8
+ 这是一个html页面,点击本页面后,按<span style="border: 2px solid;">F11</span>可以打开调试工具。
9
+ </p>
10
+ <h2>Access示例</h2>
11
+ <div>
12
+ <a class="demoHref" @click="getDbInfo">取数据库信息</a>
13
+ <a class="demoHref" @click="clearDbInfo">清除</a>
14
+ <span style="color: red;">{{ dbInfo }}</span>(代码:Application.CurrentProject.Name / Path)
15
+ </div>
16
+ <div>
17
+ <a class="demoHref" @click="openTable">打开表</a>(代码:DoCmd.OpenTable("表名", acViewNormal))
18
+ </div>
19
+ <div>
20
+ <a class="demoHref" @click="openForm">打开窗体</a>(代码:DoCmd.OpenForm("窗体名", acNormal))
21
+ </div>
22
+ <div>
23
+ <a class="demoHref" @click="countRecords">统计记录数</a>
24
+ <a class="demoHref" @click="clearCount">清除</a>
25
+ <span style="color: red;">{{ countInfo }}</span>(代码:DCount("*", "表名"))
26
+ </div>
27
+ <div>
28
+ <a class="demoHref" @click="runQuery">运行查询</a>(代码:DoCmd.OpenQuery("查询名"))
29
+ </div>
30
+ <div>
31
+ <a class="demoHref" @click="setStatusText">设置状态栏文字</a>(代码:SysCmd(acSysCmdSetStatus, "文字"))
32
+ </div>
33
+ <div>
34
+ <a class="demoHref" @click="clearStatusText">清除状态栏</a>(代码:SysCmd(acSysCmdClearStatus))
35
+ </div>
36
+ </template>
37
+
38
+ <script setup lang="ts">
39
+ import { ref } from 'vue';
40
+
41
+ defineOptions({
42
+ name: 'DemoPage',
43
+ });
44
+
45
+ const dbInfo = ref('');
46
+ const countInfo = ref('');
47
+
48
+ const getDbInfo = () => {
49
+ const prj = Application.CurrentProject;
50
+ if (prj) {
51
+ dbInfo.value = `数据库名称: ${prj.Name},路径: ${prj.Path}`;
52
+ const info = `数据库名称: ${prj.Name}\n数据库路径: ${prj.Path}`;
53
+ console.log(info);
54
+ } else {
55
+ dbInfo.value = '';
56
+ alert('没有打开的数据库');
57
+ }
58
+ }
59
+
60
+ const clearDbInfo = () => {
61
+ dbInfo.value = '';
62
+ }
63
+
64
+ const openTable = () => {
65
+ // 打开"员工"表(如果不存在该表,Access会提示错误)
66
+ // 开发者可将表名替换为当前数据库中实际存在的表名
67
+ try {
68
+ Application.DoCmd.OpenTable("员工", acViewNormal);
69
+ } catch (e) {
70
+ alert('打开表失败,请确认数据库中是否存在"员工"表,或替换为实际表名');
71
+ console.error(e);
72
+ }
73
+ }
74
+
75
+ const openForm = () => {
76
+ // 打开"员工列表"窗体(如果不存在该窗体,Access会提示错误)
77
+ // 开发者可将窗体名替换为当前数据库中实际存在的窗体名
78
+ try {
79
+ Application.DoCmd.OpenForm("员工列表", acNormal);
80
+ } catch (e) {
81
+ alert('打开窗体失败,请确认数据库中是否存在"员工列表"窗体,或替换为实际窗体名');
82
+ console.error(e);
83
+ }
84
+ }
85
+
86
+ const countRecords = () => {
87
+ // 统计"员工"表的记录数(如果表不存在则返回0)
88
+ try {
89
+ const count = Application.DCount("*", "员工");
90
+ countInfo.value = `"员工"表共有 ${count} 条记录`;
91
+ } catch (e) {
92
+ countInfo.value = '统计失败,请确认表名是否正确';
93
+ console.error(e);
94
+ }
95
+ }
96
+
97
+ const clearCount = () => {
98
+ countInfo.value = '';
99
+ }
100
+
101
+ const runQuery = () => {
102
+ // 运行"员工查询"(如果不存在该查询,Access会提示错误)
103
+ // 开发者可将查询名替换为当前数据库中实际存在的查询名
104
+ try {
105
+ Application.DoCmd.OpenQuery("员工查询", acViewNormal, acReadOnly);
106
+ } catch (e) {
107
+ alert('运行查询失败,请确认数据库中是否存在"员工查询",或替换为实际查询名');
108
+ console.error(e);
109
+ }
110
+ }
111
+
112
+ const setStatusText = () => {
113
+ Application.SysCmd(acSysCmdSetStatus, "uudev Access 示例正在运行...");
114
+ }
115
+
116
+ const clearStatusText = () => {
117
+ Application.SysCmd(acSysCmdClearStatus);
118
+ }
119
+
120
+ </script>
121
+ <style scoped>
122
+ .demoHref {
123
+ color: #42b983;
124
+ cursor: pointer;
125
+ text-decoration: underline;
126
+ margin-right: 50px;
127
+ }
128
+ </style>
@@ -0,0 +1,9 @@
1
+ import { createApp } from 'vue'
2
+ import App from './App.vue'
3
+ import router from './router'
4
+
5
+ const app = createApp(App)
6
+
7
+ app.use(router)
8
+
9
+ app.mount('#app')
@@ -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