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.
- package/.env.dev +14 -0
- package/CHANGELOG.md +9 -0
- package/README.md +24 -0
- package/dist/ed-frame-vue.common.1.js +11046 -0
- package/dist/ed-frame-vue.common.1.js.map +1 -0
- package/dist/ed-frame-vue.common.2.js +1715 -0
- package/dist/ed-frame-vue.common.2.js.map +1 -0
- package/dist/ed-frame-vue.common.js +53427 -0
- package/dist/ed-frame-vue.common.js.map +1 -0
- package/dist/ed-frame-vue.umd.1.js +11046 -0
- package/dist/ed-frame-vue.umd.1.js.map +1 -0
- package/dist/ed-frame-vue.umd.2.js +1715 -0
- package/dist/ed-frame-vue.umd.2.js.map +1 -0
- package/dist/ed-frame-vue.umd.js +53437 -0
- package/dist/ed-frame-vue.umd.js.map +1 -0
- package/dist/ed-frame-vue.umd.min.1.js +17 -0
- package/dist/ed-frame-vue.umd.min.1.js.map +1 -0
- package/dist/ed-frame-vue.umd.min.2.js +4 -0
- package/dist/ed-frame-vue.umd.min.2.js.map +1 -0
- package/dist/ed-frame-vue.umd.min.js +470 -0
- package/dist/ed-frame-vue.umd.min.js.map +1 -0
- package/import.easydata.js +46 -0
- package/lib/CHANGELOG.md +18 -0
- package/lib/README.md +27 -0
- package/lib/api/ds/index.js +124 -0
- package/lib/api/easyData.js +90 -0
- package/lib/api/easyform/easyForm.js +32 -0
- package/lib/api/index.js +61 -0
- package/lib/api/interface/index.js +32 -0
- package/lib/api/system.js +20 -0
- package/lib/index.js +80 -0
- package/lib/packages/BasicTemplate/EasyDataTemplate.vue +189 -0
- package/lib/packages/BasicTemplate/Props.js +64 -0
- package/lib/packages/BasicTemplate/components/TemplateComp.vue +263 -0
- package/lib/packages/BasicTemplate/components/TemplateViews.vue +292 -0
- package/lib/packages/BasicTemplate/hooks/business.js +74 -0
- package/lib/packages/BasicTemplate/hooks/getFormData.js +89 -0
- package/lib/packages/BasicTemplate/hooks/queryFormData.js +194 -0
- package/lib/packages/BasicTemplate/hooks/submitForm.js +53 -0
- package/lib/packages/BasicTemplate/hooks/useEmits.js +15 -0
- package/lib/packages/BasicTemplate/hooks/validate.js +42 -0
- package/lib/packages/EasyDataForm/EasyDataForm.vue +597 -0
- package/lib/packages/EasyDataForm/Props.js +22 -0
- package/lib/packages/EasyDataForm/components/FormItem.vue +228 -0
- package/lib/packages/EasyDataForm/hooks/useChosePopup.js +85 -0
- package/lib/packages/EasyDataForm/hooks/useEmits.js +19 -0
- package/lib/packages/EasyDataForm/hooks/useForm.js +169 -0
- package/lib/packages/EasyDataForm/hooks/useUpload.js +168 -0
- package/lib/packages/EasyDataList/EasyDataList.vue +348 -0
- package/lib/packages/EasyDataList/Props.js +116 -0
- package/lib/packages/EasyDataList/components/BasicModal.vue +150 -0
- package/lib/packages/EasyDataList/components/FormAction.vue +63 -0
- package/lib/packages/EasyDataList/hooks/useEmits.js +30 -0
- package/lib/packages/EasyDataList/hooks/useForm.js +62 -0
- package/lib/packages/EasyDataList/hooks/useTable.js +314 -0
- package/lib/packages/EasyDataTable/EasyDataTable.vue +233 -0
- package/lib/packages/EasyDataView/EasyDataView.vue +105 -0
- package/lib/packages/EdRichPreview/index.js +32 -0
- package/lib/packages/EdRichText/index.vue +167 -0
- package/lib/packages/EdRichText/replaceUrl.js +49 -0
- package/lib/packages/components/FileView.vue +97 -0
- package/lib/packages/index.js +11 -0
- package/lib/packages/mixins/EasyDataMixins.js +133 -0
- package/lib/packages/mixins/useTable.jsx +130 -0
- package/lib/pages/DataSource/index.js +8 -0
- package/lib/pages/DataSource/src/components/ControlViews/BaseProps.js +103 -0
- package/lib/pages/DataSource/src/components/ControlViews/control.js +1089 -0
- package/lib/pages/DataSource/src/components/ControlViews/index.vue +301 -0
- package/lib/pages/DataSource/src/components/TableOperationModal.vue +225 -0
- package/lib/pages/DataSource/src/components/TablePropsModal.vue +367 -0
- package/lib/pages/DataSource/src/components/ViewPropsModal.vue +737 -0
- package/lib/pages/DataSource/src/components/modal/ChooseDict.vue +119 -0
- package/lib/pages/DataSource/src/hooks/useTable.js +138 -0
- package/lib/pages/DataSource/src/index.vue +431 -0
- package/lib/pages/Interface/index.js +8 -0
- package/lib/pages/Interface/src/components/InterfaceCall.vue +73 -0
- package/lib/pages/Interface/src/components/InterfaceDepend.vue +299 -0
- package/lib/pages/Interface/src/components/InterfaceFee.vue +131 -0
- package/lib/pages/Interface/src/components/InterfaceMessage.vue +878 -0
- package/lib/pages/Interface/src/components/InterfaceMock.vue +203 -0
- package/lib/pages/Interface/src/components/InterfaceParam.vue +308 -0
- package/lib/pages/Interface/src/components/InterfaceRepeat.vue +281 -0
- package/lib/pages/Interface/src/components/InterfaceVariable.vue +31 -0
- package/lib/pages/Interface/src/index.vue +216 -0
- package/lib/pages/Template/index.js +8 -0
- package/lib/pages/Template/src/components/DefineModal.vue +524 -0
- package/lib/pages/Template/src/components/TemplatePreview.vue +109 -0
- package/lib/pages/Template/src/components/model/AddDialog.vue +60 -0
- package/lib/pages/Template/src/components/model/TemplatePreview2.vue +101 -0
- package/lib/pages/Template/src/hooks/index.js +3 -0
- package/lib/pages/Template/src/hooks/useEmits.js +64 -0
- package/lib/pages/Template/src/index.vue +124 -0
- package/lib/popup/index.js +8 -0
- package/lib/popup/src/DataSourceChoose.vue +44 -0
- package/lib/popup/src/DataSourceViewIdChoose.vue +67 -0
- package/lib/popup/src/DictChoose.vue +104 -0
- package/lib/popup/src/InterfaceChoose.vue +46 -0
- package/lib/popup/src/OrgChoose.vue +121 -0
- package/lib/popup/src/RoleChoose.vue +101 -0
- package/lib/popup/src/TemplateChoose.vue +43 -0
- package/lib/popup/src/UserChoose.vue +161 -0
- package/lib/popup//347/273/204/344/273/266/345/274/200/345/217/221/350/247/204/350/214/203.md +25 -0
- package/lib/style/custom.scss +126 -0
- package/lib/style/deep.scss +109 -0
- package/lib/style/index.scss +4 -0
- package/lib/utils/MapLoader.js +48 -0
- package/lib/utils/dateUtils.js +58 -0
- package/lib/utils/index.js +8 -0
- package/lib/utils/setting.js +25 -0
- package/lib/utils/sortable/index.js +3784 -0
- package/lib/utils/useBusiness.js +212 -0
- package/lib/utils/utils.js +588 -0
- package/package.json +77 -0
- package/src/App.vue +12 -0
- package/src/assets/Vue.png +0 -0
- package/src/assets/avatar.png +0 -0
- package/src/assets/images/bg.png +0 -0
- package/src/assets/images/logo-bills.png +0 -0
- package/src/assets/images/pic.png +0 -0
- package/src/assets/images/weplus-logo.png +0 -0
- package/src/assets/marker.png +0 -0
- package/src/assets/styles/common.scss +359 -0
- package/src/assets/styles/ele-docs.css +3278 -0
- package/src/assets/styles/fonts/icomoon.eot +0 -0
- package/src/assets/styles/fonts/icomoon.svg +14 -0
- package/src/assets/styles/fonts/icomoon.ttf +0 -0
- package/src/assets/styles/fonts/icomoon.woff +0 -0
- package/src/assets/styles/fonts/style.css +39 -0
- package/src/assets/styles/higtlightEle.css +84 -0
- package/src/assets/svg/code.svg +7 -0
- package/src/assets/svg/password.svg +1 -0
- package/src/components/Popups/DiyCompDictChoose.vue +112 -0
- package/src/components/Popups/index.js +28 -0
- package/src/components/ed-base-vue/global/variable.js +8 -0
- package/src/components/ed-base-vue/index.js +81 -0
- package/src/components/ed-base-vue/package/EdCard/index.js +7 -0
- package/src/components/ed-base-vue/package/EdCard/src/index.vue +87 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/index.js +8 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/AceConfig.js +71 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/Editor.vue +137 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/Toolbar.vue +68 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/index.vue +119 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/webpack-resolver.js +51 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/Toolbar.vue +57 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/config.js +64 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/index.vue +309 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/EdCodeEditor.vue +238 -0
- package/src/components/ed-base-vue/package/EdDate/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDate/src/index.js +50 -0
- package/src/components/ed-base-vue/package/EdDescriptions/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDescriptions/src/EdDescriptions.vue +46 -0
- package/src/components/ed-base-vue/package/EdDescriptions/src/EdDescriptionsItem.js +20 -0
- package/src/components/ed-base-vue/package/EdDescriptions/src/Props.js +20 -0
- package/src/components/ed-base-vue/package/EdDialog/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDialog/src/EdDialog.vue +138 -0
- package/src/components/ed-base-vue/package/EdDialog/src/Props.js +91 -0
- package/src/components/ed-base-vue/package/EdDialog/src/components/DialogFooter.vue +42 -0
- package/src/components/ed-base-vue/package/EdDialog/src/components/DialogWrapper.vue +53 -0
- package/src/components/ed-base-vue/package/EdDrawer/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDrawer/src/DrawerFooter.vue +41 -0
- package/src/components/ed-base-vue/package/EdDrawer/src/EdDrawer.vue +150 -0
- package/src/components/ed-base-vue/package/EdDrawer/src/props.js +71 -0
- package/src/components/ed-base-vue/package/EdFlow/index.js +8 -0
- package/src/components/ed-base-vue/package/EdFlow/src/EdFlowItem.vue +733 -0
- package/src/components/ed-base-vue/package/EdFlow/src/index.vue +148 -0
- package/src/components/ed-base-vue/package/EdForm/index.js +8 -0
- package/src/components/ed-base-vue/package/EdForm/src/EdForm.vue +172 -0
- package/src/components/ed-base-vue/package/EdForm/src/Props.js +33 -0
- package/src/components/ed-base-vue/package/EdForm/src/components/EdFormItem.vue +34 -0
- package/src/components/ed-base-vue/package/EdIcons/index.js +8 -0
- package/src/components/ed-base-vue/package/EdIcons/src/hooks/Icons.js +406 -0
- package/src/components/ed-base-vue/package/EdIcons/src/hooks/Icons1.js +830 -0
- package/src/components/ed-base-vue/package/EdIcons/src/index.vue +13 -0
- package/src/components/ed-base-vue/package/EdImage/index.js +8 -0
- package/src/components/ed-base-vue/package/EdImage/src/index.vue +28 -0
- package/src/components/ed-base-vue/package/EdInputArray/index.js +8 -0
- package/src/components/ed-base-vue/package/EdInputArray/src/Props.js +26 -0
- package/src/components/ed-base-vue/package/EdInputArray/src/index.vue +97 -0
- package/src/components/ed-base-vue/package/EdInputColor/index.js +8 -0
- package/src/components/ed-base-vue/package/EdInputColor/src/InputColor.vue +81 -0
- package/src/components/ed-base-vue/package/EdInputMap/index.js +9 -0
- package/src/components/ed-base-vue/package/EdInputMap/src/EdInputMap.vue +246 -0
- package/src/components/ed-base-vue/package/EdInputMap/src/EdInputMapProps.js +6 -0
- package/src/components/ed-base-vue/package/EdInputPop/index.js +13 -0
- package/src/components/ed-base-vue/package/EdInputPop/src/EdInputPop.vue +144 -0
- package/src/components/ed-base-vue/package/EdInputPop/src/Props.js +48 -0
- package/src/components/ed-base-vue/package/EdInputTable/index.js +8 -0
- package/src/components/ed-base-vue/package/EdInputTable/src/EdInputTable.vue +368 -0
- package/src/components/ed-base-vue/package/EdInputTable/src/Fetch.js +40 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/index.js +13 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/EdJsonEditor.vue +198 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/img/jsoneditor-icons.svg +749 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/jsoneditor.css +2031 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/plus.svg +1 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/hooks.js +63 -0
- package/src/components/ed-base-vue/package/EdJsonViewer/index.js +8 -0
- package/src/components/ed-base-vue/package/EdJsonViewer/src/EdJsonViewer.vue +44 -0
- package/src/components/ed-base-vue/package/EdLable/index.js +8 -0
- package/src/components/ed-base-vue/package/EdLable/src/index.vue +34 -0
- package/src/components/ed-base-vue/package/EdLink/index.js +8 -0
- package/src/components/ed-base-vue/package/EdLink/src/index.vue +43 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/index.js +15 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/src/EdMarkEditor.vue +368 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/src/extra-function.js +538 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/src/highlight.js +95 -0
- package/src/components/ed-base-vue/package/EdTable/index.js +8 -0
- package/src/components/ed-base-vue/package/EdTable/src/EdTable.vue +240 -0
- package/src/components/ed-base-vue/package/EdTable/src/Props.js +97 -0
- package/src/components/ed-base-vue/package/EdTable/src/components/TableColumnItem.js +24 -0
- package/src/components/ed-base-vue/package/EdTable/src/components/TablePagination.vue +73 -0
- package/src/components/ed-base-vue/package/EdTableEditor/index.js +8 -0
- package/src/components/ed-base-vue/package/EdTableEditor/src/EdTableEditor.vue +282 -0
- package/src/components/ed-base-vue/package/EdTableEditor/src/Props.js +107 -0
- package/src/components/ed-base-vue/package/EdTableEditor/src/hooks/validate.js +90 -0
- package/src/components/ed-base-vue/package/EdUpload/index.js +8 -0
- package/src/components/ed-base-vue/package/EdUpload/src/Props.js +90 -0
- package/src/components/ed-base-vue/package/EdUpload/src/index.vue +88 -0
- package/src/components/ed-base-vue/package/EdViewer/index.js +8 -0
- package/src/components/ed-base-vue/package/EdViewer/src/EdViewer.vue +310 -0
- package/src/components/ed-base-vue/package/EdWangEditor/index.js +14 -0
- package/src/components/ed-base-vue/package/EdWangEditor/src/EdWangEditor.vue +127 -0
- package/src/components/ed-base-vue/package/ExtendSlot.js +12 -0
- package/src/components/ed-base-vue/package/OptionSlot.js +65 -0
- package/src/components/ed-base-vue/plugin/Message/index.js +2 -0
- package/src/components/ed-base-vue/plugin/Message/src/main.js +91 -0
- package/src/components/ed-base-vue/plugin/Message/src/main.vue +253 -0
- package/src/components/ed-base-vue/plugin/print/index.js +156 -0
- package/src/components/ed-base-vue/plugin/sortable/index.js +3784 -0
- package/src/components/ed-base-vue/style/custom.scss +107 -0
- package/src/components/ed-base-vue/style/deep.scss +100 -0
- package/src/components/ed-base-vue/style/index.scss +4 -0
- package/src/components/ed-base-vue/tools/date-format.js +315 -0
- package/src/components/ed-base-vue/tools/utils.js +124 -0
- package/src/layouts/components/AppMain.vue +17 -0
- package/src/layouts/components/Header.vue +256 -0
- package/src/layouts/components/Logo.vue +56 -0
- package/src/layouts/components/Navbar.vue +169 -0
- package/src/layouts/components/SideBar.vue +107 -0
- package/src/layouts/components/index.js +5 -0
- package/src/layouts/index.vue +57 -0
- package/src/main.js +42 -0
- package/src/request/config.js +6 -0
- package/src/request/index.js +85 -0
- package/src/request/request.js +147 -0
- package/src/router/index.js +65 -0
- package/src/router/modules/baseRouter.js +43 -0
- package/src/router/modules/easydata.js +49 -0
- package/src/views/base/BaseRichPreview.vue +23 -0
- package/src/views/base/BaseRichText.vue +28 -0
- package/src/views/base/EdFormView.vue +54 -0
- package/src/views/base/EdTable.vue +98 -0
- package/src/views/base/inputTable.vue +103 -0
- package/src/views/easydata/Interface.vue +3 -0
- package/src/views/easydata/dataSource.vue +13 -0
- package/src/views/easydata/dataSourceView.vue +71 -0
- package/src/views/easydata/templateDemo.vue +89 -0
- package/src/views/easydata/templateInfo.vue +13 -0
- package/src/views/index.vue +17 -0
- package/src/views/login.vue +208 -0
- package/src/views/redirect.vue +15 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-container">
|
|
3
|
+
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams">
|
|
4
|
+
<el-form-item label="角色名称" prop="name">
|
|
5
|
+
<el-input v-model="queryParams.name" clearable placeholder="请输入角色名称" size="small" style="width: 240px"
|
|
6
|
+
@keyup.enter.native="handleQuery"/>
|
|
7
|
+
</el-form-item>
|
|
8
|
+
<el-form-item>
|
|
9
|
+
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
|
10
|
+
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
11
|
+
</el-form-item>
|
|
12
|
+
</el-form>
|
|
13
|
+
|
|
14
|
+
<el-table v-loading="loading" :data="roleList" highlight-current-row @current-change="handleCurrentChange">
|
|
15
|
+
<el-table-column label="角色编号" prop="id" width="120"/>
|
|
16
|
+
<el-table-column :show-overflow-tooltip="true" label="角色名称" prop="name" width="150"/>
|
|
17
|
+
<el-table-column :show-overflow-tooltip="true" label="角色标识" prop="code" width="150"/>
|
|
18
|
+
<el-table-column label="角色类型" prop="type" width="80">
|
|
19
|
+
<template slot-scope="scope">
|
|
20
|
+
<dict-tag :type="DICT_TYPE.SYSTEM_ROLE_TYPE" :value="scope.row.type"/>
|
|
21
|
+
</template>
|
|
22
|
+
</el-table-column>
|
|
23
|
+
<el-table-column label="显示顺序" prop="sort" width="100"/>
|
|
24
|
+
<el-table-column align="center" label="状态" width="100">
|
|
25
|
+
<template slot-scope="scope">
|
|
26
|
+
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" disabled/>
|
|
27
|
+
</template>
|
|
28
|
+
</el-table-column>
|
|
29
|
+
|
|
30
|
+
</el-table>
|
|
31
|
+
|
|
32
|
+
<pagination v-show="total>0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNo" :total="total"
|
|
33
|
+
@pagination="loadData"/>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import {listRole,} from "../../api/system";
|
|
39
|
+
export default {
|
|
40
|
+
name: "RoleChoose",
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
// 遮罩层
|
|
44
|
+
loading: true,
|
|
45
|
+
// 显示搜索条件
|
|
46
|
+
showSearch: true,
|
|
47
|
+
// 总条数
|
|
48
|
+
total: 0,
|
|
49
|
+
roleList: [],
|
|
50
|
+
currentRow: {},
|
|
51
|
+
// 查询参数
|
|
52
|
+
queryParams: {
|
|
53
|
+
pageNo: 1,
|
|
54
|
+
pageSize: 10,
|
|
55
|
+
name: undefined,
|
|
56
|
+
},
|
|
57
|
+
// 表单校验
|
|
58
|
+
rules: {
|
|
59
|
+
name: [
|
|
60
|
+
{required: true, message: "角色名称不能为空", trigger: "blur"}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
watch: {},
|
|
68
|
+
created() {
|
|
69
|
+
this.loadData();
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
getData() {
|
|
73
|
+
return {value: this.currentRow.id, label: this.currentRow.name}
|
|
74
|
+
},
|
|
75
|
+
handleCurrentChange(row) {
|
|
76
|
+
this.currentRow = row;
|
|
77
|
+
},
|
|
78
|
+
/** 查询角色列表 */
|
|
79
|
+
loadData() {
|
|
80
|
+
this.loading = true;
|
|
81
|
+
listRole(this.queryParams).then(
|
|
82
|
+
response => {
|
|
83
|
+
this.roleList = response.data.list;
|
|
84
|
+
this.total = response.data.total;
|
|
85
|
+
this.loading = false;
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
/** 搜索按钮操作 */
|
|
90
|
+
handleQuery() {
|
|
91
|
+
this.queryParams.pageNo = 1;
|
|
92
|
+
this.loadData();
|
|
93
|
+
},
|
|
94
|
+
/** 重置按钮操作 */
|
|
95
|
+
resetQuery() {
|
|
96
|
+
this.resetForm("queryForm");
|
|
97
|
+
this.handleQuery();
|
|
98
|
+
},
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<EasyDataList :data-source-name="dataSourceName" :diy-colums="columns"
|
|
4
|
+
:action-props="{showExportBtn:false,showAddBtn:false}"
|
|
5
|
+
:table-props="{isOperate: false}"
|
|
6
|
+
@handleCurrentChange="handleCurrentChange">
|
|
7
|
+
|
|
8
|
+
</EasyDataList>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script lang="jsx">
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'TemplateChooes',
|
|
15
|
+
data() {
|
|
16
|
+
return {
|
|
17
|
+
dataSourceName: 'easy_template_info',
|
|
18
|
+
currentData: {}, //选中的数据
|
|
19
|
+
columns: [
|
|
20
|
+
{
|
|
21
|
+
label: 'Id',
|
|
22
|
+
prop: 'id',
|
|
23
|
+
}, {
|
|
24
|
+
label: '模板名称',
|
|
25
|
+
prop: 'keyInfoObject.template_name',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: '备注',
|
|
29
|
+
prop: 'keyInfoObject.template_remark',
|
|
30
|
+
},
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
getData() {
|
|
36
|
+
return {value: this.currentData.id, label: this.currentData.keyInfoObject.template_name};
|
|
37
|
+
},
|
|
38
|
+
handleCurrentChange(row) {
|
|
39
|
+
this.currentData = row
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-container">
|
|
3
|
+
<!-- 搜索工作栏 -->
|
|
4
|
+
<el-row :gutter="20">
|
|
5
|
+
<!--部门数据-->
|
|
6
|
+
<el-col :span="4" :xs="24">
|
|
7
|
+
<div class="head-container">
|
|
8
|
+
<el-input v-model="deptName" clearable placeholder="请输入部门名称" prefix-icon="el-icon-search" size="small"
|
|
9
|
+
style="margin-bottom: 20px"/>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="head-container">
|
|
12
|
+
<el-tree ref="tree" :data="deptOptions" :expand-on-click-node="false"
|
|
13
|
+
:filter-node-method="filterNode"
|
|
14
|
+
:props="defaultProps" default-expand-all highlight-current @node-click="handleNodeClick"/>
|
|
15
|
+
</div>
|
|
16
|
+
</el-col>
|
|
17
|
+
<!--用户数据-->
|
|
18
|
+
<el-col :span="20" :xs="24">
|
|
19
|
+
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px"
|
|
20
|
+
size="small">
|
|
21
|
+
<el-form-item label="用户名称" prop="username">
|
|
22
|
+
<el-input v-model="queryParams.username" clearable placeholder="请输入用户名称" style="width: 240px"
|
|
23
|
+
@keyup.enter.native="handleQuery"/>
|
|
24
|
+
</el-form-item>
|
|
25
|
+
<el-form-item>
|
|
26
|
+
<el-button icon="el-icon-search" type="primary" @click="handleQuery">搜索</el-button>
|
|
27
|
+
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
28
|
+
</el-form-item>
|
|
29
|
+
</el-form>
|
|
30
|
+
<el-table v-loading="loading" :data="userList" highlight-current-row @current-change="handleCurrentChange">
|
|
31
|
+
<el-table-column v-if="columns[0].visible" key="id" align="center" label="用户编号" prop="id"/>
|
|
32
|
+
<el-table-column v-if="columns[1].visible" key="username" :show-overflow-tooltip="true" align="center"
|
|
33
|
+
label="用户名称"
|
|
34
|
+
prop="username"/>
|
|
35
|
+
<el-table-column v-if="columns[2].visible" key="nickname" :show-overflow-tooltip="true" align="center"
|
|
36
|
+
label="用户昵称"
|
|
37
|
+
prop="nickname"/>
|
|
38
|
+
<el-table-column v-if="columns[3].visible" key="deptName" :show-overflow-tooltip="true" align="center"
|
|
39
|
+
label="部门"
|
|
40
|
+
prop="dept.name"/>
|
|
41
|
+
</el-table>
|
|
42
|
+
|
|
43
|
+
<pagination v-show="total>0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNo" :total="total"
|
|
44
|
+
@pagination="loadData"/>
|
|
45
|
+
</el-col>
|
|
46
|
+
</el-row>
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import {listUser, listSimpleDepts, listSimplePosts} from "../../api/system";
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
name: "UserChoose",
|
|
56
|
+
data() {
|
|
57
|
+
return {
|
|
58
|
+
// 遮罩层
|
|
59
|
+
loading: true,
|
|
60
|
+
// 导出遮罩层
|
|
61
|
+
exportLoading: false,
|
|
62
|
+
// 显示搜索条件
|
|
63
|
+
showSearch: true,
|
|
64
|
+
// 总条数
|
|
65
|
+
total: 0,
|
|
66
|
+
// 用户表格数据
|
|
67
|
+
userList: null,
|
|
68
|
+
// 部门树选项
|
|
69
|
+
deptOptions: undefined,
|
|
70
|
+
// 部门名称
|
|
71
|
+
deptName: undefined,
|
|
72
|
+
// 岗位选项
|
|
73
|
+
postOptions: [],
|
|
74
|
+
// 表单参数
|
|
75
|
+
form: {},
|
|
76
|
+
defaultProps: {
|
|
77
|
+
children: "children",
|
|
78
|
+
label: "name"
|
|
79
|
+
},
|
|
80
|
+
// 查询参数
|
|
81
|
+
queryParams: {
|
|
82
|
+
pageNo: 1,
|
|
83
|
+
pageSize: 10,
|
|
84
|
+
username: undefined,
|
|
85
|
+
deptId: undefined,
|
|
86
|
+
},
|
|
87
|
+
// 列信息
|
|
88
|
+
columns: [
|
|
89
|
+
{key: 0, label: `用户编号`, visible: true},
|
|
90
|
+
{key: 1, label: `用户名称`, visible: true},
|
|
91
|
+
{key: 2, label: `用户昵称`, visible: true},
|
|
92
|
+
{key: 3, label: `部门`, visible: true},
|
|
93
|
+
],
|
|
94
|
+
currentRow: {}
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
watch: {
|
|
98
|
+
// 根据名称筛选部门树
|
|
99
|
+
deptName(val) {
|
|
100
|
+
this.$refs.tree.filter(val);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
created() {
|
|
104
|
+
this.loadData();
|
|
105
|
+
this.getTreeselect();
|
|
106
|
+
},
|
|
107
|
+
methods: {
|
|
108
|
+
/** 查询用户列表 */
|
|
109
|
+
loadData() {
|
|
110
|
+
this.loading = true;
|
|
111
|
+
listUser(this.queryParams).then(response => {
|
|
112
|
+
this.userList = response.data.list;
|
|
113
|
+
this.total = response.data.total;
|
|
114
|
+
this.loading = false;
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
getData() {
|
|
119
|
+
return {value: this.currentRow.id, label: this.currentRow.username}
|
|
120
|
+
},
|
|
121
|
+
handleCurrentChange(row) {
|
|
122
|
+
this.currentRow = row;
|
|
123
|
+
},
|
|
124
|
+
/** 查询部门下拉树结构 + 岗位下拉 */
|
|
125
|
+
getTreeselect() {
|
|
126
|
+
listSimpleDepts().then(response => {
|
|
127
|
+
// 处理 deptOptions 参数
|
|
128
|
+
this.deptOptions = [];
|
|
129
|
+
this.deptOptions.push(...this.handleTree(response.data, "id"));
|
|
130
|
+
});
|
|
131
|
+
listSimplePosts().then(response => {
|
|
132
|
+
// 处理 postOptions 参数
|
|
133
|
+
this.postOptions = [];
|
|
134
|
+
this.postOptions.push(...response.data);
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
// 筛选节点
|
|
138
|
+
filterNode(value, data) {
|
|
139
|
+
if (!value) return true;
|
|
140
|
+
return data.name.indexOf(value) !== -1;
|
|
141
|
+
},
|
|
142
|
+
// 节点单击事件
|
|
143
|
+
handleNodeClick(data) {
|
|
144
|
+
this.queryParams.deptId = data.id;
|
|
145
|
+
this.loadData();
|
|
146
|
+
},
|
|
147
|
+
/** 搜索按钮操作 */
|
|
148
|
+
handleQuery() {
|
|
149
|
+
this.queryParams.pageNo = 1;
|
|
150
|
+
this.loadData();
|
|
151
|
+
},
|
|
152
|
+
/** 重置按钮操作 */
|
|
153
|
+
resetQuery() {
|
|
154
|
+
this.resetForm("queryForm");
|
|
155
|
+
this.handleQuery();
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
</script>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
.ed-drag--cursor_move {
|
|
2
|
+
cursor: move;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.es-form--action {
|
|
6
|
+
width: 100%;
|
|
7
|
+
padding-bottom: 20px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.el-dropdown-link {
|
|
11
|
+
color: #409EFF;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.es-dialog--operate {
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
align-items: center;
|
|
20
|
+
div:last-child{
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: flex-end;
|
|
23
|
+
align-items: center;
|
|
24
|
+
padding-right: 20px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.es-box-card {
|
|
29
|
+
.es-box-card--header {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
align-items: center;
|
|
33
|
+
|
|
34
|
+
div:last-child, .es-card-header-operate{
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: flex-end;
|
|
37
|
+
align-items: center;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.view-list-card.active {
|
|
42
|
+
background-color: rgb(225, 243, 216);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.es-box-card--top {
|
|
47
|
+
margin-top: 10px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
.es-row, .es-row--col{
|
|
52
|
+
height: 100%;
|
|
53
|
+
.es-box-card {
|
|
54
|
+
height: 100% ;
|
|
55
|
+
|
|
56
|
+
.el-card__body {
|
|
57
|
+
height: calc(100% - 45px);
|
|
58
|
+
overflow-y: auto;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//es-menu
|
|
64
|
+
.es-menu {
|
|
65
|
+
border-right: none;
|
|
66
|
+
.es-menu-item {
|
|
67
|
+
display: flex;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
align-items: center;
|
|
70
|
+
|
|
71
|
+
&.is-active {
|
|
72
|
+
background: rgba(24, 144, 255, 0.1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.es-menu-item--operate {
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: flex-end;
|
|
78
|
+
align-items: center;
|
|
79
|
+
line-height: 56px;
|
|
80
|
+
.el-button {
|
|
81
|
+
line-height: 56px;
|
|
82
|
+
padding: 0;
|
|
83
|
+
margin: 0;
|
|
84
|
+
margin-left: 2px;
|
|
85
|
+
margin-top: 1px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
// es-template
|
|
93
|
+
.es-template {
|
|
94
|
+
padding-bottom: 20px;
|
|
95
|
+
|
|
96
|
+
.es-template--steps {
|
|
97
|
+
|
|
98
|
+
&__main {
|
|
99
|
+
margin-top: 10px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.es-steps--isVertical {
|
|
104
|
+
display: flex;
|
|
105
|
+
min-height: 300px;
|
|
106
|
+
|
|
107
|
+
.el-steps--vertical {
|
|
108
|
+
flex: 1;
|
|
109
|
+
height: 100%;
|
|
110
|
+
margin-top: 20px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.es-template--steps__main {
|
|
114
|
+
flex: 7;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.es-template__footer {
|
|
119
|
+
margin-top: 20px;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// EasyDataForm.vue
|
|
124
|
+
.ed-form--box {
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vue样式穿透 ::v-deep
|
|
3
|
+
* 修改element样式
|
|
4
|
+
*/
|
|
5
|
+
::v-deep {
|
|
6
|
+
|
|
7
|
+
// el-card 默认样式修改
|
|
8
|
+
.el-card {
|
|
9
|
+
.el-card__header {
|
|
10
|
+
font-size: 18px;
|
|
11
|
+
padding: 10px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.el-card.is-never-shadow {
|
|
16
|
+
.el-card__header {
|
|
17
|
+
opacity: 0.5;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// el-drawer 默认样式修改
|
|
22
|
+
.es-modal {
|
|
23
|
+
.el-drawer__header {
|
|
24
|
+
position: relative;
|
|
25
|
+
padding: 16px 24px;
|
|
26
|
+
border-bottom: 1px solid #e8e8e8;
|
|
27
|
+
border-radius: 4px 4px 0 0;
|
|
28
|
+
color: rgba(0, 0, 0, .85);
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
font-size: 18px;
|
|
31
|
+
margin-bottom: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.el-drawer__body {
|
|
35
|
+
position: relative;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
|
|
39
|
+
.es-drawer__content {
|
|
40
|
+
padding: 20px;
|
|
41
|
+
flex: 1;
|
|
42
|
+
overflow: auto;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.es-drawer__footer {
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: flex-end;
|
|
48
|
+
align-items: center;
|
|
49
|
+
border-top: 1px solid #e8e8e8;
|
|
50
|
+
padding: 10px 16px;
|
|
51
|
+
background: #fff;
|
|
52
|
+
border-radius: 0 0 2px 2px;
|
|
53
|
+
width: 100%;
|
|
54
|
+
|
|
55
|
+
.el-button {
|
|
56
|
+
width: 100px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.el-button:last-child {
|
|
60
|
+
margin-left: 30px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.easy-dialog {
|
|
67
|
+
.el-dialog__header {
|
|
68
|
+
position: relative;
|
|
69
|
+
padding: 16px 24px;
|
|
70
|
+
border-bottom: 1px solid #e8e8e8;
|
|
71
|
+
border-radius: 4px 4px 0 0;
|
|
72
|
+
color: rgba(0, 0, 0, .85);
|
|
73
|
+
font-weight: 500;
|
|
74
|
+
font-size: 18px;
|
|
75
|
+
margin-bottom: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.el-dialog__body {
|
|
79
|
+
flex: 1;
|
|
80
|
+
padding: 15px
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.el-dialog__footer {
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-content: flex-end;
|
|
86
|
+
align-items: center;
|
|
87
|
+
border-top: 1px solid #e8e8e8;
|
|
88
|
+
padding: 10px 16px;
|
|
89
|
+
background: #fff;
|
|
90
|
+
border-radius: 0 0 2px 2px;
|
|
91
|
+
width: 100%;
|
|
92
|
+
|
|
93
|
+
.el-button {
|
|
94
|
+
width: 100px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.table-tag {
|
|
101
|
+
display: flex;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
align-items: center;
|
|
104
|
+
|
|
105
|
+
.el-tag {
|
|
106
|
+
margin: 0 2px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export default class MapLoader {
|
|
2
|
+
constructor(id) {
|
|
3
|
+
this.initMap(id)
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
initMap(id) {
|
|
7
|
+
let aMapScript = document.createElement('script')
|
|
8
|
+
aMapScript.setAttribute('src', 'https://webapi.amap.com/maps?v=1.4.11&key=c0af2a8bee25c16d7a307124ddb43056&plugin=AMap.CitySearch')
|
|
9
|
+
document.head.appendChild(aMapScript)
|
|
10
|
+
|
|
11
|
+
aMapScript.onload = () => {
|
|
12
|
+
AMap.plugin(["AMap.Geolocation"], () => {
|
|
13
|
+
var geolocation = new AMap.Geolocation({
|
|
14
|
+
enableHighAccuracy: true, // 是否使用高精度定位,默认:true
|
|
15
|
+
timeout: 10000, // 超过10秒后停止定位,默认:无穷大
|
|
16
|
+
maximumAge: 0, // 定位结果缓存0毫秒,默认:0
|
|
17
|
+
convert: true, // 自动偏移坐标,偏移后的坐标为高德坐标,默认:true
|
|
18
|
+
showButton: true, // 显示定位按钮,默认:true
|
|
19
|
+
buttonPosition: "LB", // 定位按钮停靠位置,默认:'LB',左下角
|
|
20
|
+
buttonOffset: new AMap.Pixel(10, 20), // 定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
|
|
21
|
+
showMarker: true, // 定位成功后在定位到的位置显示点标记,默认:true
|
|
22
|
+
showCircle: true, // 定位成功后用圆圈表示定位精度范围,默认:true
|
|
23
|
+
panToLocation: true, // 定位成功后将定位到的位置作为地图中心点,默认:true
|
|
24
|
+
zoomToAccuracy: true, // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
console.log(AMap)
|
|
28
|
+
geolocation.getCurrentPosition();
|
|
29
|
+
AMap.event.addListener(geolocation, 'complete', onComplete)
|
|
30
|
+
AMap.event.addListener(geolocation, 'error', onError)
|
|
31
|
+
|
|
32
|
+
function onComplete(data) {
|
|
33
|
+
// data是具体的定位信息
|
|
34
|
+
console.log(data)
|
|
35
|
+
console.log('123123')
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function onError(data) {
|
|
39
|
+
console.log(data)
|
|
40
|
+
// 定位出错
|
|
41
|
+
console.log('123123s')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 将毫秒,转换成时间字符串。例如说,xx 分钟
|
|
3
|
+
*
|
|
4
|
+
* @param ms 毫秒
|
|
5
|
+
* @returns {string} 字符串
|
|
6
|
+
*/
|
|
7
|
+
export function getDate(ms) {
|
|
8
|
+
const day = Math.floor(ms / (24 * 60 * 60 * 1000));
|
|
9
|
+
const hour = Math.floor((ms / (60 * 60 * 1000) - day * 24));
|
|
10
|
+
const minute = Math.floor(((ms / (60 * 1000)) - day * 24 * 60 - hour * 60));
|
|
11
|
+
const second = Math.floor((ms / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60));
|
|
12
|
+
if (day > 0) {
|
|
13
|
+
return day + "天" + hour + "小时" + minute + "分钟";
|
|
14
|
+
}
|
|
15
|
+
if (hour > 0) {
|
|
16
|
+
return hour + "小时" + minute + "分钟";
|
|
17
|
+
}
|
|
18
|
+
if (minute > 0) {
|
|
19
|
+
return minute + "分钟";
|
|
20
|
+
}
|
|
21
|
+
if (second > 0) {
|
|
22
|
+
return second + "秒";
|
|
23
|
+
} else {
|
|
24
|
+
return 0 + "秒";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 格式化时间
|
|
30
|
+
* @param date
|
|
31
|
+
* @param fmt
|
|
32
|
+
* @returns {*}
|
|
33
|
+
*/
|
|
34
|
+
export function formatDate(date, fmt = 'yyyy-MM-dd hh:mm:ss') {
|
|
35
|
+
if (/(y+)/.test(fmt)) {
|
|
36
|
+
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
|
37
|
+
}
|
|
38
|
+
let o = {
|
|
39
|
+
'M+': date.getMonth() + 1,
|
|
40
|
+
'd+': date.getDate(),
|
|
41
|
+
'h+': date.getHours(),
|
|
42
|
+
'm+': date.getMinutes(),
|
|
43
|
+
's+': date.getSeconds()
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
for (let k in o) {
|
|
47
|
+
if (new RegExp(`(${k})`).test(fmt)) {
|
|
48
|
+
let str = o[k] + '';
|
|
49
|
+
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return fmt;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
function padLeftZero(str) {
|
|
57
|
+
return ('00' + str).substr(str.length);
|
|
58
|
+
}
|