From fd10983400c917836478d016fb69e9d75902e681 Mon Sep 17 00:00:00 2001 From: LX <768863620@qq.com> Date: Wed, 20 Sep 2023 13:52:21 +0800 Subject: [PATCH] no message --- 前端/Table 隐藏列自动保存.md | 174 ++++++ ...新增,修改,删除)(添加自定义按钮)隐藏显示.md | 524 ++++++++++++++++++ 大屏/大屏开发文档.md | 419 ++++++++++++++ 部署手册/linux部署手册.md | 281 ++++++++++ 4 files changed, 1398 insertions(+) create mode 100644 前端/Table 隐藏列自动保存.md create mode 100644 前端/页面按钮(新增,修改,删除)(添加自定义按钮)隐藏显示.md create mode 100644 大屏/大屏开发文档.md create mode 100644 部署手册/linux部署手册.md diff --git a/前端/Table 隐藏列自动保存.md b/前端/Table 隐藏列自动保存.md new file mode 100644 index 0000000..6e2c08a --- /dev/null +++ b/前端/Table 隐藏列自动保存.md @@ -0,0 +1,174 @@ +                                          Table 隐藏列自动保存 + +页面中配置crudOperation :tableKey='tableKey' + +``` + + +``` + +在data 中添加 tabkeKey + +``` +data() { + return { + queryTypeOptions: [ + { key: 'code', display_name: '代码' }, + { key: 'name', display_name: '名称' }, + { key: 'enabled', display_name: '状态' }, + { key: 'heat', display_name: '热度' } + ], + permission: { + add: ['admin', 'area:add'], + edit: ['admin', 'area:edit'], + del: ['admin', 'area:del'] + }, + tableKey:'api/area', + rules: { + code: [ + { required: true, message: '库区编号不能为空', trigger: 'blur' } + ] + } + } + } +``` + +全部代码 + +``` + + + + + + +``` diff --git a/前端/页面按钮(新增,修改,删除)(添加自定义按钮)隐藏显示.md b/前端/页面按钮(新增,修改,删除)(添加自定义按钮)隐藏显示.md new file mode 100644 index 0000000..357a086 --- /dev/null +++ b/前端/页面按钮(新增,修改,删除)(添加自定义按钮)隐藏显示.md @@ -0,0 +1,524 @@ +对页面 新增 修改 删除等按钮进行隐藏,添加自定义按钮 + +``` +cruds() { + return CRUD({ + title: '出库明细', + url: 'api/pickDetail', + idField: 'id', + sort: 'id,desc', + crudMethod: {...crudPickDetail}, + optShow: { + add: true, + edit: false, + del: false, + reset: true, + download: true + } + }) + } +``` + +添加自定义按钮 + +[:disabled="show_fp” ]()为显示状态 + +[@click="allocate(crud.selections)"]() 为点击时间 [crud.selections]() 选中的数据 + +``` + + 分配 + +``` + + + +``` +data() { + return { + show_fp: true, + show_jh: true, + show_cancelfp:true, + radio3: '全部', + items: [], + permission: { + add: ['admin', 'pickDetail:add'], + edit: ['admin', 'pickDetail:edit'], + del: ['admin', 'pickDetail:del'] + }, + rules: { + item: [ + {required: true, message: '物料必填', trigger: 'blur'} + ] + }, + queryTypeOptions: [ + {key: 'itemCode', display_name: '物料编码'}, + {key: 'itemName', display_name: '物料名称'}, + {key: 'po', display_name: '任务号'}, + {key: 'status', display_name: '状态'} + ] + } + } +``` + +``` +allocate(datas) { + this.$confirm(`选中的${datas.length}条数据分配确认?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + + const ids = []; + for (let i = 0; i < datas.length; i++) { + ids.push(datas[i].id) + } + crudPickDetail.allocate(ids).then(res => { + DonMessage.success('分配成功!') + this.crud.toQuery(); + }).catch(() => { + + }) + + }).catch(() => { + this.$refs.table.clearSelection() + DonMessage.info('取消成功!') + }); + } +``` + +修改选择框选中事件 [@selection-change="selectionChangeHandlerTwo"]() + +``` + +``` + +根据选择的数据进行判断,新加的按钮是否可用 + +``` + selectionChangeHandlerTwo(val) { + this.crud.selections = val + if (this.crud.selections.length > 1 || this.crud.selections.length == 0) { + this.show_jh = true; + this.show_fp = true; + this.show_cancelfp=true; + } + + //分配 + if (this.crud.selections.length == 1 && this.crud.selections[0].orderQty > this.crud.selections[0].allocatedQty) { + this.show_jh = true; + this.show_fp = false; + } + + //取消分配 + if (this.crud.selections.length == 1 && this.crud.selections[0].orderQty == this.crud.selections[0].allocatedQty&&this.crud.selections[0].pickedQty==0) { + this.show_jh = true; + this.show_fp = true; + this.show_cancelfp=false; + } + + //拣货 + if (this.crud.selections.length == 1 && this.crud.selections[0].orderQty == this.crud.selections[0].allocatedQty) { + this.show_jh = false; + this.show_fp = true; + } + + + } +``` + +完整代码,请查看 /views/business-data/asnDetial/index + +``` + + + + + + +``` diff --git a/大屏/大屏开发文档.md b/大屏/大屏开发文档.md new file mode 100644 index 0000000..39c55fc --- /dev/null +++ b/大屏/大屏开发文档.md @@ -0,0 +1,419 @@ +# 大屏开发文档 + +demo下载地址 http://47.100.54.81:3000/LiuXue/Youchain_DaPinDemo.git + +[Examples - Apache ECharts](https://echarts.apache.org/examples/zh/index.html) + +关键代码地址:/src/router/index.js    /src/router/router.js + +router.js + +你需要像login 页面一样给新页面添加访问路径,并配置标题(浏览器顶部显示)以及vue的路径 + +``` +import Vue from 'vue' +import Router from 'vue-router' +import Layout from '../layout/index' + +Vue.use(Router) + +export const constantRouterMap = [ + { path: '/login', + meta: { title: '登录', noCache: true }, + component: (resolve) => require(['@/views/login'], resolve), + hidden: true + }, + { path: '/home', + meta: { title: '登录', noCache: true }, + component: (resolve) => require(['@/views/home'], resolve), + hidden: true + }, + { path: '/test', + meta: { title: '测试', noCache: true }, + component: (resolve) => require(['@/views/app-dashboard/index'], resolve), + hidden: true + }, + { path: '/test2', + meta: { title: '测试2', noCache: true }, + component: (resolve) => require(['@/views/zhongwei-daping/index'], resolve), + hidden: true + }, + { + path: '/404', + component: (resolve) => require(['@/views/features/404'], resolve), + hidden: true + }, + { + path: '/401', + component: (resolve) => require(['@/views/features/401'], resolve), + hidden: true + }, + { + path: '/redirect', + component: Layout, + hidden: true, + children: [ + { + path: '/redirect/:path*', + component: (resolve) => require(['@/views/features/redirect'], resolve) + } + ] + }, + { + path: '/', + component: Layout, + redirect: '/dashboard', + children: [ + { + path: 'dashboard', + component: (resolve) => require(['@/views/home'], resolve), + name: 'Dashboard', + meta: { title: '首页', icon: 'index', affix: true, noCache: true } + } + ] + }, + { + path: '/user', + component: Layout, + hidden: true, + redirect: 'noredirect', + children: [ + { + path: 'center', + component: (resolve) => require(['@/views/system/user/center'], resolve), + name: '个人中心', + meta: { title: '个人中心' } + } + ] + } +] + +export default new Router({ + // mode: 'hash', + mode: 'history', + scrollBehavior: () => ({ y: 0 }), + routes: constantRouterMap +}) + +``` + + + +index.js + +whiteList 为白名单列表,你需要把 访问路径添加到白名单 + + import router from './routers' + import store from '@/store' + import Config from '@/settings' + import NProgress from 'nprogress' // progress bar + import 'nprogress/nprogress.css'// progress bar style + import { buildMenus } from '@/api/system/menu' + import { filterAsyncRouter } from '@/store/modules/permission' + + NProgress.configure({ showSpinner: false })// NProgress Configuration + + const whiteList = ['/login', '/401', '/404', '/home', '/test', '/test2']// no redirect whitelist + + router.beforeEach((to, from, next) => { + if (to.meta.title) { + document.title = to.meta.title + ' - ' + Config.title + } + if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入 + next() + } else { + next(`/login`) // 否则全部重定向到登录页 + NProgress.done() + } + }) + + export const loadMenus = (next, to) => { + buildMenus().then(res => { + const sdata = JSON.parse(JSON.stringify(res)) + const rdata = JSON.parse(JSON.stringify(res)) + const sidebarRoutes = filterAsyncRouter(sdata) + const rewriteRoutes = filterAsyncRouter(rdata, false, true) + rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) + + store.dispatch('GenerateRoutes', rewriteRoutes).then(() => { // 存储路由 + router.addRoutes(rewriteRoutes) // 动态添加可访问路由表 + next({ ...to, replace: true }) + }) + store.dispatch('SetSidebarRouters', sidebarRoutes) + }) + } + + router.afterEach(() => { + NProgress.done() // finish progress bar + }) + +/src/view/zhongwei-daping/index.vue + +使用el-row 对页面进行布局 + +.mian-container / background-image 为背景图片 + +.divmao    单块背景模糊 + +        backdrop-filter 模糊像素,越大越模糊 + +        background      背景色,最后两位是透明度 + +        box-shadow     边缘阴影 + +![](C:\Users\15267\AppData\Roaming\marktext\images\2023-08-31-10-38-26-image.png) + +``` + + + + + + +``` + +    页面添加雷达图 + +    import RadarChart from './RadarChart.vue' + +    在components 中引用 + +``` + export default { + name: 'DataView', + components: { + BarChart, + RightChart1, + // eslint-disable-next-line vue/no-unused-components + RadarChart + }, + data() { + return {} + } + +} +``` + +    直接在 EL 中添加 + +``` + +     + +``` + +/src/zhongwei-daping/RadarChatr    雷达图 + +静态数据 + +``` + + + + +``` + +             动态数据的话,修改 initChart()部分为 + +``` +methods: { + initChart() { + this.chart = echarts.init(this.$el, 'macarons') + crudSysAppUpdate.get().then(res => { + this.chart.setOption(res) + }) + } +} +``` + + diff --git a/部署手册/linux部署手册.md b/部署手册/linux部署手册.md new file mode 100644 index 0000000..6222bc7 --- /dev/null +++ b/部署手册/linux部署手册.md @@ -0,0 +1,281 @@ +ubuntu 部署项目 + +安装桌面 + +``` +1.sudo apt-get update + +2.sudo apt-get install ubuntu-desktop +``` + +安装远程工具 + +```markup +sudo apt-get install xrdp +``` + +然后用win+R 键输入mstsc,进入下面远程桌面连接,输入之前的IP; + +![](https://www.guyuehome.com/Uploads/Editor/202210/20201216141326387.png) + +同样的输入账号和密码,就可以进入了,这个看起来就舒服多了。 + +![](https://www.guyuehome.com/Uploads/Editor/202210/20201216141339557.png) + +## 步骤1:安装 MySQL + +在 Ubuntu 上通过以下步骤安装 MySQL 服务器及客户端: + +```shell +sudo apt-get update +sudo apt-get install mysql-server mysql-client +``` + +安装过程中,您可能会被要求设置 root 用户的密码。如果没有出现该对话框,请继续执行下面的步骤。 + +## 步骤2:修改用户密码 + +要修改 root 用户的密码,请按照以下步骤操作: + +1. 打开终端,并以 root 用户身份登录到 MySQL shell: + + ```shell + sudo mysql -u root + ``` + +2. 输入 root 密码以登录到 MySQL shell。 + +3. 在 MySQL shell 中,执行以下命令来更改 root 用户的密码(将 `new_password` 替换为您要设置的新密码): + + ```sql + ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password'; + FLUSH PRIVILEGES; + ``` + +4. 退出 MySQL shell: + + ```sql + EXIT; + ``` + +## 步骤3:配置 MySQL 允许远程连接 + +要允许来自其他主机的连接,请按照以下步骤进行配置: + +1. 编辑 MySQL 配置文件: + + ```shell + sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf + ``` + +2. 找到 `bind-address` 行并注释掉(在行前添加 `#` 符号),以允许来自任何 IP 地址的连接。 + +3. 保存并关闭文件。 + +4. 重新启动 MySQL 服务器: + + ```shell + sudo systemctl restart mysql + ``` + +## 步骤4:修改配置,使其可以被navicat连接 + +1. 打开终端,并以 root 用户身份登录到 MySQL shell: + +```shell + sudo mysql -u root -p +``` + +选择数据库 + +```php +use mysql; +``` + +更新root用户host字段 让所有ip都可以连接 + +```bash + update user set host = '%' where user = 'root'; +``` + +刷新修改 + +```undefined +FLUSH PRIVILEGES; +``` + +## 步骤5:连接 MySQL 数据库 + +现在我们可以使用 Navicat 连接到 MySQL 数据库: + +1. 打开 Navicat 工具,并点击 "连接"(Connect)按钮。 + +2. 在新建连接窗口中,输入以下信息: + + - 连接名(Connection Name):自定义名称。 + - 主机名或 IP 地址(Host):MySQL 服务器的 IP 地址或主机名。 + - 端口号(Port):默认为 3306。 + - 用户名(Username):root 或您创建的其他用户。 + - 密码(Password):之前设置的密码。 + +3. 点击 "测试连接"(Test Connection)按钮以验证连接是否成功。 + +4. 如果连接测试通过,点击 "连接"(Connect)按钮以建立与 MySQL 数据库的连接。 + +恭喜!您已经成功安装了 MySQL 并使用 Navicat 连接到 MySQL 数据库。现在您可以开始管理和操作数据库了。 + +请注意,在执行上述步骤时,请根据实际情况调整参数和配置信息,确保正确设置密码和允许远程连接。 + +### 卸载MySQL [在Ubuntu中删除mysql_ubuntu卸载mysql_ccbbaaap的博客-CSDN博客](https://blog.csdn.net/ccbbaaap/article/details/130657186) + +# # Reids 安装 + +一、安装 +1.1 更新仓库(非必须) + +``` +sudo apt update +``` + +1.2 使用 apt 从官方 Ubuntu 存储库来安装 Redis + +``` +sudo apt-get install redis-server +``` + +二、设置密码 +2.1 打开Redis配置文件redis.conf + +``` +sudo vi /etc/redis/redis.conf +``` + +2.2 找到# requirepass foobared这一行,将注释符号#去掉,将后面修改成自己的密码,例如,设置密码为123abc + +``` +requirepass 123abc +``` + +三、开启远程访问 +默认情况下,Redis服务器不允许远程访问,只允许本机访问,所以我们需要设置打开远程访问的功能。 + +1、打开Redis服务器的配置文件redis.conf + +``` +sudo vi /etc/redis/redis.conf +``` + +2、使用注释符号#注释bind 127.0.0.1这行 + +#注释bind +#bind 127.0.0.1 +四、Redis服务控制命令 + +``` +/etc/init.d/redis-server start #启动 +/etc/init.d/redis-server stop #关闭 +/etc/init.d/redis-server restart #重启 +``` + + vim 搜索 / 加搜索关键词 + + + +# nginx 安装 + +``` + apt-get install nginx +``` + +其他命令 + +``` +查看版本 +nginx -v +启动nginx +service nginx start +查看运行状态 +service nginx status +重启nginx +service nginx restart +sudo systemctl restart nginx +``` + +安装后的文件目录 + +``` +/usr/sbin/nginx:主程序 +/etc/nginx:存放配置文件 +/usr/share/nginx:存放静态文件 +/var/log/nginx:存放日志 +``` + + + +# 安装JDK1.8 + +``` + sudo apt install openjdk-8-jre-headless + java -version +``` + + + + + +# 后端启动 + +``` +nohup java -jar eladmin-system-2.6.jar --spring.profiles.active=prod > nohup.out 2>&1 &o +``` + + + +## 后端停止 + +``` +PID=$(ps -ef | grep eladmin-system-2.6.jar | grep -v grep | awk '{ print $2 }') +if [ -z "$PID" ] +then +echo Application is already stopped +else +echo kill -9 $PID +kill -9 $PID +fi +``` + +# **查看日志脚本** + +``` +tail -f nohup.out +``` + + + +# 前端部署nginx 配置 + +在http{} 中添加server + +``` +server{ + listen 8091; + server_name 101.35.240.82; + root /home/ubuntu/dist; + location / { + try_files $uri $uri/ @router; + index index.html; + } + location @router { + rewrite ^.*$ /index.html last; + } + } +``` + +![](C:\Users\15267\AppData\Roaming\marktext\images\2023-09-19-16-48-12-image.png) + +``` +listen 为端口号 +server_name 域名/当前服务器外网IP; +root /home/wwwroot/eladmin/dist; #dist上传的路径 + +```