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 @@
- 1、 onInit(){ this.setFiexdSearchForm(true); //设置固定显示所有查询条件}
+
+
+ 设置type='label'以纯文本方式显示,设置readonly=true以组件只读方式显示。具体使用见:框架文档->组件api->VolForm。点击查看文档
+ 1、后台实体复用:同一个实体,不同的接口验证的字段不同,需要注册对应字段。 2、普通多参数验证:普通参数可用于任何参数名相同的接口。 3、具体使用参照:ObjectActionValidatorExampleController,具体注入验证规则参照:ValidatorContainer.cs 根据组件api文档中voltable配置table显示与数据加载,更多功能参数配置见组件api->voltable 如果需要更详情的table编辑信息及其他操作见:组件api->VolTable组件
+
-
-
+
+
+
+ {{ file.name }}
+
{{ formatterDate(scope.row, column) }}
订单详情
+
+
+
+
+ 订单明细
+
+ SellOrder.js文件中的扩展SellOrder表显示body信息,你可以在此处定义需要显示的信息
+
+
{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 @@
+ 两列表单(数据源可后台自动绑定/也可手动绑定)
+
+ 其他组件
+ 手动打开tabs,详细使用见:框架文档->前端开发->手动打开tabs
+ 弹出框/post/get请求(http请求代码位置:api->http.js)
+ vuex状态管理,vuex代码路径:store->index.js
+ 上传excel文件
+
+ -- 此后台验证封装目的是为了增加代码复用性、尽量避免自己写if esle判断提交的参数。
+
+
+ 验证所有普通参数
+ 只验证手机号
+ 验证字符长度与数字大小
+ 实体校验指定字段:用户名、密码
+ 实体校验指定字段:密码
+ 实体字段:用户名、密码,普通参数
+
+
+ 表单数据
+
+
{{ userInfo.userName }} @@ -25,7 +25,7 @@
1、VolTable基于Element Table封装的常用功能。
++ 2、功能包括,双击编辑:select、select联动、switch、日期、图片显示与预览、单元格文件下载、input、render动态渲染等组件。 +
++ 3、最重要的是,封装后的组件功能包括:自动绑定下拉框数据源、自动从后台加载数据、分页、及table输入验证等常用功能(只需要照着文档配置json即可完成)。 +
++ 4、具体使用见:框架文档->组件api->voltable。点击查看文档 + +
++ 1、只需要配置好列信息即可从后台加载(自动求和见代码中的备注说明或table组件api)。 +
++ 2、如果需要筛选条件,在loadTableBefore方法中按demo格式提交查询参数即可 +
++ 3、具体使用见:框架文档->组件api->voltable。点击查看文档 + +
+1、日期(内容)格式化。
+2、单元格点击事件、双击事件。
+3、单元格背景颜色、文字换行等...
++ 4、具体使用见:框架文档->组件api->voltable。点击查看文档 + +
+