tianheng-ui 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/iconfont.eot +0 -0
- package/lib/iconfont.svg +155 -0
- package/lib/iconfont.ttf +0 -0
- package/lib/iconfont.woff +0 -0
- package/lib/index.js +5 -2
- package/lib/tianheng-ui.js +34 -1
- package/lib/tianheng-ui.js.map +1 -1
- package/package.json +8 -2
- package/packages/formMaking/Container.vue +592 -0
- package/packages/formMaking/CusDialog.vue +134 -0
- package/packages/formMaking/FormConfig.vue +31 -0
- package/packages/formMaking/GenerateForm.vue +184 -0
- package/packages/formMaking/GenerateFormItem.vue +266 -0
- package/packages/formMaking/Upload/index.vue +451 -0
- package/packages/formMaking/WidgetConfig.vue +498 -0
- package/packages/formMaking/WidgetForm.vue +217 -0
- package/packages/formMaking/WidgetFormItem.vue +284 -0
- package/packages/formMaking/componentsConfig.js +313 -0
- package/packages/formMaking/generateCode.js +155 -0
- package/packages/formMaking/iconfont/demo.css +539 -0
- package/packages/formMaking/iconfont/demo_index.html +1159 -0
- package/packages/formMaking/iconfont/iconfont.css +189 -0
- package/packages/formMaking/iconfont/iconfont.eot +0 -0
- package/packages/formMaking/iconfont/iconfont.js +1 -0
- package/packages/formMaking/iconfont/iconfont.svg +155 -0
- package/packages/formMaking/iconfont/iconfont.ttf +0 -0
- package/packages/formMaking/iconfont/iconfont.woff +0 -0
- package/packages/formMaking/iconfont/iconfont.woff2 +0 -0
- package/packages/formMaking/index.js +79 -0
- package/packages/formMaking/lang/en-US.js +187 -0
- package/packages/formMaking/lang/zh-CN.js +187 -0
- package/packages/formMaking/styles/cover.scss +41 -0
- package/packages/formMaking/styles/index.scss +746 -0
- package/packages/formMaking/util/index.js +33 -0
- package/packages/formMaking/util/request.js +28 -0
Binary file
|
Binary file
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import VueI18n from 'vue-i18n'
|
2
|
+
import 'normalize.css/normalize.css'
|
3
|
+
|
4
|
+
import MakingForm from './Container.vue'
|
5
|
+
import GenerateForm from './GenerateForm.vue'
|
6
|
+
|
7
|
+
import enUS from './lang/en-US'
|
8
|
+
import zhCN from './lang/zh-CN'
|
9
|
+
|
10
|
+
import './iconfont/iconfont.css'
|
11
|
+
import './styles/cover.scss'
|
12
|
+
import './styles/index.scss'
|
13
|
+
|
14
|
+
const loadLang = function (Vue, lang, locale, i18n) {
|
15
|
+
if (locale) {
|
16
|
+
locale('en-US', {...locale('en-US'), ...enUS})
|
17
|
+
locale('zh-CN', {...locale('zh-CN'), ...zhCN})
|
18
|
+
Vue.config.lang = lang
|
19
|
+
} else if (i18n) {
|
20
|
+
i18n.setLocaleMessage('en-US', {...i18n.messages['en-US'], ...enUS})
|
21
|
+
i18n.setLocaleMessage('zh-CN', {...i18n.messages['zh-CN'], ...zhCN})
|
22
|
+
i18n.locale = lang
|
23
|
+
} else {
|
24
|
+
Vue.use(VueI18n)
|
25
|
+
Vue.locale('en-US', {...Vue.locale('en-US'), ...enUS})
|
26
|
+
Vue.locale('zh-CN', {...Vue.locale('zh-CN'), ...zhCN})
|
27
|
+
Vue.config.lang = lang
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
MakingForm.install = function (Vue, opts = {
|
32
|
+
lang: 'zh-CN',
|
33
|
+
locale: null,
|
34
|
+
i18n: null
|
35
|
+
}) {
|
36
|
+
loadLang(Vue, opts.lang, opts.locale, opts.i18n)
|
37
|
+
Vue.component(MakingForm.name, MakingForm)
|
38
|
+
}
|
39
|
+
|
40
|
+
GenerateForm.install = function (Vue, opts = {
|
41
|
+
lang: 'zh-CN',
|
42
|
+
locale: null,
|
43
|
+
i18n: null
|
44
|
+
}) {
|
45
|
+
loadLang(Vue, opts.lang, opts.locale, opts.i18n)
|
46
|
+
Vue.component(GenerateForm.name, GenerateForm)
|
47
|
+
}
|
48
|
+
|
49
|
+
const components = [
|
50
|
+
MakingForm,
|
51
|
+
GenerateForm
|
52
|
+
]
|
53
|
+
|
54
|
+
const install = function (Vue, opts = {
|
55
|
+
lang: 'zh-CN',
|
56
|
+
locale: null,
|
57
|
+
i18n: null
|
58
|
+
}) {
|
59
|
+
loadLang(Vue, opts.lang, opts.locale, opts.i18n)
|
60
|
+
components.forEach(component => {
|
61
|
+
Vue.component(component.name, component)
|
62
|
+
})
|
63
|
+
}
|
64
|
+
|
65
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
66
|
+
install(window.Vue);
|
67
|
+
}
|
68
|
+
|
69
|
+
export {
|
70
|
+
install,
|
71
|
+
MakingForm,
|
72
|
+
GenerateForm
|
73
|
+
}
|
74
|
+
|
75
|
+
export default {
|
76
|
+
install,
|
77
|
+
MakingForm,
|
78
|
+
GenerateForm
|
79
|
+
}
|
@@ -0,0 +1,187 @@
|
|
1
|
+
export default {
|
2
|
+
fm: {
|
3
|
+
components: {
|
4
|
+
fields: {
|
5
|
+
input: 'Input',
|
6
|
+
textarea: 'Textarea',
|
7
|
+
number: 'Number',
|
8
|
+
radio: 'Radio',
|
9
|
+
checkbox: 'Checkbox',
|
10
|
+
time: 'Time',
|
11
|
+
date: 'Date',
|
12
|
+
rate: 'Rate',
|
13
|
+
color: 'Color',
|
14
|
+
select: 'Select',
|
15
|
+
switch: 'Switch',
|
16
|
+
slider: 'Slider',
|
17
|
+
text: 'Text',
|
18
|
+
blank: 'Custom',
|
19
|
+
fileupload: 'File',
|
20
|
+
imgupload: 'Image',
|
21
|
+
editor: 'Editor',
|
22
|
+
cascader: 'Cascader',
|
23
|
+
table: 'Sub-table',
|
24
|
+
grid: 'Grid',
|
25
|
+
tabs: 'Tabs',
|
26
|
+
divider: 'Divider'
|
27
|
+
},
|
28
|
+
basic: {
|
29
|
+
title: 'Basic Component',
|
30
|
+
},
|
31
|
+
advance: {
|
32
|
+
title: 'Advance Component',
|
33
|
+
},
|
34
|
+
layout: {
|
35
|
+
title: 'Layout',
|
36
|
+
}
|
37
|
+
},
|
38
|
+
description: {
|
39
|
+
containerEmpty: 'You can drag and drop the item from the left to add components',
|
40
|
+
configEmpty: 'Please add a component',
|
41
|
+
tableEmpty: 'You can drag and drop the item from the left to add components',
|
42
|
+
uploadJsonInfo: 'There is the format of JSON below,you can overwrite it with you own JSON code'
|
43
|
+
},
|
44
|
+
message: {
|
45
|
+
copySuccess: 'Copy Successed',
|
46
|
+
validError: 'Form data validation failed'
|
47
|
+
},
|
48
|
+
actions: {
|
49
|
+
import: 'Import JSON',
|
50
|
+
clear: 'Clear',
|
51
|
+
preview: 'Preview',
|
52
|
+
json: 'Generate JSON',
|
53
|
+
code: 'Generate Code',
|
54
|
+
getData: 'Get Data',
|
55
|
+
reset: 'Reset',
|
56
|
+
copyData: 'Copy Data',
|
57
|
+
cancel: 'Cancel',
|
58
|
+
confirm: 'Confirm',
|
59
|
+
addOption: 'Add Option',
|
60
|
+
addColumn: 'Add Column',
|
61
|
+
addTab: 'Add Tab',
|
62
|
+
upload: 'Upload',
|
63
|
+
add: 'Add'
|
64
|
+
},
|
65
|
+
config: {
|
66
|
+
form: {
|
67
|
+
title: 'Form Attribute',
|
68
|
+
labelPosition: {
|
69
|
+
title: 'Label Position',
|
70
|
+
left: 'Left',
|
71
|
+
right: 'Right',
|
72
|
+
top: 'Top'
|
73
|
+
},
|
74
|
+
labelWidth: 'Label Width',
|
75
|
+
size: 'Size',
|
76
|
+
customClass: 'Custom Class'
|
77
|
+
},
|
78
|
+
widget: {
|
79
|
+
title: 'Component Attribute',
|
80
|
+
model: 'ID',
|
81
|
+
name: 'Name',
|
82
|
+
width: 'Width',
|
83
|
+
height: 'Height',
|
84
|
+
size: 'Size',
|
85
|
+
labelWidth: 'Label Width',
|
86
|
+
custom: 'Custom',
|
87
|
+
placeholder: 'Placeholder',
|
88
|
+
layout: 'Layout',
|
89
|
+
block: 'Block',
|
90
|
+
inline: 'Inline',
|
91
|
+
contentPosition: 'Content Position',
|
92
|
+
left: 'Left',
|
93
|
+
right: 'Right',
|
94
|
+
center: 'Center',
|
95
|
+
showInput: 'Display Input Box',
|
96
|
+
min: 'Minimum',
|
97
|
+
max: 'Maximum',
|
98
|
+
step: 'Step',
|
99
|
+
multiple: 'Multiple',
|
100
|
+
filterable: 'Searchable',
|
101
|
+
allowHalf: 'Allow Half',
|
102
|
+
showAlpha: 'Support transparency options',
|
103
|
+
showLabel: 'Show lable',
|
104
|
+
option: 'Option',
|
105
|
+
staticData: 'Static Data',
|
106
|
+
remoteData: 'Remote Date',
|
107
|
+
remoteFunc: 'Remote Function',
|
108
|
+
value: 'Value',
|
109
|
+
label: 'Label',
|
110
|
+
childrenOption: 'Sub-Option',
|
111
|
+
defaultValue: 'Default Value',
|
112
|
+
showType: 'Display type',
|
113
|
+
isRange: 'Range Time',
|
114
|
+
isTimestamp: 'Get time stamp',
|
115
|
+
startPlaceholder: 'Placeholder of start time',
|
116
|
+
endPlaceholder: 'Placeholder of end time',
|
117
|
+
format: 'Format',
|
118
|
+
limit: 'Maximum Upload Count',
|
119
|
+
isQiniu: 'Upload with Qiniu Cloud',
|
120
|
+
tokenFunc: 'A funchtin to get Qiniu Uptoken',
|
121
|
+
imageAction: 'Picture upload address',
|
122
|
+
tip: 'Text Prompt',
|
123
|
+
action: 'Upload Address',
|
124
|
+
defaultType: 'Data Type',
|
125
|
+
string: 'String',
|
126
|
+
object: 'Object',
|
127
|
+
array: 'Array',
|
128
|
+
number: 'Number',
|
129
|
+
boolean: 'Boolean',
|
130
|
+
integer: 'Integer',
|
131
|
+
float: 'Float',
|
132
|
+
url: 'URL',
|
133
|
+
email: 'E-mail',
|
134
|
+
hex: 'Hexadecimal',
|
135
|
+
gutter: 'Grid Spacing',
|
136
|
+
columnOption: 'Column Configuration',
|
137
|
+
span: 'Grid spans',
|
138
|
+
justify: 'Horizontal Arrangement',
|
139
|
+
justifyStart: 'Start',
|
140
|
+
justifyEnd: 'End',
|
141
|
+
justifyCenter: 'Center',
|
142
|
+
justifySpaceAround: 'Space Around',
|
143
|
+
justifySpaceBetween: 'Space Between',
|
144
|
+
align: 'Vertical Arrangement',
|
145
|
+
alignTop: 'Top',
|
146
|
+
alignMiddle: 'Middle',
|
147
|
+
alignBottom: 'Bottom',
|
148
|
+
type: 'Type',
|
149
|
+
default: 'Default',
|
150
|
+
card: 'Tabs',
|
151
|
+
borderCard: 'Border-Card',
|
152
|
+
tabPosition: 'Tab Position',
|
153
|
+
top: 'Top',
|
154
|
+
bottom: 'Bottom',
|
155
|
+
tabOption: 'Label Configuration',
|
156
|
+
tabName: 'Tab Name',
|
157
|
+
customClass: 'Custom Class',
|
158
|
+
attribute: 'Attribute Action',
|
159
|
+
dataBind: 'Data Binding',
|
160
|
+
hidden: 'Hidden',
|
161
|
+
readonly: 'Read Only',
|
162
|
+
disabled: 'Disabled',
|
163
|
+
editable: 'Text box is editable',
|
164
|
+
clearable: 'Display Clear Button',
|
165
|
+
arrowControl: 'Use the arrow for time selection',
|
166
|
+
isDelete: 'Deletable',
|
167
|
+
isEdit: 'Editable',
|
168
|
+
showPassword: 'Display Password',
|
169
|
+
validate: 'Validation',
|
170
|
+
required: 'Required',
|
171
|
+
patternPlaceholder: 'Fill in the regular expressions',
|
172
|
+
newOption: 'New Option',
|
173
|
+
tab: 'Tab',
|
174
|
+
validatorRequired: 'Required',
|
175
|
+
validatorType: 'Invaild format',
|
176
|
+
validatorPattern: 'Unmatched pattern',
|
177
|
+
showWordLimit: 'Show word limit',
|
178
|
+
maxlength: 'Max length',
|
179
|
+
}
|
180
|
+
},
|
181
|
+
upload: {
|
182
|
+
preview: 'preview',
|
183
|
+
edit: 'replace',
|
184
|
+
delete: 'delete'
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|
@@ -0,0 +1,187 @@
|
|
1
|
+
export default {
|
2
|
+
fm: {
|
3
|
+
components: {
|
4
|
+
fields: {
|
5
|
+
input: '单行文本',
|
6
|
+
textarea: '多行文本',
|
7
|
+
number: '计数器',
|
8
|
+
radio: '单选框组',
|
9
|
+
checkbox: '多选框组',
|
10
|
+
time: '时间选择器',
|
11
|
+
date: '日期选择器',
|
12
|
+
rate: '评分',
|
13
|
+
color: '颜色选择器',
|
14
|
+
select: '下拉选择框',
|
15
|
+
switch: '开关',
|
16
|
+
slider: '滑块',
|
17
|
+
text: '文字',
|
18
|
+
blank: '自定义区域',
|
19
|
+
fileupload: '文件',
|
20
|
+
imgupload: '图片',
|
21
|
+
editor: '编辑器',
|
22
|
+
cascader: '级联选择器',
|
23
|
+
table: '子表单',
|
24
|
+
grid: '栅格布局',
|
25
|
+
tabs: '标签页',
|
26
|
+
divider: '分割线'
|
27
|
+
},
|
28
|
+
basic: {
|
29
|
+
title: '基础字段',
|
30
|
+
},
|
31
|
+
advance: {
|
32
|
+
title: '高级字段',
|
33
|
+
},
|
34
|
+
layout: {
|
35
|
+
title: '布局字段',
|
36
|
+
}
|
37
|
+
},
|
38
|
+
description: {
|
39
|
+
containerEmpty: '从左侧拖拽来添加字段',
|
40
|
+
configEmpty: '请添加字段',
|
41
|
+
tableEmpty: '从左侧拖拽来添加字段',
|
42
|
+
uploadJsonInfo: 'JSON格式如下,直接复制生成的json覆盖此处代码点击确定即可'
|
43
|
+
},
|
44
|
+
message: {
|
45
|
+
copySuccess: '复制成功',
|
46
|
+
validError: '表单数据校验失败'
|
47
|
+
},
|
48
|
+
actions: {
|
49
|
+
import: '导入JSON',
|
50
|
+
clear: '清空',
|
51
|
+
preview: '预览',
|
52
|
+
json: '生成JSON',
|
53
|
+
code: '生成代码',
|
54
|
+
getData: '获取数据',
|
55
|
+
reset: '重置',
|
56
|
+
copyData: '复制数据',
|
57
|
+
cancel: '取 消',
|
58
|
+
confirm: '确 定',
|
59
|
+
addOption: '添加选项',
|
60
|
+
addColumn: '添加列',
|
61
|
+
addTab: '添加标签',
|
62
|
+
upload: '点击上传',
|
63
|
+
add: '添加'
|
64
|
+
},
|
65
|
+
config: {
|
66
|
+
form: {
|
67
|
+
title: '表单属性',
|
68
|
+
labelPosition: {
|
69
|
+
title: '标签对齐方式',
|
70
|
+
left: '左对齐',
|
71
|
+
right: '右对齐',
|
72
|
+
top: '顶部对齐'
|
73
|
+
},
|
74
|
+
labelWidth: '表单标签宽度',
|
75
|
+
size: '组件尺寸',
|
76
|
+
customClass: '自定义Class'
|
77
|
+
},
|
78
|
+
widget: {
|
79
|
+
title: '字段属性',
|
80
|
+
model: '字段标识',
|
81
|
+
name: '标题',
|
82
|
+
width: '宽度',
|
83
|
+
height: '高度',
|
84
|
+
size: '大小',
|
85
|
+
labelWidth: '标签宽度',
|
86
|
+
custom: '自定义',
|
87
|
+
placeholder: '占位内容',
|
88
|
+
layout: '布局方式',
|
89
|
+
block: '块级',
|
90
|
+
inline: '行内',
|
91
|
+
contentPosition: '文案位置',
|
92
|
+
left: '左侧',
|
93
|
+
right: '右侧',
|
94
|
+
center: '居中',
|
95
|
+
showInput: '显示输入框',
|
96
|
+
min: '最小值',
|
97
|
+
max: '最大值',
|
98
|
+
step: '步长',
|
99
|
+
multiple: '是否多选',
|
100
|
+
filterable: '是否可搜索',
|
101
|
+
allowHalf: '允许半选',
|
102
|
+
showAlpha: '支持透明度选择',
|
103
|
+
showLabel: '是否显示标签',
|
104
|
+
option: '选项',
|
105
|
+
staticData: '静态数据',
|
106
|
+
remoteData: '远端数据',
|
107
|
+
remoteFunc: '远端方法',
|
108
|
+
value: '值',
|
109
|
+
label: '标签',
|
110
|
+
childrenOption: '子选项',
|
111
|
+
defaultValue: '默认值',
|
112
|
+
showType: '显示类型',
|
113
|
+
isRange: '是否为范围选择',
|
114
|
+
isTimestamp: '是否获取时间戳',
|
115
|
+
startPlaceholder: '开始时间占位内容',
|
116
|
+
endPlaceholder: '结束时间占位内容',
|
117
|
+
format: '格式',
|
118
|
+
limit: '最大上传数',
|
119
|
+
isQiniu: '使用七牛上传',
|
120
|
+
tokenFunc: '获取七牛Token方法',
|
121
|
+
imageAction: '图片上传地址',
|
122
|
+
tip: '提示说明文字',
|
123
|
+
action: '上传地址',
|
124
|
+
defaultType: '绑定数据类型',
|
125
|
+
string: '字符串',
|
126
|
+
object: '对象',
|
127
|
+
array: '数组',
|
128
|
+
number: '数字',
|
129
|
+
boolean: '布尔值',
|
130
|
+
integer: '整数',
|
131
|
+
float: '浮点数',
|
132
|
+
url: 'URL地址',
|
133
|
+
email: '邮箱地址',
|
134
|
+
hex: '十六进制',
|
135
|
+
gutter: '栅格间隔',
|
136
|
+
columnOption: '列配置项',
|
137
|
+
span: '栅格值',
|
138
|
+
justify: '水平排列方式',
|
139
|
+
justifyStart: '左对齐',
|
140
|
+
justifyEnd: '右对齐',
|
141
|
+
justifyCenter: '居中',
|
142
|
+
justifySpaceAround: '两侧间隔相等',
|
143
|
+
justifySpaceBetween: '两端对齐',
|
144
|
+
align: '垂直排列方式',
|
145
|
+
alignTop: '顶部对齐',
|
146
|
+
alignMiddle: '居中',
|
147
|
+
alignBottom: '底部对齐',
|
148
|
+
type: '风格类型',
|
149
|
+
default: '默认',
|
150
|
+
card: '选项卡',
|
151
|
+
borderCard: '卡片化',
|
152
|
+
tabPosition: '选项卡位置',
|
153
|
+
top: '顶部',
|
154
|
+
bottom: '底部',
|
155
|
+
tabOption: '标签配置项',
|
156
|
+
tabName: '标签名称',
|
157
|
+
customClass: '自定义Class',
|
158
|
+
attribute: '操作属性',
|
159
|
+
dataBind: '数据绑定',
|
160
|
+
hidden: '隐藏',
|
161
|
+
readonly: '完全只读',
|
162
|
+
disabled: '禁用',
|
163
|
+
editable: '文本框可输入',
|
164
|
+
clearable: '显示清除按钮',
|
165
|
+
arrowControl: '使用箭头进行时间选择',
|
166
|
+
isDelete: '删除',
|
167
|
+
isEdit: '编辑',
|
168
|
+
showPassword: '显示密码',
|
169
|
+
validate: '校验',
|
170
|
+
required: '必填',
|
171
|
+
patternPlaceholder: '填写正则表达式',
|
172
|
+
newOption: '新选项',
|
173
|
+
tab: '标签页',
|
174
|
+
validatorRequired: '必须填写',
|
175
|
+
validatorType: '格式不正确',
|
176
|
+
validatorPattern: '格式不匹配',
|
177
|
+
showWordLimit: '显示字数统计',
|
178
|
+
maxlength: '最大字数',
|
179
|
+
}
|
180
|
+
},
|
181
|
+
upload: {
|
182
|
+
preview: '预览',
|
183
|
+
edit: '替换',
|
184
|
+
delete: '删除'
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
.fm-style{
|
2
|
+
.el-radio+.el-radio{
|
3
|
+
margin-left: 0 !important;
|
4
|
+
}
|
5
|
+
.el-radio{
|
6
|
+
margin-right: 30px;
|
7
|
+
}
|
8
|
+
.el-checkbox+.el-checkbox{
|
9
|
+
margin-left: 0 !important;
|
10
|
+
}
|
11
|
+
.el-checkbox{
|
12
|
+
margin-right: 30px;
|
13
|
+
}
|
14
|
+
.el-form-item--small{
|
15
|
+
.el-radio{
|
16
|
+
line-height: 32px !important;
|
17
|
+
}
|
18
|
+
|
19
|
+
.el-rate{
|
20
|
+
margin-top: 6px;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
.el-form-item--mini{
|
24
|
+
.el-radio{
|
25
|
+
line-height: 28px !important;
|
26
|
+
}
|
27
|
+
|
28
|
+
.el-rate{
|
29
|
+
margin-top: 4px;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
.el-form-item--medium{
|
33
|
+
.el-radio{
|
34
|
+
line-height: 36px !important;
|
35
|
+
}
|
36
|
+
|
37
|
+
.el-rate{
|
38
|
+
margin-top: 8px;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|