af-mobile-client-vue3 1.5.63 → 1.5.64

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/compress.js CHANGED
@@ -1,36 +1,36 @@
1
- import fs from 'node:fs'
2
- import path from 'node:path'
3
- import { fileURLToPath } from 'node:url'
4
- import * as tar from 'tar'
5
-
6
- // 当前文件所在目录
7
- const __filename = fileURLToPath(import.meta.url)
8
- const __dirname = path.dirname(__filename)
9
-
10
- // 压缩源目录名(即 build 后生成的目录名)
11
- const outputName = `dist_af-library-mobile-web`
12
-
13
- // 源目录路径
14
- const cwd = path.join(__dirname, 'dist', outputName)
15
-
16
- // 输出 tar.gz 文件路径
17
- const outputPath = path.join(__dirname, 'dist', `${outputName}.tar.gz`)
18
-
19
- if (!fs.existsSync(cwd)) {
20
- console.error('❌ 目录不存在:', cwd)
21
- // eslint-disable-next-line node/prefer-global/process
22
- process.exit(1)
23
- }
24
-
25
- tar.c(
26
- {
27
- gzip: true,
28
- file: outputPath,
29
- cwd,
30
- },
31
- ['.'],
32
- ).then(() => {
33
- console.log(`✅ 压缩完成: ${outputPath}`)
34
- }).catch((err) => {
35
- console.error('❌ 压缩失败:', err)
36
- })
1
+ import fs from 'node:fs'
2
+ import path from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+ import * as tar from 'tar'
5
+
6
+ // 当前文件所在目录
7
+ const __filename = fileURLToPath(import.meta.url)
8
+ const __dirname = path.dirname(__filename)
9
+
10
+ // 压缩源目录名(即 build 后生成的目录名)
11
+ const outputName = `dist_af-library-mobile-web`
12
+
13
+ // 源目录路径
14
+ const cwd = path.join(__dirname, 'dist', outputName)
15
+
16
+ // 输出 tar.gz 文件路径
17
+ const outputPath = path.join(__dirname, 'dist', `${outputName}.tar.gz`)
18
+
19
+ if (!fs.existsSync(cwd)) {
20
+ console.error('❌ 目录不存在:', cwd)
21
+ // eslint-disable-next-line node/prefer-global/process
22
+ process.exit(1)
23
+ }
24
+
25
+ tar.c(
26
+ {
27
+ gzip: true,
28
+ file: outputPath,
29
+ cwd,
30
+ },
31
+ ['.'],
32
+ ).then(() => {
33
+ console.log(`✅ 压缩完成: ${outputPath}`)
34
+ }).catch((err) => {
35
+ console.error('❌ 压缩失败:', err)
36
+ })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.5.63",
4
+ "version": "1.5.64",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  // import cameraIcon from '@af-mobile-client-vue3/assets/img/component/camera.png'
3
3
  import { deleteFile, upload } from '@af-mobile-client-vue3/services/api/common'
4
+ import { detectEnvironment } from '@af-mobile-client-vue3/utils/environment'
4
5
  import { mobileUtil } from '@af-mobile-client-vue3/utils/mobileUtil'
5
6
  import { formatNow } from '@af-mobile-client-vue3/utils/timeUtil'
6
7
  import {
@@ -36,9 +37,8 @@ const emit = defineEmits(['updateFileList', 'updateAllFileList'])
36
37
  const imageList = ref<Array<any>>(props.imageList ?? [])
37
38
 
38
39
  const parentData: any = inject('provideParent')
39
- // 浏览器模式:隐藏的文件输入(选择 / 拍照)
40
+ // 浏览器 / 微信内 H5:统一用隐藏 file input(与单独 camera input 行为等价,均为系统选图)
40
41
  const fileInputRef = ref<HTMLInputElement | undefined>()
41
- const cameraInputRef = ref<HTMLInputElement | undefined>()
42
42
 
43
43
  function openBrowserFilePicker() {
44
44
  if (fileInputRef.value) {
@@ -47,13 +47,6 @@ function openBrowserFilePicker() {
47
47
  }
48
48
  }
49
49
 
50
- function openBrowserCameraPicker() {
51
- if (cameraInputRef.value) {
52
- cameraInputRef.value.value = ''
53
- cameraInputRef.value.click()
54
- }
55
- }
56
-
57
50
  function emitUpdatesAfterChange() {
58
51
  // 新增:对外抛出完整与ID列表
59
52
  (emit as any)('updateAllFileList', imageList.value.filter(item => item.status === 'done').map(item => item))
@@ -378,6 +371,12 @@ const actionOptions = [
378
371
  function handleUploadAreaClick() {
379
372
  if (props.readonly)
380
373
  return
374
+ const env = detectEnvironment()
375
+ // 微信内:直接走浏览器式文件选择,不弹出拍照/上传菜单
376
+ if (env.isWechat || env.isMiniprogram) {
377
+ openBrowserFilePicker()
378
+ return
379
+ }
381
380
  if (props.attr?.uploadImage) {
382
381
  showActionSheet.value = true
383
382
  }
@@ -389,29 +388,21 @@ function handleUploadAreaClick() {
389
388
  function handleActionSelect(option: any) {
390
389
  showActionSheet.value = false
391
390
  if (option.key === 'camera') {
392
- if (import.meta.env.VITE_APP_WEI_XIN) {
393
- openBrowserCameraPicker()
394
- return
395
- }
396
391
  triggerCamera()
397
392
  }
398
393
  else if (option.key === 'file') {
399
- if (import.meta.env.VITE_APP_WEI_XIN) {
400
- openBrowserFilePicker()
401
- return
402
- }
394
+ // 手机文件上传
403
395
  mobileUtil.execute({
404
396
  funcName: 'photoAlbum',
405
397
  param: {},
406
398
  callbackFunc: (result: any) => {
407
- console.log('>>>> result: ', result)
408
399
  if (result.status === 'success') {
409
400
  result.data?.photos.forEach((photo: any) => {
410
401
  handlePhotoUpload(photo)
411
402
  })
412
403
  }
413
404
  else {
414
- // 浏览器模式:打开文件选择
405
+ // 手机文件选择失败,则走浏览器式文件选择
415
406
  openBrowserFilePicker()
416
407
  }
417
408
  },
@@ -441,7 +432,7 @@ defineExpose({
441
432
 
442
433
  <template>
443
434
  <div class="uploader-container">
444
- <!-- 浏览器模式隐藏输入:文件选择 -->
435
+ <!-- 浏览器 / 微信 H5:统一隐藏文件选择(多选图片) -->
445
436
  <input
446
437
  ref="fileInputRef"
447
438
  type="file"
@@ -450,15 +441,6 @@ defineExpose({
450
441
  style="display:none"
451
442
  @change="(e:any) => handleBrowserFiles(e.target.files)"
452
443
  >
453
- <!-- 浏览器模式隐藏输入:拍照(相机) -->
454
- <input
455
- ref="cameraInputRef"
456
- type="file"
457
- accept="image/*"
458
- capture="environment"
459
- style="display:none"
460
- @change="(e:any) => handleBrowserFiles(e.target.files)"
461
- >
462
444
  <van-uploader
463
445
  ref="uploaderRef"
464
446
  v-model="imageList"
@@ -1,168 +1,168 @@
1
- <script setup lang="ts">
2
- import {
3
- Field as VanField,
4
- Picker as VanPicker,
5
- Popup as VanPopup,
6
- Search as VanSearch,
7
- } from 'vant'
8
- import { computed, inject, onMounted, ref } from 'vue'
9
-
10
- const workflowHandleWrap: any = inject('workflowHandleWrap')
11
-
12
- const showPicker = ref(false)
13
-
14
- const showMultiplePicker = ref(false)
15
-
16
- const branchChargePersons = ref({})
17
-
18
- const isInit = ref(false)
19
-
20
- // 用于 filterOption 的本地输入缓存(vant 不自带 filter)
21
- const filterKeyword = ref('')
22
-
23
- const customFieldName = {
24
- text: 'label',
25
- value: 'value',
26
- }
27
-
28
- const selectedNode = ref(undefined)
29
-
30
- const selectedOptions = computed(() => {
31
- if (!selectedNode.value) {
32
- return []
33
- }
34
- return filterOptions(selectedNode.value.chargePersonOptions)
35
- })
36
-
37
- onMounted(() => {
38
- isInit.value = false
39
- if (workflowHandleWrap.branchNodes.value) {
40
- // 初始化初始值
41
- for (const node of workflowHandleWrap.branchNodes.value) {
42
- branchChargePersons.value[node.stepId] = {
43
- handler: '',
44
- handlerId: '',
45
- }
46
- }
47
- }
48
- isInit.value = true
49
- })
50
-
51
- function setBranchPersonValue(stepId, value, options, selectedOptions) {
52
- if (!stepId)
53
- return
54
- if (!workflowHandleWrap.branchChargePersons.value) {
55
- workflowHandleWrap.branchChargePersons.value = {}
56
- }
57
- if (!workflowHandleWrap.branchChargePersons.value[stepId]) {
58
- workflowHandleWrap.branchChargePersons.value[stepId] = {}
59
- }
60
- if (workflowHandleWrap.branchChargePersons.value[stepId]) {
61
- branchChargePersons.value[stepId] = {
62
- handler: options.find(item => item.value === value)?.label,
63
- handlerId: value,
64
- }
65
- Object.assign(workflowHandleWrap.branchChargePersons.value[stepId], branchChargePersons.value[stepId])
66
- }
67
- workflowHandleWrap.checkedNextStepPerson.value = selectedOptions[0].value
68
- workflowHandleWrap.checkedNextStepPersonName.value = selectedOptions[0].label
69
- }
70
-
71
- function getBranchSelectionLabel() {
72
- if (workflowHandleWrap.needMultipleBranchSelection.value) {
73
- return '分支处理人'
74
- }
75
- else if (workflowHandleWrap.calculatedTargetNode.value) {
76
- return `${workflowHandleWrap.getStepNameByStepId(workflowHandleWrap.calculatedTargetNode.value)}处理人`
77
- }
78
- else {
79
- return '处理人'
80
- }
81
- }
82
-
83
- // vant 没有原生 filter-option,因此需要本地筛选
84
- function filterOptions(options) {
85
- if (!filterKeyword.value)
86
- return options
87
- return options.filter(option => option.label.toLowerCase().includes(filterKeyword.value.toLowerCase()))
88
- }
89
-
90
- // 搜索回调函数
91
- function search(val: string) {
92
- filterKeyword.value = val || ''
93
- }
94
- </script>
95
-
96
- <template>
97
- <div v-if="workflowHandleWrap.isNeedSelectPerson.value && isInit">
98
- <!-- 多分支选择 -->
99
- <template v-if="workflowHandleWrap.needMultipleBranchSelection.value && workflowHandleWrap.branchNodes.value.length > 0">
100
- <template v-for="node in workflowHandleWrap.branchNodes.value" :key="node.stepId">
101
- <VanField
102
- v-model="branchChargePersons[node.stepId].handler"
103
- :label="`${node.stepName}处理人`"
104
- is-link
105
- clickable
106
- required
107
- placeholder="请选择处理人"
108
- @click="selectedNode = node; showMultiplePicker = true;"
109
- />
110
- </template>
111
- <VanPopup v-model:show="showMultiplePicker" position="bottom">
112
- <!-- 搜索框 -->
113
- <VanSearch
114
- v-model="filterKeyword"
115
- placeholder="搜索"
116
- @clear="() => search('')"
117
- @update:model-value="search"
118
- />
119
- <VanPicker
120
- :columns="selectedOptions"
121
- :columns-field-names="customFieldName"
122
- value-key="label"
123
- @confirm="(val) => {
124
- setBranchPersonValue(selectedNode.stepId, val.selectedValues[0], selectedNode.chargePersonOptions, val.selectedOptions)
125
- showMultiplePicker = false;
126
- }"
127
- @cancel="showMultiplePicker = false;"
128
- />
129
- </VanPopup>
130
- </template>
131
-
132
- <!-- 单分支选择 -->
133
- <template v-else>
134
- <VanField
135
- v-model="workflowHandleWrap.checkedNextStepPersonName.value"
136
- :label="getBranchSelectionLabel()"
137
- label-width="auto"
138
- is-link
139
- clickable
140
- required
141
- placeholder="请选择处理人"
142
- @click="showPicker = true"
143
- />
144
- <VanPopup v-model:show="showPicker" position="bottom">
145
- <!-- 搜索框 -->
146
- <VanSearch
147
- v-model="filterKeyword"
148
- placeholder="搜索"
149
- @clear="() => search('')"
150
- @update:model-value="search"
151
- />
152
- <VanPicker
153
- :columns="filterOptions(workflowHandleWrap.nextStepPersonOptions.value)"
154
- :columns-field-names="customFieldName"
155
- @confirm="(val) => {
156
- setBranchPersonValue(workflowHandleWrap.calculatedTargetNode.value, val.selectedValues[0], workflowHandleWrap.nextStepPersonOptions.value, val.selectedOptions)
157
- showPicker = false;
158
- }"
159
- @cancel="showPicker = false;"
160
- />
161
- </VanPopup>
162
- </template>
163
- </div>
164
- </template>
165
-
166
- <style scoped>
167
- /* 保持你的样式或根据 vant 移动端自行优化 */
168
- </style>
1
+ <script setup lang="ts">
2
+ import {
3
+ Field as VanField,
4
+ Picker as VanPicker,
5
+ Popup as VanPopup,
6
+ Search as VanSearch,
7
+ } from 'vant'
8
+ import { computed, inject, onMounted, ref } from 'vue'
9
+
10
+ const workflowHandleWrap: any = inject('workflowHandleWrap')
11
+
12
+ const showPicker = ref(false)
13
+
14
+ const showMultiplePicker = ref(false)
15
+
16
+ const branchChargePersons = ref({})
17
+
18
+ const isInit = ref(false)
19
+
20
+ // 用于 filterOption 的本地输入缓存(vant 不自带 filter)
21
+ const filterKeyword = ref('')
22
+
23
+ const customFieldName = {
24
+ text: 'label',
25
+ value: 'value',
26
+ }
27
+
28
+ const selectedNode = ref(undefined)
29
+
30
+ const selectedOptions = computed(() => {
31
+ if (!selectedNode.value) {
32
+ return []
33
+ }
34
+ return filterOptions(selectedNode.value.chargePersonOptions)
35
+ })
36
+
37
+ onMounted(() => {
38
+ isInit.value = false
39
+ if (workflowHandleWrap.branchNodes.value) {
40
+ // 初始化初始值
41
+ for (const node of workflowHandleWrap.branchNodes.value) {
42
+ branchChargePersons.value[node.stepId] = {
43
+ handler: '',
44
+ handlerId: '',
45
+ }
46
+ }
47
+ }
48
+ isInit.value = true
49
+ })
50
+
51
+ function setBranchPersonValue(stepId, value, options, selectedOptions) {
52
+ if (!stepId)
53
+ return
54
+ if (!workflowHandleWrap.branchChargePersons.value) {
55
+ workflowHandleWrap.branchChargePersons.value = {}
56
+ }
57
+ if (!workflowHandleWrap.branchChargePersons.value[stepId]) {
58
+ workflowHandleWrap.branchChargePersons.value[stepId] = {}
59
+ }
60
+ if (workflowHandleWrap.branchChargePersons.value[stepId]) {
61
+ branchChargePersons.value[stepId] = {
62
+ handler: options.find(item => item.value === value)?.label,
63
+ handlerId: value,
64
+ }
65
+ Object.assign(workflowHandleWrap.branchChargePersons.value[stepId], branchChargePersons.value[stepId])
66
+ }
67
+ workflowHandleWrap.checkedNextStepPerson.value = selectedOptions[0].value
68
+ workflowHandleWrap.checkedNextStepPersonName.value = selectedOptions[0].label
69
+ }
70
+
71
+ function getBranchSelectionLabel() {
72
+ if (workflowHandleWrap.needMultipleBranchSelection.value) {
73
+ return '分支处理人'
74
+ }
75
+ else if (workflowHandleWrap.calculatedTargetNode.value) {
76
+ return `${workflowHandleWrap.getStepNameByStepId(workflowHandleWrap.calculatedTargetNode.value)}处理人`
77
+ }
78
+ else {
79
+ return '处理人'
80
+ }
81
+ }
82
+
83
+ // vant 没有原生 filter-option,因此需要本地筛选
84
+ function filterOptions(options) {
85
+ if (!filterKeyword.value)
86
+ return options
87
+ return options.filter(option => option.label.toLowerCase().includes(filterKeyword.value.toLowerCase()))
88
+ }
89
+
90
+ // 搜索回调函数
91
+ function search(val: string) {
92
+ filterKeyword.value = val || ''
93
+ }
94
+ </script>
95
+
96
+ <template>
97
+ <div v-if="workflowHandleWrap.isNeedSelectPerson.value && isInit">
98
+ <!-- 多分支选择 -->
99
+ <template v-if="workflowHandleWrap.needMultipleBranchSelection.value && workflowHandleWrap.branchNodes.value.length > 0">
100
+ <template v-for="node in workflowHandleWrap.branchNodes.value" :key="node.stepId">
101
+ <VanField
102
+ v-model="branchChargePersons[node.stepId].handler"
103
+ :label="`${node.stepName}处理人`"
104
+ is-link
105
+ clickable
106
+ required
107
+ placeholder="请选择处理人"
108
+ @click="selectedNode = node; showMultiplePicker = true;"
109
+ />
110
+ </template>
111
+ <VanPopup v-model:show="showMultiplePicker" position="bottom">
112
+ <!-- 搜索框 -->
113
+ <VanSearch
114
+ v-model="filterKeyword"
115
+ placeholder="搜索"
116
+ @clear="() => search('')"
117
+ @update:model-value="search"
118
+ />
119
+ <VanPicker
120
+ :columns="selectedOptions"
121
+ :columns-field-names="customFieldName"
122
+ value-key="label"
123
+ @confirm="(val) => {
124
+ setBranchPersonValue(selectedNode.stepId, val.selectedValues[0], selectedNode.chargePersonOptions, val.selectedOptions)
125
+ showMultiplePicker = false;
126
+ }"
127
+ @cancel="showMultiplePicker = false;"
128
+ />
129
+ </VanPopup>
130
+ </template>
131
+
132
+ <!-- 单分支选择 -->
133
+ <template v-else>
134
+ <VanField
135
+ v-model="workflowHandleWrap.checkedNextStepPersonName.value"
136
+ :label="getBranchSelectionLabel()"
137
+ label-width="auto"
138
+ is-link
139
+ clickable
140
+ required
141
+ placeholder="请选择处理人"
142
+ @click="showPicker = true"
143
+ />
144
+ <VanPopup v-model:show="showPicker" position="bottom">
145
+ <!-- 搜索框 -->
146
+ <VanSearch
147
+ v-model="filterKeyword"
148
+ placeholder="搜索"
149
+ @clear="() => search('')"
150
+ @update:model-value="search"
151
+ />
152
+ <VanPicker
153
+ :columns="filterOptions(workflowHandleWrap.nextStepPersonOptions.value)"
154
+ :columns-field-names="customFieldName"
155
+ @confirm="(val) => {
156
+ setBranchPersonValue(workflowHandleWrap.calculatedTargetNode.value, val.selectedValues[0], workflowHandleWrap.nextStepPersonOptions.value, val.selectedOptions)
157
+ showPicker = false;
158
+ }"
159
+ @cancel="showPicker = false;"
160
+ />
161
+ </VanPopup>
162
+ </template>
163
+ </div>
164
+ </template>
165
+
166
+ <style scoped>
167
+ /* 保持你的样式或根据 vant 移动端自行优化 */
168
+ </style>
@@ -1,88 +1,88 @@
1
- import { defineStore } from 'pinia'
2
- import { ref } from 'vue'
3
-
4
- export interface StepToolsInfo {
5
- workflowId: string
6
- stepDefines: any
7
- formData: any
8
- currentStepData: any
9
- readOnly: boolean
10
- callbackFunction: Function
11
- businessData: any
12
- }
13
-
14
- export const useStepStore = defineStore('apply-step', () => {
15
- const stepState = ref<StepToolsInfo>({
16
- workflowId: '0',
17
- stepDefines: undefined,
18
- formData: undefined,
19
- currentStepData: undefined,
20
- readOnly: false,
21
- callbackFunction: () => {
22
- return true
23
- },
24
- businessData: undefined,
25
- })
26
- const getWorkflowId = () => {
27
- return stepState.value.workflowId || '0'
28
- }
29
- const getStepDefines = () => {
30
- return stepState.value.stepDefines || {}
31
- }
32
- const getFormData = () => {
33
- return stepState.value.formData || {}
34
- }
35
- const getReadOnly = () => {
36
- return stepState.value.readOnly || false
37
- }
38
- const getCurrentStepData = () => {
39
- return stepState.value.currentStepData || {}
40
- }
41
- const getCallbackFunction = () => {
42
- return stepState.value.callbackFunction || undefined
43
- }
44
- const getBusinessData = () => {
45
- return stepState.value.businessData || {}
46
- }
47
- const setWorkflowId = (workflowId: string) => {
48
- stepState.value.workflowId = workflowId
49
- }
50
- const setStepDefines = (stepDefines: any) => {
51
- stepState.value.stepDefines = stepDefines
52
- }
53
- const setFormData = (formData: any) => {
54
- stepState.value.formData = formData
55
- }
56
- const setCurrentStepData = (currentStepData: any) => {
57
- stepState.value.currentStepData = currentStepData
58
- }
59
- const setReadOnly = (readOnly: boolean) => {
60
- stepState.value.readOnly = readOnly
61
- }
62
- const setCallbackFunction = (callbackFunction: Function) => {
63
- stepState.value.callbackFunction = callbackFunction
64
- }
65
- const setBusinessData = (businessData: any) => {
66
- stepState.value.businessData = businessData
67
- }
68
-
69
- return {
70
- stepState,
71
- getWorkflowId,
72
- getStepDefines,
73
- getFormData,
74
- getCurrentStepData,
75
- getReadOnly,
76
- getCallbackFunction,
77
- getBusinessData,
78
- setWorkflowId,
79
- setStepDefines,
80
- setFormData,
81
- setCurrentStepData,
82
- setReadOnly,
83
- setCallbackFunction,
84
- setBusinessData,
85
- }
86
- })
87
-
88
- export default useStepStore
1
+ import { defineStore } from 'pinia'
2
+ import { ref } from 'vue'
3
+
4
+ export interface StepToolsInfo {
5
+ workflowId: string
6
+ stepDefines: any
7
+ formData: any
8
+ currentStepData: any
9
+ readOnly: boolean
10
+ callbackFunction: Function
11
+ businessData: any
12
+ }
13
+
14
+ export const useStepStore = defineStore('apply-step', () => {
15
+ const stepState = ref<StepToolsInfo>({
16
+ workflowId: '0',
17
+ stepDefines: undefined,
18
+ formData: undefined,
19
+ currentStepData: undefined,
20
+ readOnly: false,
21
+ callbackFunction: () => {
22
+ return true
23
+ },
24
+ businessData: undefined,
25
+ })
26
+ const getWorkflowId = () => {
27
+ return stepState.value.workflowId || '0'
28
+ }
29
+ const getStepDefines = () => {
30
+ return stepState.value.stepDefines || {}
31
+ }
32
+ const getFormData = () => {
33
+ return stepState.value.formData || {}
34
+ }
35
+ const getReadOnly = () => {
36
+ return stepState.value.readOnly || false
37
+ }
38
+ const getCurrentStepData = () => {
39
+ return stepState.value.currentStepData || {}
40
+ }
41
+ const getCallbackFunction = () => {
42
+ return stepState.value.callbackFunction || undefined
43
+ }
44
+ const getBusinessData = () => {
45
+ return stepState.value.businessData || {}
46
+ }
47
+ const setWorkflowId = (workflowId: string) => {
48
+ stepState.value.workflowId = workflowId
49
+ }
50
+ const setStepDefines = (stepDefines: any) => {
51
+ stepState.value.stepDefines = stepDefines
52
+ }
53
+ const setFormData = (formData: any) => {
54
+ stepState.value.formData = formData
55
+ }
56
+ const setCurrentStepData = (currentStepData: any) => {
57
+ stepState.value.currentStepData = currentStepData
58
+ }
59
+ const setReadOnly = (readOnly: boolean) => {
60
+ stepState.value.readOnly = readOnly
61
+ }
62
+ const setCallbackFunction = (callbackFunction: Function) => {
63
+ stepState.value.callbackFunction = callbackFunction
64
+ }
65
+ const setBusinessData = (businessData: any) => {
66
+ stepState.value.businessData = businessData
67
+ }
68
+
69
+ return {
70
+ stepState,
71
+ getWorkflowId,
72
+ getStepDefines,
73
+ getFormData,
74
+ getCurrentStepData,
75
+ getReadOnly,
76
+ getCallbackFunction,
77
+ getBusinessData,
78
+ setWorkflowId,
79
+ setStepDefines,
80
+ setFormData,
81
+ setCurrentStepData,
82
+ setReadOnly,
83
+ setCallbackFunction,
84
+ setBusinessData,
85
+ }
86
+ })
87
+
88
+ export default useStepStore
@@ -1,31 +1,31 @@
1
- <script setup lang="ts">
2
- import FilePreview from '@af-mobile-client-vue3/components/data/FilePreview/index.vue'
3
- import { onMounted, ref } from 'vue'
4
-
5
- const previewDocType = ref('pdf')
6
- const previewDocUrl = ref('/resource/af-revenue/pdf/e0a35f3414444d009cbce020af2e617d.pdf')
7
-
8
- const filePreviewRef = ref<InstanceType<typeof FilePreview> | null>(null)
9
-
10
- onMounted(() => {
11
- filePreviewRef.value?.init({
12
- path: '/resource/af-revenue/pdf/e0a35f3414444d009cbce020af2e617d.pdf',
13
- })
14
- })
15
- </script>
16
-
17
- <template>
18
- <div>
19
- <FilePreview
20
- ref="filePreviewRef"
21
- :key="`${previewDocType}-${previewDocUrl}`"
22
- class="doc-preview-file"
23
- />
24
- </div>
25
- </template>
26
-
27
- <style scoped lang="less">
28
- .doc-preview-file {
29
- height: 90vh;
30
- }
31
- </style>
1
+ <script setup lang="ts">
2
+ import FilePreview from '@af-mobile-client-vue3/components/data/FilePreview/index.vue'
3
+ import { onMounted, ref } from 'vue'
4
+
5
+ const previewDocType = ref('pdf')
6
+ const previewDocUrl = ref('/resource/af-revenue/pdf/e0a35f3414444d009cbce020af2e617d.pdf')
7
+
8
+ const filePreviewRef = ref<InstanceType<typeof FilePreview> | null>(null)
9
+
10
+ onMounted(() => {
11
+ filePreviewRef.value?.init({
12
+ path: '/resource/af-revenue/pdf/e0a35f3414444d009cbce020af2e617d.pdf',
13
+ })
14
+ })
15
+ </script>
16
+
17
+ <template>
18
+ <div>
19
+ <FilePreview
20
+ ref="filePreviewRef"
21
+ :key="`${previewDocType}-${previewDocUrl}`"
22
+ class="doc-preview-file"
23
+ />
24
+ </div>
25
+ </template>
26
+
27
+ <style scoped lang="less">
28
+ .doc-preview-file {
29
+ height: 90vh;
30
+ }
31
+ </style>
@@ -11,7 +11,7 @@ const workflowId: string = '6149'
11
11
  const stepId: string = '5'
12
12
 
13
13
  // 基础组件引用
14
- const stepDetailBaseRef = ref<InstanceType<typeof StepDetailBase>>()
14
+ const stepDetailBaseRef = ref<InstanceType<typeof StepDetailBase>>()
15
15
  </script>
16
16
 
17
17
  <template>