markLine或markArea在使用滚动条放大之后消失的问题
问题:水平的 markLine 或者 markArea 当使用 dataZoom 放大的时候。只要 markLine/markArea 不完全在当前缩放的范围内(有部分在)那么它们就会整体消失
解决方式:官方没有给出真正的解决方式。临时解决方式如下
监听滚动条的滚动,获得使用滚动条缩放 echarts 缩放后的范围(x 轴的最小值和最大值)。根据后台请求的 markLineData/markAreaData 重新计算边界。如果某个 markLine/markArea 的左侧边界小于缩放后的 x 轴左侧边界,那么就将它的左侧边界放大到 x 轴的左侧边界。右侧同理。替换掉原先的标记 series。
注意:重新 setOption()时,可以合并原先的 option(noMerge:false)。因为只是重绘 markLine/markArea,没必要销毁原先的所有组件,并重新创建新的组件。同时如果有内置滚动条的情况下,必须指定(silent:true)(不抛出事件),否则使用内置滚动条放大 echarts 后,每次左右平移只能移动一点点,因为只要移动就会进入到滚动条监听事件里,而监听事件 ...
vue组件公共模板
<template> <div></div></template><script>export default { name: 'index'}</script><style scoped></style>
上传组件设置token
<el-upload class="uploadBtn" accept="xlsx" action="http://127.0.0.1:82/lineDic/sstjq/importData" :on-success="importData" :show-file-list="false" :limit="1" :headers="headers" :file-list="fileList"> <el-button size="small" type="primary">导入</el-button></el-upload>data(){ return{ headers: { Authorization: null }, } } methods: { s ...
二进制文件流转文件并触发下载
/** * word/doc * data就是后台返回的二进制流 * fileName就是你想要把这个流转为二进制的名称 */export function downloadDoc(data, fileName) { let blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' }) let link = document.createElement('a') link.href = window.URL.createObjectURL(blob) link.style.display = 'none' link.setAttribute('download', fileName + '.doc') link.click()}
/** * excel/xlsx * data ...
vue自定义上传功能
export function importData(params) { return axios.post('/engineeringCar/importData', params, { headers: { 'Content-Type': 'multipart/form-data' } })}
<template> <div> <el-button @click="importData">导入</el-button> <input v-show="false" name="file" ref="selectFile" type="file" @change="changeFile" /> </div& ...
vue自定义下载功能
返回整体文件流,通过浏览器转成二进制触发下载该方式和传统的方式不同。
传统是读取服务器返回的流,这里是服务器流都已经整体返回了,然后才通过 js 转成文件触发下载
该方式只适合下载小文件(一般是小于 10M),如果文件过大,会导致浏览器占用内存过大,页面崩溃
以下载 excel 为例子
前台代码
/** * 下载数据导入模板 */export function downloadImportTemplate(url, fileName) { return request({ type: 'get', url, responseType: 'blob' }).then((res) => { const url = window.URL.createObjectURL(new Blob([res])) const link = document.createElement('a') link.style.display = 'none ...
局部导入css
<template> <div></div></template><script>export default { name: 'index'}</script><style scoped>@import '~@/assets/css/single_block.css';</style>
创建shell脚本并且运行
创建 shell 脚本并且运行
vim hello.sh
提权
chmod u+x hello.sh
执行
bash hello.sh
后台运行命令
如果使用 nohup 命令提交作业,那么在缺省情况下该作业的所有输出都被重定向到一个名为 nohup.out 的文件中,除非另外指定 了输出文件:
输出被重定向到 myout.file 文件中。
nohup command > myout.file 2>&1 &
不输出日志文件。
nohup command >/dev/null 2>&1 &
查看cpu核心数
查看物理 cpu 数目
cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
查看每个物理 cpu 里的核数
cat /proc/cpuinfo| grep "cpu cores"| uniq
查看 cpu 逻辑核心数(cpu 数量*每个 cpu 的核数)
cat /proc/cpuinfo| grep "processor"| wc -l
原文链接
查看后台运行的java -jar项目的端口号,并杀死该进程
lsof -i:8088Kill -9 pid
查看命令所在源文件的位置
直接使用下面这条命令跟随符号链接来以获取实际的可执行文件
readlink -f `which java`
readlink 命令会跟随一个符号链接。我在 which java 的外侧使用 readlink 将会使用 which java 的输出来替换要检查的符号链接,这被称之为命令替换。因此,在这个实例中,上面的命令大体上相当于 readlink -f /usr/bin/java 。
在我的示例中,可执行文件的位置是 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 。
查看网址
示例
curl 127.0.0.1:80 #查看本地的nginx是否启动
查看日志最后几行
tail -n 50 wx.log
示例:查看/var/log/boot.log,只显示最后一行。则执行
tail -n 1 /var/log/boot.log
tail -n 1000 #显示最后1000行tail -n +1000 #从1000行开始显示,显示1000行以后的head -n 1000 #显示前面1000行
实时监听文件末尾多行的变化,打印到控制台。ctrl+c 退出
tail -f file #默认显示10行tail -500f file #调整为500行
原文链接
端口管理
开放端口firewall-cmd --zone=public --add-port=5672/tcp --permanent # 开放5672端口firewall-cmd --zone=public --remove-port=5672/tcp --permanent #关闭5672端口firewall-cmd --reload # 配置立即生效
查看防火墙所有开放的端口firewall-cmd --zone=public --list-ports
开放端口,复杂规则# 只允许10.13.49.108的ip通过tcp协议访问18080端口firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="10.13.49.108" port protocol="tcp" port="18080" accept"# 只允许172.16.1.0网段的ip通过tcp协议访 ...
用windowd的cmd向linux服务器上传文件
示例代码
scp -P 221 D:\hussar-web-2.2.0.war root@123.123.122.138:/opt/tomcat8/webapps/
城轨项目的使用的上传 war 包用:
scp -P 221 D:\Work\workProject\dtjc\target\hussar-web-2.2.0.war root@123.123.122.138:/opt/tomcat8/webapps/
说明:其中 221 是端口,123.123.122.138 是 ip,root 是登陆用户,D:\hussar-web-2.2.0.war 是文件路径,/opt/tomcat8/webapps/是服务器存储上传文件的路径
网上拷贝
1、上传本地文件到服务器
scp -P 221 /path/filename username@servername:/path/
例如 scp /var/www/test.php root@192.168.0.101:/var/www/ 把本机/var/www/目录下的 test.php 文件上传到 192.168.0.101 这台服务器上的/ ...
根据端口号查询占用pid
netstat -nap|grep 8080tcp6 0 0 :::8081 :::* LISTEN 16996/javakill -9 16996
或者
lsof -i:8080
磁盘管理
查看某个文件夹所属的磁盘容量df -h 文件路径
查看磁盘列表
df -hl
进程管理
查看进程的详细信息ps 6832
中止进程kill -9 6832
解决centos8下python命令失效的问题
执行
ln -s /usr/bin/python3.6 /usr/bin/python
参考地址