wui-components-v2 1.0.86 → 1.0.88

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.
@@ -4,6 +4,8 @@ import { useRouter } from 'uni-mini-router'
4
4
  import { onLoad } from '@dcloudio/uni-app'
5
5
  import type { ClassEditConfigs, Entities, Fields, Groups, rowActions } from '../../type'
6
6
  import ActionPopup from '../action-popup/action-popup.vue'
7
+ import { actionDataSave } from '../../api/page'
8
+ import { useGlobalToast } from '../../composables/useGlobalToast'
7
9
 
8
10
  defineOptions({
9
11
  name: 'CardBotomButtons',
@@ -18,6 +20,7 @@ const props = defineProps<{
18
20
  ractions?: rowActions[]
19
21
  zpaging?: any
20
22
  }>()
23
+ const toast = useGlobalToast()
21
24
  const pageType = ref('')
22
25
  onLoad((option: any) => {
23
26
  pageType.value = option.type || ''
@@ -52,15 +55,27 @@ function edit() {
52
55
  const actionItem = ref<Groups>()
53
56
  const actionItemShow = ref(false)
54
57
  // 打开action弹框
55
- function action(subitem: rowActions) {
58
+ async function action(subitem: rowActions) {
56
59
  console.log(subitem)
57
- actionItem.value = {
58
- ...props.item,
59
- fields: subitem.writes,
60
- id: subitem.id,
60
+ if (subitem.writes.length) {
61
+ actionItem.value = {
62
+ ...props.item,
63
+ fields: subitem.writes,
64
+ id: subitem.id,
65
+ }
66
+ actionItemShow.value = true
67
+ }
68
+ else {
69
+ try {
70
+ await actionDataSave(subitem.id, props.code, {})
71
+ props.zpaging.reload()
72
+ toast.success({ msg: '操作成功!' })
73
+ }
74
+ catch (error: any) {
75
+ toast.error(error)
76
+ console.log(error)
77
+ }
61
78
  }
62
- actionItemShow.value = true
63
- // router.push(`/pages/edit-page/index?sourceId=${subitem.id}&id=${props.code}&title=${subitem.title}&pageType=`)
64
79
  }
65
80
 
66
81
  // 跳转raction页面
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, defineOptions, defineProps } from 'vue'
3
- import type { Columns, Entities, Fields } from '../../type'
3
+ import type { Columns, Entities } from '../../type'
4
4
  import { downloadFile, formatItemData } from '../../utils'
5
5
  import ControlTypeSupportor from '../../utils/control-type-supportor'
6
6
 
@@ -686,6 +686,7 @@ function handleFileChange(e: any, group: Groups) {
686
686
  <wd-upload
687
687
  v-if="group.batchAddFileField && group.batchAddFileField.extControlType === 'file'"
688
688
  :multiple="true"
689
+ accept="media"
689
690
  :header="{ 'hydrocarbon-program-token': hydrocarbonProgramToken, 'hydrocarbon-token': token }"
690
691
  :action="`${action}/v3/upload`"
691
692
  @success="(e) => { handleFileChange(e, group) }"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",