From 3bae73a7eec0b7b166087c5fc0700ee55727f589 Mon Sep 17 00:00:00 2001 From: 3ddbz Date: Tue, 15 Jul 2025 20:38:05 +0800 Subject: [PATCH 01/12] =?UTF-8?q?build(vite):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BE=9D=E8=B5=96=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 "type": "module" 到 package.json - 更新 vite、vue、element-plus 等主要依赖版本 - 移除 vite-plugin-commonjs 依赖 - 更新 ESLint、TypeScript 相关配置 --- .../Vol.Vue3.Vite/package.json" | 81 ++++++++++--------- 1 file changed, 44 insertions(+), 37 deletions(-) diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/package.json" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/package.json" index 470174861..9717ad2e4 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/package.json" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/package.json" @@ -2,10 +2,11 @@ "name": "vol-vue3vite", "version": "1.0.0", "private": true, + "type": "module", "scripts": { "serve": "vite --host", "dev": "vite --host", - "buildWithCheck": "run-p type-check build-only", + "buildWithCheck": "run-p type-check build", "preview": "vite preview", "test:unit": "vitest", "build": "vite build", @@ -16,45 +17,51 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", - "@microsoft/signalr": "^7.0.3", - "ali-oss": "^6.17.1", - "axios": "^1.3.4", - "core-js": "^3.29.0", - "echarts": "^5.4.1", - "element-plus": "^2.2.32", - "less": "^4.1.3", - "pinia": "^2.0.32", - "rollup-plugin-commonjs": "^10.1.0", - "vite-plugin-commonjs": "^0.10.1", - "vue": "^3.2.47", - "vue-draggable-next": "^2.1.1", - "vue-router": "^4.1.6", + "@element-plus/icons-vue": "^2.3.1", + "@microsoft/signalr": "^8.0.7", + "ali-oss": "^6.23.0", + "axios": "^1.10.0", + "core-js": "^3.44.0", + "echarts": "^5.6.0", + "element-plus": "^2.10.4", + "less": "^4.3.0", + "lodash-es": "^4.17.21", + "pinia": "^3.0.3", + "vue": "^3.5.17", + "vue-draggable-next": "^2.2.1", + "vue-router": "^4.5.1", "vuex": "^4.1.0", "wangeditor": "^4.7.15" }, "devDependencies": { - "@babel/eslint-parser": "^7.21.3", - "@rushstack/eslint-patch": "^1.2.0", - "@types/jsdom": "^21.1.0", - "@types/node": "^18.14.2", - "@vitejs/plugin-vue": "^4.0.0", - "@vitejs/plugin-vue-jsx": "^3.0.0", - "@vue/eslint-config-prettier": "^7.1.0", - "@vue/eslint-config-typescript": "^11.0.2", - "@vue/test-utils": "^2.3.0", - "@vue/tsconfig": "^0.1.3", - "eslint": "^8.36.0", - "eslint-plugin-vue": "^9.9.0", - "jsdom": "^21.1.0", - "npm-run-all": "^4.1.5", - "prettier": "^2.8.4", - "rimraf": "^4.1.2", - "rollup-plugin-visualizer": "^5.9.0", - "stylus": "^0.59.0", - "typescript": "~4.8.4", - "vite": "^4.2.0", + "@babel/eslint-parser": "^7.28.0", + "@rushstack/eslint-patch": "^1.12.0", + "@tsconfig/node22": "^22.0.2", + "@types/jsdom": "^21.1.7", + "@types/node": "^24.0.13", + "@vitejs/plugin-vue": "^6.0.0", + "@vitejs/plugin-vue-jsx": "^5.0.1", + "@vitest/eslint-plugin": "^1.3.4", + "@vue/eslint-config-prettier": "^10.2.0", + "@vue/eslint-config-typescript": "^14.6.0", + "@vue/test-utils": "^2.4.6", + "@vue/tsconfig": "^0.7.0", + "eslint": "^9.31.0", + "eslint-plugin-cypress": "^5.1.0", + "eslint-plugin-vue": "^10.3.0", + "jiti": "^2.4.2", + "jsdom": "^26.1.0", + "npm-run-all2": "^8.0.4", + "prettier": "^3.6.2", + "rimraf": "^6.0.1", + "rollup-plugin-visualizer": "^6.0.3", + "start-server-and-test": "^2.0.12", + "stylus": "^0.64.0", + "typescript": "~5.8.3", + "vite": "^7.0.4", "vite-plugin-require-transform": "^1.0.21", - "vitest": "^0.29.1", - "vue-tsc": "^1.2.0" + "vite-plugin-vue-devtools": "^7.7.7", + "vitest": "^3.2.4", + "vue-tsc": "^3.0.1" } -} +} \ No newline at end of file From f563a810e53eb5de661a5f94161070a30b553085 Mon Sep 17 00:00:00 2001 From: 3ddbz Date: Tue, 15 Jul 2025 20:57:46 +0800 Subject: [PATCH 02/12] =?UTF-8?q?build(Vol.Vue3.Vite):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=20TypeScript=20=E9=85=8D=E7=BD=AE=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20Vitest=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 tsconfig.app.json 和 tsconfig.vitest.json 文件 - 更新原有的 tsconfig.json 文件结构 - 修改 tsconfig.node.json 文件配置 - 移除 vite-plugin-commonjs 插件 - 添加 Vitest 配置文件 --- .../Vol.Vue3.Vite/tsconfig.app.json" | 12 ++++++++++++ .../Vol.Vue3.Vite/tsconfig.json" | 17 +++++++---------- .../Vol.Vue3.Vite/tsconfig.node.json" | 8 +++++--- .../Vol.Vue3.Vite/tsconfig.vitest.json" | 9 +++++++++ .../Vol.Vue3.Vite/vite.config.ts" | 11 ++--------- .../Vol.Vue3.Vite/vitest.config.ts" | 14 ++++++++++++++ 6 files changed, 49 insertions(+), 22 deletions(-) create mode 100644 "v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.app.json" create mode 100644 "v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.vitest.json" create mode 100644 "v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vitest.config.ts" diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.app.json" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.app.json" new file mode 100644 index 000000000..9907ea5b0 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.app.json" @@ -0,0 +1,12 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/*"], + "compilerOptions": { + "paths": { + "@/*": ["./src/*"] + }, + "baseUrl": ".", + "allowJs": true //js文件忽略提示 + } +} diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.json" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.json" index b85faac33..100cf6a8f 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.json" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.json" @@ -1,17 +1,14 @@ { - "extends": "@vue/tsconfig/tsconfig.web.json", - "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], - "compilerOptions": { - "baseUrl": ".", - "allowJs": true,//js文件忽略提示 - "paths": { - "@/*": ["./src/*"] - } - }, - + "files": [], "references": [ { "path": "./tsconfig.node.json" + }, + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.vitest.json" } ] } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.node.json" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.node.json" index 424084aa5..d56f4bb71 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.node.json" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.node.json" @@ -1,8 +1,10 @@ { - "extends": "@vue/tsconfig/tsconfig.node.json", - "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"], + "extends": "@tsconfig/node22/tsconfig.json", + "include": ["vite.config.*", "vitest.config.*", "eslint.config.*"], "compilerOptions": { - "composite": true, + "noEmit": true, + "module": "ESNext", + "moduleResolution": "Bundler", "types": ["node"] } } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.vitest.json" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.vitest.json" new file mode 100644 index 000000000..72734b3ca --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/tsconfig.vitest.json" @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.app.json", + "include": ["src/**/__tests__/*", "env.d.ts"], + "exclude": [], + "compilerOptions": { + "lib": [], + "types": ["node", "jsdom"] + } +} diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vite.config.ts" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vite.config.ts" index 6bca08615..5444ea67e 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vite.config.ts" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vite.config.ts" @@ -1,5 +1,4 @@ import { fileURLToPath } from 'node:url' -import commonjs from 'vite-plugin-commonjs' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' @@ -9,23 +8,17 @@ import { visualizer } from 'rollup-plugin-visualizer' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ - commonjs(), - // commonjs({ - // // 这里可以配置插件的选项,例如指定需要转换的模块等 - // include: 'node_modules/**', // 包含node_modules下的所有模块 - // }), vue(), vueJsx(), visualizer({ filename: 'report_form_rollup-plugin-visualizer.html' - }), + }) //引用后提示: // requireTransform({ // fileRegex: /.js$|.ts$/ // }) ], - define: { - }, + define: {}, optimizeDeps: { exclude: ['vue'] }, diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vitest.config.ts" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vitest.config.ts" new file mode 100644 index 000000000..c32871718 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vitest.config.ts" @@ -0,0 +1,14 @@ +import { fileURLToPath } from 'node:url' +import { mergeConfig, defineConfig, configDefaults } from 'vitest/config' +import viteConfig from './vite.config' + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + environment: 'jsdom', + exclude: [...configDefaults.exclude, 'e2e/**'], + root: fileURLToPath(new URL('./', import.meta.url)), + }, + }), +) From 70a2baaf1c9a31c47390c0bfc184431e47f228ee Mon Sep 17 00:00:00 2001 From: 3ddbz Date: Tue, 15 Jul 2025 22:00:58 +0800 Subject: [PATCH 03/12] =?UTF-8?q?feat(image):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=8A=A0=E8=BD=BD=E5=A4=B1=E8=B4=A5=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 v-fallback 指令,用于处理图片加载失败时显示默认图片 - 在 VolForm、Index、List 和 UserInfo 组件中使用该指令替换原有的错误处理逻辑 - 在 main.js 中注册全局指令 - 移除各组件中的 defaultImg 和 errorImg 相关代码 --- .../Vol.Vue3.Vite/src/components/basic/VolForm.vue" | 9 +-------- .../Vol.Vue3.Vite/src/main.js" | 8 ++++++++ .../Vol.Vue3.Vite/src/views/Index.vue" | 4 +--- .../Vol.Vue3.Vite/src/views/html/List.vue" | 9 +++------ .../Vol.Vue3.Vite/src/views/system/UserInfo.vue" | 6 +----- 5 files changed, 14 insertions(+), 22 deletions(-) diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolForm.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolForm.vue" index 6a241ccd4..9924819e4 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolForm.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolForm.vue" @@ -39,10 +39,8 @@ v-for="(img, imgIndex) in formFields[item.field]" :key="imgIndex" > - @@ -841,8 +839,6 @@ export default defineComponent({ data() { return { // remoteCall: true, - defaultImg: new URL('@/assets/imgs/error-img.png', import.meta.url).href - // errorImg: 'this.src="' + require('@/assets/imgs/error-img.png') + '"' // span: 1, // rangeFields: [], }; @@ -1397,9 +1393,6 @@ export default defineComponent({ getNode( label,node, data){ console.log(label) }, - handleImageError($e) { - $e.target.src = this.defaultImg - }, getShortcuts() { const end = new Date(); return [ diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/main.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/main.js" index 675e94a36..40bee97a5 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/main.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/main.js" @@ -11,6 +11,7 @@ import http from './api/http' // import 'dayjs/locale/zh-cn' // import locale from 'element-plus/lib/locale/lang/zh-cn' import * as ElementPlusIconsVue from '@element-plus/icons-vue' +import errorImgSrc from '@/assets/imgs/error-img.png' import permission from './api/permission' import viewgird from './components/basic/ViewGrid' @@ -59,3 +60,10 @@ window.oss = { } app.use(store).use(ElementPlus, { size: 'default' }).use(router).use(viewgird).mount('#app') app.config.globalProperties.$Message = app.config.globalProperties.$message +app.directive('fallback', { + mounted(el) { + el.onerror = function () { + el.src = errorImgSrc + } + } +}) diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Index.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Index.vue" index 8aea11b18..6f3c6a51a 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Index.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Index.vue" @@ -55,7 +55,7 @@
- +
{{ userName }} @@ -268,7 +268,6 @@ export default defineComponent({ icon: "el-icon-switch-button", }, ]); - const errorImg = ref(new URL('@/assets/imgs/default_header.png', import.meta.url).href); const selectId = ref("1"); // 【首页】标签序号(当前右键选中的菜单) const selectMenuIndex = ref("0"); @@ -618,7 +617,6 @@ export default defineComponent({ isCollapse, drawer_model, theme_color, - errorImg, userInfo, userName, userImg, diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/html/List.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/html/List.vue" index c9c1ea2f5..00a1cca3d 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/html/List.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/html/List.vue" @@ -17,20 +17,18 @@
{{ritem.title}}
- +
-
- + {{ritem.creator}} {{ritem.type||""}} {{ritem.createDate}} @@ -64,7 +62,6 @@ export default { return { header: "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/head1.jpg", - errorImg: 'this.src="' + require("@/assets/imgs/error-img.png") + '"', recommend: [], index: 0, demo2: "推荐", diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/UserInfo.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/UserInfo.vue" index 2bd0f13dd..c8b1cec48 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/UserInfo.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/UserInfo.vue" @@ -15,7 +15,7 @@
- +

{{ userInfo.userName }} @@ -124,8 +124,6 @@ export default { }, data() { return { - - errorImg:new URL('@/assets/imgs/error-img.png', import.meta.url).href, // 'this.src="' + require("@/assets/imgs/error-img.png") + '"', modifyOptions: { model: false, @@ -277,5 +275,3 @@ img:not([src]) { color: #282828; } - - From b9768c73bd941dfac36166f7afc2cf08f2077451 Mon Sep 17 00:00:00 2001 From: 3ddbz Date: Tue, 15 Jul 2025 22:04:11 +0800 Subject: [PATCH 04/12] =?UTF-8?q?refactor:=20=E6=8C=89=E9=9C=80=E5=AF=BC?= =?UTF-8?q?=E5=85=A5echarts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Vol.Vue3.Vite/src/views/Home.vue" | 373 +++++++------- .../src/views/charts/bigdata.vue" | 132 ++--- .../views/charts/bigdata/chart-options.js" | 464 ++++++++---------- .../Vol.Vue3.Vite/src/views/charts/chart.vue" | 111 +++-- .../src/views/charts/chartOptions.js" | 347 ++++++------- .../src/views/charts/formChart.vue" | 129 +++-- .../src/views/home/home-chart-options.js" | 463 +++++++++-------- 7 files changed, 1006 insertions(+), 1013 deletions(-) diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Home.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Home.vue" index eca390e2b..7def9b56f 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Home.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Home.vue" @@ -4,18 +4,9 @@

left
-
- +
+
{{ item.title }}
@@ -45,170 +36,183 @@
-
-
+
+
- - - - - diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/bigdata/chart-options.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/bigdata/chart-options.js" index fe30d3ec3..9f51e6743 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/bigdata/chart-options.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/bigdata/chart-options.js" @@ -1,36 +1,28 @@ -var echarts = require("echarts"); +import { graphic } from 'echarts/core' let chartLeft1 = { tooltip: { - trigger: "axis", + trigger: 'axis', axisPointer: { - type: "shadow" + type: 'shadow' } }, grid: { - left: "0%", - top: "10px", - right: "0%", - bottom: "4%", + left: '0%', + top: '10px', + right: '0%', + bottom: '4%', containLabel: true }, xAxis: [ { - type: "category", - data: [ - "商超门店", - "教育培训", - "房地产", - "生活服务", - "汽车销售", - "旅游酒店", - "五金建材" - ], + type: 'category', + data: ['商超门店', '教育培训', '房地产', '生活服务', '汽车销售', '旅游酒店', '五金建材'], axisLine: { show: true, lineStyle: { - color: "rgba(255,255,255,.1)", + color: 'rgba(255,255,255,.1)', width: 1, - type: "solid" + type: 'solid' } }, @@ -41,22 +33,18 @@ let chartLeft1 = { interval: 0, show: true, splitNumber: 15, - textStyle: { - color: "rgba(255,255,255,.6)", - fontSize: "12" - } + color: 'rgba(255,255,255,.6)', + fontSize: '12' } } ], yAxis: [ { - type: "value", + type: 'value', axisLabel: { show: true, - textStyle: { - color: "rgba(255,255,255,.6)", - fontSize: "12" - } + color: 'rgba(255,255,255,.6)', + fontSize: '12' }, axisTick: { show: false @@ -64,66 +52,56 @@ let chartLeft1 = { axisLine: { show: true, lineStyle: { - color: "rgba(255,255,255,.1 )", + color: 'rgba(255,255,255,.1 )', width: 1, - type: "solid" + type: 'solid' } }, splitLine: { lineStyle: { - color: "rgba(255,255,255,.1)" + color: 'rgba(255,255,255,.1)' } } } ], series: [ { - type: "bar", + type: 'bar', data: [200, 600, 300, 900, 1500, 1200, 600], - barWidth: "35%", + barWidth: '35%', itemStyle: { - normal: { - color: "#2f89cf", - opacity: 1, - barBorderRadius: 5 - } + color: '#2f89cf', + opacity: 1, + borderRadius: 5 } } ] -}; - +} let chartLeft2 = { tooltip: { - trigger: "axis", + trigger: 'axis', axisPointer: { - type: "shadow" + type: 'shadow' } }, grid: { - left: "0%", - top: "10px", - right: "0%", - bottom: "4%", + left: '0%', + top: '10px', + right: '0%', + bottom: '4%', containLabel: true }, xAxis: [ { - type: "category", - data: [ - "07.01", - "07.02", - "07.03", - "07.04", - "07.05", - "07.06", - ], + type: 'category', + data: ['07.01', '07.02', '07.03', '07.04', '07.05', '07.06'], axisLine: { show: true, lineStyle: { - color: "rgba(255,255,255,.1)", + color: 'rgba(255,255,255,.1)', width: 1, - type: "solid" + type: 'solid' } }, axisTick: { @@ -134,22 +112,18 @@ let chartLeft2 = { // rotate:50, show: true, splitNumber: 15, - textStyle: { - color: "rgba(255,255,255,.6)", - fontSize: "12" - } + color: 'rgba(255,255,255,.6)', + fontSize: '12' } } ], yAxis: [ { - type: "value", + type: 'value', axisLabel: { show: true, - textStyle: { - color: "rgba(255,255,255,.6)", - fontSize: "12" - } + color: 'rgba(255,255,255,.6)', + fontSize: '12' }, axisTick: { show: false @@ -157,25 +131,23 @@ let chartLeft2 = { axisLine: { show: true, lineStyle: { - color: "rgba(255,255,255,.1 )", + color: 'rgba(255,255,255,.1 )', width: 1, - type: "solid" + type: 'solid' } }, splitLine: { lineStyle: { - color: "rgba(255,255,255,.1)" + color: 'rgba(255,255,255,.1)' } } }, { - type: "value", + type: 'value', axisLabel: { show: true, - textStyle: { - color: "rgba(255,255,255,.6)", - fontSize: "12" - } + color: 'rgba(255,255,255,.6)', + fontSize: '12' }, axisTick: { show: false @@ -183,68 +155,65 @@ let chartLeft2 = { axisLine: { show: true, lineStyle: { - color: "rgba(255,255,255,.1 )", + color: 'rgba(255,255,255,.1 )', width: 1, - type: "solid" + type: 'solid' } }, splitLine: { lineStyle: { - color: "rgba(255,255,255,.1)" + color: 'rgba(255,255,255,.1)' } } } - ], series: [ + ], + series: [ { - type: "bar", - name: "销量", + type: 'bar', + name: '销量', data: [1200, 800, 300, 500, 560, 220], - barWidth: "25%", + barWidth: '25%', itemStyle: { - normal: { - color: "#2f89cf", - opacity: 1, - barBorderRadius: 5 - } + color: '#2f89cf', + opacity: 1, + borderRadius: 5 } - }, { - type: "bar", - name: "订单", + }, + { + type: 'bar', + name: '订单', data: [1000, 750, 380, 450, 450, 120], - barWidth: "25%", + barWidth: '25%', itemStyle: { - normal: { - color: "#46d000", - opacity: 1, - barBorderRadius: 5 - } + color: '#46d000', + opacity: 1, + borderRadius: 5 } } ] -}; +} let chartLeft3 = { tooltip: { trigger: 'axis', - axisPointer: { // 坐标轴指示器,坐标轴触发有效 - type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' } }, grid: { - left: "0%", - top: "-5px", - right: "3%", - bottom: "4%", + left: '0%', + top: '-5px', + right: '3%', + bottom: '4%', containLabel: true }, xAxis: { type: 'value', axisLabel: { show: true, - textStyle: { - color: "rgba(255,255,255,.6)", - fontSize: "12" - } + color: 'rgba(255,255,255,.6)', + fontSize: '12' }, axisTick: { show: false @@ -252,14 +221,14 @@ let chartLeft3 = { axisLine: { show: true, lineStyle: { - color: "rgba(255,255,255,.1 )", + color: 'rgba(255,255,255,.1 )', width: 1, - type: "solid" + type: 'solid' } }, splitLine: { lineStyle: { - color: "rgba(255,255,255,.1)" + color: 'rgba(255,255,255,.1)' } } }, @@ -267,10 +236,8 @@ let chartLeft3 = { type: 'category', axisLabel: { show: true, - textStyle: { - color: "rgba(255,255,255,.6)", - fontSize: "12" - } + color: 'rgba(255,255,255,.6)', + fontSize: '12' }, axisTick: { show: false @@ -278,14 +245,14 @@ let chartLeft3 = { axisLine: { show: true, lineStyle: { - color: "rgba(255,255,255,.1 )", + color: 'rgba(255,255,255,.1 )', width: 1, - type: "solid" + type: 'solid' } }, splitLine: { lineStyle: { - color: "rgba(255,255,255,.1)" + color: 'rgba(255,255,255,.1)' } }, data: ['周一', '周二', '周三', '周四', '周五'] @@ -299,253 +266,246 @@ let chartLeft3 = { show: true, position: 'insideRight' }, - barWidth: "55%", + barWidth: '55%', itemStyle: { - normal: { - color: "#2f89cf", - opacity: 1, - barBorderRadius: 5 - } + color: '#2f89cf', + opacity: 1, + borderRadius: 5 }, data: [120, 302, 400, 200, 700] } ] -}; +} let chartRight1 = { title: {}, tooltip: { - trigger: "axis", + trigger: 'axis', axisPointer: { - type: "cross", + type: 'cross', label: { - backgroundColor: "#6a7985" + backgroundColor: '#6a7985' } } }, - color: ["#ffab6f", "#09b916", "#83cddc"], //图例颜色 + color: ['#ffab6f', '#09b916', '#83cddc'], //图例颜色 legend: { - top: "0%", - icon: "roundRect", - data: ["销售订单", "退货订单", "折扣订单"], - textStyle: { - color: "rgba(255,255,255,.5)", - fontSize: "12" - } + top: '0%', + icon: 'roundRect', + data: ['销售订单', '退货订单', '折扣订单'], + color: 'rgba(255,255,255,.5)', + fontSize: '12' }, toolbox: { feature: {} }, grid: { - left: "10", - top: "20", - right: "10", - bottom: "10", + left: '10', + top: '20', + right: '10', + bottom: '10', containLabel: true }, xAxis: [ { - type: "category", + type: 'category', boundaryGap: false, axisLabel: { - textStyle: { - color: "rgba(255,255,255,.6)", - fontSize: 12 - } + color: 'rgba(255,255,255,.6)', + fontSize: 12 }, axisLine: { lineStyle: { - color: "rgba(255,255,255,.2)" + color: 'rgba(255,255,255,.2)' } }, data: [ - "2020.06.15", - "2020.06.16", - "2020.06.17", - "2020.06.18", - "2020.06.19", - "2020.06.20", - "2020.06.21", - "2020.06.22" + '2020.06.15', + '2020.06.16', + '2020.06.17', + '2020.06.18', + '2020.06.19', + '2020.06.20', + '2020.06.21', + '2020.06.22' ] } ], yAxis: [ { - type: "value", + type: 'value', axisTick: { show: false }, minInterval: 60, axisLine: { lineStyle: { - color: "rgba(255,255,255,.1)" + color: 'rgba(255,255,255,.1)' } }, axisLabel: { - textStyle: { - color: "rgba(255,255,255,.6)", - fontSize: 12 - } + color: 'rgba(255,255,255,.6)', + fontSize: 12 }, splitLine: { lineStyle: { - color: "rgba(255,255,255,.1)" + color: 'rgba(255,255,255,.1)' } } } ], series: [ { - name: "销售订单", - type: "line", + name: '销售订单', + type: 'line', smooth: true, lineStyle: { - color: "#45d4ba", + color: '#45d4ba', width: 1 }, //线条的样式 areaStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + color: new graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, - color: "#83cddc" + color: '#83cddc' }, { offset: 1, - color: "#bfdffbb5" + color: '#bfdffbb5' } ]) }, data: [5, 22, 150, 54, 1, 230, 4, 1] }, { - name: "退货订单", - type: "line", + name: '退货订单', + type: 'line', smooth: true, lineStyle: { - color: "#04a710", + color: '#04a710', width: 1 }, // areaStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + color: new graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, - color: "#0cbf22" + color: '#0cbf22' }, { offset: 1, - color: "#b8f7d1b5" + color: '#b8f7d1b5' } ]) }, data: [10, 150, 1, 250, 20, 100, 10, 150] }, { - name: "折扣订单", - type: "line", + name: '折扣订单', + type: 'line', lineStyle: { - color: "#0864c3", + color: '#0864c3', width: 1 }, //线条的样式 smooth: true, areaStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + color: new graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, - color: "#29d7ff" + color: '#29d7ff' }, { offset: 1, - color: "#34ccef85" + color: '#34ccef85' } ]) }, data: [100, 2, 260, 1, 200, 30, 101, 40] } ] -}; +} var gauge = { - series: [{ - radius: '90%', - type: 'gauge', - startAngle: 180, - endAngle: 0, - min: 0, - max: 1, - splitNumber: 8, - axisLine: { - lineStyle: { - width: 3, - color: [ - [0.25, '#FF6E76'], - [0.5, '#FDDD60'], - [0.75, '#58D9F9'], - [1, '#7CFFB2'] - ] - } - }, - pointer: { - icon: 'path://M12.8,0.7l12,40.1H0.7L12.8,0.7z', - length: '12%', - width: 20, - offsetCenter: [0, '-60%'], - itemStyle: { - color: 'auto' - } - }, - axisTick: { - length: 12, - lineStyle: { - color: 'auto', - width: 2 - } - }, - splitLine: { - length: 20, - lineStyle: { - color: 'auto', - width: 5 - } - }, - axisLabel: { - color: '#464646', - fontSize: 20, - distance: -60, - formatter: function (value) { - if (value === 0.875) { - return '优'; + series: [ + { + radius: '90%', + type: 'gauge', + startAngle: 180, + endAngle: 0, + min: 0, + max: 1, + splitNumber: 8, + axisLine: { + lineStyle: { + width: 3, + color: [ + [0.25, '#FF6E76'], + [0.5, '#FDDD60'], + [0.75, '#58D9F9'], + [1, '#7CFFB2'] + ] } - else if (value === 0.625) { - return '中'; + }, + pointer: { + icon: 'path://M12.8,0.7l12,40.1H0.7L12.8,0.7z', + length: '12%', + width: 20, + offsetCenter: [0, '-60%'], + itemStyle: { + color: 'inherit' } - else if (value === 0.375) { - return '良'; + }, + axisTick: { + length: 12, + lineStyle: { + color: 'inherit', + width: 2 } - else if (value === 0.125) { - return '差'; + }, + splitLine: { + length: 20, + lineStyle: { + color: 'inherit', + width: 5 } - } - }, - title: { - offsetCenter: [0, '-20%'], - fontSize: 20 - }, - detail: { - fontSize: 30, - offsetCenter: [0, '0%'], - valueAnimation: true, - formatter: function (value) { - return Math.round(value * 100) + '分'; }, - color: 'auto' - }, - data: [{ - value: 0.70, - name: '成绩评定' - }] - }] + axisLabel: { + color: '#464646', + fontSize: 20, + distance: -60, + formatter: function (value) { + if (value === 0.875) { + return '优' + } else if (value === 0.625) { + return '中' + } else if (value === 0.375) { + return '良' + } else if (value === 0.125) { + return '差' + } + } + }, + title: { + offsetCenter: [0, '-20%'], + fontSize: 20 + }, + detail: { + fontSize: 30, + offsetCenter: [0, '0%'], + valueAnimation: true, + formatter: function (value) { + return Math.round(value * 100) + '分' + }, + color: 'inherit' + }, + data: [ + { + value: 0.7, + name: '成绩评定' + } + ] + } + ] } export { chartLeft1, chartLeft2, chartLeft3, chartRight1, gauge } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chart.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chart.vue" index 3b0695a60..24aeebd47 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chart.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chart.vue" @@ -36,47 +36,81 @@
- diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/App_Transaction.jsx" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/App_Transaction.jsx" new file mode 100644 index 000000000..936b4fed6 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/App_Transaction.jsx" @@ -0,0 +1,135 @@ +import { h, resolveComponent } from 'vue'; +let extension = { + components: { + //动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '', //{ template: "
扩展组xx件
" }, + // gridBody: { + // template: '\ + // 查询默认/显示所有查询条件\ + // ' }, + gridBody: { + render() { + return h( + resolveComponent('ElAlert'), + { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, + type: 'success', + closable: false + }, + [ + h( + 'p', + {}, + '1、默认界面上显示的列都可以导入,也可以在后台指定导入与导出的列,见后台开发文档->后台基础代码扩展实现导入方法说明' + ), + h( + 'p', + {}, + ' 2、添加switch、checkbox组件,设置默认查询值(下拉框、默认日期)、查询界面表高度等,App_Transaction.js配置与说明' + ) + ] + ); + } + }, + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + tableAction: 'App_Appointment', //指定菜单权限,其他任何页面引用时都会走对应权限 + text: + '目前导入导出的字段为代码生成器中配置[是否显示与编辑列],可自行添加配置字段处理', + buttons: [], //扩展的按钮 + methods: { + //事件扩展 + + //事件扩展 + onInit() { + + this.buttons.push({ + name: '查看代码', + onClick: () => { + window.open('http://api.volcore.xyz/vol.doc/apptransaction.html', 'blank'); + } + }); + + + //设置查询条件 + // this.searchFormFields.Name = "林"; + //设置下拉框的字段(是否买入)的默认值(注意下拉框key如要是数字同样也要设置为字符类型数字,如果是自定sql数据源的key则需要设置成数字类型) + // this.searchFormFields.TransactionType = '1'; + //注意日期设置默认值的时候 ,如果查询类型选择的是datetime后面一定要写上,00:00:00 + //如果查询类型是date直接写年月日即可 + this.searchFormFields.CreateDate = [ + '2015-01-01 00:00:00', + '2030-12-31 00:00:00' + ]; + //设置页面上显示的按钮个数(不是必须的) + this.maxBtnLength = 6; + //设置显示所有查询条件 + this.setFiexdSearchForm(true); + + this.columns.forEach(col=>{ + if (col.field=='Describe') { + col.hidden=true; + } + }) + + this.columns.push({ + title: 'switch', + field: 'switch', + width: 80, + fixed: 'right', + align: 'center', + render: (h, { row, column, index }) => { + //这里必须将要操作的字段变更为bool类型 + row.Enable=row.Enable||false; + return ( +
+ { + this.switchChange(row); + }} + > +
+ ); + } + }); + + this.columns.push({ + title: 'checkbox', + field: 'checkbox', + width: 80, + fixed: 'right', + align: 'center', + render: (h, { row, column, index }) => { + //这里必须将要操作的字段变更为bool类型 + row.Enable=row.Enable||false; + return ( +
+ { + this.switchChange(row); + }} + > +
+ ); + } + }); + }, + switchChange(row) { + this.$message.success(row.Enable + ''); + }, + onInited() { + //设置查询界面表高度 + this.height = this.height-215; + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/App_Transaction2.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/App_Transaction2.js" new file mode 100644 index 000000000..0f3f8ed37 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/App_Transaction2.js" @@ -0,0 +1,126 @@ +let extension = { + components: { + //动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '', //{ template: "
扩展组xx件
" }, + gridBody: '', + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + text: '点击行或者点击表格的编辑即可开启编辑功能', + tableAction: 'App_Transaction', + buttons: [], //扩展的按钮 + methods: { + //事件扩展 + onInit() { + //手动设置弹出框的高度与宽度 + //判断有没有App_Transaction表修改的权限 ,无权限不开启编辑功能 + if (!this.filterPermission('App_Transaction', 'Update')) { + return; + } + //开启编辑功能 + this.doubleEdit = true; + //开启指定列可以编辑 + //**注意,开启字段的编辑信息,如果调用框架的保存方法,代码生成器中必须设置了编辑行并生成了model否则验证通不过 + this.columns.forEach((column) => { + if (column.field == 'Describe' || column.field == 'Name') { + column.edit = { type: 'text' }; + } + if (column.field == 'TransactionType') { + column.edit = { type: 'switch' }; + } + if (column.field == 'CowType') { + column.edit = { type: 'select' }; + } + }); + //动态添加操作列 + this.columns.push({ + field: '操作', + title: '操作', + align: 'center', + width: 120, + render: this.getRender() + }); + }, + beginEdit(row, column, index) { + console.log('编辑行:'+index) + //点击行编辑 return false阻止编辑(可以根据row不同的值判断当前是否可以编辑); + return true; + }, + endEditBefore(row, column, index) { + //可以自动结束编辑时,自动执行保存,下面getRender的保存按钮去掉 + // this.editSave(); + return true; + }, + editSave(row) { + //调用框架的默认保存方法 + this.http + .post('/api/App_Transaction/update', { mainData: row }, true) + .then((x) => { + this.$Message.info('保存成功'); + console.log('保存结果:' + JSON.stringify(x)); + }); + }, + getRender() { + //生成最后一列操作列 + return (h, { row, column, index }) => { + return h( + 'div', + { + style: { color: '#0c83ff', 'font-size': '13px', cursor: 'pointer' } + }, + [ + h( + 'a', + { + props: {}, + style: { 'border-bottom': '1px solid' }, + onClick: (e) => { + e.stopPropagation(); + //取消其他行选中 + this.$refs.table.$refs.table.clearSelection(); + //设置当前后选中 + this.$refs.table.$refs.table.toggleRowSelection(row); + this.del([row]); + } + }, + '删除' + ), + h( + 'a', + { + props: {}, + style: { 'margin-left': '9px', 'border-bottom': '1px solid' }, + onClick: (e) => { + e.stopPropagation(); + //将当前行设置为编辑行 + this.$refs.table.edit.rowIndex = index; + } + }, + '编辑' + ), + h( + 'a', + { + props: {}, + style: { 'margin-left': '9px', 'border-bottom': '1px solid' }, + onClick: (e) => { + e.stopPropagation(); + //强制结束编辑 + this.$refs.table.edit.rowIndex = -1; + //执行保存方法 + this.editSave(row); + } + }, + '保存' + ) + ] + ); + }; + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/App_TransactionAvgPrice.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/App_TransactionAvgPrice.js" new file mode 100644 index 000000000..666536a19 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/App_TransactionAvgPrice.js" @@ -0,0 +1,64 @@ + +import { h, resolveComponent } from 'vue'; +let extension = { + components: { + //动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '', //{ template: "
扩展组xx件
" }, + gridBody: { + render() { + return [ + h(resolveComponent('el-alert'), { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, type: 'warning', + closable: false, title: 'onInit中设置this.maxBtnLength = 7;指定按钮显示的个数。见代码:App_TransactionAvgPrice.js' + }, ''), + ] + } + }, + gridFooter: "", + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: "", + modelBody: "", + modelFooter: "" + }, + text: + "还没想好", + buttons: [], //扩展的按钮 + methods: { + //事件扩展 + onInit() { + //设置页面上显示的按钮个数(不是必须的) + this.maxBtnLength = 7; + //this.boxButtons弹出框的按钮,this.detailOptions.buttons,同样适用上面上方法 + //2021.07.17更新volform.vue组件后才能使用 + this.editFormOptions.forEach(x => { + x.forEach(option => { + if (option.field == "Date") { + option.min = "2021-07-01 00:00"; + option.max = Date.now();//日期最大值"2021-07-20 00:00" + } + + }) + }) + this.columns.forEach(option => { + if (option.field == 'AgeRange') { + option.normal = true; + } + }) + //如果要设置查询的日期范围选择同上 + //this.searchFormOptions.forEach + + //设置显示所有查询条件 + // this.setFiexdSearchForm(true); + }, + onInited() { + //设置表高度 + this.height = this.height - 50; + }, + rowClick({ row, column, event }) { //查询界面table点击行时选中当前行 + this.$refs.table.$refs.table.toggleRowSelection(row); + }, + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/news_article.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/news_article.js" new file mode 100644 index 000000000..394bb4bf6 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/news_article.js" @@ -0,0 +1,17 @@ +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader:'',//{ template: "
扩展组xx件
" }, + gridBody: '', + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + buttons: [],//扩展的按钮 + methods: {//事件扩展 + + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/vProvinceCity.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/vProvinceCity.js" new file mode 100644 index 000000000..394bb4bf6 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/appmanager/vProvinceCity.js" @@ -0,0 +1,17 @@ +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader:'',//{ template: "
扩展组xx件
" }, + gridBody: '', + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + buttons: [],//扩展的按钮 + methods: {//事件扩展 + + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/App_Appointment.jsx" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/App_Appointment.jsx" new file mode 100644 index 000000000..2d70225a9 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/App_Appointment.jsx" @@ -0,0 +1,388 @@ +import { h, resolveComponent } from 'vue'; +let extension = { + components: { + //动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '', + gridBody: { + render(h) { + return ( + +

+

+

+

+

+

+
+ ); + } + }, + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + buttons: [], //扩展的按钮 + tableAction: 'App_Appointment', //指定菜单权限,其他任何页面引用时都会走对应权限 + text: + '代码生成器中设置[是否只读]或如果没有编辑或新建权限弹出框都是只读的(点击用户姓名列可查看表单分组)', + methods: { + btn1Click(row, $e) { + $e.stopPropagation(); + this.edit(row); + }, + btn2Click(row, $e) { + $e.stopPropagation(); + this.$message.success('点击了按钮'); + }, + dropdownClick(value, row, column) { + console.log(row); + this.$message.success(value); + }, + //事件扩展 + onInit() { + this.buttons.push({ + name: '查看代码', + onClick: () => { + window.open('http://api.volcore.xyz/vol.doc/appointment.html', 'blank'); + } + }); + + //设置显示所有查询条件 + this.setFiexdSearchForm(true); + + //表格上添加自定义按钮 + this.columns.push({ + title: '操作', + field: '操作', + width: 150, + align: 'left',// 'center', + render: (h, { row, column, index }) => { + return ( +
+ { + this.btn1Click(row, $e); + }} + type="primary" + plain + style="height:26px; padding: 10px !important;" + > + 查看 + + + {/* 通过条件判断,要显示的按钮 */} + { + /* { + index % 2 === 1 + ?修改 + : 设置 + } */ + } + + + {/* 通过v-show控制按钮隐藏与显示 + 下面的index % 2 === 1换成:row.字段==值 */ + } + { + this.btn2Click(row, $e); + }} + v-show={index % 2 === 1} + type="success" + plain + style="height:26px;padding: 10px !important;" + > + 修改 + + + { + this.btn2Click(row, $e); + }} + v-show={index % 2 === 0} + type="warning" + plain + style="height:26px;padding: 10px !important;" + > + 设置 + + + { + this.dropdownClick(value); + }} + trigger="click" + v-slots={{ + dropdown: () => ( + + +
{ + this.dropdownClick('京酱肉丝', row, column); + }} + > + 京酱肉丝 +
+
+ +
{ + this.dropdownClick('驴肉火烧', row, column); + }} + > + 驴肉火烧 +
+
+
+ ) + }} + > + + 更多 + +
+
+ ); + } + }); + + //表格显示Tooltip提示 + this.columns.forEach((col) => { + if (col.field == 'Describe') { + col.title = '单元格Tooltip(鼠标放上来看效果)'; + col.showOverflowTooltip = true; + //或者用下面这的个方法自定义提示 + // col.render = (h, { row, column, index }) => { + // return ( + // + // {{ reference: {row.Describe} }} + // + // ); + // }; + } + }); + + //增加弹出框提示信息 + //https://cn.vuejs.org/guide/extras/render-function.html#passing-slots + //自定义提示 + this.editFormOptions[0][0].extra = { + render: (h) => { + return ( + + {/* 这里对应下面的#reference数据槽 */} + {{ reference: }} + + ); + } + }; + + // + // + // + + //格式化单格颜色 + this.columns.forEach((x) => { + if (x.field == 'PhoneNo') { + x.title='设置背景颜色' + x.cellStyle = (row, rowIndex, columnIndex) => { + if (row.PhoneNo == '138888887698') { //&& rowIndex == 0 + return { background: '#ddecfd' }; + }else if (row.PhoneNo == '138888887692') { //&& rowIndex == 0 + return { background: '#a9d6f9' }; + } + }; + } + if (x.field == 'Creator') { + x.title='合并列' + x.cellStyle = (row, rowIndex, columnIndex) => { + if (row.Creator == '超级管理员') { + return { background: 'rgb(45 140 240)', color: '#ffff' }; + } + }; + } + + //设置进度条 + //进度条组件见:https://element-plus.gitee.io/zh-CN/component/progress.html#%E8%BF%9B%E5%BA%A6%E6%9D%A1%E5%86%85%E6%98%BE%E7%A4%BA%E7%99%BE%E5%88%86%E6%AF%94%E6%A0%87%E8%AF%86 + if (x.field == 'CreateDate') { + x.title = '进度条' + x.render = (h, { row, column, index }) => { + if (index % 2 === 1) { + //90改为row.字段 + return + } + //10改为row.字段 + return + } + } + + if (x.field == 'Name') { + x.title = '点击查看(合并行)'; + } + }); + + //设置表单分组 + this.editFormOptions.splice(0, 0, [ + { + colSize: 12, + render: (h) => { + return ( +
+
+
+ 基本信息 +
+
+ ); + } + } + ]); + + //设置表单分组 + + this.editFormOptions.splice(2, 0, [ + { + colSize: 12, + render: (h) => { + return ( +
+
+
+ 基本信息 +
+
+ ); + } + } + ]); + + //弹出框增加分段alert提示 + this.editFormOptions.splice(3, 0, [ + { + colSize: 12, + render: (h) => { + return ( + + ); + } + } + ]); + + //查询界面按钮组 + //按钮图标这里找https://element.eleme.cn/#/zh-CN/component/icon + //第二个按钮后面添加按钮组 + this.buttons.splice(2, 1, { + name: '按钮组', + type: 'primary', + plain: true, + color: '#009688', + data: [ + { + name: '按钮一', + icon: 'el-icon-plus', + onClick: () => { + this.$message.info('按钮一'); + } + }, + { + name: '按钮二', + icon: 'el-icon-zoom-out', + onClick: () => { + this.$message.info('按钮二'); + } + } + ] + }); + }, + + onInited() { + //多页签菜单打开时,重新设置表格的最大高度 + if (this.$route.path == '/tabsTable') { + this.tableMaxHeight = document.body.clientHeight - 415; + } else { + //设置表的最大高度 + this.tableMaxHeight = this.height - 125; //400 + } + //移除快捷查询 + this.singleSearch = null; + }, + spanMethod({ row, column, rowIndex, columnIndex }) { //2023.08.19增加行、列合并功能,el合并文档见https://element-plus.gitee.io/zh-CN/component/table.html#%E5%90%88%E5%B9%B6%E8%A1%8C%E6%88%96%E5%88%97 + if (rowIndex % 2 === 0) { + if (columnIndex === 6) { + return [1, 2] + } + else if (columnIndex === 5) { + return [0, 0] + } + } + if (columnIndex === 1) { + if (rowIndex % 2 === 0) { + return { + rowspan: 2, + colspan: 1, + } + } else { + return { + rowspan: 0, + colspan: 0, + } + } + } + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/App_Appointment/App_AppointmentGridFooter.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/App_Appointment/App_AppointmentGridFooter.vue" new file mode 100644 index 000000000..575972a65 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/App_Appointment/App_AppointmentGridFooter.vue" @@ -0,0 +1,205 @@ + + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/App_Appointment2.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/App_Appointment2.js" new file mode 100644 index 000000000..1e5ff7ab0 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/App_Appointment2.js" @@ -0,0 +1,60 @@ + +import { h, resolveComponent } from 'vue'; +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '', + gridBody: { + render() { + return h(resolveComponent('ElAlert'), { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, + type: 'success', + closable: false, + }, [h('p', {}, '1、 onInited中重新定义表头数据,2021.01.08更新voltable.vue后才能使用'), + h('p', {}, ' 2、具体见:App_Appointment2.js中配置(现在只支持到二级表头、不支持编辑与复杂操作)')]); + } + }, + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + tableAction:"App_Appointment", + text: "页面全部由代码生成器生成,只需要在onInited中重新配置表头数据", + methods: {//事件扩展 + onInit() { + //设置表的最大高度 + this.tableMaxHeight = 300; + }, + onInited() { + this.columns.splice(0); + this.columns.push(...[ + { + field: 'Name', title: '基础信息', type: 'string', align: 'center', + children: [ + { field: 'Name', title: '用户姓名', type: 'string', link: true, width: 100, sortable: true }, + { field: 'PhoneNo', title: '电话', type: 'string', width: 130 }, + { field: 'Describe', title: '描述信息', type: 'string', width: 180 }, + ] + }, + { + field: 'Name', title: '创建人信息', type: 'string', align: 'center', + children: [ + { field: 'Id', title: '主键ID', type: 'string', width: 90, hidden: true }, + { field: 'CreateDate', title: '创建时间', type: 'datetime', width: 120, sortable: true }, + { field: 'Creator', title: '创建人', type: 'string', width: 130, align: 'left' }] + }, + { + field: 'Name', title: '修改人信息', type: 'string', align: 'center', + children: [ + { field: 'Modifier', title: '修 改 人', type: 'string', width: 130, align: 'left' }, + { field: 'ModifyDate', title: '修改时间', type: 'datetime', width: 150, sortable: true }] + } + ] + ) + } + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder.js" new file mode 100644 index 000000000..c46795ef7 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder.js" @@ -0,0 +1,388 @@ +//1、此文件中的代码都是对基础业务进行扩展,也只能在此处编写代码,其他地方编写的代码会被代码生成器生成的代码覆盖 +//2、此文件中的方法会与serviceFilter.js进行合并,终终执行的就是此文件中的方法 +//3、components为扩展组件,可自定义页面的头部、body及尾部的额外显示的内容,分别对应的组件为: +//gridHeader、gridBody、gridFooter、modelHeader、modelBody、modelFooter共6个组件位置,如果不需要扩展组件,请忽略此处 +//4、text为界面显示额外描述信息 +//5、buttons->view/box/detail分别为查询界面、弹出框、弹出框明细表额外扩展的按钮 +//6、methods为整个页面所有方法的业务代码扩展,如果需要在界面上的操作前、后编写业务,请覆盖此方法 +//7、methods方法中可获取任意vue对象、方法、属性,可查看ViewGridConfig路径下的js文件及ViewGrid.vue的data属性 +//如手动刷新表数据:this.search(); +//获取表的列配置信息:this.columns 明细表表的配置信息this.detail.columns +//8、获取子组件gridHeader、gridBody、gridFooter、modelHeader、modelBody、modelFooter则使用 +//this.$refs.gridHeader获取gridHeader为自己扩展的对象 +//9、在子组件gridHeader、gridBody、gridFooter、modelHeader、modelBody、modelFooter的方法中调用并获得父组件 +// this.$emit("parentCall", $vue => {}) //$vue为父组件对象,具体使用参考order->GridHeader.vue文件 + +//10、子父件传参除8、9方式,另可使用已封装的vuex,使用方式:this.$store.getters.data().xxx = this;使用实例:App_News.js + +//此处的下面的属性与方法都是对基础业务代码的扩展,如果不需要扩展则忽略对应的方法也不要写在下面 +//serviceFilter.js +//所的文件都最终会合并到ViewGrid.vue文件中 + +import { h, resolveComponent } from 'vue'; +import gridHeader from "./SellOrderComponents/GridHeader.vue" +import gridFooter from "./SellOrderComponents/GridFooter.vue" +import modelFooter from "./SellOrderComponents/ModelFooter.vue" +import modelBody from "./SellOrderComponents/ModelBody.vue" +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: gridHeader, + gridBody: { + render() { + return [ + h(resolveComponent('el-alert'), { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, type: 'warning', + closable: false, title: '一对一全部由代码生成不需要写任何代码,点击新建或编辑查看明细表,可根据需要实现扩展gridHeader、gridBody、gridFooter、modelHeader、modelBody、modelFooter任意位置' + }, ''), + ] + } + }, + gridFooter: gridFooter, + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: "", + modelBody: modelBody, + modelFooter: modelFooter, + }, + text: "示例覆盖全部可扩展方法,前台扩展文件SellOrder.js,后台Partial->SellOrdeService.cs", + //this.filterPermission('表名','权限值,如:Add')来判断页面上是否有某个按钮的权限 + buttons: { //根据需要自行实现扩展按钮 + //注:没有编辑或新建权限的情况下,是不会显示此处添加的扩展按钮,如果仍需要显示此处的按钮,可以把按钮在methods的onInited方法中添加,如:this.boxButtons.push(...) + view: [//ViewGrid查询界面按钮 + + ], + box: //新建、编辑弹出框按钮 + [//ViewGrid查询界面按钮 + { + name: "点我1", + icon: 'el-icon-delete', + value: 'Edit', + class: '', + type: 'success', + index: 1,//显示的位置 + onClick: function () { + this.$message.error("扩展的明细Box按钮,可设置index值指定显示位置,可使用this.$refs拿到包括自定义扩展的所有组件"); + } + }], + detail: //新建、编辑弹出框明细表table表按钮 + [//ViewGrid查询界面按钮 + { + name: "点我2", + icon: 'el-icon-delete', + value: 'Edit', + class: '', + type: 'success', + index: 1,//显示的位置 + onClick: function () { + this.$message.error("扩展的明细table按钮,可设置index值指定显示位置"); + } + }] + },//扩展的按钮 + methods: { + //扩展方法使用示例,根据需要实行下面的方法 + getServiceDate() { + this.http.post("/api/SellOrder/getServiceDate", {}, '正在调用后台数据').then(date => { + this.$message.error("从后台获取的服务器时间是:" + date); + }) + }, + mounted() { + //this.$message.success('mounted方法执行时,你可以此处编写业务逻辑'); + }, + //方式1,通过select选择触发显示与隐藏 + onInit() { + + this.buttons.splice(1,0,...[ + { + name: "点我弹出框", + icon: 'md-create', + value: 'Edit', + class: '', + type: 'primary', + index: 1,//显示的位置 + onClick: function () { //扩展按钮执行事件 + //this可以获取所有属性,包括this.$refs.gridHeader/gridBody等获取扩展组件对象 + // this.$message("测试扩展按钮"); + this.$refs.gridHeader.open1(); + } + }, { + name: "调用后台", + icon: 'md-create', + value: 'Edit', + class: '', + type: 'primary', + index: 1,//显示的位置 + onClick: function () { //扩展按钮执行事件 + this.getServiceDate(); + } + } + ]) + + //获取订单类型select配置,当前订单类型select改变值时,动态设置Remark,SellNo两个字段是否显示 + var orderTypeOption = this.getFormOption("OrderType"); + orderTypeOption.onChange = (val) => { + //当订单类型select改变值时,如果选中的是发货(对应字典编号为2),emark,SellNo隐藏,否则显示出来 + this.getFormOption("Remark").hidden = val == "2" + // var sellNoOption = this.getFormOption("SellNo").hidden = val == "2" + } + + //点击单元格编辑与结束编辑(默认是点击单元格编辑,鼠标离开结束编辑) + this.detailOptions.clickEdit = true; + + + //设置主表合计 + this.summary = true; + //设置明细表合计 + this.detailOptions.summary = true; + //表格设置为单选 + // this.single=true; + // this.detailOptions.single=true; + //设置编辑表单数量字段的最小与最大值 + this.editFormOptions.forEach(x => { + x.forEach(item => { + //设置输入的数量的最小值与最大值(默认是1) + if (item.field == "Qty") { + item.min = 10; + item.max =100000; + } + }); + }) + + //动态修改table并给列添加事件 + this.columns.forEach(x => { + if (x.field == "Qty") { + x.formatter = (row) => { + return '' + row.Qty + "(弹出框)" + '' + } + x.click = (row, column, event) => { + this.$refs.gridHeader.open2(row) + } + } + }) + + //动态设置查询界面table高度 + this.tableHeight = 300; + + }, + onInited() { + this.detailOptions.columnIndex=false; + this.detailOptions.ck=true; + //设置主表求字段,后台需要实现SummaryExpress方法 + this.columns.forEach(x => { + if (x.field == 'Qty'||x.field=='Weight') { + x.summary = true; + //自定义合计格式化与修改合计名称 + x.summaryFormatter=(val,column,result,summaryData)=>{ + summaryData[0]='汇总' + return ((val||'')+'').replace(/\B(?=(\d{3})+(?!\d))/g, ",")+'个' + } + } + }) + //设置明细表高度 + this.detailOptions.height = 220; + this.boxOptions.height = document.body.clientHeight * 0.90; + //设置明细表求字和段,后台需要实现GetDetailSummary方法 + this.detailOptions.columns.forEach(x => { + if (x.field == 'Weight' || x.field == 'Qty') { + x.summary = true; + } + }) + // this.$message.success('create方法执行后', desc: '你可以SellOrder.js中编写业务逻辑,其他方法同样适用' }); + }, + searchBefore(param) { //查询ViewGird表数据前,param查询参数 + //你可以指定param查询的参数,处如果返回false,则不会执行查询 + // this.$message.success(this.table.cnName + ',查询前' }); + // console.log("扩展的"this.detailOptions.cnName + '触发loadDetailTableBefore'); + return true; + }, + searchAfter(result) { //查询ViewGird表数据后param查询参数,result回返查询的结果 + // this.$notify({ + // title: '查询结果', + // message: '返回的对象:' + JSON.stringify(result), + // type: 'success' + // }); + return true; + }, + searchDetailBefore(param) {//查询从表表数据前,param查询参数 + // this.$message.success(this.detailOptions.cnName + '查询前' }); + return true; + }, + searchDetailAfter(data) {//查询从表后param查询参数,result回返查询的结果 + // this.$notify({ + // title: '明细查询结果', + // message: '返回的对象:' + JSON.stringify(data), + // type: 'success' + // }); + return true; + }, + delBefore(ids, rows) { //查询界面的表删除前 ids为删除的id数组,rows删除的行 + let auditStatus = rows.some(x => { return x.AuditStatus > 0 }); + // if (auditStatus) { + // this.$message.error('只能删除未审核的数据') + // return false; + // } + this.$message.success('删除前,选择的Id:' + ids.join(',')); + return true; + }, + delAfter(result) {//查询界面的表删除后 + return true; + }, + delDetailRow(rows) { //弹出框删除明细表的行数据(只是对table操作,并没有操作后台) + console.log(rows) + return true; + }, + addBefore(formData) { //新建保存前formData为对象,包括明细表 + //formData格式: + // { + // mainData: { 主表字段1: 'x1', 主表字段2: 'x2' }, + // detailData: [{ 明细表字段1: d1 }], + // delKeys: null //删除明细表行数据的id + // } + + //formData.mainData.xxx="xxxx";//还可以继续手动添加值 + + //如果需要同时提交其他数据到后台,请设置formData.extra=xxxx + //后台在表xxxxService.cs中重写Add方法即可从saveDataModel参数中拿到extra提交的对象 + console.log(this.detailOptions.cnName + '新建前,提交的数据:' + JSON.stringify(formData)); + return true; + }, + async addBeforeAsync(formData) { + //2020.12.06增加新建前异步方法同步处理 + //功能同上,区别在于此处可以做一些异步请求处理,全: + // var _result = await this.http.post("/api/SellOrder/getPageData", {}, true).then(result => { + // console.log("1、异步请求前") + // return result; + // }) + // console.log("2、异步请求,同步处理结果:" + JSON.stringify(_result)) + return true; + }, + addAfter(result) {//新建保存后result返回的状态及表单对象 + console.log(this.detailOptions.cnName + '新建完成后,返回的数据' + JSON.stringify(result)); + return true; + }, + updateBefore(formData) { //编辑保存前formData为对象,包括明细表、删除行的Id + //formData格式:(自己调试出输看) + // { + // mainData: { 主表字段1: 'x1', 主表字段2: 'x2' }, + // detailData: [{ 明细表字段1: d1 }], + // delKeys: null //删除明细表行数据的id + // } + + //formData.mainData.xxx="xxxx";//还可以继续手动添加值 + + //如果需要同时提交其他数据到后台,请设置formData.extra=xxxx + //后台在表xxxxService.cs中重写Update方法即可从saveDataModel参数中拿到extra提交的对象 + + console.log(this.detailOptions.cnName + '编辑前,提交的数据:' + JSON.stringify(formData)); + //获取扩展的modelFooter属性text + // console.log(this.$refs.modelFooter.text) + return true; + }, + async updateBeforeAsync(formData) { + //2020.12.06增加修改前异步方法同步处理 + //功能同上,区别在于此处可以做一些异步请求处理,全: + var _result = await this.http.post("/api/SellOrder/getPageData", {}, true).then(result => { + console.log("1、异步请求前") + return result; + }) + console.log("2、异步请求,同步处理结果:" + JSON.stringify(_result)) + return true; + }, + updateAfter(result) {//编辑保存后result返回的状态及表单对象 + // this.$message.success(this.detailOptions.cnName + '编辑完成后,返回的数据' + JSON.stringify(result)); + return true; + }, + auditBefore(ids, rows) {//审核前 + if (rows.length > 2) {//每次最多只能审核2条数据 + this.$message.error('最多只能选择两条数据'); + return false; + } + return true; + }, + auditAfter(result, rows) {// 审核后 + if (result.status) { + result.message = "审核成功。。。。。" + result.message; + } + return true; + }, + resetAddFormBefore() { //重置新建表单前的内容 + return true; + }, + resetAddFormAfter() { //重置新建表单后的内容 + //如果某些字段不需要重置,则可以重新赋值 + this.editFormFields.Remark = '新建重置默认值66666'; + //给明细表添加默认一行 + this.$refs.detail.rowData.push({ Remark: "新建666666" }); + return true; + }, + resetUpdateFormBefore() { //重置编辑表单前的内容 + //this.editFormFields当前值 + console.log(this.editFormFields) + //当前明细表的行 + console.log(this.$refs.detail.rowData) + return true; + }, + resetUpdateFormAfter() { //重置编辑表单后的内容 + //如果某些字段不需要重置,则可以重新赋值 + this.editFormFields.Remark = '编辑重置默认值66666'; + //给明细表添加默认一行 + this.$refs.detail.rowData.push({ Remark: "编辑666666" }); + return true; + }, + importAfter(data) { //导入excel后刷新table表格数据 + this.search(); //刷新table + }, + modelOpenBefore(row) { //点击编辑/新建按钮弹出框前,可以在此处写逻辑,如,从后台获取数据 + + }, + async modelOpenBeforeAsync(row) { //点击编辑/新建按钮弹出框前,可以在此处写逻辑,如,从后台获取数据 + //2021.01.10 + if (row) { + console.log("编辑操作") + } else { + console.log("新建操作") + } + //打开弹出框前,http请求同步执行 + // var _result = await this.http.post("url", {}, true).then(result => { + + // _result = result; + // }) + // console.log(result); + //返回false不会弹出框 + //this.$message.error("不能打开弹出框 "); + return true; + }, + getFormOption(field) { + let option; + this.editFormOptions.forEach(x => { + x.forEach(item => { + if (item.field == field) { + option = item; + } + }) + }) + return option; + }, + + //方式2,通过打开弹出框时触发显示与隐藏 + modelOpenAfter(row) { //编辑或新建时,根据不同的情况控制字段是否显示 + // this.editFormOptions.forEach(x => { + // x.forEach(item => { + // if (item.field == "Remark" || item.field == "SellNo") { + // //如果不是新建,则隐藏Remark,SellNo两个字段是否显示 + // //也可以根据row当前编辑行的值来处理 + // this.$set(item, "hidden", this.currentAction != "Add") + // } + // }) + // }) + }, + rowClick({ row, column, event }) { //查询界面table点击行选中当前行 + this.$refs.table.$refs.table.toggleRowSelection(row); + }, + // detailRowClick ({ row, column, event }) { + // //编辑弹出框从表table点击行选中当前行,没有从表的不用管 + // this.$refs.detail.$refs.table.toggleRowSelection(row); + // } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder2.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder2.js" new file mode 100644 index 000000000..8d6c1e4ec --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder2.js" @@ -0,0 +1,104 @@ +import gridFooter from "./SellOrder2/SellOrder2GridFooter.vue" + +//自定义从表选择数据源页面 +import modelBody from "./SellOrder2/SellOrder2ModelBody.vue" +import { h, resolveComponent } from 'vue'; +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '',//{ template: "
扩展组xx件
" }, + gridBody: { + render() { + return [ + h(resolveComponent('el-alert'), { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, type: 'success', + closable: false, title: '界面由代码生成器生成,只需几行代码即可实现点击主表行显示明细表数据(直接扩展gridFooter位置的代码,具体代码见此示例:SellOrder2.js)' + }, ''), + ] + } + }, + gridFooter: gridFooter, + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: "", + modelBody: modelBody,//自定义从表选择数据源页面 + modelFooter: "", + }, + text: "点击主表行加载明细表数据,如果本地看不到此菜单,可以按照演示环境配置下此页面菜单", + buttons: { //根据需要自行实现扩展按钮 + },//扩展的按钮 + methods: { + mounted() { + }, + //方式1,通过select选择触发显示与隐藏 + onInit() { + //点击单元格编辑与结束编辑(默认是点击单元格编辑,鼠标离开结束编辑) + this.detailOptions.clickEdit = true; + //设置主表合计 + this.summary = true; + }, + onInited() { + //调整界面table高度 + this.height = this.height - 310; + + //明细表选择数据源操作 + //获取明细表备注列,给备注列添加选择数据操作 + + this.detailOptions.buttons.unshift({ + 'name': '选择数据', + icon: "el-icon-plus", + onClick: () => { + this.$refs.modelBody.open(); + } + }) + // let _column = this.detailOptions.columns.find(x => { return x.field == "Remark" }); + // _column.title="(备注)点击选择数据" + // //移除编辑操作 + // _column.edit = null; + // //给备注列添加选择数据操作 + // _column.render = (h, { row, column, index }) => { + // return h("div", { style: {} }, + // [ + // h("i", { + // class: ["el-icon-zoom-out"], + // style: { + // cursor: "pointer", + // "margin-right": "8px", + // color: "#409eff", + // }, + // onClick: (e) => { + // e.stopPropagation(); + // //弹出选择数据源 + // this.$refs.modelBody.open(row); + // }, + // }), + // ], row.Remark) + // }; + }, + // rowDbClick({ row, column, event }){//双击事件 + // }, + rowClick({ row, column, event }) { //查询界面table点击行选中当前行 + //取消其他行选中 + this.$refs.table.$refs.table.clearSelection(); + //设置选中当前行 + this.$refs.table.$refs.table.toggleRowSelection(row); + if (this.$refs.gridFooter && this.$refs.gridFooter.$refs.tableList) { + //load方法可参照voltable组件api文档 + this.$refs.gridFooter.$refs.tableList.load({ value: row.Order_Id, sort: "CreateDate" }) + } + }, + searchAfter(rows) { + //页面加载或者刷新数据后直接显示第一行的明细 + if (rows.length) { + // this.$nextTick(() => { + this.$refs.gridFooter.$refs.tableList.load({ value: rows[0].Order_Id, sort: "CreateDate" }) + // }) + } else { + //没有数据时,清空明细数据 + this.$refs.gridFooter.$refs.tableList.rowData.splice(0) + } + return true; + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder2/SellOrder2GridFooter.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder2/SellOrder2GridFooter.vue" new file mode 100644 index 000000000..a53cb3c80 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder2/SellOrder2GridFooter.vue" @@ -0,0 +1,59 @@ + + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder2/SellOrder2ModelBody.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder2/SellOrder2ModelBody.vue" new file mode 100644 index 000000000..330a64a9e --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder2/SellOrder2ModelBody.vue" @@ -0,0 +1,113 @@ + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder3.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder3.js" new file mode 100644 index 000000000..b348fabea --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder3.js" @@ -0,0 +1,69 @@ + +import SellOrder3GridFooter from "./SellOrder3/SellOrder3GridFooter.vue" +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '',//{ template: "
扩展组xx件
" }, + gridBody:'', + gridFooter: SellOrder3GridFooter, //() => import("./SellOrder3/SellOrder3GridFooter.vue"), + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: "", + modelBody: '', + modelFooter: "", //() => import("./SellOrderComponents/ModelFooter.vue"), + }, + text: "用法与【主从一对一(2)】一致(见SellOrder3.js)", + buttons: { //根据需要自行实现扩展按钮 + },//扩展的按钮 + methods: { + mounted() { + }, + //方式1,通过select选择触发显示与隐藏 + onInit() { + //设置为单选,用于明细表加载数据时获取主表选行的id + this.single = true; + }, + onInited() { + this.height = this.height - 350; + }, + + rowClick({ row, column, event }) { //查询界面table点击行选中当前行 + this.$refs.table.$refs.table.toggleRowSelection(row); + if (this.$refs.gridFooter && this.$refs.gridFooter.$refs.tableList) { + //添加明细表的数据(触发明细表加载数据,见SellOrder3GridFooter方法loadBefore) + //load方法可参照voltable组件api文档 + this.$refs.gridFooter.$refs.tableList.load() + } + }, + searchAfter(rows) { + //页面加载或者刷新数据后直接显示第一行的明细 + if (rows.length) { + // this.$nextTick(() => { + this.$refs.gridFooter.$refs.tableList.load({ value: rows[0].Order_Id, sort: "CreateDate" }) + // }) + } else { + //没有数据时,清空明细数据 + this.$refs.gridFooter.$refs.tableList.rowData.splice(0) + } + return true; + }, + modelOpenAfter() { + //新建弹出框时,设置设置默认订单类型 + if (this.currentAction == "Add") { + this.editFormOptions.forEach(item => { + item.forEach(x => { + //如果是编辑帐号设置为只读 + if (x.field == "OrderType") { + //新建时默认选择中第一个下拉框的值,如果要选中其他的值,请遍历x.data获取key + /*注意:如果下拉框的数据源是自定义sql,并且key是数字,请将(x.data[0].key*1)转换成数字*/ + this.editFormFields.OrderType = x.data[0].key; + //可以指定其他input标签的默认值 + this.editFormFields.TranNo="8888" + } + }) + + }) + } + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder3/SellOrder3GridFooter.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder3/SellOrder3GridFooter.vue" new file mode 100644 index 000000000..ec38f3a42 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrder3/SellOrder3GridFooter.vue" @@ -0,0 +1,235 @@ + + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/GridBody.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/GridBody.vue" new file mode 100644 index 000000000..180762adb --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/GridBody.vue" @@ -0,0 +1,33 @@ + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/GridFooter.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/GridFooter.vue" new file mode 100644 index 000000000..c1c6b521b --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/GridFooter.vue" @@ -0,0 +1,20 @@ + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/GridHeader.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/GridHeader.vue" new file mode 100644 index 000000000..4d24067f4 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/GridHeader.vue" @@ -0,0 +1,86 @@ + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/ModelBody.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/ModelBody.vue" new file mode 100644 index 000000000..7e7269687 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/ModelBody.vue" @@ -0,0 +1,40 @@ + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/ModelFooter.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/ModelFooter.vue" new file mode 100644 index 000000000..96cc2e61b --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/SellOrderComponents/ModelFooter.vue" @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/vSellOrderImg.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/vSellOrderImg.js" new file mode 100644 index 000000000..5db7a37ac --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/vSellOrderImg.js" @@ -0,0 +1,76 @@ + +import { h, resolveComponent } from 'vue'; +import modelBody from "./vSellOrderImg/vSellOrderImgModelBody.vue" +let extension = { + components: {//动态扩充组件或组件路径 + gridHeader: '', + gridBody: { + render() { + return h(resolveComponent('el-alert'), { + type: "success", + style: { 'margin-bottom': '12px' }, + 'show-icon': false, + closable: false, + }, '点击新建、编辑弹出框,可以对明细表进行上传文件或者图片操作,见vSellOrderImg.js') + } + }, + gridFooter: '', + modelHeader: "", + //点击上传图片的弹出框 + modelBody: modelBody, + modelFooter: "", + }, + text: "一对一从表编辑上传图片", + methods: { + onInit() { + }, + onInited() { + this.height = this.height - 56; + //获取图片位置,在图片后面加一个上传按钮,这里只是演示随便找的一个字段存图片 + let _index = this.detailOptions.columns.findIndex(x => { return x.field == 'Remark' }); + + //这里只是演示,实际操作在代码生成器table显示类型设置为图片后这里就不用操作了 + //代码生成器中编辑行号设置为0,不要设置为大于0的数据 + this.detailOptions.columns[_index].edit = null; + this.detailOptions.columns[_index].type = 'img'; + this.detailOptions.columns[_index].title = '图片'; + + //从表动态添加一列(上传图片列),生成上传图片、与删除图片操作 + this.detailOptions.columns.splice(_index, 0, { + field: "随便写", + title: "上传图片", + width: 150, + align: "center", + render: (h, { row, column, index }) => { + //下面所有需要显示的信息都从row里面取出来 + return h( + "div", { style: { color: '#0c83ff', 'font-size': '13px', cursor: 'pointer' } }, + [ + h( + "i", { + style: { 'margin-right': '10px' }, + class:['el-icon-upload'], + onClick: (e) => { + e.stopPropagation(); + //记住当前操作的明细表行数据 + //如果原来有图片,上传图片界面把原来的图片也显示出来 + let fileInfo = (row.Remark || '').split(",").filter(x => { return x }).map(img => { + //(生成文件格式) fileInfo格式参数,见volupload组件 + return { path: img, name: "" }; + }) + this.$refs.modelBody.open(fileInfo, row) + } + }, [], '上传图片' + ), + h('i', { + class: ['el-icon-delete'], onClick: (e) => { + e.stopPropagation(); row.Remark = '' + } + }, '删除图片') + ]) + }, + }) + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/vSellOrderImg/vSellOrderImgModelBody.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/vSellOrderImg/vSellOrderImgModelBody.vue" new file mode 100644 index 000000000..acd16985c --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/order/vSellOrderImg/vSellOrderImgModelBody.vue" @@ -0,0 +1,72 @@ + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Dictionary.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Dictionary.js" new file mode 100644 index 000000000..22d104a30 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Dictionary.js" @@ -0,0 +1,75 @@ +import { h, resolveComponent } from 'vue'; +let extension = { + components: { //动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + //扩展组件引入方式 + gridHeader: '', + gridBody: { + render () { + return [ + h(resolveComponent('el-alert'), { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, type: 'error', + closable: false, title: '界面下拉框、多选、checkbox等数据源都在此处维护,也是代码生成器中的数据源' + }, ''), + ] + } + }, + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + buttons: [], //扩展的按钮 + methods: { //事件扩展 + onInit () { + //点击单元格编辑与结束编辑(默认是点击单元格编辑,鼠标离开结束编辑) + this.detailOptions.clickEdit = true; + this.editFormOptions.forEach(x => { + x.forEach(item => { + if (item.field == 'ParentId') { + item.min = 0; + } + if (item.field == "DbSql") { + item.placeholder = "如果从数据库加载数据源,请按此格式配置sql语句:select orderType as key,orderName as value from order 如果需要根据用户信息加载数据源,请配置好此sql,再修改后台DictionaryHandler.GetCustomDBSql方法"; + } + }) + }) + this.detailOptions.columns.forEach(x => { + if (x.field == 'OrderNo') { + x.summary = true; + } + }) + //保存后不关闭编辑框 + this.boxOptions.saveClose = false; + }, + onInited () { + this.boxOptions.height = document.body.clientHeight * 0.87 + this.height = this.height - 45; + }, + addBefore (formData) { + return this.saveBefore(formData); + }, + updateBefore (formData) { + return this.saveBefore(formData); + }, + saveBefore (formData) { + if (this.editFormFields.DbSql && + (this.editFormFields.DbSql.indexOf('value') == -1 || + this.editFormFields.DbSql.indexOf('key') == -1) + ) { + this.$message.error("sql语句必须包括key/value字段,如:select orderType as key,orderName as value from order"); + return false; + } + return true; + }, + searchBefore (param) { + return true; + }, + searchAfter (result) { + return true; + } + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_DictionaryList.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_DictionaryList.js" new file mode 100644 index 000000000..da944871b --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_DictionaryList.js" @@ -0,0 +1,22 @@ + + +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader:'', + gridbody:'', + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + buttons: [],//扩展的按钮 + methods: {//事件扩展 + onInit() { + }, + onInited() { + } + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Log.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Log.js" new file mode 100644 index 000000000..5b05c4076 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Log.js" @@ -0,0 +1,26 @@ +import { h, resolveComponent } from 'vue'; +let extension = { + components: { + //动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: "", //{ template: "
扩展组xx件
" }, + gridBody: '', + gridFooter: "", + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: "", + modelBody: "", + modelFooter: "" + }, + buttons: [], //扩展的按钮 + methods: { + //事件扩展 + onInit() { + console.log("sys_log") + this.setFiexdSearchForm(true); + }, + onInited() { + this.height = this.height - 170; + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Role.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Role.js" new file mode 100644 index 000000000..c404da619 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Role.js" @@ -0,0 +1,61 @@ + +import { h, resolveComponent } from 'vue'; +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '', + gridBody: { + render () { + return [ + h(resolveComponent('el-alert'), { + style: { 'margin-bottom': '12px' }, + 'show-icon': false, type: 'success', + closable: false, title: '关于TreeTable使用' + }, ' treetable同样全部代码自动生成,页面生成后设置this.rowKe="xxx" tree主键字段,即可完成树形table配置,具体说明见Sys_Role1.js'), + ] + } + }, + + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + buttons: [],//扩展的按钮 + tableAction:"Sys_Role", + methods: {//事件扩展 + onInited () { + this.height = this.height - 80; + this.editFormOptions.forEach(x => { + x.forEach(item => { + if (item.field == 'ParentId') { + item.title = "上级角色"; + //设置任意节点都能选中(默认只能选中最后一个节点) + item.changeOnSelect = true; + } + }) + }) + }, + onInit() { + //设置treetable的唯一值字段(这个字段的值在表里面必须是唯一的) + this.rowKey="Role_Id"; + }, + /***加载后台数据见Sys_RoleController.cs文件***/ + loadTreeChildren(tree, treeNode, resolve) { //加载子节点 + let url=`api/role/getTreeTableChildrenData?roleId=${tree.Role_Id}`; + this.http.post(url,{}).then(result=>{ + resolve(result.rows) + }) + }, + /***加载后台数据见Sys_RoleController.cs文件***/ + searchBefore(params){//判断加载根节点或子节点 + //没有查询条件,默认查询返回所有根节点数据 + if (!params.wheres.length) { + params.value=1; + } + return true; + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Role1.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Role1.js" new file mode 100644 index 000000000..d6715be6d --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_Role1.js" @@ -0,0 +1,61 @@ + +import { h, resolveComponent } from 'vue'; +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '', + gridBody: { + render () { + return [ + h(resolveComponent('el-alert'), { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, type: 'error', + closable: false, title: '关于TreeTable使用' + }, ' treetable同样全部代码自动生成,页面生成后设置this.rowKe="xxx" tree主键字段,即可完成树形table配置,具体说明见Sys_Role1.js'), + ] + } + }, + + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + buttons: [],//扩展的按钮 + tableAction:"Sys_Role", + methods: {//事件扩展 + onInited () { + this.height = this.height - 80; + this.editFormOptions.forEach(x => { + x.forEach(item => { + if (item.field == 'ParentId') { + item.title = "上级角色"; + //设置任意节点都能选中(默认只能选中最后一个节点) + item.changeOnSelect = true; + } + }) + }) + }, + onInit() { + //设置treetable的唯一值字段(这个字段的值在表里面必须是唯一的) + this.rowKey="Role_Id"; + }, + /***加载后台数据见Sys_RoleController.cs文件***/ + loadTreeChildren(tree, treeNode, resolve) { //加载子节点 + let url=`api/role/getTreeTableChildrenData?roleId=${tree.Role_Id}`; + this.http.post(url,{}).then(result=>{ + resolve(result.rows) + }) + }, + /***加载后台数据见Sys_RoleController.cs文件***/ + searchBefore(params){//判断加载根节点或子节点 + //没有查询条件,默认查询返回所有根节点数据 + if (!params.wheres.length) { + params.value=1; + } + return true; + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_User.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_User.js" new file mode 100644 index 000000000..4be71555d --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/Sys_User.js" @@ -0,0 +1,86 @@ +import { defineAsyncComponent } from "vue"; +let extension = { + components: { //动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: defineAsyncComponent(() => + import("./Sys_User/Sys_UserGridHeader.vue")), + gridBody: '', + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + text: "只能看到当前角色下的所有帐号", + buttons: [], //扩展的按钮 + methods: { //事件扩展 + onInit() { + this.boxOptions.height = 530; + this.columns.push({ + title: '操作', + hidden: false, + align: "center", + fixed: 'right', + width: 120, + render: (h, { row, column, index }) => { + return h( + "div", { style: { 'font-size': '13px', 'cursor': 'pointer', 'color': '#409eff' } }, [ + h( + "a", { + style: { 'margin-right': '15px' }, + onClick: (e) => { + e.stopPropagation() + this.$refs.gridHeader.open(row); + } + }, "修改密码" + ), + h( + "a", { + style: {}, + onClick: (e) => { + e.stopPropagation() + this.edit(row); + } + }, + "编辑" + ), + ]) + } + }) + }, + onInited() { }, + addAfter(result) { //用户新建后,显示随机生成的密码 + if (!result.status) { + return true; + } + //显示新建用户的密码 + //2020.08.28优化新建成后提示方式 + this.$confirm(result.message, '新建用户成功', { + confirmButtonText: '确定', + type: 'success', + center: true + }).then(() => { }) + + this.boxModel = false; + this.refresh(); + return false; + }, + modelOpenAfter() { + //点击弹出框后,如果是编辑状态,禁止编辑用户名,如果新建状态,将用户名字段设置为可编辑 + let isEDIT = this.currentAction == this.const.EDIT; + this.editFormOptions.forEach(item => { + item.forEach(x => { + if (x.field == "UserName") { + x.disabled=isEDIT; + } + }) + //不是新建,性别默认值设置为男 + if (!isEDIT) { + this.editFormFields.Gender = "0"; + } + }) + } + + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlow.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlow.js" new file mode 100644 index 000000000..391b94fa4 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlow.js" @@ -0,0 +1,91 @@ +/***************************************************************************************** + ** Author:jxx 2022 + ** QQ:283591387 + **完整文档见:http://v2.volcore.xyz/document/api 【代码生成页面ViewGrid】 + **常用示例见:http://v2.volcore.xyz/document/vueDev + **后台操作见:http://v2.volcore.xyz/document/netCoreDev + *****************************************************************************************/ +//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 +import gridHader from './Sys_WorkFlow/WorkFlowGridHeader.vue'; +import { h, resolveComponent } from 'vue'; +let extension = { + components: { + //查询界面扩展组件 + gridHeader: gridHader, + gridBody: { + render() { + return [ + h( + resolveComponent('el-alert'), + { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, + type: 'success', + closable: false, + title: '流程设计器根据easy-flow修改,表必须包括审批字段AuditStatus,具体见示例表SellOrder;后台startup需要注入审批流程' + }, + '' + ) + ]; + } + }, + gridFooter: '', + //新建、编辑弹出框扩展组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写) + buttons: { view: [], box: [], detail: [] }, //扩展的按钮 + methods: { + //下面这些方法可以保留也可以删除 + onInit() { + this.queryFields=['WorkTable','WorkName'] + //框架初始化配置前, + //示例:在按钮的最前面添加一个按钮 + // this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组 + // name: '按钮', //按钮名称 + // icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档) + // type: 'primary', //按钮样式vue2版本见iview文档button,vue3版本见element ui文档button + // onClick: function () { + // this.$Message.success('点击了按钮'); + // } + // }); + //示例:设置修改新建、编辑弹出框字段标签的长度 + // this.boxOptions.labelWidth = 150; + }, + onInited() { + this.height = this.height - 50; + //框架初始化配置后 + //如果要配置明细表,在此方法操作 + //this.detailOptions.columns.forEach(column=>{ }); + }, + searchBefore(param) { + //界面查询前,可以给param.wheres添加查询参数 + //返回false,则不会执行查询 + return true; + }, + searchAfter(result) { + //查询后,result返回的查询数据,可以在显示到表格前处理表格的值 + return true; + }, + addBefore(formData) { + //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值 + return true; + }, + updateBefore(formData) { + //编辑保存前formData为对象,包括明细表、删除行的Id + return true; + }, + rowClick({ row, column, event }) { + //查询界面点击行事件 + // this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行; + }, + async modelOpenBeforeAsync(row) { + //点击编辑/新建按钮弹出框前,可以在此处写逻辑,如,从后台获取数据 + this.$refs.gridHeader.open(row); + return false; + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlow/WorkFlowGridHeader.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlow/WorkFlowGridHeader.vue" index c64e2aff0..50c823790 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlow/WorkFlowGridHeader.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlow/WorkFlowGridHeader.vue" @@ -5,8 +5,8 @@
diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlowTable.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlowTable.js" new file mode 100644 index 000000000..3a3c9e622 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/flow/Sys_WorkFlowTable.js" @@ -0,0 +1,103 @@ +/***************************************************************************************** + ** Author:jxx 2022 + ** QQ:283591387 + **完整文档见:http://v2.volcore.xyz/document/api 【代码生成页面ViewGrid】 + **常用示例见:http://v2.volcore.xyz/document/vueDev + **后台操作见:http://v2.volcore.xyz/document/netCoreDev + *****************************************************************************************/ +//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 +import gridHeader from '@/components/basic/ViewGrid/ViewGridAudit.vue' +let extension = { + components: { + //查询界面扩展组件 + gridHeader: gridHeader, + gridBody: '', + gridFooter: '', + //新建、编辑弹出框扩展组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写) + buttons: { view: [], box: [], detail: [] }, //扩展的按钮 + methods: { + //下面这些方法可以保留也可以删除 + onInit() { + + //表格上添加自定义按钮 + this.columns.push({ + title: '操作', + field: '操作', + width: 120, + align: 'center', + render: (h, { row, column, index }) => { + return ( +
+ { + this.$refs.gridHeader.open([row],true); + }} + type="primary" + plain + size="small" + style="height:26px; padding: 10px !important;" + > + 审核 + + { + this.$tabs.open({ + text: row.WorkTableName || row.WorkName, + path: '/' + row.WorkTable, + query: { id: row.WorkTableKey, viewflow: 1 } + }); + }} + type="default" + plain + size="small" + style="height:26px; padding: 10px !important;" + > + 查看 + +
+ ) + } + }); + }, + onInited() { + //框架初始化配置后 + //如果要配置明细表,在此方法操作 + //this.detailOptions.columns.forEach(column=>{ }); + }, + searchBefore(param) { + //界面查询前,可以给param.wheres添加查询参数 + //返回false,则不会执行查询 + return true; + }, + searchAfter(result) { + //查询后,result返回的查询数据,可以在显示到表格前处理表格的值 + return true; + }, + addBefore(formData) { + //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值 + return true; + }, + updateBefore(formData) { + //编辑保存前formData为对象,包括明细表、删除行的Id + return true; + }, + rowClick({ row, column, event }) { + //查询界面点击行事件 + // this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行; + }, + modelOpenAfter(row) { + //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据 + //(1)判断是编辑还是新建操作: this.currentAction=='Add'; + //(2)给弹出框设置默认值 + //(3)this.editFormFields.字段='xxx'; + //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值 + //看不懂就把输出看:console.log(this.editFormOptions) + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/form/FormCollectionObject.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/form/FormCollectionObject.js" new file mode 100644 index 000000000..f2a014804 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/form/FormCollectionObject.js" @@ -0,0 +1,74 @@ +//author:jxx +//此处是对表单的方法,组件,权限操作按钮等进行任意扩展(方法扩展可参照SellOrder.js) +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '',//{ template: "
扩展组xx件
" }, + gridBody: '', + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + text: "点击左侧表单名名字即可加载收集的数据", + tableAction: "formCollectionResultTree", + buttons: { view: [], box: [], detail: [] },//扩展的按钮 + methods: {//事件扩展 + onInit() { + this.textInline = false; + // this.ck = false; + this.load = false; + this.setFiexdSearchForm(true); + + }, + onInited() { + this.height = this.height - 74; + }, + loadById(item) { + let columns = [ + { + title: "提交人", + field: "Creator" + }, + { + title: "提交时间", + field: "CreateDate" + }]; + JSON.parse(item.formOptions).formOptions.forEach(x => { + columns.push(...x.map(m => { + return { + title: m.title, + field: m.field, + type: m.type + } + })) + }) + this.formId = item.formId; + this.columns.splice(0); + this.columns.push(...columns); + this.search(); + }, + exportBefore(formData) { + formData.Value = this.formId; + return true; + }, + searchBefore(formData) { + // formData.Value = this.formId; + formData.wheres.push({name:'FormId',value:this.formId}) + return true; + }, + searchAfter(rows) { + rows.forEach(row => { + if (row.FormData) { + let data = JSON.parse(row.FormData); + for (const key in data) { + row[key] = Array.isArray(data[key]) ? data[key].filter(x => { return x != null && x != undefined }).join(',') : data[key]; + } + } + }) + return true; + } + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/form/FormDesignOptions.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/form/FormDesignOptions.js" new file mode 100644 index 000000000..a35b606f4 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/form/FormDesignOptions.js" @@ -0,0 +1,68 @@ +//author:jxx +//此处是对表单的方法,组件,权限操作按钮等进行任意扩展(方法扩展可参照SellOrder.js) +import gridHeader from './FormCollectionOptionsGridHeader.vue' +import { h, resolveComponent } from 'vue'; +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader:gridHeader,//{ template: "
扩展组xx件
" }, + gridBody: { + render() { + return [ + h(resolveComponent('el-alert'), { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, type: 'success', + closable: false, title: '1、点击新建随便输入,2、点击表格[表单设计]然后保存,3、点击预览(页面打开后提交数据),4、数据采集页面看查结果' + }, ''), + ] + } + }, + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + buttons: {view: [], box:[], detail:[]},//扩展的按钮 + methods: {//事件扩展 + onInit() { + this.boxOptions.height=200; + this.initFormButton(); + }, + onInited(){ + this.height= this.height-40; + }, + initFormButton() { + this.columns.splice(this.columns.findIndex(x => { return x.field == 'FormFields' }), 1, ...[{ + title: "操作", + field: "表单设计", + with: 80, + sort: false, + formatter: () => { + return '表单设计' + }, + click: (row) => { + this.$refs.gridHeader.open(row); + } + }, + { + title: "预览", + field: "预览", + with: 85, + sort: false, + formatter: () => { + return '预览' + }, + click: (row) => { + this.$tabs.open({ + path: "/formSubmit", text: row.Title, query: { + id: row.FormId + } + }) + // this.$refs.gridHeader.open(row); + } + }]) + } + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzLog.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzLog.js" new file mode 100644 index 000000000..9bea996c5 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzLog.js" @@ -0,0 +1,84 @@ +/***************************************************************************************** + ** Author:jxx 2022 + ** QQ:283591387 + **完整文档见:http://v2.volcore.xyz/document/api 【代码生成页面ViewGrid】 + **常用示例见:http://v2.volcore.xyz/document/vueDev + **后台操作见:http://v2.volcore.xyz/document/netCoreDev + *****************************************************************************************/ +//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 + +let extension = { + components: { + //查询界面扩展组件 + gridHeader: '', + gridBody: '', + gridFooter: '', + //新建、编辑弹出框扩展组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + tableAction: 'Sys_QuartzLog', //指定某张表的权限(这里填写表名,默认不用填写) + buttons: { view: [], box: [], detail: [] }, //扩展的按钮 + methods: { + //下面这些方法可以保留也可以删除 + onInit() { + //框架初始化配置前, + //示例:在按钮的最前面添加一个按钮 + // this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组 + // name: '按钮', //按钮名称 + // icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档) + // type: 'primary', //按钮样式vue2版本见iview文档button,vue3版本见element ui文档button + // onClick: function () { + // this.$Message.success('点击了按钮'); + // } + // }); + if (this.$route.path != '/Sys_QuartzLog') { + this.tableHeight = 345; + } + //示例:设置修改新建、编辑弹出框字段标签的长度 + // this.boxOptions.labelWidth = 150; + }, + onInited() { + //框架初始化配置后 + //如果要配置明细表,在此方法操作 + //this.detailOptions.columns.forEach(column=>{ }); + }, + searchBefore(param) { + //界面查询前,可以给param.wheres添加查询参数 + //返回false,则不会执行查询 + if (this.$route.path != '/Sys_QuartzLog') { + param.wheres.push({ + name: 'Id', + value: this.$store.getters.data().quartzId + }); + } + return true; + }, + searchAfter(result) { + //查询后,result返回的查询数据,可以在显示到表格前处理表格的值 + return true; + }, + addBefore(formData) { + //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值 + return true; + }, + updateBefore(formData) { + //编辑保存前formData为对象,包括明细表、删除行的Id + return true; + }, + rowClick({ row, column, event }) { + //查询界面点击行事件 + // this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行; + }, + modelOpenAfter(row) { + //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据 + //(1)判断是编辑还是新建操作: this.currentAction=='Add'; + //(2)给弹出框设置默认值 + //(3)this.editFormFields.字段='xxx'; + //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值 + //看不懂就把输出看:console.log(this.editFormOptions) + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzOptions.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzOptions.js" new file mode 100644 index 000000000..4915c5709 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzOptions.js" @@ -0,0 +1,158 @@ + +//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 +import gridBody from './Sys_QuartzOptionsGridBody'; +let extension = { + components: { + //查询界面扩展组件 + gridHeader: '', + gridBody: gridBody, + gridFooter: '', + //新建、编辑弹出框扩展组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写) + buttons: { view: [], box: [], detail: [] }, //扩展的按钮 + methods: { + //下面这些方法可以保留也可以删除 + onInit() { + this.textInline = false; + this.columns.push({ + field: '操作', + title: '操作', + width: 180, + fixed: 'right', + align: 'center', + render: (h, { row, column, index }) => { + return ( +
+ { + this.edit(row); + }} + type="text" + > + 编辑 + + { + this.request('Run', row, 'once'); + }} + type="text" + > + 执行一次 + + { + if (row.Status == 1) { + //开启任务 + this.request('start', row); + } else { + this.request('pause', row); + } + }} + type="text" + > + {row.Status == 1 ? '恢复' : '暂停'} + + { + this.$store.getters.data().quartzId = row.Id; + this.$refs.gridBody.open(); + }} + type="text" + > + 日志 + +
+ ); + } + }); + //示例:设置修改新建、编辑弹出框字段标签的长度 + // this.boxOptions.labelWidth = 150; + }, + request(action, row,val) { + let url = `api/Sys_QuartzOptions/${action}?val=${val}`; + this.http.post(url, row, true).then((result) => { + this.$message.success('执行成功'); + this.search(); + }); + }, + onInited() { + this.height = this.height - 50; + this.columns.forEach((col) => { + if (col.field == 'Status') { + col.align = 'center'; + col.formatter = (row) => { + // return row.Status; + if (row.Status == 1) { + return '暂停'; + } + return '正常'; + }; + } + }); + //框架初始化配置后 + //如果要配置明细表,在此方法操作 + //this.detailOptions.columns.forEach(column=>{ }); + this.editFormOptions.forEach((options) => { + options.forEach((option) => { + if (option.field == 'CronExpression') { + option.extra = { + style: 'color: #0e84ff;cursor: pointer;', + text: '查看', + click: () => { + window.open('https://cron.qqe2.com/', '_blank'); + } + }; + }else if(option.field=='PostData'){ + option.placeholder=`post参数格式如:{name:"1",value:"2"}`; + } + }); + }); + }, + searchBefore(param) { + //界面查询前,可以给param.wheres添加查询参数 + //返回false,则不会执行查询 + return true; + }, + searchAfter(result) { + //查询后,result返回的查询数据,可以在显示到表格前处理表格的值 + return true; + }, + addBefore(formData) { + //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值 + return true; + }, + updateBefore(formData) { + //编辑保存前formData为对象,包括明细表、删除行的Id + return true; + }, + rowClick({ row, column, event }) { + //查询界面点击行事件 + // this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行; + }, + modelOpenAfter(row) { + if (this.currentAction == 'Add' || !this.editFormFields.TimeOut) { + this.editFormFields.TimeOut = 180; + } + this.editFormOptions.forEach((options) => { + options.forEach((option) => { + if (option.field == 'GroupName') { + option.readonly = this.currentAction != 'Add'; + } + }); + }); + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzOptionsGridBody.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzOptionsGridBody.vue" index 099b766b3..04106ae9f 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzOptionsGridBody.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/extension/system/quartz/Sys_QuartzOptionsGridBody.vue" @@ -10,7 +10,7 @@ { + if (x.value == 'Update') { + x.hidden = true; + hasUpdate = true; + } else if (x.value == 'Delete') { + hasDel = true; + x.hidden = true; //隐藏按钮 + } else if (x.value == 'Add') { + x.type = 'primary'; + hasAdd = true; + } + }); + if (!(hasUpdate || hasDel || hasAdd)) { + return; + } + this.columns.push({ + title: '操作', + field: '操作', + width: 100, + fixed: 'right', + align: 'center', + render: (h, { row, column, index }) => { + return ( +
+ {hasAdd ? ( + { + this.addBtnClick(row); + }} + type="primary" + link + icon="Plus" + > + ) : ( + '' + )} + {hasUpdate ? ( + { + this.edit(row); + }} + type="success" + link + icon="Edit" + > + ) : ( + '' + )} + {hasDel ? ( + { + this.del(row); + }} + type="danger" + icon="Delete" + > + ) : ( + '' + )} +
+ ); + } + }); + }, + addBtnClick(row) { + //这里是动态addCurrnetRow属性记录当前点击的行数据,下面modelOpenAfter设置默认值 + this.addCurrnetRow = row; + this.add(); + }, + addAfter() { + //添加后刷新字典 + this.initDicKeys(); + return true; + }, + updateAfter() { + this.initDicKeys(); + return true; + }, + delAfter(result) { + //查询界面的表删除后 + this.initDicKeys(); + return true; + }, + modelOpenAfter(row) { + //点击行上的添加按钮事件 + if (this.addCurrnetRow) { + //获取当前组织构架的所有父级id,用于设置新建时父级id的默认值 + + //获取数据数据源 + let data = []; + this.editFormOptions.forEach((options) => { + options.forEach((option) => { + if (option.field == 'ParentId') { + data = option.orginData; + } + }); + }); + let parentIds = this.base + .getTreeAllParent(this.addCurrnetRow.DepartmentId, data) + .map((x) => { + return x.id; + }); + //设置编辑表单上级组织的默认值 + this.editFormFields.ParentId = parentIds; + this.addCurrnetRow = null; + } + } + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/main.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/main.js" index 40bee97a5..7b4f472ad 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/main.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/main.js" @@ -17,48 +17,50 @@ import permission from './api/permission' import viewgird from './components/basic/ViewGrid' const app = createApp(App) for (const [key, component] of Object.entries(ElementPlusIconsVue)) { - app.component(key, component) + app.component(key, component) } app.config.globalProperties.base = base app.config.globalProperties.http = http app.config.globalProperties.$tabs = {} app.config.globalProperties.permission = permission app.config.globalProperties.$global = { - signalR: false, //是否开启signalR - menuSearch: true, //菜单是否启用搜索功能 - table: { - smallCell: false, //表格单元格大小 - useTag: true //table组件下拉框数据源的字段是否显示背景颜色 - }, - audit: { - //审核选项 - data: [ - { text: '通过', value: 1 }, - { text: '拒绝', value: 3 }, - { text: '驳回', value: 4 } - ], - status: [0, 2] //审核中的数据 - // 待审核 = 0, - // 审核通过 = 1, - // 审核中 = 2, - // 审核未通过 = 3, - // 驳回 = 4 - } + signalR: false, //是否开启signalR + menuSearch:true,//菜单是否启用搜索功能 + table: { + smallCell:false,//表格单元格大小 + useTag: true //table组件下拉框数据源的字段是否显示背景颜色 + }, + audit: { //审核选项 + data: [ + { text: '通过', value: 1 }, + { text: '拒绝', value: 3 }, + { text: '驳回', value: 4 } + ], + status:[0,2] //审核中的数据 + // 待审核 = 0, + // 审核通过 = 1, + // 审核中 = 2, + // 审核未通过 = 3, + // 驳回 = 4 + } } //2023.03.13, //修改见:volupload.vue,后台AliOSSController.cs,阿里云OSS配置.doc window.oss = { - ali: { - //阿里云 - use: false, //使用阿里云上传文件 - //阿里缩略图压缩大小 - //.aliyuncs.com - small: '?x-oss-process=image/resize,m_lfit,w_200' - // 填写oss所配置的cdn域名 - //cdn: "https://static.xxx.com" - } + ali: { //阿里云 + use: false,//使用阿里云上传文件 + //阿里缩略图压缩大小 + //.aliyuncs.com + small: "?x-oss-process=image/resize,m_lfit,w_200", + // 填写oss所配置的cdn域名 + //cdn: "https://static.xxx.com" + } } -app.use(store).use(ElementPlus, { size: 'default' }).use(router).use(viewgird).mount('#app') +app.use(store) + .use(ElementPlus, { size: 'default' }) + .use(router) + .use(viewgird) + .mount('#app'); app.config.globalProperties.$Message = app.config.globalProperties.$message app.directive('fallback', { mounted(el) { diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/form.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/form.js" index d8ac84371..6c74a532d 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/form.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/form.js" @@ -1,5 +1,69 @@ let form = [ - + { + path: '/form1', + name: 'form1', + component: () => import('@/views/forms/form1.vue') + }, + { + path: '/form2', + name: 'form2', + component: () => import('@/views/forms/form2.vue') + }, + { + path: '/form3', + name: 'form3', + component: () => import('@/views/forms/form3.vue') + }, + { + path: '/form4', + name: 'form4', + component: () => import('@/views/forms/form4.vue') + },{ + path: '/form6', + name: 'form6', + component: () => import('@/views/forms/form6.vue') + }, + { + path: '/form7', + name: 'form7', + component: () => import('@/views/forms/form7.vue') + },{ + path: '/kindEditor', + name: 'kindEditor', + component: () => import('@/views/html/Editor.vue'), + meta: { + keepAlive: false + } + }, { + path: '/htmlList', + name: 'htmlList', + component: () => import('@/views/html/List.vue') + }, { + path: '/validator', + name: 'validator', + component: () => import('@/views/forms/objectValidator.vue') + }, { + path: '/volUploadExample', + name: 'volUploadExample', + component: () => import('@/views/upload/volUploadExample.vue') + }, { + path: '/formUpload', + name: 'formUpload', + component: () => import('@/views/upload/formUpload.vue') + }, { + path: '/treetable1', + name: 'treetable1', + component: () => import('@/views/treeTable/TreeTable1.vue') + }, { + path: '/treetable2', + name: 'treetable2', + component: () => import('@/views/treeTable/TreeTable2.vue') + } + , { + path: '/treetable3', + name: 'treetable3', + component: () => import('@/views/treeTable/TreeTable3.vue') + } ] export default form diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/formsMulti.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/formsMulti.js" index 6ea15a0ee..4a40f8174 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/formsMulti.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/formsMulti.js" @@ -1,4 +1,18 @@ let formsMulti=[ -] + { + path: '/multi1', + name: 'multi1', + component: () => import('@/views/formsMulti/multi1.vue') + }, + { + path: '/multi2', + name: 'multi2', + component: () => import('@/views/formsMulti/multi2.vue') + }, + { + path: '/multi3', + name: 'multi3', + component: () => import('@/views/formsMulti/multi3.vue') + }] export default formsMulti \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/index.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/index.js" index 6e44e6425..4b984ac9d 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/index.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/index.js" @@ -126,7 +126,7 @@ router.onError((error) => { try { console.log(error.message); if (process.env.NODE_ENV == 'development') { - // alert(error.message) + alert(error.message) } localStorage.setItem("route_error", error.message) } catch (e) { diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/tables.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/tables.js" index 676da032d..3edee3dfc 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/tables.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/tables.js" @@ -1,5 +1,24 @@ let tables = [ - + { + path: '/table1', + name: 'table1', + component: () => import('@/views/tables/table1.vue') + }, + { + path: '/table2', + name: 'table2', + component: () => import('@/views/tables/table2.vue') + }, + { + path: '/table3', + name: 'table3', + component: () => import('@/views/tables/table3.vue') + }, + { + path: '/tabsTable',//多页签 + name: 'tabsTable', + component: () => import('@/views/tables/tabsTable.vue') + } ] export default tables; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/viewGird.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/viewGird.js" index d6c5d4f8d..a047b9018 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/viewGird.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/router/viewGird.js" @@ -3,67 +3,132 @@ let viewgird = [ { path: '/Sys_Log', name: 'sys_Log', - component: () => import('@/views/system/Sys_Log.vue') + component: () => import('@/views/system/Sys_Log.vue' ) }, { path: '/Sys_User', name: 'Sys_User', - component: () => import('@/views/system/Sys_User.vue') + component: () => import('@/views/system/Sys_User.vue' ) }, { path: '/permission', name: 'permission', - component: () => import('@/views/system/Permission.vue') + component: () => import('@/views/system/Permission.vue' ) }, - + { path: '/Sys_Dictionary', name: 'Sys_Dictionary', - component: () => import('@/views/system/Sys_Dictionary.vue') + component: () => import('@/views/system/Sys_Dictionary.vue' ) }, { path: '/Sys_Role', name: 'Sys_Role', - component: () => import('@/views/system/Sys_Role.vue') - }, - // { - // path: '/Sys_Role1', - // name: 'Sys_Role1', - // component: () => import('@/views/system/Sys_Role1.vue') - // } - // , - { + component: () => import('@/views/system/Sys_Role.vue' ) + }, { + path: '/Sys_Role1', + name: 'Sys_Role1', + component: () => import('@/views/system/Sys_Role1.vue' ) + } + , { path: '/Sys_DictionaryList', name: 'Sys_DictionaryList', - component: () => import('@/views/system/Sys_DictionaryList.vue') - }, { - path: '/FormDesignOptions', - name: 'FormDesignOptions', - component: () => import('@/views/system/form/FormDesignOptions.vue') + component: () => import('@/views/system/Sys_DictionaryList.vue' ) + } + , { + path: '/SellOrder', + name: 'SellOrder', + component: () => import('@/views/order/SellOrder.vue' ) }, { - path: '/FormCollectionObject', - name: 'FormCollectionObject', - component: () => import('@/views/system/form/FormCollectionObject.vue') + path: '/SellOrder2', + name: 'SellOrder2', + component: () => import('@/views/order/SellOrder2.vue' ) }, { - path: '/Sys_WorkFlow', - name: 'Sys_WorkFlow', - component: () => import('@/views/system/flow/Sys_WorkFlow.vue') + path: '/SellOrder3', + name: 'SellOrder3', + component: () => import('@/views/order/SellOrder3.vue' ) }, { - path: '/Sys_WorkFlowTable', - name: 'Sys_WorkFlowTable', - component: () => import('@/views/system/flow/Sys_WorkFlowTable.vue') + path: '/vSellOrderImg', + name: 'vSellOrderImg', + component: () => import('@/views/order/vSellOrderImg.vue' ) + }, + { + path: '/App_Appointment', + name: 'App_Appointment', + component: () => import('@/views/order/App_Appointment.vue' ) + }, + { + path: '/App_Appointment2', //二级表头 + name: 'App_Appointment2', + component: () => import('@/views/order/App_Appointment2.vue' ) + }, + { + path: '/App_TransactionAvgPrice', + name: 'App_TransactionAvgPrice', + component: () => import('@/views/appmanager/App_TransactionAvgPrice.vue' ), + meta: { + keepAlive: false + } + } + , { + path: '/App_Expert', + name: 'App_Expert', + component: () => import('@/views/appmanager/App_Expert.vue' ) + } + , { + path: '/App_Expert2', + name: 'App_Expert2', + component: () => import('@/views/appmanager/App_Expert2.vue' ) + } + , { + path: '/App_Transaction', + name: 'App_Transaction', + component: () => import('@/views/appmanager/App_Transaction.vue' ) + } + , { + path: '/App_Transaction2', + name: 'App_Transaction2', + component: () => import('@/views/appmanager/App_Transaction2.vue' ) }, { - path: '/Sys_QuartzOptions', - name: 'Sys_QuartzOptions', - component: () => import('@/views/system/quartz/Sys_QuartzOptions.vue') + path: '/App_ReportPrice', + name: 'App_ReportPrice', + component: () => import('@/views/appmanager/App_ReportPrice.vue' ) }, { - path: '/Sys_QuartzLog', - name: 'Sys_QuartzLog', - component: () => import('@/views/system/quartz/Sys_QuartzLog.vue') + path: '/App_News', + name: 'App_News', + component: () => import('@/views/appmanager/App_News.vue' ) }, { - path: '/Sys_Department', - name: 'Sys_Department', - component: () => import('@/views/system/system/Sys_Department.vue') - }] + path: '/App_NewsEditor', + name: 'App_NewsEditor', + component: () => import('@/views/appmanager/App_NewsEditor.vue' ) + } ,{ + path: '/FormDesignOptions', + name: 'FormDesignOptions', + component: () => import('@/views/system/form/FormDesignOptions.vue') + } ,{ + path: '/FormCollectionObject', + name: 'FormCollectionObject', + component: () => import('@/views/system/form/FormCollectionObject.vue') + } ,{ + path: '/Sys_WorkFlow', + name: 'Sys_WorkFlow', + component: () => import('@/views/system/flow/Sys_WorkFlow.vue') + } ,{ + path: '/Sys_WorkFlowTable', + name: 'Sys_WorkFlowTable', + component: () => import('@/views/system/flow/Sys_WorkFlowTable.vue') + } ,{ + path: '/Sys_QuartzOptions', + name: 'Sys_QuartzOptions', + component: () => import('@/views/system/quartz/Sys_QuartzOptions.vue') + } ,{ + path: '/Sys_QuartzLog', + name: 'Sys_QuartzLog', + component: () => import('@/views/system/quartz/Sys_QuartzLog.vue') + } ,{ + path: '/Sys_Department', + name: 'Sys_Department', + component: () => import('@/views/system/system/Sys_Department.vue') + }] export default viewgird diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/store/index.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/store/index.js" index 12310ad68..ff309abf7 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/store/index.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/store/index.js" @@ -5,7 +5,7 @@ function getUserInfo(state) { let userInfo = localStorage.getItem(keys.USER); if (userInfo) { try{ - state.userInfo = JSON.parse(userInfo); + state.userInfo = JSON.parse(userInfo); }catch{ } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/uitils/common.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/uitils/common.js" index a00c8e2d5..59b80a6aa 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/uitils/common.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/uitils/common.js" @@ -249,14 +249,15 @@ let base = { if (!(data instanceof Array)) { return nodes; } - + if (data.length>100) { + data = JSON.parse(JSON.stringify(data)); + } data.forEach((x) => { if (x.id === x.parentId) { x.parentId = 0; - } - // else if (data.some((c) => c.parentId === x.id && c.id === x.parentId)) { - // x.parentId = 0; - // } + } else if (data.some((c) => c.parentId === x.id && c.id === x.parentId)) { + x.parentId = 0; + } }); var _child = data.find((x) => { @@ -289,7 +290,9 @@ let base = { if (!(data instanceof Array)) { return nodes; } - + if (data.length>100) { + data = JSON.parse(JSON.stringify(data)); + } var _child = data.find((x) => { return x.id === id; }); @@ -336,4 +339,4 @@ function getTree(id, node, data, callback, treeIds,idField,parentField) { getTree(x[idField], x, data, callback, treeIds,idField,parentField); } }); -} +} \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/uitils/translator/index.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/uitils/translator/index.js" index 531f1fea2..32e72a4ed 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/uitils/translator/index.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/uitils/translator/index.js" @@ -73,7 +73,7 @@ function $changeSource(langType, isInit, source) { app.config.globalProperties.isCN = _currentLang == 'zh-cn'; //store.commit("setLocal", source); } -import http from "@/../src/api/http.js"; +import http from "@/api/http.js"; function loadLangScript () { if (_currentLang== 'zh-cn') { diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Home.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Home.vue" index 7def9b56f..d3d6acc59 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Home.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Home.vue" @@ -4,9 +4,18 @@
left
-
- +
+
{{ item.title }}
@@ -36,8 +45,14 @@
-
-
+
+
diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Index.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Index.vue" index 6f3c6a51a..37fbd303a 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Index.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Index.vue" @@ -203,7 +203,7 @@ import { } from "vue"; import { useRouter, useRoute } from "vue-router"; import store from "../store/index"; -import http from "@/../src/api/http.js"; +import http from "@/api/http.js"; export default defineComponent({ components: { VolMenu, diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Login.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Login.vue" index d1bff1f64..5b590a175 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Login.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/Login.vue" @@ -24,7 +24,7 @@
- +
@@ -89,7 +89,7 @@ import { } from 'vue'; import { useRouter, useRoute } from 'vue-router'; import store from '../store/index'; -import http from '@/../src/api/http.js'; +import http from '@/api/http.js'; export default defineComponent({ setup(props, context) { store.commit('clearUserInfo', ''); diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Expert.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Expert.vue" new file mode 100644 index 000000000..19411e989 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Expert.vue" @@ -0,0 +1,85 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Expert2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Expert2.vue" new file mode 100644 index 000000000..3e652cc49 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Expert2.vue" @@ -0,0 +1,81 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_News.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_News.vue" new file mode 100644 index 000000000..1e7cbdf9e --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_News.vue" @@ -0,0 +1,77 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_NewsEditor.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_NewsEditor.vue" new file mode 100644 index 000000000..8ee4b25fa --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_NewsEditor.vue" @@ -0,0 +1,77 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_ReportPrice.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_ReportPrice.vue" new file mode 100644 index 000000000..23cdcfa24 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_ReportPrice.vue" @@ -0,0 +1,78 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Transaction.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Transaction.vue" new file mode 100644 index 000000000..562ac63f0 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Transaction.vue" @@ -0,0 +1,73 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Transaction2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Transaction2.vue" new file mode 100644 index 000000000..306dd81f5 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_Transaction2.vue" @@ -0,0 +1,66 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_TransactionAvgPrice.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_TransactionAvgPrice.vue" new file mode 100644 index 000000000..11a0f0602 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/appmanager/App_TransactionAvgPrice.vue" @@ -0,0 +1,78 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/builder/builderData.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/builder/builderData.js" new file mode 100644 index 000000000..9437d78de --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/builder/builderData.js" @@ -0,0 +1,206 @@ +let columnType = [{ "key": 1, "value": "img" }, +{ "key": 2, "value": "excel" }, +{ "key": 3, "value": "file" }, +//2021.07.27增加table列显示类型date(自动格式化) +{ "key": 4, "value": "date" } +] + +let dataType = [ + { "key": "text", "value": "input" }, + { "key": "textarea", "value": "textarea" }, + { "key": "switch", "value": "switch" }, + // { "key": "dropList", "value": "dropList" }, + { "key": "select", "value": "select" }, + { "key": "selectList", "value": "select多选" }, + { "key": "date", "value": "date" }, + { "key": "datetime", "value": "datetime" }, + { "key": "month", "value": "年月" }, + { "key": "rate", "value": "rate评分" }, + { "key": "time", "value": "time" }, + { "key": "checkbox", "value": "checkbox多选" }, + { "key": "password", "value": "密码输入框" }, + // 2021.05.16集成iview radio组件 + { "key": "radio", "value": "radio单选" }, + { "key": "cascader", "value": "级联" },//2020.11.01增加级联选择 + { "key": "treeSelect", "value": "树形级联(多选)tree-select" },//2020.11.01增加级联选择 + { "key": "editor", "value": "富文本编辑器" }, + { "key": "mail", "value": "mail" }, + { "key": "number", "value": "number" }, + { "key": "decimal", "value": "decimal" }, + { "key": "phone", "value": "phone" }, + { "key": "img", "value": "img" }, + { "key": "excel", "value": "excel" }, + { "key": "file", "value": "file" } +]; + +let searchDataType = [ + { "key": "text", "value": "input" }, + { "key": "like", "value": "模糊查询" }, + { "key": "textarea", "value": "textarea" }, + { "key": "switch", "value": "switch" }, + { "key": "select", "value": "select" }, + { "key": "selectList", "value": "select多选" }, + { "key": "date", "value": "date" }, + { "key": "datetime", "value": "datetime" }, + { "key": "month", "value": "年月" }, + { "key": "time", "value": "time" }, + { "key": "cascader", "value": "级联" },//2020.11.01增加级联选择 + { "key": "checkbox", "value": "checkbox" }, + // 2021.05.16集成iview radio组件 + { "key": "radio", "value": "radio" }, + { "key": "range", "value": "区间查询" }, + { "key": "mail", "value": "mail" }, + { "key": "number", "value": "number" }, + { "key": "decimal", "value": "decimal" }, + { "key": "phone", "value": "phone" } +]; +let data = { + form: { + fields: { + table_Id: '', + parentId: null, + namespace: '', + columnCNName: '', + tableName: '', + tableTrueName: '', + folderName: '', + detailCnName: '', + detailName: '', + expressField: '', + sortName: '', + richtitle: '', + uploadField: '', + uploadMaxCount: '', + enable: 0, + vuePath: '', + appPath: "", + userPermissionDesc: '开启后当前用户只能操作自己(与下级角色)创建的数据,如:查询、删除、修改等操作' + }, + addOptions: [ + [{ "title": "父 级 ID", min: 0, "field": "parentId", "required": true, type: 'number', placeholder: '放在【代码生成配置】列表的文件夹ID下,如果填入【0】就是一级目录' }], + [{ + "title": "项目类库", + "field": "namespace", + "placeholder": "代码生成后的所在类库(可以自己提前在后台项目中创建一个.netcore类库)", + "type": "select", + "required": true, + data: [] + }], + [{ "title": "表中文名", "field": "columnCNName", "required": true, placeholder: "表对应的中文名字,界面上显示会用到" }], + [{ "title": "实际表名", "field": "tableName", "required": true, placeholder: "数据库实际表名或者视图名(多表关联请创建视图再生成代码)" }], + [{ "title": "文件夹名", placeholder: "生成文件所在类库中的文件夹名(文件夹可以不存在);注意只需要填写文件夹名,不是路径", "field": "folderName", "required": true }] + ], + options: [ + [ + { "title": "主 键 ID", "field": "table_Id", "dataSource": [], readonly: true, disabled: true, columnType: 'int' }, + { "title": "父 级 ID", "field": "parentId", min: 0, "required": true, type: 'number' }, + { + "title": "项目类库", + "placeholder": "代码生成存放的位置", + "field": "namespace", + "type": "select", + "required": true, + data: [] + } + ], + [ + { "title": "表中文名", "field": "columnCNName", "dataSource": [], "required": true }, + { "title": "表 别 名", placeholder: "默认与实际表名相同", "field": "tableName", "required": true }, + { "title": "实际表名", "field": "tableTrueName" }, + + ], + [ + { "title": "文件夹名", placeholder: "生成文件所在类库中的文件夹名(文件夹可以不存在)", "field": "folderName", "required": true }, + { "title": "明细表名", "field": "detailCnName", placeholder: "明细表中文名字" }, + { "title": "明 细 表", "field": "detailName", placeholder: "数据库的表名" }, + + ], + [ + { "title": "快捷编辑", "field": "expressField", placeholder: "快捷编辑字段" }, + { "title": "排序字段", "field": "sortName", "placeholder": "多个排序字段逗号隔开(默认降序排序),如:Name,Age", colSize: 8 }, + + // { "title": "还没想好", "field": "richtitle" } + ], + [{ "title": "Vue路径", "field": "vuePath", type: "text", placeholder: 'Vue项目所在绝对路径,到views文件夹,如:E:/app/src/views', colSize: 6 }, + { "title": "app路径", "field": "appPath", type: "text", placeholder: 'uniapp项目所在绝对路径,到pages文件夹,如:E:/uniapp/pages', colSize: 6 }] + // [ //待完 + // { "title": "开启用户权限数据", "field": "enable", bind: { data: [{ key: 1, value: '是', key: 0, value: '否' }] }, type: 'switch', colSize: 2 }, + // { "title": "提示", "required": true, "field": "userPermissionDesc", colSize: 10, "placeholder": "非自增主键需要输入排序字段",readonly:true } + // ], + // [ + + // ], + // [ + // { "title": "富文本编辑字段", "field": "richtitle", "displayType": "title" }, + // { "title": "文件上传字段", "field": "uploadField", "displayType": "title" }, + // { "title": "文件上传数量限制", "field": "uploadMaxCount", "displayType": "title", columnType: 'int' } + // ], + // [ + // { "title": "Vue视图绝对路径", "field": "vuePath", "displayType": "title", colSize: 12, placeholder: 'Vue项目所在绝对路径,到views文件夹,如:E:/app/src/views' }, + // ] + ] + }, + //2021.01.09增加代码生成器设置table排序功能 + columns: [ + { field: 'columnId', title: 'ColumnId', width: 120, align: 'left', edit: { type: "text" }, hidden: true }, + { field: 'table_Id', title: 'Table_Id', width: 120, align: 'left', editor: 'text', hidden: true }, + { field: 'columnCnName', title: '列显示名称', fixed: true, width: 120, align: 'left', edit: { type: "text" } }, + { field: 'columnName', title: '列名', fixed: true, width: 120, align: 'left', edit: { type: "text" } }, + { field: 'isKey', title: '主键', width: 90, align: 'left', edit: { type: "switch" } }, + { field: 'sortable', title: '是否排序', width: 90, align: 'left', edit: { type: "switch", keep: true } }, + { + field: 'enable', title: 'app列', width: 140, align: 'left', edit: { type: "select" }, + bind: { + data: [ + { key: 1, value: "显示/查询/编辑" }, + { key: 2, value: "显示/编辑" }, + { key: 3, value: "显示/查询" }, + { key: 4, value: "显示" }, + { key: 5, value: "查询/编辑" }, + { key: 6, value: "查询" }, + { key: 7, value: "编辑" }, + ] + } + }, + { field: 'searchRowNo', title: '查询行', width: 90, align: 'left', edit: { type: "text" } }, + { field: 'searchColNo', title: '查询列', width: 90, align: 'left', edit: { type: "text" } }, + { field: 'searchType', title: '查询类型', width: 150, align: 'left', edit: { type: "select" }, bind: { data: searchDataType } }, + { field: 'editRowNo', title: '编辑行', width: 90, align: 'numberbox', edit: { type: "text" } }, + { field: 'editColNo', title: '编辑列', width: 90, align: 'numberbox', edit: { type: "text" } }, + { field: 'editType', title: '编辑类型', width: 150, align: 'left', edit: { type: "select" }, bind: { data: dataType } }, + { field: 'dropNo', title: '数据源', width: 120, align: 'left', bind: { data: [] }, edit: { type: "select", data: [] } }, + { field: 'isImage', title: 'table列显示类型', hidden: false, width: 130, align: 'left', edit: { type: "select" }, bind: { data: columnType } }, + { field: 'orderNo', title: '列显示顺序', width: 120, align: 'left', edit: { type: "text" } }, + { field: 'maxlength', title: '字段最大长度', width: 130, align: 'left', edit: { type: "text" } }, + { field: 'columnType', title: '数据类型', width: 120, align: 'left', edit: { type: "text" } }, + { field: 'isNull', title: '可为空', width: 120, align: 'left', edit: { type: "switch", keep: true } }, + { field: 'isReadDataset', title: '是否只读', width: 120, align: 'left', edit: { type: "switch", keep: true } }, + { field: 'isColumnData', title: '数据列', width: 120, align: 'left', edit: { type: "switch", keep: true } }, + { field: 'isDisplay', title: '是否显示', width: 120, align: 'left', edit: { type: "switch", keep: true } }, + { field: 'columnWidth', title: 'table列宽度', width: 120, align: 'left', edit: { type: "text" } }, + { field: 'colSize', title: '编辑字段宽度colSize', width: 180, align: 'left', edit: { type: "select" }, + bind: { data:[ + {key:0,value:"自动宽度"}, + {key:2,value:"20%"}, + {key:3,value:"30%"}, + {key:4,value:"40%"}, + {key:6,value:"50%"}, + {key:8,value:"60%"}, + {key:10,value:"80%"}, + {key:12,value:"100%"} ] + } + }, + // { field: 'import', title: '导入列', hidden: true, width: 100, align: 'left', edit: { type: "switch" } }, + // { field: 'apiInPut', title: 'Api输入列(待实现)', width: 100, align: 'left', edit: { type: "switch" } }, + // { field: 'apiIsNull', title: 'Api输入列可为空(待实现)', width: 130, align: 'left', edit: { type: "switch" } }, + // { field: 'apiOutPut', title: 'Api输出列(待实现)', width: 100, align: 'left', edit: { type: "switch" } }, + // { field: 'columnformat', title: '显示格式', width: 120, align: 'left', editor: 'text', editor: 'textarea' }, + // { field: 'script', title: '脚本', width: 120, align: 'left', editor: 'textarea' }, + // { field: 'creator', title: '创建人', width: 120, align: 'left' }, + { field: 'createDate', title: '创建时间', width: 120, align: 'left' }, + // { field: 'modifier', title: '修改人', width: 120, align: 'left' }, + // { field: 'modifyDate', title: '修改时间', width: 120, align: 'left' } + ] +} + +export default data \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/builder/coder.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/builder/coder.vue" index 8a4d896e6..f07465632 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/builder/coder.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/builder/coder.vue" @@ -5,7 +5,7 @@ :width="850" :height="450" title="新建配置信息" - :padding="10" + padding="10px" v-model="addModel" >
@@ -124,6 +124,7 @@ :color="false" :index="true" :allowEmpty="true" + :clickEdit="true" >
@@ -175,7 +176,7 @@ export default { 'layOutOptins.fields.vuePath'(val) { localStorage.setItem('vuePath', val); }, - // deep: true + deep: true //localStorage.setItem("vuePath", this.layOutOptins.fields.vuePath || ""); }, methods: { diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/formChart.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/formChart.vue" index 69959c7f2..5d5446824 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/formChart.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/formChart.vue" @@ -3,11 +3,11 @@
-
+
-
@@ -15,12 +15,12 @@
-
-
+
@@ -29,6 +29,9 @@ import VolHeader from '@/components/basic/VolHeader.vue'; import VolForm from '@/components/basic/VolForm.vue'; import * as echarts from 'echarts/core'; +import { defineComponent, onMounted, onUnmounted } from 'vue'; +import { BarChart, PieChart } from 'echarts/charts' + import { bar, pie } from './chartOptions'; import { formFields1, @@ -36,34 +39,37 @@ import { formFields2, formRules2 } from './formOptions'; -import { computed, defineComponent, onMounted, onUnmounted, useTemplateRef } from 'vue'; -import { BarChart, PieChart } from 'echarts/charts' + +import { + CanvasRenderer +} from 'echarts/renderers' import { TitleComponent, TooltipComponent, LegendComponent, + GridComponent, } from 'echarts/components'; echarts.use([ TitleComponent, TooltipComponent, LegendComponent, + CanvasRenderer, + GridComponent, BarChart, PieChart ]) defineComponent([VolForm, VolHeader]) -const barRef = useTemplateRef('barRef'); -const pieRef = useTemplateRef('pieRef'); let $bar, $pie; onMounted(() => { - $bar = echarts.init(barRef.value); - $bar.setOption(bar); + $bar = echarts.init(document.getElementById('barId')); + $pie = echarts.init(document.getElementById('pieId')); - $pie = echarts.init(pieRef.value); + $bar.setOption(bar); $pie.setOption({ ...pie, ...{ legend: { @@ -76,8 +82,14 @@ onMounted(() => { }) onUnmounted(() => { - $bar.dispose(); - $pie.dispose(); + if($bar){ + $bar.dispose(); + $bar = null; + } + if($pie){ + $pie.dispose(); + $pie = null; + } }) diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/editTable.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/editTable.vue" new file mode 100644 index 000000000..eb28ab4bb --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/editTable.vue" @@ -0,0 +1,272 @@ + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form.vue" new file mode 100644 index 000000000..4eeb1aea3 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form.vue" @@ -0,0 +1,34 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form1.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form1.vue" new file mode 100644 index 000000000..09665fb34 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form1.vue" @@ -0,0 +1,246 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form2.vue" new file mode 100644 index 000000000..40693fbc4 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form2.vue" @@ -0,0 +1,129 @@ + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form3.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form3.vue" new file mode 100644 index 000000000..26593be17 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form3.vue" @@ -0,0 +1,372 @@ + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form4.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form4.vue" new file mode 100644 index 000000000..d6cb7ddeb --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form4.vue" @@ -0,0 +1,128 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form5.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form5.vue" new file mode 100644 index 000000000..3c2c53cbf --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form5.vue" @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form6.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form6.vue" new file mode 100644 index 000000000..aa1cbd144 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form6.vue" @@ -0,0 +1,191 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form7.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form7.vue" new file mode 100644 index 000000000..041d4b372 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form7.vue" @@ -0,0 +1,218 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/objectValidator.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/objectValidator.vue" new file mode 100644 index 000000000..6803b22a6 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/objectValidator.vue" @@ -0,0 +1,265 @@ + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/table.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/table.vue" new file mode 100644 index 000000000..892f04848 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/table.vue" @@ -0,0 +1,268 @@ + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multi1.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multi1.vue" new file mode 100644 index 000000000..3eccf4b90 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multi1.vue" @@ -0,0 +1,63 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multi2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multi2.vue" new file mode 100644 index 000000000..dbc40d212 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multi2.vue" @@ -0,0 +1,66 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multi3.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multi3.vue" new file mode 100644 index 000000000..8e11cce6f --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multi3.vue" @@ -0,0 +1,225 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil1Extension/multi1.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil1Extension/multi1.js" new file mode 100644 index 000000000..f68d972cc --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil1Extension/multi1.js" @@ -0,0 +1,24 @@ + +import table1 from "../multil1Extension/table1.vue" +let extension = { + components: {//动态扩充组件或组件路径 + gridHeader:'', + gridBody: "", + gridFooter:table1, + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + text:"此处表单由代码生成,也可引入单独ViewGrid.vue手动配置数据", + tableAction:'App_TransactionAvgPrice',//指定表权限 + buttons: [],//扩展的按钮 + methods: {//事件扩展 + onInit() { + this.tableMaxHeight=400; + }, + onInited() { + + } + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil1Extension/table1.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil1Extension/table1.vue" new file mode 100644 index 000000000..c33f7d7a5 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil1Extension/table1.vue" @@ -0,0 +1,242 @@ + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil2Extension/mtable.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil2Extension/mtable.vue" new file mode 100644 index 000000000..0ea8fb64a --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil2Extension/mtable.vue" @@ -0,0 +1,313 @@ + + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil2Extension/multi2.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil2Extension/multi2.js" new file mode 100644 index 000000000..531f90c1d --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil2Extension/multi2.js" @@ -0,0 +1,23 @@ + +import mtable from "../multil2Extension/mtable.vue" +let extension = { + components: {//动态扩充组件或组件路径 + gridHeader:'', + gridBody: "", + gridFooter:mtable, + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + text:"见multi2.vue、multi2.js", + buttons: [],//扩展的按钮 + methods: {//事件扩展 + onInit() { + this.tableMaxHeight=200; + }, + onInited() { + + } + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil3Extension/comMulti.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil3Extension/comMulti.vue" new file mode 100644 index 000000000..d656c989b --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil3Extension/comMulti.vue" @@ -0,0 +1,192 @@ + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil3Extension/multi3.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil3Extension/multi3.js" new file mode 100644 index 000000000..8f59abfa8 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/formsMulti/multil3Extension/multi3.js" @@ -0,0 +1,22 @@ +import comMulti from "../multil3Extension/comMulti.vue" +let extension = { + components: {//动态扩充组件或组件路径 + gridHeader:'', + gridBody: "", + gridFooter:comMulti, + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + text:"见multi3.js、multi3.vue", + buttons: [],//扩展的按钮 + methods: {//事件扩展 + onInit() { + this.tableMaxHeight=300; + }, + onInited() { + + } + } +}; +export default extension; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/home/home-chart-options.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/home/home-chart-options.js" index cb5aed0ec..a2f2d0e68 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/home/home-chart-options.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/home/home-chart-options.js" @@ -1,245 +1,244 @@ var chart1 = { - title: { - text: '框架集成及开发环境', - left: 'center', - padding: 15 - }, - tooltip: { - trigger: 'item' - }, - legend: { - top: 'bottom', - icon: 'circle', // 这个字段控制形状 类型包括 circle,rect ,roundRect,triangle,diamond,pin,arrow,none - itemWidth: 10, // 设置宽度 - itemHeight: 10, // 设置高度 - itemGap: 7, // 设置间距 - padding: [0, 0, 15, 0] //图例距离 - }, - series: [ - { - name: '框架', - type: 'pie', - radius: ['40%', '65%'], - avoidLabelOverlap: false, - itemStyle: { - borderRadius: 10, - borderColor: '#fff', - borderWidth: 2 - }, - label: { - show: false, - position: 'center' - }, - emphasis: { - label: { - show: true, - fontSize: '40', - fontWeight: 'bold' + title: { + text: "框架集成及开发环境", + left: 'center', + padding: 15, + }, + tooltip: { + trigger: 'item' + }, + legend: { + top: 'bottom', + icon: "circle", // 这个字段控制形状 类型包括 circle,rect ,roundRect,triangle,diamond,pin,arrow,none + itemWidth: 10, // 设置宽度 + itemHeight: 10, // 设置高度 + itemGap: 7,// 设置间距 + padding: [0, 0, 15, 0] //图例距离 + }, + series: [ + { + name: '框架', + type: 'pie', + radius: ['40%', '65%'], + avoidLabelOverlap: false, + itemStyle: { + borderRadius: 10, + borderColor: '#fff', + borderWidth: 2 + }, + label: { + show: false, + position: 'center' + }, + emphasis: { + label: { + show: true, + fontSize: '40', + fontWeight: 'bold' + } + }, + labelLine: { + show: false + }, + data: [ + { value: 1048, name: '.NetCore' }, + { value: 735, name: 'Dapper' }, + + { value: 735, name: 'EntityFramework' }, + // { value: 735, name: 'JWT' }, + { value: 735, name: 'Redis' }, + { value: 735, name: 'Vue3.0' }, + { value: 580, name: 'Vuex' }, + { value: 484, name: 'Element plus' } + ] } - }, - labelLine: { - show: false - }, - data: [ - { value: 1048, name: '.NetCore' }, - { value: 735, name: 'Dapper' }, - - { value: 735, name: 'EntityFramework' }, - // { value: 735, name: 'JWT' }, - { value: 735, name: 'Redis' }, - { value: 735, name: 'Vue3.0' }, - { value: 580, name: 'Vuex' }, - { value: 484, name: 'Element plus' } - ] - } - ] + ] } var chart2 = { - title: { - text: '这里是首页' - }, - tooltip: { - trigger: 'axis', - axisPointer: { - // 坐标轴指示器,坐标轴触发有效 - type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' - } - }, - legend: { - data: ['2.0下载量', '3.0下载量'], - padding: [0, 0, 15, 0] //图例距离 - }, - grid: { - left: '3%', - right: '4%', - bottom: '3%', - top: '13%', - containLabel: true - }, - xAxis: [ - { - type: 'category', - data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021'] - } - ], - yAxis: [ - { - type: 'value' - } - ], - series: [ - { - name: '2.0下载量', - type: 'bar', - showBackground: true, - backgroundStyle: { - color: 'rgba(180, 180, 180, 0.2)' - }, - itemStyle: { - borderRadius: [4, 4, 0, 0] - }, - data: [730, 620, 420, 932, 701, 834, 890] + title: { + text: '这里是首页' + }, + tooltip: { + trigger: 'axis', + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' + } }, - { - name: '3.0下载量', - type: 'bar', + legend: { + data: ['2.0下载量', '3.0下载量'], + padding: [0, 0, 15, 0] //图例距离 + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + top:'13%', + containLabel: true + }, + xAxis: [ + { + type: 'category', + data: [ '2015', '2016', '2017', '2018', '2019', '2020', '2021'] + } + ], + yAxis: [ + { + type: 'value' + } + ], + series: [ + { + name: '2.0下载量', + type: 'bar', + showBackground: true, + backgroundStyle: { + color: 'rgba(180, 180, 180, 0.2)' + }, + itemStyle: { + borderRadius: [4, 4, 0, 0] + }, + data: [ 730, 620, 420, 932, 701, 834, 890] + }, + { + name: '3.0下载量', + type: 'bar', - showBackground: true, - backgroundStyle: { - color: 'rgba(180, 180, 180, 0.2)' - }, - data: [230, 210, 120, 132, 101, 134, 90] - } - ] + showBackground: true, + backgroundStyle: { + color: 'rgba(180, 180, 180, 0.2)' + }, + data: [230, 210, 120, 132, 101, 134, 90] + } + ] } var chart3 = { - title: { - text: '框架支持功能(Vue2.0、Vue3.0版本)', - left: 'center' - }, - tooltip: { - trigger: 'item' - }, - legend: { - top: 'bottom', - icon: 'circle', // 这个字段控制形状 类型包括 circle,rect ,roundRect,triangle,diamond,pin,arrow,none - itemWidth: 10, // 设置宽度 - itemHeight: 10, // 设置高度 - itemGap: 7, // 设置间距 - padding: [0, 0, 10, 0] //图例距离 - }, - series: [ - { - name: '框架支持功能(Vue2.0、Vue3版本)', - type: 'pie', - radius: '55%', - data: [ - { value: 748, name: '多租户' }, - { value: 435, name: '多角色' }, - { value: 580, name: '多数据库' }, - { value: 280, name: '主从分库' }, - { value: 284, name: '国际化' }, - { value: 300, name: 'App/H5开发' }, - { value: 200, name: 'Redis' }, - { value: 600, name: 'Sqlserver' }, - { value: 400, name: 'Mysql' }, - { value: 100, name: 'Oracle' } - ], - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' + title: { + text: '框架支持功能(Vue2.0、Vue3.0版本)', + left: 'center' + }, + tooltip: { + trigger: 'item' + }, + legend: { + top: 'bottom', + icon: "circle", // 这个字段控制形状 类型包括 circle,rect ,roundRect,triangle,diamond,pin,arrow,none + itemWidth: 10, // 设置宽度 + itemHeight: 10, // 设置高度 + itemGap: 7,// 设置间距 + padding: [0, 0, 10, 0] //图例距离 + }, + series: [ + { + name: '框架支持功能(Vue2.0、Vue3版本)', + type: 'pie', + radius: '55%', + data: [ + { value: 748, name: '多租户' }, + { value: 435, name: '多角色' }, + { value: 580, name: '多数据库' }, + { value: 280, name: '主从分库' }, + { value: 284, name: '国际化' }, + { value: 300, name: 'App/H5开发' }, + { value: 200, name: 'Redis' }, + { value: 600, name: 'Sqlserver' }, + { value: 400, name: 'Mysql' }, + { value: 100, name: 'Oracle' }, + ], + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } } - } - } - ] + ] } -var chart4 = { - tooltip: { - trigger: 'axis', - axisPointer: { - // Use axis to trigger tooltip - type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' - } - }, - legend: {}, - grid: { - left: '3%', - right: '4%', - bottom: '3%', - top: '13%', - containLabel: true - }, - xAxis: { - type: 'value' - }, - yAxis: { - type: 'category', - data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] - }, - series: [ - { - name: 'Direct', - type: 'bar', - stack: 'total', - label: { - show: true - }, - emphasis: { - focus: 'series' - }, - data: [320, 302, 301, 334, 390, 330, 320] +var chart4={ + tooltip: { + trigger: 'axis', + axisPointer: { + // Use axis to trigger tooltip + type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' + } }, - { - name: 'Mail Ad', - type: 'bar', - stack: 'total', - label: { - show: true - }, - emphasis: { - focus: 'series' - }, - data: [120, 132, 101, 134, 90, 230, 210] + legend: {}, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + top:'13%', + containLabel: true }, - { - name: 'Affiliate Ad', - type: 'bar', - stack: 'total', - label: { - show: true - }, - emphasis: { - focus: 'series' - }, - data: [220, 182, 191, 234, 290, 330, 310] + xAxis: { + type: 'value' }, - { - name: 'Video Ad', - type: 'bar', - stack: 'total', - label: { - show: true - }, - emphasis: { - focus: 'series' - }, - data: [150, 212, 201, 154, 190, 330, 410] + yAxis: { + type: 'category', + data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, - { - name: 'Search Engine', - type: 'bar', - stack: 'total', - label: { - show: true - }, - emphasis: { - focus: 'series' - }, - data: [820, 832, 901, 934, 1290, 1330, 1320] - } - ] -} -export { chart1, chart2, chart3, chart4 } + series: [ + { + name: 'Direct', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: [320, 302, 301, 334, 390, 330, 320] + }, + { + name: 'Mail Ad', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: [120, 132, 101, 134, 90, 230, 210] + }, + { + name: 'Affiliate Ad', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: [220, 182, 191, 234, 290, 330, 310] + }, + { + name: 'Video Ad', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: [150, 212, 201, 154, 190, 330, 410] + }, + { + name: 'Search Engine', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: [820, 832, 901, 934, 1290, 1330, 1320] + } + ] + } +export { chart1, chart2, chart3,chart4 } \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/App_Appointment.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/App_Appointment.vue" new file mode 100644 index 000000000..57464f1b7 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/App_Appointment.vue" @@ -0,0 +1,71 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/App_Appointment2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/App_Appointment2.vue" new file mode 100644 index 000000000..ff9476df4 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/App_Appointment2.vue" @@ -0,0 +1,71 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/SellOrder.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/SellOrder.vue" new file mode 100644 index 000000000..067da09c7 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/SellOrder.vue" @@ -0,0 +1,90 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/SellOrder2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/SellOrder2.vue" new file mode 100644 index 000000000..e4bfbd453 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/SellOrder2.vue" @@ -0,0 +1,81 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/SellOrder3.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/SellOrder3.vue" new file mode 100644 index 000000000..80f76d466 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/SellOrder3.vue" @@ -0,0 +1,81 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/vSellOrderImg.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/vSellOrderImg.vue" new file mode 100644 index 000000000..0920f9736 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/order/vSellOrderImg.vue" @@ -0,0 +1,77 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Permission.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Permission.vue" index 1b1434e16..1899e2dd9 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Permission.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Permission.vue" @@ -44,7 +44,7 @@ diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/UserInfo.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/UserInfo.vue" index c8b1cec48..316bd9496 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/UserInfo.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/UserInfo.vue" @@ -7,7 +7,7 @@
@@ -25,7 +25,7 @@

修改密码 - 修改头像

@@ -124,7 +124,6 @@ export default { }, data() { return { - // 'this.src="' + require("@/assets/imgs/error-img.png") + '"', modifyOptions: { model: false, fields: { oldPwd: "", newPwd: "", newPwd1: "" }, diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/flow/FlowDemo.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/flow/FlowDemo.vue" index 9cfff9704..3221c779a 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/flow/FlowDemo.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/flow/FlowDemo.vue" @@ -1,18 +1,28 @@ - + +.item-other { + background: #e1fae2; + color: #2ad431; +} diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/table1.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/table1.vue" new file mode 100644 index 000000000..c4527a882 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/table1.vue" @@ -0,0 +1,418 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/table2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/table2.vue" new file mode 100644 index 000000000..ef0df3faa --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/table2.vue" @@ -0,0 +1,243 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/table3.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/table3.vue" new file mode 100644 index 000000000..cd8b01ffd --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/table3.vue" @@ -0,0 +1,223 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tableForms.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tableForms.js" new file mode 100644 index 000000000..1ce53eaa1 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tableForms.js" @@ -0,0 +1,108 @@ +let options = { + formFileds1: {//表单配置 + Variety: "", + AgeRange: "", + DateRange: [], + City: "", + AvgPrice: 8.88, + Date: "", + IsTop: "还没想好..." + } + , formRules1: [//表单配置 + [ + { + dataKey: "city", + title: "城市", + required: true, + field: "City", + data: [], + type: "select" + }, + { + title: "多选日期", + range: true, //设置为true可以选择开始与结束日期 + required: false, + field: "DateRange", + // colSize: 4,//设置宽度为1/3 + type: "date" + } + ], + [ + { + dataKey: "age", //后台下拉框对应的数据字典编号 + data: [], //loadKey设置为true,会根据dataKey从后台的下拉框数据源中自动加载数据 + title: "月龄", + required: true, //设置为必选项 + field: "AgeRange", + type: "select" + }, + { + title: "日期", + required: true, + field: "Date", + placeholder: "你可以设置colSize属性决定标签的长度,可选值12/8/6/4", + // colSize: 8,//设置宽度为2/3 + type: "datetime" + } + ], + [ + { + title: "品种", + dataKey: "age", + placeholder: "此处数据源为手动绑定", + //如果这里绑定了data数据,后台不会加载此数据源 + data: [{ key: "1", value: "1" }, { key: "2", value: "2" }], + required: false, + field: "Variety", + type: "select" + }, + { + type: "decimal", + title: "价格", + required: true, + placeholder: "你可以自己定义placeholder显示的文字", + field: "AvgPrice" + } + ], + [ + { + title: "备注", + required: true, + field: "IsTop", + colSize: 12, //设置12,此列占100%宽度 + type: "textarea" + } + ] + ], + table: { //table表单配置 + data: [{ ExpertName: "移动手机", AuditStatus: 0, CreateDate: "2019-11-01", UserTrueName: "沈万三" }, + { ExpertName: "电子产品", AuditStatus: 1, CreateDate: "2019-11-02", UserTrueName: "鲁班" }, + { ExpertName: "生活用品", AuditStatus: 2, CreateDate: "2019-11-03", UserTrueName: "二货" }, + { ExpertName: "家具办公", AuditStatus: 0, CreateDate: "2019-11-04", UserTrueName: "二手" }], + columns: [{ + field: "ExpertName", + title: "商品名称" + }, + { + field: "AuditStatus", + title: "审核状态", + bind: { + key: "audit", + data: [ + { key: "0", value: "审核中" }, + { key: "1", value: "审核通过" }, + { key: "2", value: "审核未通过" } + ] + } + }, { + field: "UserTrueName", + title: "申请人", + width: 120 + }, { + field: "CreateDate", + title: "申请时间", + type: "datetime" + }] + } +} +export default options; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tableForms.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tableForms.vue" new file mode 100644 index 000000000..fc77df1fb --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tableForms.vue" @@ -0,0 +1,91 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tableFormsViewGrid.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tableFormsViewGrid.js" new file mode 100644 index 000000000..8f18bcdfc --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tableFormsViewGrid.js" @@ -0,0 +1,64 @@ +var viewGridOptions = { //此处的权限是使用的当前页面的权限,而不是App_Transaction表的权限 + table: { + key: 'Id', + footer: "Foots", + cnName: 'table基础配置', + name: 'App_Transaction', + url: "/App_Transaction/", + sortName: "Id" + }, + extend: { + text:"此组件配置与代码生成器生成的配置相同,自带基础操作,可任意扩展", + buttons: { //扩展按钮 + view: [//ViewGrid查询界面按钮 + { + name: "扩展按钮!", + icon: 'md-create', + value: 'Edit', + class: '', + type: 'error', + index: 1,//显示的位置 + onClick: function () { //扩展按钮执行事件 + this.$Message.error("扩展按钮") + } + }] + }, + methods: {//事件扩展 + onInit(){ + this.tableMaxHeight=500; + }, + searchAfter(result) { //查询ViewGird表数据后param查询参数,result回返查询的结果 + console.log({ title: this.table.cnName + ',查询结果', desc: '返回的对象:' + JSON.stringify(result) }); + return true; + } + } + }, + editFormFields: {"Name":"","TransactionType":"","CowType":"",PhoneNo:"",Describe:""}, + editFormOptions: [[{"title":"姓名","required":true,"field":"Name"}], + [{"dataKey":"cq","title":"是否买入","field":"TransactionType","type":"select"}], + [{"dataKey":"nav","title":"购买类型","field":"CowType","type":"select"}], + [{"type":"phone","title":"电话","field":"PhoneNo","required":true}], + [{"type":"textarea","title":"描述","field":"Describe","required":true}]], + searchFormFields: {"CowType":"","Creator":"","CreateDate":""}, + searchFormOptions: [[{"dataKey":"nav","title":"购买类型","field":"CowType","type":"dropList"},{"title":"提交人","field":"Creator"},{"title":"提交时间","field":"CreateDate","type":"datetime"}]], + columns: [{field:'Id',title:'主键ID',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'}, + {field:'Name',title:'姓名',type:'string',width:120,require:true,align:'left',sortable:true}, + {field:'PhoneNo',title:'电话',type:'string',link:true,width:150,require:true,align:'left'}, + {field:'Quantity',title:'数量',type:'int',width:90,require:true,align:'left'}, + {field:'TransactionType',title:'是否买入',type:'int',bind:{ key:'cq',data:[]},width:120,align:'left'}, + {field:'CowType',title:'购买类型',type:'string',bind:{ key:'nav',data:[]},width:90,align:'left'}, + {field:'Describe',title:'描述',type:'string',width:190,require:true,align:'left'}, + {field:'Enable',title:'是否启用',type:'byte',width:90,hidden:true,align:'left'}, + {field:'CreateID',title:'创建人Id',type:'int',width:90,hidden:true,align:'left'}, + {field:'Creator',title:'提交人',type:'string',width:130,align:'left'}, + {field:'CreateDate',title:'提交时间',type:'datetime',width:150,align:'left',sortable:true}, + {field:'Modifier',title:'修改人',type:'string',width:130,hidden:true,align:'left'}, + {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sortable:true}], + detail: { + cnName:"", + columns: [], + sortName: "", + key:"" + } +}; +export default viewGridOptions; \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tabsTable.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tabsTable.vue" new file mode 100644 index 000000000..d3d11d2ba --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/tables/tabsTable.vue" @@ -0,0 +1,136 @@ + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/TreeTable1.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/TreeTable1.vue" new file mode 100644 index 000000000..73444f4b2 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/TreeTable1.vue" @@ -0,0 +1,42 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/TreeTable2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/TreeTable2.vue" new file mode 100644 index 000000000..4a15fed63 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/TreeTable2.vue" @@ -0,0 +1,43 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/TreeTable3.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/TreeTable3.vue" new file mode 100644 index 000000000..8b34241ca --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/TreeTable3.vue" @@ -0,0 +1,144 @@ + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Table.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Table.vue" new file mode 100644 index 000000000..25ea20a0c --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Table.vue" @@ -0,0 +1,76 @@ + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Tree.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Tree.vue" new file mode 100644 index 000000000..7c181864d --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Tree.vue" @@ -0,0 +1,139 @@ + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/table.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/table.js" new file mode 100644 index 000000000..e20ef0af6 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/table.js" @@ -0,0 +1,88 @@ + +import { h, resolveComponent } from 'vue'; +let extension = { + components: {//动态扩充组件或组件路径 + //表单header、content、footer对应位置扩充的组件 + gridHeader: '', + gridBody: { + render () { + return [ + h(resolveComponent('el-alert'), { + style: { 'margin-bottom': '12px' }, + 'show-icon': true, type: 'success', + closable: false, title: '关于TreeTable使用' + }, '整个页面分为:左边树形菜单Tree.vue与右边Table.vue(代码生成的页面,复制过来即可)两部份,按照此格式配置即可,具体说明见TreeTable1.vue'), + ] + } + }, + gridFooter: '', + //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + text: "点击左边tree加载表格数据", + buttons: [],//扩展的按钮 + methods: {//事件扩展 + onInit() { + //缓存当前table页面,点击左边树形菜单时,直接刷新此页面 + this.$store.getters.data().viewGridDemo = this; + this.boxOptions.height = 400; + //默认不加载表格数据,由Tree.vue中created方法来触发默认加载数据 + this.load=false; + }, + onInited() { + this.height = this.height - 75; + }, + nodeClick(treeId){ //点击边树节点刷新右边表格 + this.refresh(); + }, + searchBefore(param) { + //点击左边tree时加载table数据,其他情况都不加载数据 + let treeId = this.$store.getters.data().treeDemo1.treeId; + if (treeId === undefined) { + return false; + } + //将查询的treeid(角色id)提交到后台 + param.value = treeId; + //生成查询条件 + // param.wheres = [{ name: 'Role_Id', value: treeId }] + return true; + }, + addBefore(param) { //保存前 + let treeId = this.$store.getters.data().treeDemo1.treeId; + if (treeId === undefined) { + this.$Message.error("请选择左侧角色") + return false; + } + //添加默认新建的值到后台 + //新建用户的角色默认为当前树形菜单选中的角色 + param.mainData.Role_Id = treeId; + param.mainData.IsRegregisterPhone = 0; + return true; + }, + addAfter(result) {//用户新建后,显示随机生成的密码 + if (!result.status) { + return true; + } + return true; + }, + modelOpenAfter() { + //点击弹出框后,如果是编辑状态,禁止编辑用户名,如果新建状态,将用户名字段设置为可编辑 + let isEDIT = this.currentAction == this.const.EDIT; + this.editFormOptions.forEach(item => { + item.forEach(x => { + if (x.field == "UserName") { + x.disabled=isEDIT + } + }) + //不是新建,性别默认值设置为男 + if (!isEDIT) { + this.editFormFields.Gender = "0"; + } + }) + } + + } +}; +export default extension; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Table2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Table2.vue" new file mode 100644 index 000000000..2a91a8af0 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Table2.vue" @@ -0,0 +1,149 @@ + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Tree2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Tree2.vue" new file mode 100644 index 000000000..28bac306b --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Tree2.vue" @@ -0,0 +1,141 @@ + + + + + diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/tree_options.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/tree_options.js" new file mode 100644 index 000000000..f5157bf9f --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/tree_options.js" @@ -0,0 +1,77 @@ +let + options = { + tree: [ + { "id": 1, "parentId": 0, "text": "北京市" }, + { "id": 2, "parentId": 1, "text": "西城区" }, + { "id": 3, "parentId": 1, "text": "东城区" }, + { "id": 5, "parentId": 0, "text": "西藏自治区" }, + { "id": 6, "parentId": 5, "text": "拉萨市" }, + { "id": 7, "parentId": 5, "text": "昌都市" }, + { "id": 8, "parentId": 7, "text": "丁青县" } + ], + //table数据 + tableData: [ + { + code: "001", + id: 1,//tree的id数据 + address: '海淀区', + remark: '北京市-海淀区', + enable: 1, + createDate: '2020-04-01 20:00' + }, { + code: "001", + id: 1,//tree的id数据 + address: '朝阳区', + remark: '北京市-朝阳区', + enable: 1, + createDate: '2020-04-01 20:00' + },{ + code: "001", + id: 2,//tree的id数据 + address: '恭王府 ', + remark: '世界最大的四合院除皇帝和家眷外,任何人是不得住进紫禁城的', + enable: 1, + createDate: '2020-04-01 20:00' + }, + { + code: "002", + id: 3,//tree的id数据 + address: '白塔寺 ', + remark: '妙应寺白塔位于阜城门内大街路北的妙应寺内。因寺内有通体涂以白垩的塔,故俗称“白塔寺”', + enable: 0, + createDate: '2020-04-01 20:00' + }, { + code: "004", + id: 6,//tree的id数据 + address: '布达拉宫', + remark: '布达拉宫不仅是西藏的象征,更是朝圣者心中的圣地', + enable: 1, + createDate: '2020-04-01 20:00' + }, + { + code: "005", + id: 5,//tree的id数据 + address: '大昭寺', + remark: '在藏民心中大昭寺在拉萨的中心地位', + enable: 1, + createDate: '2020-04-01 20:00' + }, + { + code: "007", + id: 7, + address: '测试 ', + remark: '测试测试', + enable: 1, + createDate: '2020-04-01 20:00' + }, + { + code: "008", + id: 5, + address: '日客则 ', + remark: '位于定日县境内的珠穆朗玛峰是世界第一高峰。峰顶常年积雪', + enable: 0, + createDate: '2020-04-01 20:00' + }] + } + +export default options; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/upload/formUpload.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/upload/formUpload.vue" new file mode 100644 index 000000000..2647ef135 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/upload/formUpload.vue" @@ -0,0 +1,235 @@ + + + \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/upload/volUploadExample.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/upload/volUploadExample.vue" new file mode 100644 index 000000000..a4214dae1 --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/upload/volUploadExample.vue" @@ -0,0 +1,192 @@ + + + From f813077afb77d77301ed6b84d333161eeee8efbc Mon Sep 17 00:00:00 2001 From: 3ddbz Date: Thu, 17 Jul 2025 01:14:03 +0800 Subject: [PATCH 07/12] =?UTF-8?q?refactor(Vol.Vue3.Vite):=20=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=20::v-deep=20=E9=80=89=E6=8B=A9=E5=99=A8=E4=B8=BA=20:?= =?UTF-8?q?deep=20=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在多个组件中将 ::v-deep 选择器替换为 :deep 选择器 - 不会影响功能,仅修改样式选择器 --- .../src/components/basic/QuickSearch.vue" | 12 ++--- .../components/basic/ViewGrid/ViewGrid.less" | 2 +- .../components/basic/ViewGrid/ViewGrid.vue" | 8 +-- .../src/components/basic/VolBox.vue" | 16 +++--- .../components/basic/VolElementMenuChild.vue" | 2 +- .../src/components/basic/VolForm.vue" | 50 ++++++++++++------- .../VolFormDraggable/VolFormDraggable.vue" | 20 ++++---- .../src/components/basic/VolTable.vue" | 40 +++++++-------- .../src/components/workflow/panel.vue" | 4 +- .../Vol.Vue3.Vite/src/views/Index.vue" | 4 +- .../Vol.Vue3.Vite/src/views/charts/chart.vue" | 4 +- .../Vol.Vue3.Vite/src/views/forms/form4.vue" | 6 +-- .../src/views/system/Permission.vue" | 10 ++-- .../src/views/system/Sys_Menu.vue" | 4 +- .../src/views/treeTable/demo1/Tree.vue" | 4 +- .../src/views/treeTable/demo2/Tree2.vue" | 4 +- 16 files changed, 103 insertions(+), 87 deletions(-) diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/QuickSearch.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/QuickSearch.vue" index 2ef4ab8a7..42963c4da 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/QuickSearch.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/QuickSearch.vue" @@ -89,13 +89,13 @@ export default { }; diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolBox.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolBox.vue" index 89e325fe8..27b60a974 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolBox.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolBox.vue" @@ -154,20 +154,20 @@ export default defineComponent({ diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolElementMenuChild.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolElementMenuChild.vue" index ccea3218d..0574b1824 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolElementMenuChild.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolElementMenuChild.vue" @@ -46,7 +46,7 @@ export default { diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chart.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chart.vue" index 24aeebd47..5c03a23f8 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chart.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chart.vue" @@ -128,11 +128,11 @@ function tabClick(name) { } } -.m-charts ::v-deep(.el-tabs__content) { +.m-charts :deep(.el-tabs__content) { height: calc(100% - 45px); } -.m-charts ::v-deep(.el-tab-pane) { +.m-charts :deep(.el-tab-pane) { height: 100%; } \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form4.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form4.vue" index d6cb7ddeb..0fc102e0e 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form4.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/forms/form4.vue" @@ -116,13 +116,13 @@ export default { margin-bottom: 15px; background: white; } -.t-dis ::v-deep(.example-tb .el-alert) { +.t-dis :deep(.example-tb .el-alert) { display: none; } -.t-dis ::v-deep(.example-tb .tb) { +.t-dis :deep(.example-tb .tb) { margin-top: 0 !important; } -.t-dis ::v-deep(.example-tb .search-info) { +.t-dis :deep(.example-tb .search-info) { margin-left: -19px; } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Permission.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Permission.vue" index 1899e2dd9..d8637d2e4 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Permission.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Permission.vue" @@ -352,7 +352,7 @@ export default defineComponent({ } } -.role-tree-left ::v-deep(.el-tree-node__content) { +.role-tree-left :deep(.el-tree-node__content) { cursor: pointer; height: auto; padding: 5px; @@ -360,22 +360,22 @@ export default defineComponent({ font-size: 15px; } -.role-tree-left ::v-deep(.el-tree-node__content:hover) { +.role-tree-left :deep(.el-tree-node__content:hover) { background: #f4f4f4; border-radius: 20px; } -.role-tree-left ::v-deep(.is-current > .el-tree-node__content:first-child) { +.role-tree-left :deep(.is-current > .el-tree-node__content:first-child) { background: #f2f2f2; border-radius: 20px; } -.role-tree-right ::v-deep(.el-tree-node__content) { +.role-tree-right :deep(.el-tree-node__content) { margin-bottom: 5px; height: auto; } -.role-tree-right ::v-deep(.el-checkbox__label) { +.role-tree-right :deep(.el-checkbox__label) { position: relative; top: 2px; } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Sys_Menu.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Sys_Menu.vue" index be5878522..cb917a34c 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Sys_Menu.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/system/Sys_Menu.vue" @@ -600,7 +600,7 @@ export default defineComponent({ .form-content { margin-top: 30px; } -.menu-left ::v-deep(.el-scrollbar__bar.is-vertical) { +.menu-left :deep(.el-scrollbar__bar.is-vertical) { width: 2px; } .auth-group { @@ -623,7 +623,7 @@ export default defineComponent({ padding-bottom: 10px; } } -.auth-group ::v-deep(.el-checkbox__label) { +.auth-group :deep(.el-checkbox__label) { padding-left: 4px; } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Tree.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Tree.vue" index 7c181864d..d553fc4bb 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Tree.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo1/Tree.vue" @@ -130,10 +130,10 @@ export default { padding-right: 5px; } } -.com-el-tree ::v-deep(.el-tree-node) { +.com-el-tree :deep(.el-tree-node) { padding: 3px 0; } -.com-el-tree ::v-deep(.el-scrollbar .el-scrollbar__thumb) { +.com-el-tree :deep(.el-scrollbar .el-scrollbar__thumb) { width: 0 !important; } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Tree2.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Tree2.vue" index 28bac306b..cc0b0639f 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Tree2.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/treeTable/demo2/Tree2.vue" @@ -131,10 +131,10 @@ export default { padding-right: 5px; } } -.com-el-tree ::v-deep(.el-tree-node) { +.com-el-tree :deep(.el-tree-node) { padding: 3px 0; } -.com-el-tree ::v-deep(.el-scrollbar .el-scrollbar__thumb) { +.com-el-tree :deep(.el-scrollbar .el-scrollbar__thumb) { width: 0 !important; } From e8ebb8e4939b9ed3cf7ea6441b2b365dd3082341 Mon Sep 17 00:00:00 2001 From: 3ddbz Date: Thu, 17 Jul 2025 01:14:56 +0800 Subject: [PATCH 08/12] =?UTF-8?q?feat(vite):=20=E4=BD=BF=E7=94=A8=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AE=20API=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 .env 和 .env.production 文件,分别配置开发和生产环境的 API URL - 修改 http.js 文件,使用环境变量替代硬编码的 API URL - 更新 vite.config.ts 文件,引入环境变量配置 --- .../Vol.Vue3.Vite/.env" | 2 + .../Vol.Vue3.Vite/.env.production" | 1 + .../Vol.Vue3.Vite/src/api/http.js" | 11 +- .../Vol.Vue3.Vite/vite.config.ts" | 135 ++++++++++-------- 4 files changed, 76 insertions(+), 73 deletions(-) create mode 100644 "v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/.env" create mode 100644 "v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/.env.production" diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/.env" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/.env" new file mode 100644 index 000000000..04c48d65d --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/.env" @@ -0,0 +1,2 @@ +VITE_APP_TITLE=Vol开发框架Vue3版本 +VITE_API_URL=http://127.0.0.1:9991/ \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/.env.production" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/.env.production" new file mode 100644 index 000000000..9b7b1bedb --- /dev/null +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/.env.production" @@ -0,0 +1 @@ +VITE_API_URL=http://api.volcore.xyz/ \ No newline at end of file diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/http.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/http.js" index 95fd723a1..5285bdadc 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/http.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/http.js" @@ -11,16 +11,7 @@ import { ElLoading as Loading, ElMessage as Message } from 'element-plus'; let loadingInstance; let loadingStatus = false; -if (process.env.NODE_ENV == 'development') { - axios.defaults.baseURL = 'http://127.0.0.1:9991/'; -} -else if (process.env.NODE_ENV == 'debug') { - axios.defaults.baseURL = 'http://127.0.0.1:9991/'; -} - -else if (process.env.NODE_ENV == 'production') { - axios.defaults.baseURL = 'http://api.volcore.xyz/'; -} +axios.defaults.baseURL = __API_URL__; if (!axios.defaults.baseURL.endsWith('/')) { axios.defaults.baseURL+="/"; } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vite.config.ts" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vite.config.ts" index 5444ea67e..d5109ff2b 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vite.config.ts" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/vite.config.ts" @@ -1,75 +1,84 @@ import { fileURLToPath } from 'node:url' -import { defineConfig } from 'vite' +import { defineConfig, loadEnv } from 'vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import { visualizer } from 'rollup-plugin-visualizer' // https://vitejs.dev/config/ -export default defineConfig({ - plugins: [ - vue(), - vueJsx(), - visualizer({ - filename: 'report_form_rollup-plugin-visualizer.html' - }) - //引用后提示: - // requireTransform({ - // fileRegex: /.js$|.ts$/ - // }) - ], - define: {}, - optimizeDeps: { - exclude: ['vue'] - }, - build: { - commonjsOptions: { - transformMixedEsModules: true +export default defineConfig(({ mode }) => { + const envConfig = loadEnv(mode, process.cwd()) + + console.log('envConfig', envConfig) + + return { + plugins: [ + vue(), + vueJsx(), + visualizer({ + filename: 'report_form_rollup-plugin-visualizer.html' + }) + //引用后提示: + // requireTransform({ + // fileRegex: /.js$|.ts$/ + // }) + ], + define: { + __APP_TITLE__: JSON.stringify(envConfig.VITE_APP_TITLE), + __API_URL__: JSON.stringify(envConfig.VITE_API_URL) }, - rollupOptions: { - output: { - //每个node_modules模块分成一个js文件 - manualChunks(id) { - if (id.includes('node_modules')) { - return id.toString().split('node_modules/')[1].split('/')[0].toString() - } - }, - // 用于从入口点创建的块的打包输出格式[name]表示文件名,[hash]表示该文件内容hash值 - // entryFileNames: 'assets/js/[name].[hash].js', // 用于命名代码拆分时创建的共享块的输出命名 - // chunkFileNames: 'assets/js/[name].[hash].js', // 用于输出静态资源的命名,[ext]表示文件扩展名 - // assetFileNames: 'assets/[ext]/[name].[hash].[ext]' - entryFileNames: 'assets/js/[hash].js', // 用于命名代码拆分时创建的共享块的输出命名 - chunkFileNames: 'assets/js/[hash].js', // 用于输出静态资源的命名,[ext]表示文件扩展名 - assetFileNames: 'assets/[ext]/[hash].[ext]' - } + optimizeDeps: { + exclude: ['vue'] + }, + build: { + commonjsOptions: { + transformMixedEsModules: true + }, + rollupOptions: { + output: { + //每个node_modules模块分成一个js文件 + manualChunks(id) { + if (id.includes('node_modules')) { + return id.toString().split('node_modules/')[1].split('/')[0].toString() + } + }, + // 用于从入口点创建的块的打包输出格式[name]表示文件名,[hash]表示该文件内容hash值 + // entryFileNames: 'assets/js/[name].[hash].js', // 用于命名代码拆分时创建的共享块的输出命名 + // chunkFileNames: 'assets/js/[name].[hash].js', // 用于输出静态资源的命名,[ext]表示文件扩展名 + // assetFileNames: 'assets/[ext]/[name].[hash].[ext]' + entryFileNames: 'assets/js/[hash].js', // 用于命名代码拆分时创建的共享块的输出命名 + chunkFileNames: 'assets/js/[hash].js', // 用于输出静态资源的命名,[ext]表示文件扩展名 + assetFileNames: 'assets/[ext]/[hash].[ext]' + } + }, + // outDir: 'dist', // 输出目录,默认为 'dist' + // rollupOptions: { + // input: { + // main: 'src/main.js', // 你的入口文件 + // } + // }, + sourcemap: false //生成源映射文件 }, - // outDir: 'dist', // 输出目录,默认为 'dist' - // rollupOptions: { - // input: { - // main: 'src/main.js', // 你的入口文件 - // } - // }, - sourcemap: false //生成源映射文件 - }, - publicDir: 'public', // 这里指定了 public 文件夹的位置 - css: { - //查看CSS属于哪个css文件 - devSourcemap: false - }, - server: { - port: 9990 - // proxy: { - // '/api': { - // target: 'http://xxxx.com', - // changeOrigin: true, - // rewrite: (path) => path.replace(/^\/api/, '') - // } - // } - }, - resolve: { - extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue', '.mjs'], - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) + publicDir: 'public', // 这里指定了 public 文件夹的位置 + css: { + //查看CSS属于哪个css文件 + devSourcemap: false + }, + server: { + port: 9990 + // proxy: { + // '/api': { + // target: 'http://xxxx.com', + // changeOrigin: true, + // rewrite: (path) => path.replace(/^\/api/, '') + // } + // } + }, + resolve: { + extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue', '.mjs'], + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } } } }) From f6aa62e7758292ccf37fed2546aa3f72d5248b90 Mon Sep 17 00:00:00 2001 From: 3ddbz Date: Thu, 17 Jul 2025 01:17:41 +0800 Subject: [PATCH 09/12] =?UTF-8?q?refactor(components):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=20VolElementMenu=20=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化模板结构,提高代码可读性和维护性 - 使用 ElScrollbar 组件包裹菜单,解决菜单滚动问题 - 重构 VolElementMenuChild 组件,使用 computed 属性动态决定组件类型 --- .../src/components/basic/VolElementMenu.vue" | 80 +++++++------------ .../components/basic/VolElementMenuChild.vue" | 79 +++++++++--------- 2 files changed, 65 insertions(+), 94 deletions(-) diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolElementMenu.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolElementMenu.vue" index cc544d19e..68598af8f 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolElementMenu.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/VolElementMenu.vue" @@ -1,51 +1,33 @@