@utogether/udp-core 1.0.1-beta.4 → 1.0.1-beta.5
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/build/plugins.ts +39 -37
- package/dist/{403-CT4J-t-o.js → 403-CP2RkkAy.js} +10 -10
- package/dist/{404-BAudfnaK.js → 404-DwK-0wNQ.js} +4 -4
- package/dist/{500-BlOGtpEE.js → 500-CLbJDqnd.js} +1 -1
- package/dist/{AuthorityInfo-Bl03tEhF.js → AuthorityInfo-Bi1_uhMu.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-CUwS2F3R.js → AuthorityInfo.vue_vue_type_style_index_0_lang-RUhvzu76.js} +8 -9
- package/dist/{Company-CIj9XgQn.js → Company-B--cokc6.js} +3 -3
- package/dist/{CompanyPanel-CublK5NN.js → CompanyPanel-B_gmcZ9L.js} +6 -6
- package/dist/{Department-BolPW-W3.js → Department-DbKdyNzK.js} +3 -3
- package/dist/{DepartmentPanel-BttxSHfM.js → DepartmentPanel-BmEttboJ.js} +23 -24
- package/dist/{DesignPanel-BwCbn92O.js → DesignPanel-LL68_36s.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-y2AnCTg6.js → DesignPanel.vue_vue_type_style_index_0_lang-DWPmFegv.js} +8 -9
- package/dist/{DictView-D85ziNV2.js → DictView-B8j-EWx5.js} +1 -1
- package/dist/{InvOrganization-CaAk_f7F.js → InvOrganization-DnGQlESM.js} +7 -8
- package/dist/Org-Dg9Xkd34.js +34 -0
- package/dist/{Preview-DMGbhV6q.js → Preview-yot4NBW5.js} +1 -1
- package/dist/{ReportDefine-DogZwa8T.js → ReportDefine-DHadqNYy.js} +1 -1
- package/dist/{ReportDesign-CdSsJJeA.js → ReportDesign-CBihGRth.js} +23 -24
- package/dist/{ReportQuery-DPvKqeUm.js → ReportQuery-CwHQ6LUU.js} +1 -1
- package/dist/{ReportQueryFrom-UokkfBx_.js → ReportQueryFrom-ie6lQcGL.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-BlOoThY7.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-B8LJNK0m.js} +1 -1
- package/dist/{ReportTemplate-DCnmllXW.js → ReportTemplate-B2Smwo-z.js} +18 -18
- package/dist/{Role-sfmwLiNM.js → Role-Cf7DB7uS.js} +3 -3
- package/dist/{RoleAssign-WRk90VO2.js → RoleAssign-upUnqs_i.js} +3 -3
- package/dist/{RolePanel-iWysS02n.js → RolePanel-BBGDGK8V.js} +1 -1
- package/dist/{RolePanel-DhP0_5ur.js → RolePanel-EXL_FLvM.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CYXqW-d4.js → RolePanel.vue_vue_type_script_setup_true_lang-BwfL_JVZ.js} +8 -9
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-_hVY31HC.js → RolePanel.vue_vue_type_script_setup_true_lang-DF8qJKwW.js} +9 -9
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-BozDFES-.js → ScrollPanel.vue_vue_type_style_index_0_lang-DbBGg32H.js} +13 -13
- package/dist/{Staff-Bha-Ijax.js → Staff-DYu5ZEyR.js} +3 -3
- package/dist/{StaffInfo-CbfYI8UW.js → StaffInfo-CHvNGjtz.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-Ce-MUVYH.js → StaffInfo.vue_vue_type_script_setup_true_lang-XRJVEJ-s.js} +14 -14
- package/dist/{StaffPanel-B8094e97.js → StaffPanel-C-ygEY65.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-_kJIBCtx.js → StaffPanel.vue_vue_type_script_setup_true_lang-BvLrF4Yw.js} +6 -6
- package/dist/{SysUser-D1J9vPnb.js → SysUser-BHk_szpK.js} +2 -2
- package/dist/{SysUserPanel-DGDPKKoY.js → SysUserPanel-DFvzA5d-.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-D-5-zKn6.js → SysUserPanel.vue_vue_type_script_setup_true_lang-B9zUXXwa.js} +24 -25
- package/dist/{SystemMenu-Dz8Pllh5.js → SystemMenu-5TK9ZA11.js} +34 -35
- package/dist/{UserInfo-ecAJA2Yg.js → UserInfo-Bx3zQqHa.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-4_-I_sQN.js → UserInfo.vue_vue_type_style_index_0_lang-C2sqUQdg.js} +12 -13
- package/dist/{childView-4uI_RT2m.js → childView-BSUWnii7.js} +1 -1
- package/dist/{childView-OXXoMFg3.js → childView-CFC3gA_U.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-DC-yx4Kv.js → childView.vue_vue_type_style_index_0_lang-EcT-Dux7.js} +48 -49
- package/dist/{childView.vue_vue_type_style_index_0_lang-e43PUsUO.js → childView.vue_vue_type_style_index_0_lang-WQVLSJR8.js} +9 -10
- package/dist/{code-rule-B667R66s.js → code-rule-DybjhotB.js} +6 -8
- package/dist/core.es.js +2 -2
- package/dist/{cron-task-DcmGSr2D.js → cron-task-DGdknqaF.js} +7 -8
- package/dist/{frameView-BzgaLYjQ.js → frameView-BOOZRv1S.js} +1 -1
- package/dist/index-BDE4-ZvN.js +5091 -0
- package/dist/{layoutView-BBQB8pDc.js → layoutView-BWeDLY9C.js} +11 -12
- package/dist/{login-DIG7pRU7.js → login-BcuCHhGE.js} +21 -21
- package/dist/{login-log-CvVnyGi3.js → login-log-kqKzKTto.js} +1 -1
- package/dist/{lov-view-CSIPKZSY.js → lov-view-DDgzqYSW.js} +8 -9
- package/dist/{menuInfo-CPHjl7id.js → menuInfo-B3MOxomU.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-BXNiinTg.js → menuInfo.vue_vue_type_style_index_0_lang-BXMrNMUs.js} +15 -16
- package/dist/{pda-app-BLjbMcdt.js → pda-app-Dy9WMHEG.js} +19 -20
- package/dist/{resource-MxqaSJqB.js → resource-BoCP7-dM.js} +8 -8
- package/dist/{su-welcome-C0flTYCx.js → su-welcome-DXpI1MHr.js} +97 -98
- package/dist/{sys-config-CXzGs3Nl.js → sys-config-BiUWzxGU.js} +19 -20
- package/dist/udp-core.css +2 -2
- package/dist/{utogether-CFdIDuAT.js → utogether-DXDcsKt7.js} +1 -1
- package/package.json +1 -1
- package/src/App.vue +1 -1
- package/src/api/index.ts +1 -1
- package/src/components/udp/count-down.vue +536 -0
- package/src/components/udp/form.vue +107 -0
- package/src/components/udp/index.ts +4 -1
- package/src/components/udp/modal-form.vue +9 -0
- package/src/components/udp/upload.vue +425 -0
- package/src/components/udp/utils.ts +72 -3
- package/src/layout/components/lay-panel/index.vue +3 -3
- package/src/main.ts +21 -20
- package/src/style/vxetable.scss +24 -2
- package/src/utils/{http → udp/http}/index.ts +8 -24
- package/src/utils/{http → udp/http}/types.d.ts +8 -5
- package/src/views/login/login-view.vue +1 -1
- package/src/views/system/menu/menuInfo.vue +1 -1
- package/src/views/system/sys/sys-config.vue +1 -1
- package/src/views/udev/dict/childView.vue +6 -1
- package/src/views/uhome/su-welcome.vue +1 -1
- package/src/views/ulogin/login.vue +3 -2
- package/src/views/upms/user/login-log.vue +1 -1
- package/src/views/urpt/design/ReportDesign.vue +3 -3
- package/dist/Org-CreIihFE.js +0 -35
- package/dist/await-to-js.es5-BtRbN2QH.js +0 -10
- package/dist/index-CLliRySq.js +0 -2606
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2022-06-21 14:50:52
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-08-03 16:01:16
|
|
6
|
+
* @Description: excel数据导入
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<vxe-modal v-model="visible" :show-header="false" fullscreen remember @close="onClose">
|
|
10
|
+
<template #default>
|
|
11
|
+
<vxe-grid ref="xgrid" v-bind="gridOptions" v-on="gridEvents">
|
|
12
|
+
<template v-for="col in columns" :key="col.field" #[col.field!]="{ row }">
|
|
13
|
+
<el-select v-if="col.dictCode && !col.disabled" v-model.trim="row[col.field!]" clearable>
|
|
14
|
+
<el-option
|
|
15
|
+
v-for="child in dict[col.dictCode]?.children"
|
|
16
|
+
:key="child.dictCode"
|
|
17
|
+
:value="child.dictCode"
|
|
18
|
+
:label="child.dictName"
|
|
19
|
+
/>
|
|
20
|
+
</el-select>
|
|
21
|
+
<el-date-picker
|
|
22
|
+
v-else-if="['date', 'month', 'datetime'].includes(col.dataType) && !col.disabled"
|
|
23
|
+
v-model.trim="row[col.field!]"
|
|
24
|
+
:type="col.dataType"
|
|
25
|
+
value-format="YYYY-MM-DD hh:mm:ss"
|
|
26
|
+
/>
|
|
27
|
+
<input v-else-if="!col.da && !col.disabled" v-model.trim="row[col.field!]" class="ut-input" />
|
|
28
|
+
<span v-else-if="!showErrorMsg">{{ row[col.field!] }}</span>
|
|
29
|
+
<span v-else>{{ row[col.field!] }}</span>
|
|
30
|
+
</template>
|
|
31
|
+
<template #pager>
|
|
32
|
+
<vxe-pager
|
|
33
|
+
v-model:current-page="listQuery.currentPage"
|
|
34
|
+
v-model:page-size="listQuery.pageSize"
|
|
35
|
+
:layouts="layouts"
|
|
36
|
+
:page-sizes="[200, 500, 1000, 2000, 5000, 10000]"
|
|
37
|
+
:total="listQuery.total"
|
|
38
|
+
@page-change="handlePageChange"
|
|
39
|
+
/></template>
|
|
40
|
+
</vxe-grid>
|
|
41
|
+
</template>
|
|
42
|
+
</vxe-modal>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts">
|
|
46
|
+
export default {
|
|
47
|
+
name: 'UtUpload'
|
|
48
|
+
};
|
|
49
|
+
</script>
|
|
50
|
+
<script setup lang="ts">
|
|
51
|
+
import { reactive, ref, watch, getCurrentInstance } from 'vue';
|
|
52
|
+
import { toDateString } from 'xe-utils';
|
|
53
|
+
import { storageLocal, cookies, warnMessage } from '@utogether/utils';
|
|
54
|
+
import Big from 'big.js';
|
|
55
|
+
import { useI18n } from 'vue-i18n';
|
|
56
|
+
// import type { IRecord, ITableColProps } from '../../types';
|
|
57
|
+
import { VxeTableInstance, VxeGridProps, VxeGridListeners } from 'vxe-table';
|
|
58
|
+
import { VxeUI } from 'vxe-pc-ui';
|
|
59
|
+
import type { VxePagerPropTypes, VxePagerEvents } from 'vxe-pc-ui';
|
|
60
|
+
|
|
61
|
+
export interface IProps {
|
|
62
|
+
defaultParams?: IRecord;
|
|
63
|
+
options?: IRecord;
|
|
64
|
+
columns: Array<ITableColProps>;
|
|
65
|
+
templateData?: Array<ITableColProps>;
|
|
66
|
+
serviceCode?: string;
|
|
67
|
+
url?: string;
|
|
68
|
+
sourceList?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
72
|
+
defaultParams: (): IRecord => {
|
|
73
|
+
return {};
|
|
74
|
+
},
|
|
75
|
+
options: (): IRecord => {
|
|
76
|
+
return {
|
|
77
|
+
filename: '数据模板',
|
|
78
|
+
errorField: 'errorMsg',
|
|
79
|
+
errListField: 'list'
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
columns: () => [],
|
|
83
|
+
templateData: () => [],
|
|
84
|
+
sourceList: 'list'
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const instance = getCurrentInstance()!;
|
|
88
|
+
const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
|
|
89
|
+
const visible = defineModel<boolean>('visible');
|
|
90
|
+
|
|
91
|
+
const { t } = useI18n();
|
|
92
|
+
|
|
93
|
+
const showErrorMsg = ref(false);
|
|
94
|
+
|
|
95
|
+
const dict = storageLocal.getItem('kLov');
|
|
96
|
+
|
|
97
|
+
watch(
|
|
98
|
+
() => visible.value,
|
|
99
|
+
nv => {
|
|
100
|
+
if (nv) {
|
|
101
|
+
gridOptions.data = [];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const getColumns = () => {
|
|
107
|
+
const columns = props.columns.map(col => {
|
|
108
|
+
col.slots = { default: col.field };
|
|
109
|
+
col.title = col.field;
|
|
110
|
+
return col;
|
|
111
|
+
});
|
|
112
|
+
const col: ITableColProps = {
|
|
113
|
+
type: 'checkbox',
|
|
114
|
+
width: 40,
|
|
115
|
+
align: 'center',
|
|
116
|
+
fixed: 'left'
|
|
117
|
+
};
|
|
118
|
+
columns.unshift(col);
|
|
119
|
+
return columns;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const listQuery = ref({ pageSize: 200, currentPage: 1, total: 0 });
|
|
123
|
+
|
|
124
|
+
const layouts: VxePagerPropTypes.Layouts = [
|
|
125
|
+
'Sizes',
|
|
126
|
+
'PrevJump',
|
|
127
|
+
'PrevPage',
|
|
128
|
+
'Number',
|
|
129
|
+
'NextPage',
|
|
130
|
+
'NextJump',
|
|
131
|
+
'FullJump',
|
|
132
|
+
'Total'
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
const height = window.innerHeight - 25;
|
|
136
|
+
|
|
137
|
+
const xgrid = ref<VxeTableInstance>();
|
|
138
|
+
// 导入的所有数据
|
|
139
|
+
let dataList: ITableColProps[] = [];
|
|
140
|
+
|
|
141
|
+
const importConfig = {
|
|
142
|
+
mode: 'covering',
|
|
143
|
+
types: ['csv', 'xlsx'],
|
|
144
|
+
afterImportMethod: onImportMethod
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const gridOptions = reactive<VxeGridProps>({
|
|
148
|
+
border: true,
|
|
149
|
+
height,
|
|
150
|
+
data: [],
|
|
151
|
+
importConfig,
|
|
152
|
+
showOverflow: true,
|
|
153
|
+
loading: false,
|
|
154
|
+
toolbarConfig: {
|
|
155
|
+
buttons: [
|
|
156
|
+
{
|
|
157
|
+
code: 'import_plus',
|
|
158
|
+
name: t('message.btn.upload'),
|
|
159
|
+
icon: 'ri-upload-2-line',
|
|
160
|
+
status: 'primary'
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
code: 'save_plus',
|
|
164
|
+
name: t('message.btn.save'),
|
|
165
|
+
icon: 'ri-save-3-line',
|
|
166
|
+
status: 'success'
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
code: 'del_plus',
|
|
170
|
+
name: t('message.btn.delete'),
|
|
171
|
+
icon: 'ri-delete-bin-line',
|
|
172
|
+
status: 'danger'
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
code: 'export_plus',
|
|
176
|
+
name: t('message.btn.downloadTemp'),
|
|
177
|
+
icon: 'ri-download-2-line',
|
|
178
|
+
status: 'warning'
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
tools: [
|
|
182
|
+
{
|
|
183
|
+
code: 'question',
|
|
184
|
+
name: t('message.btn.FAQ'),
|
|
185
|
+
status: 'primary',
|
|
186
|
+
icon: 'vxe-icon-info-circle-fill'
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
code: 'replay',
|
|
190
|
+
name: t('message.btn.back'),
|
|
191
|
+
status: 'info',
|
|
192
|
+
icon: 'vxe-icon-undo'
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
columns: getColumns()
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
const gridEvents: VxeGridListeners = {
|
|
200
|
+
toolbarButtonClick({ code }) {
|
|
201
|
+
// const $grid = xgrid.value;
|
|
202
|
+
switch (code) {
|
|
203
|
+
case 'import_plus': {
|
|
204
|
+
handleImport();
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
case 'save_plus': {
|
|
208
|
+
handleSave();
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
case 'del_plus': {
|
|
212
|
+
handleDelete();
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
case 'export_plus': {
|
|
216
|
+
handleDownLoadFile();
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
toolbarToolClick({ code }) {
|
|
222
|
+
// const $grid = xgrid.value;
|
|
223
|
+
switch (code) {
|
|
224
|
+
case 'replay': {
|
|
225
|
+
onClose();
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
case 'question': {
|
|
229
|
+
showImportQuestion();
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
const handleImport = () => {
|
|
237
|
+
dataList = [];
|
|
238
|
+
xgrid.value?.openImport();
|
|
239
|
+
};
|
|
240
|
+
// 导入后获取数据
|
|
241
|
+
function onImportMethod(options: any) {
|
|
242
|
+
dataList = options.$table.getTableData().fullData;
|
|
243
|
+
// 标题会默认导入,删除第一行
|
|
244
|
+
// dataList.splice(0, 1);
|
|
245
|
+
const columns = getColumns().filter(f => !f.type && f.mapField !== props.options.errorField);
|
|
246
|
+
columns.forEach(col => {
|
|
247
|
+
const idx = dataList.findIndex(data => data[col.field!] === col.field);
|
|
248
|
+
idx !== -1 && dataList.splice(idx, 1);
|
|
249
|
+
});
|
|
250
|
+
props.columns.forEach(col => {
|
|
251
|
+
if (col.dateFormatter || col.valueType === 'number') {
|
|
252
|
+
dataList.forEach(data => {
|
|
253
|
+
if (col.dateFormatter) {
|
|
254
|
+
data[col.field!] = toDateString(data[col.field!], col.dateFormatter || 'yyyy-MM-dd HH:mm:ss');
|
|
255
|
+
} else {
|
|
256
|
+
data[col.field!] = Big(data[col.field!]).toFixed(col.decimal || 6);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
listQuery.value.total = dataList.length;
|
|
262
|
+
getDataList();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const getDataList = () => {
|
|
266
|
+
const { currentPage, pageSize } = listQuery.value;
|
|
267
|
+
gridOptions.data = dataList.filter(
|
|
268
|
+
(data, idx) => idx < pageSize * currentPage && idx >= pageSize * (currentPage - 1)
|
|
269
|
+
);
|
|
270
|
+
};
|
|
271
|
+
// 切换页数
|
|
272
|
+
const handlePageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }) => {
|
|
273
|
+
listQuery.value.currentPage = currentPage;
|
|
274
|
+
listQuery.value.pageSize = pageSize;
|
|
275
|
+
getDataList();
|
|
276
|
+
};
|
|
277
|
+
// 模板下载
|
|
278
|
+
const handleDownLoadFile = () => {
|
|
279
|
+
const data: ITableColProps[] = [];
|
|
280
|
+
if (props.templateData.length) {
|
|
281
|
+
data.push(...props.templateData);
|
|
282
|
+
} else {
|
|
283
|
+
const obj: ITableColProps = {};
|
|
284
|
+
getColumns()
|
|
285
|
+
.filter(f => f.type !== 'checkbox')
|
|
286
|
+
.forEach(col => {
|
|
287
|
+
obj[col.field!] = '案例';
|
|
288
|
+
});
|
|
289
|
+
data.push(obj);
|
|
290
|
+
}
|
|
291
|
+
const opt: IRecord = {
|
|
292
|
+
filename: props.options.filename,
|
|
293
|
+
type: 'xlsx',
|
|
294
|
+
columns: getColumns().filter(f => f.mapField !== props.options.errorField && f.type !== 'checkbox'),
|
|
295
|
+
data
|
|
296
|
+
};
|
|
297
|
+
xgrid.value?.exportData(opt);
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
const handleSave = async () => {
|
|
301
|
+
if (!dataList.length) {
|
|
302
|
+
return warnMessage(t('message.importEmpty'));
|
|
303
|
+
}
|
|
304
|
+
const type = await VxeUI.modal.confirm(t('message.importRecord'));
|
|
305
|
+
if (type === 'confirm') {
|
|
306
|
+
gridOptions.loading = true;
|
|
307
|
+
const { url } = props;
|
|
308
|
+
formatterData('toSave');
|
|
309
|
+
serviceApi
|
|
310
|
+
.post(url, dataList)
|
|
311
|
+
.then((res: any) => {
|
|
312
|
+
if (res?.status === 'error' || res?.length) {
|
|
313
|
+
showErrorMsg.value = true;
|
|
314
|
+
setErrorMessage(res?.length ? res : res[props.options.errListField || props.sourceList]);
|
|
315
|
+
VxeUI.modal.message({
|
|
316
|
+
content: t('message.importFailed'),
|
|
317
|
+
status: 'error'
|
|
318
|
+
});
|
|
319
|
+
} else {
|
|
320
|
+
VxeUI.modal.message({
|
|
321
|
+
content: t('message.importSuccess'),
|
|
322
|
+
status: 'success'
|
|
323
|
+
});
|
|
324
|
+
onClose();
|
|
325
|
+
}
|
|
326
|
+
})
|
|
327
|
+
.finally(() => {
|
|
328
|
+
showErrorMsg.value = false;
|
|
329
|
+
gridOptions.loading = false;
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @description:删除行
|
|
336
|
+
*/
|
|
337
|
+
const handleDelete = () => {
|
|
338
|
+
const checkboxRecords = xgrid.value?.getCheckboxRecords();
|
|
339
|
+
if (!checkboxRecords?.length) {
|
|
340
|
+
return VxeUI.modal.message({
|
|
341
|
+
content: t('message.selectedRecord'),
|
|
342
|
+
status: 'warning'
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
checkboxRecords.forEach(record => {
|
|
346
|
+
const idx = dataList.findIndex(data => data._X_ROW_KEY === record._X_ROW_KEY)!;
|
|
347
|
+
idx !== -1 && dataList.splice(idx, 1);
|
|
348
|
+
});
|
|
349
|
+
gridOptions.data = dataList;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
const setErrorMessage = (array: ITableColProps[]) => {
|
|
353
|
+
listQuery.value.total = array.length;
|
|
354
|
+
dataList = array.map((item, idx) => {
|
|
355
|
+
item._X_ROW_KEY = idx;
|
|
356
|
+
return item;
|
|
357
|
+
});
|
|
358
|
+
formatterData('toShow');
|
|
359
|
+
getDataList();
|
|
360
|
+
};
|
|
361
|
+
const formatterData = (formatterType: string) => {
|
|
362
|
+
gridOptions.columns!.forEach((col: any) => {
|
|
363
|
+
if (formatterType === 'toSave') {
|
|
364
|
+
const commonParam = cookies.get('kCookies_param')
|
|
365
|
+
? JSON.parse(cookies.get('kCookies_param')!)
|
|
366
|
+
: {};
|
|
367
|
+
dataList.forEach(data => {
|
|
368
|
+
data[col.mapField] = data[col.field];
|
|
369
|
+
Object.assign(data, commonParam, props.defaultParams);
|
|
370
|
+
});
|
|
371
|
+
} else {
|
|
372
|
+
dataList.forEach(data => {
|
|
373
|
+
data[col.field] = data[col.mapField];
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
const showImportQuestion = () => {
|
|
380
|
+
VxeUI.modal.alert(t('message.importTip'), t('message.udp.tip'));
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
const emit = defineEmits<{ (e: 'close'): void }>();
|
|
384
|
+
|
|
385
|
+
const onClose = () => {
|
|
386
|
+
visible.value = false;
|
|
387
|
+
emit('close');
|
|
388
|
+
};
|
|
389
|
+
</script>
|
|
390
|
+
|
|
391
|
+
<style lang="scss" scoped>
|
|
392
|
+
.ut-input {
|
|
393
|
+
box-sizing: border-box;
|
|
394
|
+
box-sizing: border-box;
|
|
395
|
+
display: inline-block;
|
|
396
|
+
width: 100%;
|
|
397
|
+
height: 28px;
|
|
398
|
+
padding: 0 15px;
|
|
399
|
+
font-size: 13px;
|
|
400
|
+
line-height: 28px;
|
|
401
|
+
color: #606266;
|
|
402
|
+
background-color: #fff;
|
|
403
|
+
background-image: none;
|
|
404
|
+
border: 1px solid #dcdfe6;
|
|
405
|
+
border-radius: 4px;
|
|
406
|
+
outline: 0;
|
|
407
|
+
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
408
|
+
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
409
|
+
appearance: none;
|
|
410
|
+
|
|
411
|
+
&:hover {
|
|
412
|
+
border-color: #c0c4cc;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
&:focus {
|
|
416
|
+
border-color: #409eff;
|
|
417
|
+
outline: 0;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
&:disabled {
|
|
421
|
+
background-color: #f5f7fa;
|
|
422
|
+
outline: none;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
</style>
|
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
* @Author: levi7754 levi7754@163.com
|
|
3
3
|
* @Date: 2025-07-14 17:38:38
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-07-
|
|
5
|
+
* @LastEditTime: 2025-07-30 15:00:49
|
|
6
6
|
* @FilePath: \udp-front\packages\udp-core\src\components\udp\utils.ts
|
|
7
7
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
8
|
*/
|
|
9
|
-
import { clone, isString, isEmpty, toDateString, isObject, isFunction } from 'xe-utils';
|
|
10
|
-
import { cookies, storageLocal } from '@utogether/utils';
|
|
9
|
+
import { clone, isString, isEmpty, toDateString, isObject, isFunction, merge } from 'xe-utils';
|
|
10
|
+
import { cookies, storageLocal, useRender } from '@utogether/utils';
|
|
11
11
|
/** 系统配置的key */
|
|
12
12
|
const kSYSCONFIG = 'kSysConfig';
|
|
13
13
|
const kCOOKIES = 'kCookies_param';
|
|
14
14
|
|
|
15
15
|
const sysConfig = storageLocal.getItem(kSYSCONFIG);
|
|
16
16
|
|
|
17
|
+
const renderHook = useRender();
|
|
18
|
+
|
|
17
19
|
/** 工具栏按钮标准化 */
|
|
18
20
|
export const formatButton = (buttons, auth?) => {
|
|
19
21
|
buttons.forEach(btn => {
|
|
20
22
|
btn.auth = auth ? auth[btn.code] || btn.auth : btn.auth;
|
|
23
|
+
debugger;
|
|
21
24
|
if (!btn.name) {
|
|
22
25
|
btn.name = `message.btn.${btn.code}`;
|
|
23
26
|
} else if (sysConfig?.i18nEnabled === 'Y' && !btn.name.startsWith('message.')) {
|
|
@@ -377,3 +380,69 @@ export const getAttrs = attrs => {
|
|
|
377
380
|
});
|
|
378
381
|
return data;
|
|
379
382
|
};
|
|
383
|
+
|
|
384
|
+
export const formatItems = (items, status, span = 24) => {
|
|
385
|
+
if (!items.length) return items;
|
|
386
|
+
return items.map(item => {
|
|
387
|
+
if (item.children?.length) {
|
|
388
|
+
item.children = formatItems(item.children, status, span);
|
|
389
|
+
return item;
|
|
390
|
+
} else {
|
|
391
|
+
item.title = item.title || `message.${item.field}`;
|
|
392
|
+
item.span = item.span || span;
|
|
393
|
+
if (item.type === 'collapseNode') {
|
|
394
|
+
// 折叠项目,title和宽度不需要
|
|
395
|
+
item.title = '';
|
|
396
|
+
item.titleWidth = 0;
|
|
397
|
+
}
|
|
398
|
+
let disabled = false;
|
|
399
|
+
if (status === 'detail') {
|
|
400
|
+
disabled = true;
|
|
401
|
+
item.placeholder = null;
|
|
402
|
+
} else {
|
|
403
|
+
disabled =
|
|
404
|
+
item.disabled === false ? item.disabled : item.disabled || item.itemRender?.props?.disabled;
|
|
405
|
+
}
|
|
406
|
+
let itemRender = {
|
|
407
|
+
name: 'VxeInput',
|
|
408
|
+
props: { disabled, placeholder: disabled ? '' : item.placeholder }
|
|
409
|
+
};
|
|
410
|
+
if (item.code && !item.itemRender) {
|
|
411
|
+
itemRender = renderHook.renderDict(item.code);
|
|
412
|
+
}
|
|
413
|
+
item.itemRender = item.itemRender || itemRender;
|
|
414
|
+
item.itemRender['props'] = Object.assign(item.itemRender.props || {}, {
|
|
415
|
+
disabled
|
|
416
|
+
});
|
|
417
|
+
return item;
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* @description: 标准化必填数据
|
|
424
|
+
* @param {*} records 数据列表
|
|
425
|
+
* @param {*} t i18n对象
|
|
426
|
+
* @return {*} rule数据
|
|
427
|
+
*/
|
|
428
|
+
export const formatRules = (records, t) => {
|
|
429
|
+
const rule = {};
|
|
430
|
+
records.forEach(item => {
|
|
431
|
+
if (item.children?.length) {
|
|
432
|
+
const subRuls = formatRules(item.children, t);
|
|
433
|
+
merge(rule, subRuls);
|
|
434
|
+
} else {
|
|
435
|
+
if (item.required) {
|
|
436
|
+
const { field, title } = item;
|
|
437
|
+
const i18n = title?.startsWith('message.');
|
|
438
|
+
rule[field] = [
|
|
439
|
+
{
|
|
440
|
+
required: true,
|
|
441
|
+
message: `${t('message.required')}${title && i18n ? t(title) : title || t(`message.${field}`)}`
|
|
442
|
+
}
|
|
443
|
+
];
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
return rule;
|
|
448
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2021-12-23 17:33:20
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-
|
|
5
|
+
* @LastEditTime: 2025-07-31 10:15:40
|
|
6
6
|
* @Description: 个性化设置页面
|
|
7
7
|
-->
|
|
8
8
|
<script setup lang="ts">
|
|
@@ -52,7 +52,7 @@ onBeforeUnmount(() => {
|
|
|
52
52
|
<template>
|
|
53
53
|
<div :class="{ show }">
|
|
54
54
|
<div class="right-panel-background" />
|
|
55
|
-
<div ref="target" class="right-panel bg-bg_color">
|
|
55
|
+
<div ref="target" class="right-panel bg-bg_color bg-white">
|
|
56
56
|
<div
|
|
57
57
|
class="project-configuration border-0 border-b-[1px] border-solid border-[var(--pure-border-color)]"
|
|
58
58
|
>
|
|
@@ -118,7 +118,7 @@ onBeforeUnmount(() => {
|
|
|
118
118
|
position: fixed;
|
|
119
119
|
top: 0;
|
|
120
120
|
right: 0;
|
|
121
|
-
z-index:
|
|
121
|
+
z-index: 400000;
|
|
122
122
|
width: 100%;
|
|
123
123
|
max-width: 300px;
|
|
124
124
|
box-shadow: 0 0 15px 0 rgb(0 0 0 / 5%);
|
package/src/main.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2022-10-18 18:13:54
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-07-
|
|
5
|
+
* @LastEditTime: 2025-07-31 17:17:32
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
import { createApp, type Directive } from 'vue';
|
|
@@ -31,21 +31,22 @@ import VueViewer from 'v-viewer';
|
|
|
31
31
|
|
|
32
32
|
// import SuTable from './components/SuTable/SuTable.vue';
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
// UtButton,
|
|
36
|
-
// utLov2,
|
|
37
|
-
// UGrid,
|
|
38
|
-
// UtDivider,
|
|
39
|
-
|
|
40
|
-
// FormUpload2
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// UtContent,
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
34
|
+
import {
|
|
35
|
+
// UtButton,
|
|
36
|
+
// utLov2,
|
|
37
|
+
// UGrid,
|
|
38
|
+
// UtDivider,
|
|
39
|
+
UtModalForm2,
|
|
40
|
+
// FormUpload2
|
|
41
|
+
UtForm2,
|
|
42
|
+
UtGrid2,
|
|
43
|
+
// UtContent,
|
|
44
|
+
// UtCountdown2,
|
|
45
|
+
UtUpload2
|
|
46
|
+
// UtIconSelect,
|
|
47
|
+
// UtCalendar
|
|
48
|
+
// uAttachment
|
|
49
|
+
} from './components/udp';
|
|
49
50
|
|
|
50
51
|
const app = createApp(App);
|
|
51
52
|
|
|
@@ -88,12 +89,12 @@ const init = ({ router, config, lang, views, env, tableConfig }) => {
|
|
|
88
89
|
app.component('FontIcon', FontIcon);
|
|
89
90
|
// app.component('uAttachment', uAttachment).component('UGrid', UGrid);
|
|
90
91
|
// .component('UtDivider', UtDivider)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
app.component('UtModalForm2', UtModalForm2);
|
|
93
|
+
app.component('UtGrid2', UtGrid2);
|
|
94
|
+
app.component('UtForm2', UtForm2);
|
|
94
95
|
// .component('UtContent', UtContent)
|
|
95
96
|
// .component('UtIconSelect', UtIconSelect)
|
|
96
|
-
|
|
97
|
+
app.component('UtUpload2', UtUpload2);
|
|
97
98
|
// .component('UtCalendar', UtCalendar)
|
|
98
99
|
// .component('UtModalGrid', UtModalGrid);
|
|
99
100
|
app.use(VueViewer, { defaultOptions: { zIndex: 9999 } });
|
package/src/style/vxetable.scss
CHANGED
|
@@ -33,7 +33,15 @@ html[data-vxe-ui-theme='light'] {
|
|
|
33
33
|
|
|
34
34
|
/** 必填录入框颜色 */
|
|
35
35
|
.vxe-form--item.is--required {
|
|
36
|
-
.vxe-input > .vxe-input--inner:not(:disabled) {
|
|
36
|
+
.vxe-input > .vxe-input--wrapper > .vxe-input--inner:not(:disabled) {
|
|
37
|
+
background-color: #fffbdf;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.vxe-input--control-icon:not(:disabled) {
|
|
41
|
+
background-color: #fffbdf;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.el-select__wrapper:not(:disabled) {
|
|
37
45
|
background-color: #fffbdf;
|
|
38
46
|
}
|
|
39
47
|
|
|
@@ -152,10 +160,24 @@ html[data-vxe-ui-theme='light'] {
|
|
|
152
160
|
|
|
153
161
|
// 表单label加粗
|
|
154
162
|
.vxe-form--item-title-content {
|
|
155
|
-
font-size: 13px;
|
|
156
163
|
font-weight: 700;
|
|
157
164
|
color: #192847;
|
|
158
165
|
}
|
|
166
|
+
|
|
167
|
+
.vxe-form--group-title {
|
|
168
|
+
border-bottom: 1px solid #eee;
|
|
169
|
+
|
|
170
|
+
.vxe-form--item-title-content {
|
|
171
|
+
font-size: 15px;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.vxe-form--group-title::before {
|
|
176
|
+
position: relative;
|
|
177
|
+
top: 2px;
|
|
178
|
+
color: var(--udp-theme-project-text);
|
|
179
|
+
content: '▉';
|
|
180
|
+
}
|
|
159
181
|
}
|
|
160
182
|
|
|
161
183
|
.vxe-form.size--mini .vxe-form--item-inner {
|