sohelp-eleplus 1.1.1-8.beta.1
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 +35 -0
- package/cache/DictCache.js +58 -0
- package/cache/ModuleCache.js +322 -0
- package/components.js +46 -0
- package/core-export.js +4 -0
- package/http/CrudHttp.js +115 -0
- package/http/DictHttp.js +12 -0
- package/http/ModuleHttp.js +68 -0
- package/http/SohelpHttp.js +125 -0
- package/index.js +6 -0
- package/installer.js +8 -0
- package/lang/en_US.js +4 -0
- package/lang/zh_CN.js +4 -0
- package/lang/zh_TW.js +4 -0
- package/package.json +9 -0
- package/sohelp-ace-editor/index.vue +198 -0
- package/sohelp-application-select/index.vue +15 -0
- package/sohelp-autocode/index.vue +53 -0
- package/sohelp-calendar-view/index.vue +11 -0
- package/sohelp-card-view/index.vue +11 -0
- package/sohelp-condition/index.vue +210 -0
- package/sohelp-cry-input/index.vue +64 -0
- package/sohelp-date/index.vue +27 -0
- package/sohelp-datetime/index.vue +44 -0
- package/sohelp-datetime-picker/index.vue +86 -0
- package/sohelp-datetime-range/index.vue +59 -0
- package/sohelp-dict/index.vue +206 -0
- package/sohelp-dict/props.js +68 -0
- package/sohelp-drawer/index.vue +50 -0
- package/sohelp-drop-card/index.vue +94 -0
- package/sohelp-drop-card/props.js +68 -0
- package/sohelp-dyn-select/index.vue +99 -0
- package/sohelp-dyn-select/props.js +67 -0
- package/sohelp-dyn-tree/index.vue +82 -0
- package/sohelp-dyn-tree-select/index.vue +114 -0
- package/sohelp-entity-form/index.vue +524 -0
- package/sohelp-entity-grid/index.vue +30 -0
- package/sohelp-file-upload/index.vue +218 -0
- package/sohelp-filter-scheme/components/condition.vue +102 -0
- package/sohelp-filter-scheme/components/filter.vue +45 -0
- package/sohelp-filter-scheme/components/keywords.vue +15 -0
- package/sohelp-filter-scheme/components/scheme.vue +49 -0
- package/sohelp-filter-scheme/index.vue +113 -0
- package/sohelp-grid/SohelpGridConfig.js~ +408 -0
- package/sohelp-grid/components/filter-condition-item.vue +298 -0
- package/sohelp-grid/index.vue +1965 -0
- package/sohelp-grid/js/ConditionType.js +101 -0
- package/sohelp-grid/js/DefaultGridOptions.js +145 -0
- package/sohelp-grid/js/DefaultProps.js +27 -0
- package/sohelp-grid/js/SohelpConfigFunction.js +0 -0
- package/sohelp-grid/js/SohelpGridConfig.js +101 -0
- package/sohelp-grid/js/useSohelpGridConfig.js +525 -0
- package/sohelp-grid-select/index.vue +245 -0
- package/sohelp-grid-view/filter/config/grid-filter-condition.vue +221 -0
- package/sohelp-grid-view/filter/config/grid-filter-config.vue +27 -0
- package/sohelp-grid-view/filter/config/grid-filter-field.vue +378 -0
- package/sohelp-grid-view/filter/config/grid-filter-keywords.vue +310 -0
- package/sohelp-grid-view/filter/config/grid-filter-list.vue +313 -0
- package/sohelp-grid-view/filter/config/grid-filter-scheme.vue +264 -0
- package/sohelp-grid-view/filter/config/grid-filter-sort.vue +310 -0
- package/sohelp-grid-view/filter/config/index.vue +206 -0
- package/sohelp-grid-view/filter/filter-form.vue +446 -0
- package/sohelp-grid-view/filter/filter-toolbar.vue +110 -0
- package/sohelp-grid-view/filter/index.vue +160 -0
- package/sohelp-grid-view/index.vue +379 -0
- package/sohelp-grid-view-select/index.vue +141 -0
- package/sohelp-group-view/index.vue +11 -0
- package/sohelp-icon-select/icons/AnalysisOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ApplicationOutlined.vue +21 -0
- package/sohelp-icon-select/icons/AppstoreAddOutlined.vue +28 -0
- package/sohelp-icon-select/icons/AppstoreOutlined.vue +30 -0
- package/sohelp-icon-select/icons/ArrowDown.vue +21 -0
- package/sohelp-icon-select/icons/ArrowDownOutlined.vue +20 -0
- package/sohelp-icon-select/icons/ArrowLeft.vue +21 -0
- package/sohelp-icon-select/icons/ArrowLeftOutlined.vue +20 -0
- package/sohelp-icon-select/icons/ArrowRight.vue +21 -0
- package/sohelp-icon-select/icons/ArrowRightOutlined.vue +20 -0
- package/sohelp-icon-select/icons/ArrowUp.vue +21 -0
- package/sohelp-icon-select/icons/ArrowUpOutlined.vue +20 -0
- package/sohelp-icon-select/icons/BellOutlined.vue +21 -0
- package/sohelp-icon-select/icons/BookOutlined.vue +21 -0
- package/sohelp-icon-select/icons/CalendarOutlined.vue +19 -0
- package/sohelp-icon-select/icons/CaretDownFilled.vue +13 -0
- package/sohelp-icon-select/icons/CaretUpFilled.vue +13 -0
- package/sohelp-icon-select/icons/CheckCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/CheckCircleOutlined.vue +23 -0
- package/sohelp-icon-select/icons/CheckOutlined.vue +20 -0
- package/sohelp-icon-select/icons/CityOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ClockCircleOutlined.vue +23 -0
- package/sohelp-icon-select/icons/CloseCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/CloseCircleOutlined.vue +22 -0
- package/sohelp-icon-select/icons/CloseOutlined.vue +20 -0
- package/sohelp-icon-select/icons/CloudUploadOutlined.vue +23 -0
- package/sohelp-icon-select/icons/ClusterOutlined.vue +21 -0
- package/sohelp-icon-select/icons/CodeOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ColumnHeightOutlined.vue +18 -0
- package/sohelp-icon-select/icons/CompassOutlined.vue +22 -0
- package/sohelp-icon-select/icons/CompressOutlined.vue +23 -0
- package/sohelp-icon-select/icons/ConnectionOutlined.vue +24 -0
- package/sohelp-icon-select/icons/ControlOutlined.vue +27 -0
- package/sohelp-icon-select/icons/CopyOutlined.vue +22 -0
- package/sohelp-icon-select/icons/CpuOutlined.vue +22 -0
- package/sohelp-icon-select/icons/DashboardOutlined.vue +26 -0
- package/sohelp-icon-select/icons/DatabaseOutlined.vue +22 -0
- package/sohelp-icon-select/icons/DeleteOutlined.vue +22 -0
- package/sohelp-icon-select/icons/DesktopOutlined.vue +19 -0
- package/sohelp-icon-select/icons/DownloadOutlined.vue +21 -0
- package/sohelp-icon-select/icons/DragOutlined.vue +22 -0
- package/sohelp-icon-select/icons/EditOutlined.vue +21 -0
- package/sohelp-icon-select/icons/EllipsisOutlined.vue +15 -0
- package/sohelp-icon-select/icons/EnvironmentOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ExclamationCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/ExpandOutlined.vue +23 -0
- package/sohelp-icon-select/icons/FileOutlined.vue +22 -0
- package/sohelp-icon-select/icons/FilterFilled.vue +15 -0
- package/sohelp-icon-select/icons/FolderAddOutlined.vue +20 -0
- package/sohelp-icon-select/icons/FolderOutlined.vue +19 -0
- package/sohelp-icon-select/icons/FormOutlined.vue +20 -0
- package/sohelp-icon-select/icons/FullscreenExitOutlined.vue +16 -0
- package/sohelp-icon-select/icons/FullscreenOutlined.vue +16 -0
- package/sohelp-icon-select/icons/FundOutlined.vue +20 -0
- package/sohelp-icon-select/icons/GlobalOutlined.vue +15 -0
- package/sohelp-icon-select/icons/HolderOutlined.vue +18 -0
- package/sohelp-icon-select/icons/HomeOutlined.vue +19 -0
- package/sohelp-icon-select/icons/IdcardOutlined.vue +25 -0
- package/sohelp-icon-select/icons/InfoCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/LinkOutlined.vue +15 -0
- package/sohelp-icon-select/icons/LoadingDotOutlined.vue +21 -0
- package/sohelp-icon-select/icons/LoadingOutlined.vue +19 -0
- package/sohelp-icon-select/icons/LockOutlined.vue +21 -0
- package/sohelp-icon-select/icons/LogOutlined.vue +22 -0
- package/sohelp-icon-select/icons/LogoutOutlined.vue +22 -0
- package/sohelp-icon-select/icons/MailOutlined.vue +19 -0
- package/sohelp-icon-select/icons/MenuFoldOutlined.vue +17 -0
- package/sohelp-icon-select/icons/MenuUnfoldOutlined.vue +17 -0
- package/sohelp-icon-select/icons/MessageOutlined.vue +22 -0
- package/sohelp-icon-select/icons/MinusCircleOutlined.vue +22 -0
- package/sohelp-icon-select/icons/MobileOutlined.vue +20 -0
- package/sohelp-icon-select/icons/MoonOutlined.vue +21 -0
- package/sohelp-icon-select/icons/MoreOutlined.vue +15 -0
- package/sohelp-icon-select/icons/PauseFilled.vue +14 -0
- package/sohelp-icon-select/icons/PieChartOutlined.vue +20 -0
- package/sohelp-icon-select/icons/PlayFilled.vue +13 -0
- package/sohelp-icon-select/icons/PlusCircleOutlined.vue +22 -0
- package/sohelp-icon-select/icons/PlusOutlined.vue +19 -0
- package/sohelp-icon-select/icons/ProtectOutlined.vue +21 -0
- package/sohelp-icon-select/icons/QuestionCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/QuestionCircleOutlined.vue +25 -0
- package/sohelp-icon-select/icons/ReloadOutlined.vue +22 -0
- package/sohelp-icon-select/icons/SearchOutlined.vue +21 -0
- package/sohelp-icon-select/icons/SettingOutlined.vue +24 -0
- package/sohelp-icon-select/icons/ShoppingOutlined.vue +19 -0
- package/sohelp-icon-select/icons/SortOutlined.vue +21 -0
- package/sohelp-icon-select/icons/StarFilled.vue +15 -0
- package/sohelp-icon-select/icons/StepBackwardFilled.vue +17 -0
- package/sohelp-icon-select/icons/StepForwardFilled.vue +17 -0
- package/sohelp-icon-select/icons/SuitcaseOutlined.vue +19 -0
- package/sohelp-icon-select/icons/SunOutlined.vue +29 -0
- package/sohelp-icon-select/icons/SwapOutlined.vue +21 -0
- package/sohelp-icon-select/icons/SyncOutlined.vue +21 -0
- package/sohelp-icon-select/icons/TableOutlined.vue +19 -0
- package/sohelp-icon-select/icons/TagOutlined.vue +20 -0
- package/sohelp-icon-select/icons/TimerOutlined.vue +22 -0
- package/sohelp-icon-select/icons/UndoOutlined.vue +22 -0
- package/sohelp-icon-select/icons/UnlockOutlined.vue +21 -0
- package/sohelp-icon-select/icons/UploadOutlined.vue +21 -0
- package/sohelp-icon-select/icons/UserOutlined.vue +21 -0
- package/sohelp-icon-select/icons/VerticalAlignMiddleOutlined.vue +15 -0
- package/sohelp-icon-select/icons/VerticalLeftOutlined.vue +13 -0
- package/sohelp-icon-select/icons/VerticalRightOutlined.vue +13 -0
- package/sohelp-icon-select/icons/WarningOutlined.vue +21 -0
- package/sohelp-icon-select/icons/ZoomInOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ZoomOutOutlined.vue +22 -0
- package/sohelp-icon-select/icons/index.js +106 -0
- package/sohelp-icon-select/icons/index.ts +106 -0
- package/sohelp-icon-select/index.vue +95 -0
- package/sohelp-icon-select/vxeui-icon.js +90 -0
- package/sohelp-image-upload/index.vue +286 -0
- package/sohelp-input/index.vue +39 -0
- package/sohelp-modal/index.vue +72 -0
- package/sohelp-module/index.vue +54 -0
- package/sohelp-module/useModalManager.js +89 -0
- package/sohelp-module/useSohelpModule.js +64 -0
- package/sohelp-number-input/index.vue +32 -0
- package/sohelp-number-range/index.vue +135 -0
- package/sohelp-org-select/index.vue +30 -0
- package/sohelp-org-tree/index.vue +18 -0
- package/sohelp-org-tree-select/index.vue +93 -0
- package/sohelp-org-user-tree/index.vue +26 -0
- package/sohelp-org-user-tree-select/index.vue +11 -0
- package/sohelp-pagination/index.vue +11 -0
- package/sohelp-power/index.vue +105 -0
- package/sohelp-pro-form/components/pro-form-footer.vue +44 -0
- package/sohelp-pro-form/components/pro-form-item.vue +1133 -0
- package/sohelp-pro-form/index.vue +257 -0
- package/sohelp-pro-form/util.js +140 -0
- package/sohelp-pro-layout/index.vue +11 -0
- package/sohelp-pro-table/index.vue +14 -0
- package/sohelp-process/index.vue +216 -0
- package/sohelp-rate/index.vue +56 -0
- package/sohelp-rate/props.js +71 -0
- package/sohelp-relation/index.vue +11 -0
- package/sohelp-rich-text/index.vue +242 -0
- package/sohelp-rich-text/util.js +231 -0
- package/sohelp-richtext/index.vue +10 -0
- package/sohelp-role-select/index.vue +33 -0
- package/sohelp-search/components/search-config.vue +0 -0
- package/sohelp-search/index.vue +49 -0
- package/sohelp-search-pro-form/index.vue +11 -0
- package/sohelp-select/index.vue +120 -0
- package/sohelp-split-panel/index.vue +15 -0
- package/sohelp-switch/index.vue +56 -0
- package/sohelp-table/index.vue +151 -0
- package/sohelp-tenant-select/index.vue +128 -0
- package/sohelp-text/index.vue +14 -0
- package/sohelp-textarea-input/index.vue +36 -0
- package/sohelp-time/index.vue +10 -0
- package/sohelp-tree/index.vue +37 -0
- package/sohelp-tree-select/index.vue +18 -0
- package/sohelp-user-select/index.vue +44 -0
- package/sohelp-user-select/index.vue~ +53 -0
- package/sohelp-user-select/props.js +71 -0
- package/sohelp-user-tag/index.vue +12 -0
- package/sohelp-user-tree/index.vue +11 -0
- package/sohelp-vform-drawer/index.vue +40 -0
- package/sohelp-vform-eleplus/favicon.ico +0 -0
- package/sohelp-vform-eleplus/index.vue +297 -0
- package/sohelp-vform-eleplus/preview.html +91 -0
- package/sohelp-vform-eleplus/render.es.js +72433 -0
- package/sohelp-vform-eleplus/render.style.css +16 -0
- package/sohelp-vform-eleplus/render.umd.js +57 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +462 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +419 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-modal/index.vue +41 -0
- package/sohelp-vform-select/index.vue +11 -0
- package/sohelp-vform-vant/favicon.ico +0 -0
- package/sohelp-vform-vant/render.es.js +14608 -0
- package/sohelp-vform-vant/render.style.css +1 -0
- package/sohelp-vform-vant/render.umd.js +22 -0
- package/sohelp-vxe-grid/DefaultGridOptions.js +90 -0
- package/sohelp-vxe-grid/DefaultProps.js +27 -0
- package/sohelp-vxe-grid/SohelpGridConfig.js +143 -0
- package/sohelp-vxe-grid/index.vue +475 -0
- package/sohelp-vxe-grid-select/index.vue +148 -0
- package/sohelp-vxe-table/index.vue +184 -0
- package/sohelp-workflow/index.vue +495 -0
- package/sohelp-workflow/nodeWrap.vue +53 -0
- package/sohelp-workflow/nodes/addNode.vue +27 -0
- package/sohelp-workflow/nodes/approver.vue +125 -0
- package/sohelp-workflow/nodes/branch.vue +434 -0
- package/sohelp-workflow/nodes/promoter.vue +80 -0
- package/sohelp-workflow/nodes/send.vue +95 -0
- package/sohelp-workflow-drawer/components/approval-modal.vue +182 -0
- package/sohelp-workflow-drawer/components/draw-box.vue +141 -0
- package/sohelp-workflow-drawer/components/form.vue +78 -0
- package/sohelp-workflow-drawer/components/table.vue +153 -0
- package/sohelp-workflow-drawer/components/timeline.vue +189 -0
- package/sohelp-workflow-drawer/components/workflow.vue +68 -0
- package/sohelp-workflow-drawer/index.vue +311 -0
- package/sohelp-workflow-drawer/js/index.js +119 -0
- package/utils/ProFormConvertUtil.js +76 -0
- package/utils/core.js +310 -0
- package/utils/use-form-data.js +48 -0
- package/utils/use-mobile.js +43 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* axios实例
|
|
3
|
+
*/
|
|
4
|
+
import { ElMessageBox } from "element-plus/es";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export const SohelpHttp = {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 获取后端上下文地址
|
|
11
|
+
*/
|
|
12
|
+
getBaseUrl(){
|
|
13
|
+
return window.$axios.defaults.baseURL
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 下载文件
|
|
18
|
+
* @param _url
|
|
19
|
+
* @param param
|
|
20
|
+
* @param fileName
|
|
21
|
+
* @returns {Promise<never>}
|
|
22
|
+
*/
|
|
23
|
+
download: async function(_url, param, fileName) {
|
|
24
|
+
if (window.$axios == null) {
|
|
25
|
+
console.error("请在配置main.js中配置window.$axios实例!!");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
if (!fileName) {
|
|
30
|
+
fileName = (new Date()).getTime();
|
|
31
|
+
}
|
|
32
|
+
// 发起GET请求,设置responseType为blob
|
|
33
|
+
const response = await window.$axios.get(_url, {
|
|
34
|
+
responseType: "blob",
|
|
35
|
+
params: param
|
|
36
|
+
}).catch(e => {
|
|
37
|
+
return Promise.reject(e.message);
|
|
38
|
+
});
|
|
39
|
+
if (response.type === "application/json") {
|
|
40
|
+
try {
|
|
41
|
+
const text = await response.text();
|
|
42
|
+
const res = JSON.parse(text);
|
|
43
|
+
if (res?.meta?.success) {
|
|
44
|
+
return res.data;
|
|
45
|
+
} else {
|
|
46
|
+
if (res?.meta?.error) {
|
|
47
|
+
console.log("SohelpHttp.download:", res.meta.error);
|
|
48
|
+
}
|
|
49
|
+
return Promise.reject(new Error(res.meta.message));
|
|
50
|
+
}
|
|
51
|
+
} catch (e) {
|
|
52
|
+
return Promise.reject(e.message);
|
|
53
|
+
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// 创建一个链接元素用于下载
|
|
57
|
+
const url = window.URL.createObjectURL(response);
|
|
58
|
+
const link = document.createElement("a");
|
|
59
|
+
link.href = url;
|
|
60
|
+
link.setAttribute("download", fileName); // 设置下载的文件名
|
|
61
|
+
document.body.appendChild(link);
|
|
62
|
+
|
|
63
|
+
// 触发下载
|
|
64
|
+
link.click();
|
|
65
|
+
// 清理
|
|
66
|
+
document.body.removeChild(link);
|
|
67
|
+
window.URL.revokeObjectURL(url);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
return Promise.reject(error);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
get: function(url, param, callback) {
|
|
73
|
+
if (window.$axios == null) {
|
|
74
|
+
console.error("请在配置main.js中配置window.$axios实例!!");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
for (const key in param) {
|
|
78
|
+
if (typeof param[key] === "object" && param[key] !== null) {
|
|
79
|
+
param[key] = JSON.stringify(param[key]); // 转换为 JSON 字符串
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
let promise = window.$axios.get(url, { params: param });
|
|
83
|
+
return promise.then((r) => {
|
|
84
|
+
if (!r.meta.success && r.meta.error) {
|
|
85
|
+
console.error(
|
|
86
|
+
"(GET请求URL):",
|
|
87
|
+
url,
|
|
88
|
+
"(请求参数):",
|
|
89
|
+
param,
|
|
90
|
+
"(返回结果):",
|
|
91
|
+
r.meta.error
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
if (typeof callback === "function") {
|
|
95
|
+
callback.call(this, r);
|
|
96
|
+
}
|
|
97
|
+
return Promise.resolve(r);
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
post: function(url, param, callback, error) {
|
|
101
|
+
if (window.$axios == null) {
|
|
102
|
+
console.error("请在配置main.js中配置window.$axios实例!!");
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
let promise = window.$axios.post(url, param);
|
|
106
|
+
return promise.then((r) => {
|
|
107
|
+
if (!r.meta.success && r.meta.error) {
|
|
108
|
+
console.error(
|
|
109
|
+
"(GET请求URL):",
|
|
110
|
+
url,
|
|
111
|
+
"(请求参数):",
|
|
112
|
+
param,
|
|
113
|
+
"(返回结果):",
|
|
114
|
+
r.meta.error
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
if (typeof callback === "function") {
|
|
118
|
+
callback.call(this, r);
|
|
119
|
+
}
|
|
120
|
+
return Promise.resolve(r);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export default SohelpHttp;
|
package/index.js
ADDED
package/installer.js
ADDED
package/lang/en_US.js
ADDED
package/lang/zh_CN.js
ADDED
package/lang/zh_TW.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ace-container" ref="aceContainer">
|
|
3
|
+
<!-- 官方文档中使用id,这里禁止使用,在后期打包后容易出现问题,使用 ref 或者 DOM 就行 -->
|
|
4
|
+
<div class="ace-editor" ref="ace"></div>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import ace from 'ace-builds';
|
|
10
|
+
/* 启用此行后webpack打包回生成很多动态加载的js文件,不便于部署,故禁用!!
|
|
11
|
+
特别提示:禁用此行后,需要调用ace.config.set('basePath', 'path...')指定动态js加载URL!!
|
|
12
|
+
*/
|
|
13
|
+
//import 'ace-builds/webpack-resolver'
|
|
14
|
+
|
|
15
|
+
//import 'ace-builds/src-min-noconflict/theme-monokai' // 默认设置的主题
|
|
16
|
+
import 'ace-builds/src-min-noconflict/theme-sqlserver'; // 新设主题
|
|
17
|
+
import 'ace-builds/src-min-noconflict/mode-javascript'; // 默认设置的语言模式
|
|
18
|
+
import 'ace-builds/src-min-noconflict/mode-json'; //
|
|
19
|
+
import 'ace-builds/src-min-noconflict/mode-css'; //
|
|
20
|
+
import 'ace-builds/src-min-noconflict/ext-language_tools';
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'CodeEditor',
|
|
24
|
+
props: {
|
|
25
|
+
height: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: '400px'
|
|
28
|
+
},
|
|
29
|
+
modelValue: {
|
|
30
|
+
type: String
|
|
31
|
+
//required: true
|
|
32
|
+
},
|
|
33
|
+
readonly: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
mode: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'javascript'
|
|
40
|
+
},
|
|
41
|
+
userWorker: {
|
|
42
|
+
//是否开启语法检查,默认开启
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
wrap: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
bindKey: {
|
|
51
|
+
type: Object,
|
|
52
|
+
default: null
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
emits: ['update:modelValue', 'bindExec'],
|
|
56
|
+
mounted() {
|
|
57
|
+
ace.config.set(
|
|
58
|
+
'basePath',
|
|
59
|
+
'https://ks3-cn-beijing.ksyun.com/vform2021/ace'
|
|
60
|
+
);
|
|
61
|
+
const h = Number(this.height.replace("px",""));
|
|
62
|
+
const maxLine = h/10 < 5 ? 5 : h /10;
|
|
63
|
+
this.addAutoCompletion(ace); //添加自定义代码提示!!
|
|
64
|
+
this.aceEditor = ace.edit(this.$refs.ace, {
|
|
65
|
+
maxLines: maxLine, // 最大行数,超过会自动出现滚动条
|
|
66
|
+
minLines: 5, // 最小行数,还未到最大行数时,编辑器会自动伸缩大小
|
|
67
|
+
fontSize: 12, // 编辑器内字体大小
|
|
68
|
+
theme: this.themePath, // 默认设置的主题
|
|
69
|
+
mode: this.modePath, // 默认设置的语言模式
|
|
70
|
+
tabSize: 2, // 制表符设置为2个空格大小
|
|
71
|
+
readOnly: this.readonly,
|
|
72
|
+
highlightActiveLine: true,
|
|
73
|
+
value: this.codeValue,
|
|
74
|
+
wrap: this.wrap
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
this.aceEditor.setOptions({
|
|
78
|
+
enableBasicAutocompletion: true,
|
|
79
|
+
enableSnippets: true, // 设置代码片段提示
|
|
80
|
+
enableLiveAutocompletion: true // 设置自动提示
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
if (this.bindKey) {
|
|
84
|
+
this.aceEditor.commands.addCommand({
|
|
85
|
+
name: 'myShortcut',
|
|
86
|
+
bindKey: {
|
|
87
|
+
...this.bindKey
|
|
88
|
+
},
|
|
89
|
+
exec: (editor) => {
|
|
90
|
+
this.$emit('bindExec', this.modelValue);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (this.mode === 'json') {
|
|
96
|
+
this.setJsonMode();
|
|
97
|
+
} else if (this.mode === 'css') {
|
|
98
|
+
this.setCssMode();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (!this.userWorker) {
|
|
102
|
+
this.aceEditor.getSession().setUseWorker(false);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//编辑时同步数据
|
|
106
|
+
this.aceEditor.getSession().on('change', (ev) => {
|
|
107
|
+
this.$emit('update:modelValue', this.aceEditor.getValue());
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
this.$nextTick(() => {
|
|
111
|
+
this.$refs.ace.style.minHeight = this.height;
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
data() {
|
|
115
|
+
return {
|
|
116
|
+
aceEditor: null,
|
|
117
|
+
themePath: 'ace/theme/sqlserver', // 不导入 webpack-resolver,该模块路径会报错
|
|
118
|
+
modePath: 'ace/mode/javascript', // 同上
|
|
119
|
+
codeValue: this.modelValue
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
methods: {
|
|
124
|
+
addAutoCompletion(ace) {
|
|
125
|
+
let acData = [
|
|
126
|
+
{
|
|
127
|
+
meta: 'VForm API',
|
|
128
|
+
caption: 'getWidgetRef',
|
|
129
|
+
value: 'getWidgetRef()',
|
|
130
|
+
score: 1
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
meta: 'VForm API',
|
|
134
|
+
caption: 'getFormRef',
|
|
135
|
+
value: 'getFormRef()',
|
|
136
|
+
score: 1
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
meta: 'VForm API',
|
|
140
|
+
caption: 'getParentFormRef',
|
|
141
|
+
value: 'getParentFormRef()',
|
|
142
|
+
score: 1
|
|
143
|
+
}
|
|
144
|
+
//TODO: 待补充!!
|
|
145
|
+
];
|
|
146
|
+
let langTools = ace.require('ace/ext/language_tools');
|
|
147
|
+
langTools.addCompleter({
|
|
148
|
+
getCompletions: function (editor, session, pos, prefix, callback) {
|
|
149
|
+
if (prefix.length === 0) {
|
|
150
|
+
return callback(null, []);
|
|
151
|
+
} else {
|
|
152
|
+
return callback(null, acData);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
setJsonMode() {
|
|
159
|
+
this.aceEditor.getSession().setMode('ace/mode/json');
|
|
160
|
+
this.formatJson(this.codeValue);
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
setCssMode() {
|
|
164
|
+
this.aceEditor.getSession().setMode('ace/mode/css');
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
getEditorAnnotations() {
|
|
168
|
+
return this.aceEditor.getSession().getAnnotations();
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
setValue(newValue) {
|
|
172
|
+
this.aceEditor.getSession().setValue(newValue);
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
formatJson(val) {
|
|
176
|
+
if (val) {
|
|
177
|
+
try {
|
|
178
|
+
var jsonValue = JSON.parse(val);
|
|
179
|
+
var formattedJson = JSON.stringify(jsonValue, null, 2);
|
|
180
|
+
this.aceEditor.setValue(formattedJson);
|
|
181
|
+
} catch (error) {
|
|
182
|
+
console.error('无效的json');
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
this.aceEditor.setValue('{}');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
</script>
|
|
191
|
+
|
|
192
|
+
<style lang="scss" scoped>
|
|
193
|
+
.ace-container,
|
|
194
|
+
.ace-editor {
|
|
195
|
+
// min-height: 300px;
|
|
196
|
+
width: 100%;
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sohelp-input v-bind="$attrs" v-model="modelValue">
|
|
3
|
+
<template #append>
|
|
4
|
+
<el-icon style="cursor: pointer" @click="getCode">
|
|
5
|
+
<Refresh />
|
|
6
|
+
</el-icon>
|
|
7
|
+
</template>
|
|
8
|
+
</sohelp-input>
|
|
9
|
+
</template>
|
|
10
|
+
<script setup>
|
|
11
|
+
import { nextTick, onMounted, useAttrs } from 'vue';
|
|
12
|
+
import { ElMessage } from 'element-plus';
|
|
13
|
+
import { Refresh } from '@element-plus/icons-vue';
|
|
14
|
+
const attrs = useAttrs();
|
|
15
|
+
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
field: { type: String, default: '' },
|
|
18
|
+
refid: { type: String, default: '' }
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const modelValue = defineModel();
|
|
22
|
+
|
|
23
|
+
onMounted(() => {
|
|
24
|
+
nextTick(() => {
|
|
25
|
+
if (attrs?.autoLoad) {
|
|
26
|
+
getCode();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const getCode = async () => {
|
|
32
|
+
if (attrs.readonly) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const { field, refid } = props;
|
|
36
|
+
if (field && refid) {
|
|
37
|
+
const res = await SohelpHttp.get(`/engine/web/crud/autocode?refid=${refid}&field=${field}`).catch((err) => {
|
|
38
|
+
ElMessage.error(err.message || 'error');
|
|
39
|
+
});
|
|
40
|
+
if (res?.data) {
|
|
41
|
+
modelValue.value = res.data || 123;
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
ElMessage.error('请配置Refid和Field参数');
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
</script>
|
|
48
|
+
<script>
|
|
49
|
+
export default {
|
|
50
|
+
name: 'SohelpAutocode'
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
53
|
+
<style scoped></style>
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div style="display: flex; align-items: center">
|
|
4
|
+
<el-select
|
|
5
|
+
v-model="obj.type"
|
|
6
|
+
:style="{ backgroundColor: obj.type === 'and' ? '#38c10b' : '#c59d0a' }"
|
|
7
|
+
class="mySelectStyle"
|
|
8
|
+
>
|
|
9
|
+
<el-option label="满足所有条件" value="and" />
|
|
10
|
+
<el-option label="满足任一条件" value="or" />
|
|
11
|
+
</el-select>
|
|
12
|
+
<el-icon @click="addSubCondition(0)" style="margin-left: 10px; cursor: pointer" size="24">
|
|
13
|
+
<Fold />
|
|
14
|
+
</el-icon>
|
|
15
|
+
<el-dropdown trigger="click">
|
|
16
|
+
<el-icon style="margin-left: 10px; cursor: pointer" size="24">
|
|
17
|
+
<CirclePlus />
|
|
18
|
+
</el-icon>
|
|
19
|
+
<template #dropdown>
|
|
20
|
+
<el-dropdown-menu>
|
|
21
|
+
<el-dropdown-item @click="addCondition(item)" v-for="item in fields">{{ item.label }}</el-dropdown-item>
|
|
22
|
+
</el-dropdown-menu>
|
|
23
|
+
</template>
|
|
24
|
+
</el-dropdown>
|
|
25
|
+
<el-icon
|
|
26
|
+
v-if="currentIndex > -1"
|
|
27
|
+
@click="delSubCondition(currentIndex)"
|
|
28
|
+
style="margin-left: 8px; cursor: pointer"
|
|
29
|
+
size="20"
|
|
30
|
+
>
|
|
31
|
+
<Delete />
|
|
32
|
+
</el-icon>
|
|
33
|
+
</div>
|
|
34
|
+
<div
|
|
35
|
+
v-if="obj.children && obj.children.length"
|
|
36
|
+
v-for="(item, index) in obj.children"
|
|
37
|
+
:style="{ borderLeft: obj.type === 'and' ? '4px solid #38c10b' : '4px solid #c59d0a' }"
|
|
38
|
+
>
|
|
39
|
+
<div v-if="!item.type" style="display: flex; align-items: center; justify-content: space-between; padding: 10px">
|
|
40
|
+
<div style="display: flex; align-items: center; width: 240px">
|
|
41
|
+
<div style="font-size: 16px; margin-right: 10px">{{ item.label }}</div>
|
|
42
|
+
<select v-model="item.comparison" style="border: none; width: auto; background-color: #dedede">
|
|
43
|
+
<option v-for="op in options" :value="op.value">{{ op.label }}</option>
|
|
44
|
+
</select>
|
|
45
|
+
</div>
|
|
46
|
+
<div style="display: flex; align-items: center">
|
|
47
|
+
<el-input v-model="item.value" placeholder="请输入" />
|
|
48
|
+
<el-icon @click="removeCondition(index)" style="margin-left: 8px" size="20">
|
|
49
|
+
<Delete />
|
|
50
|
+
</el-icon>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div v-else style="padding: 10px 0 0 10px">
|
|
54
|
+
<SohelpCondition
|
|
55
|
+
:value="item"
|
|
56
|
+
:fields="fields"
|
|
57
|
+
:current-index="index"
|
|
58
|
+
:key="item.key || index"
|
|
59
|
+
@removeCondition="removeCondition(index)"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script>
|
|
67
|
+
export default {
|
|
68
|
+
name: 'SohelpCondition',
|
|
69
|
+
components: {
|
|
70
|
+
SohelpCondition: import('./index.vue')
|
|
71
|
+
},
|
|
72
|
+
props: {
|
|
73
|
+
fields: {
|
|
74
|
+
type: Array,
|
|
75
|
+
required: true
|
|
76
|
+
},
|
|
77
|
+
modelValue: {
|
|
78
|
+
type: Object,
|
|
79
|
+
required: true
|
|
80
|
+
},
|
|
81
|
+
value: {
|
|
82
|
+
type: Object,
|
|
83
|
+
required: true
|
|
84
|
+
},
|
|
85
|
+
currentIndex: {
|
|
86
|
+
type: Number,
|
|
87
|
+
default: -1
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
data() {
|
|
91
|
+
return {
|
|
92
|
+
mainConditionType: 'and', // 主条件类型
|
|
93
|
+
conditions: [],
|
|
94
|
+
options: [
|
|
95
|
+
{
|
|
96
|
+
label: '包含',
|
|
97
|
+
value: 'LIKE'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: '不包含',
|
|
101
|
+
value: 'NOT_LIKE'
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
{
|
|
105
|
+
label: '等于',
|
|
106
|
+
value: 'EQ'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: '不等于',
|
|
110
|
+
value: 'NE'
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: '大于',
|
|
114
|
+
value: 'GT'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
label: '小于',
|
|
118
|
+
value: 'LT'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: '大于等于',
|
|
122
|
+
value: 'GTE'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: '小于等于',
|
|
126
|
+
value: 'LTE'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: '左包含',
|
|
130
|
+
value: 'LEFT_LIKE'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: '右包含',
|
|
134
|
+
value: 'RIGHT_LIKE'
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: '为空',
|
|
138
|
+
value: 'EMPTY'
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
label: '不为空',
|
|
142
|
+
value: 'NOT_EMPTY'
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
obj: this.value
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
watch: {
|
|
149
|
+
conditions: {
|
|
150
|
+
handler(newConditions) {
|
|
151
|
+
this.$emit('update:modelValue', { [this.mainConditionType]: newConditions });
|
|
152
|
+
},
|
|
153
|
+
deep: true
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
methods: {
|
|
157
|
+
addCondition(row) {
|
|
158
|
+
let data = [];
|
|
159
|
+
let datato = [];
|
|
160
|
+
if (this.obj.children.length) {
|
|
161
|
+
this.obj.children.forEach((e) => {
|
|
162
|
+
if (!e.type) {
|
|
163
|
+
data.push({ ...e });
|
|
164
|
+
} else {
|
|
165
|
+
datato.push({ ...e });
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
data.push({ ...row });
|
|
170
|
+
this.obj.children = data.concat(datato);
|
|
171
|
+
},
|
|
172
|
+
removeCondition(index) {
|
|
173
|
+
this.obj.children.splice(index, 1);
|
|
174
|
+
// 刷新
|
|
175
|
+
this.obj.children.forEach((t) => {
|
|
176
|
+
t.key = Math.random();
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
addSubCondition() {
|
|
180
|
+
// 确保 children 数组存在
|
|
181
|
+
// if (!this.conditions[index].children) {
|
|
182
|
+
// this.$set(this.conditions[index], 'children', []);
|
|
183
|
+
// }
|
|
184
|
+
this.obj.children.push({
|
|
185
|
+
type: 'and',
|
|
186
|
+
children: []
|
|
187
|
+
});
|
|
188
|
+
},
|
|
189
|
+
delSubCondition(index) {
|
|
190
|
+
if (index > -1) {
|
|
191
|
+
this.$emit('removeCondition', index);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
</script>
|
|
197
|
+
|
|
198
|
+
<style lang="scss" scoped>
|
|
199
|
+
/* 添加样式 */
|
|
200
|
+
.mySelectStyle {
|
|
201
|
+
border-radius: 5px;
|
|
202
|
+
border: none !important;
|
|
203
|
+
width: 130px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
:deep(.el-select__placeholder) {
|
|
207
|
+
color: #ffffff !important;
|
|
208
|
+
/* 自定义占位符颜色 */
|
|
209
|
+
}
|
|
210
|
+
</style>
|