commit:前端webpack版本

This commit is contained in:
Jerry
2024-07-14 22:11:19 +08:00
parent 8295a6a167
commit ed5b9fc602
47 changed files with 23209 additions and 5197 deletions

View File

@@ -0,0 +1,4 @@
> 1%
last 2 versions
not dead
not ie 11

View File

@@ -1,2 +1,2 @@
VITE_SERVER_HOST='http://localhost:8082/'
VITE_PROJECT_NAME='橙单演示工程'
VUE_APP_SERVER_HOST='http://localhost:8082/'
VUE_APP_PROJECT_NAME='橙单演示工程'

View File

@@ -1,2 +1,2 @@
VITE_SERVER_HOST='http://localhost:8082/'
VITE_PROJECT_NAME='橙单项目'
VUE_APP_SERVER_HOST='http://localhost:8082/'
VUE_APP_PROJECT_NAME='橙单项目'

83
OrangeFormsOpen-VUE3/auto-imports.d.ts vendored Normal file
View File

@@ -0,0 +1,83 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const createPinia: typeof import('pinia')['createPinia']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const defineStore: typeof import('pinia')['defineStore']
const effectScope: typeof import('vue')['effectScope']
const getActivePinia: typeof import('pinia')['getActivePinia']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const mapActions: typeof import('pinia')['mapActions']
const mapGetters: typeof import('pinia')['mapGetters']
const mapState: typeof import('pinia')['mapState']
const mapStores: typeof import('pinia')['mapStores']
const mapWritableState: typeof import('pinia')['mapWritableState']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const setActivePinia: typeof import('pinia')['setActivePinia']
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const storeToRefs: typeof import('pinia')['storeToRefs']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useLink: typeof import('vue-router')['useLink']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useSlots: typeof import('vue')['useSlots']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
import('vue')
}

View File

@@ -0,0 +1,3 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset'],
};

View File

@@ -8,17 +8,11 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
AdvanceQuery: typeof import('./src/components/AdvanceQuery/index.vue')['default']
BarChart: typeof import('./src/components/Charts/barChart.vue')['default']
Base: typeof import('./src/components/Charts/base.vue')['default']
BreadCrumb: typeof import('./src/components/layout/components/BreadCrumb.vue')['default']
CarouselChart: typeof import('./src/components/Charts/carouselChart.vue')['default']
CommonList: typeof import('./src/components/Charts/commonList.vue')['default']
DataCard: typeof import('./src/components/Charts/dataCard.vue')['default']
DataProgressCard: typeof import('./src/components/Charts/dataProgressCard.vue')['default']
DataViewTable: typeof import('./src/components/Charts/dataViewTable.vue')['default']
BtnsRightAddBtn: typeof import('./src/components/Btns/RightAddBtn.vue')['default']
DateRange: typeof import('./src/components/DateRange/index.vue')['default']
DeptSelect: typeof import('./src/components/DeptSelect/index.vue')['default']
DeptSelectDlg: typeof import('./src/components/DeptSelect/DeptSelectDlg.vue')['default']
DeptSelectDeptSelectDlg: typeof import('./src/components/DeptSelect/DeptSelectDlg.vue')['default']
DialogLayout: typeof import('./src/components/Dialog/layout.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAside: typeof import('element-plus/es')['ElAside']
ElBadge: typeof import('element-plus/es')['ElBadge']
@@ -27,8 +21,6 @@ declare module 'vue' {
ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
@@ -44,7 +36,6 @@ declare module 'vue' {
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElFooter: typeof import('element-plus/es')['ElFooter']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
@@ -53,8 +44,6 @@ declare module 'vue' {
ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
ElIconArrowLeft: typeof import('@element-plus/icons-vue')['ArrowLeft']
ElIconArrowRight: typeof import('@element-plus/icons-vue')['ArrowRight']
ElIconCaretBottom: typeof import('@element-plus/icons-vue')['CaretBottom']
ElIconClose: typeof import('@element-plus/icons-vue')['Close']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
@@ -65,7 +54,6 @@ declare module 'vue' {
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
@@ -84,58 +72,30 @@ declare module 'vue' {
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
FilterBox: typeof import('./src/components/FilterBox/index.vue')['default']
FunnelChart: typeof import('./src/components/Charts/funnelChart.vue')['default']
FunnelChartV3: typeof import('./src/components/Charts/funnelChartV3.vue')['default']
GaugeChart: typeof import('./src/components/Charts/gaugeChart.vue')['default']
Icons: typeof import('./src/components/icons/index.vue')['default']
IconSelect: typeof import('./src/components/IconSelect/index.vue')['default']
InputNumberRange: typeof import('./src/components/InputNumberRange/index.vue')['default']
Layout: typeof import('./src/components/Dialog/layout.vue')['default']
LineChart: typeof import('./src/components/Charts/lineChart.vue')['default']
MultiColumn: typeof import('./src/components/layout/components/multi-column.vue')['default']
MultiColumnMenu: typeof import('./src/components/layout/components/multi-column-menu.vue')['default']
Layout: typeof import('./src/components/layout/index.vue')['default']
LayoutComponentsBreadCrumb: typeof import('./src/components/layout/components/BreadCrumb.vue')['default']
LayoutComponentsMultiColumn: typeof import('./src/components/layout/components/multi-column.vue')['default']
LayoutComponentsMultiColumnMenu: typeof import('./src/components/layout/components/multi-column-menu.vue')['default']
LayoutComponentsSidebar: typeof import('./src/components/layout/components/Sidebar.vue')['default']
LayoutComponentsSubMenu: typeof import('./src/components/layout/components/SubMenu.vue')['default']
LayoutComponentsTagItem: typeof import('./src/components/layout/components/TagItem.vue')['default']
LayoutComponentsTagPanel: typeof import('./src/components/layout/components/TagPanel.vue')['default']
MultiItemBox: typeof import('./src/components/MultiItemBox/index.vue')['default']
MultiItemList: typeof import('./src/components/MultiItemList/index.vue')['default']
PageCloseButton: typeof import('./src/components/PageCloseButton/index.vue')['default']
PieChart: typeof import('./src/components/Charts/pieChart.vue')['default']
PivotTable: typeof import('./src/components/Charts/pivotTable.vue')['default']
PivotTableColumn: typeof import('./src/components/Charts/pivotTableColumn.vue')['default']
Progress: typeof import('./src/components/Progress/index.vue')['default']
ProgressBar: typeof import('./src/components/Charts/progressBar.vue')['default']
ProgressCircle: typeof import('./src/components/Charts/progressCircle.vue')['default']
RadarChart: typeof import('./src/components/Charts/radarChart.vue')['default']
RadarChartV3: typeof import('./src/components/Charts/radarChartV3.vue')['default']
RichEditor: typeof import('./src/components/RichEditor/index.vue')['default']
RichText: typeof import('./src/components/Charts/richText.vue')['default']
RightAddBtn: typeof import('./src/components/Btns/RightAddBtn.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
ScatterChart: typeof import('./src/components/Charts/scatterChart.vue')['default']
ScriptEditor: typeof import('./src/components/ScriptEditor/index.vue')['default']
Sidebar: typeof import('./src/components/layout/components/Sidebar.vue')['default']
StepBar: typeof import('./src/components/StepBar/index.vue')['default']
StepItem: typeof import('./src/components/StepBar/stepItem.vue')['default']
SubMenu: typeof import('./src/components/layout/components/SubMenu.vue')['default']
StepBarStepItem: typeof import('./src/components/StepBar/stepItem.vue')['default']
TableBox: typeof import('./src/components/TableBox/index.vue')['default']
TableProgressColumn: typeof import('./src/components/TableProgressColumn/index.vue')['default']
TagItem: typeof import('./src/components/layout/components/TagItem.vue')['default']
TagPanel: typeof import('./src/components/layout/components/TagPanel.vue')['default']
ThirdParty: typeof import('./src/components/thirdParty/index.vue')['default']
UserSelect: typeof import('./src/components/UserSelect/index.vue')['default']
UserSelectDlg: typeof import('./src/components/UserSelect/UserSelectDlg.vue')['default']
VanButton: typeof import('vant/es')['Button']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanCheckbox: typeof import('vant/es')['Checkbox']
VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
VanForm: typeof import('vant/es')['Form']
VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup']
VanRate: typeof import('vant/es')['Rate']
VanSearch: typeof import('vant/es')['Search']
VanSidebar: typeof import('vant/es')['Sidebar']
VanSidebarItem: typeof import('vant/es')['SidebarItem']
VanStepper: typeof import('vant/es')['Stepper']
VanSwitch: typeof import('vant/es')['Switch']
VanUploader: typeof import('vant/es')['Uploader']
UserSelectUserSelectDlg: typeof import('./src/components/UserSelect/UserSelectDlg.vue')['default']
}
}

View File

@@ -8,6 +8,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script src="/src/main.ts"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -2,11 +2,9 @@
"name": "vite",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview",
"dev": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "eslint --fix \"src/**/*.{ts,vue}\" && prettier --write \"src/**/*.{ts,vue}\""
},
"dependencies": {
@@ -17,25 +15,27 @@
"ace-builds": "^1.32.2",
"axios": "^1.5.1",
"bpmn-js-token-simulation": "^0.10.0",
"clipboard": "^2.0.11",
"core-js": "^3.8.3",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.10",
"echarts": "^5.5.0",
"ejs": "^3.1.9",
"element-plus": "^2.7.3",
"highlight.js": "^11.9.0",
"jsencrypt": "^3.3.2",
"json-bigint": "^1.0.0",
"clipboard": "^2.0.11",
"pinia": "^2.1.6",
"pinia-plugin-persist": "^1.0.0",
"vant": "^4.7.3",
"vue": "^3.3.8",
"element-plus": "^2.7.3",
"vue-draggable-plus": "^0.3.1",
"vue-json-viewer": "^3.0.4",
"vue-router": "^4.2.5",
"vxe-table": "^4.5.13",
"xe-utils": "^3.5.14",
"xml-js": "^1.6.11"
"xml-js": "^1.6.11",
"lodash": "^4.17.21"
},
"devDependencies": {
"@types/ejs": "^3.1.5",
@@ -44,7 +44,12 @@
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"@vant/auto-import-resolver": "^1.0.2",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"autoprefixer": "^10.4.16",
"bpmn-js": "^7.4.0",
"bpmn-js-properties-panel": "^0.37.2",
@@ -54,18 +59,17 @@
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.8.0",
"node-polyfill-webpack-plugin": "^4.0.0",
"postcss": "^8.4.20",
"postcss-html": "^1.5.0",
"postcss-preset-env": "^7.8.3",
"postcss-scss": "^4.0.6",
"prettier": "2.8.1",
"sass": "^1.57.1",
"sass": "^1.32.7",
"sass-loader": "^12.0.0",
"typescript": "^4.9.3",
"unplugin-auto-import": "^0.16.7",
"unplugin-vue-components": "^0.25.2",
"vite": "^4.0.0",
"vite-plugin-eslint": "^1.8.1",
"vue-eslint-parser": "^9.1.0",
"vue-tsc": "^1.0.11"
"vue-eslint-parser": "^9.1.0"
}
}

View File

@@ -9,7 +9,7 @@ watch(
() => route.name,
() => {
//console.log('路由发生了变化', route.name, route.fullPath, route.path, route);
document.title = import.meta.env.VITE_PROJECT_NAME;
document.title = process.env.VUE_APP_PROJECT_NAME;
if (route.meta && route.meta.title) {
document.title += ' - ' + route.meta.title;
}

View File

@@ -61,71 +61,71 @@ $--color-primary-light-9: color-mix(in srgb, $--color-white 90%, $--color-primar
/**
* 弹窗样式封装的layer的弹窗
**/
body .layer-dialog .layui-layer-title{
.layui-layer-page .layui-layer-title{
border:1px solid #01000000;
border-radius: 4px 4px 0 0;
background-color: #f8f8f8;
}
body .layer-dialog .slot-fragment {
.layui-layer-page .slot-fragment {
height: 100%;
}
body .layer-dialog .layui-layer-setwin {color: #fff}
.layui-layer-page .layui-layer-setwin {color: #fff}
body .layer-dialog {
.layui-layer-page {
border:1px solid #01000000;
border-radius: 4px;
}
body .layer-dialog .layui-layer-content {
.layui-layer-page .layui-layer-content {
padding: $box-padding-size;
}
body .layer-dialog.one_to_one_query .layui-layer-content {
.layui-layer-page.one_to_one_query .layui-layer-content {
padding: 0;
}
body .layer-dialog.layui-layer-iframe .layui-layer-content {
.layui-layer-page.layui-layer-iframe .layui-layer-content {
padding: 0!important;
}
/**
* 左树右表弹窗样式
*/
body .layer-advance-dialog {
.layer-advance-dialog {
background-color: #F8F8F8;
border:1px solid #01000000;
border-radius: 4px;
}
body .layer-advance-dialog .layui-layer-title{
.layer-advance-dialog .layui-layer-title{
border:1px solid #01000000;
border-radius: 4px 4px 0 0;
}
body .layer-advance-dialog .layui-layer-content {
.layer-advance-dialog .layui-layer-content {
padding: 5px 15px;
}
/**
* 全屏弹窗样式
*/
body .fullscreen-dialog {
.fullscreen-dialog {
background-color: #F8F8F8;
border: none;
border-radius: 0;
}
body .fullscreen-dialog .layui-layer-title {
.fullscreen-dialog .layui-layer-title {
display: none;
}
body .fullscreen-dialog .layui-layer-setwin {
.fullscreen-dialog .layui-layer-setwin {
display: none;
}
body .fullscreen-dialog .layui-layer-content {
.fullscreen-dialog .layui-layer-content {
height: 100vh!important;
padding: 0;
}
@@ -735,7 +735,7 @@ body .fullscreen-dialog .layui-layer-content {
border-radius: 8px;
line-height: 40px;
}
.logo {;
.logo {
display: inline-block;
padding-left: 0;
margin-right: 8px;

View File

@@ -19,10 +19,7 @@ export const useDate = () => {
statsType = allowStatsType.indexOf(statsType) === -1 ? 'day' : statsType;
if (statsType === 'datetime') format = 'YYYY-MM-DD HH:mm:ss';
//console.log('date', statsType, format, date);
const tempDate = date instanceof Date ? date : parseDate(date, format);
//console.log('tempDate', tempDate);
if (!tempDate) return undefined;
switch (statsType) {
case 'time':

View File

@@ -25,7 +25,6 @@ export const useDownload = () => {
},
)
.then(res => {
console.log('============= download', res);
const data = res instanceof Blob ? res : res.data;
if (data instanceof Blob) {
const url = window.URL.createObjectURL(data);
@@ -41,7 +40,6 @@ export const useDownload = () => {
}
})
.catch(e => {
console.error('============= download', e);
if (e instanceof Blob) {
const reader = new FileReader();
reader.onload = function () {

View File

@@ -16,14 +16,11 @@ export const useDropdown = <T>(options: DropdownOptions<T>) => {
const { loadData, isTree, idKey, parentIdKey } = finalOptions;
//console.log('dropdown', loadData, isTree, idKey, parentIdKey);
const loadDropdownData = (): Promise<T[]> => {
return new Promise((resolve, reject) => {
if (!loaded && !loading.value) {
loadData()
.then(res => {
console.log(`loadDropdownData 加载了${res.dataList.length}条数据`);
loaded = true;
dropdownList.value = isTree
? treeDataTranslate(res.dataList, idKey, parentIdKey)

View File

@@ -5,7 +5,6 @@ export const usePermissions = () => {
const loginStorage = useLoginStore();
const checkPermCodeExist = (permCode: string) => {
//console.log(permCode);
if (getAppId() != null && getAppId() !== '') return true;
if (loginStorage.userInfo == null) {

View File

@@ -35,7 +35,6 @@ export const useTable = <T>(options: TableOptions<T>) => {
// 监听pageSize变化
watch(pageSize, (newVal, oldVal) => {
//console.log('pageSize change', newVal, oldVal);
if (newVal != oldVal) {
loadData(1, newVal)
.then(() => {
@@ -70,14 +69,8 @@ export const useTable = <T>(options: TableOptions<T>) => {
*/
const loadData = (pageNum: number, pageSize: number, reload = false): Promise<void> => {
if (paged && !reload && oldPage == pageNum && oldPageSize == pageSize) {
console.log('数据已加载,无须重复执行');
return Promise.resolve();
}
if (paged) {
console.log(`开始加载数据, 第${pageNum}页,每页${pageSize}, 强制加载:${reload}`);
} else {
console.log(`开始加载数据, 无分页, 强制加载:${reload}`);
}
const params = {} as RequestParam;
if (orderInfo.fieldName != null) params.orderParam = [orderInfo];
@@ -91,13 +84,11 @@ export const useTable = <T>(options: TableOptions<T>) => {
loading.value = true;
loadTableData(params)
.then(res => {
//console.log(res.dataList, res.totalCount);
// vxetable需要用到对象的hasOwnerProperty方法因此需要重新构造对象
dataList.value = res.dataList.map((item: T) => {
return { ...item };
});
totalCount.value = res.totalCount;
console.log(`本次加载${res.dataList.length}条数据,共有${res.totalCount}条数据`);
resolve();
})
.catch(e => {
@@ -105,7 +96,6 @@ export const useTable = <T>(options: TableOptions<T>) => {
})
.finally(() => {
loading.value = false;
//console.log('加载数据完毕');
});
});
};
@@ -125,7 +115,6 @@ export const useTable = <T>(options: TableOptions<T>) => {
* @param {String} order 正序还是倒序
*/
const onSortChange = ({ prop, field, order }: SortInfo) => {
//console.log(prop, field, order);
orderInfo.fieldName = prop || field;
orderInfo.asc = order == 'ascending' || order == 'asc';
refreshTable();
@@ -137,7 +126,6 @@ export const useTable = <T>(options: TableOptions<T>) => {
* @param showMsg 是否显示查询结果成功与否消息
*/
const refreshTable = (research = false, pageNum = 0, showMsg = false) => {
//console.log(research, pageNum, showMsg);
let reload = false;
if (research) {
if (!verifyTableParameter()) return;

View File

@@ -13,7 +13,7 @@ export const useUpload = () => {
* @returns {Array} 上传文件信息,[{name, downloadUri, filename, url}]
*/
const parseUploadData = (jsonData: string, params: ANY_OBJECT) => {
let pathList = [];
let pathList: Array<ANY_OBJECT> = [];
if (jsonData != null) {
try {
pathList = JSON.parse(jsonData);
@@ -39,7 +39,7 @@ export const useUpload = () => {
* @param {*} item 上传文件
* @param {*} params 上传文件的参数
*/
const getUploadFileUrl = (item: { downloadUri: string }, params?: ANY_OBJECT) => {
const getUploadFileUrl = (item: ANY_OBJECT, params?: ANY_OBJECT) => {
if (item == null || item.downloadUri == null) {
return null;
} else {
@@ -101,7 +101,6 @@ export const useUpload = () => {
},
)
.then((res: ANY_OBJECT) => {
console.log('uploaded file fetchUpload', res);
if (res.data && res.success) {
resolve(res.data);
}

View File

@@ -9,14 +9,13 @@ export const useUrlBuilder = () => {
* @returns 请求全路径(含参数)
*/
const buildGetUrl = (actionName: string, params: ANY_OBJECT | null = null) => {
console.log('getUrl', actionName);
const queryString = objectToQueryString(params);
if (actionName != null && actionName !== '') {
if (actionName.substring(0, 1) === '/') actionName = actionName.substring(1);
}
return (
import.meta.env.VITE_SERVER_HOST + actionName + (queryString == null ? '' : '?' + queryString)
process.env.VUE_APP_SERVER_HOST + actionName + (queryString == null ? '' : '?' + queryString)
);
};
@@ -25,14 +24,13 @@ export const useUrlBuilder = () => {
* @param actionName action方法名称
*/
const requestUrl = (actionName: string) => {
console.log('requestUrl', actionName);
if (actionName) {
if (actionName.substring(0, 1) === '/') actionName = actionName.substring(1);
}
if (actionName.indexOf('http://') === 0 || actionName.indexOf('https://') === 0) {
return actionName;
} else {
return import.meta.env.VITE_SERVER_HOST + actionName;
return process.env.VUE_APP_SERVER_HOST + actionName;
}
};

View File

@@ -12,7 +12,6 @@ const documentClientHeight = ref(0);
*/
export const useWindowResize = () => {
const windowResize = () => {
//console.log('窗口尺寸发生变化');
documentClientHeight.value = document.documentElement.clientHeight;
if (window.innerWidth <= WIDTH) {
layoutStore.defaultFormItemSize = 'default';

View File

@@ -23,7 +23,6 @@ const axiosInstance: AxiosInstance = axios.create({
},
transformResponse: [
function (data) {
//console.log('transformResponse', data);
if (typeof data === 'string') {
return JSONbig({ storeAsString: true }).parse(data);
} else {
@@ -58,7 +57,6 @@ const loginInvalid = () => {
// 创建响应拦截
axiosInstance.interceptors.response.use(
<T>(response: AxiosResponse): AxiosPromise<ResponseDataType<T>> => {
//console.log('axios response => ', response);
const { data, status } = response;
// 如果401响应放行至此执行此逻辑
if (status === 401) {
@@ -80,7 +78,6 @@ axiosInstance.interceptors.response.use(
if (response.headers['refreshedtoken'] != null) {
setToken(response.headers['refreshedtoken']);
}
//console.log('response', response, 'blob', response.data instanceof Blob);
// 判断请求是否成功
if (!(response.data instanceof Blob) && !response.data.success) {
return Promise.reject(new Error(response.data.errorMessage || 'error'));

View File

@@ -1,4 +1,4 @@
export const serverDefaultCfg = {
baseURL: import.meta.env.VITE_SERVER_HOST, // 请求基础地址,可根据环境自定义
baseURL: process.env.VUE_APP_SERVER_HOST, // 请求基础地址,可根据环境自定义
mockURL: '',
};

View File

@@ -61,26 +61,21 @@ class LoadingManager {
showMask() {
this.refCount++;
//console.log('loading >>>', this.refCount);
if (this.refCount <= 1 && this.loading == null) {
//console.log('loading do create serice');
this.loading = ElLoading.service(this.options);
}
}
hideMask() {
//console.log('loading hideMask', this.refCount);
if (this.refCount <= 1 && this.loading != null) {
this.loading.close();
this.loading = null;
//console.log('loading hideMask do close');
}
this.refCount--;
this.refCount = Math.max(0, this.refCount);
}
}
//console.log('new LoadingManager');
const loadingManager = new LoadingManager({
fullscreen: true,
background: 'rgba(0, 0, 0, 0.1)',
@@ -142,7 +137,6 @@ export async function commonRequest<D>(
...data,
...finalAxiosOption,
});
//console.log('result:', result);
if (result instanceof Blob || result.success) {
return Promise.resolve(result);
} else {
@@ -254,13 +248,6 @@ export const download = async (
method?: RequestMethods,
options?: RequestOption,
) => {
// console.log(
// 'download file url=%s, params:%s, filename:%s, options:%s',
// url,
// params,
// filename,
// options,
// );
return new Promise((resolve, reject) => {
downloadBlob(url, params, method, options)
.then(blobData => {
@@ -300,13 +287,11 @@ export const downloadBlob = (
const axiosOption: AxiosRequestConfig = {
responseType: 'blob',
transformResponse: function (data) {
//console.log(data);
return data instanceof Blob && data.size > 0 ? data : undefined;
},
};
commonRequest<Blob>(requestUrl(url), params, method, options, axiosOption)
.then(res => {
//console.log('download blob response >>>', res);
if (res instanceof Blob) {
const blobData = new Blob([res.data], { type: 'application/octet-stream' });
resolve(blobData);
@@ -337,7 +322,6 @@ export const downloadBlob = (
* @param options 请求设置(showMask-是否显示Loading层默认为trueshowError-是否显示错误信息默认为truethrottleFlag-是否开户节流默认为falsethrottleTimeout-节流时效默认为50毫秒)
*/
export const upload = async (url: string, params: ANY_OBJECT, options?: RequestOption) => {
//console.log('upload file url=%s, params:%s, options:%s', url, params, options);
const axiosOption: AxiosRequestConfig = {
headers: {
'Content-Type': 'multipart/form-data',

View File

@@ -1,5 +1,7 @@
import * as generatedDict from './generated';
import * as baseDict from './index';
export default {
...baseDict,
...generatedDict,
};

View File

@@ -0,0 +1,4 @@
import { DictionaryBase } from './types';
export {};

View File

@@ -274,7 +274,7 @@ export function setObjectToSessionStorage(key: string, value: ANY_OBJECT) {
* @param {*} defaultValue 默认值
*/
export function getObjectFromSessionStorage(key: string, defaultValue: ANY_OBJECT): ANY_OBJECT {
let jsonObj = null;
let jsonObj: ANY_OBJECT;
try {
const val: string | null = sessionStorage.getItem(key);
if (val == null) return defaultValue;
@@ -590,11 +590,9 @@ export function fileToBase64(file: File) {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = e => {
console.log('file loaded', e);
resolve(e.target?.result as string);
};
reader.onerror = e => {
console.warn('file load', e);
reject(e);
};
});
@@ -640,7 +638,6 @@ export function deepMerge(obj1: ANY_OBJECT, obj2: ANY_OBJECT) {
tempObj[key] = copyObject(val2);
}
} else if (Array.isArray(val2)) {
//console.log('......deepMerge.......', val1, val2, obj1, obj2);
// 如果两个值都是数组,则合并数组
if (Array.isArray(val1)) {
tempObj[key] = val2.map((arrVal2, index) => {

View File

@@ -149,7 +149,7 @@ const loadGroupData = () => {
}
if (currentGroup.value == null) currentGroup.value = dataList[0];
setTimeout(() => {
if (groupTree.value)
if (groupTree.value && currentGroup.value)
groupTree.value.setCurrentKey(currentGroup.value[props.treePanel.keyColumnName]);
}, 50);
})

View File

@@ -70,11 +70,10 @@ export class Dialog {
},
};
let layerOptions = {
let layerOptions: ANY_OBJECT = {
title: title,
type: 1,
skin:
'layer-dialog ' + (window.innerWidth <= 1900 ? 'container-default' : 'container-large'),
skin: 'layui-layer-page',
resize: false,
offset: 'auto',
shadeClose: false,
@@ -103,7 +102,8 @@ export class Dialog {
console.log('dialog params', params);
//layerOptions.content = h(component, params);
layerOptions.content = h(Layout, () => h(component, params));
const vueComponent = h(Layout, () => h(component, params));
layerOptions.content = vueComponent;
const id = layer.open(layerOptions);
observer.index = id;

View File

@@ -965,6 +965,9 @@ const getWidth = () => {
return '100%';
};
export default class Sheet {
cell(ri, ci, sheetIndex) {
throw new Error('Method not implemented.');
}
constructor(targetEl, data) {
this.eventMap = createEventEmitter();
const { showToolbar, showContextmenu, mode } = data.settings;

View File

@@ -1,193 +0,0 @@
declare module 'x-data-spreadsheet' {
export interface ExtendToolbarOption {
tip?: string;
el?: HTMLElement;
icon?: string;
onClick?: (data: object, sheet: object) => void;
}
export interface Options {
mode?: 'edit' | 'read';
showToolbar?: boolean;
showGrid?: boolean;
showContextmenu?: boolean;
showBottomBar?: boolean;
extendToolbar?: {
left?: ExtendToolbarOption[];
right?: ExtendToolbarOption[];
};
autoFocus?: boolean;
view?: {
height: () => number;
width: () => number;
};
row?: {
len: number;
height: number;
};
col?: {
len: number;
width: number;
indexWidth: number;
minWidth: number;
};
style?: {
bgcolor: string;
align: 'left' | 'center' | 'right';
valign: 'top' | 'middle' | 'bottom';
textwrap: boolean;
strike: boolean;
underline: boolean;
color: string;
font: {
name: 'Helvetica';
size: number;
bold: boolean;
italic: false;
};
};
}
export type CELL_SELECTED = 'cell-selected';
export type CELLS_SELECTED = 'cells-selected';
export type CELL_EDITED = 'cell-edited';
export type CellMerge = [number, number];
export interface SpreadsheetEventHandler {
(envt: CELL_SELECTED, callback: (cell: Cell, rowIndex: number, colIndex: number) => void): void;
(
envt: CELLS_SELECTED,
callback: (
cell: Cell,
parameters: { sri: number; sci: number; eri: number; eci: number },
) => void,
): void;
(evnt: CELL_EDITED, callback: (text: string, rowIndex: number, colIndex: number) => void): void;
}
export interface ColProperties {
width?: number;
}
/**
* Data for representing a cell
*/
export interface CellData {
text: string;
style?: number;
merge?: CellMerge;
}
/**
* Data for representing a row
*/
export interface RowData {
cells: {
[key: number]: CellData;
};
}
/**
* Data for representing a sheet
*/
export interface SheetData {
name?: string;
freeze?: string;
styles?: CellStyle[];
merges?: string[];
cols?: {
len?: number;
[key: number]: ColProperties;
};
rows?: {
[key: number]: RowData;
};
}
/**
* Data for representing a spreadsheet
*/
export interface SpreadsheetData {
[index: number]: SheetData;
}
export interface CellStyle {
align?: 'left' | 'center' | 'right';
valign?: 'top' | 'middle' | 'bottom';
font?: {
bold?: boolean;
};
bgcolor?: string;
textwrap?: boolean;
color?: string;
border?: {
top?: string[];
right?: string[];
bottom?: string[];
left?: string[];
};
}
export interface Editor {}
export interface Element {}
export interface Row {}
export interface Table {}
export interface Cell {}
export interface Sheet {}
export default class Spreadsheet {
constructor(container: string | HTMLElement, opts?: Options);
on: SpreadsheetEventHandler;
/**
* retrieve cell
* @param rowIndex {number} row index
* @param colIndex {number} column index
* @param sheetIndex {number} sheet iindex
*/
cell(rowIndex: number, colIndex: number, sheetIndex: number): Cell;
/**
* retrieve cell style
* @param rowIndex
* @param colIndex
* @param sheetIndex
*/
cellStyle(rowIndex: number, colIndex: number, sheetIndex: number): CellStyle;
/**
* get/set cell text
* @param rowIndex
* @param colIndex
* @param text
* @param sheetIndex
*/
cellText(rowIndex: number, colIndex: number, text: string, sheetIndex?: number): this;
/**
* remove current sheet
*/
deleteSheet(): void;
/**s
* load data
* @param json
*/
loadData(json: Record<string, any>): this;
/**
* get data
*/
getData(): Record<string, any>;
/**
* bind handler to change event, including data change and user actions
* @param callback
*/
change(callback: (json: Record<string, any>) => void): this;
/**
* set locale
* @param lang
* @param message
*/
static locale(lang: string, message: object): void;
}
global {
interface Window {
x_spreadsheet(container: string | HTMLElement, opts?: Options): Spreadsheet;
}
}
}

View File

@@ -23,7 +23,7 @@
}}</span>
</template>
<template v-for="child in menu.children" :key="child.menuId">
<sub-menu class="nest-menu" :menu="child" :isChild="true" />
<sub-menu class="nest-menu" :index="child.menuId" :menu="child" :isChild="true" />
</template>
</el-sub-menu>
</div>
@@ -63,7 +63,7 @@ const getTextStyle = (isShow: boolean) => {
.nest-menu :deep(.el-menu-item span:first-child),
.nest-menu :deep(.el-menu-item .menu-icon:first-child),
.nest-menu :deep(.el-submenu__title span:first-child) {
padding-left: 8px !important;
padding-left: 14px !important;
}
.nest-menu :deep(.el-submenu__title .menu-icon:first-child) {
margin-left: 8px !important;

View File

@@ -144,7 +144,7 @@ const route = useRoute();
const layoutStore = useLayoutStore();
const loginStore = useLoginStore();
const documentClientHeight = inject('documentClientHeight', ref(500));
const projectName = import.meta.env.VITE_PROJECT_NAME;
const projectName = process.env.VUE_APP_PROJECT_NAME;
const { getUploadFileUrl } = useUpload();

View File

@@ -31,6 +31,7 @@ import * as olineDicgt from '@/common/staticDict/online';
import * as flowDict from '@/common/staticDict/flow';
import { ANY_OBJECT } from '@/types/generic';
import { debounce } from 'lodash';
function useTable(app: ANY_OBJECT) {
app.use(VxeTable).use(VxeColumn).use(Edit);
@@ -41,6 +42,15 @@ function useStaticDict(app: ANY_OBJECT, staticDict: ANY_OBJECT) {
});
}
// webpack需要重写ResizeObserver否则会报错
const resizeObserver = window.ResizeObserver;
window.ResizeObserver = class ResizeObserver extends resizeObserver {
constructor(callback) {
callback = debounce(callback, 10);
super(callback);
}
};
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component);

View File

@@ -199,7 +199,9 @@ import { SysOnlineFieldKind } from '@/common/staticDict/online';
import { useUpload } from '@/common/hooks/useUpload';
import { SortInfo } from '@/common/types/sortinfo';
import { API_CONTEXT } from '@/api/config';
import { useLayoutStore } from '@/store';
const layoutStore = useLayoutStore();
const { downloadFile } = useDownload();
const { parseUploadData } = useUpload();
@@ -247,8 +249,6 @@ const form = inject('form', () => {
console.error('OnlineCustomTable: form not injected');
return { isEdit: false } as ANY_OBJECT;
});
import { useLayoutStore } from '@/store';
const layoutStore = useLayoutStore();
const slots = useSlots();

View File

@@ -7,7 +7,7 @@
</template>
<el-input
v-if="inputWidgetType === SysCustomWidgetType.Input"
size="default"
size="small"
style="width: 100%"
clearable
v-model="valStr"
@@ -17,7 +17,7 @@
/>
<el-row v-if="inputWidgetType === SysCustomWidgetType.NumberInput" type="flex">
<el-input-number
size="default"
size="small"
clearable
style="width: 100%"
controls-position="right"
@@ -30,21 +30,19 @@
/>
</el-row>
<el-row v-if="inputWidgetType === SysCustomWidgetType.Radio" type="flex" align="middle">
<el-radio-group
size="default"
v-model="valNum"
v-bind="attributeProps"
@change="onValueChange"
>
<el-radio-button v-for="item in dropdownData" :key="item.id" :value="item.id">
{{ item.name }}
</el-radio-button>
<el-radio-group size="small" v-model="valNum" v-bind="attributeProps" @change="onValueChange">
<el-radio-button
v-for="item in dropdownData"
:key="item.id"
:value="item.id"
:label="item.name"
/>
</el-radio-group>
</el-row>
<el-slider
v-if="inputWidgetType === SysCustomWidgetType.Slider"
style="width: 95%; margin-left: 5px"
size="default"
size="small"
:min="attributeItem.min"
:max="attributeItem.max"
v-model="valNum"
@@ -54,7 +52,7 @@
/>
<el-row v-if="inputWidgetType === SysCustomWidgetType.Switch" type="flex" align="middle">
<el-select
size="default"
size="small"
style="width: 100%"
v-model="valBool"
@input="onValueChange"
@@ -65,18 +63,12 @@
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
<!--
<el-switch size="default"
:value="value" @input="onValueChange"
@change="$emit('change')"
/>
-->
</el-row>
<el-select
v-if="inputWidgetType === SysCustomWidgetType.Select"
style="width: 100%"
clearable
size="default"
size="small"
v-model="valNum"
v-bind="attributeProps"
@change="onValueChange"
@@ -86,7 +78,7 @@
</el-select>
<el-color-picker
v-if="inputWidgetType === SysCustomWidgetType.ColorPicker"
size="default"
size="small"
v-model="valStr"
@input="onValueChange"
v-bind="attributeProps"

View File

@@ -547,7 +547,7 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
if (widget.props.dictInfo && Array.isArray(widget.props.dictInfo.paramList)) {
widget.props.dictInfo.paramList.forEach((param: ANY_OBJECT) => {
if (param.dictValueType === SysOnlineParamValueType.STATIC_DICT) {
let errorItem = null;
let errorItem: ANY_OBJECT | null = null;
if (Array.isArray(param.dictValue) && param.dictValue.length === 2) {
const dicts = StaticDict as ANY_OBJECT;
const staticDict = dicts[param.dictValue[0]];

View File

@@ -131,7 +131,7 @@ import { useThirdParty } from '@/components/thirdParty/hooks';
import { ThirdProps } from '@/components/thirdParty/types';
import { useLayoutStore } from '@/store';
import BasicForm from './basic/index.vue';
import DataModel from './dataModel/indev.vue';
import DataModel from './dataModel/index.vue';
import FormDesign from './formDesign/index.vue';
import EditOnlineForm from './editOnlineForm.vue';
const layoutStore = useLayoutStore();
@@ -220,7 +220,6 @@ const onNextClick = () => {
})
.then(res => {
res.forEach((item, index) => {
console.log('RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR', item);
getPageDatasourceTableList.value[index].columnList = item;
return getPageDatasourceTableList.value[index];
});
@@ -232,7 +231,7 @@ const onNextClick = () => {
activeStep.value = SysOnlinePageSettingStep.FORM_DESIGN;
})
.catch(e => {
console.error(e);
console.warn(e);
});
break;
}

View File

@@ -34,7 +34,6 @@ export const useWidgetToolkit = () => {
widgetType: number,
formType: number,
) {
console.log(column, widgetType, formType);
if (column == null) {
return {
disabled: true,
@@ -43,7 +42,7 @@ export const useWidgetToolkit = () => {
}
const columnFieldType = getColumnDataType(column);
let disabled = false;
let warningMsg = null;
let warningMsg: string | null = null;
if (column.fieldKind === SysOnlineFieldKind.UPLOAD) {
disabled = widgetType !== SysCustomWidgetType.Upload;
warningMsg = SysOnlineFieldKind.getValue(column.fieldKind);

View File

@@ -133,7 +133,7 @@
</div>
</div>
</el-tab-pane>
<el-tab-pane label="示例说明" name="cases">
<el-tab-pane label="示例说明" name="cases" :lazy="true">
<p style="margin-bottom: 16px">
<strong>在线表单</strong>
通过在线表单编辑器创建配置并绑定菜单后即可生效无代码修改适用于相对简单的表单页面

View File

@@ -425,31 +425,6 @@
</el-config-provider>
</template>
<script lang="ts">
const defaultApprovalStatus = [
{
id: 1,
name: '同意',
},
{
id: 2,
name: '拒绝',
},
{
id: 3,
name: '驳回',
},
{
id: 4,
name: '会签同意',
},
{
id: 5,
name: '会签拒绝',
},
];
</script>
<script setup lang="ts">
import { VxeTable, VxeColumn } from 'vxe-table';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
@@ -494,7 +469,13 @@ import ProcessDesigner from '../components/ProcessDesigner.vue';
import EditFlowEntryStatus from './formEditFlowEntryStatus.vue';
import EditFlowEntryVariable from './formEditFlowEntryVariable.vue';
const layoutStore = useLayoutStore();
const defaultApprovalStatus = [
{ id: 1, name: '同意' },
{ id: 2, name: '拒绝' },
{ id: 3, name: '驳回' },
{ id: 4, name: '会签同意' },
{ id: 5, name: '会签拒绝' },
];
interface IProps extends ThirdProps {
flowEntry?: ANY_OBJECT;
// 当使用Dialog.show弹出组件时须定义该prop属性以便对dialog进行回调

View File

@@ -125,14 +125,12 @@ import { useLayoutStore } from '@/store';
const layoutStore = useLayoutStore();
interface IProps extends ThirdProps {
flowEntry: ANY_OBJECT;
flowEntry?: ANY_OBJECT | undefined;
// 当使用Dialog.show弹出组件时须定义该prop属性以便对dialog进行回调
dialog?: DialogProp<ANY_OBJECT>;
}
const props = withDefaults(defineProps<IProps>(), {
flowEntry: () => {
return {};
},
flowEntry: undefined,
});
const { thirdParams } = useThirdParty(props);
const formItemSize = computed(() => {

View File

@@ -1,4 +1,4 @@
import { RouteLocationNormalizedLoaded } from 'vue-router';
import { RouteLocationNormalizedLoaded, RouteRecordRaw } from 'vue-router';
import Layout from '@/components/layout/index.vue';
import Welcome from '@/pages/welcome/index.vue';
import Login from '@/pages/login/index.vue';
@@ -9,7 +9,7 @@ function getProps(route: RouteLocationNormalizedLoaded) {
}
// 系统生成路由
export const routers = [
export const routers: Array<RouteRecordRaw> = [
{
path: '/login',
component: Login,
@@ -217,7 +217,7 @@ export const routers = [
// 第三方接入路由
{
path: '/thirdParty',
component: import('@/components/thirdParty/index.vue'),
component: () => import('@/components/thirdParty/index.vue'),
name: 'thirdParty',
props: getProps,
children: [

View File

@@ -1,10 +1,9 @@
/// <reference types="vite/client" />
/* eslint-disable */
declare module '*.vue' {
import { DefineComponent } from 'vue';
import type { DefineComponent } from 'vue';
const component: DefineComponent<{}, {}, any>;
export default component;
}
declare module '*.svg';
declare module '*.png';
declare module '*.jpg';
@@ -18,12 +17,3 @@ declare module 'ejs';
declare module 'bpmn-js/lib/Modeler';
declare module 'xml-js';
declare module 'bpmn-js-token-simulation';
interface ImportMetaEnv {
VITE_SERVER_HOST: string;
VITE_PROJECT_NAME: string;
}
interface ImportMeta {
env: ImportMetaEnv;
}

View File

@@ -26,4 +26,6 @@ export interface ColumnInfo {
fieldKind: number;
maxFileCount: number;
dictId: string;
maskFieldType: number;
encodedRule: ANY_OBJECT | string | undefined;
}

View File

@@ -1,24 +1,38 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "Node",
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"lib": ["ESNext", "DOM"],
"moduleResolution": "node",
"noImplicitAny": false,
"experimentalDecorators": true,
"skipLibCheck": true,
"noEmit": true,
"baseUrl": ".",
"types": ["element-plus/global"],
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"useDefineForClassFields": true,
"sourceMap": true,
"baseUrl": "./",
"paths": {
"@": ["src"],
"@/*": ["src/*"]
}
},
"types": [
"webpack-env"
],
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
"exclude": [
"node_modules",
// "src/components"
]
// "references": [{ "path": "./tsconfig.node.json" }]
}

View File

@@ -1,58 +0,0 @@
import path from 'path';
import { defineConfig } from 'vite';
import AutoImport from 'unplugin-auto-import/vite';
import vue from '@vitejs/plugin-vue';
import eslint from 'vite-plugin-eslint';
// import StylelintPlugin from 'vite-plugin-stylelint';
import postcssPresetEnv from 'postcss-preset-env';
import autoprefixer from 'autoprefixer';
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
import { VantResolver } from '@vant/auto-import-resolver';
// import { createStyleImportPlugin, VxeTableResolve } from 'vite-plugin-style-import';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
AutoImport({
resolvers: [ElementPlusResolver(), VantResolver()],
imports: ['vue'], // 需要引入的类型来源
dts: 'src/types/auto-import.d.ts', // 根据引入来源自动生成的类型声明文件路径
eslintrc: {
enabled: true, // 使用 eslint 配置
},
}),
Components({
resolvers: [
// 自定义element-plus主题色
ElementPlusResolver({
importStyle: 'sass',
}),
VantResolver(),
],
}),
eslint(),
// StylelintPlugin(),
],
server: {
host: '0.0.0.0',
port: 8085,
open: true,
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
css: {
// 自定义element-plus主题色
preprocessorOptions: {
scss: {
additionalData: `@use "@/assets/skin/orange/index.scss" as *;`,
},
},
postcss: {
plugins: [autoprefixer, postcssPresetEnv()],
},
},
});

View File

@@ -0,0 +1,46 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// const { defineConfig } = require('@vue/cli-service');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const AutoImport = require('unplugin-auto-import/webpack');
const Components = require('unplugin-vue-components/webpack');
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers');
module.exports = {
transpileDependencies: true,
lintOnSave: false,
devServer: {
open: true,
host: '0.0.0.0', // 允许外部ip访问
port: 8085, // 端口
},
css: {
loaderOptions: {
scss: {
additionalData: `@use "@/assets/skin/orange/index.scss" as *;`,
},
},
},
configureWebpack: config => {
// remove the existing ForkTsCheckerWebpackPlugin
// config.plugins = config.plugins.filter(p => !(p instanceof ForkTsCheckerWebpackPlugin));
config.plugins.push(
new NodePolyfillPlugin({
// typescript: {
// configFile: path.resolve(__dirname, 'tsconfig.json'),
// }
}),
);
config.plugins.push(
AutoImport({
imports: ['vue', 'vue-router', 'pinia'],
resolvers: [ElementPlusResolver()],
}),
);
config.plugins.push(
Components({
resolvers: [ElementPlusResolver({ importStyle: 'sass' })],
directoryAsNamespace: true,
}),
);
},
};