@brms/ai-skills 0.1.0
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/README.md +256 -0
- package/bin/brms-skills.mjs +411 -0
- package/package.json +30 -0
- package/skills/brms-prototype-generator/SKILL.md +129 -0
- package/skills/brms-prototype-generator/agents/openai.yaml +7 -0
- package/skills/brms-prototype-generator/examples/few-shot-examples.md +577 -0
- package/skills/brms-prototype-generator/references/01-list-query.md +444 -0
- package/skills/brms-prototype-generator/references/02-form-entry.md +129 -0
- package/skills/brms-prototype-generator/references/03-detail-display.md +125 -0
- package/skills/brms-prototype-generator/references/04-composite-page-package.md +339 -0
- package/skills/brms-prototype-generator/references/05-dialog-patterns.md +113 -0
- package/skills/brms-prototype-generator/references/06-backend-request-patterns.md +118 -0
- package/skills/brms-prototype-generator/references/resource-index.md +46 -0
- package/skills/brms-prototype-generator/references/system-prompt.md +242 -0
- package/skills/brms-prototype-generator/scripts/analyze-doc.mjs +554 -0
- package/skills/brms-prototype-generator/scripts/check-project.mjs +228 -0
- package/skills/brms-prototype-generator/scripts/discover-targets.mjs +158 -0
- package/skills/brms-prototype-generator/scripts/install-codex.mjs +74 -0
- package/skills/brms-prototype-generator/scripts/plan-pages.mjs +390 -0
- package/skills/brms-prototype-generator/scripts/validate-generated.mjs +838 -0
- package/skills/brms-prototype-generator/templates/user-input-template.md +182 -0
- package/skills/brms-vxe-plus-developer/SKILL.md +105 -0
- package/skills/brms-vxe-plus-developer/agents/openai.yaml +7 -0
- package/skills/brms-vxe-plus-developer/references/prototype-to-real.md +54 -0
- package/skills/brms-vxe-plus-developer/references/real-base-development.md +110 -0
- package/skills/brms-vxe-plus-developer/references/resource-index.md +43 -0
- package/skills/brms-vxe-plus-developer/references/review-checklist.md +49 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/01-mental-model.md +150 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/02-vxe-plus-form.md +302 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/03-vxe-plus-table.md +253 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/04-example-map.md +488 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/05-request-and-eiinfo.md +170 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/90-anti-patterns.md +137 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/README.md +43 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/README.md +21 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/A1/P0/A1P01601.vue +483 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/A1/P1/A1P11011.vue +444 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/AB/BP/ABBP0201.vue +1648 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/AM/AF/component/AMAF0601/Bidding/formConfig.ts +228 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/AM/AF/component/AMAF0601/Record/columns.ts +110 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/BM/BR/BMBR01.vue +130 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/BM/BR/component/BMBR01/columns.ts +94 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/BM/BR/component/BMBR01/formConfig.ts +108 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Change/formConfig.ts +123 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Change/index.vue +103 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Clause/columns.ts +48 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Clause/index.vue +202 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Correcte/formConfig.ts +117 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Correcte/index.vue +103 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Pay/Payment/formConfig.ts +90 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Pay/Payment/index.vue +42 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Pay/columns.ts +376 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Pay/index.vue +619 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/Domestic/formConfig.ts +73 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/Domestic/index.vue +47 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/Foreign/formConfig.ts +141 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/Foreign/index.vue +42 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/columns.ts +123 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/index.vue +593 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/index.vue +68 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Fee/columns.ts +150 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Fee/index.vue +235 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Files/columns.ts +63 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Files/index.vue +117 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Goods/columns.ts +327 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Goods/index.vue +790 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Approve/formConfig.ts +341 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Approve/index.vue +63 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Approve2/formConfig.ts +232 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Approve2/index.vue +27 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Diff/columns.ts +46 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Diff/index.vue +92 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/formConfig.ts +979 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/index.vue +62 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Other/formConfig.ts +179 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Other/index.vue +140 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Sign/formConfig.ts +118 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Sign/index.vue +44 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/index.vue +168 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Party/Major/formConfig.ts +257 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Party/Major/index.vue +47 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Party/columns.ts +256 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Party/index.vue +738 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Price/formConfig.ts +174 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Price/index.vue +51 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Top/index.vue +924 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/SM/SW/SMSW0101.vue +567 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/demo/index.vue +448 -0
- package/skills/brms-vxe-plus-developer/scripts/check-project.mjs +259 -0
- package/skills/brms-vxe-plus-developer/scripts/check-vxe-plus-page.mjs +137 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Description: 数据采集详情
|
|
3
|
+
* @Autor: 池樱千幻
|
|
4
|
+
* @Change: 池樱千幻
|
|
5
|
+
* @Date: 2025-04-07 14:57:17
|
|
6
|
+
* @LastEditTime: 2026-03-12 14:50:14
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<bx-container auto :title="title">
|
|
10
|
+
<div class="bx-container">
|
|
11
|
+
<div v-if="pageComponentType !== 'FORM'" class="flex flex-col flex-1">
|
|
12
|
+
<VxePlusTable
|
|
13
|
+
v-if="showTable" id="A1P1101001_result" ref="xGrid" :columns="columns"
|
|
14
|
+
:service-config="serviceConfig" :form-config="formConfig" :show-checkbox="true"
|
|
15
|
+
:toolbar-buttons="toolbarButtons" :is-edit="dataCollectStatus === '10'" :is-import="true" :is-export-template="true"
|
|
16
|
+
:export-config="exportConfig" v-on="gridEvents"
|
|
17
|
+
/>
|
|
18
|
+
<div v-else v-loading="!showTable" class="flex flex-1 items-center justify-center" />
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div v-if="pageComponentType === 'FORM'" class="flex flex-col flex-1">
|
|
22
|
+
<VxePlusForm v-if="showTable" ref="xForm" :form-options="formOptions" :form-events="formEvents" />
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</bx-container>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import { EiBlock, EiCommunicator, EiInfo } from '@eplat/ei'
|
|
30
|
+
import { onMounted, reactive, ref } from 'vue'
|
|
31
|
+
import type { VxeGridProps } from 'vxe-table'
|
|
32
|
+
import type { VxeFormProps } from 'vxe-pc-ui'
|
|
33
|
+
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
34
|
+
import { useDialog } from '@vxe-plus/components'
|
|
35
|
+
import { multiply } from 'xe-utils'
|
|
36
|
+
import { useTable } from '@/hooks/useTable'
|
|
37
|
+
import vxeTableDialog from '@/views/A1/P1/vxeTableDialog.vue'
|
|
38
|
+
import { getCodeSetByService } from '@/utils/eiTools'
|
|
39
|
+
import { convertToCamelCase } from '@/utils'
|
|
40
|
+
import { isEmpty } from '@/utils/is'
|
|
41
|
+
import YearDialog from '@/views/A1/P2/dialog/Year/index.vue'
|
|
42
|
+
|
|
43
|
+
const route = useRoute()
|
|
44
|
+
|
|
45
|
+
const showTable = ref(false)
|
|
46
|
+
|
|
47
|
+
const xGrid = ref<any>(null)
|
|
48
|
+
const xForm = ref<any>(null)
|
|
49
|
+
const pageComponentType = ref('FORM')
|
|
50
|
+
const title = ref('记录集')
|
|
51
|
+
const dataCollectStatus = ref('10')
|
|
52
|
+
let columns: any = null
|
|
53
|
+
|
|
54
|
+
const exportConfig = reactive({
|
|
55
|
+
fileName: '导入模板',
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const formOptions = ref<VxeFormProps<any>>({})
|
|
59
|
+
|
|
60
|
+
const { p1DataCollectHeadId, dataItemCode } = route.query as any
|
|
61
|
+
|
|
62
|
+
const formConfig = reactive({
|
|
63
|
+
data: {
|
|
64
|
+
p1DataCollectHeadId,
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const formData = ref<any>({})
|
|
69
|
+
// table按钮列表
|
|
70
|
+
const btnList: any = [
|
|
71
|
+
{ name: '新增', code: 'add', status: 'primary', dataCollectStatus: '10' },
|
|
72
|
+
{ name: '复制历史数据', code: 'copy_his', status: 'primary', dataCollectStatus: '10' },
|
|
73
|
+
{ name: '删除', code: 'del', status: 'error', dataCollectStatus: '10' },
|
|
74
|
+
{ name: '保存', code: 'SAVE', status: 'success', dataCollectStatus: '10' },
|
|
75
|
+
{ name: '确认', code: 'confirm', status: 'success', dataCollectStatus: '10' },
|
|
76
|
+
{ name: '取消确认', code: 'cancelConfirm', status: 'warning', dataCollectStatus: '40' },
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
const toolbarButtons = ref<NonNullable<VxeGridProps['toolbarConfig']>['buttons']>([
|
|
80
|
+
])
|
|
81
|
+
const info = new EiInfo()
|
|
82
|
+
|
|
83
|
+
let inquStatusBlock = new EiBlock('inqu_status')
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @description: 根据fieldAttrJson获取配置
|
|
87
|
+
* @param {*} item
|
|
88
|
+
* @return {*}
|
|
89
|
+
* @author: 池樱千幻
|
|
90
|
+
*/
|
|
91
|
+
function getJsonByfieldAttrJson(item: any) {
|
|
92
|
+
if (!item.fieldAttrJson) {
|
|
93
|
+
return {}
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
const json = JSON.parse(item.fieldAttrJson)
|
|
97
|
+
const obj: any = {}
|
|
98
|
+
if (json.width) {
|
|
99
|
+
obj.width = json.width
|
|
100
|
+
}
|
|
101
|
+
obj.visible = true
|
|
102
|
+
if (json.visible) {
|
|
103
|
+
obj.visible = json.visible !== '0'
|
|
104
|
+
}
|
|
105
|
+
if (json.isEdit) {
|
|
106
|
+
obj.isEdit = json.isEdit !== '0'
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (item.fieldLabel === 'select') {
|
|
110
|
+
obj.codeSet = json.codeSet
|
|
111
|
+
obj.condition = json?.selectConfig?.condition
|
|
112
|
+
if (json.cascadeConfig) {
|
|
113
|
+
obj.cascadeFields = json.cascadeConfig.cascadeFields
|
|
114
|
+
obj.cascadePromiseFnFields = json.cascadeConfig.cascadePromiseFnFields
|
|
115
|
+
obj.cascadePromiseFnItemFields = json.cascadeConfig.cascadePromiseFnItemFields
|
|
116
|
+
obj.cascadePromiseFn = (params: any) => getCodeSetByService({
|
|
117
|
+
serviceName: json.cascadeConfig.api.split('.')[0],
|
|
118
|
+
methodName: json.cascadeConfig.api.split('.')[1],
|
|
119
|
+
params,
|
|
120
|
+
label: json.cascadeConfig.label,
|
|
121
|
+
value: json.cascadeConfig.value,
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
if (json.selectConfig) {
|
|
125
|
+
obj.fields = json.selectConfig.fields
|
|
126
|
+
obj.selectFields = json.selectConfig.selectFields
|
|
127
|
+
}
|
|
128
|
+
if (json.codeSetType === 'api') {
|
|
129
|
+
const ei = new EiInfo()
|
|
130
|
+
if (json.condition) {
|
|
131
|
+
Object.keys(json.condition).forEach((str) => {
|
|
132
|
+
ei.set(str, json.condition[str])
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
obj.promiseFn = () => getCodeSetByService({
|
|
136
|
+
serviceName: json.codeSet.split('.')[0],
|
|
137
|
+
methodName: json.codeSet.split('.')[1],
|
|
138
|
+
params: ei,
|
|
139
|
+
label: json.optionLabel,
|
|
140
|
+
value: json.optionValue,
|
|
141
|
+
})
|
|
142
|
+
obj.codeSet = `com.brms.custom.${item.fieldSort}`
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (item.fieldLabel === 'dialog') {
|
|
146
|
+
obj.componentParam = json.dialogConfig.componentParam
|
|
147
|
+
obj.fields = json.dialogConfig.fields
|
|
148
|
+
obj.dialogFields = json.dialogConfig.dialogFields
|
|
149
|
+
}
|
|
150
|
+
return obj
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
console.error('getJsonByfieldAttrJson error: ', error)
|
|
154
|
+
return {}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function initTable() {
|
|
159
|
+
if (p1DataCollectHeadId) {
|
|
160
|
+
showTable.value = false
|
|
161
|
+
info.addBlock(EiBlock.build('inqu_status', [{ p1DataCollectHeadId }]))
|
|
162
|
+
EiCommunicator.send('A1P11020', 'queryDetail', info).then((res: EiInfo) => {
|
|
163
|
+
inquStatusBlock = res.getBlock('inqu_status')
|
|
164
|
+
const currentOpt = res.getBlock('result1').getMappedRows()[0]
|
|
165
|
+
const inqu_status = res.getBlock('inqu_status').getMappedRows()[0]
|
|
166
|
+
dataCollectStatus.value = inqu_status.dataCollectStatus
|
|
167
|
+
pageComponentType.value = currentOpt.pageComponentType
|
|
168
|
+
toolbarButtons.value = btnList.filter((item: any) => {
|
|
169
|
+
return item.dataCollectStatus === dataCollectStatus.value
|
|
170
|
+
}).map((item: any) => {
|
|
171
|
+
return {
|
|
172
|
+
name: item.name,
|
|
173
|
+
content: item.name,
|
|
174
|
+
code: item.code,
|
|
175
|
+
status: item.status,
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
let result2 = res.getBlock('result2').getMappedRows()
|
|
180
|
+
// 先将 fieldLabel : "titleLabel" 的数据过滤并单独提出
|
|
181
|
+
const titleLabel = result2.find(item => item.fieldLabel === 'titleLabel')
|
|
182
|
+
title.value = titleLabel?.fieldName
|
|
183
|
+
exportConfig.fileName = titleLabel?.fieldName
|
|
184
|
+
|
|
185
|
+
result2 = result2.filter(item => item.fieldLabel !== 'titleLabel' && item.fieldLabel !== 'seq')
|
|
186
|
+
if (pageComponentType.value !== 'FORM') {
|
|
187
|
+
const result2Columns: any = result2.map((item) => {
|
|
188
|
+
let isEdit = dataCollectStatus.value === '10'
|
|
189
|
+
const field = convertToCamelCase(item.fieldCode || '')
|
|
190
|
+
const json = getJsonByfieldAttrJson(item)
|
|
191
|
+
if (json.isEdit !== undefined) {
|
|
192
|
+
isEdit = json.isEdit
|
|
193
|
+
}
|
|
194
|
+
console.log('json: ', json)
|
|
195
|
+
if (item.fieldLabel === 'percentage') {
|
|
196
|
+
return {
|
|
197
|
+
width: json.width || 120,
|
|
198
|
+
field,
|
|
199
|
+
title: item.fieldName,
|
|
200
|
+
editType: 'percentage',
|
|
201
|
+
visible: json.visible,
|
|
202
|
+
isEdit,
|
|
203
|
+
formatter: ({ cellValue }) => !isEmpty(cellValue) ? `${multiply(Number.parseFloat(cellValue), 100)}%` : '',
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (item.fieldLabel === 'input') {
|
|
207
|
+
return {
|
|
208
|
+
width: json.width || 120,
|
|
209
|
+
field,
|
|
210
|
+
title: item.fieldName,
|
|
211
|
+
editType: 'input',
|
|
212
|
+
visible: json.visible,
|
|
213
|
+
isEdit,
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (item.fieldLabel === 'seq') {
|
|
217
|
+
return {
|
|
218
|
+
type: 'seq',
|
|
219
|
+
width: 60,
|
|
220
|
+
editType: 'input',
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (item.fieldLabel === 'select') {
|
|
224
|
+
return {
|
|
225
|
+
field,
|
|
226
|
+
title: item.fieldName,
|
|
227
|
+
isEdit,
|
|
228
|
+
visible: json.visible,
|
|
229
|
+
editRender: {
|
|
230
|
+
name: 'tableSelect',
|
|
231
|
+
props: {
|
|
232
|
+
...json,
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (item.fieldLabel === 'dialog') {
|
|
238
|
+
if (json.componentParam) {
|
|
239
|
+
json.componentParam.dataCollectYear = inqu_status.dataCollectYear
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
field,
|
|
243
|
+
title: item.fieldName,
|
|
244
|
+
isEdit,
|
|
245
|
+
editRender: {
|
|
246
|
+
name: 'tableSelectDialog',
|
|
247
|
+
props: {
|
|
248
|
+
component: vxeTableDialog,
|
|
249
|
+
...json,
|
|
250
|
+
title: `${title.value}-${item.fieldName}`,
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return {
|
|
256
|
+
field,
|
|
257
|
+
title: item.fieldName,
|
|
258
|
+
editType: 'input',
|
|
259
|
+
isEdit,
|
|
260
|
+
visible: json.visible,
|
|
261
|
+
}
|
|
262
|
+
})
|
|
263
|
+
console.log('result2Columns', result2Columns)
|
|
264
|
+
columns = useTable().createColumns(result2Columns)
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
const result = res.getBlock('result').getMappedRows()
|
|
268
|
+
|
|
269
|
+
formData.value = result2.reduce((acc, item) => {
|
|
270
|
+
const field = convertToCamelCase(item.fieldCode)
|
|
271
|
+
acc[field] = result[0] ? result[0][field] : ''
|
|
272
|
+
return acc
|
|
273
|
+
}, result[0] || {})
|
|
274
|
+
|
|
275
|
+
const items: any = result2.map((item) => {
|
|
276
|
+
return {
|
|
277
|
+
field: convertToCamelCase(item.fieldCode),
|
|
278
|
+
title: item.fieldName,
|
|
279
|
+
itemRender: { name: 'BxInputPercentage' },
|
|
280
|
+
}
|
|
281
|
+
})
|
|
282
|
+
const formBtnList = [
|
|
283
|
+
{ content: '保存', name: 'SAVE', status: 'primary', dataCollectStatus: '10' },
|
|
284
|
+
{ content: '确认', name: 'confirm', status: 'primary', dataCollectStatus: '10' },
|
|
285
|
+
{ content: '取消确认', name: 'cancelConfirm', status: 'primary', dataCollectStatus: '40' },
|
|
286
|
+
]
|
|
287
|
+
items.push({
|
|
288
|
+
span: 24,
|
|
289
|
+
align: 'center',
|
|
290
|
+
itemRender: {
|
|
291
|
+
name: 'VxeButtonGroup',
|
|
292
|
+
options: formBtnList.filter((item: any) => {
|
|
293
|
+
return item.dataCollectStatus === dataCollectStatus.value
|
|
294
|
+
}),
|
|
295
|
+
props: {
|
|
296
|
+
onClick: ({ name }) => {
|
|
297
|
+
console.log('name: ', name)
|
|
298
|
+
if (name === 'SAVE') {
|
|
299
|
+
formSave()
|
|
300
|
+
}
|
|
301
|
+
if (name === 'confirm') {
|
|
302
|
+
formConfirm()
|
|
303
|
+
}
|
|
304
|
+
if (name === 'cancelConfirm') {
|
|
305
|
+
formCancelConfirm()
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
})
|
|
311
|
+
formOptions.value = {
|
|
312
|
+
data: formData.value,
|
|
313
|
+
items,
|
|
314
|
+
readonly: dataCollectStatus.value === '40',
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
showTable.value = true
|
|
319
|
+
// inqu_status 主信息,result明细信息,result1 数据项(FORM或GRID),result2 列名信息
|
|
320
|
+
})
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
const serviceConfig = reactive({
|
|
325
|
+
serviceName: 'A1P11020',
|
|
326
|
+
queryMethod: 'queryDetail',
|
|
327
|
+
})
|
|
328
|
+
|
|
329
|
+
const { openDialog } = useDialog()
|
|
330
|
+
|
|
331
|
+
const gridEvents = reactive({
|
|
332
|
+
toolbarButtonClick: async ({ code, $grid }: { code: string, $grid: any }) => {
|
|
333
|
+
if (code === 'copy_his') {
|
|
334
|
+
openDialog(YearDialog, {
|
|
335
|
+
title: '复制历史数据',
|
|
336
|
+
componentParam: {
|
|
337
|
+
selectMode: 'multi',
|
|
338
|
+
columns: columns.value.filter(k => k.visible ?? true).map((k) => {
|
|
339
|
+
return {
|
|
340
|
+
...k,
|
|
341
|
+
width: '',
|
|
342
|
+
} as any
|
|
343
|
+
}),
|
|
344
|
+
param: {
|
|
345
|
+
dataItemCode,
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
}, async (checkedRows, exposed) => {
|
|
349
|
+
console.log('checkedRows', checkedRows)
|
|
350
|
+
await $grid.insertAt(checkedRows.map((row) => {
|
|
351
|
+
row.p1DataCollectHeadId = p1DataCollectHeadId
|
|
352
|
+
delete row.p1DataCollectLineId
|
|
353
|
+
return row
|
|
354
|
+
}))
|
|
355
|
+
exposed.close()
|
|
356
|
+
})
|
|
357
|
+
}
|
|
358
|
+
if (code === 'add') {
|
|
359
|
+
const { row: newRow } = await $grid.insertAt({
|
|
360
|
+
})
|
|
361
|
+
$grid.setEditRow(newRow)
|
|
362
|
+
}
|
|
363
|
+
if (code === 'cancelConfirm') {
|
|
364
|
+
formCancelConfirm()
|
|
365
|
+
}
|
|
366
|
+
if (code === 'confirm') {
|
|
367
|
+
formConfirm()
|
|
368
|
+
}
|
|
369
|
+
if (code === 'SAVE') {
|
|
370
|
+
const updateRecords = $grid.getUpdateRecords()
|
|
371
|
+
const insertRecords = $grid.getInsertRecords()
|
|
372
|
+
const saveInfo = new EiInfo()
|
|
373
|
+
saveInfo.addBlock(inquStatusBlock)
|
|
374
|
+
|
|
375
|
+
const saveRecords = [...updateRecords, ...insertRecords]
|
|
376
|
+
if (saveRecords.length > 0) {
|
|
377
|
+
saveInfo.addBlock(EiBlock.build('result', saveRecords.map((item: any) => {
|
|
378
|
+
return {
|
|
379
|
+
...item,
|
|
380
|
+
p1DataCollectHeadId,
|
|
381
|
+
}
|
|
382
|
+
})))
|
|
383
|
+
|
|
384
|
+
await EiCommunicator.send('A1P11021', 'save', saveInfo)
|
|
385
|
+
ElMessage.success('保存成功')
|
|
386
|
+
$grid.commitProxy('query')
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
ElMessage.warning('没有需要保存的数据')
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (code === 'del') {
|
|
394
|
+
const checkboxRecords = xGrid.value?.getCheckboxRecords()
|
|
395
|
+
if (!checkboxRecords.getBlock('result')) {
|
|
396
|
+
ElMessage.error('请选择要删除的记录')
|
|
397
|
+
return
|
|
398
|
+
}
|
|
399
|
+
ElMessageBox.confirm('确定删除吗?').then(() => {
|
|
400
|
+
EiCommunicator.send('A1P11021', 'delete', checkboxRecords).then(() => {
|
|
401
|
+
ElMessage.success('删除成功')
|
|
402
|
+
$grid.commitProxy('query')
|
|
403
|
+
})
|
|
404
|
+
})
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
})
|
|
408
|
+
|
|
409
|
+
async function formSave() {
|
|
410
|
+
const saveInfo = new EiInfo()
|
|
411
|
+
saveInfo.addBlock(inquStatusBlock)
|
|
412
|
+
saveInfo.addBlock(EiBlock.build('result', [{
|
|
413
|
+
...formData.value,
|
|
414
|
+
p1DataCollectHeadId,
|
|
415
|
+
}]))
|
|
416
|
+
await EiCommunicator.send('A1P11021', 'save', saveInfo)
|
|
417
|
+
ElMessage.success('保存成功')
|
|
418
|
+
initTable()
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
async function formConfirm() {
|
|
422
|
+
await ElMessageBox.confirm('确定确认吗?')
|
|
423
|
+
await EiCommunicator.send('A1P11020', 'confirm', info)
|
|
424
|
+
ElMessage.success('确认成功')
|
|
425
|
+
initTable()
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
async function formCancelConfirm() {
|
|
429
|
+
await ElMessageBox.confirm('确定取消确认吗?')
|
|
430
|
+
await EiCommunicator.send('A1P11020', 'notConfirm', info)
|
|
431
|
+
ElMessage.success('取消确认成功')
|
|
432
|
+
initTable()
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
const formEvents = reactive({
|
|
436
|
+
'form-submit': formSave,
|
|
437
|
+
})
|
|
438
|
+
|
|
439
|
+
onMounted(() => {
|
|
440
|
+
initTable()
|
|
441
|
+
})
|
|
442
|
+
</script>
|
|
443
|
+
|
|
444
|
+
<style scoped></style>
|