syntec3-0-ui-components-test 1.0.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 +5 -0
- package/dist/S3_0UC_main.csv +4 -0
- package/dist/S3_0UC_sub.csv +2 -0
- package/dist/globalVariableS3_0UC.json +1 -0
- package/dist/style.css +1 -0
- package/dist/syntec3-0-ui-components.es.js +19518 -0
- package/dist/syntec3-0-ui-components.es.js.map +1 -0
- package/dist/syntec3-0-ui-components.umd.js +23 -0
- package/dist/syntec3-0-ui-components.umd.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/dist/web.config +17 -0
- package/package.json +137 -0
- package/src/App.vue +31 -0
- package/src/assets/fonts/genYoGothicTW-normal.js +7 -0
- package/src/assets/image/defaultImage.png +0 -0
- package/src/assets/vue.svg +1 -0
- package/src/components/Layout/modules/fullPageGlobal.vue +113 -0
- package/src/components/Layout/modules/viewFile/config.js +65 -0
- package/src/components/Layout/modules/viewFile/createView.vue +1000 -0
- package/src/components/Layout/modules/viewFile/filterCriteria.vue +816 -0
- package/src/components/Layout/modules/viewFile/viewList.vue +291 -0
- package/src/components/Layout/modules/viewFile/viewManageTool.js +271 -0
- package/src/components/Layout/modules/viewFile/viewRecord.vue +472 -0
- package/src/components/Layout/modules/viewFile/viewTabs.vue +542 -0
- package/src/components/Layout/tools/GlobalDialog.vue +115 -0
- package/src/components/Pagination.vue +139 -0
- package/src/components/columnConfigNext.vue +273 -0
- package/src/components/customFilter/customFilter.vue +492 -0
- package/src/components/customFilter/filterCriteria.vue +769 -0
- package/src/components/customTable/components/headerOperation/index.vue +136 -0
- package/src/components/customTable/components/headerTabs/index.vue +171 -0
- package/src/components/customTable/components/tableContent/index.vue +440 -0
- package/src/components/customTable/index.vue +305 -0
- package/src/components/dialog.vue +85 -0
- package/src/components/pageContent.vue +48 -0
- package/src/components/popover.vue +402 -0
- package/src/configFiles/apiFile/baseApiList.json +11 -0
- package/src/configFiles/apiFile/coreApiList.json +24 -0
- package/src/configFiles/apiFile/mesApiList.json +4 -0
- package/src/configFiles/apiFile/mmsApiList.json +3 -0
- package/src/configFiles/errorCode.json +291 -0
- package/src/configFiles/version.js +2 -0
- package/src/i18n/lang/en-us.json +2060 -0
- package/src/i18n/lang/errorCodeTranslate.mjs +847 -0
- package/src/i18n/lang/zh-cn.json +2062 -0
- package/src/i18n/lang/zh-tw.json +2059 -0
- package/src/index.js +115 -0
- package/src/main.js +51 -0
- package/src/plugins/excel.js +88 -0
- package/src/router/index.js +41 -0
- package/src/scriptFiles/apiConfig/baseApis.js +10 -0
- package/src/scriptFiles/apiConfig/mesApis.js +10 -0
- package/src/scriptFiles/apiConfig/mmsApis.js +10 -0
- package/src/scriptFiles/apiConfig/privateCloudCoreApis.js +13 -0
- package/src/scriptFiles/apiConfig/serviceRoute.js +23 -0
- package/src/scriptFiles/apis/baseApiFunction.js +63 -0
- package/src/scriptFiles/apis/mesApiFunction.js +15 -0
- package/src/scriptFiles/apis/mmsApiFunction.js +9 -0
- package/src/scriptFiles/apis/privateCloudCoreApiFunction.js +101 -0
- package/src/scriptFiles/backendApiFunction.js +11 -0
- package/src/scriptFiles/checkApiErrorMechanism.js +137 -0
- package/src/scriptFiles/common/objectDataProcessing.js +65 -0
- package/src/scss/base/commom.scss +1068 -0
- package/src/scss/base/dialog.scss +45 -0
- package/src/scss/base/index.scss +3 -0
- package/src/scss/base/table.scss +28 -0
- package/src/store/index.js +25 -0
- package/src/store/module/langStore.js +116 -0
- package/src/style.css +52 -0
- package/src/utils/excel.js +86 -0
- package/src/utils/formula.js +69 -0
- package/src/utils/https.js +13 -0
- package/src/utils/i18n.js +42 -0
- package/src/utils/shiftSelect.js +164 -0
- package/src/utils/summation.js +77 -0
- package/src/utils/tableWidth.js +29 -0
- package/src/utils/toolFun.js +93 -0
- package/src/views/productionWorkOrder/components/columnConfig.vue +242 -0
- package/src/views/productionWorkOrder/components/docCustomFieldForm.vue +739 -0
- package/src/views/productionWorkOrder/components/filePreview.vue +148 -0
- package/src/views/productionWorkOrder/components/querySearch.vue +363 -0
- package/src/views/productionWorkOrder/configFiles/excelImportErrorCode.json +94 -0
- package/src/views/productionWorkOrder/configFiles/pdfDefaultConfig.js +933 -0
- package/src/views/productionWorkOrder/configFiles/planMakingScript.js +600 -0
- package/src/views/productionWorkOrder/configFiles/productionRelatedScript.js +368 -0
- package/src/views/productionWorkOrder/configFiles/rulse.js +23 -0
- package/src/views/productionWorkOrder/configFiles/status.js +50 -0
- package/src/views/productionWorkOrder/index.vue +2174 -0
- package/src/views/productionWorkOrder/productionFlowLabel/component/addCirculationLabel.vue +394 -0
- package/src/views/productionWorkOrder/productionFlowLabel/component/circulationLabelTable.vue +124 -0
- package/src/views/productionWorkOrder/productionFlowLabel/component/materialPartFilePreview.vue +167 -0
- package/src/views/productionWorkOrder/productionFlowLabel/component/workOrderInformation.vue +28 -0
- package/src/views/productionWorkOrder/productionFlowLabel/index.vue +604 -0
- package/src/views/production_work_order/components/priorityTooltip.vue +53 -0
- package/src/views/production_work_order/index.vue +1307 -0
- package/src/views/review_record/components/materialInfo.vue +50 -0
- package/src/views/review_record/components/rootCause.vue +42 -0
- package/src/views/review_record/components/workDetail.vue +115 -0
- package/src/views/review_record/index.vue +884 -0
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer
|
|
3
|
+
v-model="viewRecordDrawer"
|
|
4
|
+
:z-index="1000"
|
|
5
|
+
size="80%"
|
|
6
|
+
:with-header="false"
|
|
7
|
+
:before-close="closeViewRecordDrawer"
|
|
8
|
+
data-test-id="EL-DRAWER-yW3j6a"
|
|
9
|
+
>
|
|
10
|
+
<div style="display: flex; align-items: center" data-test-id="DIV-vOcYvj">
|
|
11
|
+
<span class="mdi mdi-post-outline" data-test-id="SPAN-QcjZ2G" />
|
|
12
|
+
<span style="color: #165389; font-weight: bold; margin: 0 0.5rem" data-test-id="SPAN-JLNrR8">{{
|
|
13
|
+
t('viewOperationRecordTxt')
|
|
14
|
+
}}</span>
|
|
15
|
+
<el-tooltip
|
|
16
|
+
:content="t('viewOperationRecordTips')"
|
|
17
|
+
placement="right"
|
|
18
|
+
:enterable="false"
|
|
19
|
+
data-test-id="EL-TOOLTIP-r2lUDt"
|
|
20
|
+
>
|
|
21
|
+
<span class="mdi mdi-help-circle-outline" style="color: #909399; font-size: 1rem" data-test-id="SPAN-DFDBGw" />
|
|
22
|
+
</el-tooltip>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="view-operation-record" data-test-id="DIV-Ig4Lp5">
|
|
25
|
+
<!-- 筛选区域 -->
|
|
26
|
+
<div class="filter-card" data-test-id="DIV-BY1ENL">
|
|
27
|
+
<el-form :model="queryForm" label-width="auto" class="query-form" size="default" data-test-id="EL-FORM-DQPNj7">
|
|
28
|
+
<el-row :gutter="20" data-test-id="EL-ROW-XqFgSB">
|
|
29
|
+
<el-col :span="8" data-test-id="EL-COL-44Qf7a">
|
|
30
|
+
<el-form-item :label="t('operator')" data-test-id="EL-FORM-ITEM-jhywJa">
|
|
31
|
+
<el-select
|
|
32
|
+
v-model="queryForm.operators"
|
|
33
|
+
clearable
|
|
34
|
+
multiple
|
|
35
|
+
collapse-tags
|
|
36
|
+
:collapse-tags-tooltip="true"
|
|
37
|
+
filterable
|
|
38
|
+
:placeholder="t('PleaseSelect')"
|
|
39
|
+
data-test-id="EL-SELECT-2iKRMnl"
|
|
40
|
+
>
|
|
41
|
+
<el-option
|
|
42
|
+
v-for="(item, index) in operatorList"
|
|
43
|
+
:key="index"
|
|
44
|
+
:label="item.name + ' ( ' + item.empNumber + ' )'"
|
|
45
|
+
:value="item.id"
|
|
46
|
+
:data-test-id="`EL-OPTION-rIctaO-${index}`"
|
|
47
|
+
>
|
|
48
|
+
</el-option>
|
|
49
|
+
</el-select>
|
|
50
|
+
</el-form-item>
|
|
51
|
+
</el-col>
|
|
52
|
+
|
|
53
|
+
<el-col :span="8" data-test-id="EL-COL-JWN3c6">
|
|
54
|
+
<el-form-item :label="t('operationTimeRange')" data-test-id="EL-FORM-ITEM-qGA6FG">
|
|
55
|
+
<el-date-picker
|
|
56
|
+
v-model="queryForm.timeRange"
|
|
57
|
+
type="datetimerange"
|
|
58
|
+
range-separator="~"
|
|
59
|
+
:start-placeholder="t('PleaseSelect')"
|
|
60
|
+
:end-placeholder="t('PleaseSelect')"
|
|
61
|
+
clearable
|
|
62
|
+
data-test-id="EL-DATE-PICKER-sXaAjJ"
|
|
63
|
+
/>
|
|
64
|
+
</el-form-item>
|
|
65
|
+
</el-col>
|
|
66
|
+
<el-col :span="8" data-test-id="EL-COL-7wsX67">
|
|
67
|
+
<div style="text-align: center" data-test-id="DIV-ePTtCw">
|
|
68
|
+
<el-button type="primary" data-test-id="EL-BUTTON-iepjfm" @click="handleQuery">{{
|
|
69
|
+
t('query')
|
|
70
|
+
}}</el-button>
|
|
71
|
+
<el-button data-test-id="EL-BUTTON-misE7D" @click="handleReset">{{ t('reset') }}</el-button>
|
|
72
|
+
<el-button link type="primary" data-test-id="EL-BUTTON-a3sO22ZO" @click="handleExport">
|
|
73
|
+
<v-icon style="margin-right: 0.5rem" class="mdi mdi-file-export" data-test-id="V-ICON-Mbdhkt" />
|
|
74
|
+
{{ $t('export') }}
|
|
75
|
+
</el-button>
|
|
76
|
+
</div>
|
|
77
|
+
</el-col>
|
|
78
|
+
<el-col :span="8" data-test-id="EL-COL-1mxuMy">
|
|
79
|
+
<el-form-item :label="t('operationType')" data-test-id="EL-FORM-ITEM-HAaHnq">
|
|
80
|
+
<el-select
|
|
81
|
+
v-model="queryForm.types"
|
|
82
|
+
:placeholder="t('PleaseSelect')"
|
|
83
|
+
clearable
|
|
84
|
+
multiple
|
|
85
|
+
collapse-tags
|
|
86
|
+
:collapse-tags-tooltip="true"
|
|
87
|
+
data-test-id="EL-SELECT-mg4gIc"
|
|
88
|
+
>
|
|
89
|
+
<el-option
|
|
90
|
+
v-for="(item, index) in operationTypes"
|
|
91
|
+
:key="item.value"
|
|
92
|
+
:label="item.label"
|
|
93
|
+
:value="item.value"
|
|
94
|
+
:data-test-id="`EL-OPTION-SDFctaO-${index}`"
|
|
95
|
+
/>
|
|
96
|
+
</el-select>
|
|
97
|
+
</el-form-item>
|
|
98
|
+
</el-col>
|
|
99
|
+
</el-row>
|
|
100
|
+
</el-form>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<!-- 列表区域 -->
|
|
104
|
+
<div class="table-container" data-test-id="DIV-wGYn7a">
|
|
105
|
+
<div class="table-wrapper" data-test-id="DIV-tableWrapper">
|
|
106
|
+
<el-table
|
|
107
|
+
:data="tableData"
|
|
108
|
+
border
|
|
109
|
+
:loading="tableLoading"
|
|
110
|
+
header-row-class-name="tableHeader"
|
|
111
|
+
header-cell-class-name="tableHeaderCell"
|
|
112
|
+
:scrollbar-always-on="true"
|
|
113
|
+
style="width: 100%"
|
|
114
|
+
size="default"
|
|
115
|
+
data-test-id="EL-TABLE-6CNtjP"
|
|
116
|
+
>
|
|
117
|
+
<el-table-column type="index" label="#" width="60" align="center" data-test-id="EL-TABLE-COLUMN-O8UyCw">
|
|
118
|
+
<template #default="scope">
|
|
119
|
+
<span data-test-id="SPAN-HEnHjc">{{ calcIndex(scope.$index) }}</span>
|
|
120
|
+
</template>
|
|
121
|
+
</el-table-column>
|
|
122
|
+
<el-table-column
|
|
123
|
+
v-for="(item, index) in headers"
|
|
124
|
+
:key="index"
|
|
125
|
+
:label="item.text"
|
|
126
|
+
:prop="item.value"
|
|
127
|
+
:width="item.width"
|
|
128
|
+
align="center"
|
|
129
|
+
show-overflow-tooltip
|
|
130
|
+
:data-test-id="`EL-TABLE-COLUMN-uzDbCR-${index}`"
|
|
131
|
+
>
|
|
132
|
+
<template #default="{ row, column }">
|
|
133
|
+
<span v-if="column.property === 'operateDate'" data-test-id="SPAN-Gd107Y">
|
|
134
|
+
{{ row.operateDate ? dayjs(row['operateDate']).format('YYYY-MM-DD HH:mm:ss') : '-' }}
|
|
135
|
+
</span>
|
|
136
|
+
<span v-if="column.property === 'operateType'" data-test-id="SPAN-DiW6W9">
|
|
137
|
+
<el-text v-if="row.operateType === 1" data-test-id="EL-TEXT-6b8Abr">{{ t('newView') }}</el-text>
|
|
138
|
+
<el-text v-if="row.operateType === 2" data-test-id="EL-TEXT-XzqTuW">{{ t('editView') }}</el-text>
|
|
139
|
+
<!-- <el-text v-if="row.operateType===3">{{t('copyView')}}</el-text> -->
|
|
140
|
+
<el-text v-if="row.operateType === 4" data-test-id="EL-TEXT-NrIXXs">{{ t('deleteView') }}</el-text>
|
|
141
|
+
</span>
|
|
142
|
+
</template>
|
|
143
|
+
</el-table-column>
|
|
144
|
+
</el-table>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<!-- 分页 -->
|
|
148
|
+
<div class="pagination-wrapper" data-test-id="DIV-paginationWrapper">
|
|
149
|
+
<Pagination
|
|
150
|
+
style="background-color: transparent; padding-bottom: 0.625rem; padding-top: 1.25rem"
|
|
151
|
+
:total="page.total"
|
|
152
|
+
:current-page="page.currentPage"
|
|
153
|
+
:page-type="2"
|
|
154
|
+
:page-size="page.pageSize"
|
|
155
|
+
:current-count="tableData.length"
|
|
156
|
+
:permission-code="pageData.permissionCode"
|
|
157
|
+
:has-selected="false"
|
|
158
|
+
data-test-id="PAGINATION-vcMBuD"
|
|
159
|
+
@changePage="changePage"
|
|
160
|
+
@fMounted="handleFMounted"
|
|
161
|
+
>
|
|
162
|
+
</Pagination>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</el-drawer>
|
|
167
|
+
</template>
|
|
168
|
+
|
|
169
|
+
<script setup>
|
|
170
|
+
import { ref, computed } from 'vue';
|
|
171
|
+
import { ElMessage } from 'element-plus';
|
|
172
|
+
import { objectToExcelTitle, objectToExcelBodyWithoutMap } from '@/scriptFiles/common/objectDataProcessing';
|
|
173
|
+
import Pagination from '@/components/Pagination.vue';
|
|
174
|
+
import apiFunction from '@/scriptFiles/checkApiErrorMechanism';
|
|
175
|
+
import { useI18n } from 'vue-i18n';
|
|
176
|
+
import dayjs from 'dayjs';
|
|
177
|
+
import EXCEL from '@/utils/excel.js';
|
|
178
|
+
const props = defineProps({
|
|
179
|
+
pageData: {
|
|
180
|
+
type: Object,
|
|
181
|
+
default: () => ({}),
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
const viewRecordDrawer = ref(false);
|
|
185
|
+
const { t } = useI18n();
|
|
186
|
+
// 分页
|
|
187
|
+
const page = ref({
|
|
188
|
+
total: 0,
|
|
189
|
+
currentPage: 1,
|
|
190
|
+
pageSize: 20,
|
|
191
|
+
});
|
|
192
|
+
// 表标题
|
|
193
|
+
const headers = computed(() => [
|
|
194
|
+
{ text: t('operator'), value: 'operateUserName', width: 150 }, //操作人员
|
|
195
|
+
{ text: t('operationTime'), value: 'operateDate', width: 220 }, //操作时间区间
|
|
196
|
+
{ text: t('operationType'), value: 'operateType', width: 150 }, //操作类型
|
|
197
|
+
{ text: t('operationDetails'), value: 'detail', width: '' }, //操作详情
|
|
198
|
+
]);
|
|
199
|
+
|
|
200
|
+
// 操作类型配置
|
|
201
|
+
const operationTypes = computed(() => [
|
|
202
|
+
{ label: t('newView'), value: 1 },
|
|
203
|
+
{ label: t('editView'), value: 2 },
|
|
204
|
+
// { label: t('copyView'), value: 3 },
|
|
205
|
+
{ label: t('deleteView'), value: 4 },
|
|
206
|
+
]);
|
|
207
|
+
const operatorList = ref([]); //操作人员列表
|
|
208
|
+
//获取操作人员
|
|
209
|
+
async function getEmployeeList() {
|
|
210
|
+
return apiFunction
|
|
211
|
+
.getViewEmployeeList({
|
|
212
|
+
permissionCode: props.pageData.permissionCode,
|
|
213
|
+
})
|
|
214
|
+
.then(async (res) => {
|
|
215
|
+
if (res.data.code === 0) {
|
|
216
|
+
operatorList.value = res.data.content;
|
|
217
|
+
} else {
|
|
218
|
+
ElMessage.error(t(res.data.message));
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
// 查询表单
|
|
223
|
+
const queryForm = ref({
|
|
224
|
+
operators: '',
|
|
225
|
+
timeRange: [],
|
|
226
|
+
types: [],
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
const tableData = ref([]);
|
|
230
|
+
const tableLoading = ref(false);
|
|
231
|
+
|
|
232
|
+
// 拆分operateDetail
|
|
233
|
+
function getOperateDetail(fieldString, type) {
|
|
234
|
+
const fields = fieldString.split(',').map((field) => field.replace(/'/g, '').replace(/"/g, '').trim());
|
|
235
|
+
while (fields.length < 4) fields.push('');
|
|
236
|
+
const [first, second, third, fourth] = fields;
|
|
237
|
+
const typeMap = {
|
|
238
|
+
1: () => t('addViewSuccessful', { name: first }),
|
|
239
|
+
4: () => t('deleteViewSuccessful', { name: first }),
|
|
240
|
+
2: () => {
|
|
241
|
+
const operations = [];
|
|
242
|
+
if (second) operations.push(t('adjustViewName', { name: first, newName: second }));
|
|
243
|
+
if (third) operations.push(t('adjustDataFiltering', { name: first }));
|
|
244
|
+
if (fourth) operations.push(t('adjustViewPermission', { name: first }));
|
|
245
|
+
return operations.length > 0 ? `${t('viewEditSuccessful')}, ${operations.join(', ')}` : t('viewEditSuccessful');
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
return typeMap[type] ? typeMap[type]() : '';
|
|
249
|
+
}
|
|
250
|
+
// 获取数据
|
|
251
|
+
const getViewLogList = async () => {
|
|
252
|
+
await apiFunction
|
|
253
|
+
.getViewOpLogList({
|
|
254
|
+
permissionCode: props.pageData.permissionCode,
|
|
255
|
+
operateUser: queryForm.value.operators || [],
|
|
256
|
+
operateStartDate: queryForm.value.timeRange?.length
|
|
257
|
+
? dayjs(queryForm.value.timeRange[0]).format('YYYY-MM-DD HH:mm')
|
|
258
|
+
: '',
|
|
259
|
+
operateEndDate: queryForm.value.timeRange?.length
|
|
260
|
+
? dayjs(queryForm.value.timeRange[1]).format('YYYY-MM-DD HH:mm')
|
|
261
|
+
: '',
|
|
262
|
+
operateType: queryForm.value.types.length ? queryForm.value.types : [],
|
|
263
|
+
startIndex: (page.value.currentPage - 1) * page.value.pageSize,
|
|
264
|
+
count: page.value.pageSize,
|
|
265
|
+
})
|
|
266
|
+
.then((res) => {
|
|
267
|
+
if (res.data.code === 0) {
|
|
268
|
+
tableLoading.value = false;
|
|
269
|
+
tableData.value = res.data.content.data.map((item) => {
|
|
270
|
+
return {
|
|
271
|
+
...item,
|
|
272
|
+
detail: getOperateDetail(item.operateDetail, item.operateType),
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
page.value.total = res.data.content.totalCount;
|
|
276
|
+
} else {
|
|
277
|
+
ElMessage.error(t(res.data.message));
|
|
278
|
+
tableLoading.value = false;
|
|
279
|
+
}
|
|
280
|
+
})
|
|
281
|
+
.catch()
|
|
282
|
+
.finally(() => {
|
|
283
|
+
tableLoading.value = false;
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
// 查询数据
|
|
287
|
+
const handleQuery = () => {
|
|
288
|
+
page.value.currentPage = 1; // 重置到第一页
|
|
289
|
+
tableLoading.value = true;
|
|
290
|
+
getViewLogList();
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
// 重置
|
|
294
|
+
const handleReset = () => {
|
|
295
|
+
queryForm.value = {
|
|
296
|
+
operators: [],
|
|
297
|
+
timeRange: [],
|
|
298
|
+
types: [],
|
|
299
|
+
};
|
|
300
|
+
page.value = {
|
|
301
|
+
currentPage: 1,
|
|
302
|
+
pageSize: 20,
|
|
303
|
+
};
|
|
304
|
+
getViewLogList();
|
|
305
|
+
};
|
|
306
|
+
// 分页方法
|
|
307
|
+
const changePage = async (val) => {
|
|
308
|
+
page.value.currentPage = val.page;
|
|
309
|
+
page.value.pageSize = val.size;
|
|
310
|
+
getViewLogList();
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
const handleFMounted = (arg, pageParam) => {
|
|
314
|
+
page.value.currentPage = pageParam.page;
|
|
315
|
+
page.value.pageSize = pageParam.size;
|
|
316
|
+
};
|
|
317
|
+
const calcIndex = (index) => {
|
|
318
|
+
return Number(index) + 1 + (page.value.currentPage - 1) * page.value.pageSize;
|
|
319
|
+
};
|
|
320
|
+
// 获取全部视图记录数据
|
|
321
|
+
const getLogList = ref([]);
|
|
322
|
+
const getAllLogData = async (v) => {
|
|
323
|
+
try {
|
|
324
|
+
const {
|
|
325
|
+
data: { code, content },
|
|
326
|
+
} = await apiFunction.getViewOpLogList({
|
|
327
|
+
permissionCode: props.pageData.permissionCode,
|
|
328
|
+
operateUser: queryForm.value.operators || [],
|
|
329
|
+
operateStartDate: queryForm.value.timeRange?.length
|
|
330
|
+
? dayjs(queryForm.value.timeRange[0]).format('YYYY-MM-DD HH:mm')
|
|
331
|
+
: '',
|
|
332
|
+
operateEndDate: queryForm.value.timeRange?.length
|
|
333
|
+
? dayjs(queryForm.value.timeRange[1]).format('YYYY-MM-DD HH:mm')
|
|
334
|
+
: '',
|
|
335
|
+
operateType: queryForm.value.types ? queryForm.value.types : [],
|
|
336
|
+
startIndex: v,
|
|
337
|
+
count: 200,
|
|
338
|
+
});
|
|
339
|
+
if (code === 0) {
|
|
340
|
+
getLogList.value = getLogList.value.concat(content.data);
|
|
341
|
+
if (content.totalCount > getLogList.value.length) {
|
|
342
|
+
await getAllLogData((v += 200));
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
} catch (error) {
|
|
346
|
+
ElMessage.error(t(error.message));
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
// 日期转换
|
|
350
|
+
function dateConvert(time) {
|
|
351
|
+
return time ? dayjs(time).format('YY-MM-DD HH:mm:ss') : '--';
|
|
352
|
+
}
|
|
353
|
+
function getOptypeName(val) {
|
|
354
|
+
switch (val) {
|
|
355
|
+
case 1:
|
|
356
|
+
return 'newView';
|
|
357
|
+
case 2:
|
|
358
|
+
return 'editView';
|
|
359
|
+
case 3:
|
|
360
|
+
return 'copyView';
|
|
361
|
+
case 4:
|
|
362
|
+
return 'deleteView';
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
// 导出
|
|
366
|
+
const handleExport = async () => {
|
|
367
|
+
const title = objectToExcelTitle(headers.value);
|
|
368
|
+
getLogList.value = [];
|
|
369
|
+
await getAllLogData(0);
|
|
370
|
+
const tempList = [];
|
|
371
|
+
getLogList.value.forEach((element) => {
|
|
372
|
+
const tempObject = {
|
|
373
|
+
operateUserName: element.operateUserName,
|
|
374
|
+
operateDate: dateConvert(element.operateDate),
|
|
375
|
+
operateType: t(getOptypeName(element.operateType)),
|
|
376
|
+
detail: getOperateDetail(element.operateDetail, element.operateType),
|
|
377
|
+
};
|
|
378
|
+
tempList.push(tempObject);
|
|
379
|
+
});
|
|
380
|
+
const bodyWithoutMap = objectToExcelBodyWithoutMap(tempList, headers.value, '', '');
|
|
381
|
+
const body = [];
|
|
382
|
+
bodyWithoutMap.map((item, index) => {
|
|
383
|
+
const temp = { ...item };
|
|
384
|
+
const arr = Object.values(temp);
|
|
385
|
+
body[index] = arr;
|
|
386
|
+
return body;
|
|
387
|
+
});
|
|
388
|
+
const wscols = Array.from({ length: headers.value.length }, () => ({ wch: 19 }));
|
|
389
|
+
EXCEL.exportFromArray({
|
|
390
|
+
title,
|
|
391
|
+
body,
|
|
392
|
+
name: t('viewOperationRecord'),
|
|
393
|
+
suffix: 'xlsx',
|
|
394
|
+
sheetName: t('viewOperationRecord'),
|
|
395
|
+
wscols: wscols,
|
|
396
|
+
});
|
|
397
|
+
};
|
|
398
|
+
// 打开视图列表抽屉
|
|
399
|
+
function open() {
|
|
400
|
+
viewRecordDrawer.value = true;
|
|
401
|
+
getEmployeeList();
|
|
402
|
+
handleQuery();
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// 关闭视图列表抽屉
|
|
406
|
+
function closeViewRecordDrawer() {
|
|
407
|
+
viewRecordDrawer.value = false;
|
|
408
|
+
tableData.value = [];
|
|
409
|
+
queryForm.value = {
|
|
410
|
+
operators: [],
|
|
411
|
+
timeRange: [],
|
|
412
|
+
types: [],
|
|
413
|
+
};
|
|
414
|
+
page.value.total = 0;
|
|
415
|
+
}
|
|
416
|
+
defineExpose({
|
|
417
|
+
open,
|
|
418
|
+
});
|
|
419
|
+
</script>
|
|
420
|
+
|
|
421
|
+
<style scoped>
|
|
422
|
+
.view-operation-record {
|
|
423
|
+
padding: 16px 0;
|
|
424
|
+
height: calc(100% - 26px);
|
|
425
|
+
display: flex;
|
|
426
|
+
flex-direction: column;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.filter-card {
|
|
430
|
+
background-color: #fff;
|
|
431
|
+
flex-shrink: 0;
|
|
432
|
+
/* 防止筛选区域被压缩 */
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.query-form {
|
|
436
|
+
margin-bottom: 0;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.button-group {
|
|
440
|
+
margin-top: 10px;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/* 新增的表格容器样式 */
|
|
444
|
+
.table-container {
|
|
445
|
+
flex: 1;
|
|
446
|
+
display: flex;
|
|
447
|
+
flex-direction: column;
|
|
448
|
+
background-color: #fff;
|
|
449
|
+
margin-top: 16px;
|
|
450
|
+
min-height: 0;
|
|
451
|
+
/* 重要:防止flex item溢出 */
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.table-wrapper {
|
|
455
|
+
flex: 1;
|
|
456
|
+
min-height: 0;
|
|
457
|
+
/* 重要:防止flex item溢出 */
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/* 确保表格填满容器 */
|
|
461
|
+
.table-wrapper :deep(.el-table) {
|
|
462
|
+
height: 100% !important;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.pagination-wrapper {
|
|
466
|
+
flex-shrink: 0;
|
|
467
|
+
/* 分页区域不被压缩 */
|
|
468
|
+
background-color: #fff;
|
|
469
|
+
border-top: 1px solid #ebeef5;
|
|
470
|
+
/* 可选:添加分割线 */
|
|
471
|
+
}
|
|
472
|
+
</style>
|