Skip to content

Commit 0f82c74

Browse files
committed
Initial commit
1 parent 8c84dfc commit 0f82c74

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+11721
-0
lines changed

.browserslistrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> 1%
2+
last 2 versions

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
insert_final_newline = false
15+
trim_trailing_whitespace = false

.eslintrc.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
'extends': [
7+
'plugin:vue/essential',
8+
'eslint:recommended'
9+
],
10+
rules: {
11+
'no-console': 'off',
12+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13+
'vue/no-unused-components': 0,
14+
'no-unused-vars': 0
15+
},
16+
parserOptions: {
17+
parser: 'babel-eslint'
18+
}
19+
}

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
# local env files
6+
.env.local
7+
.env.*.local
8+
9+
# Log files
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
14+
# Editor directories and files
15+
.idea
16+
.vscode
17+
*.suo
18+
*.ntvs*
19+
*.njsproj
20+
*.sln
21+
*.sw?

babel.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "form-generator",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint"
9+
},
10+
"dependencies": {
11+
"@babel/parser": "^7.7.4",
12+
"clipboard": "^2.0.4",
13+
"core-js": "^3.4.3",
14+
"file-saver": "^2.0.2",
15+
"vuedraggable": "^2.23.2"
16+
},
17+
"devDependencies": {
18+
"@vue/cli-plugin-babel": "^4.1.0",
19+
"@vue/cli-plugin-eslint": "^4.1.0",
20+
"@vue/cli-service": "^4.1.0",
21+
"babel-eslint": "^10.0.3",
22+
"eslint": "^5.16.0",
23+
"eslint-plugin-vue": "^5.0.0",
24+
"sass": "^1.23.7",
25+
"sass-loader": "^8.0.0",
26+
"svg-sprite-loader": "^4.1.6",
27+
"vue-template-compiler": "^2.6.10"
28+
}
29+
}

public/favicon.ico

4.19 KB
Binary file not shown.

public/index.html

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<!DOCTYPE html>
2+
<html lang="zh">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
8+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
9+
<title>form-generator</title>
10+
<style>
11+
.pre-loader {
12+
position: absolute;
13+
top: calc(50% - 32px);
14+
left: calc(50% - 32px);
15+
width: 64px;
16+
height: 64px;
17+
border-radius: 50%;
18+
perspective: 800px;
19+
}
20+
.pre-loader .inner {
21+
position: absolute;
22+
box-sizing: border-box;
23+
width: 100%;
24+
height: 100%;
25+
border-radius: 50%;
26+
}
27+
.pre-loader .inner.one {
28+
left: 0%;
29+
top: 0%;
30+
-webkit-animation: rotate-one 1s linear infinite;
31+
animation: rotate-one 1s linear infinite;
32+
border-bottom: 3px solid #bc9048;
33+
}
34+
.pre-loader .inner.two {
35+
right: 0%;
36+
top: 0%;
37+
-webkit-animation: rotate-two 1s linear infinite;
38+
animation: rotate-two 1s linear infinite;
39+
border-right: 3px solid #74aeff;
40+
}
41+
.pre-loader .inner.three {
42+
right: 0%;
43+
bottom: 0%;
44+
-webkit-animation: rotate-three 1s linear infinite;
45+
animation: rotate-three 1s linear infinite;
46+
border-top: 3px solid #caef74;
47+
}
48+
@keyframes rotate-one {
49+
0% {
50+
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
51+
transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
52+
}
53+
100% {
54+
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
55+
transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
56+
}
57+
}
58+
@keyframes rotate-two {
59+
0% {
60+
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
61+
transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
62+
}
63+
100% {
64+
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
65+
transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
66+
}
67+
}
68+
@keyframes rotate-three {
69+
0% {
70+
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
71+
transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
72+
}
73+
100% {
74+
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
75+
transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
76+
}
77+
}
78+
</style>
79+
<link href="https://cdn.bootcss.com/element-ui/2.12.0/theme-chalk/index.css" rel="stylesheet">
80+
<link href="https://cdn.bootcss.com/monaco-editor/0.18.0/min/vs/editor/editor.main.css" rel="stylesheet">
81+
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script>
82+
<script src="https://cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js"></script>
83+
<script src="https://cdn.bootcss.com/axios/0.19.0/axios.min.js"></script>
84+
<script src="https://cdn.bootcss.com/element-ui/2.12.0/index.js"></script>
85+
</head>
86+
87+
<body>
88+
<noscript>
89+
<strong>抱歉,javascript被禁用,请开启后重试。</strong>
90+
</noscript>
91+
<div id="app"></div>
92+
<div class="pre-loader" id="pre-loader">
93+
<div class="inner one"></div>
94+
<div class="inner two"></div>
95+
<div class="inner three"></div>
96+
</div>
97+
<script> var require = { paths: { 'vs': 'https://cdn.bootcss.com/monaco-editor/0.18.0/min/vs' }};</script>
98+
<script src="https://cdn.bootcss.com/js-beautify/1.10.2/beautifier.min.js"></script>
99+
<script src="https://cdn.bootcss.com/monaco-editor/0.18.0/min/vs/loader.js"></script>
100+
<script src="https://cdn.bootcss.com/monaco-editor/0.18.0/min/vs/editor/editor.main.nls.js"></script>
101+
<script src="https://cdn.bootcss.com/monaco-editor/0.18.0/min/vs/editor/editor.main.js"></script>
102+
</body>
103+
104+
</html>

public/preview.html

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html lang="zh">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title>form-generator-preview</title>
9+
<link href="https://cdn.bootcss.com/element-ui/2.12.0/theme-chalk/index.css" rel="stylesheet">
10+
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script>
11+
<script src="https://cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js"></script>
12+
<script src="https://cdn.bootcss.com/axios/0.19.0/axios.min.js"></script>
13+
<script src="https://cdn.bootcss.com/element-ui/2.12.0/index.js"></script>
14+
<style>
15+
body{
16+
margin: 0;
17+
padding: 0;
18+
overflow-x: hidden;
19+
-moz-osx-font-smoothing: grayscale;
20+
-webkit-font-smoothing: antialiased;
21+
text-rendering: optimizeLegibility;
22+
height: calc(100vh - 33px);
23+
padding: 12px;
24+
box-sizing: border-box;
25+
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
26+
}
27+
input, textarea{
28+
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
29+
}
30+
</style>
31+
</head>
32+
<body>
33+
<noscript>
34+
<strong>抱歉,javascript被禁用,请开启后重试。</strong>
35+
</noscript>
36+
<div id="previewApp"></div>
37+
</body>
38+
</html>

src/assets/logo.png

8.37 KB
Loading

src/components/SvgIcon/index.vue

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<template>
2+
<div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" />
3+
<svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners">
4+
<use :xlink:href="iconName" />
5+
</svg>
6+
</template>
7+
8+
<script>
9+
// doc: https://panjiachen.github.io/vue-element-admin-site/feature/component/svg-icon.html#usage
10+
function isExternal(path) {
11+
return /^(https?:|mailto:|tel:)/.test(path)
12+
}
13+
14+
export default {
15+
name: 'SvgIcon',
16+
props: {
17+
iconClass: {
18+
type: String,
19+
required: true
20+
},
21+
className: {
22+
type: String,
23+
default: ''
24+
}
25+
},
26+
computed: {
27+
isExternal() {
28+
return isExternal(this.iconClass)
29+
},
30+
iconName() {
31+
return `#icon-${this.iconClass}`
32+
},
33+
svgClass() {
34+
if (this.className) {
35+
return 'svg-icon ' + this.className
36+
} else {
37+
return 'svg-icon'
38+
}
39+
},
40+
styleExternalIcon() {
41+
return {
42+
mask: `url(${this.iconClass}) no-repeat 50% 50%`,
43+
'-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%`
44+
}
45+
}
46+
}
47+
}
48+
</script>
49+
50+
<style scoped>
51+
.svg-icon {
52+
width: 1em;
53+
height: 1em;
54+
vertical-align: -0.15em;
55+
fill: currentColor;
56+
overflow: hidden;
57+
}
58+
59+
.svg-external-icon {
60+
background-color: currentColor;
61+
mask-size: cover!important;
62+
display: inline-block;
63+
}
64+
</style>

0 commit comments

Comments
 (0)