nbb-component-ui 1.0.9 → 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/index.ts CHANGED
@@ -4,7 +4,7 @@ import {ProcessFlow} from "./src/ProcessFlow";
4
4
  // 定义插件对象,严格标注类型
5
5
  const plugin: Plugin<[]> = {
6
6
  install(app: App) {
7
- app.component('ProcessFlow', ProcessFlow)
7
+ app.component('CmcLinkProcessFlow', ProcessFlow)
8
8
  }
9
9
  }
10
10
  // 支持按需引入
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nbb-component-ui",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "main": "./dist/index.umd.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -4,10 +4,40 @@
4
4
 
5
5
  <script setup lang="ts">
6
6
  import { ElMessage } from 'element-plus'
7
+ import {ref, watch} from "vue";
8
+ import {createProcessInstanceApi} from "@/api/processInstance";
9
+
10
+ const props = defineProps<{
11
+ processInstanceId: string
12
+ request: any
13
+ }>()
14
+
15
+ const id = ref<string>('')
16
+ const processInstanceApi = createProcessInstanceApi(props.request)
17
+
7
18
 
8
19
  const open = () => {
9
20
  ElMessage.success('Hello World!')
10
21
  }
22
+
23
+ const init = (processInstanceId: string) => {
24
+ id.value = processInstanceId
25
+ processInstanceApi.processInstanceId(processInstanceId)
26
+ .then((res: any) => {
27
+ console.log(res)
28
+ })
29
+
30
+ }
31
+
32
+ watch(
33
+ () => props.processInstanceId,
34
+ (newValue) => {
35
+ if (newValue && newValue !== id.value) {
36
+ init(newValue)
37
+ }
38
+ },
39
+ { immediate: true, deep: true }
40
+ )
11
41
  </script>
12
42
 
13
43
  <style>
@@ -0,0 +1,12 @@
1
+ export const createProcessInstanceApi = (request: any) => ({
2
+ getApprovalDetail: async (processInstanceId: any) => {
3
+ return await request.get({
4
+ url: `/system/bpm/process-instance/get-approval-detail`,
5
+ params: {
6
+ processInstanceId
7
+ }
8
+ })
9
+ }
10
+ })
11
+
12
+
package/tsconfig.json CHANGED
@@ -14,7 +14,10 @@
14
14
  "noUnusedParameters": true,
15
15
  "skipLibCheck": true,
16
16
  "declaration": true,
17
- "declarationDir": "dist"
17
+ "declarationDir": "dist",
18
+ "paths": {
19
+ "@/*": ["src/*"]
20
+ }
18
21
  },
19
22
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "index.ts"]
20
23
  }
package/vite.config.js CHANGED
@@ -14,6 +14,12 @@ export default defineConfig({
14
14
  tsconfigPath: './tsconfig.json'
15
15
  })
16
16
  ],
17
+ resolve: {
18
+ // 配置@别名指向src目录
19
+ alias: {
20
+ '@': resolve(__dirname, 'src')
21
+ }
22
+ },
17
23
  build: {
18
24
  lib: {
19
25
  entry: resolve(__dirname, 'index.ts'),