wui-components-v2 1.0.40 → 1.0.42

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.
@@ -247,7 +247,24 @@ async function save() {
247
247
  return rowAddSave({ ...all, id: pageConfig.value.entity.code })
248
248
  }
249
249
 
250
- editPageDataSave(tree.value.sourceId || sourceId.value, id.value, all, tree.value.value || mainCode.value).then((res: any) => {
250
+ const newAll: Record<string, any> = {}
251
+
252
+ for (const key1 in all) {
253
+ if (Object.prototype.hasOwnProperty.call(all, key1)) {
254
+ if (all[key1].response) {
255
+ newAll[`${key1}`] = JSON.stringify({
256
+ valid: 'new',
257
+ fileKey: JSON.parse(all[key1].response).fileKey,
258
+ fileName: all[key1].name,
259
+ })
260
+ }
261
+ else {
262
+ newAll[key1] = all[key1]
263
+ }
264
+ }
265
+ }
266
+
267
+ editPageDataSave(tree.value.sourceId || sourceId.value, id.value, newAll, tree.value.value || mainCode.value).then((res: any) => {
251
268
  // 发送事件
252
269
  if (addEvent.value)
253
270
  uni.$emit(addEvent.value, res.entityCode)
@@ -19,7 +19,7 @@ const props = defineProps<{
19
19
  model: FoldCardModel
20
20
  sourceId: string
21
21
  groups: Groups
22
- enumColumn: Enums
22
+ enumColumn?: Enums
23
23
  }>()
24
24
  const contentRef = ref<any>()
25
25
  // 展示内容
@@ -42,7 +42,7 @@ const collapseData = ref<Columns[]>([])
42
42
 
43
43
  // 标签字段
44
44
  const labelColumns = computed(() => {
45
- if (props.labelColumn) {
45
+ if (props.labelColumn && props.enumColumn) {
46
46
  return props.enumColumn[props.labelColumn.mstrucId]
47
47
  }
48
48
  else {
@@ -33,6 +33,11 @@ function initFormData() {
33
33
  if (item.extControlType === 'tree-entity-select' || item.extControlType === 'multiselect') {
34
34
  return models[item.sourceId] = (props.entity && props.entity[item.sourceId]?.split(',')) || item.transDefaultValue || []
35
35
  }
36
+
37
+ if (item.extControlType === 'relselect') {
38
+ return models[item.sourceId] = (props.entity && props.entity[item.sourceId]?.split('@,@')) || (item.transDefaultValue && item.transDefaultValue?.split('@,@')) || []
39
+ }
40
+
36
41
  // 文件
37
42
  if (item.extControlType === 'file' || item.extControlType === 'relfile') {
38
43
  if (props.entity && typeof props.entity[item.sourceId] === 'object') {
@@ -7,7 +7,7 @@ defineOptions({ name: 'Search' })
7
7
  const props = defineProps<{
8
8
  criterias: Fields[]
9
9
  primaryCriteria: Fields
10
- enumColumn: Enums
10
+ enumColumn?: Enums
11
11
  }>()
12
12
  const emits = defineEmits(['submit'])
13
13
  const show = ref(false)
@@ -82,7 +82,7 @@ function handleSubmit() {
82
82
  <wd-popup v-model="show" position="bottom" custom-class="h-80vh" closable @close="handleClose">
83
83
  <view class="relative box-border h-full p-1 .dark:bg-gray-900">
84
84
  <view class="h-40px" />
85
- <formControl ref="formControlRef" :field-group="{ fields: filterCriterias, id: '', buttons: [], title: '', type: '', pointSourceId: '', mstrucId: '', relationNames: [] }" :entity="entity" :enum-column="enumColumn" />
85
+ <formControl ref="formControlRef" :field-group="{ fields: filterCriterias, readOnly: false, displayConfig: [], id: '', buttons: [], title: '', type: '', pointSourceId: '', mstrucId: '', relationNames: [] }" :entity="entity" :enum-column="enumColumn" />
86
86
  <view class="h-12" />
87
87
  <view class="fixed bottom-0 left-0 right-0 box-border w-100% flex p-2 .dark:bg-gray-900 .light:bg-white">
88
88
  <wd-button class="flex-1" @click="handleSubmit">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",
package/utils/index.ts CHANGED
@@ -39,13 +39,13 @@ export function formatItemData(data: any, type: string) {
39
39
 
40
40
  if (type === 'file' || type === 'relfile') {
41
41
  if (data) {
42
+ console.log('sdsadasd', data)
42
43
  // 判断是否为JSON文件
43
44
  if (typeof data === 'string') {
44
45
  const a = JSON.parse(data)
45
46
  return `${baseUrl}/v3/files${a.base.path}?@token=${token}&@programToken=${hydrocarbonProgramToken}`
46
47
  }
47
48
  else {
48
- console.log('sdsadasd', data)
49
49
  return data.url
50
50
  }
51
51
  }