@utogether/udp-core 1.0.1-beta.9 → 1.0.2
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 +37 -39
- package/dist/{403-BOzKHdlm.js → 403-B1rIjAAu.js} +6 -6
- package/dist/{404-uwgt4Nll.js → 404-mBqc2y4t.js} +4 -4
- package/dist/{500-4HBf6V9m.js → 500-BoI45Zdh.js} +2 -2
- package/dist/{AuthorityInfo-DvbIh1vT.js → AuthorityInfo-B08NBIIn.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-BlCPvwXU.js → AuthorityInfo.vue_vue_type_style_index_0_lang-BLP1SaiH.js} +3 -3
- package/dist/{Company-D7Q9BFmr.js → Company-JGGyWEWH.js} +3 -3
- package/dist/{CompanyPanel-C0-PJlrt.js → CompanyPanel-BQ_cCmDx.js} +7 -7
- package/dist/{Department-h2hlXACv.js → Department-z2iO6hwM.js} +10 -10
- package/dist/{DepartmentPanel-B6hDEQpG.js → DepartmentPanel-BtQe7zwU.js} +108 -78
- package/dist/{DesignPanel-cS58-1v9.js → DesignPanel-7mhtVWas.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-LdvLC8VU.js → DesignPanel.vue_vue_type_style_index_0_lang-4EsHemj_.js} +6 -6
- package/dist/{DictView-T3TmpBa8.js → DictView-CjchV2Yk.js} +15 -16
- package/dist/InvOrganization-Pn1O_XP0.js +74 -0
- package/dist/{Org-CnCBDGKF.js → Org-BqytV_vi.js} +1 -1
- package/dist/{Preview-BaktKXB1.js → Preview-CLpUUMay.js} +2 -2
- package/dist/{ReportDefine-5Rb0PO9A.js → ReportDefine-Cz1KtEUF.js} +1 -1
- package/dist/{ReportDesign-DYdkVREA.js → ReportDesign-BaORYud4.js} +13 -13
- package/dist/{ReportQuery-BwhzIXMt.js → ReportQuery-CPCPXiXz.js} +1 -1
- package/dist/{ReportQueryFrom-PHtWwlOe.js → ReportQueryFrom-C_AcrfkJ.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-BE5yZNPM.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-Bm67ejay.js} +1 -1
- package/dist/{ReportTemplate-DaadVXIi.js → ReportTemplate-CFiNMz79.js} +11 -11
- package/dist/{Role-Dtg3nAmG.js → Role-B-XDoJd5.js} +3 -3
- package/dist/{RoleAssign-DEGtLssH.js → RoleAssign-BolW8YVs.js} +8 -8
- package/dist/{RolePanel-DpUzfE_o.js → RolePanel-2kfs5tw9.js} +1 -1
- package/dist/{RolePanel-CT7BTPmy.js → RolePanel-HilSuYns.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Xyo0YEI0.js → RolePanel.vue_vue_type_script_setup_true_lang-CE4gApUY.js} +7 -7
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Dg2A6DJu.js → RolePanel.vue_vue_type_script_setup_true_lang-DPzgfAyV.js} +13 -13
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-CyutzDZS.js → ScrollPanel.vue_vue_type_style_index_0_lang-CCTH4RkH.js} +4 -4
- package/dist/{Staff-_NlAGkrh.js → Staff-BTk3whFC.js} +3 -3
- package/dist/{StaffInfo-DVgUvVgd.js → StaffInfo-d3AuSzlA.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-C8hmlFgX.js → StaffInfo.vue_vue_type_script_setup_true_lang-eOL4VlfE.js} +5 -5
- package/dist/{StaffPanel-DKNZE3IE.js → StaffPanel-DV-D4jjz.js} +1 -1
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-4sFq3CEo.js +135 -0
- package/dist/{SysUser-kQUf7XKz.js → SysUser-BnjYytws.js} +2 -2
- package/dist/{SysUserPanel-C191uX3U.js → SysUserPanel-CBoyD-Qi.js} +1 -1
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-PrTlTZR-.js +341 -0
- package/dist/{SystemMenu-DwuSvHnj.js → SystemMenu-kYB_ZaUt.js} +36 -36
- package/dist/{UserInfo-DIsInFld.js → UserInfo-4dx97VBL.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-CnvGdbej.js → UserInfo.vue_vue_type_style_index_0_lang-BpbC_ZDm.js} +10 -10
- package/dist/{childView-3Bs2UBEw.js → childView-CHPNfTEb.js} +1 -1
- package/dist/{childView-BawyULD7.js → childView-CKA_JgVZ.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-YpWF-p2F.js → childView.vue_vue_type_style_index_0_lang-Bym2fQRd.js} +7 -7
- package/dist/childView.vue_vue_type_style_index_0_lang-W7bCtXeu.js +177 -0
- package/dist/{code-rule-DVaYcn8S.js → code-rule-CbxuZg0-.js} +40 -38
- package/dist/core.es.js +18 -12
- package/dist/{cron-task-xuzP-BpE.js → cron-task-nTOpqQYf.js} +7 -7
- package/dist/flow-task-B07st2aD.js +10 -0
- package/dist/{frameView-Cudt06qS.js → frameView-Z1tPUyCh.js} +1 -1
- package/dist/index-C3q8HoJM.js +4650 -0
- package/dist/{layoutView-BlFTV2jX.js → layoutView--MGA9zUB.js} +1766 -1760
- package/dist/{log-in-e7D5Ss1P.js → log-in-CSYJDA6m.js} +36 -29
- package/dist/log-out-DiwGCg7p.js +130 -0
- package/dist/login-C6Y0ajDp.js +251 -0
- package/dist/{login-log-kqKzKTto.js → login-log-C0V-_l3F.js} +5 -3
- package/dist/{lov-view-B2HaxyMs.js → lov-view-Cmv7wZZ9.js} +6 -6
- package/dist/{menuInfo-BxCTJ1VW.js → menuInfo-UeutJpOa.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-CLOPNeUW.js → menuInfo.vue_vue_type_style_index_0_lang-CWX4Mu67.js} +118 -98
- package/dist/{pda-app-DPsAFNiw.js → pda-app-B6w99SJo.js} +10 -10
- package/dist/{resource-Dibb7t8u.js → resource-BybJvUv0.js} +4 -4
- package/dist/{su-welcome-DejR0KkM.js → su-welcome-C1bmxHoY.js} +119 -121
- package/dist/sys-config-BnmIDnCj.js +370 -0
- package/dist/udp-core.css +1 -9
- package/dist/utogether-MlnyYtNS.js +4 -0
- package/index.ts +49 -40
- package/package.json +18 -18
- package/src/App.vue +65 -65
- package/src/api/http.ts +1 -4
- package/src/api/index.ts +4 -2
- package/src/api/user.ts +2 -2
- package/src/components/SuCharts/src/UserInfo.vue +78 -78
- package/src/components/SuScrollTree/ScrollPanel.vue +1 -6
- package/src/components/udp/content/index.vue +88 -0
- package/src/components/udp/{form.vue → form/form.vue} +13 -16
- package/src/components/udp/{grid.vue → grid/index.vue} +56 -27
- package/src/components/udp/index.ts +4 -9
- package/src/components/udp/ut-stamp-badge/index.vue +271 -0
- package/src/components/udp/utils.ts +66 -105
- package/src/layout/components/lay-navbar/index.vue +8 -6
- package/src/layout/components/lay-panel/index.vue +150 -150
- package/src/layout/components/lay-search/index.vue +25 -25
- package/src/layout/components/lay-select-org/index.vue +4 -9
- package/src/layout/components/lay-setting/index.vue +503 -510
- package/src/layout/components/lay-sidebar/horizontal.vue +8 -6
- package/src/layout/components/lay-sidebar/mixNav.vue +260 -258
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +101 -98
- package/src/layout/components/lay-tag/index.vue +24 -51
- package/src/layout/hooks/useDataThemeChange.ts +1 -1
- package/src/layout/hooks/useNav.ts +176 -173
- package/src/layout/hooks/useTag.ts +227 -233
- package/src/layout/types.ts +93 -92
- package/src/main.ts +115 -119
- package/src/plugins/i18n/en.ts +302 -302
- package/src/plugins/i18n/module/u-workflow.ts +1 -1
- package/src/plugins/i18n/zh.ts +21 -6
- package/src/plugins/vxe-table/index.ts +116 -53
- package/src/plugins/vxe-table/render.tsx +945 -956
- package/src/router/index.ts +17 -17
- package/src/router/modules/flow.ts +35 -0
- package/src/router/modules/home.ts +32 -32
- package/src/router/modules/remaining.ts +58 -58
- package/src/router/utils.ts +420 -377
- package/src/store/modules/app.ts +2 -4
- package/src/store/modules/epTheme.ts +48 -49
- package/src/store/modules/multiTags.ts +15 -14
- package/src/store/modules/permission.ts +25 -15
- package/src/store/modules/system.ts +1 -3
- package/src/style/button.scss +85 -85
- package/src/style/login.css +1 -1
- package/src/style/vxetable.scss +61 -2
- package/src/utils/dataFormat/index.ts +223 -223
- package/src/utils/index.ts +3 -1
- package/src/utils/lifecycle.ts +39 -20
- package/src/utils/propTypes.ts +1 -6
- package/src/utils/storage/index.ts +2 -2
- package/src/utils/udp/http/index.ts +24 -11
- package/src/utils/udp/http/types.d.ts +3 -10
- package/src/views/login/login-view.vue +4 -18
- package/src/views/organization/company/CompanyPanel.vue +259 -259
- package/src/views/organization/department/Department.vue +58 -58
- package/src/views/organization/department/DepartmentPanel.vue +303 -283
- package/src/views/organization/inv-org/InvOrganization.vue +22 -7
- package/src/views/organization/staff/StaffInfo.vue +127 -133
- package/src/views/organization/staff/StaffPanel.vue +162 -145
- package/src/views/system/cron/cron-task.vue +2 -12
- package/src/views/system/menu/SystemMenu.vue +185 -183
- package/src/views/system/menu/menuInfo.vue +384 -363
- package/src/views/system/role/UserInfo.vue +195 -195
- package/src/views/system/role-assign/RoleAssign.vue +57 -57
- package/src/views/system/role-assign/RolePanel.vue +139 -139
- package/src/views/system/sys/sys-config.vue +69 -20
- package/src/views/system/sysUser/SysUserPanel.vue +97 -28
- package/src/views/uapp/pda/pda-app.vue +208 -208
- package/src/views/udev/coderule/code-rule.vue +132 -121
- package/src/views/udev/dict/DictView.vue +2 -2
- package/src/views/udev/dict/childView.vue +183 -222
- package/src/views/udev/lov/childView.vue +1 -7
- package/src/views/udev/lov/lov-view.vue +91 -91
- package/src/views/uhome/components/menu-favorite.vue +314 -331
- package/src/views/uhome/su-welcome.vue +319 -339
- package/src/views/ulogin/login.vue +325 -321
- package/src/views/upms/interface/log-in.vue +100 -106
- package/src/views/upms/interface/log-out.vue +104 -107
- package/src/views/upms/user/login-log.vue +54 -60
- package/src/views/urpt/design/DesignPanel.vue +507 -507
- package/src/views/urpt/design/Preview.vue +1 -0
- package/src/views/urpt/design/ReportDesign.vue +2 -4
- package/src/views/utask/flow-task.vue +18 -0
- package/types/global.d.ts +231 -236
- package/dist/InvOrganization-BVuOhzbt.js +0 -66
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-BOOO6Cek.js +0 -111
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-SwNbAEvW.js +0 -294
- package/dist/childView.vue_vue_type_style_index_0_lang-DWIFCX3X.js +0 -187
- package/dist/index-CKnq5xIa.js +0 -2623
- package/dist/log-out--RRncZhN.js +0 -120
- package/dist/login-CpKykfdf.js +0 -253
- package/dist/sys-config-DiySRWns.js +0 -277
- package/dist/utogether-Dct_14Zk.js +0 -182
- package/src/components/udp/count-down.vue +0 -536
- package/src/components/udp/flip-down/FlipCard/flip-card.vue +0 -251
- package/src/components/udp/flip-down/FlipCard/interfaces.ts +0 -4
- package/src/components/udp/flip-down/FlipClock/flip-clock.vue +0 -113
- package/src/components/udp/form-upload.vue +0 -482
- package/src/components/udp/lov.vue +0 -388
- package/src/components/udp/modal-form.vue +0 -189
- package/src/components/udp/modal-grid.vue +0 -288
- package/src/components/udp/upload.vue +0 -423
- package/src/utils/udp/useRender.ts +0 -431
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ut-lov-wrapper">
|
|
3
|
-
<vxe-modal
|
|
4
|
-
v-if="mode === 'vxe'"
|
|
5
|
-
v-model="showLovModal"
|
|
6
|
-
:width="modalWidth"
|
|
7
|
-
:destroy-on-close="false"
|
|
8
|
-
:title="lovTitle"
|
|
9
|
-
:transfer="transfer"
|
|
10
|
-
height="66%"
|
|
11
|
-
resize
|
|
12
|
-
esc-closable
|
|
13
|
-
show-footer
|
|
14
|
-
:class-name="className"
|
|
15
|
-
:before-hide-method="beforeHideMethod"
|
|
16
|
-
>
|
|
17
|
-
<template #default>
|
|
18
|
-
<vxe-grid ref="xgrid" v-bind="data" resizable @cell-dblclick="onCellClick" />
|
|
19
|
-
</template>
|
|
20
|
-
<template #footer>
|
|
21
|
-
<vxe-button :content="$t('message.btn.cancel')" icon="ri-close-line" status="warning" @click="onClose" />
|
|
22
|
-
<vxe-button :content="$t('message.btn.confirm')" icon="ri-save-3-line" status="primary" @click="onConfirm" />
|
|
23
|
-
</template>
|
|
24
|
-
</vxe-modal>
|
|
25
|
-
<el-dialog
|
|
26
|
-
v-else
|
|
27
|
-
v-model="showLovModal"
|
|
28
|
-
:width="modalWidth"
|
|
29
|
-
:show-close="false"
|
|
30
|
-
:title="lovTitle"
|
|
31
|
-
:append-to-body="transfer"
|
|
32
|
-
draggable
|
|
33
|
-
destroy-on-close
|
|
34
|
-
close-on-press-escape
|
|
35
|
-
>
|
|
36
|
-
<template #default>
|
|
37
|
-
<div style="height: 360px">
|
|
38
|
-
<vxe-grid ref="xgrid" v-bind="data" resizable @cell-dblclick="onCellClick" />
|
|
39
|
-
</div>
|
|
40
|
-
</template>
|
|
41
|
-
<template #footer>
|
|
42
|
-
<vxe-button :content="$t('message.btn.cancel')" icon="ri-close-line" status="warning" @click="onClose" />
|
|
43
|
-
<vxe-button :content="$t('message.btn.confirm')" icon="ri-save-3-line" status="primary" @click="onConfirm" />
|
|
44
|
-
</template>
|
|
45
|
-
</el-dialog>
|
|
46
|
-
<vxe-input
|
|
47
|
-
v-model="record[displayName || field]"
|
|
48
|
-
:clearable="!disabled && clearable"
|
|
49
|
-
:disabled="disabled"
|
|
50
|
-
:readonly="readonly"
|
|
51
|
-
:placeholder="placeholder"
|
|
52
|
-
style="width: 100%"
|
|
53
|
-
type="search"
|
|
54
|
-
size="mini"
|
|
55
|
-
@search-click="onSeach"
|
|
56
|
-
@clear="onClear"
|
|
57
|
-
/>
|
|
58
|
-
</div>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<script lang="ts">
|
|
62
|
-
export default {
|
|
63
|
-
name: 'UtLov'
|
|
64
|
-
};
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<script setup lang="ts">
|
|
68
|
-
// @ts-nocheck
|
|
69
|
-
import { ref, reactive, getCurrentInstance } from 'vue';
|
|
70
|
-
import { VxeGridProps } from 'vxe-table';
|
|
71
|
-
import to from 'await-to-js';
|
|
72
|
-
import { clone, toDateString, isEmpty } from 'xe-utils';
|
|
73
|
-
import { useRender, cookies, delay } from '@utogether/utils';
|
|
74
|
-
// import type { IFormItemProps, IRecord } from '../../types';
|
|
75
|
-
|
|
76
|
-
export interface IProps {
|
|
77
|
-
record: object;
|
|
78
|
-
defaultParams?: object;
|
|
79
|
-
code: string;
|
|
80
|
-
field: string;
|
|
81
|
-
displayName?: string;
|
|
82
|
-
placeholder?: string;
|
|
83
|
-
mode?: string;
|
|
84
|
-
clearable?: boolean;
|
|
85
|
-
multiple?: boolean;
|
|
86
|
-
disabled?: boolean;
|
|
87
|
-
autoLoad?: boolean;
|
|
88
|
-
readonly?: boolean;
|
|
89
|
-
transfer?: boolean;
|
|
90
|
-
}
|
|
91
|
-
const props = withDefaults(defineProps<IProps>(), {
|
|
92
|
-
record: () => {
|
|
93
|
-
return {};
|
|
94
|
-
},
|
|
95
|
-
defaultParams: () => {
|
|
96
|
-
return {};
|
|
97
|
-
},
|
|
98
|
-
mode: 'vxe',
|
|
99
|
-
placeholder: '请选择',
|
|
100
|
-
clearable: true,
|
|
101
|
-
multiple: false,
|
|
102
|
-
disabled: false,
|
|
103
|
-
readonly: true,
|
|
104
|
-
autoLoad: true
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
const instance = getCurrentInstance()!;
|
|
108
|
-
const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
|
|
109
|
-
|
|
110
|
-
const minWidth = 600;
|
|
111
|
-
const showLovModal = ref(false);
|
|
112
|
-
const modalWidth = ref(minWidth);
|
|
113
|
-
const lovTitle = ref('');
|
|
114
|
-
const className = ref('vxe-table--ignore-clear');
|
|
115
|
-
|
|
116
|
-
const data = reactive<VxeGridProps>({
|
|
117
|
-
loading: false,
|
|
118
|
-
border: true,
|
|
119
|
-
pagerConfig: {},
|
|
120
|
-
formConfig: { titleWidth: 90, titleAlign: 'right', items: [] },
|
|
121
|
-
height: 'auto',
|
|
122
|
-
editConfig: {},
|
|
123
|
-
rowConfig: { keyField: '_X_ROW_KEY' },
|
|
124
|
-
proxyConfig: {
|
|
125
|
-
form: true, // 查询是需要启用表单代理
|
|
126
|
-
autoLoad: false,
|
|
127
|
-
response: {
|
|
128
|
-
result: 'list',
|
|
129
|
-
total: 'total'
|
|
130
|
-
},
|
|
131
|
-
ajax: {
|
|
132
|
-
query: ({ page, form }) => {
|
|
133
|
-
const commonParam = cookies.get('kCookies_param') ? JSON.parse(cookies.get('kCookies_param')) : {};
|
|
134
|
-
let queryParams = Object.assign({}, form, commonParam, props.defaultParams);
|
|
135
|
-
queryParams.pageNum = page?.currentPage || 1;
|
|
136
|
-
queryParams.pageSize = page?.pageSize || 20;
|
|
137
|
-
if (!props.readonly) {
|
|
138
|
-
const { field, displayName } = props;
|
|
139
|
-
// 非只读时,意味着可录入文本,此时查询是需要加上录入的文本内容作为条件
|
|
140
|
-
queryParams[displayName || field] = props.record[displayName || field];
|
|
141
|
-
}
|
|
142
|
-
// console.log(queryParams);
|
|
143
|
-
queryParams = formatterParam(queryParams);
|
|
144
|
-
if (lovData.lovType !== 'url') {
|
|
145
|
-
queryParams.lovCode = props.code;
|
|
146
|
-
return serviceApi.get('/upfm/v1/lovViewHeader/listBySql', queryParams);
|
|
147
|
-
}
|
|
148
|
-
return serviceApi.get(lovData.lovUrl, queryParams);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
checkboxConfig: {},
|
|
153
|
-
columns: []
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
// const displayName = ref(null);
|
|
157
|
-
let lovData = undefined;
|
|
158
|
-
let dataList = [];
|
|
159
|
-
|
|
160
|
-
const formatterParam = params => {
|
|
161
|
-
const columns = dataList.filter(col => ['date', 'month'].includes(col.fieldType) && col.isSearch);
|
|
162
|
-
columns.forEach(col => {
|
|
163
|
-
if (col.fieldType === 'date') {
|
|
164
|
-
params[col.field] = toDateString(params[col.field], 'yyyy-MM-dd 00:00:00');
|
|
165
|
-
} else if (col.fieldType === 'month') {
|
|
166
|
-
params[col.field] = toDateString(params[col.field], 'yyyy-MM');
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
return params;
|
|
170
|
-
};
|
|
171
|
-
// 查询字段
|
|
172
|
-
const getFormItem = () => {
|
|
173
|
-
const items = clone(dataList, true).filter(col => col.isSearch === 'Y');
|
|
174
|
-
if (!items.length) return;
|
|
175
|
-
// console.log(items);
|
|
176
|
-
const isCollapse = items.length > 2;
|
|
177
|
-
const forItems: IFormItemProps[] = items
|
|
178
|
-
.sort((a, b) => a.seqNo - b.seqNo)
|
|
179
|
-
.map((item: IRecord, idx) => {
|
|
180
|
-
return {
|
|
181
|
-
field: item.colField,
|
|
182
|
-
title: item.colTitle,
|
|
183
|
-
span: 8,
|
|
184
|
-
folding: idx > 1,
|
|
185
|
-
itemRender: getItemRender(item)
|
|
186
|
-
};
|
|
187
|
-
});
|
|
188
|
-
searchBtn.collapseNode = isCollapse;
|
|
189
|
-
if (isCollapse) {
|
|
190
|
-
// 按钮设置为 折叠节点并将搜索按钮插入到第一列的最后
|
|
191
|
-
forItems.splice(2, 0, searchBtn);
|
|
192
|
-
} else {
|
|
193
|
-
forItems.push(searchBtn);
|
|
194
|
-
}
|
|
195
|
-
data.formConfig.items = forItems;
|
|
196
|
-
};
|
|
197
|
-
const searchBtn: IFormItemProps = {
|
|
198
|
-
span: 8,
|
|
199
|
-
align: 'right',
|
|
200
|
-
collapseNode: false,
|
|
201
|
-
itemRender: {
|
|
202
|
-
name: 'VxeButtonGroup',
|
|
203
|
-
options: [
|
|
204
|
-
{
|
|
205
|
-
type: 'submit',
|
|
206
|
-
submit: 'submit',
|
|
207
|
-
content: 'message.btn.search',
|
|
208
|
-
status: 'primary',
|
|
209
|
-
icon: 'ri-search-line'
|
|
210
|
-
// props: {
|
|
211
|
-
// },
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
type: 'reset',
|
|
215
|
-
name: 'reset',
|
|
216
|
-
content: 'message.btn.reset',
|
|
217
|
-
status: 'info',
|
|
218
|
-
icon: 'ri-refresh-line'
|
|
219
|
-
// props: {
|
|
220
|
-
// },
|
|
221
|
-
}
|
|
222
|
-
]
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
// console.log("useRender", useRender);
|
|
227
|
-
const renderHook = useRender();
|
|
228
|
-
|
|
229
|
-
const getItemRender = item => {
|
|
230
|
-
if (['date', 'month'].includes(item.fieldType)) {
|
|
231
|
-
const valueFormat = item.fieldType === 'date' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM';
|
|
232
|
-
return renderHook.renderDate({ type: item.fieldType, valueFormat });
|
|
233
|
-
} else if (item.fieldType === 'dictCode') {
|
|
234
|
-
return renderHook.renderDict(item.dictCode);
|
|
235
|
-
}
|
|
236
|
-
return { name: 'VxeInput' };
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
// 获取columns
|
|
240
|
-
const getColumns = () => {
|
|
241
|
-
const columns = clone(dataList, true).filter((col: IRecord) => col.isCol === 'Y');
|
|
242
|
-
const colWidth = columns.reduce((curv, prev: IRecord) => curv + +prev.colWidth, 65);
|
|
243
|
-
modalWidth.value = colWidth < minWidth ? minWidth : colWidth > 900 ? 900 : colWidth;
|
|
244
|
-
data.columns = columns
|
|
245
|
-
.sort((a, b) => a.seqNo - b.seqNo)
|
|
246
|
-
.map(col => {
|
|
247
|
-
const fieldType = col.fieldType;
|
|
248
|
-
const dictCode = ['formatDict', col.dictCode];
|
|
249
|
-
return {
|
|
250
|
-
field: col.colField,
|
|
251
|
-
title: col.colTitle,
|
|
252
|
-
minWidth: col.colWidth,
|
|
253
|
-
formatter: fieldType === 'date' ? ['formatDate'] : col.fieldType === 'dictCode' ? dictCode : null
|
|
254
|
-
};
|
|
255
|
-
});
|
|
256
|
-
if (props.multiple) {
|
|
257
|
-
data.columns.unshift({ type: 'checkbox', width: 45, align: 'center' });
|
|
258
|
-
} else {
|
|
259
|
-
data.columns.unshift({ type: 'radio', width: 45, align: 'center' });
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
// 获取grid配置
|
|
264
|
-
const xgrid = ref(null);
|
|
265
|
-
|
|
266
|
-
const getGridConfig = async () => {
|
|
267
|
-
console.log('88888');
|
|
268
|
-
data.loading = true;
|
|
269
|
-
const url = '/upfm/v1/lovViewHeader/detailByViewCode';
|
|
270
|
-
const [err, res]: [Error, any] = await to(serviceApi.get(url, { lovCode: props.code }));
|
|
271
|
-
data.loading = false;
|
|
272
|
-
if (err) onClose();
|
|
273
|
-
lovTitle.value = res?.lovTitle || res.lovName;
|
|
274
|
-
dataList = res.lineList;
|
|
275
|
-
lovData = res;
|
|
276
|
-
props.autoLoad && xgrid.value.commitProxy('query');
|
|
277
|
-
getColumns();
|
|
278
|
-
getFormItem();
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
const onSeach = async () => {
|
|
282
|
-
if (props.disabled) return;
|
|
283
|
-
getGridConfig();
|
|
284
|
-
await delay(64);
|
|
285
|
-
showLovModal.value = true;
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
const onClear = () => {
|
|
289
|
-
emit('clear', '');
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
// 双击
|
|
293
|
-
const onCellClick = ({ row }) => {
|
|
294
|
-
const record = !props.multiple ? row : [row];
|
|
295
|
-
emit('change', record, lovData.valueField);
|
|
296
|
-
onClose();
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
const onConfirm = () => {
|
|
300
|
-
const grid = xgrid.value;
|
|
301
|
-
const record = !props.multiple ? grid.getRadioRecord() : grid.getCheckboxRecords();
|
|
302
|
-
!isEmpty(record) && emit('change', record, lovData.valueField);
|
|
303
|
-
onClose();
|
|
304
|
-
};
|
|
305
|
-
/** 输入框显示值 */
|
|
306
|
-
// const setDisplayLabel = row => {
|
|
307
|
-
// let value = row[lovData.valueField];
|
|
308
|
-
// if (props.multiple) {
|
|
309
|
-
// value = row.map(m => m[lovData.valueField]).join();
|
|
310
|
-
// }
|
|
311
|
-
// Object.assign(props.record, { [props.field]: value });
|
|
312
|
-
// };
|
|
313
|
-
|
|
314
|
-
// 关闭Lov
|
|
315
|
-
const onClose = () => {
|
|
316
|
-
dataList.length = 0;
|
|
317
|
-
showLovModal.value = false;
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
const beforeHideMethod = ({ type }) => {
|
|
321
|
-
// console.log("cccc", type);
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
const emit = defineEmits<{
|
|
325
|
-
(e: 'clear', str: ''): void;
|
|
326
|
-
(e: 'change', record: any, field: string): void;
|
|
327
|
-
}>();
|
|
328
|
-
</script>
|
|
329
|
-
|
|
330
|
-
<style lang="scss">
|
|
331
|
-
.ut-lov-wrapper {
|
|
332
|
-
.vxe-pager .vxe-pager--sizes {
|
|
333
|
-
display: inline-block;
|
|
334
|
-
width: 7em !important;
|
|
335
|
-
text-align: center;
|
|
336
|
-
cursor: pointer;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.el-dialog__header {
|
|
340
|
-
padding: 0.6em 4.6em 0.6em 1em;
|
|
341
|
-
margin-right: 0;
|
|
342
|
-
background-color: #f8f8f8;
|
|
343
|
-
border-bottom: 1px solid #ebeef5;
|
|
344
|
-
|
|
345
|
-
.el-dialog__title {
|
|
346
|
-
font-size: 1.1em;
|
|
347
|
-
font-weight: 600;
|
|
348
|
-
color: #000 !important;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.el-dialog__body {
|
|
353
|
-
padding: 5px 6px;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.el-dialog__footer {
|
|
357
|
-
padding: 5px 6px;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.vxe-grid {
|
|
361
|
-
.vxe-form {
|
|
362
|
-
.vxe-form--item {
|
|
363
|
-
.vxe-form--item-title-label {
|
|
364
|
-
font-weight: 500 !important;
|
|
365
|
-
color: #000 !important;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.vxe-input--date-picker-suffix {
|
|
369
|
-
color: #000 !important;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
.vxe-cell {
|
|
375
|
-
.vxe-cell--label {
|
|
376
|
-
font-weight: 500 !important;
|
|
377
|
-
color: #000 !important;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.vxe-input {
|
|
383
|
-
i[class*='vxe-icon-'] {
|
|
384
|
-
color: #6a6a6a !important;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
</style>
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: wei.li
|
|
3
|
-
* @Date: 2021-11-29 21:02:43
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-07-14 17:38:19
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<div>
|
|
11
|
-
<vxe-modal
|
|
12
|
-
v-model="showModal"
|
|
13
|
-
:title="title"
|
|
14
|
-
:width="width"
|
|
15
|
-
:height="height"
|
|
16
|
-
:loading="loading"
|
|
17
|
-
:show-footer="dataStatus !== 'detail'"
|
|
18
|
-
v-bind="modalAttrs"
|
|
19
|
-
min-width="240"
|
|
20
|
-
min-height="300"
|
|
21
|
-
destroy-on-close
|
|
22
|
-
resize
|
|
23
|
-
@close="onClose"
|
|
24
|
-
>
|
|
25
|
-
<template #default>
|
|
26
|
-
<vxe-form
|
|
27
|
-
ref="xForm"
|
|
28
|
-
:data="record"
|
|
29
|
-
:items="formItems"
|
|
30
|
-
:rules="rules"
|
|
31
|
-
title-align="right"
|
|
32
|
-
:title-width="formAttrs.titleWidth || 90"
|
|
33
|
-
v-bind="formAttrs"
|
|
34
|
-
/>
|
|
35
|
-
</template>
|
|
36
|
-
<template #footer>
|
|
37
|
-
<vxe-checkbox
|
|
38
|
-
v-if="!url && dataStatus === 'add'"
|
|
39
|
-
v-model="continuous"
|
|
40
|
-
content="连续添加"
|
|
41
|
-
unchecked-value="0"
|
|
42
|
-
checked-value="1"
|
|
43
|
-
style="margin-right: 12px"
|
|
44
|
-
/>
|
|
45
|
-
<ut-button status="warning" content="cancel" icon="ri-close-line" @tap="onClose" />
|
|
46
|
-
<ut-button status="u-cyan" content="confirm" icon="ri-save-3-line" @tap="onConfirm" />
|
|
47
|
-
</template>
|
|
48
|
-
</vxe-modal>
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<script lang="ts">
|
|
53
|
-
export default {
|
|
54
|
-
name: 'UtModalForm'
|
|
55
|
-
};
|
|
56
|
-
</script>
|
|
57
|
-
<script lang="ts" setup>
|
|
58
|
-
import { onBeforeMount, ref, computed, getCurrentInstance, useAttrs } from 'vue';
|
|
59
|
-
import { useI18n } from 'vue-i18n';
|
|
60
|
-
import { getAttrs } from './utils';
|
|
61
|
-
import to from 'await-to-js';
|
|
62
|
-
import { formatRules, successMessage, formatItems } from '@utogether/utils';
|
|
63
|
-
|
|
64
|
-
// import type { IRecord, IFormItemProps } from '../../types';
|
|
65
|
-
|
|
66
|
-
export interface IProps {
|
|
67
|
-
record: IRecord; // 数据对象
|
|
68
|
-
formAttrs?: IRecord;
|
|
69
|
-
modalAttrs?: IRecord;
|
|
70
|
-
items: Array<IFormItemProps>; // form item
|
|
71
|
-
url?: string; // 服务路径
|
|
72
|
-
method?: string; // 请求方式
|
|
73
|
-
title?: string; // 标题
|
|
74
|
-
dataStatus?: string; // 状态
|
|
75
|
-
width?: number;
|
|
76
|
-
height?: number;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const props = withDefaults(defineProps<IProps>(), {
|
|
80
|
-
record: (): IRecord => {
|
|
81
|
-
return {};
|
|
82
|
-
},
|
|
83
|
-
formAttrs: (): IRecord => {
|
|
84
|
-
return {};
|
|
85
|
-
},
|
|
86
|
-
items: () => [],
|
|
87
|
-
title: '数据记录',
|
|
88
|
-
width: 420,
|
|
89
|
-
height: 360,
|
|
90
|
-
dataStatus: 'detail',
|
|
91
|
-
url: '',
|
|
92
|
-
method: 'post'
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const attrs: IRecord = getAttrs(useAttrs());
|
|
96
|
-
|
|
97
|
-
const continuous = ref('0');
|
|
98
|
-
const loading = ref(false);
|
|
99
|
-
const instance = getCurrentInstance()!;
|
|
100
|
-
|
|
101
|
-
const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @description: 根据items 获取必填选
|
|
105
|
-
*/
|
|
106
|
-
const rules = computed(() => {
|
|
107
|
-
if (!props.items.length) return {};
|
|
108
|
-
return formatRules(props.items, t);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
const formItems = computed(() => {
|
|
112
|
-
if (!props.items.length) return props.items;
|
|
113
|
-
return formatItems(props.items, props.dataStatus);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const { t } = useI18n();
|
|
117
|
-
const showModal = ref(false);
|
|
118
|
-
|
|
119
|
-
const xForm = ref(null);
|
|
120
|
-
/**
|
|
121
|
-
* @description: 弹框确认
|
|
122
|
-
*/
|
|
123
|
-
const onConfirm = () => {
|
|
124
|
-
// @ts-ignore
|
|
125
|
-
xForm.value.validate(async (valid: boolean) => {
|
|
126
|
-
if (!valid) {
|
|
127
|
-
const { record, url, method } = props;
|
|
128
|
-
if (url) {
|
|
129
|
-
showLoading();
|
|
130
|
-
const body = attrs?.dataProcessMethod ? attrs?.dataProcessMethod(record) : record;
|
|
131
|
-
if (url) {
|
|
132
|
-
const [err, data] = await to(serviceApi[method](url, body));
|
|
133
|
-
if (!err) {
|
|
134
|
-
successMessage();
|
|
135
|
-
emit('confirm', data);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
hiddenLoading();
|
|
139
|
-
onClose();
|
|
140
|
-
} else {
|
|
141
|
-
emit('confirm');
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* @description: 显示加载框
|
|
149
|
-
*/
|
|
150
|
-
const showLoading = () => {
|
|
151
|
-
loading.value = true;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* @description: 关闭加载框
|
|
156
|
-
*/
|
|
157
|
-
const hiddenLoading = () => {
|
|
158
|
-
loading.value = false;
|
|
159
|
-
};
|
|
160
|
-
const validateForm = (cb: Function) => {
|
|
161
|
-
// @ts-ignore
|
|
162
|
-
xForm.value.validate(cb);
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* @description: 关闭弹框
|
|
167
|
-
*/
|
|
168
|
-
const onClose = () => {
|
|
169
|
-
showModal.value = false;
|
|
170
|
-
emit('close');
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* @description: 打开弹框
|
|
174
|
-
*/
|
|
175
|
-
const openModal = () => {
|
|
176
|
-
showModal.value = true;
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
const emit = defineEmits<{
|
|
180
|
-
(e: 'close'): void;
|
|
181
|
-
(e: 'confirm', record?: any): void;
|
|
182
|
-
}>();
|
|
183
|
-
|
|
184
|
-
defineExpose({ showLoading, hiddenLoading, openModal, validateForm });
|
|
185
|
-
|
|
186
|
-
onBeforeMount(() => {
|
|
187
|
-
openModal();
|
|
188
|
-
});
|
|
189
|
-
</script>
|