tianheng-ui 0.1.0 → 0.1.2
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/README.md +9 -18
- package/lib/039af9192b9bb277966ceb4e4ce29c41.js +16 -0
- package/lib/2d84c80112a372bc149cad3464e90fa3.js +1617 -0
- package/lib/5977b934a4c6b480790864ea01303173.js +10834 -0
- package/lib/7745f3e776488705a38e62f85adad54d.js +16 -0
- package/lib/de8dee841ffdaaede3a2254deef30376.js +15395 -0
- package/lib/e78eab250e7f8ccac3d918dfdb06ca10.js +8904 -0
- package/lib/theme-chalk/fonts/PingFang.ttf +0 -0
- package/lib/theme-chalk/fonts/bpmn.eot +0 -0
- package/lib/theme-chalk/fonts/bpmn.svg +224 -0
- package/lib/theme-chalk/fonts/bpmn.ttf +0 -0
- package/lib/theme-chalk/fonts/bpmn.woff +0 -0
- package/lib/theme-chalk/fonts/bpmn.woff2 +0 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.eot +0 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.svg +2671 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.ttf +0 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.woff +0 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.woff2 +0 -0
- package/lib/theme-chalk/fonts/iconfont.eot +0 -0
- package/lib/theme-chalk/fonts/iconfont.svg +155 -0
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff2 +0 -0
- package/lib/theme-chalk/images/notData.png +0 -0
- package/lib/theme-chalk/index.scss +31 -0
- package/lib/theme-chalk/js/Log.js +99 -0
- package/lib/theme-chalk/js/axios.js +86 -0
- package/lib/theme-chalk/js/store/getters.js +5 -0
- package/lib/theme-chalk/js/store/modules/makingForm.js +21 -0
- package/lib/theme-chalk/js/store/store.js +26 -0
- package/lib/theme-chalk/styles/button.scss +501 -0
- package/lib/theme-chalk/styles/card.scss +29 -0
- package/lib/theme-chalk/styles/cell.scss +54 -0
- package/lib/theme-chalk/styles/codeEditor.scss +9 -0
- package/lib/theme-chalk/styles/col.scss +151 -0
- package/lib/theme-chalk/styles/dialog.scss +56 -0
- package/lib/theme-chalk/styles/empty.scss +22 -0
- package/lib/theme-chalk/styles/feature.scss +46 -0
- package/lib/theme-chalk/styles/font.css +7 -0
- package/lib/theme-chalk/styles/grid.scss +41 -0
- package/lib/theme-chalk/styles/icon.css +1944 -0
- package/lib/theme-chalk/styles/imagePreview.scss +113 -0
- package/lib/theme-chalk/styles/img.scss +35 -0
- package/lib/theme-chalk/styles/reset.scss +17 -0
- package/lib/theme-chalk/styles/root.css +64 -0
- package/lib/theme-chalk/styles/row.scss +23 -0
- package/lib/theme-chalk/styles/upload.scss +744 -0
- package/lib/theme-chalk/styles/variable.scss +80 -0
- package/lib/tianheng-ui.js +116 -0
- package/package.json +86 -48
- package/packages/Button/index.js +8 -0
- package/packages/Button/index.vue +80 -0
- package/packages/Card/index.js +8 -0
- package/packages/Card/index.vue +37 -0
- package/packages/Cell/index.js +8 -0
- package/packages/Cell/index.vue +68 -0
- package/packages/CodeEditor/index.js +8 -0
- package/packages/CodeEditor/index.vue +177 -0
- package/packages/Col/index.js +8 -0
- package/packages/Col/index.vue +43 -0
- package/packages/Dialog/index.js +8 -0
- package/packages/Dialog/index.vue +129 -0
- package/packages/Empty/index.js +8 -0
- package/packages/Empty/index.vue +35 -0
- package/packages/FormMaking/FormConfig.vue +60 -0
- package/packages/FormMaking/GenerateForm.vue +308 -0
- package/packages/FormMaking/GenerateFormItem.vue +887 -0
- package/packages/FormMaking/GenerateFormItemH5.vue +825 -0
- package/packages/FormMaking/Upload/index.vue +572 -0
- package/packages/FormMaking/WidgetConfig.vue +472 -0
- package/packages/FormMaking/WidgetForm.vue +159 -0
- package/packages/FormMaking/WidgetFormItem.vue +187 -0
- package/packages/FormMaking/custom/config.js +762 -0
- package/packages/FormMaking/custom/configs/alliance.vue +0 -0
- package/packages/FormMaking/custom/configs/blank.vue +54 -0
- package/packages/FormMaking/custom/configs/button.vue +172 -0
- package/packages/FormMaking/custom/configs/cascader.vue +175 -0
- package/packages/FormMaking/custom/configs/cell.vue +81 -0
- package/packages/FormMaking/custom/configs/checkbox.vue +234 -0
- package/packages/FormMaking/custom/configs/color.vue +137 -0
- package/packages/FormMaking/custom/configs/date.vue +158 -0
- package/packages/FormMaking/custom/configs/divider.vue +61 -0
- package/packages/FormMaking/custom/configs/editor.vue +71 -0
- package/packages/FormMaking/custom/configs/filler.vue +57 -0
- package/packages/FormMaking/custom/configs/grid.vue +103 -0
- package/packages/FormMaking/custom/configs/image.vue +138 -0
- package/packages/FormMaking/custom/configs/input.vue +176 -0
- package/packages/FormMaking/custom/configs/number.vue +140 -0
- package/packages/FormMaking/custom/configs/radio.vue +211 -0
- package/packages/FormMaking/custom/configs/rate.vue +109 -0
- package/packages/FormMaking/custom/configs/select.vue +305 -0
- package/packages/FormMaking/custom/configs/slider.vue +142 -0
- package/packages/FormMaking/custom/configs/switch.vue +130 -0
- package/packages/FormMaking/custom/configs/table.vue +105 -0
- package/packages/FormMaking/custom/configs/table_h5.vue +102 -0
- package/packages/FormMaking/custom/configs/tabs.vue +175 -0
- package/packages/FormMaking/custom/configs/text.vue +71 -0
- package/packages/FormMaking/custom/configs/textarea.vue +167 -0
- package/packages/FormMaking/custom/configs/time.vue +153 -0
- package/packages/FormMaking/custom/configs/upload.vue +155 -0
- package/packages/FormMaking/custom/index.js +32 -0
- package/packages/FormMaking/custom/items/alliance.vue +132 -0
- package/packages/FormMaking/custom/items/blank.vue +16 -0
- package/packages/FormMaking/custom/items/button.vue +27 -0
- package/packages/FormMaking/custom/items/cascader.vue +29 -0
- package/packages/FormMaking/custom/items/cell.vue +18 -0
- package/packages/FormMaking/custom/items/checkbox.vue +46 -0
- package/packages/FormMaking/custom/items/color.vue +19 -0
- package/packages/FormMaking/custom/items/date.vue +29 -0
- package/packages/FormMaking/custom/items/divider.vue +14 -0
- package/packages/FormMaking/custom/items/editor.vue +22 -0
- package/packages/FormMaking/custom/items/filler.vue +17 -0
- package/packages/FormMaking/custom/items/grid.vue +130 -0
- package/packages/FormMaking/custom/items/image.vue +70 -0
- package/packages/FormMaking/custom/items/input.vue +33 -0
- package/packages/FormMaking/custom/items/login.vue +13 -0
- package/packages/FormMaking/custom/items/number.vue +24 -0
- package/packages/FormMaking/custom/items/radio.vue +44 -0
- package/packages/FormMaking/custom/items/rate.vue +20 -0
- package/packages/FormMaking/custom/items/select.vue +32 -0
- package/packages/FormMaking/custom/items/slider.vue +34 -0
- package/packages/FormMaking/custom/items/switch.vue +22 -0
- package/packages/FormMaking/custom/items/table.vue +106 -0
- package/packages/FormMaking/custom/items/table_h5.vue +126 -0
- package/packages/FormMaking/custom/items/tabs.vue +145 -0
- package/packages/FormMaking/custom/items/text.vue +18 -0
- package/packages/FormMaking/custom/items/textarea.vue +37 -0
- package/packages/FormMaking/custom/items/time.vue +32 -0
- package/packages/FormMaking/custom/items/upload.vue +102 -0
- package/packages/FormMaking/custom/mixins/index.js +61 -0
- package/packages/FormMaking/custom/register.js +18 -0
- package/packages/FormMaking/generate.js +5 -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 +33 -0
- package/packages/FormMaking/index.vue +807 -0
- package/packages/FormMaking/lang/en-US.js +187 -0
- package/packages/FormMaking/lang/zh-CN.js +187 -0
- package/packages/FormMaking/making.js +9 -0
- package/packages/FormMaking/styles/cover.scss +41 -0
- package/packages/FormMaking/styles/index.scss +785 -0
- package/packages/FormMaking/util/generateCode.js +163 -0
- package/packages/FormMaking/util/index.js +33 -0
- package/packages/FormMaking/util/request.js +28 -0
- package/packages/Grid/index.js +8 -0
- package/packages/Grid/index.vue +21 -0
- package/packages/GridItem/index.js +8 -0
- package/packages/GridItem/index.vue +69 -0
- package/packages/Icons/index.js +8 -0
- package/packages/Icons/index.vue +377 -0
- package/packages/Image/index.js +8 -0
- package/packages/Image/index.vue +146 -0
- package/packages/ImagePreview/index.js +8 -0
- package/packages/ImagePreview/index.vue +386 -0
- package/packages/Row/index.js +8 -0
- package/packages/Row/index.vue +33 -0
- package/packages/Table/action.js +8 -0
- package/packages/Table/action.vue +168 -0
- package/packages/Table/column.vue +63 -0
- package/packages/Table/index.js +8 -0
- package/packages/Table/index.vue +327 -0
- package/packages/Table/search.js +8 -0
- package/packages/Table/search.vue +163 -0
- package/packages/Table/tools.js +8 -0
- package/packages/Table/tools.vue +49 -0
- package/packages/TableMaking/custom/configs/fieldSearch.vue +17 -0
- package/packages/TableMaking/custom/configs/fieldTable.vue +15 -0
- package/packages/TableMaking/custom/items/search/index.vue +158 -0
- package/packages/TableMaking/custom/items/tools/index.vue +49 -0
- package/packages/TableMaking/generate.js +5 -0
- package/packages/TableMaking/generateTable.vue +560 -0
- package/packages/TableMaking/index.vue +229 -0
- package/packages/TableMaking/making.js +5 -0
- package/packages/TableMaking/util/index.js +433 -0
- package/packages/TableMaking/widgetConfig.vue +390 -0
- package/packages/TableMaking/widgetTable.vue +305 -0
- package/packages/Upload/ajax.js +85 -0
- package/packages/Upload/index.js +8 -0
- package/packages/Upload/index.vue +325 -0
- package/packages/Upload/upload-dragger.vue +70 -0
- package/packages/Upload/upload-list.vue +121 -0
- package/packages/Upload/upload.vue +193 -0
- package/packages/VueEditor/index.js +8 -0
- package/packages/VueEditor/index.vue +38 -0
- package/packages/Workflow/Log.js +99 -0
- package/packages/Workflow/designer/ProcessDesigner.vue +628 -0
- package/packages/Workflow/designer/index.js +7 -0
- package/packages/Workflow/designer/plugins/content-pad/contentPadProvider.js +390 -0
- package/packages/Workflow/designer/plugins/content-pad/index.js +6 -0
- package/packages/Workflow/designer/plugins/defaultEmpty.js +24 -0
- package/packages/Workflow/designer/plugins/descriptor/activitiDescriptor.json +1071 -0
- package/packages/Workflow/designer/plugins/descriptor/camundaDescriptor.json +1087 -0
- package/packages/Workflow/designer/plugins/descriptor/flowableDescriptor.json +1215 -0
- package/packages/Workflow/designer/plugins/extension-moddle/activiti/activitiExtension.js +74 -0
- package/packages/Workflow/designer/plugins/extension-moddle/activiti/index.js +9 -0
- package/packages/Workflow/designer/plugins/extension-moddle/camunda/extension.js +148 -0
- package/packages/Workflow/designer/plugins/extension-moddle/camunda/index.js +6 -0
- package/packages/Workflow/designer/plugins/extension-moddle/flowable/flowableExtension.js +74 -0
- package/packages/Workflow/designer/plugins/extension-moddle/flowable/index.js +9 -0
- package/packages/Workflow/designer/plugins/palette/CustomPalette.js +156 -0
- package/packages/Workflow/designer/plugins/palette/index.js +6 -0
- package/packages/Workflow/designer/plugins/palette/paletteProvider.js +160 -0
- package/packages/Workflow/designer/plugins/translate/customTranslate.js +41 -0
- package/packages/Workflow/designer/plugins/translate/zh.js +238 -0
- package/packages/Workflow/highlight/index.js +5 -0
- package/packages/Workflow/index.js +34 -0
- package/packages/Workflow/index.vue +399 -0
- package/packages/Workflow/modules/auto-place/CustomAutoPlace.js +81 -0
- package/packages/Workflow/modules/auto-place/index.js +6 -0
- package/packages/Workflow/modules/custom-renderer/CustomRenderer.js +17 -0
- package/packages/Workflow/modules/custom-renderer/index.js +6 -0
- package/packages/Workflow/modules/rules/CustomRules.js +16 -0
- package/packages/Workflow/modules/rules/index.js +6 -0
- package/packages/Workflow/palette/ProcessPalette.vue +106 -0
- package/packages/Workflow/palette/index.js +7 -0
- package/packages/Workflow/penal/PropertiesPanel.vue +245 -0
- package/packages/Workflow/penal/base/ElementBaseInfo.vue +80 -0
- package/packages/Workflow/penal/flow-condition/FlowCondition.vue +142 -0
- package/packages/Workflow/penal/form/ElementForm.vue +367 -0
- package/packages/Workflow/penal/index.js +7 -0
- package/packages/Workflow/penal/listeners/ElementListeners.vue +299 -0
- package/packages/Workflow/penal/listeners/UserTaskListeners.vue +322 -0
- package/packages/Workflow/penal/listeners/template.js +178 -0
- package/packages/Workflow/penal/listeners/utilSelf.js +64 -0
- package/packages/Workflow/penal/multi-instance/ElementMultiInstance.vue +200 -0
- package/packages/Workflow/penal/other/ElementOtherConfig.vue +59 -0
- package/packages/Workflow/penal/properties/ElementProperties.vue +135 -0
- package/packages/Workflow/penal/signal-message/SignalAndMessage.vue +104 -0
- package/packages/Workflow/penal/task/ElementTask.vue +73 -0
- package/packages/Workflow/penal/task/task-components/ReceiveTask.vue +97 -0
- package/packages/Workflow/penal/task/task-components/ScriptTask.vue +85 -0
- package/packages/Workflow/penal/task/task-components/UserTask.vue +535 -0
- package/packages/Workflow/theme/element-variables.scss +70 -0
- package/packages/Workflow/theme/index.scss +2 -0
- package/packages/Workflow/theme/process-designer.scss +157 -0
- package/packages/Workflow/theme/process-panel.scss +107 -0
- package/packages/Workflow/translations.js +25 -0
- package/packages/Workflow/utils.js +71 -0
- package/packages/index.js +160 -0
- package/babel.config.js +0 -15
- package/index.js +0 -11
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
- package/src/App.vue +0 -28
- package/src/assets/logo.png +0 -0
- package/src/components/HelloWorld.vue +0 -58
- package/src/main.js +0 -8
package/package.json
CHANGED
@@ -1,48 +1,86 @@
|
|
1
|
-
{
|
2
|
-
"name": "tianheng-ui",
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
"
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"
|
14
|
-
},
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
|
25
|
-
|
26
|
-
"
|
27
|
-
"
|
28
|
-
|
29
|
-
|
30
|
-
"
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
"
|
35
|
-
|
36
|
-
|
37
|
-
"
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
"
|
42
|
-
"
|
43
|
-
|
44
|
-
|
45
|
-
"
|
46
|
-
|
47
|
-
|
48
|
-
|
1
|
+
{
|
2
|
+
"name": "tianheng-ui",
|
3
|
+
"description": "A Vue.js project",
|
4
|
+
"version": "0.1.2",
|
5
|
+
"author": "shu lang <403732931@qq.com>",
|
6
|
+
"license": "MIT",
|
7
|
+
"private": false,
|
8
|
+
"main": "./lib/tianheng-ui.js",
|
9
|
+
"style": "lib/theme-chalk/index.css",
|
10
|
+
"scripts": {
|
11
|
+
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot --mode=development",
|
12
|
+
"build": "cross-env NODE_ENV=preview webpack --progress --hide-modules --mode=production",
|
13
|
+
"build:npm": "cross-env NODE_ENV=production webpack --progress --hide-modules --mode=production"
|
14
|
+
},
|
15
|
+
"dependencies": {
|
16
|
+
"ace-builds": "^1.4.13",
|
17
|
+
"axios": "^0.27.2",
|
18
|
+
"bpmn-js-sketchy": "^0.5.3",
|
19
|
+
"bpmn-js-task-resize": "^1.2.0",
|
20
|
+
"bpmn-js-token-simulation": "^0.10.0",
|
21
|
+
"clipboard": "^2.0.11",
|
22
|
+
"diagram-js-minimap": "^2.0.4",
|
23
|
+
"element-ui": "^2.15.6",
|
24
|
+
"highlight.js": "^10.5.0",
|
25
|
+
"min-dash": "^3.5.2",
|
26
|
+
"mini-css-extract-plugin": "^1.6.2",
|
27
|
+
"normalize.css": "^8.0.1",
|
28
|
+
"nprogress": "^0.2.0",
|
29
|
+
"viewerjs": "^1.10.5",
|
30
|
+
"vue": "^2.5.11",
|
31
|
+
"vue-i18n": "^5.0.3",
|
32
|
+
"vue-router": "^3.5.3",
|
33
|
+
"vue2-editor": "^2.10.3",
|
34
|
+
"vuedraggable": "^2.24.3",
|
35
|
+
"vuex": "^3.6.2",
|
36
|
+
"x2js": "^3.4.2",
|
37
|
+
"xlsx": "^0.18.5",
|
38
|
+
"xml-js": "^1.6.11"
|
39
|
+
},
|
40
|
+
"browserslist": [
|
41
|
+
"> 1%",
|
42
|
+
"last 2 versions",
|
43
|
+
"not ie <= 8"
|
44
|
+
],
|
45
|
+
"devDependencies": {
|
46
|
+
"@babel/core": "^7.0.0",
|
47
|
+
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
48
|
+
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
49
|
+
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
50
|
+
"@babel/plugin-syntax-import-meta": "^7.0.0",
|
51
|
+
"@babel/preset-env": "^7.0.0",
|
52
|
+
"@types/ace": "0.0.42",
|
53
|
+
"@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
|
54
|
+
"@vue/babel-preset-jsx": "^1.4.0",
|
55
|
+
"babel-loader": "^8.2.5",
|
56
|
+
"babel-plugin-component": "^1.1.1",
|
57
|
+
"babel-plugin-import": "^1.13.5",
|
58
|
+
"bpmn-js": "^8.8.3",
|
59
|
+
"bpmn-js-properties-panel": "^0.37.2",
|
60
|
+
"camunda-bpmn-moddle": "^4.4.1",
|
61
|
+
"cross-env": "^5.0.5",
|
62
|
+
"css-loader": "^0.28.7",
|
63
|
+
"file-loader": "^1.1.4",
|
64
|
+
"html-webpack-plugin": "^4.5.0",
|
65
|
+
"less": "^3.9.0",
|
66
|
+
"less-loader": "^4.1.0",
|
67
|
+
"sass": "^1.55.0",
|
68
|
+
"sass-loader": "^7.3.1",
|
69
|
+
"style-loader": "^2.0.0",
|
70
|
+
"uglifyjs-webpack-plugin": "^2.2.0",
|
71
|
+
"vue-loader": "^14.2.4",
|
72
|
+
"vue-template-compiler": "^2.4.4",
|
73
|
+
"webpack": "^4.46.0",
|
74
|
+
"webpack-cli": "^3.3.12",
|
75
|
+
"webpack-dev-server": "^3.11.3"
|
76
|
+
},
|
77
|
+
"files": [
|
78
|
+
"lib",
|
79
|
+
"packages"
|
80
|
+
],
|
81
|
+
"homepage": "https://tianhengui.demo.tianhengyun.com/",
|
82
|
+
"keywords": [
|
83
|
+
"tianheng",
|
84
|
+
"tianheng-ui"
|
85
|
+
]
|
86
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<template>
|
2
|
+
<button
|
3
|
+
class="th-button"
|
4
|
+
:class="selfClass"
|
5
|
+
:disabled="buttonDisabled || loading"
|
6
|
+
:autofocus="autofocus"
|
7
|
+
:type="nativeType"
|
8
|
+
@click="handleClick"
|
9
|
+
>
|
10
|
+
<i class="el-icon-loading" v-if="loading"></i>
|
11
|
+
<i :class="icon" v-if="icon && !loading"></i>
|
12
|
+
<span v-if="$slots.default"><slot></slot></span>
|
13
|
+
</button>
|
14
|
+
</template>
|
15
|
+
<script>
|
16
|
+
export default {
|
17
|
+
name: "ThButton",
|
18
|
+
|
19
|
+
inject: {
|
20
|
+
thForm: { default: "" },
|
21
|
+
thFormItem: { default: "" }
|
22
|
+
},
|
23
|
+
|
24
|
+
props: {
|
25
|
+
type: {
|
26
|
+
type: String,
|
27
|
+
default: "default"
|
28
|
+
},
|
29
|
+
size: String,
|
30
|
+
icon: {
|
31
|
+
type: String,
|
32
|
+
default: ""
|
33
|
+
},
|
34
|
+
nativeType: {
|
35
|
+
type: String,
|
36
|
+
default: "button"
|
37
|
+
},
|
38
|
+
loading: Boolean,
|
39
|
+
disabled: Boolean,
|
40
|
+
plain: Boolean,
|
41
|
+
autofocus: Boolean,
|
42
|
+
round: Boolean,
|
43
|
+
circle: Boolean
|
44
|
+
},
|
45
|
+
|
46
|
+
computed: {
|
47
|
+
selfClass() {
|
48
|
+
let className = [
|
49
|
+
this.type ? "th-button-" + this.type : "",
|
50
|
+
this.buttonSize ? "th-button-size-" + this.buttonSize : "",
|
51
|
+
{
|
52
|
+
"is-disabled": this.buttonDisabled,
|
53
|
+
"is-loading": this.loading,
|
54
|
+
"is-plain": this.plain,
|
55
|
+
"is-round": this.round,
|
56
|
+
"is-circle": this.circle
|
57
|
+
}
|
58
|
+
];
|
59
|
+
return className;
|
60
|
+
},
|
61
|
+
_thFormItemSize() {
|
62
|
+
return (this.thFormItem || {}).thFormItemSize;
|
63
|
+
},
|
64
|
+
buttonSize() {
|
65
|
+
return this.size || this._thFormItemSize || (this.$ELEMENT || {}).size;
|
66
|
+
},
|
67
|
+
buttonDisabled() {
|
68
|
+
return this.$options.propsData.hasOwnProperty("disabled")
|
69
|
+
? this.disabled
|
70
|
+
: (this.thForm || {}).disabled;
|
71
|
+
}
|
72
|
+
},
|
73
|
+
|
74
|
+
methods: {
|
75
|
+
handleClick(evt) {
|
76
|
+
this.$emit("click", evt);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
};
|
80
|
+
</script>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="th-card" :class="seflClass">
|
3
|
+
<template v-if="showHeader">
|
4
|
+
<slot v-if="$slots.header" name="header" />
|
5
|
+
<div v-else class="th-card-header">
|
6
|
+
<span v-if="title">{{ title }}</span>
|
7
|
+
<slot v-else name="title" />
|
8
|
+
<span v-if="label">{{ label }}</span>
|
9
|
+
<slot v-else name="label" />
|
10
|
+
</div>
|
11
|
+
</template>
|
12
|
+
<div class="th-card-body" :style="bodyStyle">
|
13
|
+
<slot />
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</template>
|
17
|
+
|
18
|
+
<script>
|
19
|
+
export default {
|
20
|
+
name: "ThCard",
|
21
|
+
props: {
|
22
|
+
showHeader: { type: Boolean, default: true },
|
23
|
+
title: String,
|
24
|
+
label: String,
|
25
|
+
bodyStyle: String | Object,
|
26
|
+
shadow: { type: String, default: "always" }, // always / hover / never
|
27
|
+
border: Boolean
|
28
|
+
},
|
29
|
+
computed: {
|
30
|
+
seflClass() {
|
31
|
+
let className = `${this.shadow}-shadow`;
|
32
|
+
if (this.border) className = `${className} th-is_border`;
|
33
|
+
return className;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
};
|
37
|
+
</script>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<template>
|
2
|
+
<div :class="selfCellClass" :style="customStyle" @click="handleClick">
|
3
|
+
<i v-if="icon" class="th-cell-icon" :class="icon"></i>
|
4
|
+
<slot v-else name="icon" />
|
5
|
+
<div class="th-cell-content">
|
6
|
+
<div
|
7
|
+
v-if="title"
|
8
|
+
:class="['th-cell-title', titleClass]"
|
9
|
+
:style="titleStyle"
|
10
|
+
>
|
11
|
+
{{ title }}
|
12
|
+
</div>
|
13
|
+
<slot v-else name="title" />
|
14
|
+
<div v-if="label" :class="['th-cell-label', labelClass]">
|
15
|
+
{{ label }}
|
16
|
+
</div>
|
17
|
+
<slot v-else name="label" />
|
18
|
+
</div>
|
19
|
+
<div v-if="value" :class="['th-cell-value', valueClass]">
|
20
|
+
{{ value }}
|
21
|
+
</div>
|
22
|
+
<slot v-else />
|
23
|
+
</div>
|
24
|
+
</template>
|
25
|
+
|
26
|
+
<script>
|
27
|
+
export default {
|
28
|
+
name: "ThCell",
|
29
|
+
props: {
|
30
|
+
title: Number | String,
|
31
|
+
value: Number | String,
|
32
|
+
label: String,
|
33
|
+
icon: String,
|
34
|
+
|
35
|
+
customStyle: String | Object,
|
36
|
+
titleStyle: String | Object,
|
37
|
+
|
38
|
+
customClass: String,
|
39
|
+
titleClass: String,
|
40
|
+
labelClass: String,
|
41
|
+
valueClass: String,
|
42
|
+
|
43
|
+
activeClass: String,
|
44
|
+
hoverClass: String,
|
45
|
+
|
46
|
+
center: Boolean,
|
47
|
+
hover: Boolean,
|
48
|
+
active: Boolean
|
49
|
+
},
|
50
|
+
computed: {
|
51
|
+
selfCellClass() {
|
52
|
+
let className = "th-cell";
|
53
|
+
if (this.customClass) className = `${className} ${this.customClass}`;
|
54
|
+
if (this.center) className = `${className} th-is_alignItemsCenter`;
|
55
|
+
if (this.active)
|
56
|
+
className = `${className} ${this.activeClass || "th-is_active"}`;
|
57
|
+
if (this.hover)
|
58
|
+
className = `${className} ${this.hoverClass || "th-is_hover"}`;
|
59
|
+
return className;
|
60
|
+
}
|
61
|
+
},
|
62
|
+
methods: {
|
63
|
+
handleClick(evt) {
|
64
|
+
this.$emit("click", evt);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
};
|
68
|
+
</script>
|
@@ -0,0 +1,177 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="th-codeEditor" :style="selfStyle" :ref="generateId" />
|
3
|
+
</template>
|
4
|
+
<script>
|
5
|
+
// 引入全局实例
|
6
|
+
import ace from "ace-builds";
|
7
|
+
// 主题风格,引入主题后还需要在 options 中指定主题才会生效
|
8
|
+
import "ace-builds/src-min-noconflict/theme-textmate";
|
9
|
+
import "ace-builds/src-min-noconflict/theme-monokai";
|
10
|
+
import "ace-builds/src-min-noconflict/theme-terminal";
|
11
|
+
import "ace-builds/src-min-noconflict/theme-clouds";
|
12
|
+
|
13
|
+
// 联想词
|
14
|
+
import "ace-builds/src-min-noconflict/ext-language_tools";
|
15
|
+
// 支持代码格式, 需要引入具体的语法高亮库才会有对应的语法高亮效果
|
16
|
+
import "ace-builds/src-min-noconflict/mode-javascript";
|
17
|
+
import "ace-builds/src-min-noconflict/mode-json";
|
18
|
+
import "ace-builds/src-min-noconflict/mode-css";
|
19
|
+
import "ace-builds/src-min-noconflict/mode-html";
|
20
|
+
import "ace-builds/src-min-noconflict/mode-sql";
|
21
|
+
|
22
|
+
import jsWorkerUrl from "file-loader!ace-builds/src-noconflict/worker-javascript";
|
23
|
+
ace.config.setModuleUrl("ace/mode/javascript_worker", jsWorkerUrl);
|
24
|
+
ace.config.setModuleUrl(
|
25
|
+
"ace/snippets/javascript",
|
26
|
+
require("file-loader!ace-builds/src-noconflict/snippets/javascript.js")
|
27
|
+
);
|
28
|
+
|
29
|
+
import cssWorkerUrl from "file-loader!ace-builds/src-noconflict/worker-css";
|
30
|
+
ace.config.setModuleUrl("ace/mode/css_worker", cssWorkerUrl);
|
31
|
+
ace.config.setModuleUrl(
|
32
|
+
"ace/snippets/css",
|
33
|
+
require("file-loader!ace-builds/src-noconflict/snippets/css.js")
|
34
|
+
);
|
35
|
+
|
36
|
+
import jsonWorkerUrl from "file-loader!ace-builds/src-noconflict/worker-json";
|
37
|
+
ace.config.setModuleUrl("ace/mode/json_worker", jsonWorkerUrl);
|
38
|
+
|
39
|
+
import htmlWorkerUrl from "file-loader!ace-builds/src-noconflict/worker-html";
|
40
|
+
ace.config.setModuleUrl("ace/mode/html_worker", htmlWorkerUrl);
|
41
|
+
|
42
|
+
export default {
|
43
|
+
name: "ThCodeEditor",
|
44
|
+
model: {
|
45
|
+
event: "change"
|
46
|
+
},
|
47
|
+
props: {
|
48
|
+
// 编辑器内容
|
49
|
+
value: String,
|
50
|
+
// 默认语言
|
51
|
+
language: {
|
52
|
+
type: String,
|
53
|
+
default: "javascript"
|
54
|
+
},
|
55
|
+
// 主题,对应主题库 JS 需要提前引入
|
56
|
+
theme: {
|
57
|
+
type: String,
|
58
|
+
default: "textmate"
|
59
|
+
},
|
60
|
+
height: String | Number,
|
61
|
+
// 是否只读
|
62
|
+
readonly: Boolean,
|
63
|
+
// 最大行数
|
64
|
+
maxLines: Number,
|
65
|
+
// 自定义提示
|
66
|
+
completions: {
|
67
|
+
type: Array,
|
68
|
+
default: () => {
|
69
|
+
return [];
|
70
|
+
}
|
71
|
+
},
|
72
|
+
showGutter: { type: Boolean, default: true },
|
73
|
+
highlightActiveLine: { type: Boolean, default: true },
|
74
|
+
highlightSelectedWord: { type: Boolean, default: true }
|
75
|
+
},
|
76
|
+
data() {
|
77
|
+
return {
|
78
|
+
editor: null,
|
79
|
+
generateId:
|
80
|
+
"id_" +
|
81
|
+
Math.random()
|
82
|
+
.toString(36)
|
83
|
+
.substr(2, 4)
|
84
|
+
};
|
85
|
+
},
|
86
|
+
mounted() {
|
87
|
+
// 初始化
|
88
|
+
this.initEditor();
|
89
|
+
this.setCompleteData();
|
90
|
+
},
|
91
|
+
computed: {
|
92
|
+
selfStyle() {
|
93
|
+
const style = {};
|
94
|
+
if (typeof this.height === "string" && this.height) {
|
95
|
+
style.height = this.height;
|
96
|
+
style.minHeight = "auto";
|
97
|
+
}
|
98
|
+
if (typeof this.height === "number" && this.height != null) {
|
99
|
+
style.height = `${this.height}px`;
|
100
|
+
style.minHeight = "auto";
|
101
|
+
}
|
102
|
+
return style;
|
103
|
+
}
|
104
|
+
},
|
105
|
+
watch: {
|
106
|
+
value(val) {
|
107
|
+
if (this.editor.getValue() !== val) {
|
108
|
+
this.editor.setValue(val);
|
109
|
+
this.editor.clearSelection();
|
110
|
+
}
|
111
|
+
}
|
112
|
+
},
|
113
|
+
methods: {
|
114
|
+
// 初始化
|
115
|
+
initEditor() {
|
116
|
+
// 创建实例
|
117
|
+
this.editor = ace.edit(this.$refs[this.generateId], {
|
118
|
+
mode: `ace/mode/${this.language}`,
|
119
|
+
theme: `ace/theme/${this.theme}`,
|
120
|
+
fontSize: 14,
|
121
|
+
tabSize: 2,
|
122
|
+
value: this.value,
|
123
|
+
selectionStyle: "text",
|
124
|
+
maxLines: this.maxLines,
|
125
|
+
readOnly: this.readonly,
|
126
|
+
showGutter: this.showGutter,
|
127
|
+
highlightActiveLine: this.highlightActiveLine,
|
128
|
+
highlightSelectedWord: this.highlightSelectedWord
|
129
|
+
});
|
130
|
+
// 设置属性等,具体需要可根据官方参数自行设置
|
131
|
+
this.editor.setOptions({
|
132
|
+
enableBasicAutocompletion: true,
|
133
|
+
enableSnippets: true,
|
134
|
+
enableLiveAutocompletion: true,
|
135
|
+
wrap: true,
|
136
|
+
setShowPrintMargin: false
|
137
|
+
});
|
138
|
+
// 设置值改变监听
|
139
|
+
this.editor.on("change", () => {
|
140
|
+
this.$emit("change", this.editor.getValue());
|
141
|
+
});
|
142
|
+
},
|
143
|
+
setCompleteData() {
|
144
|
+
let langTools = ace.require("ace/ext/language_tools");
|
145
|
+
langTools.addCompleter({
|
146
|
+
getCompletions: (editor, session, pos, prefix, callback) => {
|
147
|
+
if (prefix.length === 0) {
|
148
|
+
return callback(null, []);
|
149
|
+
} else {
|
150
|
+
return callback(null, this.completions);
|
151
|
+
}
|
152
|
+
}
|
153
|
+
});
|
154
|
+
},
|
155
|
+
setShowGutter(bool) {
|
156
|
+
this.editor.renderer.setShowGutter(bool);
|
157
|
+
},
|
158
|
+
// 实例方法,高亮某一行
|
159
|
+
gotoLine(lineNumber) {
|
160
|
+
this.editor.gotoLine(lineNumber);
|
161
|
+
},
|
162
|
+
// resize编辑器
|
163
|
+
resize() {
|
164
|
+
this.editor.resize();
|
165
|
+
},
|
166
|
+
destroy() {
|
167
|
+
if (this.editor) {
|
168
|
+
this.editor.destroy();
|
169
|
+
this.editor = null;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
},
|
173
|
+
beforeDestroy() {
|
174
|
+
this.destroy();
|
175
|
+
}
|
176
|
+
};
|
177
|
+
</script>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="th-col" :class="selfClass" :style="selfStyle">
|
3
|
+
<slot />
|
4
|
+
</div>
|
5
|
+
</template>
|
6
|
+
|
7
|
+
<script>
|
8
|
+
export default {
|
9
|
+
name: "ThCol",
|
10
|
+
props: {
|
11
|
+
span: { type: Number | String, default: 24 },
|
12
|
+
offset: Number
|
13
|
+
},
|
14
|
+
computed: {
|
15
|
+
selfClass() {
|
16
|
+
let className = "";
|
17
|
+
if (this.span) className = `th-col-${this.span}`;
|
18
|
+
if (this.offset) className = `${className} th-col-offset-${this.offset}`;
|
19
|
+
return className;
|
20
|
+
},
|
21
|
+
selfStyle() {
|
22
|
+
let parent = this.$parent;
|
23
|
+
while (parent && parent.$options.name !== "ThRow") {
|
24
|
+
parent = parent.$parent;
|
25
|
+
}
|
26
|
+
|
27
|
+
let gutter = 0;
|
28
|
+
if (parent) gutter = parent.gutter;
|
29
|
+
|
30
|
+
const style = {};
|
31
|
+
if (gutter) {
|
32
|
+
style.paddingLeft = `${gutter / 2}px`;
|
33
|
+
style.paddingRight = style.paddingLeft;
|
34
|
+
}
|
35
|
+
return style;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
};
|
39
|
+
</script>
|
40
|
+
|
41
|
+
<style lang="scss">
|
42
|
+
@import "../../lib/theme-chalk/styles/col.scss";
|
43
|
+
</style>
|