Commit 4b9a4502 by zhuzhequan

fix:添加打包压缩

parent 980ed3a4
...@@ -57,6 +57,7 @@ declare module 'vue' { ...@@ -57,6 +57,7 @@ declare module 'vue' {
ElTimePicker: typeof import('element-plus/es')['ElTimePicker'] ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree'] ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload'] ElUpload: typeof import('element-plus/es')['ElUpload']
Icon: typeof import('./src/components/Icon.vue')['default'] Icon: typeof import('./src/components/Icon.vue')['default']
ImageView: typeof import('./src/components/ImageView.vue')['default'] ImageView: typeof import('./src/components/ImageView.vue')['default']
......
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
"unplugin-auto-import": "^0.17.5", "unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.18.5", "unplugin-icons": "^0.18.5",
"unplugin-vue-components": "^0.26.0", "unplugin-vue-components": "^0.26.0",
"vite": "^5.1.4" "vite": "^5.1.4",
"vite-plugin-compression": "^0.5.1"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
...@@ -4320,6 +4321,20 @@ ...@@ -4320,6 +4321,20 @@
"node": ">=0.8" "node": ">=0.8"
} }
}, },
"node_modules/fs-extra": {
"version": "10.1.0",
"resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-10.1.0.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/fs.realpath": { "node_modules/fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz",
...@@ -4509,6 +4524,12 @@ ...@@ -4509,6 +4524,12 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
"dev": true
},
"node_modules/graphemer": { "node_modules/graphemer": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmmirror.com/graphemer/-/graphemer-1.4.0.tgz", "resolved": "https://registry.npmmirror.com/graphemer/-/graphemer-1.4.0.tgz",
...@@ -4842,6 +4863,18 @@ ...@@ -4842,6 +4863,18 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/jsonfile": {
"version": "6.2.1",
"resolved": "https://registry.npmmirror.com/jsonfile/-/jsonfile-6.2.1.tgz",
"integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==",
"dev": true,
"dependencies": {
"universalify": "^2.0.0"
},
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/keyv": { "node_modules/keyv": {
"version": "4.5.4", "version": "4.5.4",
"resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz", "resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz",
...@@ -6201,6 +6234,15 @@ ...@@ -6201,6 +6234,15 @@
"url": "https://github.com/sponsors/jonschlinkert" "url": "https://github.com/sponsors/jonschlinkert"
} }
}, },
"node_modules/universalify": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
}
},
"node_modules/unplugin": { "node_modules/unplugin": {
"version": "1.16.1", "version": "1.16.1",
"resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.16.1.tgz", "resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.16.1.tgz",
...@@ -6516,6 +6558,20 @@ ...@@ -6516,6 +6558,20 @@
} }
} }
}, },
"node_modules/vite-plugin-compression": {
"version": "0.5.1",
"resolved": "https://registry.npmmirror.com/vite-plugin-compression/-/vite-plugin-compression-0.5.1.tgz",
"integrity": "sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==",
"dev": true,
"dependencies": {
"chalk": "^4.1.2",
"debug": "^4.3.3",
"fs-extra": "^10.0.0"
},
"peerDependencies": {
"vite": ">=2.0.0"
}
},
"node_modules/vscode-uri": { "node_modules/vscode-uri": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.1.0.tgz", "resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.1.0.tgz",
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
"unplugin-auto-import": "^0.17.5", "unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.18.5", "unplugin-icons": "^0.18.5",
"unplugin-vue-components": "^0.26.0", "unplugin-vue-components": "^0.26.0",
"vite": "^5.1.4" "vite": "^5.1.4",
"vite-plugin-compression": "^0.5.1"
} }
} }
...@@ -66,6 +66,24 @@ export function getOrderList( ...@@ -66,6 +66,24 @@ export function getOrderList(
}, },
) )
} }
export function getOrderTrackingList(
params: SearchForm,
currentPage: number,
pageSize: number,
orderTracking?: boolean,
) {
return axios.post<never, BasePaginationData<PodUsOrderListData>>(
'/factory/podJomallOrderUs/get-order-tracking-list',
{
...params,
currentPage,
pageSize,
orderTracking,
},
)
}
export function handleExceptionOrderApi(orderIds: number[]) { export function handleExceptionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/processExceptionOrders', 'factory/podJomallOrderUs/processExceptionOrders',
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
import { import {
getListCraftApi, getListCraftApi,
getProductionClientApi, getProductionClientApi,
getOrderList, getOrderTrackingList,
getOperationLogApi, getOperationLogApi,
getOrderTabData, getOrderTabData,
getfaceSimplexFileApi, getfaceSimplexFileApi,
...@@ -44,7 +44,7 @@ import { convertToChinaTime } from '@/utils/index' ...@@ -44,7 +44,7 @@ import { convertToChinaTime } from '@/utils/index'
import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts' import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts'
import { useValue } from '@/utils/hooks/useValue' import { useValue } from '@/utils/hooks/useValue'
const tabName = ref<string>('1')
const [searchForm, resetSearchForm] = useValue<SearchForm>({ const [searchForm, resetSearchForm] = useValue<SearchForm>({
timeType: 1, timeType: 1,
shopNumber: '', shopNumber: '',
...@@ -539,7 +539,7 @@ const getOrderListFn = async () => { ...@@ -539,7 +539,7 @@ const getOrderListFn = async () => {
}) })
const { currentPage, pageSize } = pagination.value const { currentPage, pageSize } = pagination.value
try { try {
const { data } = await getOrderList( const { data } = await getOrderTrackingList(
{ {
...searchForm.value, ...searchForm.value,
startTime: startTime:
...@@ -711,6 +711,12 @@ function changeChinaTime(zone: string) { ...@@ -711,6 +711,12 @@ function changeChinaTime(zone: string) {
}) })
} }
const tabChange = () => {
if(tabName.value==='2'){
operationLog()
}
}
const handleRadioGroupClick = (event: Event) => { const handleRadioGroupClick = (event: Event) => {
const target = event.target as HTMLElement const target = event.target as HTMLElement
const radioButton = target.closest('.el-radio-button') const radioButton = target.closest('.el-radio-button')
...@@ -790,14 +796,6 @@ useEnterKeyTrigger({ ...@@ -790,14 +796,6 @@ useEnterKeyTrigger({
}, },
}) })
watch(
() => currentRowId.value,
(newValue, oldValue) => {
if (newValue !== oldValue) {
operationLog()
}
},
)
loadTabData() loadTabData()
loadProductionClient() loadProductionClient()
getUserMark() getUserMark()
...@@ -1198,8 +1196,8 @@ onMounted(() => { ...@@ -1198,8 +1196,8 @@ onMounted(() => {
</template> </template>
<template #other> <template #other>
<div class="bottom-table"> <div class="bottom-table">
<el-tabs> <el-tabs v-model="tabName" @tab-change="tabChange">
<el-tab-pane label="商品明细"> <el-tab-pane name="1" label="商品明细">
<TableView <TableView
ref="goodsRef" ref="goodsRef"
v-loading="goodsLoading" v-loading="goodsLoading"
...@@ -1212,7 +1210,7 @@ onMounted(() => { ...@@ -1212,7 +1210,7 @@ onMounted(() => {
</template> </template>
</TableView> </TableView>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="操作日志" @tab-click="operationLog"> <el-tab-pane name="2" label="操作日志" >
<div> <div>
<el-button <el-button
:type="zoneType === 'Asia/Shanghai' ? 'primary' : ''" :type="zoneType === 'Asia/Shanghai' ? 'primary' : ''"
......
...@@ -4,13 +4,27 @@ import Components from 'unplugin-vue-components/vite' ...@@ -4,13 +4,27 @@ import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx' import vueJsx from '@vitejs/plugin-vue-jsx'
import compression from 'vite-plugin-compression'
// https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: '/', base: '/',
server:{
proxy: {
'/api/': {
target: 'http://172.16.17.244:8060',
},
},
},
plugins: [ plugins: [
vue(), vue(),
compression({
ext: '.gz', // 生成的文件扩展名
compressionOptions: { level: 9 }, // 压缩级别,1-9,越高压缩率越大
algorithm: 'gzip', // 压缩算法,可选 'gzip' | 'brotli'
threshold: 102400, // 阈值:小于100kb的文件不压缩(压缩后反而可能变大)
filter:/\.(js|css|html|svg|json)$/i , // 排除已经压缩过的文件(图片、视频、压缩包本身)
deleteOriginFile: false, // 不要删除原始源文件,默认false,避免回退问题
}),
vueJsx(), vueJsx(),
AutoImport({ AutoImport({
imports: ['vue', 'vue-router', 'pinia'], imports: ['vue', 'vue-router', 'pinia'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment