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,137 @@
|
|
|
1
|
+
import errorCode from '@/configFiles/errorCode.json';
|
|
2
|
+
import apiFunction from './backendApiFunction.js';
|
|
3
|
+
import { ElMessage } from 'element-plus';
|
|
4
|
+
import i18n from '@/utils/i18n.js';
|
|
5
|
+
|
|
6
|
+
const delay = (times) =>
|
|
7
|
+
new Promise((resolve) => {
|
|
8
|
+
setTimeout(() => {
|
|
9
|
+
const timeAddTime = times + 1;
|
|
10
|
+
resolve(timeAddTime);
|
|
11
|
+
return timeAddTime;
|
|
12
|
+
}, 3000);
|
|
13
|
+
});
|
|
14
|
+
const JumpLogin = () => {
|
|
15
|
+
const BUILD_TYPE = process.env.NODE_ENV;
|
|
16
|
+
if (BUILD_TYPE === 'production') {
|
|
17
|
+
// 生产环境
|
|
18
|
+
const { protocol } = window.location;
|
|
19
|
+
const { hostname } = window.location;
|
|
20
|
+
const { port } = window.location;
|
|
21
|
+
window.location.href = `${protocol}//${hostname}:${port}/BASE/login`;
|
|
22
|
+
} else if (BUILD_TYPE === 'development') {
|
|
23
|
+
// 本地研发环境
|
|
24
|
+
window.location.href = '/login';
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const callRefreshAPI = async (action, prop, times) => {
|
|
28
|
+
let apiResult = {};
|
|
29
|
+
await apiFunction
|
|
30
|
+
.refreshToken({
|
|
31
|
+
account: localStorage.synFactoryUserID,
|
|
32
|
+
})
|
|
33
|
+
.then(async (response) => {
|
|
34
|
+
switch (response.data.code) {
|
|
35
|
+
case errorCode.Success: {
|
|
36
|
+
await action(...prop)
|
|
37
|
+
.then((res) => {
|
|
38
|
+
apiResult = res;
|
|
39
|
+
})
|
|
40
|
+
.catch((err) => {
|
|
41
|
+
apiResult = err;
|
|
42
|
+
});
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
// case errorCode.Token_Expired:
|
|
46
|
+
// case errorCode.Cookie_Error:
|
|
47
|
+
// case errorCode.Verify_Fail: {
|
|
48
|
+
// apiFunction
|
|
49
|
+
// .logout()
|
|
50
|
+
// .then(() => {
|
|
51
|
+
// JumpLogin();
|
|
52
|
+
// })
|
|
53
|
+
// .catch((err) => {
|
|
54
|
+
// console.log(err);
|
|
55
|
+
// });
|
|
56
|
+
// apiResult = {};
|
|
57
|
+
// break;
|
|
58
|
+
// }
|
|
59
|
+
default: {
|
|
60
|
+
apiFunction
|
|
61
|
+
.logout()
|
|
62
|
+
.then(() => {
|
|
63
|
+
JumpLogin();
|
|
64
|
+
})
|
|
65
|
+
.catch((err) => {
|
|
66
|
+
console.log(err);
|
|
67
|
+
});
|
|
68
|
+
apiResult = {};
|
|
69
|
+
ElMessage.error('Refresh Token Api Error!');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
.catch(async (err) => {
|
|
74
|
+
apiResult = err;
|
|
75
|
+
const timeAdd = await delay(times);
|
|
76
|
+
if (timeAdd > 1) {
|
|
77
|
+
ElMessage.error(i18n.global.t('canNotGetToken'));
|
|
78
|
+
return apiResult;
|
|
79
|
+
}
|
|
80
|
+
return await callRefreshAPI(action, prop, timeAdd);
|
|
81
|
+
});
|
|
82
|
+
return apiResult;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const retryExecute = async (action, parameter, times, shouldAlert) => {
|
|
86
|
+
try {
|
|
87
|
+
const result = await action(...parameter);
|
|
88
|
+
if (result.data.code === errorCode.Verify_Fail || result.data.code === errorCode.Cookie_Error || result.data.code === errorCode.UserID_UnExist) {
|
|
89
|
+
apiFunction
|
|
90
|
+
.logout()
|
|
91
|
+
.then(() => {
|
|
92
|
+
JumpLogin();
|
|
93
|
+
})
|
|
94
|
+
.catch((err) => {
|
|
95
|
+
console.log(err);
|
|
96
|
+
});
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
if (result.data.code === errorCode.Token_Expired) {
|
|
100
|
+
return await callRefreshAPI(action, parameter, 0);
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
103
|
+
} catch (error) {
|
|
104
|
+
const timeAdd = await delay(times);
|
|
105
|
+
if (timeAdd > 1) {
|
|
106
|
+
if (shouldAlert) {
|
|
107
|
+
// ElMessage.error(i18n.global.t('apiError'));
|
|
108
|
+
return error;
|
|
109
|
+
}
|
|
110
|
+
throw error;
|
|
111
|
+
}
|
|
112
|
+
return await retryExecute(action, parameter, times + 1, shouldAlert);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @param {object} apis apiFunction
|
|
119
|
+
* @param {boolean}shouldAlert should alert when error
|
|
120
|
+
* @returns {Object} proxy object
|
|
121
|
+
*/
|
|
122
|
+
function createApiProxy(apis, shouldAlert = false) {
|
|
123
|
+
return new Proxy(apis, {
|
|
124
|
+
get(...args) {
|
|
125
|
+
const allFunction = Reflect.get(...args);
|
|
126
|
+
return async function thisFun(...param) {
|
|
127
|
+
return retryExecute(allFunction, param, 0, shouldAlert);
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const nonAlertProxy = createApiProxy(apiFunction);
|
|
134
|
+
const proxyObj = createApiProxy(apiFunction, true);
|
|
135
|
+
|
|
136
|
+
export default proxyObj;
|
|
137
|
+
export { nonAlertProxy };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 物件轉excel header
|
|
3
|
+
* @param {*} object 物件
|
|
4
|
+
* @returns {Array} 回傳excel header
|
|
5
|
+
*/
|
|
6
|
+
export function objectToExcelTitle(object) {
|
|
7
|
+
const title = [];
|
|
8
|
+
const titleList = [];
|
|
9
|
+
object.forEach((ele) => {
|
|
10
|
+
titleList.push(ele.text);
|
|
11
|
+
});
|
|
12
|
+
title.push(titleList);
|
|
13
|
+
return title;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 物件轉excel body
|
|
18
|
+
* @param {Array} table excel資料
|
|
19
|
+
* @param {Array} header excel header
|
|
20
|
+
* @param {string} stringReplaced 被替換字串
|
|
21
|
+
* @param {string} replaceTo 替換字串
|
|
22
|
+
* @returns {Array} 回傳excel body
|
|
23
|
+
*/
|
|
24
|
+
export function objectToExcelBodyWithoutMap(table, header, stringReplaced, replaceTo) {
|
|
25
|
+
const bodyTemp = [];
|
|
26
|
+
table.forEach((ele) => {
|
|
27
|
+
const sortedObject = {};
|
|
28
|
+
header.forEach((head) => {
|
|
29
|
+
Object.entries(ele).forEach((key) => {
|
|
30
|
+
if (key[0] === head.value.replace(stringReplaced, replaceTo)) {
|
|
31
|
+
const value = key[1];
|
|
32
|
+
sortedObject[key[0]] = value;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
bodyTemp.push(sortedObject);
|
|
37
|
+
});
|
|
38
|
+
return bodyTemp;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 物件轉下拉選單array
|
|
43
|
+
* @param {object} object 物件
|
|
44
|
+
* @returns {Array} 回傳下拉選單array
|
|
45
|
+
*/
|
|
46
|
+
export function objectToSelectList(object) {
|
|
47
|
+
const list = [];
|
|
48
|
+
Object.entries(object).forEach((key) => {
|
|
49
|
+
list.push({
|
|
50
|
+
text: key[0],
|
|
51
|
+
value: parseInt(key[1], 10),
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
return list;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 取得物件特定key值
|
|
59
|
+
* @param {object} obj 物件
|
|
60
|
+
* @param {number} value 特定key的value
|
|
61
|
+
* @returns {string} 回傳特定key
|
|
62
|
+
*/
|
|
63
|
+
export function getObjKeys(obj, value) {
|
|
64
|
+
return Object.keys(obj).find((key) => obj[key] === value);
|
|
65
|
+
}
|