simple-frame-unit 1.0.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.
Files changed (260) hide show
  1. package/.env.dev +14 -0
  2. package/CHANGELOG.md +9 -0
  3. package/README.md +24 -0
  4. package/dist/ed-frame-vue.common.1.js +11046 -0
  5. package/dist/ed-frame-vue.common.1.js.map +1 -0
  6. package/dist/ed-frame-vue.common.2.js +1715 -0
  7. package/dist/ed-frame-vue.common.2.js.map +1 -0
  8. package/dist/ed-frame-vue.common.js +53427 -0
  9. package/dist/ed-frame-vue.common.js.map +1 -0
  10. package/dist/ed-frame-vue.umd.1.js +11046 -0
  11. package/dist/ed-frame-vue.umd.1.js.map +1 -0
  12. package/dist/ed-frame-vue.umd.2.js +1715 -0
  13. package/dist/ed-frame-vue.umd.2.js.map +1 -0
  14. package/dist/ed-frame-vue.umd.js +53437 -0
  15. package/dist/ed-frame-vue.umd.js.map +1 -0
  16. package/dist/ed-frame-vue.umd.min.1.js +17 -0
  17. package/dist/ed-frame-vue.umd.min.1.js.map +1 -0
  18. package/dist/ed-frame-vue.umd.min.2.js +4 -0
  19. package/dist/ed-frame-vue.umd.min.2.js.map +1 -0
  20. package/dist/ed-frame-vue.umd.min.js +470 -0
  21. package/dist/ed-frame-vue.umd.min.js.map +1 -0
  22. package/import.easydata.js +46 -0
  23. package/lib/CHANGELOG.md +18 -0
  24. package/lib/README.md +27 -0
  25. package/lib/api/ds/index.js +124 -0
  26. package/lib/api/easyData.js +90 -0
  27. package/lib/api/easyform/easyForm.js +32 -0
  28. package/lib/api/index.js +61 -0
  29. package/lib/api/interface/index.js +32 -0
  30. package/lib/api/system.js +20 -0
  31. package/lib/index.js +80 -0
  32. package/lib/packages/BasicTemplate/EasyDataTemplate.vue +189 -0
  33. package/lib/packages/BasicTemplate/Props.js +64 -0
  34. package/lib/packages/BasicTemplate/components/TemplateComp.vue +263 -0
  35. package/lib/packages/BasicTemplate/components/TemplateViews.vue +292 -0
  36. package/lib/packages/BasicTemplate/hooks/business.js +74 -0
  37. package/lib/packages/BasicTemplate/hooks/getFormData.js +89 -0
  38. package/lib/packages/BasicTemplate/hooks/queryFormData.js +194 -0
  39. package/lib/packages/BasicTemplate/hooks/submitForm.js +53 -0
  40. package/lib/packages/BasicTemplate/hooks/useEmits.js +15 -0
  41. package/lib/packages/BasicTemplate/hooks/validate.js +42 -0
  42. package/lib/packages/EasyDataForm/EasyDataForm.vue +597 -0
  43. package/lib/packages/EasyDataForm/Props.js +22 -0
  44. package/lib/packages/EasyDataForm/components/FormItem.vue +228 -0
  45. package/lib/packages/EasyDataForm/hooks/useChosePopup.js +85 -0
  46. package/lib/packages/EasyDataForm/hooks/useEmits.js +19 -0
  47. package/lib/packages/EasyDataForm/hooks/useForm.js +169 -0
  48. package/lib/packages/EasyDataForm/hooks/useUpload.js +168 -0
  49. package/lib/packages/EasyDataList/EasyDataList.vue +348 -0
  50. package/lib/packages/EasyDataList/Props.js +116 -0
  51. package/lib/packages/EasyDataList/components/BasicModal.vue +150 -0
  52. package/lib/packages/EasyDataList/components/FormAction.vue +63 -0
  53. package/lib/packages/EasyDataList/hooks/useEmits.js +30 -0
  54. package/lib/packages/EasyDataList/hooks/useForm.js +62 -0
  55. package/lib/packages/EasyDataList/hooks/useTable.js +314 -0
  56. package/lib/packages/EasyDataTable/EasyDataTable.vue +233 -0
  57. package/lib/packages/EasyDataView/EasyDataView.vue +105 -0
  58. package/lib/packages/EdRichPreview/index.js +32 -0
  59. package/lib/packages/EdRichText/index.vue +167 -0
  60. package/lib/packages/EdRichText/replaceUrl.js +49 -0
  61. package/lib/packages/components/FileView.vue +97 -0
  62. package/lib/packages/index.js +11 -0
  63. package/lib/packages/mixins/EasyDataMixins.js +133 -0
  64. package/lib/packages/mixins/useTable.jsx +130 -0
  65. package/lib/pages/DataSource/index.js +8 -0
  66. package/lib/pages/DataSource/src/components/ControlViews/BaseProps.js +103 -0
  67. package/lib/pages/DataSource/src/components/ControlViews/control.js +1089 -0
  68. package/lib/pages/DataSource/src/components/ControlViews/index.vue +301 -0
  69. package/lib/pages/DataSource/src/components/TableOperationModal.vue +225 -0
  70. package/lib/pages/DataSource/src/components/TablePropsModal.vue +367 -0
  71. package/lib/pages/DataSource/src/components/ViewPropsModal.vue +737 -0
  72. package/lib/pages/DataSource/src/components/modal/ChooseDict.vue +119 -0
  73. package/lib/pages/DataSource/src/hooks/useTable.js +138 -0
  74. package/lib/pages/DataSource/src/index.vue +431 -0
  75. package/lib/pages/Interface/index.js +8 -0
  76. package/lib/pages/Interface/src/components/InterfaceCall.vue +73 -0
  77. package/lib/pages/Interface/src/components/InterfaceDepend.vue +299 -0
  78. package/lib/pages/Interface/src/components/InterfaceFee.vue +131 -0
  79. package/lib/pages/Interface/src/components/InterfaceMessage.vue +878 -0
  80. package/lib/pages/Interface/src/components/InterfaceMock.vue +203 -0
  81. package/lib/pages/Interface/src/components/InterfaceParam.vue +308 -0
  82. package/lib/pages/Interface/src/components/InterfaceRepeat.vue +281 -0
  83. package/lib/pages/Interface/src/components/InterfaceVariable.vue +31 -0
  84. package/lib/pages/Interface/src/index.vue +216 -0
  85. package/lib/pages/Template/index.js +8 -0
  86. package/lib/pages/Template/src/components/DefineModal.vue +524 -0
  87. package/lib/pages/Template/src/components/TemplatePreview.vue +109 -0
  88. package/lib/pages/Template/src/components/model/AddDialog.vue +60 -0
  89. package/lib/pages/Template/src/components/model/TemplatePreview2.vue +101 -0
  90. package/lib/pages/Template/src/hooks/index.js +3 -0
  91. package/lib/pages/Template/src/hooks/useEmits.js +64 -0
  92. package/lib/pages/Template/src/index.vue +124 -0
  93. package/lib/popup/index.js +8 -0
  94. package/lib/popup/src/DataSourceChoose.vue +44 -0
  95. package/lib/popup/src/DataSourceViewIdChoose.vue +67 -0
  96. package/lib/popup/src/DictChoose.vue +104 -0
  97. package/lib/popup/src/InterfaceChoose.vue +46 -0
  98. package/lib/popup/src/OrgChoose.vue +121 -0
  99. package/lib/popup/src/RoleChoose.vue +101 -0
  100. package/lib/popup/src/TemplateChoose.vue +43 -0
  101. package/lib/popup/src/UserChoose.vue +161 -0
  102. package/lib/popup//347/273/204/344/273/266/345/274/200/345/217/221/350/247/204/350/214/203.md +25 -0
  103. package/lib/style/custom.scss +126 -0
  104. package/lib/style/deep.scss +109 -0
  105. package/lib/style/index.scss +4 -0
  106. package/lib/utils/MapLoader.js +48 -0
  107. package/lib/utils/dateUtils.js +58 -0
  108. package/lib/utils/index.js +8 -0
  109. package/lib/utils/setting.js +25 -0
  110. package/lib/utils/sortable/index.js +3784 -0
  111. package/lib/utils/useBusiness.js +212 -0
  112. package/lib/utils/utils.js +588 -0
  113. package/package.json +77 -0
  114. package/src/App.vue +12 -0
  115. package/src/assets/Vue.png +0 -0
  116. package/src/assets/avatar.png +0 -0
  117. package/src/assets/images/bg.png +0 -0
  118. package/src/assets/images/logo-bills.png +0 -0
  119. package/src/assets/images/pic.png +0 -0
  120. package/src/assets/images/weplus-logo.png +0 -0
  121. package/src/assets/marker.png +0 -0
  122. package/src/assets/styles/common.scss +359 -0
  123. package/src/assets/styles/ele-docs.css +3278 -0
  124. package/src/assets/styles/fonts/icomoon.eot +0 -0
  125. package/src/assets/styles/fonts/icomoon.svg +14 -0
  126. package/src/assets/styles/fonts/icomoon.ttf +0 -0
  127. package/src/assets/styles/fonts/icomoon.woff +0 -0
  128. package/src/assets/styles/fonts/style.css +39 -0
  129. package/src/assets/styles/higtlightEle.css +84 -0
  130. package/src/assets/svg/code.svg +7 -0
  131. package/src/assets/svg/password.svg +1 -0
  132. package/src/components/Popups/DiyCompDictChoose.vue +112 -0
  133. package/src/components/Popups/index.js +28 -0
  134. package/src/components/ed-base-vue/global/variable.js +8 -0
  135. package/src/components/ed-base-vue/index.js +81 -0
  136. package/src/components/ed-base-vue/package/EdCard/index.js +7 -0
  137. package/src/components/ed-base-vue/package/EdCard/src/index.vue +87 -0
  138. package/src/components/ed-base-vue/package/EdCodeEditor/index.js +8 -0
  139. package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/AceConfig.js +71 -0
  140. package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/Editor.vue +137 -0
  141. package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/Toolbar.vue +68 -0
  142. package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/index.vue +119 -0
  143. package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/webpack-resolver.js +51 -0
  144. package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/Toolbar.vue +57 -0
  145. package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/config.js +64 -0
  146. package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/index.vue +309 -0
  147. package/src/components/ed-base-vue/package/EdCodeEditor/src/EdCodeEditor.vue +238 -0
  148. package/src/components/ed-base-vue/package/EdDate/index.js +8 -0
  149. package/src/components/ed-base-vue/package/EdDate/src/index.js +50 -0
  150. package/src/components/ed-base-vue/package/EdDescriptions/index.js +8 -0
  151. package/src/components/ed-base-vue/package/EdDescriptions/src/EdDescriptions.vue +46 -0
  152. package/src/components/ed-base-vue/package/EdDescriptions/src/EdDescriptionsItem.js +20 -0
  153. package/src/components/ed-base-vue/package/EdDescriptions/src/Props.js +20 -0
  154. package/src/components/ed-base-vue/package/EdDialog/index.js +8 -0
  155. package/src/components/ed-base-vue/package/EdDialog/src/EdDialog.vue +138 -0
  156. package/src/components/ed-base-vue/package/EdDialog/src/Props.js +91 -0
  157. package/src/components/ed-base-vue/package/EdDialog/src/components/DialogFooter.vue +42 -0
  158. package/src/components/ed-base-vue/package/EdDialog/src/components/DialogWrapper.vue +53 -0
  159. package/src/components/ed-base-vue/package/EdDrawer/index.js +8 -0
  160. package/src/components/ed-base-vue/package/EdDrawer/src/DrawerFooter.vue +41 -0
  161. package/src/components/ed-base-vue/package/EdDrawer/src/EdDrawer.vue +150 -0
  162. package/src/components/ed-base-vue/package/EdDrawer/src/props.js +71 -0
  163. package/src/components/ed-base-vue/package/EdFlow/index.js +8 -0
  164. package/src/components/ed-base-vue/package/EdFlow/src/EdFlowItem.vue +733 -0
  165. package/src/components/ed-base-vue/package/EdFlow/src/index.vue +148 -0
  166. package/src/components/ed-base-vue/package/EdForm/index.js +8 -0
  167. package/src/components/ed-base-vue/package/EdForm/src/EdForm.vue +172 -0
  168. package/src/components/ed-base-vue/package/EdForm/src/Props.js +33 -0
  169. package/src/components/ed-base-vue/package/EdForm/src/components/EdFormItem.vue +34 -0
  170. package/src/components/ed-base-vue/package/EdIcons/index.js +8 -0
  171. package/src/components/ed-base-vue/package/EdIcons/src/hooks/Icons.js +406 -0
  172. package/src/components/ed-base-vue/package/EdIcons/src/hooks/Icons1.js +830 -0
  173. package/src/components/ed-base-vue/package/EdIcons/src/index.vue +13 -0
  174. package/src/components/ed-base-vue/package/EdImage/index.js +8 -0
  175. package/src/components/ed-base-vue/package/EdImage/src/index.vue +28 -0
  176. package/src/components/ed-base-vue/package/EdInputArray/index.js +8 -0
  177. package/src/components/ed-base-vue/package/EdInputArray/src/Props.js +26 -0
  178. package/src/components/ed-base-vue/package/EdInputArray/src/index.vue +97 -0
  179. package/src/components/ed-base-vue/package/EdInputColor/index.js +8 -0
  180. package/src/components/ed-base-vue/package/EdInputColor/src/InputColor.vue +81 -0
  181. package/src/components/ed-base-vue/package/EdInputMap/index.js +9 -0
  182. package/src/components/ed-base-vue/package/EdInputMap/src/EdInputMap.vue +246 -0
  183. package/src/components/ed-base-vue/package/EdInputMap/src/EdInputMapProps.js +6 -0
  184. package/src/components/ed-base-vue/package/EdInputPop/index.js +13 -0
  185. package/src/components/ed-base-vue/package/EdInputPop/src/EdInputPop.vue +144 -0
  186. package/src/components/ed-base-vue/package/EdInputPop/src/Props.js +48 -0
  187. package/src/components/ed-base-vue/package/EdInputTable/index.js +8 -0
  188. package/src/components/ed-base-vue/package/EdInputTable/src/EdInputTable.vue +368 -0
  189. package/src/components/ed-base-vue/package/EdInputTable/src/Fetch.js +40 -0
  190. package/src/components/ed-base-vue/package/EdJsonEditor/index.js +13 -0
  191. package/src/components/ed-base-vue/package/EdJsonEditor/src/EdJsonEditor.vue +198 -0
  192. package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/img/jsoneditor-icons.svg +749 -0
  193. package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/jsoneditor.css +2031 -0
  194. package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/plus.svg +1 -0
  195. package/src/components/ed-base-vue/package/EdJsonEditor/src/hooks.js +63 -0
  196. package/src/components/ed-base-vue/package/EdJsonViewer/index.js +8 -0
  197. package/src/components/ed-base-vue/package/EdJsonViewer/src/EdJsonViewer.vue +44 -0
  198. package/src/components/ed-base-vue/package/EdLable/index.js +8 -0
  199. package/src/components/ed-base-vue/package/EdLable/src/index.vue +34 -0
  200. package/src/components/ed-base-vue/package/EdLink/index.js +8 -0
  201. package/src/components/ed-base-vue/package/EdLink/src/index.vue +43 -0
  202. package/src/components/ed-base-vue/package/EdMarkEditor/index.js +15 -0
  203. package/src/components/ed-base-vue/package/EdMarkEditor/src/EdMarkEditor.vue +368 -0
  204. package/src/components/ed-base-vue/package/EdMarkEditor/src/extra-function.js +538 -0
  205. package/src/components/ed-base-vue/package/EdMarkEditor/src/highlight.js +95 -0
  206. package/src/components/ed-base-vue/package/EdTable/index.js +8 -0
  207. package/src/components/ed-base-vue/package/EdTable/src/EdTable.vue +240 -0
  208. package/src/components/ed-base-vue/package/EdTable/src/Props.js +97 -0
  209. package/src/components/ed-base-vue/package/EdTable/src/components/TableColumnItem.js +24 -0
  210. package/src/components/ed-base-vue/package/EdTable/src/components/TablePagination.vue +73 -0
  211. package/src/components/ed-base-vue/package/EdTableEditor/index.js +8 -0
  212. package/src/components/ed-base-vue/package/EdTableEditor/src/EdTableEditor.vue +282 -0
  213. package/src/components/ed-base-vue/package/EdTableEditor/src/Props.js +107 -0
  214. package/src/components/ed-base-vue/package/EdTableEditor/src/hooks/validate.js +90 -0
  215. package/src/components/ed-base-vue/package/EdUpload/index.js +8 -0
  216. package/src/components/ed-base-vue/package/EdUpload/src/Props.js +90 -0
  217. package/src/components/ed-base-vue/package/EdUpload/src/index.vue +88 -0
  218. package/src/components/ed-base-vue/package/EdViewer/index.js +8 -0
  219. package/src/components/ed-base-vue/package/EdViewer/src/EdViewer.vue +310 -0
  220. package/src/components/ed-base-vue/package/EdWangEditor/index.js +14 -0
  221. package/src/components/ed-base-vue/package/EdWangEditor/src/EdWangEditor.vue +127 -0
  222. package/src/components/ed-base-vue/package/ExtendSlot.js +12 -0
  223. package/src/components/ed-base-vue/package/OptionSlot.js +65 -0
  224. package/src/components/ed-base-vue/plugin/Message/index.js +2 -0
  225. package/src/components/ed-base-vue/plugin/Message/src/main.js +91 -0
  226. package/src/components/ed-base-vue/plugin/Message/src/main.vue +253 -0
  227. package/src/components/ed-base-vue/plugin/print/index.js +156 -0
  228. package/src/components/ed-base-vue/plugin/sortable/index.js +3784 -0
  229. package/src/components/ed-base-vue/style/custom.scss +107 -0
  230. package/src/components/ed-base-vue/style/deep.scss +100 -0
  231. package/src/components/ed-base-vue/style/index.scss +4 -0
  232. package/src/components/ed-base-vue/tools/date-format.js +315 -0
  233. package/src/components/ed-base-vue/tools/utils.js +124 -0
  234. package/src/layouts/components/AppMain.vue +17 -0
  235. package/src/layouts/components/Header.vue +256 -0
  236. package/src/layouts/components/Logo.vue +56 -0
  237. package/src/layouts/components/Navbar.vue +169 -0
  238. package/src/layouts/components/SideBar.vue +107 -0
  239. package/src/layouts/components/index.js +5 -0
  240. package/src/layouts/index.vue +57 -0
  241. package/src/main.js +42 -0
  242. package/src/request/config.js +6 -0
  243. package/src/request/index.js +85 -0
  244. package/src/request/request.js +147 -0
  245. package/src/router/index.js +65 -0
  246. package/src/router/modules/baseRouter.js +43 -0
  247. package/src/router/modules/easydata.js +49 -0
  248. package/src/views/base/BaseRichPreview.vue +23 -0
  249. package/src/views/base/BaseRichText.vue +28 -0
  250. package/src/views/base/EdFormView.vue +54 -0
  251. package/src/views/base/EdTable.vue +98 -0
  252. package/src/views/base/inputTable.vue +103 -0
  253. package/src/views/easydata/Interface.vue +3 -0
  254. package/src/views/easydata/dataSource.vue +13 -0
  255. package/src/views/easydata/dataSourceView.vue +71 -0
  256. package/src/views/easydata/templateDemo.vue +89 -0
  257. package/src/views/easydata/templateInfo.vue +13 -0
  258. package/src/views/index.vue +17 -0
  259. package/src/views/login.vue +208 -0
  260. package/src/views/redirect.vue +15 -0
@@ -0,0 +1,105 @@
1
+ <template>
2
+ <ed-descriptions v-loading="initLoading" v-bind="moduleProp" :columns="descColumns" :data="formData" >
3
+ <!-- 展示列插槽 -->
4
+ <template v-for="name in slotNames" v-slot:[name]="scope">
5
+ <slot :name="name" v-bind="scope"></slot>
6
+ </template>
7
+ </ed-descriptions>
8
+ </template>
9
+
10
+ <script lang="jsx">
11
+ import EasyDataMixins from "../../packages/mixins/EasyDataMixins";
12
+ import {TempType} from "../../api/easyData";
13
+
14
+ /**
15
+ * EasyDataView组件
16
+ * - 示例
17
+ *
18
+ * ```vue
19
+ * <EasyDataView ref="BasicDescribe" :columns="descColumns" :controlConfig="controlConfig" :formData="formData">
20
+ * </EasyDataView>
21
+ * ```
22
+ *
23
+ * 详细用法参考下方链接
24
+ *
25
+ * [EasyDataView组件使用示例](./web-comp/ExampleEasyDataViewCode.md)
26
+ *
27
+ * 混入属性参考
28
+ *
29
+ * [EasyDataMixins](./EasyDataMixins.md)
30
+ */
31
+ export default {
32
+ name: "EasyDataView",
33
+ props: {
34
+ /**
35
+ * 属性配置
36
+ * @default {}
37
+ */
38
+ controlConfig: {
39
+ type: Object,
40
+ default: () => {
41
+ return {}
42
+ }
43
+ },
44
+ },
45
+ mixins: [EasyDataMixins],
46
+ data() {
47
+ return {
48
+ // loading
49
+ initLoading: false,
50
+ // 描述信息
51
+ descColumns: [],
52
+ // 插槽名
53
+ slotNames:[]
54
+ }
55
+ },
56
+ watch: {
57
+ controlConfig: {
58
+ handler(newVal, oldVal) {
59
+ if (newVal && Object.keys(newVal).length > 0) {
60
+ const {controlInfos, controlProps, dataSource} = newVal
61
+ this.controlInfos = controlInfos
62
+ this.controlProps = controlProps
63
+ this.dataSource = dataSource
64
+
65
+ this.$nextTick(() => {
66
+ this.descColumns = this.getColumns(controlInfos, controlProps)
67
+ this.getSlotNames(this.descColumns)
68
+ })
69
+ }
70
+ },
71
+ deep: true,
72
+ immediate: true
73
+ },
74
+ // 有数据源名称且未传入controlConfig时,自动发起请求
75
+ dataSourceName: {
76
+ deep: true,
77
+ immediate: true,
78
+ handler(newVal, oldVal) {
79
+ if (newVal && newVal !== oldVal && (Object.keys(this.controlConfig).length === 0)) {
80
+ this.initControls().then(({controlInfos, controlProps}) => {
81
+ this.descColumns = this.getColumns(controlInfos, controlProps)
82
+ this.getSlotNames(this.descColumns)
83
+ })
84
+ }
85
+ }
86
+ }
87
+ },
88
+ methods:{
89
+ // 插槽项
90
+ getSlotNames(columns){
91
+ columns.map(column =>{
92
+ this.slotNames.push(column.prop.includes('.') ? column.prop.split('.').pop() : column.prop)
93
+ })
94
+ },
95
+ getType(){
96
+ return TempType.view
97
+ },
98
+ getFormData(){
99
+ return new Promise((resolve, reject)=>{
100
+ resolve(true)
101
+ })
102
+ }
103
+ }
104
+ }
105
+ </script>
@@ -0,0 +1,32 @@
1
+ import Vue from "vue";
2
+ import replaceUrl from "../EdRichText/replaceUrl"
3
+ let Content = null
4
+ export default {
5
+ name: 'EdRichPreview',
6
+ props: {
7
+ value: {type: String, default: '',},
8
+ },
9
+ // 文章编辑相关配置
10
+ data() {
11
+ return {
12
+ editor: null,
13
+ // 这里的 HTML 内容必须是 wangEditor 生成的(即 editor.getHtml() 返回的) HTML 格式,不可以自己随意写
14
+ defaultHtml: this.value,
15
+ }
16
+ },
17
+ render(h) {
18
+ if (this.value !== "") {
19
+ let dome = replaceUrl(this.value, this.$EdFrame.BASE_API, true)
20
+ Content = Vue.extend({
21
+ template: `<div><template>${dome}</template></div>`
22
+ })
23
+ return Content ? h(Content) : null
24
+ }
25
+ return h('span')
26
+ },
27
+ methods: {
28
+
29
+
30
+ },
31
+
32
+ }
@@ -0,0 +1,167 @@
1
+ <template>
2
+ <!-- 富文本编辑器 -->
3
+ <div class="editor">
4
+ <Toolbar :defaultConfig="toolbarConfig" :editor="editor" :mode="mode" class="editor-toolbar"/>
5
+
6
+ <Editor
7
+ v-model="defaultHtml"
8
+ :defaultConfig="editorConfigs"
9
+ :mode="mode"
10
+ class="editor-content"
11
+ @customPaste="customPaste"
12
+ @onChange="onChange"
13
+ @onCreated="onCreated"
14
+ />
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ import {Editor, Toolbar} from '@wangeditor/editor-for-vue';
20
+ import "@wangeditor/editor/dist/css/style.css";
21
+ import {deepMerge} from "../../utils/utils";
22
+ import replaceUrl from "./replaceUrl";
23
+
24
+ /**
25
+ * 富文本编辑器
26
+ * - 示例
27
+ *
28
+ * ```vue
29
+ * <ed-wang-editor v-model="value"></ed-wang-editor>
30
+ * ```
31
+ */
32
+ export default {
33
+ name: 'EdRichText',
34
+ components: {Editor, Toolbar},
35
+ props: {
36
+ value: {type: String, default: '',},
37
+ // 'default' or 'simple'
38
+ mode: {type: String, default: 'default'},
39
+ // 工具栏配置
40
+ toolbarConfig: {
41
+ type: Object,
42
+ default: () => {
43
+ return {
44
+ //排除某些菜单,其他都保留
45
+ excludeKeys: ["group-video"],
46
+ }
47
+ }
48
+ },
49
+ // 编辑器配置(图片如配置颜色、字体、链接校验、上传图片等)
50
+ editorConfig: {
51
+ type: Object,
52
+ default: () => {
53
+ return {
54
+ placeholder: "<p style='font-size: 14px'>请输入内容...</p>",
55
+ // 所有的菜单配置,都要在 MENU_CONF 属性下
56
+ MENU_CONF: {}
57
+ }
58
+ }
59
+ }
60
+ },
61
+ // 文章编辑相关配置
62
+ data() {
63
+ return {
64
+ editor: null,
65
+ // 这里的 HTML 内容必须是 wangEditor 生成的(即 editor.getHtml() 返回的) HTML 格式,不可以自己随意写
66
+ defaultHtml: "",
67
+ // 默认编辑器配置
68
+ defaultConfig: {
69
+ placeholder: "<p style='font-size: 14px'>请输入内容...</p>",
70
+ // 所有的菜单配置,都要在 MENU_CONF 属性下
71
+ MENU_CONF: {
72
+ uploadImage: {
73
+ customUpload: this.customUpload
74
+ },
75
+ uploadVideo: {
76
+ customUpload: this.customUpload
77
+ }
78
+ }
79
+ }
80
+ }
81
+ },
82
+ watch: {
83
+ value: {
84
+ deep: true,
85
+ immediate: true,
86
+ handler(newVal, oldVal) {
87
+ if (newVal) {
88
+ this.defaultHtml = replaceUrl(newVal, this.$EdFrame.BASE_API, false)
89
+ }
90
+ }
91
+ }
92
+ },
93
+ computed: {
94
+ editorConfigs() {
95
+ return deepMerge(this.defaultConfig, this.editorConfig)
96
+ }
97
+ },
98
+ methods: {
99
+ /**
100
+ * @name customUploadImage
101
+ * @param file
102
+ * @param insertFn
103
+ * @desc 自定义上传图片
104
+ */
105
+ customUpload(file, insertFn) {
106
+ let param = new FormData(); //创建form对象
107
+ param.append('file', file)
108
+ let UPLOAD_URL = this.$EdFrame.BASE_API + '/admin-api/easydata/common/upload'
109
+ this.$EdFrame.uploadAction(UPLOAD_URL, param).then(response => {
110
+ if (response.success) {
111
+ let FileUrl = `${this.$EdFrame.BASE_API}/admin-api/infra/file/${response.data.configId}/get/${response.data.filePath}?t=image`
112
+ insertFn(FileUrl)
113
+ }
114
+ })
115
+ },
116
+
117
+ // 编辑器创建完毕时的回调函数。
118
+ onCreated(editor) {
119
+ this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错
120
+ },
121
+
122
+ // 对用户剪切板内容的处理
123
+ customPaste(editor, event) {
124
+ // event 是 ClipboardEvent 类型,可以拿到粘贴的数据
125
+ const text = event.clipboardData.getData('text/plain'); // 获取粘贴的纯文本
126
+ editor.insertText(text);
127
+ event.preventDefault(); // 阻止默认的粘贴行为
128
+ return false;
129
+ },
130
+
131
+ //onChange 时获取编辑器最新内容
132
+ onChange(e) {
133
+ this.$emit("input", e.getHtml())
134
+ },
135
+ // 编辑器 focus 时的回调函数。
136
+ onFocus(e) {
137
+ this.$emit("onFocus", e)
138
+ },
139
+ // 编辑器 blur 时的回调函数。
140
+ onBlur(e) {
141
+ this.$emit("onBlur", e)
142
+ },
143
+ },
144
+ //组件销毁时,及时销毁编辑器
145
+ beforeDestroy() {
146
+ const editor = this.editor
147
+ if (editor == null) return
148
+ editor.destroy() // 组件销毁时,及时销毁编辑器
149
+ }
150
+ }
151
+ </script>
152
+
153
+ <style lang="scss" scoped>
154
+ .editor {
155
+ border: 1px solid #ccc;
156
+
157
+ .editor-toolbar {
158
+ border-bottom: 1px solid #ccc
159
+ }
160
+
161
+ .editor-content {
162
+ height: 500px;
163
+ overflow-y: hidden;
164
+ }
165
+ }
166
+ </style>
167
+
@@ -0,0 +1,49 @@
1
+ /**
2
+ * 重置产品介绍中图片地址
3
+ * @name getImgSrc
4
+ * */
5
+ export default function replaceUrl(htmlStr, url, preview = false) {
6
+ try {
7
+ const imgReg = /<img.*?(?:>|\/>)/gi // 匹配图片中的img标签
8
+ const videoReg = /<video(([\s\S])*?)<\/video>/gi // 匹配图片中的img标签
9
+ return htmlStr.replace(imgReg, (match, capture) => {
10
+ return resetString(match, preview ? "image" : "img", url)
11
+ }).replace(videoReg, (match, capture) => {
12
+ return resetString(match, "video", url)
13
+ });
14
+ } catch (e) {
15
+ //TODO handle the exception
16
+ return htmlStr;
17
+ }
18
+ }
19
+
20
+ // 替换文件预览地址
21
+ function resetString(match, type, url) {
22
+ const srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i // 匹配图片中的src
23
+ let srcStr = match.match(srcReg)
24
+ let params = getUrlParams(srcStr[1])
25
+ let isUpload = Object.keys(params).length > 0 && hasObject(params, "t")
26
+ let str = srcStr[1].slice(srcStr[1].indexOf('/admin-api'), srcStr[1].length)
27
+ let dome = match.replace(srcReg, `src="${url + str}"`)
28
+
29
+ if (isUpload) {
30
+ return type === 'image' ? dome.replace('img', `ed-image preview`) + '</ed-image>' : dome
31
+ } else {
32
+ return match
33
+ }
34
+ }
35
+
36
+ // 检测对象中是否包含指定字段
37
+ function hasObject(thisArg, ...argArray) {
38
+ return Object.prototype.hasOwnProperty.call(thisArg, ...argArray)
39
+ }
40
+
41
+ function getUrlParams(url) {
42
+ // \w+ 表示匹配至少一个(数字、字母及下划线), [\u4e00-\u9fa5]+ 表示匹配至少一个中文字符
43
+ let pattern = /(\w+|[\u4e00-\u9fa5]+)=(\w+|[\u4e00-\u9fa5]+)/ig;
44
+ let result = {};
45
+ url.replace(pattern, ($, $1, $2) => {
46
+ result[$1] = $2;
47
+ })
48
+ return result
49
+ }
@@ -0,0 +1,97 @@
1
+ <template>
2
+ <span>
3
+ <el-link type="primary" @click="openUploadClick">文件({{ list.length }})</el-link>
4
+ <ed-dialog ref="edDialog" :showOkBtn="false" :visible.sync="visible" title="预览" @close="visible = false">
5
+ <el-table :data="list" border>
6
+ <el-table-column label="文件名称" prop="name">
7
+ </el-table-column>
8
+ <el-table-column fixed="right" label="操作" width="100">
9
+ <template slot-scope="scope">
10
+ <el-button size="small" type="text" @click="preview(scope.row)">预览</el-button>
11
+ <el-button size="small" type="text" @click="uploadHandleDownload(scope.row)">下载</el-button>
12
+ </template>
13
+ </el-table-column>
14
+ </el-table>
15
+ </ed-dialog>
16
+ <ed-dialog ref="iframeDialog" :fullscreen="true" :showOkBtn="false" :title="title"
17
+ :visible.sync="iframeVisible" @close="iframeVisible = false">
18
+ <div v-loading="loading" style="height: 100%;">
19
+ <iframe ref="Iframe" :src="src" class="iframeClass" height="100%" width="100%"></iframe>
20
+ </div>
21
+ </ed-dialog>
22
+ </span>
23
+ </template>
24
+
25
+ <script>
26
+ import {getFileAccessHttpUrl, DefaultUrl } from "../../api/easyData";
27
+ import {encode} from "js-base64";
28
+
29
+ export default {
30
+ name: "FileView",
31
+ props: {
32
+ list: {
33
+ type: Array,
34
+ default: () => []
35
+ },
36
+ },
37
+ data() {
38
+ return {
39
+ visible: false,
40
+ iframeVisible: false,
41
+ src: '',
42
+ title: '',
43
+ loading: false,
44
+ }
45
+ },
46
+ methods: {
47
+ openUploadClick() {
48
+ this.visible = true
49
+ },
50
+ preview(cellValue) {
51
+ this.title = cellValue.name
52
+ let imageTypes = ['jpg', 'gif', 'jpeg', 'png']
53
+ const imageList = imageTypes.includes(cellValue.type) ? [{...cellValue, url: this._makeUrl(cellValue)}] : []
54
+ const fileUrl = !imageTypes.includes(cellValue.type) ? [this._makeUrl(cellValue)] : []
55
+ if (fileUrl.length > 0) {
56
+ this.src = this.$EdFrame.FILE_PREVIEW_URL + encodeURIComponent(encode(fileUrl.join('|')))
57
+ this.iframeVisible = true
58
+ this.$nextTick(() => this.iframeLoad())
59
+ } else if (imageList.length > 0) {
60
+ this.$viewerApi({images: imageList})
61
+ }
62
+ },
63
+ /**
64
+ * @name 文件下载
65
+ * @param file
66
+ * @description 新窗口打开
67
+ */
68
+ uploadHandleDownload(file) {
69
+ if (file.filePath) window.open(this._makeUrl(file))
70
+ },
71
+ /** 把file对象转换为下载url全地址 */
72
+ _makeUrl(file) {
73
+ return getFileAccessHttpUrl(DefaultUrl.downloadUrl + file.configId + "/get/" + file.filePath)
74
+ },
75
+ iframeLoad() {
76
+ this.loading = true;
77
+ const iframe = this.$refs.Iframe;
78
+ console.info(this.$refs, iframe)
79
+ if (iframe.attachEvent) { // IE
80
+ iframe.attachEvent('onload', () => {
81
+ this.loading = false;
82
+ });
83
+ } else { // 非IE
84
+ iframe.onload = () => {
85
+ this.loading = false;
86
+ };
87
+ }
88
+ }
89
+ }
90
+ }
91
+ </script>
92
+
93
+ <style scoped>
94
+ .iframeClass {
95
+ border: none;
96
+ }
97
+ </style>
@@ -0,0 +1,11 @@
1
+ import EasyDataView from './EasyDataView/EasyDataView.vue'
2
+ import EasyDataList from './EasyDataList/EasyDataList.vue'
3
+ import EasyDataTable from './EasyDataTable/EasyDataTable.vue'
4
+ import EasyDataForm from './EasyDataForm/EasyDataForm.vue'
5
+
6
+ export const packages = {
7
+ EasyDataView,
8
+ EasyDataList,
9
+ EasyDataForm,
10
+ EasyDataTable,
11
+ }
@@ -0,0 +1,133 @@
1
+ import { getVarType } from "../../utils/utils";
2
+ import useTable from "./useTable"
3
+ import {initControls, TempType} from "../../api/easyData";
4
+ export default {
5
+ mixins: [useTable],
6
+ data(){
7
+ return {
8
+ initLoading: false,
9
+ controlInfos: [],
10
+ controlProps: {},
11
+ dataSource: {},
12
+ }
13
+ },
14
+ props: {
15
+ /**
16
+ * 数据源名称
17
+ * @default ''
18
+ */
19
+ dataSourceName: {type: String, default: ''},
20
+ /**
21
+ * 视图ID,用于显示不同视图
22
+ * @default 'default'
23
+ */
24
+ viewId: {type: String, default: 'default'},
25
+ /**
26
+ * 业务请求参数,仅模板使用
27
+ * @default {}
28
+ */
29
+ bizParams: {type: Object, default: () => {}},
30
+ /**
31
+ * 表单数据默认值,新增接口提交数据会自动带上
32
+ * @default {}
33
+ */
34
+ formData: {type: [Array, Object], default: () => {}},
35
+ /**
36
+ * 额外请求参数,仅模板使用
37
+ * @default {}
38
+ */
39
+ extraParams: {type: Object, default: () => {}},
40
+ /**
41
+ * 数据源传递
42
+ * @default []
43
+ */
44
+ passModuleIds: {type: Array, default: () => []},
45
+ /**
46
+ * 模块属性 模块使用自定义属性
47
+ * @default {}
48
+ */
49
+ moduleProp: {
50
+ type: Object,
51
+ default: () => {
52
+ return {
53
+ showAddBtn: false,
54
+ showAction: false
55
+ }
56
+ }
57
+ }
58
+ },
59
+ methods:{
60
+ /**
61
+ * 初始化表单模板数据
62
+ * @returns {Promise<void>}
63
+ */
64
+ initControls() {
65
+ return new Promise(async (resolve, reject) => {
66
+ this.initLoading = true
67
+ try {
68
+ const result = await initControls(this.dataSourceName, this.viewId)
69
+ const {data: {controlInfos, controlPropsMap, dataSource}} = result;
70
+ this.controlInfos = this.getControlInfo(controlInfos)
71
+ this.controlProps = controlPropsMap
72
+ this.dataSource = dataSource
73
+
74
+ resolve({
75
+ dataSource: dataSource,
76
+ controlProps: controlPropsMap,
77
+ controlInfos: controlInfos
78
+ })
79
+ }catch (e) {
80
+ reject(e)
81
+ }
82
+ this.initLoading = false
83
+ })
84
+ },
85
+
86
+ /**
87
+ * @name getControlInfo
88
+ * @param controlInfos
89
+ * @returns {*}
90
+ * @description 获取表单控件属性
91
+ */
92
+ getControlInfo(controlInfos) {
93
+ this.$emit('editControlInfos', controlInfos)
94
+ return controlInfos
95
+ },
96
+
97
+ /**
98
+ * 获取当前模板类型
99
+ * @returns
100
+ */
101
+ getType(){
102
+ return TempType.save
103
+ },
104
+
105
+ /** 获取指定二级模块数据,或者所有需要的二级模块数据 */
106
+ getPassModuleData(moduleId = this.passModuleIds) {
107
+ if(moduleId && this._tempV) {
108
+ if(getVarType(moduleId) === 'string') {
109
+ return this._tempV.getFormData(moduleId)
110
+ } else if (getVarType(moduleId) === 'array' && moduleId.length > 0) {
111
+ let PromiseAll = []
112
+ moduleId.map(item=>{
113
+ PromiseAll.push(this._tempV.getFormData(item))
114
+ })
115
+ return new Promise((resolve, reject) => {
116
+ Promise.all(PromiseAll).then(data => {
117
+ resolve(data)
118
+ }).catch(err => {
119
+ console.log(err)
120
+ reject(false)
121
+ })
122
+ })
123
+ }
124
+ }
125
+ return new Promise((resolve, reject) => {resolve({})})
126
+ },
127
+
128
+ // 检测对象中是否包含指定字段
129
+ hasObject(thisArg, ...argArray){
130
+ return Object.prototype.hasOwnProperty.call(thisArg, ...argArray)
131
+ },
132
+ }
133
+ }