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/package.json" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/package.json" index 470174861..cd9ef961e 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.14", + "@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 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 d6a71e504..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" @@ -1,121 +1,108 @@ import axios from 'axios' import store from '../store/index' +// import {getCurrentInstance} from 'vue' import { useRouter, useRoute } from 'vue-router' -import { nextTick } from 'vue' -const router = useRouter() -axios.defaults.timeout = 50000 -axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8' +const router = useRouter(); +axios.defaults.timeout = 50000; +axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'; -import { ElLoading as Loading, ElMessage as Message } from 'element-plus' +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 = 'http://api.volcore.xyz/'; +let loadingInstance; +let loadingStatus = false; +axios.defaults.baseURL = __API_URL__; if (!axios.defaults.baseURL.endsWith('/')) { - axios.defaults.baseURL+="/"; + axios.defaults.baseURL+="/"; } -let ipAddress = axios.defaults.baseURL -axios.interceptors.request.use( - (config) => { - return config - }, - (error) => { - return Promise.reject(error) - } -) -axios.interceptors.response.use( - (res) => { - closeLoading() - checkResponse(res) +let ipAddress = axios.defaults.baseURL; +axios.interceptors.request.use((config) => { + return config; +}, (error) => { + return Promise.reject(error); +}); - return Promise.resolve(res) - }, - (error) => { - closeLoading() - let httpMessage = '' +axios.interceptors.response.use((res) => { + + closeLoading(); + + checkResponse(res); + + return Promise.resolve(res); +}, (error) => { + closeLoading(); + let httpMessage = ''; if (error.response) { - if (error.response.status == '401') { - if (error.response.data && error.response.data.code == 401) { - if (!localStorage.getItem('user')) { - // Message.error({ - // showClose: true, - // message: '登陆已过期', - // type: 'error' - // }); - } - toLogin() - return + if (error.response.status == '401') { + if (error.response.data && error.response.data.code == 401) { + if (!localStorage.getItem('user')) { + Message.error({ + showClose: true, + message: '登陆已过期', + type: 'error' + }); + } + toLogin(); + return; + } + + } + if (error.response.status == '404') { + httpMessage = "未找到请求地址"; + } + else if (error.response.data && error.response.data.message) { + httpMessage = error.response.data.message; } - } - if (error.response.status == '404') { - httpMessage = '未找到请求地址' - } else if (error.response.data && error.response.data.message) { - httpMessage = error.response.data.message - } - } else { - httpMessage = '服务器处理异常' } - redirect(httpMessage) - return Promise.reject(error.response || {}, httpMessage) - } -) -function closeLoading() { - if (loadingInstance) { - loadingInstance.close() - } - if (loadingStatus) { - loadingStatus = false + else { + httpMessage = '服务器处理异常' + } + redirect(httpMessage); + return Promise.reject(error.response || {}, httpMessage); +}); +function closeLoading () { if (loadingInstance) { - loadingInstance.close() + loadingInstance.close(); } - } + if (loadingStatus) { + loadingStatus = false; + if (loadingInstance) { + loadingInstance.close(); + } + } + } -function checkResponse(res) { - //刷新token - if (!res.headers) { - if (res.getResponseHeader('vol_exp') == '1') { - replaceToken() +function checkResponse (res) { + //刷新token + if (!res.headers) { + if (res.getResponseHeader("vol_exp") == "1") { + replaceToken(); + } + } + else if (res.headers.vol_exp == "1") { + replaceToken(); } - } else if (res.headers.vol_exp == '1') { - replaceToken() - } } -const _Authorization = 'Authorization' +const _Authorization = 'Authorization'; -function showLoading(loading) { - // if (loading === undefined) { - // loading = true; - // } - if (!loading || loadingStatus) { - return - } - nextTick(() => { +function showLoading (loading) { + if (!loading || loadingStatus) { + return; + } loadingInstance = Loading.service({ - lock: true, - body: true, - text:typeof loading == 'string' ? loading : '正在处理.....', - customClass: 'http-loading', - background: 'rgba(58, 61, 63, 0.32)' - }) - }) + lock: true, + text: 'Loading', + customClass:"http-loading", + background: typeof loading == "string" ? loading : '正在处理.....', + background: 'rgba(58, 61, 63, 0.32)' + }); } -function getToken() { - return store.getters.getToken() +function getToken () { + return store.getters.getToken(); } /* @@ -124,46 +111,37 @@ function getToken() { loading是否显示遮罩层,可以传入true.false.及提示文本 config配置信息,如{timeout:3000,headers:{token:123}} */ -function post(url, params, loading, config) { - showLoading(loading) - axios.defaults.headers[_Authorization] = getToken() - - return new Promise((resolve, reject) => { - axios - .post(url, params, config) - .then( - (response) => { - resolve(response.data) - }, - (err) => { - reject(err && err.data && err.data.message ? err.data.message : '服务器处理异常') - } - ) - .catch((error) => { - reject(error) - }) - }) +function post (url, params, loading, config) { + showLoading(loading); + axios.defaults.headers[_Authorization] = getToken(); + return new Promise((resolve, reject) => { + axios.post(url, params, config) + .then(response => { + resolve(response.data); + }, err => { + reject(err && err.data && err.data.message ? err.data.message : '服务器处理异常'); + }) + .catch((error) => { + reject(error) + }) + }) } //=true异步请求时会显示遮罩层,=字符串,异步请求时遮罩层显示当前字符串 -function get(url, param, loading, config) { - showLoading(loading) - axios.defaults.headers[_Authorization] = getToken() - return new Promise((resolve, reject) => { - axios - .get(url, config) - .then( - (response) => { - resolve(response.data) - }, - (err) => { - reject(err) - } - ) - .catch((error) => { - reject(error) - }) - }) +function get (url, param, loading, config) { + showLoading(loading); + axios.defaults.headers[_Authorization] = getToken(); + return new Promise((resolve, reject) => { + axios.get(url, config) + .then(response => { + resolve(response.data) + }, err => { + reject(err) + }) + .catch((error) => { + reject(error) + }) + }) } function getDataViewAccessToken(params, callback) { @@ -194,94 +172,96 @@ function getDataViewAccessToken(params, callback) { //params:请求参数 //fileName:下载的文件名 //loading:是否显示加载状态 -function download(url, params, fileName, loading, callback) { - fileName = fileName.replace('>', '>').replace('<', '<') - post(url, params, loading, { responseType: 'blob' }).then((content) => { - const blob = new Blob([content]) - if ('download' in document.createElement('a')) { - // 非IE下载 - const elink = document.createElement('a') - elink.download = fileName - elink.style.display = 'none' - elink.href = URL.createObjectURL(blob) - document.body.appendChild(elink) - elink.click() - URL.revokeObjectURL(elink.href) // 释放URL 对象 - document.body.removeChild(elink) - } else { - // IE10+下载 - navigator.msSaveBlob(blob, fileName) - } - callback && callback() - }) +function download (url, params, fileName, loading,callback) { + fileName = fileName.replace(">", ">").replace("<", "<"); + post(url, params, loading, { responseType: 'blob' }).then(content => { + const blob = new Blob([content]) + if ('download' in document.createElement('a')) { // 非IE下载 + const elink = document.createElement('a') + elink.download = fileName + elink.style.display = 'none' + elink.href = URL.createObjectURL(blob) + document.body.appendChild(elink) + elink.click() + URL.revokeObjectURL(elink.href) // 释放URL 对象 + document.body.removeChild(elink) + } else { // IE10+下载 + navigator.msSaveBlob(blob, fileName) + } + callback?.(); + }) } -function createXHR() { - if (XMLHttpRequest) { - return new XMLHttpRequest() - } - if (ActiveXObject) { - if (typeof arguments.callee.activeXString != 'string') { - var versions = ['MSXML2.XMLHttp.6.0', 'MSXML2.XMLHttp', 'MSXML2.XMLHttp.3.0'] - for (var i = 0; i < versions.length; i++) { - try { - new ActiveXObject(versions[i]) - arguments.callee.activeXString = versions[i] - break - } catch (e) { - console.log(e) + +function createXHR () { + if (XMLHttpRequest) { + return new XMLHttpRequest(); + } + if (ActiveXObject) { + if (typeof arguments.callee.activeXString != "string") { + var versions = [ + "MSXML2.XMLHttp.6.0", + "MSXML2.XMLHttp", + "MSXML2.XMLHttp.3.0" + ]; + for (var i = 0; i < versions.length; i++) { + try { + new ActiveXObject(versions[i]); + arguments.callee.activeXString = versions[i]; + break; + } catch (e) { + console.log(e); + } + } } - } + return new ActiveXObject(arguments.callee.activeXString); } - return new ActiveXObject(arguments.callee.activeXString) - } } -function redirect(responseText, message) { - try { - let responseData = typeof responseText == 'string' ? JSON.parse(responseText) : responseText - if ( - (responseData.hasOwnProperty('code') && responseData.code == 401) || - (responseData.data && responseData.data.code == 401) - ) { - closeLoading() - toLogin() - } else { - if (message) { +function redirect (responseText, message) { + try { + let responseData = typeof responseText == 'string' && responseText !== "" ? JSON.parse(responseText) : responseText; + if ((responseData.hasOwnProperty('code') && responseData.code == 401) + || (responseData.data && responseData.data.code == 401)) { + closeLoading(); + toLogin(); + } else { + if (message) { + Message.error({ + showClose: true, + message: message, + type: 'error' + }); + } + } + } catch (error) { + console.log(error); Message.error({ - showClose: true, - message: message, - type: 'error' - }) - } + showClose: true, + message: responseText, + type: 'error' + }); } - } catch (error) { - console.log(error) - Message.error({ - showClose: true, - message: responseText, - type: 'error' - }) - } } -function toLogin() { - // const vueinstance= getCurrentInstance(); - if (window.location.hash) { - window.location.href = window.location.origin + '/#/login' - return - } - window.location.href = window.location.origin + '/login' - // router.push({ path: '/login', params: { r: Math.random() } }); + +function toLogin () { + // const vueinstance= getCurrentInstance(); + if (window.location.hash) { + window.location.href = window.location.origin + '/#/login' + return + } + window.location.href = window.location.origin + '/login' + // router.push({ path: '/login', params: { r: Math.random() } }); } //动态刷新token -function replaceToken() { - ajax({ - url: '/api/User/replaceToken', - param: {}, - json: true, - success: function (x) { - if (x.status) { +function replaceToken () { + ajax({ + url: "/api/User/replaceToken", + param: {}, + json: true, + success: function (x) { + if (x.status) { let userInfo = store.getters.getUserInfo() if (x.data && x.data.accessToken) { userInfo.token = x.data.token @@ -294,84 +274,68 @@ function replaceToken() { } else { console.log(x.message) toLogin() - } - }, - errror: function (ex) { - console.log(ex) - toLogin() - }, - type: 'post', - async: false - }) + } + }, + errror: function (ex) { + console.log(ex); + toLogin(); + }, + type: "post", + async: false + }); + + } -function ajax(param) { - let httpParam = Object.assign( - { - url: '', - headers: {}, - param: {}, - json: true, - success: function () {}, - errror: function () {}, - type: 'post', - async: true - }, - param - ) +function ajax (param) { + let httpParam = + Object.assign({ + url: '', headers: {}, + param: {}, json: true, + success: function () { }, + errror: function () { }, + type: 'post', async: true + }, param); - httpParam.url = axios.defaults.baseURL + httpParam.url.replace(/\/?/, '') - httpParam.headers[_Authorization] = getToken() - httpParam.headers['serviceId'] = localStorage.getItem('serviceId') - httpParam.headers['deptId'] = localStorage.getItem('deptId') - var xhr = createXHR() - xhr.onreadystatechange = function () { - if (xhr.status == 403 || xhr.status == 401) { - redirect(xhr.responseText) - return - } - checkResponse(xhr) - if (xhr.readyState == 4 && xhr.status == 200) { - httpParam.success(httpParam.json ? JSON.parse(xhr.responseText) : xhr.responseText) - return + httpParam.url = axios.defaults.baseURL + httpParam.url.replace(/\/?/, ''); + httpParam.headers[_Authorization] = getToken(); + var xhr = createXHR(); + xhr.onreadystatechange = function () { + if (xhr.status == 403 || xhr.status == 401) { + redirect(xhr.responseText); + return; + } + checkResponse(xhr); + if (xhr.readyState == 4 && xhr.status == 200) { + httpParam.success(httpParam.json ? JSON.parse(xhr.responseText) : xhr.responseText); + return; + } + if (xhr.status != 0 && xhr.readyState != 1) { + httpParam.errror(xhr); + } + }; + //初始化请求 + xhr.open( + httpParam.type, + httpParam.url, + httpParam.async + ); + xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + for (const key in httpParam.headers) { + xhr.setRequestHeader(key, httpParam.headers[key]); } - if (xhr.status != 0 && xhr.readyState != 1) { - httpParam.errror(xhr) + + try { + xhr.send(JSON.stringify(httpParam.param)); + } catch (error) { + toLogin(); } - } - //初始化请求 - xhr.open(httpParam.type, httpParam.url, httpParam.async) - xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded') - for (const key in httpParam.headers) { - xhr.setRequestHeader(key, httpParam.headers[key]) - } - let dataStr = '' - for (const key in httpParam.param) { - dataStr += key + '=' + httpParam.param[key] - } - try { - xhr.send(dataStr) - } catch (error) { - toLogin() - } } ajax.post = function (url, param, success, errror) { - ajax({ - url: url, - param: param, - success: success, - error: errror, - type: 'post' - }) + ajax({ url: url, param: param, success: success, error: errror, type: 'post' }) } ajax.get = function (url, param, success, errror) { - ajax({ - url: url, - param: param, - success: success, - error: errror, - type: 'get' - }) + ajax({ url: url, param: param, success: success, error: errror, type: 'get' }) } -export default { post, get, download, getDataViewAccessToken, ajax, ipAddress } +export default { post, get,download, ajax, ipAddress } diff --git "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/permission.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/permission.js" index a5014f4e8..34cbf82b1 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/permission.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/permission.js" @@ -1,47 +1,53 @@ + import http from '@/api/http.js' -import buttons from './buttons.js' -import store from '@/store/index.js' +import buttons from '@/api/buttons.js' +import store from '@/store/index' import { useRouter } from 'vue-router' let permission = { - getMenu() { - return http.get('/api/getTreeMenu') - }, - getButtons(path, extra, table, tableName) { - //extra自定额外按钮 + getMenu() { + return http.get("/api/getTreeMenu"); + }, getButtons(path, extra, table, tableName) {//extra自定额外按钮 + //extra自定额外按钮 //table获取指定表的权限 if (table) { - table = '/' + table - } - let permission = store.getters.getPermission(table || path) - if (!permission) { - permission = store.getters.getPermission(path.substring(1)) + table = '/' + table; + } + let permission = store.getters.getPermission(table || path); if (!permission) { - permission = store.getters.getPermission('/' + tableName) + permission = store.getters.getPermission(path.substring(1)); if (!permission) { - to401() - return + if ((tableName || '').indexOf('/') != -1) { + let arr = tableName.split('/'); + tableName = arr[arr.length - 1]; + } + permission = store.getters.getPermission('/' + tableName); + if (!permission) { + permission = (store.state.permission||[]).find(x => x.tableName ==tableName); + if (!permission) { + to401(); + return; + } + } } } + + let permissions = permission.permission; //.split(','); + let gridButtons = buttons.filter((item) => { + return !item.value || permissions.indexOf(item.value) != -1; + }); + if (extra && extra instanceof Array) { + gridButtons.push(...extra); + } + return gridButtons; + }, to401() { + to401(); } - - let permissions = permission.permission //.split(','); - let gridButtons = buttons.filter((item) => { - return !item.value || permissions.indexOf(item.value) != -1 - }) - if (extra && extra instanceof Array) { - gridButtons.push(...extra) - } - return gridButtons - }, - to401() { - to401() - } } function to401() { - const router = useRouter() - router.push({ - path: '/401' - }) + const router = useRouter(); + router.push({ + path: '/401' + }); } -export default permission +export default permission; \ 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/useTest.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/useTest.js" index 2874e76ff..d4d7be188 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/useTest.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/api/useTest.js" @@ -1,9 +1,9 @@ const tipxx = { - install: function (vue) { - alert(1) - vue.prototype.$tip = function () { - alert('测试use') + install: function (vue) { + alert(1); + vue.prototype.$tip = function () { + alert('测试use') + }; } - } } -export default { tipxx } +export default { tipxx } \ 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/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/ViewGrid/ViewGridAudit.vue" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/ViewGrid/ViewGridAudit.vue" index 0a72596c0..e49ec9179 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/ViewGrid/ViewGridAudit.vue" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/components/basic/ViewGrid/ViewGridAudit.vue" @@ -97,7 +97,7 @@ - - +.menu-icon { + font-size: 18px; + margin-right: 6px; +} + 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..62f6e0b2f 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" @@ -1,58 +1,25 @@ - - - - - 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..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" @@ -36,47 +36,81 @@ - \ 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/charts/chartOptions.js" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chartOptions.js" index 2ec6bdabc..6c92fe049 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chartOptions.js" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/charts/chartOptions.js" @@ -1,212 +1,165 @@ -let options= { - bar:{ - // title: { - // text: 'World Population' - // }, - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'shadow' - } - }, - // legend: {}, - grid: { - top:10, - left: '3%', - right: '4%', - bottom: '3%', - containLabel: true - }, - xAxis: { - type: 'value', - boundaryGap: [0, 0.01] - }, - yAxis: { - type: 'category', - data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World'] +export const bar = { + // title: { + // text: 'World Population' + // }, + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + } + }, + // legend: {}, + grid: { + top: 10, + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + xAxis: { + type: 'value', + boundaryGap: [0, 0.01] + }, + yAxis: { + type: 'category', + data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World'] + }, + series: [ + { + name: '2011', + type: 'bar', + data: [18203, 23489, 29034, 14970, 31744, 60230] + }, + { + name: '2012', + type: 'bar', + data: [19325, 23438, 31000, 11594, 24141, 6807] + } + ] +} + +export const pie = { + tooltip: { + trigger: 'item', + formatter: '{a}
{b} : {c} ({d}%)' + }, + legend: { + top: 20, + // orient: "vertical", + // right: 300, + // top: 200, + // bottom: 20, + data: ['图例1', '图例2', '图例3', '图例4', '图例5', '图例6', '图例7'] + }, + series: [ + { + name: '图例1', + type: 'pie', + radius: ['40%', '70%'], + selectedMode: 'single', + itemStyle: { + borderRadius: 6, + borderColor: '#fff', + borderWidth: 2 }, - series: [ + data: [ { - name: '2011', - type: 'bar', - data: [18203, 23489, 29034, 14970, 31744, 60230] + value: 2563, + name: '图例1', + itemStyle: { + color: 'rgb(45, 140, 240)' + } }, { - name: '2012', - type: 'bar', - data: [19325, 23438, 31000, 11594, 24141, 6807] - } - ] - }, - pie: { - tooltip: { - trigger: "item", - formatter: "{a}
{b} : {c} ({d}%)" - }, - legend: { - top: 20, - // orient: "vertical", - // right: 300, - // top: 200, - // bottom: 20, - data: [ - "图例1", - "图例2", - "图例3", - "图例4", - "图例5", - "图例6", - "图例7" - ] - }, - series: [ + value: 727, + name: '图例2', + itemStyle: { + color: 'rgb(92, 173, 255)' + } + }, { - name: "图例1", - type: "pie", - radius: ['40%', '70%'], - selectedMode: "single", + value: 2182, + name: '图例3', itemStyle: { - borderRadius: 6, - borderColor: '#fff', - borderWidth: 2 - }, - data: [ - { - value: 2563, - name: "图例1", - itemStyle: { - color: "rgb(45, 140, 240)" - } - }, - { - value: 727, - name: "图例2", - itemStyle: { - color: "rgb(92, 173, 255)" - } - }, - { - value: 2182, - name: "图例3", - itemStyle: { - color: "rgb(25, 190, 107)" - } - }, - { - value: 1419, - name: "图例4", - itemStyle: { - color: "#00e5ff" - } - }, - { - value: 984, - name: "图例5", - itemStyle: { - color: "#ff80ab" - } - }, - { - value: 870, - name: "图例6", - itemStyle: { - color: "rgb(237, 64, 20)" - } - }, - { - value: 1670, - name: "图例7", - itemStyle: { - color: "#ffb445" - } - } - ] - } - ] - }, - line: { - legend: { - data: ["邮件营销", "联盟广告"] - }, - grid: { - left: "3%", - right: "4%", - bottom: "3%", - containLabel: true - }, - toolbox: { - feature: { - saveAsImage: {} - } - }, - xAxis: { - type: "category", - boundaryGap: false, - data: [ - "1月", - "2月", - "3月", - "4月", - "5月", - "6月", - "7月", - "8月", - "9月", - "10月", - "11月", - "12月" - ] - }, - yAxis: { - type: "value" - }, - series: [ + color: 'rgb(25, 190, 107)' + } + }, + { + value: 1419, + name: '图例4', + itemStyle: { + color: '#00e5ff' + } + }, { - name: "邮件营销", - type: "line", - stack: "总量", + value: 984, + name: '图例5', itemStyle: { - color: "rgb(25, 190, 107)" - }, - smooth: true, - data: [ - 7.0, - 6.9, - 9.5, - 12.5, - 18.2, - 21.5, - 22.5, - 23.3, - 18.3, - 13.9, - 9.6 - ] + color: '#ff80ab' + } }, { - name: "联盟广告", - type: "line", - stack: "总量", - smooth: true, + value: 870, + name: '图例6', itemStyle: { - color: "rgb(92, 173, 255)" - }, - data: [ - 7.0, - 6.9, - 9.5, - 14.5, - 18.2, - 21.5, - 22.5, - 21.3, - 18.3, - 13.9, - 9.6 - ] + color: 'rgb(237, 64, 20)' + } + }, + { + value: 1670, + name: '图例7', + itemStyle: { + color: '#ffb445' + } } ] } - } + ] +} - export default options; \ No newline at end of file +export const line = { + legend: { + data: ['邮件营销', '联盟广告'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '邮件营销', + type: 'line', + stack: '总量', + itemStyle: { + color: 'rgb(25, 190, 107)' + }, + smooth: true, + data: [7.0, 6.9, 9.5, 12.5, 18.2, 21.5, 22.5, 23.3, 18.3, 13.9, 9.6] + }, + { + name: '联盟广告', + type: 'line', + stack: '总量', + smooth: true, + itemStyle: { + color: 'rgb(92, 173, 255)' + }, + data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 22.5, 21.3, 18.3, 13.9, 9.6] + } + ] +} 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 25d4f1092..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" @@ -2,92 +2,97 @@
- -
+ +
- - + +
- - + +
- -
+ +
- + 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..0fc102e0e --- /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..7349033dc --- /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 3eaf63def..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" @@ -96,10 +96,7 @@ var chart2 = { color: 'rgba(180, 180, 180, 0.2)' }, itemStyle: { - - normal: { - barBorderRadius: [4, 4, 0, 0] - } + borderRadius: [4, 4, 0, 0] }, data: [ 730, 620, 420, 932, 701, 834, 890] }, @@ -133,7 +130,6 @@ var chart3 = { }, series: [ { - name: '框架支持功能(Vue2.0、Vue3版本)', type: 'pie', radius: '55%', 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/index/index.less" "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/index/index.less" index c872e9114..477b3d629 100644 --- "a/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/index/index.less" +++ "b/v3\347\211\210\346\234\254\344\273\243\347\240\201/Vol.Vue3.Vite/src/views/index/index.less" @@ -97,9 +97,9 @@ .header-info { padding-right: 20px; - display: inline-block; + display: flex; + //display: inline-block; // position: absolute; - height: 100%; } .header-info > div { @@ -107,18 +107,6 @@ height: 100%; } -.user-header { - background: white; - height: 52px; - width: 52px; - border-radius: 50%; - margin-right: 0px; - top: 4px; - left: 7px; - position: relative; - border: 1px solid #dfdfdf; -} - .project-name { line-height: 60px; padding: 0 50px 0 20px; @@ -140,21 +128,32 @@ } .vol-header .user { - text-align: left; - padding: 0 12px; - position: relative; height: 100%; - display: flex; - flex-direction: column; - // height: 60px; - justify-content: center; - span:last-child { - font-size: 12px; + display: inline-flex; + gap: 8px; + align-items: center; + + .user-header { + background: white; + height: 52px; + width: 52px; + border-radius: 50%; + border: 1px solid #dfdfdf; + } + + p { + text-align: left; + padding: 0 12px 0 px; + display: flex; + flex-direction: column; + justify-content: center; + span:last-child { + font-size: 12px; + } } } .vol-header .settings { - padding-top: 10px; color: #d4d2d2; } @@ -162,10 +161,6 @@ position: relative; } -.header-info:hover { - cursor: pointer; -} - .header-navigation { cursor: pointer; box-shadow: none; @@ -218,15 +213,19 @@ } .h-link { - line-height: 59px; -} - -.h-link a { font-size: 14px; text-decoration: none; padding: 0px 15px; - /* height: 60px; */ + height: 100%; display: inline-block; + i, + .user-header { + line-height: 60px; + } + + :hover { + cursor: pointer; + } } img[src=''], @@ -248,24 +247,20 @@ img:not([src]) { background-color: #272929; } - .h-link a:hover { - background: #0c0202; - } - a { color: #f2f2f2; } - .h-link a:hover { - color: #dfdfdf; - } - - .h-link .actived { - border-bottom: 2px solid white; - } - - .h-link .actived a { + .h-link { color: white !important; + &:hover { + background: #0c0202; + color: #dfdfdf; + } + + .actived { + border-bottom: 2px solid white; + } } .vol-header .user { @@ -335,19 +330,15 @@ img:not([src]) { color: #dcdfe6; } - .h-link a:hover { - background: #d71212; - } - - .h-link .actived { - border-bottom: 2px solid white; - } - - .h-link a, - .h-link .actived a, - .vol-header .settings, - .vol-header .user { + .h-link { color: white; + &:hover { + background: #d71212; + } + + .actived { + border-bottom: 2px solid white; + } } .vol-header .header-text { @@ -377,19 +368,16 @@ img:not([src]) { background-color: rgb(255, 153, 0); } - .h-link a:hover { - background: #c97901; - } + .h-link { + color: white; - .h-link .actived { - border-bottom: 2px solid white; - } + &:hover { + background: #c97901; + } - .h-link a, - .h-link .actived a, - .vol-header .settings, - .vol-header .user { - color: white; + .actived { + border-bottom: 2px solid white; + } } .vol-header .header-text { @@ -420,19 +408,15 @@ img:not([src]) { background-color: rgb(25, 190, 107); } - .h-link a:hover { - background: #329103; - } - - .h-link .actived { - border-bottom: 2px solid white; - } - - .h-link a, - .h-link .actived a, - .vol-header .settings, - .vol-header .user { + .h-link { color: white; + &:hover { + background: #329103; + } + + h-link .actived { + border-bottom: 2px solid white; + } } .vol-header .header-text { @@ -463,19 +447,15 @@ img:not([src]) { background-color: rgb(45, 140, 240); } - .h-link a:hover { - background: #0170e3; - } - - .h-link .actived { - border-bottom: 2px solid white; - } - - .h-link a, - .h-link .actived a, - .vol-header .settings, - .vol-header .user { + .h-link { color: white; + &:hover { + background: #0170e3; + } + + .actived { + border-bottom: 2px solid white; + } } .vol-header .header-text { @@ -500,13 +480,11 @@ img:not([src]) { .header { background-color: #434956; } - - .h-link a:hover { - background: #eeeeee; - } - - .h-link a { + .h-link { color: #211f1f; + &:hover { + background: #eeeeee; + } } .header-navigation { 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..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" @@ -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 2bd0f13dd..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 @@
@@ -15,7 +15,7 @@
- +

{{ userInfo.userName }} @@ -25,7 +25,7 @@

修改密码 - 修改头像

@@ -124,9 +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, fields: { oldPwd: "", newPwd: "", newPwd1: "" }, @@ -277,5 +274,3 @@ img:not([src]) { color: #282828; } - - 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..d553fc4bb --- /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..cc0b0639f --- /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 @@ + + + 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..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,82 +1,84 @@ import { fileURLToPath } from 'node:url' -import commonjs from 'vite-plugin-commonjs' -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: [ - commonjs(), - // commonjs({ - // // 这里可以配置插件的选项,例如指定需要转换的模块等 - // include: 'node_modules/**', // 包含node_modules下的所有模块 - // }), - 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)) + } } } }) 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)), + }, + }), +)