Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夜猫逐梦
1024程序员开源挑战赛
提交
d78551a0
1
1024程序员开源挑战赛
项目概览
夜猫逐梦
/
1024程序员开源挑战赛
与 Fork 源项目一致
Fork自
GitCode / 1024程序员开源挑战赛(10.23-11.14)
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
1
1024程序员开源挑战赛
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d78551a0
编写于
6月 21, 2021
作者:
B
baiy
提交者:
ninecents
10月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加变量名转换工具 #44
上级
7468a820
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
46 addition
and
40 deletion
+46
-40
README.md
README.md
+1
-0
src/config.js
src/config.js
+12
-5
src/tool.router.js
src/tool.router.js
+4
-0
src/tool.vue
src/tool.vue
+1
-1
src/tool/adapter.js
src/tool/adapter.js
+1
-1
src/views/tool/variableConversion.vue
src/views/tool/variableConversion.vue
+27
-33
未找到文件。
README.md
浏览文件 @
d78551a0
...
...
@@ -89,6 +89,7 @@ npm run serve -adapter=utools
-
[
moment
](
https://momentjs.com/
)
-
[
vue-codemirror
](
https://www.npmjs.com/package/vue-codemirror
)
-
[
sm-crypto
](
https://github.com/JuneAndGreen/sm-crypto
)
-
[
camelcaseplugin
](
https://github.com/netnexus/camelcaseplugin
)
> 当然项目中还使用很多不知道姓名的大神的代码, 在这里就不一一感谢
...
...
src/config.js
浏览文件 @
d78551a0
...
...
@@ -10,14 +10,12 @@ const tool = [
{
'
name
'
:
'
hash
'
,
'
title
'
:
'
哈希(hash)
'
,
'
cat
'
:
[
'
encryption
'
],
'
keyword
'
:
[
'
md5
'
,
'
sha1
'
,
'
sha256
'
,
'
sha512
'
,
'
sm3
'
]
'
cat
'
:
[
'
encryption
'
]
},
{
'
name
'
:
'
encrypt
'
,
'
title
'
:
'
加密/解密
'
,
'
cat
'
:
[
'
encryption
'
],
'
keyword
'
:
[
'
AES
'
,
'
DES
'
,
'
RC4
'
,
'
Rabbit
'
,
'
TripleDes
'
,
'
sm2
'
]
'
cat
'
:
[
'
encryption
'
]
},
{
'
name
'
:
'
base64
'
,
'
title
'
:
'
BASE64编码
'
,
'
cat
'
:
[
'
encryption
'
]},
{
'
name
'
:
'
json
'
,
'
title
'
:
'
JSON工具
'
,
'
cat
'
:
[
'
conversion
'
,
'
serialize
'
]},
...
...
@@ -40,9 +38,18 @@ const tool = [
{
'
name
'
:
'
uuid
'
,
'
title
'
:
'
UUID生成
'
,
'
cat
'
:
[
'
other
'
]},
{
'
name
'
:
'
jsonToObject
'
,
'
title
'
:
'
JSON转实体类
'
,
'
cat
'
:
[
'
conversion
'
,
'
serialize
'
]},
{
'
name
'
:
'
ascii
'
,
'
title
'
:
'
ascii转换
'
,
'
cat
'
:
[
'
conversion
'
]},
{
'
name
'
:
'
variableConversion
'
,
'
title
'
:
'
变量名转换
'
,
'
cat
'
:
[
'
conversion
'
]},
]
const
utools
=
{
keyword
:
{
hash
:
[
'
md5
'
,
'
sha1
'
,
'
sha256
'
,
'
sha512
'
,
'
sm3
'
],
encrypt
:
[
'
AES
'
,
'
DES
'
,
'
RC4
'
,
'
Rabbit
'
,
'
TripleDes
'
,
'
sm2
'
]
}
}
module
.
exports
=
{
category
,
tool
tool
,
utools
}
\ No newline at end of file
src/tool.router.js
浏览文件 @
d78551a0
...
...
@@ -97,6 +97,10 @@ const routes = [
{
path
:
'
/tool/ascii
'
,
component
:
r
=>
require
([
'
./views/tool/ascii.vue
'
],
r
)
},
{
path
:
'
/tool/variableConversion
'
,
component
:
r
=>
require
([
'
./views/tool/variableConversion.vue
'
],
r
)
}
]
...
...
src/tool.vue
浏览文件 @
d78551a0
...
...
@@ -193,7 +193,7 @@ export default {
return
h
(
'
Input
'
,
{
props
:
{
type
:
"
textarea
"
,
rows
:
"
10
"
,
rows
:
10
,
value
:
JSON
.
stringify
(
historyFactory
(
this
.
currentTool
).
get
(
index
),
null
,
"
\t
"
),
}
})
...
...
src/tool/adapter.js
浏览文件 @
d78551a0
...
...
@@ -47,7 +47,7 @@ const utoolsConfigWrite = () => {
"
cmds
"
:
[
'
ctool
'
,
'
程序开发常用工具
'
]
},
...
toolConfig
.
tool
.
map
((
item
)
=>
{
let
keyword
=
item
.
hasOwnProperty
(
"
keyword
"
)
?
item
[
'
keyword
'
]
:
[];
let
keyword
=
toolConfig
[
'
keyword
'
].
hasOwnProperty
(
item
.
name
)
?
toolConfig
[
'
keyword
'
][
item
.
name
]
:
[];
return
{
"
code
"
:
"
ctool-
"
+
item
.
name
,
"
explain
"
:
item
.
title
,
...
...
src/views/tool/variableConversion.vue
浏览文件 @
d78551a0
<
template
>
<
heightResize
ignore
@
resize=
"resize"
>
<
div
>
<Row
:gutter=
"10"
>
<Col
span=
"6"
>
<input-block
top=
"4px"
:text=
"$t('variableConversion_input')"
>
<autoHeightTextarea
:height=
"height1"
v-model=
"current.input"
:placeholder=
"$t('variableConversion_input_placeholder')"
/>
</input-block>
<Col
span=
"6"
style=
"margin-top: 10px"
>
<Card
:padding=
"0"
>
<p
slot=
"title"
>
输入变量名
</p>
<template
slot=
"extra"
>
<Button
size=
"small"
type=
"primary"
@
click=
"handle()"
>
转换
</Button>
</
template
>
<Input
v-model=
"current.input"
:rows=
"4"
type=
"textarea"
placeholder=
"变量名 一行一个"
></Input>
</Card>
</Col>
<Col
span=
"6"
v-for=
"(item,key) in resultColumns"
:key=
"key"
:style=
"`margin-top: $
{key > 2 ? '10px' : '0'}`">
<input-block
top=
"4px"
type=
"default"
:text=
"item.title"
@
on-default-right-bottom-click=
"()=>copy(item.key)"
>
<autoHeightTextarea
:height=
"key > 2 ? height2 : height1"
:value=
"output[item.key]"
:placeholder=
"item.title"
/>
</input-block>
<Col
span=
"6"
v-for=
"(item,key) in resultColumns"
:key=
"key"
style=
"margin-top: 10px"
>
<Card
:padding=
"0"
>
<p
slot=
"title"
>
{{ item.title }}
</p>
<Input
v-model=
"current.output[item.key]"
:rows=
"4"
type=
"textarea"
></Input>
</Card>
</Col>
</Row>
</
heightResize
>
</
div
>
</template>
<
script
>
import
varCamelCase
from
"
./library/varCamelCase
"
import
heightResize
from
"
./components/heightResize
"
;
import
autoHeightTextarea
from
"
./components/autoHeightTextarea
"
;
export
default
{
components
:
{
heightResize
,
autoHeightTextarea
},
computed
:
{
resultColumns
()
{
return
varCamelCase
.
resultKey
.
map
((
item
)
=>
{
...
...
@@ -33,32 +33,26 @@ export default {
}
});
},
output
()
{
let
result
=
varCamelCase
.
convent
(
this
.
current
.
input
)
this
.
$saveToolData
(
this
.
current
);
return
result
;
}
},
created
()
{
this
.
$initToolData
(
'
input
'
)
this
.
current
=
Object
.
assign
(
this
.
current
,
this
.
$getToolData
(
"
input
"
)
)
},
methods
:
{
copy
(
type
)
{
this
.
$clipboardCopy
(
this
.
output
[
type
],
true
);
},
resize
(
height
)
{
this
.
height1
=
Math
.
ceil
(
height
/
2
);
this
.
height2
=
height
-
this
.
height1
-
10
;
handle
(
)
{
if
(
!
this
.
current
.
input
)
{
return
;
}
this
.
current
.
output
=
varCamelCase
.
convent
(
this
.
current
.
input
)
this
.
$saveToolData
(
this
.
current
)
;
}
},
data
()
{
return
{
current
:
{
input
:
""
},
height1
:
100
,
height2
:
100
input
:
""
,
output
:
[],
}
}
},
}
</
script
>
</
script
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录