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,588 @@
1
+ import md5 from 'md5'
2
+ import Vue from "vue";
3
+
4
+ const Event = new Vue();
5
+ // Event.$emit(事件名,数据); // 使用 $emit 来传递
6
+ // Event.$on(事件名,data => {}); // 使用 $on 来接收
7
+
8
+ /**
9
+ * @name setBusEvent
10
+ * @param event
11
+ * @param value
12
+ * @description 设置bus总线,记录数据
13
+ */
14
+ export function setBusEvent(event, value) {
15
+ try {
16
+ Event.$emit(event, value)
17
+ } catch (e) {
18
+ console.log(e)
19
+ }
20
+ }
21
+
22
+ /**
23
+ * @name getBusEvent
24
+ * @returns {Promise<unknown>}
25
+ * @description 获取bus数据
26
+ * @param key
27
+ */
28
+ export function getBusEvent(key) {
29
+ return new Promise((resolve, reject) => {
30
+ try {
31
+ console.log(key)
32
+ Event.$on(key, data => {
33
+ console.log(key, data)
34
+ resolve(data)
35
+ })
36
+ } catch (e) {
37
+ console.log(e)
38
+ reject(e)
39
+ }
40
+ })
41
+ }
42
+
43
+ /**
44
+ * 获取变量数据类型,包括ES6 新类型Symbol
45
+ * @param n
46
+ * @returns {string}
47
+ */
48
+ export function getVarType(n) {
49
+ const typeStr = Object.prototype.toString.call(n);
50
+ let typeName = '';
51
+ switch (typeStr) {
52
+ case '[object String]':
53
+ typeName = 'string';
54
+ break;
55
+ case '[object Number]':
56
+ typeName = 'number';
57
+ break;
58
+ case '[object Boolean]':
59
+ typeName = 'boolean';
60
+ break;
61
+ case '[object Undefined]':
62
+ typeName = 'undefined';
63
+ break;
64
+
65
+ case '[object Object]':
66
+ typeName = 'object';
67
+ break;
68
+ case '[object Array]':
69
+ typeName = 'array';
70
+ break;
71
+ case '[object Null]':
72
+ typeName = 'null';
73
+ break;
74
+ case '[object RegExp]':
75
+ typeName = 'RegExp';
76
+ break;
77
+
78
+ case '[object Symbol]':
79
+ typeName = 'symbol';
80
+ break;
81
+ case '[object JSON]':
82
+ typeName = 'json';
83
+ break;
84
+ case '[object Math]':
85
+ typeName = 'math';
86
+ break;
87
+
88
+ default:
89
+ typeName = 'object';
90
+ }
91
+
92
+ return typeName;
93
+ }
94
+
95
+ /**
96
+ * 随机生成数字
97
+ * 示例:生成长度为 12 的随机数:randomNumber(12)
98
+ * 示例:生成 3~23 之间的随机数:randomNumber(3, 23)
99
+ *
100
+ * @param1 最小值 | 长度
101
+ * @param2 最大值
102
+ * @return int 生成后的数字
103
+ */
104
+ export function randomNumber() {
105
+ // 生成 最小值 到 最大值 区间的随机数
106
+ const random = (min, max) => {
107
+ return Math.floor(Math.random() * (max - min + 1) + min)
108
+ }
109
+ if (arguments.length === 1) {
110
+ let [length] = arguments
111
+ // 生成指定长度的随机数字,首位一定不是 0
112
+ let nums = [...Array(length).keys()].map((i) => (i > 0 ? random(0, 9) : random(1, 9)))
113
+ return parseInt(nums.join(''))
114
+ } else if (arguments.length >= 2) {
115
+ let [min, max] = arguments
116
+ return random(min, max)
117
+ } else {
118
+ return Number.NaN
119
+ }
120
+ }
121
+
122
+ /**
123
+ * 随机生成字符串
124
+ * @param length 字符串的长度
125
+ * @param chats 可选字符串区间(只会生成传入的字符串中的字符)
126
+ * @return string 生成的字符串
127
+ */
128
+ export function randomString(length, chats) {
129
+ if (!length) length = 1
130
+ if (!chats) chats = '0123456789qwertyuioplkjhgfdsazxcvbnm'
131
+ let str = ''
132
+ for (let i = 0; i < length; i++) {
133
+ let num = randomNumber(0, chats.length - 1)
134
+ str += chats[num]
135
+ }
136
+ return str
137
+ }
138
+
139
+ /**
140
+ * 随机生成uuid
141
+ * @name randomUUID
142
+ * @return string 生成的uuid
143
+ */
144
+ export function randomUUID() {
145
+ let chats = '0123456789abcdef'
146
+ return randomString(32, chats)
147
+ }
148
+
149
+ export function getLength(object) {
150
+ let count = 0;
151
+ for (let i in object) count++;
152
+ return count;
153
+ }
154
+
155
+ export function CompareObj(objA, objB, flag) {
156
+ for (let key in objA) {
157
+ if (!flag) //跳出整个循环
158
+ break;
159
+ if (!objB.hasOwnProperty(key)) {
160
+ flag = false;
161
+ break;
162
+ }
163
+ if (getVarType(objA[key]) !== 'array') { //子级不是数组时,比较属性值
164
+ if (objB[key] != objA[key]) {
165
+ flag = false;
166
+ break;
167
+ }
168
+ } else {
169
+ if (getVarType(objA[key]) !== 'array') {
170
+ flag = false;
171
+ break;
172
+ }
173
+ let oA = objA[key],
174
+ oB = objB[key];
175
+ if (oA.length != oB.length) {
176
+ flag = false;
177
+ break;
178
+ }
179
+ for (let k in oA) {
180
+ if (!flag) //这里跳出循环是为了不让递归继续
181
+ break;
182
+ flag = CompareObj(oA[k], oB[k], flag);
183
+ }
184
+ }
185
+ }
186
+ return flag;
187
+ }
188
+
189
+ export function Compare(objA, objB) {
190
+ if (getVarType(objA) !== 'object' || getVarType(objB) !== 'object') return false; //判断类型是否正确
191
+ if (getLength(objA) !== getLength(objB)) return false; //判断长度是否一致
192
+ return CompareObj(objA, objB, true); //默认为true
193
+ }
194
+
195
+
196
+ export function underlineToHumpJson(json) {
197
+ if (json) {
198
+ let result = {}
199
+ Object.keys(json).forEach((key) => {
200
+ result[underlineToHump(key)] = json[key]
201
+ })
202
+ return result
203
+ }
204
+ return json
205
+ }
206
+
207
+ export function underlineToHump(s) {
208
+ if (s.indexOf("_") > 0) {
209
+ let a = s.split("_");
210
+ let result = a[0];
211
+ for (let i = 1; i < a.length; i++) {
212
+ result = result + a[i].slice(0, 1).toUpperCase() + a[i].slice(1);
213
+ }
214
+ return result
215
+ } else {
216
+ return s
217
+ }
218
+ }
219
+
220
+ export function humpToUnderline(str) {
221
+ return str.replace(/([A-Z])/g, "_$1").toLowerCase()
222
+ }
223
+
224
+ /**
225
+ * 加签
226
+ * @param params
227
+ */
228
+ export function sign(params) {
229
+ if (params) {
230
+ let signArray = ''
231
+ for (let param in params) {
232
+ if (param === 'page' || param === 'createTime' || param === 'updateTime' || param === 'keyInfoObject' || param === 'dataInfoArray') {
233
+ continue
234
+ }
235
+
236
+ let value = params[param]
237
+ if (value != null) {
238
+ value = JSON.stringify(value)
239
+ value = value.replace(/{/g, "")
240
+ value = value.replace(/}/g, "")
241
+ value = value.replace("[", "")
242
+ value = value.replace(/,/g, "")
243
+ value = value.replace("]", "")
244
+ value = value.replace(/,/g, "")
245
+ value = value.replace(/['"]+/g, "")
246
+ if (value != null && value !== '') {
247
+ signArray += value
248
+ }
249
+ }
250
+ }
251
+ params.signature = md5(quick_sort(signArray).join(""))
252
+ }
253
+ return params
254
+ }
255
+
256
+
257
+ export function quick_sort(arr) {
258
+ var arry1, arry2, mid;
259
+
260
+ if (arr.length < 2) return arr;
261
+ else if (arr.length === 2)
262
+ if (arr[0] > arr[1])
263
+ return arr.reverse();
264
+ else
265
+ return arr;
266
+ else {
267
+ arry1 = [];
268
+ arry2 = [];
269
+ mid = arr[0];
270
+ for (var i = 1; i < arr.length; i++) {
271
+ if (arr[i] < mid)
272
+ arry1.push(arr[i]);
273
+ else
274
+ arry2.push(arr[i]);
275
+ }
276
+ }
277
+ return (quick_sort(arry1).concat(mid, quick_sort(arry2)));
278
+ }
279
+
280
+
281
+ /**
282
+ * @param {*} url 文件下载地址
283
+ * @param {*} name 文件名称
284
+ */
285
+ export const downloadFile = async ({url, name}) => {
286
+ let urlBlob = await urlToBlob(url)
287
+ let link = document.createElement('a');
288
+ if (link.download !== undefined) {
289
+ let uri = URL.createObjectURL(urlBlob);
290
+ link.setAttribute('href', uri);
291
+ link.setAttribute('download', name);
292
+ link.style.visibility = 'hidden';
293
+ document.body.appendChild(link);
294
+ link.click();
295
+ document.body.removeChild(link);
296
+ }
297
+ }
298
+
299
+ // url 转bolb
300
+ function urlToBlob(the_url) {
301
+ return new Promise((resolve, reject) => {
302
+ let xhr = new XMLHttpRequest();
303
+ xhr.open('get', the_url, true);
304
+ xhr.responseType = 'blob';
305
+ xhr.onload = (res) => {
306
+ if (res.target.status === 200) {
307
+ resolve(res.target.response);
308
+ } else {
309
+ reject(res)
310
+ }
311
+ };
312
+ xhr.send();
313
+ })
314
+ }
315
+ /**
316
+ * 初始化数据源控件
317
+ * @return {Object|Array}
318
+ * @param record
319
+ */
320
+ export function convertToViewModelOld(record) {
321
+ if (record instanceof Array) {
322
+ let newRecords = []
323
+ record.map((r) => newRecords.push(initViewModelRecord(r)))
324
+ return newRecords
325
+ } else {
326
+ return initViewModelRecord(record)
327
+ }
328
+ }
329
+
330
+ /**
331
+ * 初始化数据源控件
332
+ * @return {Object|Array}
333
+ * @param record 代转换对象
334
+ * @param deleteVirtualJson 是否删除虚拟列映射的前端json 包括:keyInfoObject、keyInfoView、dataInfoView
335
+ * @param deleteVirtual 是否删除虚拟列属性,即只要viewModel对象需要的属性
336
+ */
337
+ export function convertToViewModel(record, deleteVirtual = false, deleteVirtualJson = false) {
338
+ if (record instanceof Array) {
339
+ let newRecords = []
340
+ record.map((r) => {
341
+ newRecords.push(initViewModelRecord(r, deleteVirtual, deleteVirtualJson))
342
+ })
343
+ return newRecords
344
+ } else {
345
+ return initViewModelRecord(record, deleteVirtual, deleteVirtualJson)
346
+ }
347
+ }
348
+
349
+
350
+
351
+
352
+ /**
353
+ * @name initViewModelRecord
354
+ * @param record
355
+ * @return {*}
356
+ */
357
+ function initViewModelRecord(record, deleteVirtual = false, deleteVirtualJson = false) {
358
+ let newRecord = Object.assign({}, record)
359
+
360
+ if(deleteVirtual) {
361
+ let {id, dataSourceName, createTime, updateTime, keyInfo,
362
+ dataInfo, deleted, tenantId, updater, creator, orgId, orgCode} = record
363
+ newRecord = {
364
+ id, dataSourceName, createTime, updateTime, keyInfo,
365
+ dataInfo, deleted, tenantId, updater, creator, orgId, orgCode
366
+ }
367
+ }
368
+ if(deleteVirtualJson) {
369
+ delete newRecord.keyInfoObject
370
+ delete newRecord.keyInfoView
371
+ delete newRecord.dataInfoView
372
+ }
373
+
374
+ if (newRecord.keyInfo) {
375
+ if (typeof newRecord.keyInfo == 'string') {
376
+ newRecord.keyInfo = JSON.parse(newRecord.keyInfo)
377
+ }
378
+ newRecord.key = Object.assign(newRecord.keyInfo)
379
+ newRecord.keyInfo = ''
380
+ }
381
+ if (newRecord.dataInfo) {
382
+ if (typeof newRecord.dataInfo == 'string') {
383
+ newRecord.dataInfo = JSON.parse(newRecord.dataInfo)
384
+ }
385
+ newRecord.data = Object.assign(newRecord.dataInfo)
386
+ newRecord.dataInfo = ''
387
+ }
388
+ return newRecord
389
+ }
390
+
391
+ /**
392
+ * 初始化数据源控件
393
+ * @return Control
394
+ * @param record
395
+ */
396
+ export function convertToModel(record) {
397
+ let newRecord = Object.assign({}, record)
398
+ if (newRecord.keyInfo) {
399
+ if (typeof newRecord.keyInfo == 'string') {
400
+ newRecord.keyInfo = JSON.parse(newRecord.keyInfo)
401
+ }
402
+ }
403
+ if (newRecord.dataInfo) {
404
+ if (typeof newRecord.dataInfo == 'string') {
405
+ newRecord.dataInfo = JSON.parse(newRecord.dataInfo)
406
+ }
407
+ }
408
+ return newRecord
409
+ }
410
+
411
+ /**
412
+ * @name equal
413
+ * @param a
414
+ * @param b
415
+ * @return {boolean}
416
+ * @description ES6 Map、Set和Typed阵列支持的最快深度对等。
417
+ */
418
+ export function equal(a, b) {
419
+ if (a === b) return true;
420
+
421
+ if (a && b && typeof a == 'object' && typeof b == 'object') {
422
+ if (a.constructor !== b.constructor) return false;
423
+
424
+ let length, i, keys;
425
+ if (Array.isArray(a)) {
426
+ length = a.length;
427
+ if (length != b.length) return false;
428
+ for (i = length; i-- !== 0;)
429
+ if (!equal(a[i], b[i])) return false;
430
+ return true;
431
+ }
432
+
433
+
434
+ if ((a instanceof Map) && (b instanceof Map)) {
435
+ if (a.size !== b.size) return false;
436
+ for (i of a.entries())
437
+ if (!b.has(i[0])) return false;
438
+ for (i of a.entries())
439
+ if (!equal(i[1], b.get(i[0]))) return false;
440
+ return true;
441
+ }
442
+
443
+ if ((a instanceof Set) && (b instanceof Set)) {
444
+ if (a.size !== b.size) return false;
445
+ for (i of a.entries())
446
+ if (!b.has(i[0])) return false;
447
+ return true;
448
+ }
449
+
450
+ if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
451
+ length = a.length;
452
+ if (length !== b.length) return false;
453
+ for (i = length; i-- !== 0;)
454
+ if (a[i] !== b[i]) return false;
455
+ return true;
456
+ }
457
+
458
+
459
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
460
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
461
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
462
+
463
+ keys = Object.keys(a);
464
+ length = keys.length;
465
+ if (length !== Object.keys(b).length) return false;
466
+
467
+ for (i = length; i-- !== 0;)
468
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
469
+
470
+ for (i = length; i-- !== 0;) {
471
+ let key = keys[i];
472
+ if (!equal(a[key], b[key])) return false;
473
+ }
474
+
475
+ return true;
476
+ }
477
+
478
+ // true if both NaN, false otherwise
479
+ return a!==a && b!==b;
480
+ }
481
+
482
+
483
+ // 深度克隆
484
+ export function deepClone(obj) {
485
+ // 对常见的“非”值,直接返回原来值
486
+ if ([null, undefined, NaN, false].includes(obj)) return obj
487
+ if (typeof obj !== 'object' && typeof obj !== 'function') {
488
+ // 原始类型直接返回
489
+ return obj
490
+ }
491
+ const o = getVarType(obj) === 'array' ? [] : {}
492
+ for (const i in obj) {
493
+ if (obj.hasOwnProperty(i)) {
494
+ o[i] = typeof obj[i] === 'object' ? deepClone(obj[i]) : obj[i]
495
+ }
496
+ }
497
+ return o
498
+ }
499
+
500
+ // JS对象深度合并
501
+ export function deepMerge(target = {}, source = {}) {
502
+ target = deepClone(target)
503
+ if (typeof target !== 'object' || typeof source !== 'object') return false
504
+ for (const prop in source) {
505
+ if (!source.hasOwnProperty(prop)) continue
506
+ if (prop in target) {
507
+ if (typeof target[prop] !== 'object') {
508
+ target[prop] = source[prop]
509
+ } else if (typeof source[prop] !== 'object') {
510
+ target[prop] = source[prop]
511
+ } else if (target[prop].concat && source[prop].concat) {
512
+ target[prop] = target[prop].concat(source[prop])
513
+ } else {
514
+ target[prop] = deepMerge(target[prop], source[prop])
515
+ }
516
+ } else {
517
+ target[prop] = source[prop]
518
+ }
519
+ }
520
+ return target
521
+ }
522
+
523
+ /**
524
+ * @name getVarType
525
+ * @param jsonData
526
+ * @param pathArr
527
+ * @returns {*}
528
+ * @description 获取json值, 可使用prototype
529
+ */
530
+ export function getValueByKey(jsonData, pathArr){
531
+ if(pathArr.includes('.')){
532
+ let keyArr = pathArr.split('.')
533
+ let value = jsonData
534
+ for (const i in keyArr) {
535
+ value = jsonData[keyArr[i]]
536
+ }
537
+ return value
538
+ }
539
+ else {
540
+ return jsonData[pathArr]
541
+ }
542
+ }
543
+
544
+ /**
545
+ * 判断元素是否是 VNode对象
546
+ * @param _this
547
+ * @param node
548
+ * @return {boolean}
549
+ */
550
+ export function isVNode(_this, node){
551
+ // 获取 vnode 实例
552
+ const vnode = _this.$createElement('span', '')
553
+ // VNode 构造函数
554
+ const VNode = vnode.constructor;
555
+ // 所以通过 obj instanceof VNode 即可判断
556
+ return node instanceof VNode
557
+ }
558
+
559
+
560
+ /**
561
+ * 获取字段名
562
+ * getPath('key.name') ==> "name"
563
+ * @param string
564
+ * @return {*|string}
565
+ */
566
+ export function getPath(string) {
567
+ /** Used to match property names within property paths. */
568
+ const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
569
+
570
+ /** Used to match backslashes in property paths. */
571
+ const reEscapeChar = /\\(\\)?/g;
572
+
573
+ /**
574
+ * Converts `string` to a property path array.
575
+ *
576
+ * @private
577
+ * @param {string} string The string to convert.
578
+ * @returns {Array} Returns the property path array.
579
+ */
580
+ const result = [];
581
+ if (string.charCodeAt(0) === 46 /* . */) {
582
+ result.push('');
583
+ }
584
+ string.replace(rePropName, function (match, number, quote, subString) {
585
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
586
+ });
587
+ return result.length !== 0 ? result[result.length - 1] : ''
588
+ }
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "simple-frame-unit",
3
+ "version": "1.0.2",
4
+ "description": "基于vue2 研发的与simple-data后端配合使用的组件",
5
+ "private": false,
6
+ "scripts": {
7
+ "serve-dev": "vue-cli-service serve --mode dev",
8
+ "serve-local": "vue-cli-service serve --mode local",
9
+ "build": "vue-cli-service build",
10
+ "build:lib": "vue-cli-service build --target lib --name ed-frame-vue --dest ./dist/ lib/index.js",
11
+ "lint": "vue-cli-service lint",
12
+ "release": "standard-version",
13
+ "preserve": "npm run-script easydata",
14
+ "easydata": "node import.easydata.js",
15
+ "push": "git push",
16
+ "pub": "npm run build:lib && npm run release && npm publish && npm run push"
17
+ },
18
+ "main": "lib/index.js",
19
+ "browser": "dist/ed-frame-vue.umd.min.js",
20
+ "dependencies": {
21
+ "core-js": "^3.6.5",
22
+ "html2canvas": "^1.4.1",
23
+ "js-base64": "^3.7.5",
24
+ "jspdf": "^2.5.1",
25
+ "lodash": "^4.17.21",
26
+ "md5": "^2.3.0",
27
+ "standard-version": "^7.0.0",
28
+ "vuedraggable": "^2.24.3"
29
+ },
30
+ "devDependencies": {
31
+ "@riophae/vue-treeselect": "0.4.0",
32
+ "@vue/cli-plugin-babel": "~4.5.15",
33
+ "@vue/cli-plugin-eslint": "~4.5.15",
34
+ "@vue/cli-service": "~4.5.15",
35
+ "axios": "^1.5.1",
36
+ "babel-eslint": "^10.1.0",
37
+ "ed-base-vue": "^1.0.72",
38
+ "element-ui": "2.15.10",
39
+ "eslint": "^6.7.2",
40
+ "eslint-plugin-vue": "^6.2.2",
41
+ "sass": "1.3.0",
42
+ "sass-loader": "10.2.0",
43
+ "standard-version": "^7.0.0",
44
+ "v-viewer": "^1.6.4",
45
+ "vue": "^2.6.11",
46
+ "vue-router": "3.6.5",
47
+ "vue-template-compiler": "^2.6.11"
48
+ },
49
+ "eslintConfig": {
50
+ "root": true,
51
+ "env": {
52
+ "node": true
53
+ },
54
+ "extends": [
55
+ "plugin:vue/essential",
56
+ "eslint:recommended"
57
+ ],
58
+ "parserOptions": {
59
+ "parser": "babel-eslint"
60
+ },
61
+ "rules": {
62
+ "no-unused-vars": "off",
63
+ "space-before-function-paren": "off"
64
+ }
65
+ },
66
+ "browserslist": [
67
+ "> 1%",
68
+ "last 2 versions",
69
+ "not dead"
70
+ ],
71
+ "keywords": [
72
+ "easy-data",
73
+ "easydata"
74
+ ],
75
+ "__npminstall_done": true,
76
+ "_from": "ed-frame-vue@1.0.0"
77
+ }
package/src/App.vue ADDED
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <div id="app">
3
+ <router-view></router-view>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'app',
10
+ };
11
+ </script>
12
+ <style></style>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file