w-ui-v1 1.0.23 → 1.0.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-ui-v1",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
package/w-add/w-add.vue CHANGED
@@ -9,42 +9,7 @@
9
9
  v-if="item.type === 'fieldGroup'">
10
10
  <wd-form ref="form" :model="model">
11
11
  <wd-cell-group v-for="(subItem, subIndex) in item.fields" :key="subIndex">
12
- <view v-if="!subItem.hidden" style="border-bottom: 1px solid rgb(243 242 242);">
13
- <wd-input v-if="subItem.extControlType === 'text'" :disabled="subItem.disabled"
14
- :label="subItem.title" label-width="100px" :prop="subItem.id" clearable
15
- v-model="model[subItem.id]"
16
- :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
17
- :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" />
18
- <wd-picker v-if="subItem.extControlType === 'select'" :disabled="subItem.disabled"
19
- :label="subItem.title" label-width="100px" :prop="subItem.id" clearable
20
- v-model="model[subItem.id]"
21
- :placeholder="subItem.disabled ? '无需输入' : `请选择${subItem.title}`"
22
- :rules="[{ required: subItem.required, message: `请选择${subItem.title}` }]"
23
- :columns="Enumcolumn[subItem.mstrucId]" />
24
- <wd-textarea auto-height v-if="subItem.extControlType === 'textarea'"
25
- :disabled="subItem.disabled" :label="subItem.title" label-width="100px"
26
- :prop="subItem.id" clearable v-model="model[subItem.id]"
27
- :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
28
- :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" />
29
- <wd-input
30
- v-if="subItem.extControlType === 'decimal' || subItem.extControlType === 'int'"
31
- :disabled="subItem.disabled" :label="subItem.title" label-width="100px"
32
- :prop="subItem.id" clearable v-model="model[subItem.id]" type="number"
33
- :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
34
- :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" />
35
- <wd-calendar v-if="subItem.extControlType === 'datetime'" :disabled="subItem.disabled"
36
- :label="subItem.title" label-width="100px" :prop="subItem.id" clearable
37
- v-model="model[subItem.id]" type="datetime"
38
- :placeholder="subItem.disabled ? '无需输入' : `请选择${subItem.title}`"
39
- :rules="[{ required: subItem.required, message: `请选择${subItem.title}` }]" />
40
- <wSelectPicker @confirm="wSelectPickerconfirm" :prop="subItem.id"
41
- v-if="subItem.extControlType === 'relselect'" v-model="model[subItem.id]"
42
- :disabled="subItem.disabled" :label="subItem.title" type="radio"
43
- :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
44
- :source-id="subItem.sourceId" clearable filterable
45
- :rules="[{ required: subItem.required, message: `请选择${subItem.title}` }]" />
46
- </view>
47
-
12
+ <wFromControl :subItem="subItem" :model="model" :Enumcolumn="Enumcolumn" v-model:model-value="model[subItem.id]"/>
48
13
  </wd-cell-group>
49
14
 
50
15
  </wd-form>
@@ -68,42 +33,7 @@
68
33
  </template>
69
34
  <wd-form :ref="item.id" :model="PItem">
70
35
  <wd-cell-group v-for="(subItem, subIndex) in item.fields" :key="subIndex">
71
- <view v-if="!subItem.hidden" style="border-bottom: 1px solid rgb(243 242 242);">
72
- <wd-input v-if="subItem.extControlType === 'text'" :disabled="subItem.disabled"
73
- :label="subItem.title" label-width="100px" :prop="subItem.id" clearable
74
- v-model="PItem[subItem.id]"
75
- :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
76
- :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" />
77
- <wd-picker v-if="subItem.extControlType === 'select'"
78
- :disabled="subItem.disabled" :label="subItem.title" label-width="100px"
79
- :prop="subItem.id" clearable v-model="PItem[subItem.id]"
80
- :placeholder="subItem.disabled ? '无需输入' : `请选择${subItem.title}`"
81
- :rules="[{ required: subItem.required, message: `请选择${subItem.title}` }]"
82
- :columns="Enumcolumn[subItem.mstrucId]" />
83
- <wd-textarea auto-height v-if="subItem.extControlType === 'textarea'"
84
- :disabled="subItem.disabled" :label="subItem.title" label-width="100px"
85
- :prop="subItem.id" clearable v-model="PItem[subItem.id]"
86
- :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
87
- :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" />
88
- <wd-input
89
- v-if="subItem.extControlType === 'decimal' || subItem.extControlType === 'int'"
90
- :disabled="subItem.disabled" :label="subItem.title" label-width="100px"
91
- :prop="subItem.id" clearable v-model="model[subItem.id]" type="number"
92
- :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
93
- :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" />
94
- <wd-calendar v-if="subItem.extControlType === 'datetime'"
95
- :disabled="subItem.disabled" :label="subItem.title" label-width="100px"
96
- :prop="subItem.id" clearable v-model="model[subItem.id]" type="number"
97
- :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
98
- :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" />
99
- <wSelectPicker :prop="subItem.id" v-if="subItem.extControlType === 'relselect'"
100
- v-model="model[subItem.id]" :disabled="subItem.disabled"
101
- :label="subItem.title" type="radio"
102
- :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
103
- :source-id="subItem.sourceId" clearable filterable
104
- :rules="[{ required: subItem.required, message: `请选择${subItem.title}` }]" />
105
- </view>
106
-
36
+ <wFromControl :subItem="subItem" :model="PItem" :Enumcolumn="Enumcolumn" v-model:model-value="PItem[subItem.id]"/>
107
37
  </wd-cell-group>
108
38
 
109
39
  </wd-form>
@@ -141,6 +71,7 @@
141
71
  </template>
142
72
 
143
73
  <script setup lang="ts">
74
+ import wFromControl from '../w-form-control/w-form-control.vue'
144
75
  import wSelectPicker from '../w-select-picker/w-select-picker.vue'
145
76
  import WSelectTable from '../w-table/w-selectTable.vue';
146
77
  import { onLoad } from '@dcloudio/uni-app'
@@ -245,7 +176,6 @@ const wSelectPickerconfirm = (e) => {
245
176
 
246
177
  //保存
247
178
  async function handleSubmit() {
248
-
249
179
  form.value[0]
250
180
  .validate()
251
181
  .then(async ({ valid, errors }) => {
@@ -254,27 +184,9 @@ async function handleSubmit() {
254
184
  message: '保存中...',
255
185
  duration: 0
256
186
  })
257
- const newModel = {}
258
- pageConf.value.groups?.forEach((item: any) => {
259
- item.fields?.forEach((subItem: any) => {
260
- switch (subItem.extControlType) {
261
- case 'relselect':
262
- let t = wSelectPickerconfirmData.value.find((sItem: any) => {
263
- return sItem.value === model.value[subItem.id]
264
- })
265
- newModel[subItem.id] = `${t.value}@R@${t.label}`
266
- break
267
- case 'datetime':
268
- newModel[subItem.id] = model.value[subItem.id] ? dayjs(model.value[subItem.id]).format('YYYY-MM-DD HH:mm:ss') : ''
269
- break
270
- default:
271
- newModel[subItem.id] = model.value[subItem.id]
272
- }
273
- })
274
- });
275
- console.log(newModel)
187
+
276
188
  try {
277
- const res = await addPageDataSave(sourceId.value, newModel)
189
+ const res = await addPageDataSave(sourceId.value, model.value)
278
190
  if (res.data.status==='success'){
279
191
  toast.success("保存成功")
280
192
  uni.navigateBack()
@@ -65,31 +65,36 @@
65
65
  success: (res) => {
66
66
  if (res.statusCode === 200) {
67
67
  console.log('下载成功', res.tempFilePath);
68
-
69
- // 将临时文件保存到本地
70
- uni.saveFile({
71
- tempFilePath: res.tempFilePath,
72
- success: (saveRes) => {
73
- console.log('文件保存成功', saveRes.savedFilePath);
74
- const savedFilePath = saveRes.savedFilePath; // 保存后的路径
75
- // 打开文件(如PDF、Word等)
68
+ // 打开文件(如PDF、Word等)
76
69
  uni.openDocument({
77
- filePath: savedFilePath,
70
+ filePath: res.tempFilePath,
71
+ showMenu:true,
78
72
  success: () => console.log('打开文件成功')
79
73
  });
80
- uni.showToast({
81
- title: '文件保存成功',
82
- icon: 'success'
83
- });
84
- },
85
- fail: (saveErr) => {
86
- console.error('文件保存失败', saveErr);
87
- uni.showToast({
88
- title: '文件保存失败',
89
- icon: 'none'
90
- });
91
- }
92
- });
74
+ // // 将临时文件保存到本地
75
+ // uni.saveFile({
76
+ // tempFilePath: res.tempFilePath,
77
+ // success: (saveRes) => {
78
+ // console.log('文件保存成功', saveRes.savedFilePath);
79
+ // const savedFilePath = saveRes.savedFilePath; // 保存后的路径
80
+ // // 打开文件(如PDF、Word等)
81
+ // uni.openDocument({
82
+ // filePath: savedFilePath,
83
+ // success: () => console.log('打开文件成功')
84
+ // });
85
+ // uni.showToast({
86
+ // title: '文件保存成功',
87
+ // icon: 'success'
88
+ // });
89
+ // },
90
+ // fail: (saveErr) => {
91
+ // console.error('文件保存失败', saveErr);
92
+ // uni.showToast({
93
+ // title: '文件保存失败',
94
+ // icon: 'none'
95
+ // });
96
+ // }
97
+ // });
93
98
  } else {
94
99
  console.error('下载失败', res);
95
100
  uni.showToast({
@@ -0,0 +1,94 @@
1
+ <template>
2
+ <view v-if="!subItem.hidden" style="border-bottom: 1px solid rgb(243 242 242);">
3
+ <wd-input v-if="subItem.extControlType === 'text'" :disabled="subItem.disabled" :label="subItem.title"
4
+ label-width="100px" :prop="subItem.id" clearable :modelValue="modelValue"
5
+ :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
6
+ :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" @input="(e) => { change(e) }" />
7
+ <wd-picker v-if="subItem.extControlType === 'select'" :disabled="subItem.disabled" :label="subItem.title"
8
+ label-width="100px" :prop="subItem.id" clearable :modelValue="modelValue"
9
+ :placeholder="subItem.disabled ? '无需输入' : `请选择${subItem.title}`"
10
+ :rules="[{ required: subItem.required, message: `请选择${subItem.title}` }]" :columns="Enumcolumn[subItem.mstrucId]"
11
+ @confirm="(e) => { change(e) }" />
12
+ <wd-textarea auto-height v-if="subItem.extControlType === 'textarea'" :disabled="subItem.disabled"
13
+ :label="subItem.title" label-width="100px" :prop="subItem.id" clearable :modelValue="modelValue"
14
+ :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
15
+ :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" @input="(e) => { change(e) }" />
16
+ <wd-input v-if="subItem.extControlType === 'decimal' || subItem.extControlType === 'int'"
17
+ :disabled="subItem.disabled" :label="subItem.title" label-width="100px" :prop="subItem.id" clearable
18
+ :modelValue="modelValue" type="number" :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`"
19
+ :rules="[{ required: subItem.required, message: `请填写${subItem.title}` }]" @input="(e) => { change(e) }" />
20
+ <wd-calendar v-if="subItem.extControlType === 'datetime'" :disabled="subItem.disabled" :label="subItem.title"
21
+ label-width="100px" :prop="subItem.id" clearable :modelValue="modelValue" type="datetime"
22
+ :placeholder="subItem.disabled ? '无需输入' : `请选择${subItem.title}`"
23
+ :rules="[{ required: subItem.required, message: `请选择${subItem.title}` }]" @confirm="(e) => { change(e) }" />
24
+ <wSelectPicker @confirm="wSelectPickerconfirm" :prop="subItem.id" v-if="subItem.extControlType === 'relselect'"
25
+ :modelValue="modelValue" :disabled="subItem.disabled" :label="subItem.title" type="radio"
26
+ :placeholder="subItem.disabled ? '无需输入' : `请输入${subItem.title}`" :source-id="subItem.sourceId" clearable
27
+ filterable :rules="[{ required: subItem.required, message: `请选择${subItem.title}` }]" />
28
+ </view>
29
+ </template>
30
+
31
+ <script setup lang="ts">
32
+ import wSelectPicker from '../w-select-picker/w-select-picker.vue'
33
+ import dayjs from 'dayjs/esm/index'
34
+ import { defineProps, ref, defineEmits, computed } from 'vue'
35
+ const props = defineProps({
36
+ subItem: {
37
+ type: Object,
38
+ default: () => {
39
+ return {}
40
+ }
41
+ },
42
+ model: {
43
+ type: Object,
44
+ default: () => {
45
+ return {}
46
+ }
47
+ },
48
+ Enumcolumn: {
49
+ type: Object,
50
+ default: () => {
51
+ return {}
52
+ }
53
+ }
54
+ })
55
+ const modelValue = computed(() => {
56
+ switch (props.subItem.extControlType) {
57
+ case 'datetime':
58
+ return props.model[props.subItem.id] ? dayjs(props.model[props.subItem.id]).valueOf() : null
59
+ break
60
+ case 'relselect':
61
+ return props.model[props.subItem.id] ? props.model[props.subItem.id].split('@R@')[0] : ''
62
+ break
63
+ default:
64
+ return props.model[props.subItem.id]
65
+ }
66
+
67
+ })
68
+
69
+ const emit = defineEmits(['update:modelValue'])
70
+
71
+ //wSelectPicker组件确定事件
72
+ const wSelectPickerconfirm = (e) => {
73
+
74
+ if (Array.isArray(e.selectedItems)) {
75
+
76
+ } else {
77
+ emit('update:modelValue', `${e.selectedItems.value}@R@${e.selectedItems.label}`)
78
+ }
79
+ }
80
+
81
+ const change = (e) => {
82
+ switch (props.subItem.extControlType) {
83
+ case 'datetime':
84
+ emit('update:modelValue', dayjs(e.value).format('YYYY-MM-DD HH:mm:ss'))
85
+ break
86
+ default:
87
+ emit('update:modelValue', e.value)
88
+ }
89
+
90
+
91
+ }
92
+ </script>
93
+
94
+ <style scoped></style>
package/w-menu/w-menu.vue CHANGED
@@ -127,7 +127,7 @@ function queryList() {
127
127
  <view v-if="filtermenu.length > 0">
128
128
  <wd-card v-for="(item, index) in filtermenu" :key="index" :title="item.title">
129
129
  <template #default>
130
- <wd-grid :column="5" :clickable="true">
130
+ <wd-grid :column="4" :clickable="true">
131
131
  <wd-grid-item use-slot v-for="(subItem, subIndex) in item.items" :key="subIndex"
132
132
  @itemclick="gotoPage(subItem)" use-text-slot>
133
133
  <template #default>
@@ -118,10 +118,10 @@ function add() {
118
118
 
119
119
  </template>
120
120
  <!-- 卡片 -->
121
- <view v-for="(item, index) in dataList" :key="index"
122
- :style="{ background: radiovalue === index ? 'rgb(217 229 255)' : '#fff' }">
121
+ <view v-for="(item, index) in dataList" :key="index" @click="radiovalue = index"
122
+ >
123
123
  <view style="padding:10px 0 0 30px;" @click="radiovalue = index">
124
- <wd-radio-group v-model="radiovalue" shape="dot" inline style="background: none;">
124
+ <wd-radio-group v-model="radiovalue" shape="dot" inline >
125
125
  <wd-radio :value="index"></wd-radio>
126
126
  </wd-radio-group>
127
127
  </view>
@@ -139,4 +139,8 @@ function add() {
139
139
  background-color: #fff;
140
140
  margin-bottom: 10px;
141
141
  }
142
+ :deep(.wd-radio-group){
143
+ background-color: none;
144
+
145
+ }
142
146
  </style>