vue3的js和ts代码上传

This commit is contained in:
zhuoda 2022-10-24 20:11:58 +08:00
parent 0996e90df0
commit 207b949484
562 changed files with 103071 additions and 0 deletions

1
.gitignore vendored
View File

@ -22,4 +22,5 @@ target/
### front ### ### front ###
**/dist **/dist
**/node_modules **/node_modules
**/.vscode

View File

@ -0,0 +1,2 @@
VITE_APP_PROJECT_TITLE = 'SmartAdmin'

View File

@ -0,0 +1,8 @@
VITE_APP_API_URL = 'http://127.0.0.1:1024'
VITE_APP_PROJECT_TITLE = 'SmartAdmin 开发环境(Dev)'
VITE_APP_PROFILE = 'dev'
VITE_APP_MODE = 'development'

View File

@ -0,0 +1,8 @@
VITE_APP_API_URL = 'http://127.0.0.1:1024'
VITE_APP_PROJECT_TITLE = 'SmartAdmin 本地环境(Localhost)'
VITE_APP_PROFILE = 'local'
VITE_APP_MODE = 'local'

View File

@ -0,0 +1,8 @@
VITE_APP_API_URL = 'http://127.0.0.1:1024'
VITE_APP_PROJECT_TITLE = 'SmartAdmin 预发布环境(Pre)'
VITE_APP_PROFILE = 'pre'
VITE_APP_MODE = 'production'

View File

@ -0,0 +1,8 @@
VITE_APP_API_URL = 'http://127.0.0.1:1024'
VITE_APP_PROJECT_TITLE = 'SmartAdmin'
VITE_APP_PROFILE = 'prod'
VITE_APP_MODE = 'production'

View File

@ -0,0 +1,8 @@
VITE_APP_API_URL = 'http://127.0.0.1:1024'
VITE_APP_PROJECT_TITLE = 'SmartAdmin 测试环境(Test)'
VITE_APP_PROFILE = 'test'
VITE_APP_MODE = 'development'

View File

@ -0,0 +1,18 @@
*.sh
node_modules
lib
*.md
*.woff
*.ttf
.vscode
.idea
dist
public
/docs
.husky
.local
.localhost
/bin
Dockerfile
src/assets

View File

@ -0,0 +1,66 @@
/*
* @Description:
* @Author: zhuoda
* @Date: 2021-11-05
* @LastEditTime: 2022-07-05
* @LastEditors: zhuoda
*/
module.exports = {
root: true, //此项是用来告诉eslint找当前配置文件不能往父级查找
env: {
browser: true,
es2021: true,
node: true,
},
parser: 'vue-eslint-parser', //使用vue-eslint-parser 来解析vue文件中的 template和script
parserOptions: {
ecmaVersion: 12, // 默认情况下ESLint使用的是ECMAScript5语法此处我们设置的选项是 es12
sourceType: 'module', // 指定js导入的方式
},
extends: ['plugin:vue/vue3-essential', 'eslint:recommended', 'plugin:vue/base'],
globals: {
defineProps: 'readonly',
defineEmits: 'readonly',
defineExpose: 'readonly',
withDefaults: 'readonly',
},
plugins: ['vue'],
rules: {
'no-unused-vars': [
'error',
// we are only using this rule to check for unused arguments since TS
// catches unused variables but not args.
{ varsIgnorePattern: '.*', args: 'none' },
],
'space-before-function-paren': 'off',
'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
'vue/require-default-prop': 'off',
'vue/multi-word-component-names': [
'error',
{
ignores: ['index'], //需要忽略的组件名
},
],
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
// Enable vue/script-setup-uses-vars rule
'vue/script-setup-uses-vars': 'error',
},
};

View File

@ -0,0 +1,6 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
.idea

View File

@ -0,0 +1,30 @@
/*
* 代码格式化配置
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-12 14:44:18
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
module.exports = {
printWidth: 150, // 每行代码长度默认80
tabWidth: 2, // 缩进空格数
useTabs: false, //不用tab缩进
semi: true, //// 在语句末尾打印分号
singleQuote: true, // 使用单引号而不是双引号
vueIndentScriptAndStyle: true, //Vue文件脚本和样式标签缩进
quoteProps: 'as-needed', // 更改引用对象属性的时间 可选值"<as-needed|consistent|preserve>"
jsxSingleQuote: true, // 在JSX中使用单引号而不是双引号
trailingComma: 'es5', //多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>"默认none
bracketSpacing: true, // 在对象文字中的括号之间打印空格
jsxBracketSameLine: false, //jsx 标签的反尖括号需要换行
arrowParens: 'always', // 在单独的箭头函数参数周围包括括号 always(x) => x \ avoidx => x
rangeStart: 0, // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码
rangeEnd: Infinity,
requirePragma: false, // 指定要使用的解析器,不需要写文件开头的 @prettier
insertPragma: false, // 不需要自动在文件开头插入 @prettier
proseWrap: 'preserve', // 使用默认的折行标准 always\never\preserve
htmlWhitespaceSensitivity: 'css', // 指定HTML文件的全局空格敏感度 css\strict\ignore
endOfLine: 'auto', // 因为prettier的规范和eslint的换行规则不同所以这个必须配置。要不然每次打开文件都会有一堆的警告;换行符使用 lf 结尾是 可选值"<auto|lf|crlf|cr
};

View File

@ -0,0 +1,3 @@
/dist/*
/public/*
public/*

View File

@ -0,0 +1,70 @@
module.exports = {
root: true,
plugins: ['stylelint-order'],
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
rules: {
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['global'],
},
],
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: ['v-deep'],
},
],
'at-rule-no-unknown': [
true,
{
ignoreAtRules: [
'tailwind',
'apply',
'variants',
'responsive',
'screen',
'function',
'if',
'each',
'include',
'mixin',
],
},
],
'no-empty-source': null,
'named-grid-areas-no-invalid': null,
'unicode-bom': 'never',
'no-descending-specificity': null,
'font-family-no-missing-generic-family-keyword': null,
'declaration-colon-space-after': 'always-single-line',
'declaration-colon-space-before': 'never',
// 'declaration-block-trailing-semicolon': 'always',
'rule-empty-line-before': [
'always',
{
ignore: ['after-comment', 'first-nested'],
},
],
'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
'order/order': [
[
'dollar-variables',
'custom-properties',
'at-rules',
'declarations',
{
type: 'at-rule',
name: 'supports',
},
{
type: 'at-rule',
name: 'media',
},
'rules',
],
{ severity: 'warning' },
],
},
ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
};

View File

@ -0,0 +1,24 @@
<!--
* @Description:
* @Author: zhuoda
* @Date: 2021-08-03
* @LastEditTime: 2022-06-23
* @LastEditors: zhuoda
-->
<!DOCTYPE html>
<html lang="en" id="htmlRoot">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="renderer" content="webkit"/>
<meta name="viewport"
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
/>
<title>SmartAdmin 2.X</title>
<link rel="icon" href="/favicon.ico"/>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES6",
"jsx":"preserve",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"paths": {
"/@/*": [
"src/*"
]
}
},
"exclude": [
"node_modules"
]
}

View File

@ -0,0 +1,75 @@
{
"name":"SmartAdmin",
"version": "2.0.0",
"author": {
"name": "1024创新实验室1024lab",
"email": "lab1024@163.com",
"url": "https://www.1024lab.net"
},
"license": "MIT",
"homepage": "https://smartadmin.1024lab.net",
"scripts": {
"dev": "vite",
"test": "vite build --mode test",
"pre": "vite build --mode pre",
"prod": "vite build --mode production",
"localhost": "vite --mode localhost",
"build": "vue-tsc --noEmit && vite build",
"serve": "vite preview"
},
"dependencies": {
"@ant-design/icons-vue": "^6.1.0",
"@wangeditor/editor": "^5.0.1",
"@wangeditor/editor-for-vue": "^5.1.11",
"ant-design-vue": "3.2.5",
"axios": "~0.27.2",
"clipboard": "~2.0.11",
"crypto-js": "~4.1.1",
"decimal.js": "^10.3.1",
"diff": "^5.1.0",
"diff2html": "^3.4.18",
"echarts": "^5.1.2",
"highlight.js": "^11.6.0",
"js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"lunar-javascript": "^1.2.32",
"mitt": "^3.0.0",
"nprogress": "^0.2.0",
"pinia": "~2.0.14",
"sortablejs": "^1.15.0",
"ua-parser-js": "^1.0.2",
"v-viewer": "~1.6.4",
"vue": "~3.2.26",
"vue-i18n": "^9.1.10",
"vue-router": "~4.0.15",
"vue3-json-viewer": "^2.2.2"
},
"devDependencies": {
"@vitejs/plugin-vue": "~2.3.3",
"@vue/compiler-sfc": "~3.2.26",
"eslint": "^8.16.0",
"eslint-config-prettier": "~8.5.0",
"eslint-plugin-prettier": "~4.0.0",
"eslint-plugin-vue": "~9.1.0",
"less": "~4.1.1",
"less-loader": "~10.0.1",
"prettier": "~2.6.2",
"rimraf": "^3.0.2",
"stylelint": "~14.8.5",
"stylelint-config-prettier": "~9.0.3",
"stylelint-config-standard": "~25.0.0",
"stylelint-order": "~5.0.0",
"vite": "~2.9.9",
"vite-plugin-mock": "~2.9.6",
"vite-plugin-optimize-persist": "^0.1.2",
"vite-plugin-package-config": "^0.1.1",
"vue-eslint-parser": "~9.0.2"
},
"engines": {
"node": ">=14"
},
"repository": {
"type": "git",
"url": "https://github.com/1024-lab/smart-admin.git"
}
}

View File

@ -0,0 +1,4 @@
module.exports = {
plugins: {
},
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,34 @@
<!--
* 主应用页面
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-12 23:46:47
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<a-config-provider :locale="antdLocale">
<!---全局loading--->
<a-spin :spinning="spinning" tip="稍等片刻,我在拼命加载中..." size="large">
<!--- 路由 -->
<RouterView />
</a-spin>
</a-config-provider>
</template>
<script setup>
import dayjs from 'dayjs';
import { computed } from 'vue';
import { messages } from '/@/i18n/index';
import { useAppConfigStore } from '/@/store/modules/system/app-config';
import { useSpinStore } from './store/modules/system/spin';
const antdLocale = computed(() => messages[useAppConfigStore().language].antdLocale);
const dayjsLocale = computed(() => messages[useAppConfigStore().language].dayjsLocale);
dayjs.locale(dayjsLocale);
let spinStore = useSpinStore();
const spinning = computed(() => spinStore.loading);
</script>

View File

@ -0,0 +1,34 @@
/*
* 类目api
*
* @Author: 卓大
* @Date: 2022-09-03 21:35:00
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { getRequest, postRequest } from '/@/lib/axios';
export const categoryApi = {
// 添加类目 @author 卓大
addCategory: (param) => {
return postRequest('/category/add', param);
},
// GET
// 删除类目 @author 卓大
deleteCategoryById: (categoryId) => {
return getRequest(`/category/delete/${categoryId}`);
},
// 查询类目层级树 @author 卓大
queryCategoryTree: (param) => {
return postRequest('/category/tree', param);
},
// 更新类目 @author 卓大
updateCategory: (param) => {
return postRequest('/category/update', param);
},
// 查询类目详情 @author 卓大
getCategory: (categoryId) => {
return getRequest(`/category/${categoryId}`);
},
};

View File

@ -0,0 +1,31 @@
/*
* @Description:
* @Author: zhuoda
* @Date: 2021-11-05
* @LastEditTime: 2022-06-23
* @LastEditors: zhuoda
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const goodsApi = {
// 添加商品 @author zhuoda
addGoods: (param) => {
return postRequest('/goods/add', param);
},
// 删除 @author zhuoda
deleteGoods: (goodsId) => {
return getRequest(`/goods/delete/${goodsId}`);
},
// 批量 @author zhuoda
batchDelete: (goodsIdList) => {
return postRequest('/goods/batchDelete', goodsIdList);
},
// 分页查询 @author zhuoda
queryGoodsList: (param) => {
return postRequest('/goods/query', param);
},
// 更新商品 @author zhuoda
updateGoods: (param) => {
return postRequest('/goods/update', param);
},
};

View File

@ -0,0 +1,42 @@
/*
* 银行卡
*
* @Author: 善逸
* @Date: 2022-09-03 21:42:08
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const bankApi = {
// 新建银行信息 @author 善逸
create: (param) => {
return postRequest('/oa/bank/create', param);
},
// 删除银行信息 @author 善逸
delete: (bankId) => {
return getRequest(`/oa/bank/delete/${bankId}`);
},
// 查询银行信息详情 @author 善逸
detail: (bankId) => {
return getRequest(`/oa/bank/get/${bankId}`);
},
// 分页查询银行信息 @author 善逸
pageQuery: (param) => {
return postRequest('/oa/bank/page/query', param);
},
// 编辑银行信息 @author 善逸
update: (param) => {
return postRequest('/oa/bank/update', param);
},
// 根据企业ID查询不分页的银行列表 @author 善逸
queryList: (enterpriseId) => {
return getRequest(`/oa/bank/query/list/${enterpriseId}`);
},
};

View File

@ -0,0 +1,64 @@
/*
* 企业信息
*
* @Author: 开云
* @Date: 2022-09-03 21:47:28
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const enterpriseApi = {
// 新建企业 @author 开云
create: (param) => {
return postRequest('/oa/enterprise/create', param);
},
// 删除企业 @author 开云
delete: (enterpriseId) => {
return getRequest(`/oa/enterprise/delete/${enterpriseId}`);
},
// 查询企业详情 @author 开云
detail: (enterpriseId) => {
return getRequest(`/oa/enterprise/get/${enterpriseId}`);
},
// 分页查询企业模块 @author 开云
pageQuery: (param) => {
return postRequest('/oa/enterprise/page/query', param);
},
//企业列表查询 含数据范围 @author 开云
queryList: (type) => {
let query = '';
if (type) {
query = `?type=${type}`;
}
return getRequest(`/oa/enterprise/query/list${query}`);
},
// 编辑企业 @author 开云
update: (param) => {
return postRequest('/oa/enterprise/update', param);
},
// 企业全部员工List @author yandy
employeeList: (param) => {
return postRequest('/oa/enterprise/employee/list', param);
},
// 分页查询企业员工List @author 卓大
queryPageEmployeeList: (param) => {
return postRequest('/oa/enterprise/employee/queryPage', param);
},
// 添加员工 @author yandy
addEmployee: (param) => {
return postRequest('/oa/enterprise/employee/add', param);
},
// 删除员工 @author yandy
deleteEmployee: (param) => {
return postRequest('/oa/enterprise/employee/delete', param);
},
};

View File

@ -0,0 +1,44 @@
/*
* OA发票信息
*
* @Author: 善逸
* @Date: 2022-09-03 21:48:54
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const invoiceApi = {
// 新建发票信息 @author 善逸
create: (param) => {
return postRequest('/oa/invoice/create', param);
},
// 删除发票信息 @author 善逸
delete: (bankId) => {
return getRequest(`/oa/invoice/delete/${bankId}`);
},
// 查询发票信息详情 @author 善逸
detail: (bankId) => {
return getRequest(`//oa/invoice/get/${bankId}`);
},
// 分页查询发票信息 @author 善逸
pageQuery: (param) => {
return postRequest('/oa/invoice/page/query', param);
},
// 编辑发票信息 @author 善逸
update: (param) => {
return postRequest('/oa/invoice/update', param);
},
// 查询发票列表 @author 善逸
queryList: (enterpriseId) => {
return getRequest(`/oa/invoice/query/list/${enterpriseId}`);
},
};

View File

@ -0,0 +1,74 @@
/*
* @Description: 公告信息企业动态
* @version:
* @Author: zhuoda
* @Date: 2022-08-16 20:34:36
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const noticeApi = {
// ---------------- 通知公告类型 -----------------------
// 通知公告类型-获取全部 @author zhuoda
getAllNoticeTypeList() {
return getRequest('/oa/noticeType/getAll');
},
// 通知公告类型-添加 @author zhuoda
addNoticeType(name) {
return getRequest(`/oa/noticeType/add/${name}`);
},
// 通知公告类型-修改 @author zhuoda
updateNoticeType(noticeTypeId, name) {
return getRequest(`/oa/noticeType/update/${noticeTypeId}/${name}`);
},
// 通知公告类型-删除 @author zhuoda
deleteNoticeType(noticeTypeId) {
return getRequest(`/oa/noticeType/delete/${noticeTypeId}`);
},
// ---------------- 通知公告管理 -----------------------
// 通知公告-分页查询 @author zhuoda
queryNotice(param) {
return postRequest('/oa/notice/query', param);
},
// 通知公告-添加 @author zhuoda
addNotice(param) {
return postRequest('/oa/notice/add', param);
},
// 通知公告-更新 @author zhuoda
updateNotice(param) {
return postRequest('/oa/notice/update', param);
},
// 通知公告-删除 @author zhuoda
deleteNotice(noticeId) {
return getRequest(`/oa/notice/delete/${noticeId}`);
},
// 通知公告-更新详情 @author zhuoda
getUpdateNoticeInfo(noticeId) {
return getRequest(`/oa/notice/getUpdateVO/${noticeId}`);
},
// --------------------- 【员工】查看 通知公告 -------------------------
// 通知公告-员工-查看详情 @author zhuoda
view(noticeId) {
return getRequest(`/oa/notice/employee/view/${noticeId}`);
},
// 通知公告-员工-查询 @author zhuoda
queryEmployeeNotice(param) {
return postRequest('/oa/notice/employee/query', param);
},
// 【员工】通知公告-查询 查看记录 @author zhuoda
queryViewRecord(param) {
return postRequest('/oa/notice/employee/queryViewRecord', param);
},
};

View File

@ -0,0 +1,25 @@
/*
* 缓存
*
* @Author: 罗伊
* @Date: 2022-09-03 21:51:34
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const cacheApi = {
// 获取某个缓存的所有key @author 罗伊
getKeys: (cacheName) => {
return getRequest(`/support/cache/keys/${cacheName}`);
},
// 移除某个缓存 @author 罗伊
remove: (cacheName) => {
return getRequest(`/support/cache/remove/${cacheName}`);
},
// 获取所有缓存 @author 罗伊
getAllCacheNames: () => {
return getRequest('/support/cache/names');
},
};

View File

@ -0,0 +1,45 @@
/**
* 系统更新日志 api 封装
*
* @Author: 卓大
* @Date: 2022-09-26 14:53:50
* @Copyright 1024创新实验室
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const changeLogApi = {
/**
* 分页查询 @author 卓大
*/
queryPage : (param) => {
return postRequest('/changeLog/queryPage', param);
},
/**
* 增加 @author 卓大
*/
add: (param) => {
return postRequest('/changeLog/add', param);
},
/**
* 修改 @author 卓大
*/
update: (param) => {
return postRequest('/changeLog/update', param);
},
/**
* 删除 @author 卓大
*/
delete: (id) => {
return getRequest(`/changeLog/delete/${id}`);
},
/**
* 批量删除 @author 卓大
*/
batchDelete: (idList) => {
return postRequest('/changeLog/batchDelete', idList);
},
};

View File

@ -0,0 +1,46 @@
/*
* 代码生成器
*
* @Author: 卓大
* @Date: 2022-09-03 21:51:54
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { getRequest, postRequest,download } from '/@/lib/axios';
export const codeGeneratorApi = {
// 查询数据库的表 @author 卓大
queryTableList: (param) => {
return postRequest('/support/codeGenerator/table/queryTableList', param);
},
// 查询表的列 @author 卓大
getTableColumns: (table) => {
return getRequest(`/support/codeGenerator/table/getTableColumns/${table}`);
},
// ------------------- 配置 -------------------
// 获取表的配置信息 @author 卓大
getConfig: (table) => {
return getRequest(`/support/codeGenerator/table/getConfig/${table}`);
},
// 更新配置信息 @author 卓大
updateConfig: (param) => {
return postRequest('/support/codeGenerator/table/updateConfig', param);
},
// ------------------- 生成 -------------------
// 预览代码 @author 卓大
preview: (param) => {
return postRequest('/support/codeGenerator/code/preview', param);
},
// 下载代码 @author 卓大
downloadCode: (tableName) => {
return download(`${tableName}.zip`,`/support/codeGenerator/code/download/${tableName}`);
},
};

View File

@ -0,0 +1,29 @@
/*
* 配置
*
* @Author: 卓大
* @Date: 2022-09-03 21:51:54
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const configApi = {
// 分页查询 @author 卓大
queryList: (param) => {
return postRequest('/support/config/query', param);
},
// 添加配置参数 @author 卓大
addConfig: (param) => {
return postRequest('/support/config/add', param);
},
// 修改配置参数 @author 卓大
updateConfig: (param) => {
return postRequest('/support/config/update', param);
},
// 查询配置详情 @author 卓大
queryByKey: (param) => {
return getRequest(`/support/config/queryByKey?configKey=${param}`);
},
};

View File

@ -0,0 +1,18 @@
/*
* 数据变动
*
* @Author: 卓大
* @Date: 2022-09-03 21:51:54
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest } from '/@/lib/axios';
export const dataTracerApi = {
// 分页查询业务操作日志 - @author 卓大
queryList: (param) => {
return postRequest('/support/dataTracer/query', param);
},
};

View File

@ -0,0 +1,59 @@
/*
* 字典
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:55:25
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const dictApi = {
// 分页查询数据字典KEY - @author 卓大
keyQuery: (param) => {
return postRequest('/support/dict/key/query', param);
},
// 查询全部字典key - @author 卓大
queryAllKey: () => {
return getRequest('/support/dict/key/queryAll');
},
/**
* 分页查询数据字典value - @author 卓大
*/
valueQuery: (param) => {
return postRequest('/support/dict/value/query', param);
},
// 数据字典KEY-添加- @author 卓大
keyAdd: (param) => {
return postRequest('/support/dict/key/add', param);
},
// 分页查询数据字典value - @author 卓大
valueAdd: (param) => {
return postRequest('/support/dict/value/add', param);
},
// 数据字典key-更新- @author 卓大
keyEdit: (param) => {
return postRequest('/support/dict/key/edit', param);
},
// 数据字典Value-更新- @author 卓大
valueEdit: (param) => {
return postRequest('/support/dict/value/edit', param);
},
// 数据字典key-删除- @author 卓大
keyDelete: (keyIdList) => {
return postRequest('/support/dict/key/delete', keyIdList);
},
// 数据字典Value-删除- @author 卓大
valueDelete: (valueIdList) => {
return postRequest('/support/dict/value/delete', valueIdList);
},
// 缓存刷新- @author 卓大
cacheRefresh: () => {
return getRequest('/support/dict/cache/refresh');
},
// 数据字典-值列表- @author 卓大
valueList: (keyCode) => {
return getRequest(`/support/dict/value/list/${keyCode}`);
},
};

View File

@ -0,0 +1,21 @@
/*
* 意见反馈
*
* @Author: 1024创新实验室开云
* @Date: 2022-09-03 21:56:31
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest } from '/@/lib/axios';
export const feedbackApi = {
// 意见反馈-新增
addFeedback: (params) => {
return postRequest('/support/feedback/add', params);
},
// 意见反馈-分页查询
queryFeedback: (params) => {
return postRequest('/support/feedback/query', params);
},
};

View File

@ -0,0 +1,38 @@
/*
* 文件上传
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:55:25
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest, download } from '/@/lib/axios';
export const fileApi = {
// 文件上传 @author 卓大
uploadUrl: '/support/file/upload',
uploadFile: (param, folder) => {
return postRequest(`/support/file/upload?folder=${folder}`, param);
},
/**
* 分页查询 @author 卓大
*/
queryPage: (param) => {
return postRequest('/support/file/queryPage', param);
},
/**
* 获取文件URL根据fileKey @author 胡克
*/
getUrl: (fileKey) => {
return getRequest(`/support/file/getFileUrl?fileKey=${fileKey}`);
},
/**
* 下载文件流根据fileKey @author 胡克
*/
downLoadFile: (fileName, fileKey) => {
return download(fileName, '/support/file/downLoad', { fileKey });
},
};

View File

@ -0,0 +1,17 @@
/*
* 心跳
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:55:47
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest } from '/@/lib/axios';
export const heartBeatApi = {
// 分页查询 @author 卓大
queryList: (param) => {
return postRequest('/support/heartBeat/query', param);
},
};

View File

@ -0,0 +1,59 @@
/*
* 帮助文档
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:56:31
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const helpDocApi = {
// 【管理】帮助文档-分页查询 @author zhuoda
query: (param) => {
return postRequest('/support/helpDoc/query', param);
},
//【管理】帮助文档-更新 @author zhuoda
update: (param) => {
return postRequest('/support/helpDoc/update', param);
},
// 【管理】帮助文档-添加 @author zhuoda
add: (param) => {
return postRequest('/support/helpDoc/add', param);
},
//【管理】帮助文档-删除 @author zhuoda
delete: (helpDocId) => {
return getRequest(`/support/helpDoc/delete/${helpDocId}`);
},
//【管理】帮助文档-获取详情 @author zhuoda
getDetail: (helpDocId) => {
return getRequest(`/support/helpDoc/getDetail/${helpDocId}`);
},
//【管理】帮助文档-根据关联id查询 @author zhuoda
queryHelpDocByRelationId: (relationId) => {
return getRequest(`/support/helpDoc/queryHelpDocByRelationId/${relationId}`);
},
//----------------------- 用户相关 --------------------------------
//【用户】帮助文档-查询全部 @author zhuoda
getAllHelpDocList() {
return getRequest('/support/helpDoc/user/queryAllHelpDocList');
},
//【用户】帮助文档-查询全部 @author zhuoda
view(helpDocId) {
return getRequest(`/support/helpDoc/user/view/${helpDocId}`);
},
//【用户】帮助文档-查询 查看记录 @author zhuoda
queryViewRecord(param) {
return postRequest('/support/helpDoc/user/queryViewRecord', param);
},
};

View File

@ -0,0 +1,32 @@
/*
* 帮助文档 目录
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:56:31
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const helpDocCatalogApi = {
//帮助文档目录-获取全部 @author zhuoda
getAll: () => {
return getRequest('/support/helpDoc/helpDocCatalog/getAll');
},
//帮助文档目录-添加 @author zhuoda
add: (param) => {
return postRequest('/support/helpDoc/helpDocCatalog/add', param);
},
//帮助文档目录-更新 @author zhuoda
update: (param) => {
return postRequest('/support/helpDoc/helpDocCatalog/update', param);
},
//帮助文档目录-删除 @author zhuoda
delete: (helpDocCatalogId) => {
return getRequest(`/support/helpDoc/helpDocCatalog/delete/${helpDocCatalogId}`);
},
};

View File

@ -0,0 +1,17 @@
/*
* 登录日志
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:56:31
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const loginLogApi = {
// 分页查询 @author 卓大
queryList: (param) => {
return postRequest('/support/loginLog/page/query', param);
},
};

View File

@ -0,0 +1,21 @@
/*
* 操作日志
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:56:45
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const operateLogApi = {
// 分页查询 @author 卓大
queryList: (param) => {
return postRequest('/support/operateLog/page/query', param);
},
// 详情 @author 卓大
detail: (id) => {
return getRequest(`/support/operateLog/detail/${id}`);
},
};

View File

@ -0,0 +1,25 @@
/*
* reload (内存热加载钩子等)
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:57:19
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const reloadApi = {
// 查询reload列表 @author 卓大
queryList: () => {
return getRequest('/support/reload/query');
},
// 获取reload result @author 卓大
queryReloadResult: (tag) => {
return getRequest(`/support/reload/result/${tag}`);
},
// 执行reload @author 卓大
reload: (reloadForm) => {
return postRequest('/support/reload/update', reloadForm);
},
};

View File

@ -0,0 +1,25 @@
/*
* 单据序列号
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:57:52
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const serialNumberApi = {
// 生成单号 @author 卓大
generate: (generateForm) => {
return postRequest('/support/serialNumber/generate', generateForm);
},
// 获取所有单号定义 @author 卓大
getAll: () => {
return getRequest('/support/serialNumber/all');
},
// 获取生成记录 @author 卓大
queryRecord: (form) => {
return postRequest('/support/serialNumber/queryRecord', form);
},
};

View File

@ -0,0 +1,26 @@
/*
* @Description:表格自定义列
* @version:
* @Author: zhuoda
* @Date: 2022-08-17 23:32:36
* @LastEditors: zhuoda
* @LastEditTime: 2022-08-21
*/
import { postRequest, getRequest } from '/@/lib/axios';
export const tableColumnApi = {
// 修改表格列 @author zhuoda
updateTableColumn: (param) => {
return postRequest('/support/tableColumn/update', param);
},
// 查询表格列 @author zhuoda
getColumns: (tableId) => {
return getRequest(`/support/tableColumn/getColumns/${tableId}`);
},
// 删除表格列 @author zhuoda
deleteColumns: (tableId) => {
return getRequest(`/support/tableColumn/delete/${tableId}`);
},
};

View File

@ -0,0 +1,55 @@
/*
* 部门
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:58:50
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { getRequest, postRequest } from '/@/lib/axios';
export const departmentApi = {
/**
* @description: 查询部门列表 @author 卓大
* @param {*}
* @return {*}
*/
queryAllDepartment: () => {
return getRequest('/department/listAll');
},
/**
* @description: 查询部门树形列表 @author 卓大
* @param {*}
* @return {*}
*/
queryDepartmentTree: () => {
return getRequest('/department/treeList');
},
/**
* @description: 添加部门 @author 卓大
* @param {*}
* @return {*}
*/
addDepartment: (param) => {
return postRequest('/department/add', param);
},
/**
* @description: 更新部门信息 @author 卓大
* @param {*}
* @return {*}
*/
updateDepartment: (param) => {
return postRequest('/department/update', param);
},
/**
* @description: 获取校区列表 @author 卓大
* @param {*}
* @return {*}
*/
deleteDepartment: (departmentId) => {
return getRequest(`/department/delete/${departmentId}`);
},
};

View File

@ -0,0 +1,98 @@
/*
* 员工
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:59:15
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { getRequest, postRequest } from '/@/lib/axios';
export const employeeApi = {
/**
* @description: 查询所有员工 @author 卓大
* @param {*}
* @return {*}
*/
queryAll: () => {
return getRequest('/employee/queryAll');
},
/**
* @description: 员工管理查询
* @param {*}
* @return {*}
*/
queryEmployee: (params) => {
return postRequest('/employee/query', params);
},
/**
* @description: 添加员工
* @param {EmployeeAddDto} params
* @return {*}
*/
addEmployee: (params) => {
return postRequest('/employee/add', params);
},
/**
* @description: 更新员工信息
* @param {EmployeeUpdateDto} params
* @return {*}
*/
updateEmployee: (params) => {
return postRequest('/employee/update', params);
},
/**
* @description: 删除员工
* @param {number} employeeId
* @return {*}
*/
deleteEmployee: (employeeId) => {
return getRequest(`/employee/delete/${employeeId}`);
},
/**
* @description: 批量删除员工
* @param {number} employeeIdList
* @return {*}
*/
batchDeleteEmployee: (employeeIdList) => {
return postRequest('/employee/update/batch/delete', employeeIdList);
},
/**
* @description: 批量调整员工部门
* @return {*}
*/
batchUpdateDepartmentEmployee: (updateParam) => {
return postRequest('/employee/update/batch/department', updateParam);
},
/**
* @description: 重置员工密码
* @param {number} employeeId
* @return {*}
*/
resetPassword: (employeeId) => {
return getRequest(`/employee/update/password/reset/${employeeId}`);
},
/**
* @description: 修改面面
* @param {number} employeeId
* @return {*}
*/
updateEmployeePassword: (param) => {
return postRequest('/employee/update/password',param);
},
/**
* @description: 更新员工禁用状态
* @param {number} employeeId
* @return {*}
*/
updateDisabled: (employeeId) => {
return getRequest(`/employee/update/disabled/${employeeId}`);
},
// 查询员工-根据部门id
queryEmployeeByDeptId: (departmentId) => {
return getRequest(`/employee/query/dept/${departmentId}`);
},
};

View File

@ -0,0 +1,29 @@
/*
* 首页api
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:59:39
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { getRequest } from '/@/lib/axios';
export const homeApi = {
/**
* @description: 首页-金额统计业绩收款订单数等 @author 卓大
* @param {*}
* @return {*}
*/
homeAmountStatistics: () => {
return getRequest('/home/amount/statistics');
},
/**
* @description: 首页-待办信息 @author 卓大
* @param {*}
* @return {*}
*/
homeWaitHandle: () => {
return getRequest('home/wait/handle');
},
};

View File

@ -0,0 +1,51 @@
/*
* 登录
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 21:59:58
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { getRequest, postRequest } from '/@/lib/axios';
export const loginApi = {
/**
* 登录 @author 卓大
* @param param
*/
login: (param) => {
return postRequest('/login', param);
},
/**
* 退出登录 @author 卓大
* @param param
*/
logout: () => {
return getRequest('/login/logout');
},
/**
* 获取验证码 @author 卓大
* @param param
*/
getCaptcha: () => {
return getRequest('/login/getCaptcha');
},
/**
* 获取登录信息 @author 卓大
* @param param
*/
getLoginInfo: () => {
return getRequest('/login/getLoginInfo');
},
/**
* 刷新用户信息包含用户基础信息权限信息等等 @author 卓大
*/
refresh: () => {
return getRequest('/login/refresh');
},
};

View File

@ -0,0 +1,54 @@
/*
* 菜单
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 22:00:32
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { getRequest, postRequest } from '/@/lib/axios';
export const menuApi = {
/**
* 添加菜单
*/
addMenu: (param) => {
return postRequest('/menu/add', param);
},
/**
* 更新菜单
*/
updateMenu: (param) => {
return postRequest('/menu/update', param);
},
/**
* 批量删除菜单
*/
batchDeleteMenu: (menuIdList) => {
return getRequest(`/menu/batchDelete?menuIdList=${menuIdList}`);
},
/**
* 查询所有菜单列表
*/
queryMenu: () => {
return getRequest('/menu/query');
},
/**
* 查询菜单树
*/
queryMenuTree: (onlyMenu) => {
return getRequest(`/menu/tree?onlyMenu=${onlyMenu}`);
},
/**
* 获取所有请求路径
*/
getAuthUrl: () => {
return getRequest('/menu/auth/url');
},
};

View File

@ -0,0 +1,28 @@
/*
* 角色菜单
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 22:00:49
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { getRequest, postRequest } from '/@/lib/axios';
export const roleMenuApi = {
/**
* @description: 获取角色关联菜单权限
* @param {*}
* @return {*}
*/
getRoleSelectedMenu: (roleId) => {
return getRequest(`role/menu/getRoleSelectedMenu/${roleId}`);
},
/**
* @description: 更新角色权限
* @param {*}
* @return {*}
*/
updateRoleMenu: (data) => {
return postRequest('role/menu/updateRoleMenu', data);
},
};

View File

@ -0,0 +1,110 @@
/*
* 角色
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 22:00:41
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { getRequest, postRequest } from '/@/lib/axios';
export const roleApi = {
/**
* @description: 获取所有角色
* @param {*}
* @return {*}
*/
queryAll: () => {
return getRequest('/role/getAll');
},
/**
* @description:添加角色
* @param {*}
* @return {*}
*/
addRole: (data) => {
return postRequest('/role/add', data);
},
/**
* @description:更新角色
* @param {*}
* @return {*}
*/
updateRole: (data) => {
return postRequest('/role/update', data);
},
/**
* @description: 删除角色
* @param {number} roleId
* @return {*}
*/
deleteRole: (roleId) => {
return getRequest(`/role/delete/${roleId}`);
},
/**
* @description: 批量设置某角色数据范围
* @param {DataScopeBatchSetRoleDto} data
* @return {*}
*/
updateDataScope: (data) => {
return postRequest('/role/dataScope/updateRoleDataScopeList', data);
},
/**
* @description: 获取当前系统所配置的所有数据范围
* @param {*}
* @return {*}
*/
getDataScopeList: () => {
return getRequest('/dataScope/list');
},
/**
* @description: 获取某角色所设置的数据范围
* @param {number} roleId
* @return {*}
*/
getDataScopeByRoleId: (roleId) => {
return getRequest(`/role/dataScope/getRoleDataScopeList/${roleId}`);
},
/**
* @description: 获取角色成员-员工列表
* @param {*}
* @return {*}
*/
queryRoleEmployee: (params) => {
return postRequest('/role/employee/queryEmployee', params);
},
/**
* @description: 从角色成员列表中移除员工
* @param {number} employeeId
* @param {number} roleId
* @return {*}
*/
deleteEmployeeRole: (employeeId, roleId) => {
return getRequest('/role/employee/removeEmployee?employeeId=' + employeeId + '&roleId=' + roleId);
},
/**
* @description: 从角色成员列表中批量移除员工
* @param {RoleEmployeeBatchDto} data
* @return {*}
*/
batchRemoveRoleEmployee: (data) => {
return postRequest('/role/employee/batchRemoveRoleEmployee', data);
},
/**
* @description: 根据角色id获取角色员工列表(无分页)
* @param {*}
* @return {*}
*/
getRoleAllEmployee: (roleId) => {
return getRequest(`/role/employee/getAllEmployeeByRoleId/${roleId}`);
},
/**
* @description: 角色成员列表中批量添加员工
* @param data
* @return {*}
*/
batchAddRoleEmployee: (data) => {
return postRequest('/role/employee/batchAddRoleEmployee', data);
},
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

View File

@ -0,0 +1,85 @@
<!--
* 目录 树形选择组件
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-12 21:01:52
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-tree-select
v-model:value="selectValue"
:style="`width:${width}`"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
:tree-data="categoryTreeData"
:placeholder="placeholder"
tree-default-expand-all
@change="onChange"
/>
</template>
<script setup>
import { ref, watch, onMounted } from 'vue';
import { categoryApi } from '/@/api/business/category/category-api';
import { smartSentry } from '/@/lib/smart-sentry';
const props = defineProps({
value: Number,
placeholder: {
type: String,
default: '请选择',
},
categoryType: Number,
width: {
type: String,
default: '100%',
},
});
const emit = defineEmits(['update:value', 'change']);
// ----------------- -----------------
const categoryTreeData = ref([]);
async function queryCategoryTree() {
if (!props.categoryType) {
categoryTreeData.value = [];
return;
}
try {
let param = {
categoryType: props.categoryType,
};
let resp = await categoryApi.queryCategoryTree(param);
categoryTreeData.value = resp.data;
} catch (e) {
smartSentry.captureError(e);
}
}
// ----------------- -----------------
const selectValue = ref(props.value);
// value
watch(
() => props.value,
(newValue) => {
selectValue.value = newValue;
}
);
//
watch(
() => props.categoryType,
() => {
queryCategoryTree();
}
);
function onChange(value) {
emit('update:value', value);
emit('change', value);
}
onMounted(queryCategoryTree);
</script>

View File

@ -0,0 +1,109 @@
<!--
* 公司银行 下拉选择框
*
* @Author: 1024创新实验室开云
* @Date: 2022-09-02 22:12:20
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-select
v-model:value="selectValue"
:style="`width: ${width}`"
:placeholder="props.placeholder"
:showSearch="true"
:allowClear="true"
:size="size"
@change="handleChange"
:disabled="disabled"
:mode="multiple ? 'multiple' : ''"
optionFilterProp="label"
>
<a-select-option v-for="item in dataList" :key="item.bankId" :label="item.bankName">
{{ item.bankName }}({{ starAccountNumber(item.accountNumber) }})
</a-select-option>
</a-select>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue';
import { bankApi } from '/@/api/business/oa/bank-api';
import _ from 'lodash';
const props = defineProps({
value: [Number, String, Object],
width: {
type: String,
default: '200px',
},
placeholder: {
type: String,
default: '请选择',
},
size: {
type: String,
default: 'default',
},
disabled: {
type: Boolean,
default: false,
},
multiple: {
type: Boolean,
default: false,
},
enterpriseId: {
type: Number,
},
});
// ------------------------ ------------------------
const emit = defineEmits(['update:value', 'change']);
const selectValue = ref(props.value);
// value
watch(
() => props.value,
(newValue) => {
selectValue.value = newValue;
}
);
// ID
watch(
() => props.enterpriseId,
(newValue) => {
queryData();
}
);
function handleChange(value) {
emit('update:value', value);
emit('change', value);
}
// ------------------------ ------------------------
const dataList = ref([]);
async function queryData() {
if (!props.enterpriseId) {
return;
}
let res = await bankApi.queryList(props.enterpriseId);
dataList.value = res.data;
if (!props.value && !_.isEmpty(dataList.value)) {
selectValue.value = res.data[0].invoiceId;
handleChange(res.data[0].invoiceId);
}
}
//
function starAccountNumber(accountNumber) {
if (accountNumber.length < 7) {
return accountNumber;
}
return accountNumber.substr(0, 3) + '**' + accountNumber.substring(accountNumber.length - 3);
}
onMounted(queryData);
</script>

View File

@ -0,0 +1,108 @@
<!--
* 公司的开票信息 下拉选择框
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-01 23:14:49
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<a-select
v-model:value="selectValue"
:style="`width: ${width}`"
:placeholder="props.placeholder"
:showSearch="true"
:allowClear="true"
:size="size"
@change="handleChange"
:disabled="disabled"
:mode="multiple ? 'multiple' : ''"
optionFilterProp="label"
>
<a-select-option v-for="item in dataList" :key="item.invoiceId" :label="item.invoiceHeads">
{{ item.invoiceHeads }}
</a-select-option>
</a-select>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue';
import { invoiceApi } from '/@/api/business/oa/invoice-api';
import _ from 'lodash';
const props = defineProps({
value: [Number, String, Object],
width: {
type: String,
default: '200px',
},
placeholder: {
type: String,
default: '请选择',
},
size: {
type: String,
default: 'default',
},
disabled: {
type: Boolean,
default: false,
},
multiple: {
type: Boolean,
default: false,
},
enterpriseId: {
type: Number,
},
});
// ------------------------ ------------------------
const emit = defineEmits(['update:value', 'change']);
const selectValue = ref(props.value);
// value
watch(
() => props.value,
(newValue) => {
selectValue.value = newValue;
}
);
// ID
watch(
() => props.enterpriseId,
(newValue) => {
queryData();
}
);
function handleChange(value) {
emit('update:value', value);
emit(
'change',
value,
dataList.value.find((e) => e.invoiceId == value)
);
}
// ------------------------ ------------------------
const dataList = ref([]);
async function queryData() {
if (!props.enterpriseId) {
return;
}
let res = await invoiceApi.queryList(props.enterpriseId);
dataList.value = res.data;
if (!props.value && !_.isEmpty(dataList.value)) {
selectValue.value = res.data[0].invoiceId;
handleChange(res.data[0].invoiceId);
}
}
onMounted(queryData);
</script>

View File

@ -0,0 +1,85 @@
<!--
* 企业列表 下拉选择框
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-26 19:16:24
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-select
v-model:value="selectValue"
:style="`width: ${width}`"
:placeholder="props.placeholder"
:showSearch="true"
:allowClear="true"
:size="size"
@change="handleChange"
:disabled="disabled"
:mode="multiple ? 'multiple' : ''"
optionFilterProp="label"
>
<a-select-option v-for="item in dataList" :key="item.enterpriseId" :label="item.enterpriseName">
{{ item.enterpriseName }}
</a-select-option>
</a-select>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue';
import { enterpriseApi } from '/@/api/business/oa/enterprise-api';
const props = defineProps({
value: [Number, String, Object],
width: {
type: String,
default: '200px',
},
placeholder: {
type: String,
default: '请选择',
},
size: {
type: String,
default: 'default',
},
disabled: {
type: Boolean,
default: false,
},
multiple: {
type: Boolean,
default: false,
},
// ENTERPRISE_TYPE_ENUM
type: {
type: Number,
},
});
const emit = defineEmits(['update:value', 'change']);
const selectValue = ref(props.value);
// value
watch(
() => props.value,
(newValue) => {
selectValue.value = newValue;
}
);
function handleChange(value) {
emit('update:value', value);
emit('change', value);
}
const dataList = ref([]);
async function queryData() {
let res = await enterpriseApi.queryList(props.type);
dataList.value = res.data;
}
onMounted(queryData);
</script>

View File

@ -0,0 +1,91 @@
<!--
* 地区选择框
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-12 15:22:45
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-cascader
:style="`width:${width}`"
v-model:value="areaValue"
:show-search="{ filter }"
:options="areaOptionData"
:placeholder="placeholder"
:size="size"
@change="handleChange"
/>
</template>
<script setup>
import { PROVINCE_CITY_DISTRICT } from "./province-city-district";
import { PROVINCE_CITY } from "./province-city";
import { ref, toRaw, watch } from "vue";
// ============ ============
const TYPE_PROVINCE_CITY_DISTRICT = "province_city_district";
const TYPE_PROVINCE_CITY = "province_city";
const props = defineProps({
type: String,
value: [Number, Array],
width: {
type: String,
default: '200px',
},
placeholder: {
type: String,
default: '请选择地区',
},
size: {
type: String,
default: 'default',
},
disabled: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(['update:value', 'change']);
// ============ ============
const areaOptionData =
props.type === TYPE_PROVINCE_CITY_DISTRICT ? PROVINCE_CITY_DISTRICT : PROVINCE_CITY;
//
const areaValue = ref([]);
// value
watch(
() => props.value,
(newValue) => {
if (newValue) {
let array = [];
for (let index = 0; index < 3; index++) {
if (newValue[index]) {
array.push(newValue[index].value);
}
}
areaValue.value = array;
} else {
areaValue.value = [];
}
}
);
function handleChange(value, selectedOptions){
emit("update:value", toRaw(selectedOptions));
emit("change", value, toRaw(selectedOptions));
}
const filter = (inputValue, path) => {
return path.some(
(option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1
);
};
</script>

View File

@ -0,0 +1,81 @@
<!--
* 布尔 树形选择组件
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-12 21:01:52
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-select
v-model:value="selectValue"
:style="`width: ${width}px`"
:placeholder="placeholder"
:showSearch="true"
:allowClear="true"
:size="size"
@change="handleChange"
@deselect="handleChange"
>
<a-select-option v-for="item in $smartEnumPlugin.getValueDescList('FLAG_NUMBER_ENUM')" :key="item.value" :value="item.value">
{{ item.desc }}
</a-select-option>
</a-select>
</template>
<script setup>
import _ from 'lodash';
import { ref, watch } from 'vue';
const props = defineProps({
value: Number,
width: {
type: Number,
default: 100,
},
placeholder: {
type: String,
default: '请选择',
},
size: {
type: String,
default: 'default',
},
disabled: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(['update:value', 'change']);
function convertBoolean2number(value) {
let result = null;
if (_.isNaN(value) || _.isNull(value) || _.isUndefined(value)) {
result = null;
} else {
result = value ? 1 : 0;
}
return result;
}
// value
const selectValue = ref(convertBoolean2number(props.value));
watch(
() => props.value,
(newValue) => {
selectValue.value = convertBoolean2number(newValue);
}
);
const handleChange = (value) => {
console.log('boolean enum select', value);
let booleanResult = null;
if (!_.isUndefined(value)) {
booleanResult = value === 1 ? true : false;
}
emit('update:value', booleanResult);
emit('change', booleanResult);
};
</script>

View File

@ -0,0 +1,133 @@
<!--
* 图标 选择
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-01 23:14:49
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<div>
<a-popover v-model:visible="visible" placement="bottomLeft" trigger="click">
<template #title>
<a-form-item-rest>
<a-radio-group @change="updateSelectIconArray" v-model:value="iconStyle" style="margin: 8px">
<a-radio-button value="outlined">线框风格</a-radio-button>
<a-radio-button value="filled">实底风格</a-radio-button>
<a-radio-button value="twoTone">双色风格</a-radio-button>
</a-radio-group>
</a-form-item-rest>
<a-form-item-rest>
<a-input-search v-model:value="searchValue" placeholder="输入英文关键词进行搜索" @change="updateSelectIconArray" />
</a-form-item-rest>
</template>
<template #content>
<div class="icon-box">
<div v-for="item in iconLoopArray" :key="item" @click="handleClick(item)" class="icon-content">
<component :is="$antIcons[item]" />
</div>
<div v-show="showMoreIndex > 0">
<a-button type="link" @click="showMore">点击展开更多图标因图标较多可能会卡一小会</a-button>
</div>
</div>
</template>
<slot name="iconSelect"></slot>
</a-popover>
</div>
</template>
<script setup>
import * as VueIcon from '@ant-design/icons-vue';
import { computed, ref, watch } from 'vue';
import _ from 'lodash';
//线
const outlinedIconArray = Object.keys(VueIcon).filter((e) => _.endsWith(e.toLowerCase(), 'outlined'));
//
const filledIconArray = Object.keys(VueIcon).filter((e) => _.endsWith(e.toLowerCase(), 'filled'));
//
const twoToneIconArray = Object.keys(VueIcon).filter((e) => _.endsWith(e.toLowerCase(), 'twotone'));
// ------------ / ------------
const visible = ref(false);
// ------------ ------------
const SHOW_MORE_LENGTH = 35;
const showMoreIndex = ref(SHOW_MORE_LENGTH);
function showMore() {
showMoreIndex.value = -1;
}
// ------------ ------------
const iconStyle = ref('outlined');
const selectIconArray = ref([...outlinedIconArray]);
const iconLoopArray = computed(() => {
return _.slice(selectIconArray.value, 0, showMoreIndex.value);
});
watch(iconStyle, (newValue, oldValue) => {
updateSelectIconArray();
});
let searchValue = ref('');
function updateSelectIconArray() {
let tempArray = null;
if (iconStyle.value === 'outlined') {
tempArray = outlinedIconArray;
} else if (iconStyle.value === 'filled') {
tempArray = filledIconArray;
} else {
tempArray = twoToneIconArray;
}
if (!searchValue.value) {
selectIconArray.value = tempArray;
} else {
selectIconArray.value = tempArray.filter((e) => e.toLowerCase().includes(searchValue.value.toLowerCase()));
}
if (selectIconArray.value.length > SHOW_MORE_LENGTH) {
showMoreIndex.value = SHOW_MORE_LENGTH;
}
}
// ------------ ------------
const emit = defineEmits(['updateIcon']);
function handleClick(icon) {
visible.value = false;
emit('updateIcon', icon);
}
</script>
<style scoped lang="less">
.icon-box {
overflow: auto;
font-size: 20px;
width: 410px;
height: 300px;
display: flex;
flex-wrap: wrap;
flex-direction: row;
align-content: flex-start;
}
.icon-content {
width: 45px;
height: 40px;
margin: 5px;
cursor: pointer;
text-align: center;
border-radius: 6px;
border: 1px solid #ccc;
.more-icon {
font-size: 14px;
margin: 5px;
}
}
.icon-content:hover {
background: #1890ff;
}
</style>

View File

@ -0,0 +1,18 @@
<!--
* iframe 组件
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-01 23:14:49
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<iframe :id="name" :src="url" frameborder="0" height="800" scrolling="yes" width="100%"></iframe>
</template>
<script setup>
let props = defineProps({
name: String,
url: String,
});
</script>

View File

@ -0,0 +1,3 @@
<template>
<div></div>
</template>

View File

@ -0,0 +1,55 @@
<!--
* 枚举 多选框
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-08 20:32:30
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" :options="optionList" @change="handleChange" />
</template>
<script setup>
import { ref, watch, getCurrentInstance, onMounted } from 'vue';
const props = defineProps({
enumName: String,
value: Array,
width: {
type: String,
default: '200px',
},
});
// ------------ ------------
const optionList = ref([]);
function buildOptionList() {
const internalInstance = getCurrentInstance(); //
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
const valueList = smartEnumPlugin.getValueDescList(props.enumName);
optionList.value = valueList.map((e) => Object.assign({}, { value: e.value, label: e.desc }));
}
onMounted(buildOptionList);
// ------------ ------------
const selectValue = ref(props.value);
watch(
() => props.value,
(newValue) => {
selectValue.value = newValue;
}
);
const emit = defineEmits(['update:value', 'change']);
function handleChange(value) {
emit('update:value', value);
emit('change', value);
}
</script>

View File

@ -0,0 +1,63 @@
<!--
* 枚举 radio
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-08 20:32:30
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<template v-if="isButton">
<a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid">
<a-radio-button v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
{{ item.desc }}
</a-radio-button>
</a-radio-group>
</template>
<template v-else>
<a-radio-group v-model:value="selectValue" @change="handleChange">
<a-radio v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
{{ item.desc }}
</a-radio>
</a-radio-group>
</template>
</template>
<script setup>
import { ref, watch } from 'vue';
const props = defineProps({
enumName: String,
value: [Number, String],
width: {
type: String,
default: '100%',
},
size: {
type: String,
default: 'default',
},
isButton: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(['update:value', 'change']);
const selectValue = ref(props.value);
watch(
() => props.value,
(newValue) => {
selectValue.value = newValue;
}
);
function handleChange(e) {
emit('update:value', e.target.value);
emit('change', e.target.value);
}
</script>

View File

@ -0,0 +1,68 @@
<!--
* 枚举 下拉框
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-08 20:32:30
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-select
v-model:value="selectValue"
:style="`width: ${width}`"
:placeholder="props.placeholder"
:showSearch="true"
:allowClear="true"
:size="size"
@change="handleChange"
@deselect="handleChange"
:disabled="disabled"
>
<a-select-option v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
{{ item.desc }}
</a-select-option>
</a-select>
</template>
<script setup>
import { ref, watch } from 'vue';
const props = defineProps({
enumName: String,
value: [Number,String],
width: {
type: String,
default: '100%',
},
placeholder: {
type: String,
default: '请选择',
},
size: {
type: String,
default: 'default',
},
disabled: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(['update:value', 'change']);
const selectValue = ref(props.value);
watch(
() => props.value,
(newValue) => {
selectValue.value = newValue;
}
);
function handleChange(value) {
emit('update:value', value);
emit('change', value);
}
</script>

View File

@ -0,0 +1,20 @@
/*
* loading 组件
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-07-22 20:33:41
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import { useSpinStore } from "/@/store/modules/system/spin";
export const SmartLoading = {
show: () => {
useSpinStore().show();
},
hide: () => {
useSpinStore().hide();
},
};

View File

@ -0,0 +1,109 @@
<!--
* 编辑器
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-12 15:34:33
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<div style="border: 1px solid #ccc">
<Toolbar style="border-bottom: 1px solid #ccc" :editor="editorRef" />
<Editor
style="overflow-y: hidden"
:style="{ height: `${height}px` }"
v-model="editorHtml"
:defaultConfig="editorConfig"
@onCreated="handleCreated"
@onChange="handleChange"
/>
</div>
</template>
<script setup>
import { shallowRef, onBeforeUnmount, watch, ref } from 'vue';
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
import { fileApi } from '/@/api/support/file/file-api';
import '@wangeditor/editor/dist/css/style.css';
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
import { smartSentry } from '/@/lib/smart-sentry';
//
const editorConfig = { MENU_CONF: {} };
//
let customUpload = {
async customUpload(file, insertFn) {
try {
const formData = new FormData();
formData.append('file', file);
let res = await fileApi.uploadFile(formData, FILE_FOLDER_TYPE_ENUM.COMMON.value);
let data = res.data;
insertFn(data.fileUrl);
} catch (error) {
smartSentry.captureError(error);
}
},
};
editorConfig.MENU_CONF['uploadImage'] = customUpload;
editorConfig.MENU_CONF['uploadVideo'] = customUpload;
// ----------------------- emits props ----------------
const editorHtml = ref();
let props = defineProps({
modelValue: String,
height: {
type: Number,
default: 500,
},
});
watch(
() => props.modelValue,
(nVal) => {
console.log(nVal);
editorHtml.value = nVal;
},
{
immediate: true,
deep: true,
}
);
// html
const emit = defineEmits(['update:modelValue']);
const editorRef = shallowRef();
const handleCreated = (editor) => {
editorRef.value = editor;
};
const handleChange = (editor) => {
emit('update:modelValue', editorHtml.value);
};
function getHtml() {
const htmlContent = editorRef.value.getHtml();
return htmlContent === '<p><br></p>' ? '' : htmlContent;
}
function getText() {
return editorRef.value.getText();
}
//
onBeforeUnmount(() => {
const editor = editorRef.value;
if (editor == null) return;
editor.destroy();
});
defineExpose({
editorRef,
getHtml,
getText,
});
</script>
<style scoped>
.w-e-full-screen-container {
z-index: 9999 !important;
}
</style>

View File

@ -0,0 +1,239 @@
<!--
* 数据变动记录 表格 组件
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-12 21:01:52
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-form class="smart-query-form">
<a-row class="smart-query-form-row">
<a-form-item label="关键字" class="smart-query-form-item">
<a-input style="width: 300px" v-model:value="queryForm.keywords" placeholder="变更内容" />
</a-form-item>
<a-form-item class="smart-query-form-item smart-margin-left10">
<a-button-group>
<a-button type="primary" @click="onSearch">
<template #icon>
<SearchOutlined />
</template>
查询
</a-button>
<a-button @click="onReload">
<template #icon>
<ReloadOutlined />
</template>
重置
</a-button>
</a-button-group>
</a-form-item>
</a-row>
</a-form>
<a-card size="small" :bordered="false">
<a-table size="small" :dataSource="tableData" :columns="columns" rowKey="dataTracerId" :pagination="false" bordered>
<template #bodyCell="{ record, index, column }">
<template v-if="column.dataIndex === 'dataTracerId'">
<div>{{ index + 1 }}</div>
</template>
<template v-if="column.dataIndex === 'userName'">
<div>{{record.userName}} ({{ $smartEnumPlugin.getDescByValue('USER_TYPE_ENUM', record.userType) }})</div>
</template>
<template v-if="column.dataIndex === 'userAgent'">
<div>{{ record.browser }} / {{ record.os }} / {{ record.device }}</div>
</template>
<template v-if="column.dataIndex === 'content'">
<div class="operate-content" v-html="record.content"></div>
</template>
<template v-else-if="column.dataIndex === 'action'">
<a-button v-if="record.diffOld || record.diffNew" @click="showDetail(record)" type="link">详情 </a-button>
</template>
</template>
</a-table>
<div class="smart-query-table-page">
<a-pagination
showSizeChanger
showQuickJumper
show-less-items
:pageSizeOptions="PAGE_SIZE_OPTIONS"
:defaultPageSize="queryForm.pageSize"
v-model:current="queryForm.pageNum"
v-model:pageSize="queryForm.pageSize"
:total="total"
@change="onSearch"
@showSizeChange="onSearch"
:show-total="(total) => `共${total}条`"
/>
</div>
<a-modal v-model:visible="visibleDiff" width="90%" title="数据比对" :footer="null">
<div v-html="prettyHtml"></div>
</a-modal>
</a-card>
</template>
<script setup>
import * as Diff from 'diff';
import * as Diff2Html from 'diff2html';
import 'diff2html/bundles/css/diff2html.min.css';
import uaparser from 'ua-parser-js';
import { nextTick, reactive, ref, watch } from 'vue';
import { dataTracerApi } from '/@/api/support/data-tracer/data-tracer-api';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
import { smartSentry } from '/@/lib/smart-sentry';
let props = defineProps({
// id
dataId: {
type: Number,
},
//
type: {
type: Number,
},
});
const columns = reactive([
{
title: '序号',
dataIndex: 'dataTracerId',
width: 50,
},
{
title: '操作时间',
dataIndex: 'createTime',
width: 150,
},
{
title: '操作人',
dataIndex: 'userName',
width: 100,
ellipsis: true,
},
{
title: 'IP',
dataIndex: 'ip',
ellipsis: true,
width: 100,
},
{
title: '客户端',
dataIndex: 'userAgent',
ellipsis: true,
width: 150,
},
{
title: '操作内容',
dataIndex: 'content',
},
{
title: '操作',
dataIndex: 'action',
fixed: 'right',
width: 80,
},
]);
// --------------- ---------------
const queryFormState = {
pageNum: 1,
pageSize: PAGE_SIZE,
searchCount: true,
keywords: undefined,
};
const queryForm = reactive({ ...queryFormState });
const tableLoading = ref(false);
const tableData = ref([]);
const total = ref(0);
function onReload() {
Object.assign(queryForm, queryFormState);
onSearch();
}
async function onSearch() {
try {
tableLoading.value = true;
let responseModel = await dataTracerApi.queryList(Object.assign({}, queryForm, { dataId: props.dataId, type: props.type }));
for (const e of responseModel.data.list) {
if (!e.userAgent) {
continue;
}
let ua = uaparser(e.userAgent);
e.browser = ua.browser.name;
e.os = ua.os.name;
e.device = ua.device.vendor ? ua.device.vendor + ua.device.model : '';
}
const list = responseModel.data.list;
total.value = responseModel.data.total;
tableData.value = list;
} catch (e) {
smartSentry.captureError(e);
} finally {
tableLoading.value = false;
}
}
// ========= watch ===============
watch(
() => props.dataId,
(e) => {
if (e) {
queryForm.dataId = e;
onSearch();
}
},
{ immediate: true }
);
// --------------- diff ---------------
// diff
const visibleDiff = ref(false);
let prettyHtml = ref('');
function showDetail(record) {
visibleDiff.value = true;
let diffOld = record.diffOld.replaceAll('<br/>','\r\n');
let diffNew = record.diffNew.replaceAll('<br/>','\r\n');
console.log(diffOld)
console.log(diffNew)
const args = ['', diffOld, diffNew, '变更前', '变更后'];
let diffPatch = Diff.createPatch(...args);
let html = Diff2Html.html(diffPatch, {
drawFileList: false,
matching: 'words',
diffMaxChanges: 1000,
outputFormat: 'side-by-side',
});
prettyHtml.value = html;
nextTick(() => {
let diffDiv = document.querySelectorAll('.d2h-file-side-diff');
if (diffDiv.length > 0) {
let left = diffDiv[0],
right = diffDiv[1];
left.addEventListener('scroll', function (e) {
if (left.scrollLeft != right.scrollLeft) {
right.scrollLeft = left.scrollLeft;
}
});
right.addEventListener('scroll', function (e) {
if (left.scrollLeft != right.scrollLeft) {
left.scrollLeft = right.scrollLeft;
}
});
}
});
}
</script>
<style scoped lang="less">
.operate-content {
line-height: 20px;
margin: 5px 0px;
}
</style>

View File

@ -0,0 +1,78 @@
<!---
* 字典key 下拉选择框
*
* @Author: 1024创新实验室罗伊
* @Date: 2022-09-12 22:06:45
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<div>
<a-select
v-model:value="selectValue"
:style="`width: ${width}`"
:placeholder="props.placeholder"
:showSearch="true"
:allowClear="true"
:size="size"
@change="onChange"
>
<a-select-option v-for="item in dictKeyCodeList" :key="item.keyCode" :value="item.keyCode">
{{ item.keyName }}
</a-select-option>
</a-select>
</div>
</template>
<script setup>
import { computed, onMounted, ref, watch } from 'vue';
import { dictApi } from '/@/api/support/dict/dict-api';
const props = defineProps({
value: [Array, String],
placeholder: {
type: String,
default: '请选择字典',
},
width: {
type: String,
default: '100%',
},
size: {
type: String,
default: 'default',
},
//
disabledFlag: {
type: Number,
default: null,
},
});
// -------------------------- --------------------------
const dictKeyCodeList = ref([]);
async function queryDict() {
let responseModel = await dictApi.queryAllKey();
dictKeyCodeList.value = responseModel.data;
}
onMounted(queryDict);
// -------------------------- --------------------------
const emit = defineEmits(['update:value', 'change']);
const selectValue = ref(props.value);
watch(
() => props.value,
(newValue) => {
selectValue.value = newValue;
}
);
function onChange(value) {
emit('update:value', value);
emit('change', value);
}
</script>

View File

@ -0,0 +1,116 @@
<!---
* 字段 下拉选择框
*
* @Author: 1024创新实验室罗伊
* @Date: 2022-09-12 22:06:45
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<div>
<a-select
v-model:value="selectValue"
:style="`width: ${width}`"
:placeholder="props.placeholder"
:allowClear="true"
:size="size"
:mode="mode"
@change="onChange"
:disabled="disabled"
>
<a-select-option v-for="item in dictValueList" :key="item.valueCode" :value="item.valueCode">
{{ item.valueName }}
</a-select-option>
</a-select>
</div>
</template>
<script setup>
import { computed, onMounted, ref, watch } from 'vue';
import { dictApi } from '/@/api/support/dict/dict-api';
const props = defineProps({
keyCode: String,
value: [Array, String],
mode: {
type: String,
default: 'combobox',
},
width: {
type: String,
default: '200px',
},
placeholder: {
type: String,
default: '请选择',
},
size: {
type: String,
default: 'default',
},
disabled: {
type: Boolean,
default: false,
},
});
// -------------------------- --------------------------
const dictValueList = ref([]);
async function queryDict() {
let res = await dictApi.valueList(props.keyCode);
dictValueList.value = res.data;
}
const values = computed(() => {
if (!props.value) {
return [];
}
if (!Array.isArray(props.value)) {
console.error('valueList is not array!!!');
return [];
}
let res = [];
if (props.value && props.value.length > 0) {
props.value.forEach((element) => {
res.push(element.valueCode);
});
return res;
}
return res;
});
onMounted(queryDict);
// -------------------------- --------------------------
const selectValue = ref(props.value);
watch(
() => props.value,
(value) => {
selectValue.value = value;
}
);
const emit = defineEmits(['update:value', 'change']);
function onChange(value) {
let selected = [];
if (!value) {
emit('update:value', selected);
emit('change', selected);
return selected;
}
if (Array.isArray(props.value)) {
let valueList = dictValueList.value.filter((e) => value.includes(e.valueCode));
valueList = valueList.map((e) => e.valueCode);
emit('update:value', valueList);
emit('change', valueList);
} else {
let findValue = dictValueList.value.find((e) => e.valueCode == value);
emit('update:value', findValue.valueCode);
emit('change', findValue.valueCode);
}
}
</script>

View File

@ -0,0 +1,87 @@
<!--
* 文件预览 弹窗
*
* @Author: 1024创新实验室善逸
* @Date: 2022-09-02 20:19:39
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-modal title="文件预览" v-model:visible="visibleFlag" :width="768" @cancel="onClose">
<div class="container">
<img class="img-prev" :src="previewUrl" />
</div>
<template #footer>
<a-button @click="onClose">关闭</a-button>
</template>
</a-modal>
</template>
<script setup>
import { ref } from 'vue';
import { download } from '/@/lib/axios';
import { fileApi } from '/@/api/support/file/file-api';
import { smartSentry } from '/@/lib/smart-sentry';
import { SmartLoading } from '/@/components/framework/smart-loading';
const visibleFlag = ref(false);
const imgFileType = ['jpg', 'jpeg', 'png', 'gif'];
const previewUrl = ref();
function showPreview(fileItem) {
if (!fileItem.fileUrl) {
(async () => {
SmartLoading.show();
try {
let res = await fileApi.getUrl(fileItem.fileKey);
fileItem.fileUrl = res.data;
showFile(fileItem);
} catch (e) {
smartSentry.captureError(e);
} finally {
SmartLoading.hide();
}
})();
} else {
showFile(fileItem);
}
}
function showFile(fileItem) {
if (isImg(fileItem.fileType)) {
previewUrl.value = fileItem.fileUrl;
visibleFlag.value = true;
return;
}
download(fileItem.fileName, fileItem.fileUrl);
}
//
function isImg(fileType) {
return imgFileType.includes(fileType);
}
function onClose() {
visibleFlag.value = false;
}
defineExpose({
showPreview,
});
</script>
<style lang="less" scoped>
.container {
display: flex;
justify-content: center;
align-items: center;
.img-prev {
display: block;
width: 100%;
height: 600px;
object-fit: contain;
}
}
</style>

View File

@ -0,0 +1,78 @@
<!--
* 文件预览
*
* @Author: 1024创新实验室善逸
* @Date: 2022-07-19 23:19:39
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<div >
<template v-if="type == 'text'">
<a v-for="(item, index) in fileList" :key="index" @click="preview(item, index)">
{{ item.fileName }}
<span v-if="index != fileList.length - 1" v-html="separator"></span>
</a>
</template>
<a-space>
<a-image-preview-group :preview="{ visible, onVisibleChange: setVisible, current: previewCurrent }">
<a-image
v-for="(item, index) in fileList"
:key="index"
:src="item.fileUrl"
:style="{ display: type == 'text' ? 'none' : '' }"
:width="width"
/>
</a-image-preview-group>
</a-space>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { download } from '/@/lib/axios';
let props = defineProps({
fileList: {
type: Array,
default: () => {
return [];
},
},
// text,picture
type: {
type: String,
default: 'text',
},
// image
width: {
type: Number,
default: 150,
},
// html <br/>
separator: {
type: String,
default: '',
},
});
const imgFileType = ['jpg', 'jpeg', 'png', 'gif'];
//
function preview(file, index) {
if (imgFileType.some((e) => e === file.fileType)) {
previewCurrent.value = index;
visible.value = true;
} else {
download(file.fileName, file.fileUrl);
}
}
//
const visible = ref(false);
const previewCurrent = ref(0);
function setVisible(value) {
visible.value = value;
}
</script>

View File

@ -0,0 +1,199 @@
<!--
* 文件上传
*
* @Author: 1024创新实验室善逸
* @Date: 2022-08-12 20:19:39
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<div class="clearfix">
<a-upload
:accept="props.accept"
:before-upload="beforeUpload"
:customRequest="customRequest"
:file-list="fileList"
:headers="{ 'x-access-token': useUserStore().getToken }"
:list-type="listType"
@change="handleChange"
@preview="handlePreview"
@remove="handleRemove"
>
<div v-if="fileList.length < props.maxUploadSize">
<template v-if="listType == 'picture-card'">
<PlusOutlined />
<div class="ant-upload-text">
{{ buttonText }}
</div>
</template>
<template v-if="listType == 'text'">
<a-button>
<upload-outlined />
{{ buttonText }}
</a-button>
</template>
</div>
</a-upload>
<a-modal :footer="null" :visible="previewVisible" @cancel="handleCancel">
<img :src="previewUrl" alt="example" style="width: 100%" />
</a-modal>
</div>
</template>
<script setup>
import { computed, ref, watch } from 'vue';
import { message } from 'ant-design-vue';
import { fileApi } from '/@/api/support/file/file-api';
import { useUserStore } from '/@/store/modules/system/user';
import { SmartLoading } from '/@/components/framework/smart-loading';
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
import { download } from '/@/lib/axios';
import { smartSentry } from '/@/lib/smart-sentry';
const props = defineProps({
value: String,
buttonText: {
type: String,
default: '点击上传附件',
},
showUploadBtn: {
type: Boolean,
default: true,
},
defaultFileList: {
type: Array,
default: () => [],
},
multiple: {
type: Boolean,
default: false,
},
//
maxUploadSize: {
type: Number,
default: 10,
},
maxSize: {
type: Number,
default: 10,
},
//
accept: {
type: String,
default: '',
},
//
folder: {
type: Number,
default: FILE_FOLDER_TYPE_ENUM.COMMON.value,
},
// text, picture picture-card
listType: {
type: String,
default: 'picture-card',
},
});
//
const imgFileType = ['jpg', 'jpeg', 'png', 'gif'];
//
const files = computed(() => {
let res = [];
if (props.defaultFileList && props.defaultFileList.length > 0) {
props.defaultFileList.forEach((element) => {
element.url = element.fileUrl;
element.name = element.fileName;
res.push(element);
});
return res;
}
return res;
});
// -------------------- --------------------
const previewVisible = ref(false);
const fileList = ref([]);
const previewUrl = ref('');
watch(
files,
(value) => {
fileList.value = value;
},
{
immediate: true,
}
);
const emit = defineEmits(['update:value', 'change']);
const customRequest = async (options) => {
SmartLoading.show();
try {
console.log(options);
const formData = new FormData();
formData.append('file', options.file);
let res = await fileApi.uploadFile(formData, props.folder);
let file = res.data;
file.url = file.fileUrl;
file.name = file.fileName;
fileList.value.push(file);
emit('change', fileList.value);
} catch (e) {
smartSentry.captureError(e);
} finally {
SmartLoading.hide();
}
};
function handleChange(info) {
let fileStatus = info.file.status;
let file = info.file;
if (fileStatus == 'removed') {
let index = fileList.value.findIndex((e) => e.fileId == file.fileId);
if (index != -1) {
fileList.value.splice(index, 1);
emit('change', fileList.value);
}
}
}
function handleRemove(file) {
console.log(fileList.value);
}
function beforeUpload(file) {
const isLimitSize = file.size / 1024 / 1024 < props.maxSize;
if (!isLimitSize) {
return message.error(`上传的文件必须小于${props.maxSize}Mb`);
}
return isLimitSize;
}
function handleCancel() {
previewVisible.value = false;
}
const handlePreview = async (file) => {
if (imgFileType.some((e) => e === file.fileType)) {
previewUrl.value = file.url || file.preview;
previewVisible.value = true;
} else {
download(file.fileName, file.fileUrl);
}
};
// ------------------------ ------------------------
function clear() {
fileList.value = [];
}
defineExpose({
clear,
});
</script>
<style lang="less" scoped>
:deep(.ant-upload-picture-card-wrapper) {
display: flex;
}
</style>

View File

@ -0,0 +1,163 @@
<!--
* 表格列设置
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-26 23:45:51
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<span>
<a-tooltip title="全屏" v-if="!fullScreenFlag">
<a-button type="text" @click="fullScreen" size="small">
<template #icon><fullscreen-outlined /></template>
</a-button>
</a-tooltip>
<a-tooltip title="取消全屏" v-if="fullScreenFlag">
<a-button type="text" @click="fullScreen" size="small">
<template #icon><fullscreen-exit-outlined /></template>
</a-button>
</a-tooltip>
<a-tooltip title="刷新">
<a-button type="text" @click="props.refresh" size="small">
<template #icon><redo-outlined /></template>
</a-button>
</a-tooltip>
<a-tooltip title="列设置">
<a-button type="text" @click="showModal" size="small">
<template #icon><setting-outlined /></template>
</a-button>
</a-tooltip>
<SmartTableColumnModal ref="smartTableColumnModal" @change="updateColumn" />
</span>
</template>
<script setup>
import _ from 'lodash';
import { tableColumnApi } from '/@/api/support/table/table-column-api';
import { onMounted, reactive, ref, watch } from 'vue';
import SmartTableColumnModal from './smart-table-column-modal.vue';
import { message } from 'ant-design-vue';
import { mergeColumn } from './smart-table-column-merge';
import { smartSentry } from '/@/lib/smart-sentry';
const props = defineProps({
//
modelValue: {
type: Array,
default: new Array(),
},
//
refresh: {
type: Function,
required: true,
},
// id
tableId: {
type: Number,
require: true,
},
});
const emit = defineEmits(['update:modelValue']);
// columns使
let originalColumn = _.cloneDeep(props.modelValue);
onMounted(buildUserTableColumns);
//
async function buildUserTableColumns() {
if (!props.tableId) {
return;
}
let userTableColumnArray = [];
try {
let res = await tableColumnApi.getColumns(props.tableId);
if (res.data) {
try {
userTableColumnArray = JSON.parse(res.data);
} catch (e1) {
smartSentry.captureError(e1);
}
}
} catch (e) {
smartSentry.captureError(e);
}
updateColumn(userTableColumnArray);
}
// ----------------- -------------------
const fullScreenFlag = ref(false);
function fullScreen() {
if (fullScreenFlag.value) {
//
exitFullscreen(document.querySelector('#smartAdminLayoutContent'));
fullScreenFlag.value = false;
} else {
//
launchFullScreen(document.querySelector('#smartAdminLayoutContent'));
fullScreenFlag.value = true;
}
}
// -
function launchFullScreen(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else {
message.error('当前浏览器不支持部分全屏!');
}
}
// -退
function exitFullscreen(element) {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
// ----------------- -------------------
const smartTableColumnModal = ref();
function showModal() {
smartTableColumnModal.value.show(originalColumn, props.tableId);
}
//
function updateColumn(changeColumnArray) {
//
const newColumns = mergeColumn(_.cloneDeep(originalColumn), changeColumnArray);
emit(
'update:modelValue',
newColumns.filter((e) => e.showFlag)
);
}
// ========= watch ===============
watch(
() => props.tableId,
(e) => {
if (e) {
originalColumn = _.cloneDeep(props.modelValue);
buildUserTableColumns();
}
},
{ immediate: true }
);
</script>

View File

@ -0,0 +1,54 @@
/*
* 表格列设置
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-26 23:45:51
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
import _ from 'lodash';
/**
* 将原视表格列和用户表格列进行合并排序
* @param {*} originalTableColumnArray
* @param {*} userTableColumnArray
*/
export function mergeColumn(originalTableColumnArray, userTableColumnArray) {
if (!userTableColumnArray) {
return originalTableColumnArray;
}
//第一步将用户的列数据转为Map以后备使用
let userTableColumnMap = new Map();
for (const item of userTableColumnArray) {
userTableColumnMap.set(item.columnKey, item);
}
//第二步以前端的table columns列为基础将用户后端的数据填充到前端表格列里
let fontColumnSort = 1;
let newColumns = [];
for (const fontColumn of originalTableColumnArray) {
//原始表格列默认显示
fontColumn.columnKey = fontColumn.dataIndex;
fontColumn.showFlag = true;
fontColumn.sort = fontColumnSort;
// 如果用户存在此列,则覆盖 sort和width、showFlag字段
let userColumn = userTableColumnMap.get(fontColumn.columnKey);
if (userColumn) {
fontColumn.sort = userColumn.sort;
fontColumn.showFlag = userColumn.showFlag;
if (userColumn.width) {
fontColumn.width = userColumn.width;
}
}
newColumns.push(fontColumn);
fontColumnSort++;
}
//第三步:前端列进行排序
newColumns = _.sortBy(newColumns, (e) => e.sort);
return newColumns;
}

View File

@ -0,0 +1,280 @@
<!--
* 表格列设置
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-26 23:45:51
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-modal :width="700" :visible="visible" title="设置列" :destroyOnClose="true" :closable="false">
<a-alert type="info" show-icon class="smart-margin-bottom10">
<template #icon><smile-outlined /></template>
<template #message> 可以通过拖拽行直接修改顺序哦 <pushpin-outlined />为固定列不可拖拽 </template>
</a-alert>
<a-table
id="smartTableColumnModalTable"
rowKey="columnKey"
row-class-name="column-row"
:columns="tableColumns"
:dataSource="tableData"
:rowSelection="{ checkStrictly: false, selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
:pagination="false"
size="small"
bordered
>
<template #bodyCell="{ text, record, index, column }">
<template v-if="column.dataIndex === 'title'">
<a-button type="text" :class="record.fixed ? '' : 'handle'" size="small" style="width: 100%; text-align: left">
<template #icon v-if="!record.fixed"> <drag-outlined /> </template>
<template #icon v-if="record.fixed"> <pushpin-outlined /> </template>
{{ text }}
</a-button>
</template>
<template v-if="column.dataIndex === 'width'">
<a-input-number v-model:value="record.width" style="width: 90px; margin-left: 10px; margin-right: 3px" size="small" />px
</template>
<template v-if="column.dataIndex === 'operate'">
<div class="smart-table-operate" v-if="!record.fixed">
<a-button @click="up(index)" v-show="index > 0" type="link" class="handle" size="small" style="margin-right: 12px"> 上移 </a-button>
<a-button @click="down(index)" type="link" class="handle" size="small" v-show="index !== tableData.length - 1"> 下移</a-button>
</div>
</template>
</template>
</a-table>
<template #footer>
<a-button key="back" @click="hide">取消</a-button>
<a-button key="submit" type="primary" :loading="submitLoading" @click="save">保存</a-button>
<a-button key="back" :loading="submitLoading" @click="reset" danger style="margin-left: 20px">恢复默认</a-button>
</template>
</a-modal>
</template>
<script setup>
import { SmartLoading } from '/@/components/framework/smart-loading';
import { tableColumnApi } from '/@/api/support/table/table-column-api';
import { ref, reactive, nextTick, computed } from 'vue';
import _ from 'lodash';
import Sortable from 'sortablejs';
import { message, Modal } from 'ant-design-vue';
import { mergeColumn } from './smart-table-column-merge';
import { smartSentry } from '/@/lib/smart-sentry';
const emit = defineEmits(['change']);
defineExpose({ show });
// ---------------- / --------------------
let tableId = 1;
const visible = ref(false);
//
function show(columns, showTableId) {
tableId = showTableId;
visible.value = true;
getUserTableColumns(tableId, _.cloneDeep(columns));
}
//
function hide() {
visible.value = false;
}
//
async function getUserTableColumns(tableId, columns) {
SmartLoading.show();
let userTableColumnArray = [];
try {
let res = await tableColumnApi.getColumns(tableId);
if (res.data) {
try {
userTableColumnArray = JSON.parse(res.data);
} catch (e1) {
smartSentry.captureError(e1);
}
}
} catch (e) {
smartSentry.captureError(e);
} finally {
SmartLoading.hide();
}
//
tableData.value = mergeColumn(columns, userTableColumnArray);
//
for (const item of tableData.value) {
if (item.showFlag) {
selectedRowKeyList.value.push(item.columnKey);
continue;
}
}
nextTick(() => {
initDrag();
});
}
// --------------------- --------------------------------
const tableData = ref([]);
const tableColumns = [
{
title: '列',
dataIndex: 'title',
},
{
title: '宽度(像素)',
dataIndex: 'width',
width: 150,
},
{
title: '操作',
dataIndex: 'operate',
width: 150,
rowDrag: true,
},
];
// --------------------- --------------------------------
//
function initDrag() {
let tbody = document.querySelector('#smartTableColumnModalTable tbody');
Sortable.create(tbody, {
animation: 300,
dragClass: 'smart-ghost-class', //
ghostClass: 'smart-ghost-class', //
chosenClass: 'smart-ghost-class', //
handle: '.handle',
onEnd({ newIndex, oldIndex }) {
if (newIndex == oldIndex) {
return;
}
moveTableData(oldIndex, newIndex);
},
});
}
//
function up(oldIndex) {
let newIndex = oldIndex - 1;
if (newIndex < 0) {
return;
}
//
if (tableData.value[newIndex].fixed) {
return;
}
moveTableData(oldIndex, newIndex);
}
//
function down(oldIndex) {
let newIndex = oldIndex + 1;
if (newIndex >= tableData.value.length) {
return;
}
//
if (tableData.value[newIndex].fixed) {
return;
}
moveTableData(oldIndex, newIndex);
}
//
function moveTableData(oldIndex, newIndex) {
const currRow = tableData.value.splice(oldIndex, 1)[0];
tableData.value.splice(newIndex, 0, currRow);
}
// ----------- table start -----------
const selectedRowKeyList = ref([]);
function onSelectChange(keyArray) {
selectedRowKeyList.value = keyArray;
}
// ------------------------- ------------------------
const submitLoading = ref(false);
//
function reset() {
Modal.confirm({
title: '确定要恢复默认吗?',
content: '确定恢复默认后,该信息将不可恢复',
okText: '确定恢复',
okType: 'danger',
onOk() {
(async () => {
submitLoading.value = true;
try {
await tableColumnApi.deleteColumns(tableId);
message.success('恢复默认成功');
emit('change', []);
hide();
} catch (e) {
smartSentry.captureError(e);
} finally {
submitLoading.value = false;
}
})();
},
cancelText: '取消',
onCancel() {},
});
}
//
async function save() {
submitLoading.value = true;
try {
let columnList = [];
for (let index = 0; index < tableData.value.length; index++) {
let item = tableData.value[index];
let column = {
columnKey: item.columnKey,
sort: index + 1,
};
if (item.width) {
column.width = item.width;
}
column.showFlag = selectedRowKeyList.value.indexOf(item.columnKey) > -1 ? true : false;
columnList.push(column);
}
columnList = _.sortBy(columnList, (e) => e.sort);
await tableColumnApi.updateTableColumn({
tableId,
columnList,
});
message.success('保存成功');
emit('change', columnList);
hide();
} catch (e) {
smartSentry.captureError(e);
} finally {
submitLoading.value = false;
}
}
</script>
<style scoped lang="less">
.column-row:hover {
background-color: red !important;
}
.column-row {
cursor: pointer;
}
.blue-background-class {
background-color: red !important;
}
:deep(.ant-table-tbody) {
.ant-table-row-selected > td {
background-color: #ffffff;
}
}
</style>

View File

@ -0,0 +1,58 @@
<!--
* 部门 树形选择框
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-12 23:05:43
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*
-->
<template>
<a-tree-select
:value="props.value"
:treeData="treeData"
:fieldNames="{ label: 'name', key: 'departmentId', value: 'departmentId' }"
show-search
style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
placeholder="请选择部门"
allow-clear
tree-default-expand-all
:multiple="props.multiple"
@change="onChange"
/>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import _ from 'lodash';
import { departmentApi } from '/@/api/system/department/department-api';
const props = defineProps({
//
value: Number,
//
multiple: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(['update:value']);
let treeData = ref([]);
onMounted(queryDepartmentTree);
async function queryDepartmentTree() {
let res = await departmentApi.queryDepartmentTree();
treeData.value = res.data;
}
function onChange(e) {
emit('update:value', e);
}
defineExpose({
queryDepartmentTree,
});
</script>

View File

@ -0,0 +1,97 @@
<!--
* 员工下拉选择框
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-12 15:09:02
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<a-select
v-model:value="selectValue"
:style="`width: ${width}`"
:placeholder="props.placeholder"
:showSearch="true"
:allowClear="true"
:size="size"
@change="onChange"
>
<a-select-option v-for="item in employeeList" :key="item.employeeId" :value="item.employeeId">
{{ item.actualName }}
<template v-if="item.departmentName"> {{ item.departmentName }} </template>
</a-select-option>
</a-select>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue';
import { employeeApi } from '/@/api/system/employee/employee-api';
import { smartSentry } from '/@/lib/smart-sentry';
// =========== =============
const props = defineProps({
value: [Number, Array],
placeholder: {
type: String,
default: '请选择',
},
width: {
type: String,
default: '100%',
},
size: {
type: String,
default: 'default',
},
// ID
roleId: {
type: Number,
default: null,
},
//
disabledFlag: {
type: Number,
default: null,
},
});
const emit = defineEmits(['update:value', 'change']);
// =========== =============
//
const employeeList = ref([]);
async function query() {
try {
let params = {};
if (props.roleId) {
params = { roleId: props.roleId };
}
if (null != props.disabledFlag) {
params.disabledFlag = props.disabledFlag;
}
let resp = await employeeApi.queryAll(params);
employeeList.value = resp.data;
} catch (e) {
smartSentry.captureError(e);
}
}
onMounted(query);
// =========== =============
const selectValue = ref(props.value);
watch(
() => props.value,
(newValue) => {
selectValue.value = newValue;
}
);
function onChange(value) {
emit('update:value', value);
emit('change', value);
}
</script>

View File

@ -0,0 +1,182 @@
<!--
* 员工 表格 弹窗 选择框
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-19 23:09:02
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<a-modal v-model:visible="visible" :width="900" title="选择人员" @cancel="closeModal" @ok="onSelectEmployee">
<a-form class="smart-query-form">
<a-row class="smart-query-form-row">
<a-form-item label="关键字" class="smart-query-form-item">
<a-input style="width: 150px" v-model:value="params.keyword" placeholder="关键字" />
</a-form-item>
<a-form-item label="部门" class="smart-query-form-item">
<DepartmentTreeSelect style="width: 200px" ref="departmentTreeSelect" v-model:value="params.departmentId" />
</a-form-item>
<a-form-item label="状态" class="smart-query-form-item">
<a-select style="width: 120px" v-model:value="params.disabledFlag" placeholder="请选择状态" allowClear>
<a-select-option :key="1"> 禁用 </a-select-option>
<a-select-option :key="0"> 启用 </a-select-option>
</a-select>
</a-form-item>
<a-form-item class="smart-query-form-item smart-margin-left10">
<a-button type="primary" @click="queryEmployee">
<template #icon>
<SearchOutlined />
</template>
查询
</a-button>
<a-button @click="reset" class="smart-margin-left10">
<template #icon>
<ReloadOutlined />
</template>
重置
</a-button>
</a-form-item>
</a-row>
</a-form>
<a-table
:row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
:loading="tableLoading"
size="small"
:columns="columns"
:data-source="tableData"
:pagination="false"
bordered
rowKey="employeeId"
:scroll="{ y: 300 }"
>
<template #bodyCell="{ text, column }">
<template v-if="column.dataIndex === 'disabledFlag'">
<a-tag :color="text ? 'error' : 'processing'">{{ text ? '禁用' : '启用' }}</a-tag>
</template>
<template v-if="column.dataIndex === 'gender'">
<span>{{ $smartEnumPlugin.getDescByValue('GENDER_ENUM', text) }}</span>
</template>
</template>
</a-table>
<div class="smart-query-table-page">
<a-pagination
showSizeChanger
showQuickJumper
show-less-items
:pageSizeOptions="PAGE_SIZE_OPTIONS"
:defaultPageSize="params.pageSize"
v-model:current="params.pageNum"
v-model:pageSize="params.pageSize"
:total="total"
@change="queryEmployee"
@showSizeChange="queryEmployee"
:show-total="(total) => `共${total}条`"
/>
</div>
</a-modal>
</template>
<script setup>
import { message } from 'ant-design-vue';
import { computed, reactive, ref } from 'vue';
import { employeeApi } from '/@/api/system/employee/employee-api';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue';
import { smartSentry } from '/@/lib/smart-sentry';
// ----------------------- emits props ---------------------
const emits = defineEmits('selectData');
defineExpose({
showModal,
});
// ----------------------- modal ---------------------
const visible = ref(false);
async function showModal(selectEmployeeId) {
selectedRowKeyList.value = selectEmployeeId || [];
visible.value = true;
queryEmployee();
}
function closeModal() {
Object.assign(params, defaultParams);
selectedRowKeyList.value = [];
visible.value = false;
}
// ----------------------- ---------------------
const tableLoading = ref(false);
const departmentTreeSelect = ref();
const total = ref();
let defaultParams = {
departmentId: undefined,
disabledFlag: undefined,
employeeIdList: undefined,
keyword: undefined,
searchCount: undefined,
pageNum: 1,
pageSize: PAGE_SIZE,
sortItemList: undefined,
};
const params = reactive({ ...defaultParams });
function reset() {
Object.assign(params, defaultParams);
queryEmployee();
}
async function queryEmployee() {
tableLoading.value = true;
try {
let res = await employeeApi.queryEmployee(params);
tableData.value = res.data.list;
total.value = res.data.total;
} catch (error) {
smartSentry.captureError(error);
} finally {
tableLoading.value = false;
}
}
// ----------------------- ---------------------
let selectedRowKeyList = ref([]);
const hasSelected = computed(() => selectedRowKeyList.value.length > 0);
function onSelectChange(selectedRowKeys) {
selectedRowKeyList.value = selectedRowKeys;
}
function onSelectEmployee() {
if (!hasSelected.value) {
message.warning('请选择角色人员');
return;
}
emits('selectData', selectedRowKeyList.value);
closeModal();
}
// ----------------------- ---------------------
const tableData = ref([]);
//
const columns = [
{
title: '姓名',
dataIndex: 'actualName',
},
{
title: '手机号',
dataIndex: 'phone',
},
{
title: '性别',
dataIndex: 'gender',
},
{
title: '登录账号',
dataIndex: 'loginName',
},
{
title: '状态',
dataIndex: 'disabledFlag',
},
];
</script>

View File

@ -0,0 +1,76 @@
<!--
* 菜单 树形 下拉选择框
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-01 23:14:49
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<a-tree-select
:value="props.value"
:treeData="treeData"
:fieldNames="{ label: 'menuName', key: 'menuId', value: 'menuId' }"
show-search
tree-checkable
style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
placeholder="请选择菜单"
allow-clear
tree-default-expand-all
@change="onSelectChange"
/>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import _ from 'lodash';
import { menuApi } from '/@/api/system/menu/menu-api';
import { buildMenuTableTree } from '/@/views/system/menu/menu-data-handler';
import { MENU_TYPE_ENUM } from '/@/constants/system/menu-const';
const props = defineProps({
//
value: Array,
//
multiple: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(['update:value']);
let treeData = ref([]);
onMounted(queryMenuTree);
//
let menuList = [];
async function queryMenuTree() {
let res = await menuApi.queryMenu();
menuList = res.data.filter((e) => e.menuType === MENU_TYPE_ENUM.MENU.value || e.menuType === MENU_TYPE_ENUM.CATALOG.value);
for (const item of menuList) {
if (item.menuType === MENU_TYPE_ENUM.CATALOG.value) {
item.disabled = true;
}
}
treeData.value = buildMenuTableTree(menuList);
}
/**
* 根据id集合获取菜单集合
*/
function getMenuListByIdList(menuIdList) {
return _.cloneDeep(menuList.filter((e) => menuIdList.indexOf(e.menuId) > -1));
}
function onSelectChange(e) {
emit('update:value', e);
}
// ----------------------- ------------------------
defineExpose({
queryMenuTree,
getMenuListByIdList,
});
</script>

View File

@ -0,0 +1,29 @@
/*
* 应用默认配置
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 22:07:01
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
export const appDefaultConfig = {
// i18n 语言选择
language: 'zh_CN',
// 布局: side 或者 side-expand
layout: 'side',
// 侧边菜单宽度 默认为200px
sideMenuWidth: 200,
// 菜单主题
sideMenuTheme: 'dark',
// 标签页
pageTagFlag: true,
// 面包屑
breadCrumbFlag: true,
// 页脚
footerFlag: true,
// 帮助文档
helpDocFlag: false,
// 网站名称
websiteName: 'SmartAdmin 2.X',
};

View File

@ -0,0 +1,23 @@
/*
* 类别
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 22:07:51
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
export const CATEGORY_TYPE_ENUM = {
GOODS: {
value: 1,
desc: '商品',
},
DEMO: {
value: 2,
desc: '演示分类',
},
};
export default {
CATEGORY_TYPE_ENUM,
};

View File

@ -0,0 +1,26 @@
/*
* 商品
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-03 22:08:10
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/
export const GOODS_STATUS_ENUM = {
APPOINTMENT: {
value: 1,
desc: '预约中',
},
SELL: {
value: 2,
desc: '售卖中',
},
SELL_OUT: {
value: 3,
desc: '售罄',
},
};
export default {
GOODS_STATUS_ENUM,
};

Some files were not shown because too many files have changed in this diff Show More