From 2bd750a3d60e1bb1f4fff5466d89c0290e65aa9a Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 19 May 2023 15:23:41 +0800 Subject: [PATCH 1/7] chore: update deps --- package.json | 65 ++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 7a00c122..fdd251a2 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "serve:pro": "vite preview --mode pro", "serve:dev": "vite preview --mode dev", "serve:test": "vite preview --mode test", + "preview": "pnpm build:front && vite preview", "npm:check": "npx npm-check-updates", "clean": "npx rimraf node_modules", "clean:cache": "npx rimraf node_modules/.cache", @@ -33,12 +34,12 @@ "@form-create/element-ui": "^3.1.17", "@iconify/iconify": "^3.1.0", "@videojs-player/vue": "^1.0.0", - "@vueuse/core": "^10.1.0", + "@vueuse/core": "^10.1.2", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10", - "@zxcvbn-ts/core": "^2.2.1", + "@zxcvbn-ts/core": "^3.0.1", "animate.css": "^4.1.1", - "axios": "^1.3.6", + "axios": "^1.4.0", "benz-amr-recorder": "^1.1.5", "bpmn-js-token-simulation": "^0.10.0", "camunda-bpmn-moddle": "^7.0.1", @@ -48,34 +49,34 @@ "diagram-js": "^11.6.0", "echarts": "^5.4.2", "echarts-wordcloud": "^2.1.0", - "element-plus": "2.3.3", + "element-plus": "2.3.4", "fast-xml-parser": "^4.2.2", - "highlight.js": "^11.7.0", + "highlight.js": "^11.8.0", "intro.js": "^7.0.1", "jsencrypt": "^3.3.2", "lodash-es": "^4.17.21", - "min-dash": "^4.1.0", + "min-dash": "^4.1.1", "mitt": "^3.0.0", "nprogress": "^0.2.0", - "pinia": "^2.0.35", + "pinia": "^2.1.3", "qrcode": "^1.5.3", - "qs": "^6.11.1", + "qs": "^6.11.2", "steady-xml": "^0.1.0", "url": "^0.11.0", - "video.js": "^8.0.4", - "vue": "3.2.47", + "video.js": "^8.3.0", + "vue": "3.3.4", "vue-i18n": "9.2.2", - "vue-router": "^4.1.6", - "vue-types": "^5.0.2", + "vue-router": "^4.2.1", + "vue-types": "^5.0.3", "vuedraggable": "^4.1.0", "web-storage-cache": "^1.1.1", "xe-utils": "^3.5.7", "xml-js": "^1.6.11" }, "devDependencies": { - "@commitlint/cli": "^17.6.1", - "@commitlint/config-conventional": "^17.6.1", - "@iconify/json": "^2.2.54", + "@commitlint/cli": "^17.6.3", + "@commitlint/config-conventional": "^17.6.3", + "@iconify/json": "^2.2.67", "@intlify/unplugin-vue-i18n": "^0.10.0", "@purge-icons/generated": "^0.9.0", "@types/intro.js": "^5.1.1", @@ -84,39 +85,39 @@ "@types/nprogress": "^0.2.0", "@types/qrcode": "^1.5.0", "@types/qs": "^6.9.7", - "@typescript-eslint/eslint-plugin": "^5.59.0", - "@typescript-eslint/parser": "^5.59.0", - "@vitejs/plugin-legacy": "^4.0.2", - "@vitejs/plugin-vue": "^4.1.0", + "@typescript-eslint/eslint-plugin": "^5.59.6", + "@typescript-eslint/parser": "^5.59.6", + "@vitejs/plugin-legacy": "^4.0.3", + "@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue-jsx": "^3.0.1", "autoprefixer": "^10.4.14", "bpmn-js": "^8.9.0", "bpmn-js-properties-panel": "^0.46.0", "consola": "^3.1.0", - "eslint": "^8.39.0", + "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", - "eslint-define-config": "^1.18.0", + "eslint-define-config": "^1.20.0", "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-vue": "^9.11.0", - "lint-staged": "^13.2.1", + "eslint-plugin-vue": "^9.13.0", + "lint-staged": "^13.2.2", "postcss": "^8.4.23", "postcss-html": "^1.5.0", "postcss-scss": "^4.0.6", "prettier": "^2.8.8", - "rimraf": "^5.0.0", - "rollup": "^3.20.7", - "sass": "^1.62.0", - "stylelint": "^15.6.0", + "rimraf": "^5.0.1", + "rollup": "^3.22.0", + "sass": "^1.62.1", + "stylelint": "^15.6.2", "stylelint-config-html": "^1.1.0", "stylelint-config-recommended": "^12.0.0", "stylelint-config-standard": "^33.0.0", "stylelint-order": "^6.0.3", - "terser": "^5.17.1", + "terser": "^5.17.4", "typescript": "5.0.4", - "unplugin-auto-import": "^0.15.3", + "unplugin-auto-import": "^0.16.0", "unplugin-element-plus": "^0.7.1", "unplugin-vue-components": "^0.24.1", - "vite": "4.3.1", + "vite": "4.3.8", "vite-plugin-compression": "^0.5.1", "vite-plugin-ejs": "^1.6.4", "vite-plugin-eslint": "^1.8.1", @@ -125,8 +126,8 @@ "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-top-level-await": "^1.3.0", "vite-plugin-vue-setup-extend-plus": "^0.1.0", - "vite-plugin-windicss": "^1.8.10", - "vue-tsc": "^1.4.4", + "vite-plugin-windicss": "^1.9.0", + "vue-tsc": "^1.6.5", "windicss": "^3.5.6" }, "engines": { -- Gitee From 45ee4116b7b84ca5d76ed099ae5a0167a5cb7689 Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 19 May 2023 15:24:01 +0800 Subject: [PATCH 2/7] fix: echart --- src/components/Echart/src/Echart.vue | 2 +- src/plugins/echarts/index.ts | 10 +++++++--- src/views/infra/redis/index.vue | 7 +------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/components/Echart/src/Echart.vue b/src/components/Echart/src/Echart.vue index 31f2eea0..cec28e42 100644 --- a/src/components/Echart/src/Echart.vue +++ b/src/components/Echart/src/Echart.vue @@ -27,7 +27,7 @@ const props = defineProps({ const isDark = computed(() => appStore.getIsDark) const theme = computed(() => { - const echartTheme: boolean | string = unref(isDark) ? true : 'auto' + const echartTheme: boolean | string = unref(isDark) ? true : 'inherit' return echartTheme }) diff --git a/src/plugins/echarts/index.ts b/src/plugins/echarts/index.ts index 34f756f6..bfccbb48 100644 --- a/src/plugins/echarts/index.ts +++ b/src/plugins/echarts/index.ts @@ -6,7 +6,8 @@ import { PieChart, MapChart, PictorialBarChart, - RadarChart + RadarChart, + GaugeChart } from 'echarts/charts' import { @@ -16,7 +17,8 @@ import { PolarComponent, AriaComponent, ParallelComponent, - LegendComponent + LegendComponent, + ToolboxComponent } from 'echarts/components' import { CanvasRenderer } from 'echarts/renderers' @@ -25,6 +27,7 @@ echarts.use([ LegendComponent, TitleComponent, TooltipComponent, + ToolboxComponent, GridComponent, PolarComponent, AriaComponent, @@ -35,7 +38,8 @@ echarts.use([ MapChart, CanvasRenderer, PictorialBarChart, - RadarChart + RadarChart, + GaugeChart ]) export default echarts diff --git a/src/views/infra/redis/index.vue b/src/views/infra/redis/index.vue index 011f8e59..f98f2f30 100644 --- a/src/views/infra/redis/index.vue +++ b/src/views/infra/redis/index.vue @@ -63,9 +63,6 @@ -- Gitee From 985d764f623e24402b1ba91562d2994b28d1aeec Mon Sep 17 00:00:00 2001 From: xiaobai <2511883673@qq.com> Date: Tue, 6 Jun 2023 01:08:38 +0800 Subject: [PATCH 7/7] 20230606 add trade-order and details --- src/api/mall/trade/order/index.ts | 11 +- src/router/modules/remaining.ts | 16 + src/views/mall/trade/order/index.vue | 233 ++++++++++-- .../trade/order/tradeOrderDetail-crmeb.vue | 141 +++++++ .../mall/trade/order/tradeOrderDetail.vue | 355 ++++++++++++++++++ 5 files changed, 717 insertions(+), 39 deletions(-) create mode 100644 src/views/mall/trade/order/tradeOrderDetail-crmeb.vue create mode 100644 src/views/mall/trade/order/tradeOrderDetail.vue diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index 22b8f205..5a401030 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -5,10 +5,7 @@ export const getOrderList = (params: PageParam) => { return request.get({ url: '/trade/order/page', params }) } -// // 获得交易订单详情 -// export function getOrderDetail(id) { -// return request({ -// url: '/trade/order/get-detail?id=' + id, -// method: 'get' -// }) -// } +// 获得交易订单详情 +export const getOrderDetail = (id: number) => { + return request.get({ url: '/trade/order/get-detail?id=' + id }) +} diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 4f5a16bd..6b7a2fd4 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -195,6 +195,22 @@ const remainingRouter: AppRouteRecordRaw[] = [ noTagsView: true } }, + { + path: '/trade/order', + component: Layout, + name: 'order', + meta: { + hidden: true + }, + children: [ + { + path: 'detail', + name: 'TradeOrderDetail', + component: () => import('@/views/mall/trade/order/tradeOrderDetail.vue'), + meta: { title: '订单详情', hidden: true } + } + ] + }, { path: '/403', component: () => import('@/views/Error/403.vue'), diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index e5a1e28e..61b22856 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -45,7 +45,7 @@ /> - + - - - + + + + + + @@ -93,13 +101,19 @@ 重置 + + + 导出TODO + - + - + + + + + @@ -218,8 +249,13 @@ @@ -242,17 +278,38 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import * as TradeOrderApi from '@/api/mall/trade/order' import { dateFormatter, formatDate } from '@/utils/formatTime' +import download from '@/utils/download' +// import TradeOrderDetail from './tradeOrderDetail.vue' +interface CurrentType { + checkTotal: number //选中的数量 + currentType: string //页面选中类型, 0-noPage无选中页面 1-currentPage 当前页面 2-allPage所有页面 + selectAll: boolean //全选标识 + multipleSelection: [] // 选中的数据 暂未记录,需考虑全选时数据应该如何处理 ,部分选中可以使用该数据,需要登记 + pageNoList: [] //当前页面选中的页号 如果再次选中当前页将取消本页面的选中数据 全选时 将所有的页面list 都放进去 再次全选时 全部清空 +} +const orderSelect: CurrentType = reactive({ + checkTotal: 0, + currentType: '0', + selectAll: false, + multipleSelection: [], + pageNoList: [] +}) + +const message = useMessage() +const { push } = useRouter() const queryFormRef = ref() //表单搜索 const queryParams = ref({ pageNo: 1, //首页 pageSize: 10, //页面大小 - searchType: '', - searchValue: '' + tabIndex: 0 //详情页面数据 }) + const loading = ref(false) +const exportLoading = ref(false) // 总记录数 const total = ref(0) + //表数据 const list = ref([]) //订单搜索 @@ -284,16 +341,115 @@ const searchList = ref([ ]) const imgViewVisible = ref(false) // 商品图预览 + const imageViewerList = ref([]) // 商品图预览列表 + +/**当前页 所有页 暂不考虑数据本地化 会导致选中当前页 从后台重新拉取数据时出现数据不一致*/ +const handleDropType = (command: string) => { + orderSelect.currentType = command + let i = 0 + if (command === '1') { + // pageNoList 当前页面选中的页号 如果再次选中当前页将取消本页面的选中数据 + //取消本页面记录 + var index = orderSelect.pageNoList.indexOf(queryParams.value.pageNo) + if (index > -1) { + for (i; i < list.value.length; i++) { + if (list.value[i]['itemSelect'] === true) { + list.value[i]['itemSelect'] = false + orderSelect.checkTotal = orderSelect.checkTotal - 1 + } + } + orderSelect.pageNoList.splice(index, 1) + } else { + for (i; i < list.value.length; i++) { + if (list.value[i]['itemSelect'] === false) { + list.value[i]['itemSelect'] = true + orderSelect.checkTotal = orderSelect.checkTotal + 1 + } + } + orderSelect.pageNoList.splice(0, 0, queryParams.value.pageNo) + } + } + if (command === '2') { + orderSelect.selectAll = !orderSelect.selectAll + //全选时 将所有的页面list 都放进去 再次全选时 全部清空 + if (orderSelect.selectAll) { + //打勾勾 + for (i; i < list.value.length; i++) { + list.value[i]['itemSelect'] = true + } + // 初始化页面数组 + const array1: [] = Array.from( + { length: total.value / queryParams.value.pageSize + 1 }, + (item, idx) => idx + 1 + ) + orderSelect.pageNoList = [] //清空原有的 + orderSelect.pageNoList = [].concat(array1) + orderSelect.checkTotal = total.value + } else { + //取消勾勾 + for (i; i < list.value.length; i++) { + list.value[i]['itemSelect'] = false + } + orderSelect.pageNoList = [] //清空 + orderSelect.checkTotal = 0 + } + } +} +/***复选框选中 */ +const handcheckclick = (row: any) => { + //选中增加1 + if (!row.itemSelect) { + // 取消 -1 + orderSelect.checkTotal = orderSelect.checkTotal - 1 + // + } else { + //选中 +1 + orderSelect.checkTotal = orderSelect.checkTotal + 1 + } +} +/** + * 导出数据 + */ + +const handleExport = async () => { + try { + // 导出的二次确认 + await message.exportConfirm() + // 发起导出 + exportLoading.value = true + //TODO导出的数据是后台导出还是从前端中获取数据(全选时数据怎么打印?) + download.excel(orderSelect.multipleSelection as any, '订单信息.xls') // + } catch { + } finally { + exportLoading.value = false + } + //TODO + exportLoading.value = false +} + /** 搜索按钮操作 */ const handleQuery = () => { + //选中状态初始化 + orderSelect.checkTotal = 0 + orderSelect.currentType = '0' + orderSelect.multipleSelection = [] + orderSelect.pageNoList = [] + orderSelect.selectAll = false + getList() } /** 重置按钮操作 */ const resetQuery = () => { + //选中状态初始化 + orderSelect.checkTotal = 0 + orderSelect.currentType = '0' + orderSelect.multipleSelection = [] + orderSelect.pageNoList = [] + orderSelect.selectAll = false + queryFormRef.value.resetFields() - console.log(queryParams) handleQuery() } @@ -303,6 +459,22 @@ const getList = async () => { const data = await TradeOrderApi.getOrderList(queryParams.value) list.value = data.list total.value = data.total + + let i = 0 + //给数组添加选中属性 itemSelect 默认为false 当前状态如果时全选 则新加载的页面都为选中状态 + if ( + orderSelect.currentType === '2' || //全选状态加载状态设置为选中 + orderSelect.pageNoList.indexOf(queryParams.value.pageNo) > -1 //已选择页面加载状态设置为默认选中,会存在选中当前页面后手动取消该页面部分数据,再重新加载该页面时设置为选中状态,但是没有增加选中的数量 + ) { + for (i; i < list.value.length; i++) { + list.value[i]['itemSelect'] = true + } + } else { + //还需要判断当前页面是否已经选中了? 而且还要出来选中的数据是否后来手动一行行取消了处理 + for (i; i < list.value.length; i++) { + list.value[i]['itemSelect'] = false //暂定为未选中状态, 实际情况需要考虑已选中状态,后期优化 + } + } } finally { loading.value = false } @@ -311,8 +483,9 @@ const getList = async () => { /** * 跳转订单详情 */ -const goOrderDetail = (row: any) => { - console.log('TODO Order Detail: ' + row.no) +const showOrderDetail = (row: any) => { + console.log('TODO Order Detail: ' + row.id) + push({ name: 'TradeOrderDetail', query: { id: row.id } }) } /** @@ -328,10 +501,6 @@ const sendXX = (row: any) => { console.log('TODO Send XX: ' + row.no) } -const handleSelectionChange = (val: list) => { - multipleSelection.value = val -} - /** * 商品图预览 * @param imgUrl diff --git a/src/views/mall/trade/order/tradeOrderDetail-crmeb.vue b/src/views/mall/trade/order/tradeOrderDetail-crmeb.vue new file mode 100644 index 00000000..ae4fe01c --- /dev/null +++ b/src/views/mall/trade/order/tradeOrderDetail-crmeb.vue @@ -0,0 +1,141 @@ + + + diff --git a/src/views/mall/trade/order/tradeOrderDetail.vue b/src/views/mall/trade/order/tradeOrderDetail.vue new file mode 100644 index 00000000..3e261550 --- /dev/null +++ b/src/views/mall/trade/order/tradeOrderDetail.vue @@ -0,0 +1,355 @@ + + + -- Gitee