Skip to content

Commit 9381b33

Browse files
committed
初始化
0 parents  commit 9381b33

File tree

8 files changed

+12095
-0
lines changed

8 files changed

+12095
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#### 第二个小版本,肯定会存在各种问题。后期再优化
2+
3+
> 0.0.2:根据论坛反馈ctrl+c 复制语句之后, 没有呼出插件问题
4+
5+
mybatisLog日志格式化参数:
6+
7+
将控制台日志完整复制到工具点击转换即可
8+
9+
![](https://img-blog.csdnimg.cn/20200622153111340.png)
10+
11+
![](https://img-blog.csdnimg.cn/20200622153246801.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NzczODUx,size_16,color_FFFFFF,t_70)

element.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

element.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<!-- import CSS -->
6+
<link rel="stylesheet" href="./element.css">
7+
<script src="dist/clipboard.min.js"></script>
8+
</head>
9+
<body>
10+
<div id="app">
11+
<el-row :gutter="20">
12+
<el-col :span="20">
13+
<el-input
14+
type="textarea"
15+
autosize
16+
placeholder="请输入内容"
17+
v-model="textarea1">
18+
</el-input>
19+
</el-col>
20+
<el-col :span="4">
21+
<el-button type="primary" round @click="onSubmit">转换</el-button>
22+
</el-col>
23+
</el-col>
24+
</el-row>
25+
<br>
26+
<el-row :gutter="20">
27+
<el-col :span="20">
28+
<el-input
29+
type="textarea"
30+
autosize
31+
v-model="result">
32+
</el-input>
33+
</el-col>
34+
<el-col :span="4">
35+
36+
</el-col>
37+
</el-col>
38+
</el-row>
39+
40+
41+
</div>
42+
</body>
43+
<!-- import Vue before Element -->
44+
<script src="./vue.js"></script>
45+
<!-- import JavaScript -->
46+
<script src="./element.js"></script>
47+
<script>
48+
49+
new Vue({
50+
el: '#app',
51+
data: function () {
52+
return {
53+
textarea1: '',
54+
result: ''
55+
}
56+
},
57+
methods: {
58+
onSubmit () {
59+
if(null == this.textarea1 || '' == this.textarea1){
60+
this.result =''
61+
return
62+
}
63+
if( this.textarea1.indexOf('?') == -1){
64+
this.result ='别闹,没有占位符咋替换呢。默认 "?",暂不支持其他。'
65+
return
66+
}
67+
let preparing = this.textarea1.split("==>")[1].split(':')[1]
68+
let parameters = this.textarea1.split("==>")[2].split(':')[1]
69+
let rep = new RegExp('\\((.| )+?\\)', 'g');
70+
let param = parameters.replace(rep, '');
71+
let array = param.split(',')
72+
let result = '';
73+
for (let i of array) {
74+
if (result !== '') {
75+
result = result.replace('?', i)
76+
} else {
77+
result = preparing.replace('?', i)
78+
}
79+
}
80+
let reg = new RegExp('\" ', "g")
81+
this.result = result.replace(reg, '')
82+
}
83+
84+
}
85+
})
86+
</script>
87+
</html>

logo.png

4.2 KB
Loading

plugin.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"pluginName": "mybatisLog格式化",
3+
"description": "将idea开发工具中的sql日志自动拼接参数",
4+
"main": "index.html",
5+
"homepage": "https://xionghaizhi.github.io",
6+
"author": "xionghaizhi",
7+
"preload": "preload.js",
8+
"logo": "logo.png",
9+
"version": "0.0.2",
10+
"development": {
11+
"main": "index.html",
12+
"preload": "preload.js",
13+
"logo": "logo.png"
14+
15+
},
16+
"features": [{
17+
"code": "mybaitsLog",
18+
"explain": "mybaitsLog",
19+
"cmds": [
20+
"mybaits",
21+
"mybaitsLog",
22+
{
23+
"type": "regex",
24+
"label": "mybatisLog格式化",
25+
"match": "/[a-zA-Z]/",
26+
"minLength": 5
27+
}
28+
]
29+
}]
30+
}

preload.js

Whitespace-only changes.

0 commit comments

Comments
 (0)