w-ui-v1 1.0.28 → 1.0.29
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 +1 -1
- package/utils/apis/pageConfig.ts +9 -2
- package/w-add/w-add.vue +77 -59
- package/w-card/utils/utils.ts +1 -1
- package/w-card/w-card.vue +7 -2
- package/w-detail/w-detail.vue +65 -57
- package/w-search/w-search.vue +5 -7
- package/w-table/w-selectTable.vue +72 -25
- package/w-table/w-table.vue +9 -3
package/package.json
CHANGED
package/utils/apis/pageConfig.ts
CHANGED
|
@@ -54,9 +54,9 @@ export function editPageConfig(sourceId: string,code: string) {
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
// 获取页面数据key
|
|
57
|
-
export function getPageKey(sourceId: string, query: string='') {
|
|
57
|
+
export function getPageKey(sourceId: string,mainCode:string='', query: string='') {
|
|
58
58
|
return request({
|
|
59
|
-
url: `/v3/ltmpl/query/key?sourceId=${sourceId}&menuId=${sourceId}&${query}`,
|
|
59
|
+
url: `/v3/ltmpl/query/key?sourceId=${sourceId}&mainCode=${mainCode}&menuId=${sourceId}&${query}`,
|
|
60
60
|
})
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -102,4 +102,11 @@ export function customButtonSave(sourceId: string,codes:string, data: any) {
|
|
|
102
102
|
...data
|
|
103
103
|
}
|
|
104
104
|
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//获取勾选数据
|
|
108
|
+
export function getSelectData(sourceId: string,codes:string) {
|
|
109
|
+
return request({
|
|
110
|
+
url: `/v3/field-group/data/selected?sourceId=${sourceId}&${codes}`,
|
|
111
|
+
})
|
|
105
112
|
}
|
package/w-add/w-add.vue
CHANGED
|
@@ -4,73 +4,64 @@
|
|
|
4
4
|
<wd-loading />
|
|
5
5
|
</view>
|
|
6
6
|
<view v-else>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
v-if="item.type === 'fieldGroup'">
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<view v-if="item.type === 'relation'">
|
|
20
|
-
<view v-if="item.pointSourceId">
|
|
21
|
-
<view class="row-add" v-if="item.buttons.includes('selectAdd')">
|
|
22
|
-
<wd-button hairline type="info" size="small" icon="add"
|
|
23
|
-
@click="selectrow(item)">选择</wd-button>
|
|
24
|
-
</view>
|
|
7
|
+
<wd-collapse v-model="value">
|
|
8
|
+
<wd-collapse-item :title="item.title" :name="item.id" v-for="(item, index) in pageConf.groups"
|
|
9
|
+
:key="index">
|
|
10
|
+
<view v-if="item.type === 'fieldGroup'">
|
|
11
|
+
<wd-form ref="form" :model="model">
|
|
12
|
+
<wd-cell-group v-for="(subItem, subIndex) in item.fields" :key="subIndex">
|
|
13
|
+
<wFromControl :subItem="subItem" :model="model" :Enumcolumn="Enumcolumn"
|
|
14
|
+
v-model:model-value="model[subItem.id]" />
|
|
15
|
+
</wd-cell-group>
|
|
16
|
+
|
|
17
|
+
</wd-form>
|
|
18
|
+
|
|
25
19
|
</view>
|
|
26
|
-
<view v-
|
|
27
|
-
<
|
|
28
|
-
v-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
20
|
+
<view v-if="item.type === 'relation'">
|
|
21
|
+
<view class="row-add">
|
|
22
|
+
<wd-button v-if="item.buttons.includes('selectAdd')" hairline type="info" size="small"
|
|
23
|
+
icon="add" @click="selectrow(item)">选择</wd-button>
|
|
24
|
+
<wd-button v-if="item.buttons.includes('dtmplAdd')" hairline type="info" size="small"
|
|
25
|
+
icon="add" @click="addrow(item.id)">新增</wd-button>
|
|
26
|
+
</view>
|
|
27
|
+
|
|
28
|
+
<!-- 卡片 -->
|
|
29
|
+
<view class="card-list" >
|
|
30
|
+
<w-card v-for="(subitem, index) in selectData[item.id]" :key="index" :car-index="index" :page="{
|
|
31
|
+
rowActions:item.rowActions||[],
|
|
32
|
+
buttons:item.buttons||[],
|
|
33
|
+
ractions:item.ractions||[],
|
|
34
|
+
columns:item.fields||[]
|
|
35
|
+
}"
|
|
36
|
+
:item-data="subitem" :source-id="item.pointSourceId" />
|
|
37
|
+
</view>
|
|
38
|
+
|
|
45
39
|
<view class="row-add" v-if="item.buttons.includes('rowAdd')">
|
|
46
40
|
<wd-button hairline type="info" size="small" icon="add"
|
|
47
41
|
@click="addrow(item.id)">加一条</wd-button>
|
|
48
42
|
</view>
|
|
49
43
|
</view>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</
|
|
55
|
-
</wd-collapse>
|
|
56
|
-
<view class="footer-button">
|
|
57
|
-
<wd-button block @click="handleSubmit" icon="save">保存</wd-button>
|
|
44
|
+
</wd-collapse-item>
|
|
45
|
+
</wd-collapse>
|
|
46
|
+
<view class="footer-button">
|
|
47
|
+
<wd-button block @click="handleSubmit" icon="save">保存</wd-button>
|
|
48
|
+
</view>
|
|
58
49
|
</view>
|
|
59
|
-
</view>
|
|
60
50
|
<wd-message-box />
|
|
61
51
|
<wd-toast />
|
|
62
52
|
</view>
|
|
63
53
|
</template>
|
|
64
54
|
|
|
65
55
|
<script setup lang="ts">
|
|
56
|
+
import wCard from '../w-card/w-card.vue'
|
|
66
57
|
import wFromControl from '../w-form-control/w-form-control.vue'
|
|
67
|
-
import
|
|
68
|
-
import { onLoad } from '@dcloudio/uni-app'
|
|
58
|
+
import { onLoad, onUnload } from '@dcloudio/uni-app'
|
|
69
59
|
import { ref, defineProps, reactive } from 'vue';
|
|
70
60
|
import {
|
|
71
61
|
addPageConfig,
|
|
72
62
|
getEnum,
|
|
73
|
-
addPageDataSave
|
|
63
|
+
addPageDataSave,
|
|
64
|
+
getSelectData
|
|
74
65
|
} from '../utils/apis/pageConfig'
|
|
75
66
|
import { useMessage } from 'wot-design-uni'
|
|
76
67
|
import { useToast } from 'wot-design-uni'
|
|
@@ -91,9 +82,12 @@ const pageConf = ref({ groups: [] })
|
|
|
91
82
|
const form = ref()//基本数据表单
|
|
92
83
|
//表单数据
|
|
93
84
|
const model = ref({})
|
|
94
|
-
const
|
|
95
|
-
|
|
85
|
+
const relationID = ref('')
|
|
86
|
+
const modelsRef = {
|
|
87
|
+
|
|
96
88
|
}
|
|
89
|
+
|
|
90
|
+
const checkboxvalue = ref([])
|
|
97
91
|
const loading = ref(false)
|
|
98
92
|
const value = ref([])
|
|
99
93
|
const Enumcolumn = ref({})
|
|
@@ -101,6 +95,21 @@ const pointSourceId = ref('')
|
|
|
101
95
|
onLoad((option: any) => {
|
|
102
96
|
sourceId.value = props.sourceId || option.sourceId
|
|
103
97
|
getPageConfig()
|
|
98
|
+
|
|
99
|
+
//监听勾选列表页面事件
|
|
100
|
+
uni.$on('getCheckData', function (data: any) {
|
|
101
|
+
checkboxvalue.value = data.checkData
|
|
102
|
+
//获取勾选数据
|
|
103
|
+
let codes = ''
|
|
104
|
+
checkboxvalue.value.forEach((item: any) => {
|
|
105
|
+
codes += `codes=${item}&`
|
|
106
|
+
})
|
|
107
|
+
getSelectDataPxoy(codes)
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
onUnload(() => {
|
|
111
|
+
// 取消监听勾选列表页面事件
|
|
112
|
+
uni.$off('getCheckData')
|
|
104
113
|
})
|
|
105
114
|
|
|
106
115
|
function getPageConfig() {
|
|
@@ -118,6 +127,7 @@ function getPageConfig() {
|
|
|
118
127
|
// t[0][subItem.id] = subItem.defaultValue || ''
|
|
119
128
|
// })
|
|
120
129
|
relation[item.id] = t
|
|
130
|
+
relation[`${item.id}.$$flag$$`] = true
|
|
121
131
|
}
|
|
122
132
|
if (item.type === 'fieldGroup') {
|
|
123
133
|
|
|
@@ -167,21 +177,21 @@ async function handleSubmit() {
|
|
|
167
177
|
message: '保存中...',
|
|
168
178
|
duration: 0
|
|
169
179
|
})
|
|
170
|
-
|
|
180
|
+
|
|
171
181
|
try {
|
|
172
182
|
const res = await addPageDataSave(sourceId.value, model.value)
|
|
173
|
-
if (res.data.status==='success'){
|
|
183
|
+
if (res.data.status === 'success') {
|
|
174
184
|
toast.success("保存成功")
|
|
175
|
-
|
|
176
|
-
}else{
|
|
177
|
-
toast.error(res.data.message||'保存失败"')
|
|
185
|
+
uni.navigateBack()
|
|
186
|
+
} else {
|
|
187
|
+
toast.error(res.data.message || '保存失败"')
|
|
178
188
|
}
|
|
179
|
-
|
|
189
|
+
|
|
180
190
|
} catch (error) {
|
|
181
191
|
toast.error(error)
|
|
182
192
|
}
|
|
183
193
|
|
|
184
|
-
|
|
194
|
+
|
|
185
195
|
}
|
|
186
196
|
})
|
|
187
197
|
.catch((error) => {
|
|
@@ -190,13 +200,21 @@ async function handleSubmit() {
|
|
|
190
200
|
|
|
191
201
|
}
|
|
192
202
|
|
|
193
|
-
|
|
203
|
+
//跳转勾选页面数据
|
|
194
204
|
function selectrow(item: any) {
|
|
205
|
+
relationID.value = item.id
|
|
195
206
|
pointSourceId.value = item.pointSourceId
|
|
196
207
|
uni.navigateTo({
|
|
197
208
|
url: `/pages/selectTable/selectTable?sourceId=${pointSourceId.value}`
|
|
198
209
|
})
|
|
199
210
|
}
|
|
211
|
+
const selectData = ref({})
|
|
212
|
+
//获取勾选数据
|
|
213
|
+
async function getSelectDataPxoy(codes: string) {
|
|
214
|
+
const res = await getSelectData(relationID.value, codes)
|
|
215
|
+
selectData.value[relationID.value] = res.data.entities
|
|
216
|
+
}
|
|
217
|
+
|
|
200
218
|
|
|
201
219
|
//新加一行
|
|
202
220
|
function addrow(key: any) {
|
package/w-card/utils/utils.ts
CHANGED
|
@@ -47,7 +47,7 @@ export function getValue(content: any, title: any): any {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
//文件链接
|
|
50
|
-
if (obj.base?.path && (obj.base?.type.includes('docx')|| obj.base?.type.includes('txt'))) {
|
|
50
|
+
if (obj.base?.path && (obj.base?.type.includes('docx')|| obj.base?.type.includes('txt')|| obj.base?.type.includes('dat'))) {
|
|
51
51
|
|
|
52
52
|
return {
|
|
53
53
|
url: `${baseUrl}/v3/files${obj.base.path}?@token=${token}&@programToken=${hydrocarbonProgramToken}`,
|
package/w-card/w-card.vue
CHANGED
|
@@ -77,6 +77,7 @@ const items = computed(() => {
|
|
|
77
77
|
}).map((item: any) => {
|
|
78
78
|
return {
|
|
79
79
|
title: item.title,
|
|
80
|
+
controlType: item.controlType,
|
|
80
81
|
content: getValue(props.itemData?.fieldMap[item.id], item.title),
|
|
81
82
|
data: props.itemData?.fieldMap[item.id],
|
|
82
83
|
id: item.id,
|
|
@@ -134,7 +135,7 @@ function goto(type: string, item: any = {}, subItem: string = '') {
|
|
|
134
135
|
break
|
|
135
136
|
case 'openPage':
|
|
136
137
|
uni.navigateTo({
|
|
137
|
-
url: `/pages/table/table?sourceId=${item.id}&pageTitle=${item.title}`,
|
|
138
|
+
url: `/pages/table/table?sourceId=${item.id}&pageTitle=${item.title}&mainCode=${props.itemData.code}`,
|
|
138
139
|
})
|
|
139
140
|
break
|
|
140
141
|
}
|
|
@@ -207,9 +208,13 @@ const actionBtn = (item: any) => {
|
|
|
207
208
|
<wd-text type="primary" @click="downloadFile(item.content.url)" :text="item.content?.name" />
|
|
208
209
|
</view>
|
|
209
210
|
|
|
210
|
-
<audio v-else-if="item.content?.type === '音频'" :src="item.content?.url" :author="item.content?.author"
|
|
211
|
+
<audio style="width: 50px;" v-else-if="item.content?.type === '音频'" :src="item.content?.url" :author="item.content?.author"
|
|
211
212
|
:name="item.content?.name" controls></audio>
|
|
212
213
|
|
|
214
|
+
<!-- <audio style="width: 50px;" v-else-if="item.controlType==='file'" :src="item.content"
|
|
215
|
+
controls></audio> -->
|
|
216
|
+
|
|
217
|
+
|
|
213
218
|
<view v-else class="value">
|
|
214
219
|
{{ item.content }}
|
|
215
220
|
</view>
|
package/w-detail/w-detail.vue
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
//在自定义组件中使用 Wot Design Uni 组件时,需开启styleIsolation: 'shared'选项覆盖样式
|
|
3
3
|
export default {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
options: {
|
|
5
|
+
styleIsolation: 'shared'//使css :deep()生效
|
|
6
|
+
}
|
|
7
7
|
}
|
|
8
8
|
</script>
|
|
9
9
|
<script setup lang="ts">
|
|
10
10
|
import { onLoad } from '@dcloudio/uni-app'
|
|
11
|
-
import { getValue
|
|
11
|
+
import { getValue, downloadFile } from '../w-card/utils/utils'
|
|
12
12
|
import {
|
|
13
13
|
computed,
|
|
14
14
|
ref,
|
|
@@ -73,40 +73,39 @@ function goto(PItem: any, item: any) {
|
|
|
73
73
|
<wd-loading />
|
|
74
74
|
</view>
|
|
75
75
|
<wd-collapse v-model="value" v-else>
|
|
76
|
-
<wd-collapse-item custom-body-class="collapse-custom-class" :title="item.title" :name="item.id"
|
|
77
|
-
|
|
76
|
+
<wd-collapse-item custom-body-class="collapse-custom-class" :title="item.title" :name="item.id"
|
|
77
|
+
v-for="(item, index) in pageConf.groups" :key="index">
|
|
78
|
+
|
|
78
79
|
<wd-card title=" " v-if="item.type === 'fieldGroup'" custom-class="card-custom-class">
|
|
79
80
|
<view v-for="(subItem, subIndex) in item.fields" :key='subIndex' style='margin-bottom: 8px;'>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<wd-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
</wd-col>
|
|
109
|
-
</wd-row>
|
|
81
|
+
<view v-if="!subItem.hidden" class="row">
|
|
82
|
+
|
|
83
|
+
<view class="label">
|
|
84
|
+
{{ subItem.title }}:
|
|
85
|
+
</view>
|
|
86
|
+
|
|
87
|
+
<wd-img v-if="getValue(pageData.fieldMap[subItem.sourceId], subItem.title)?.type === '图片'"
|
|
88
|
+
width="100rpx" height="100rpx"
|
|
89
|
+
:src="getValue(pageData.fieldMap[subItem.sourceId], subItem.title).url"
|
|
90
|
+
:enable-preview="true" />
|
|
91
|
+
<view
|
|
92
|
+
v-else-if="getValue(pageData.fieldMap[subItem.sourceId], subItem.title)?.type === '文件'"
|
|
93
|
+
class="value">
|
|
94
|
+
<wd-text type="primary"
|
|
95
|
+
@click="downloadFile(getValue(pageData.fieldMap[subItem.sourceId], subItem.title).url)"
|
|
96
|
+
:text="getValue(pageData.fieldMap[subItem.sourceId], subItem.title).name" />
|
|
97
|
+
</view>
|
|
98
|
+
<audio
|
|
99
|
+
v-else-if="getValue(pageData.fieldMap[subItem.sourceId], subItem.title)?.type === '音频'"
|
|
100
|
+
:src="getValue(pageData.fieldMap[subItem.sourceId], subItem.title).url"
|
|
101
|
+
:author="getValue(pageData.fieldMap[subItem.sourceId], subItem.title).author"
|
|
102
|
+
:name="getValue(pageData.fieldMap[subItem.sourceId], subItem.title).name"
|
|
103
|
+
controls></audio>
|
|
104
|
+
<view v-else class="value">
|
|
105
|
+
{{ getValue(pageData.fieldMap[subItem.sourceId], subItem.title) }}
|
|
106
|
+
</view>
|
|
107
|
+
|
|
108
|
+
</view>
|
|
110
109
|
</view>
|
|
111
110
|
|
|
112
111
|
<template #footer>
|
|
@@ -114,17 +113,17 @@ function goto(PItem: any, item: any) {
|
|
|
114
113
|
v-if="item.buttons.includes('detail')">详情</wd-button>
|
|
115
114
|
</template>
|
|
116
115
|
</wd-card>
|
|
117
|
-
|
|
116
|
+
|
|
118
117
|
<view v-if="item.type === 'relation'">
|
|
119
|
-
<wd-card custom-class="card-custom-class" title=" "
|
|
118
|
+
<wd-card custom-class="card-custom-class-relation" title=" "
|
|
119
|
+
v-for="(PItem, PIndex) in pageData.arrayMap[item.id]" :key="PIndex">
|
|
120
120
|
<view v-for="(subItem, subIndex) in item.fields" :key='subIndex' style='margin-bottom: 8px;'>
|
|
121
|
-
<
|
|
122
|
-
|
|
121
|
+
<view v-if="!subItem.hidden" class="row">
|
|
122
|
+
|
|
123
123
|
<view class="label">
|
|
124
124
|
{{ subItem.title }}:
|
|
125
125
|
</view>
|
|
126
|
-
|
|
127
|
-
<wd-col :span="18">
|
|
126
|
+
|
|
128
127
|
<wd-img
|
|
129
128
|
v-if="getValue(PItem.fieldMap[subItem.sourceId], subItem.title)?.type === '图片'"
|
|
130
129
|
width="100rpx" height="100rpx"
|
|
@@ -146,8 +145,8 @@ function goto(PItem: any, item: any) {
|
|
|
146
145
|
<view v-else class="value">
|
|
147
146
|
{{ getValue(PItem.fieldMap[subItem.sourceId], subItem.title) }}
|
|
148
147
|
</view>
|
|
149
|
-
|
|
150
|
-
</
|
|
148
|
+
|
|
149
|
+
</view>
|
|
151
150
|
</view>
|
|
152
151
|
|
|
153
152
|
<template #footer>
|
|
@@ -164,24 +163,33 @@ function goto(PItem: any, item: any) {
|
|
|
164
163
|
</template>
|
|
165
164
|
|
|
166
165
|
<style scoped lang="scss">
|
|
167
|
-
.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
.row {
|
|
167
|
+
display: flex;
|
|
168
|
+
|
|
169
|
+
.label {
|
|
170
|
+
//文字换行
|
|
171
|
+
white-space: normal;
|
|
172
|
+
word-break: break-all;
|
|
173
|
+
margin-right: 20rpx;
|
|
174
|
+
}
|
|
172
175
|
|
|
173
|
-
.value {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
.value {
|
|
177
|
+
//文字换行
|
|
178
|
+
white-space: normal;
|
|
179
|
+
word-break: break-all;
|
|
180
|
+
color: #333;
|
|
181
|
+
}
|
|
178
182
|
}
|
|
179
183
|
|
|
180
|
-
|
|
184
|
+
|
|
185
|
+
:deep(.card-custom-class) {
|
|
181
186
|
margin: 0 !important;
|
|
182
187
|
}
|
|
188
|
+
:deep(.card-custom-class-relation){
|
|
189
|
+
margin: 0 0 8px 0 !important;
|
|
190
|
+
}
|
|
183
191
|
|
|
184
|
-
:deep(.collapse-custom-class){
|
|
185
|
-
background-color
|
|
192
|
+
:deep(.collapse-custom-class) {
|
|
193
|
+
background-color: #F6F7FB;
|
|
186
194
|
}
|
|
187
195
|
</style>
|
package/w-search/w-search.vue
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<wd-drop-menu-item ref="dropMenu" title="搜索" @opened="handleOpened">
|
|
10
10
|
<view v-for="(item, index) in props.criterias" :key="index">
|
|
11
11
|
<wSelectPicker :model-value="searchData[item.sourceId] ? searchData[item.sourceId].value : ''"
|
|
12
|
-
v-if="item.extControlType === 'relselectvalue'" type="radio"
|
|
12
|
+
v-if="item.extControlType === 'relselectvalue' || item.extControlType === 'entity-select'" type="radio"
|
|
13
13
|
@confirm="(e) => { searchData[item.sourceId] = e.selectedItems }" :label="item.title"
|
|
14
14
|
:placeholder="`请选择${item.title}`" :source-id="item.sourceId" filterable />
|
|
15
15
|
<wd-input v-else-if="item.extControlType === 'text'" type="text" :label="item.title"
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
:label="item.title" v-model="searchData[item.sourceId]" clearable />
|
|
29
29
|
</view>
|
|
30
30
|
|
|
31
|
-
<wd-input v-else type="text" :label="item.title"
|
|
32
|
-
|
|
31
|
+
<wd-input v-else type="text" :label="item.title" v-model="searchData[item.sourceId]"
|
|
32
|
+
:placeholder="`请输入${item.title}`" clearable />
|
|
33
33
|
</view>
|
|
34
34
|
<view class="search-btn">
|
|
35
35
|
<wd-button size="small" icon="refresh" @click="clear" type="info">重置</wd-button>
|
|
@@ -76,9 +76,6 @@ onBeforeMount(() => {
|
|
|
76
76
|
case 'daterange':
|
|
77
77
|
data[`${item.sourceId}`] = []
|
|
78
78
|
break;
|
|
79
|
-
case 'relselectvalue':
|
|
80
|
-
data[`${item.sourceId}`] = ''
|
|
81
|
-
break;
|
|
82
79
|
default:
|
|
83
80
|
data[`${item.sourceId}`] = ''
|
|
84
81
|
}
|
|
@@ -116,6 +113,7 @@ const search = () => {
|
|
|
116
113
|
d = `c_${key}=${dayjs(element).format('YYYY-MM-DD HH')}`
|
|
117
114
|
data.push(d)
|
|
118
115
|
break;
|
|
116
|
+
case 'entity-select':
|
|
119
117
|
case 'relselectvalue':
|
|
120
118
|
console.log(element)
|
|
121
119
|
d = `c_${key}=${element.label}`
|
|
@@ -149,7 +147,7 @@ const clear = () => {
|
|
|
149
147
|
async function getEnumer() {
|
|
150
148
|
let params = []
|
|
151
149
|
props.criterias.forEach((item: any) => {
|
|
152
|
-
if (item.
|
|
150
|
+
if (item.extControlType === 'select') {
|
|
153
151
|
params.push(`mstrucIds=${item.mstrucId}`)
|
|
154
152
|
}
|
|
155
153
|
|
|
@@ -26,6 +26,7 @@ const props = defineProps({
|
|
|
26
26
|
const query = ref('')
|
|
27
27
|
const sourceId = ref('')
|
|
28
28
|
const radiovalue = ref()
|
|
29
|
+
const checkboxvalue = ref([])
|
|
29
30
|
const pageData = ref<{
|
|
30
31
|
criterias: []
|
|
31
32
|
buttons: string[]
|
|
@@ -44,6 +45,33 @@ watch(() => props.sourceId, (value) => {
|
|
|
44
45
|
immediate: false
|
|
45
46
|
})
|
|
46
47
|
|
|
48
|
+
//选择的数据
|
|
49
|
+
const checkData = computed(() => {
|
|
50
|
+
let data=[]
|
|
51
|
+
checkboxvalue.value.forEach((item:any)=>{
|
|
52
|
+
let it=dataList.value.find((subitem:any)=>{
|
|
53
|
+
|
|
54
|
+
return subitem.code === item
|
|
55
|
+
})
|
|
56
|
+
if(it){
|
|
57
|
+
data.push({
|
|
58
|
+
label:it.fieldMap[pageData.value.primaryColumn.id],
|
|
59
|
+
value:it.code
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
return data
|
|
65
|
+
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
//关闭tag
|
|
69
|
+
function handletagClose(item: any) {
|
|
70
|
+
checkboxvalue.value = checkboxvalue.value.filter((subitem: any) => {
|
|
71
|
+
return subitem !== item.value
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
47
75
|
// 获取页面配置
|
|
48
76
|
function getPageConfig() {
|
|
49
77
|
selectPageConfig(sourceId.value).then((res: any) => {
|
|
@@ -81,10 +109,10 @@ async function queryList(pageNo: number, pageSize: number) {
|
|
|
81
109
|
const key = await getPageKey(sourceId.value, query.value)// 获取key
|
|
82
110
|
const data = await getPageData(key.data?.key, pageNo, pageSize)// 获取数据
|
|
83
111
|
// const count = await getPageTotal(key.data?.key)// 获取总数
|
|
84
|
-
paging.value.complete(data.data.entities)
|
|
112
|
+
paging.value.complete && paging.value.complete(data.data.entities)
|
|
85
113
|
}
|
|
86
114
|
catch (error) {
|
|
87
|
-
paging.value.complete(false)
|
|
115
|
+
paging.value.complete && paging.value.complete(false)
|
|
88
116
|
console.error(error)
|
|
89
117
|
}
|
|
90
118
|
}
|
|
@@ -95,18 +123,18 @@ function add() {
|
|
|
95
123
|
url: `/pages/add/add?sourceId=${sourceId.value}`,
|
|
96
124
|
})
|
|
97
125
|
}
|
|
126
|
+
|
|
98
127
|
// 点击确定按钮
|
|
99
128
|
function SubmitHanld() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
uni.setStorageSync('selectItem', item)
|
|
129
|
+
uni.navigateBack({
|
|
130
|
+
success:()=>{
|
|
131
|
+
uni.$emit('getCheckData',{checkData: checkboxvalue.value})
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
//点击取消按钮
|
|
137
|
+
function handleCansle() {
|
|
110
138
|
uni.navigateBack()
|
|
111
139
|
}
|
|
112
140
|
|
|
@@ -124,25 +152,32 @@ function SubmitHanld() {
|
|
|
124
152
|
<wd-button v-if="pageData.buttons.includes('dtmplAdd')" type="icon" icon="add" @click="add" />
|
|
125
153
|
</view>
|
|
126
154
|
<view class="button-container">
|
|
127
|
-
<wd-button type="info" size="small"
|
|
128
|
-
<wd-button size="small" @click="SubmitHanld">确定</wd-button>
|
|
155
|
+
<wd-button type="info" size="small" @click="handleCansle">取消</wd-button>
|
|
156
|
+
<wd-button size="small" @click="SubmitHanld" >确定</wd-button>
|
|
129
157
|
</view>
|
|
130
158
|
</view>
|
|
131
|
-
|
|
159
|
+
<!-- 选择的数据 -->
|
|
160
|
+
<view class="select-container">
|
|
161
|
+
<wd-tag @close="handletagClose(item)" closable round type="primary" v-for="(item, index) in checkData" :key="index">{{ item.label }}</wd-tag>
|
|
162
|
+
</view>
|
|
132
163
|
</template>
|
|
133
164
|
<!-- 卡片 -->
|
|
134
|
-
<view
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
165
|
+
<view class="card-container">
|
|
166
|
+
<!-- 复选框 -->
|
|
167
|
+
<wd-checkbox-group v-model="checkboxvalue">
|
|
168
|
+
<view v-for="(item, index) in dataList" :key="index">
|
|
169
|
+
<view >
|
|
170
|
+
<view style="padding:10px 0 0 30px;">
|
|
171
|
+
<wd-checkbox :modelValue="item.code"></wd-checkbox>
|
|
172
|
+
</view>
|
|
173
|
+
<w-card style="background: none;" :car-index="index" :page="pageData" :item-data="item"
|
|
174
|
+
:source-id="sourceId" />
|
|
175
|
+
</view>
|
|
140
176
|
</view>
|
|
141
|
-
|
|
142
|
-
</view>
|
|
143
|
-
|
|
177
|
+
</wd-checkbox-group>
|
|
144
178
|
</view>
|
|
145
179
|
|
|
180
|
+
|
|
146
181
|
</z-paging>
|
|
147
182
|
</template>
|
|
148
183
|
|
|
@@ -153,9 +188,21 @@ function SubmitHanld() {
|
|
|
153
188
|
justify-content: space-between;
|
|
154
189
|
background-color: #fff;
|
|
155
190
|
padding: 10px;
|
|
156
|
-
|
|
191
|
+
|
|
192
|
+
.button-container {
|
|
157
193
|
display: flex;
|
|
158
194
|
gap: 10px;
|
|
159
195
|
}
|
|
160
196
|
}
|
|
197
|
+
.select-container{
|
|
198
|
+
display: flex;
|
|
199
|
+
flex-wrap: wrap;
|
|
200
|
+
gap: 5px;
|
|
201
|
+
padding:0 10px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.card-container {
|
|
205
|
+
padding:10px;
|
|
206
|
+
background-color: #F6F7FB;
|
|
207
|
+
}
|
|
161
208
|
</style>
|
package/w-table/w-table.vue
CHANGED
|
@@ -21,16 +21,22 @@ const props = defineProps({
|
|
|
21
21
|
sourceId: {
|
|
22
22
|
type: String,
|
|
23
23
|
default: ''
|
|
24
|
+
},
|
|
25
|
+
mainCode:{
|
|
26
|
+
type: String,
|
|
27
|
+
default: ''
|
|
24
28
|
}
|
|
25
29
|
})
|
|
26
30
|
const query = ref('')
|
|
27
31
|
const sourceId = ref('')
|
|
32
|
+
const mainCode = ref('')
|
|
28
33
|
const pageData = ref<{
|
|
29
34
|
criterias: []
|
|
30
35
|
buttons: string[]
|
|
31
36
|
}>({ criterias: [], buttons: [] })
|
|
32
37
|
onLoad((option: any) => {
|
|
33
38
|
sourceId.value = props.sourceId || option.sourceId
|
|
39
|
+
mainCode.value = props.mainCode ||option.mainCode
|
|
34
40
|
uni.setNavigationBarTitle({ title: option.pageTitle })
|
|
35
41
|
|
|
36
42
|
})
|
|
@@ -81,13 +87,13 @@ async function queryList(pageNo: number, pageSize: number) {
|
|
|
81
87
|
// })
|
|
82
88
|
try {
|
|
83
89
|
|
|
84
|
-
const key = await getPageKey(sourceId.value, query.value)// 获取key
|
|
90
|
+
const key = await getPageKey(sourceId.value, mainCode.value,query.value)// 获取key
|
|
85
91
|
const data = await getPageData(key.data?.key, pageNo, pageSize)// 获取数据
|
|
86
92
|
// const count = await getPageTotal(key.data?.key)// 获取总数
|
|
87
|
-
paging.value.complete(data.data.entities)
|
|
93
|
+
paging.value.complete&&paging.value.complete(data.data.entities)
|
|
88
94
|
}
|
|
89
95
|
catch (error) {
|
|
90
|
-
paging.value&&paging.value.complete(false)
|
|
96
|
+
paging.value.complete&&paging.value&&paging.value.complete(false)
|
|
91
97
|
console.error(error)
|
|
92
98
|
}
|
|
93
99
|
}
|