n20-common-lib 1.3.10 → 1.3.11
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/nstc-g6/assets/svg/404.svg +1 -0
- package/nstc-g6/assets/svg/addFile.svg +32 -0
- package/nstc-g6/assets/svg/bug.svg +1 -0
- package/nstc-g6/assets/svg/chart.svg +1 -0
- package/nstc-g6/assets/svg/clipboard.svg +1 -0
- package/nstc-g6/assets/svg/component.svg +1 -0
- package/nstc-g6/assets/svg/dashboard.svg +1 -0
- package/nstc-g6/assets/svg/deleteFile.svg +28 -0
- package/nstc-g6/assets/svg/documentation.svg +1 -0
- package/nstc-g6/assets/svg/drag.svg +1 -0
- package/nstc-g6/assets/svg/edit.svg +1 -0
- package/nstc-g6/assets/svg/education.svg +1 -0
- package/nstc-g6/assets/svg/email.svg +1 -0
- package/nstc-g6/assets/svg/example.svg +1 -0
- package/nstc-g6/assets/svg/excel.svg +1 -0
- package/nstc-g6/assets/svg/exit-fullscreen.svg +1 -0
- package/nstc-g6/assets/svg/eye-open.svg +1 -0
- package/nstc-g6/assets/svg/eye.svg +1 -0
- package/nstc-g6/assets/svg/favorite.svg +1 -0
- package/nstc-g6/assets/svg/favorite_active.svg +1 -0
- package/nstc-g6/assets/svg/favorite_x400.svg +1 -0
- package/nstc-g6/assets/svg/favorite_x400_active.svg +1 -0
- package/nstc-g6/assets/svg/favorite_x400_blank.svg +1 -0
- package/nstc-g6/assets/svg/filter.svg +16 -0
- package/nstc-g6/assets/svg/filter@2x.png +0 -0
- package/nstc-g6/assets/svg/filterActive.svg +16 -0
- package/nstc-g6/assets/svg/filterClose@2x.png +0 -0
- package/nstc-g6/assets/svg/form.svg +1 -0
- package/nstc-g6/assets/svg/fullscreen.svg +1 -0
- package/nstc-g6/assets/svg/guide.svg +1 -0
- package/nstc-g6/assets/svg/hourglass.svg +19 -0
- package/nstc-g6/assets/svg/icon.svg +1 -0
- package/nstc-g6/assets/svg/international.svg +1 -0
- package/nstc-g6/assets/svg/language.svg +1 -0
- package/nstc-g6/assets/svg/left-dis.svg +1 -0
- package/nstc-g6/assets/svg/left.svg +1 -0
- package/nstc-g6/assets/svg/link.svg +1 -0
- package/nstc-g6/assets/svg/list.svg +1 -0
- package/nstc-g6/assets/svg/lock.svg +1 -0
- package/nstc-g6/assets/svg/message-t.svg +1 -0
- package/nstc-g6/assets/svg/money.svg +1 -0
- package/nstc-g6/assets/svg/money3.svg +1 -0
- package/nstc-g6/assets/svg/money4.svg +1 -0
- package/nstc-g6/assets/svg/moneyTwo.svg +1 -0
- package/nstc-g6/assets/svg/msg_white.svg +1 -0
- package/nstc-g6/assets/svg/nested.svg +1 -0
- package/nstc-g6/assets/svg/newsearch.svg +19 -0
- package/nstc-g6/assets/svg/password.svg +1 -0
- package/nstc-g6/assets/svg/pdf.svg +1 -0
- package/nstc-g6/assets/svg/people.svg +1 -0
- package/nstc-g6/assets/svg/peoples.svg +1 -0
- package/nstc-g6/assets/svg/phone.svg +1 -0
- package/nstc-g6/assets/svg/phone_msg.svg +1 -0
- package/nstc-g6/assets/svg/qq.svg +1 -0
- package/nstc-g6/assets/svg/right-dis.svg +1 -0
- package/nstc-g6/assets/svg/right.svg +1 -0
- package/nstc-g6/assets/svg/search.svg +1 -0
- package/nstc-g6/assets/svg/searchActive.svg +19 -0
- package/nstc-g6/assets/svg/shopping.svg +1 -0
- package/nstc-g6/assets/svg/size.svg +1 -0
- package/nstc-g6/assets/svg/skill.svg +1 -0
- package/nstc-g6/assets/svg/star.svg +1 -0
- package/nstc-g6/assets/svg/steam.svg +1 -0
- package/nstc-g6/assets/svg/tab.svg +1 -0
- package/nstc-g6/assets/svg/table.svg +1 -0
- package/nstc-g6/assets/svg/theme.svg +1 -0
- package/nstc-g6/assets/svg/tree-table.svg +1 -0
- package/nstc-g6/assets/svg/tree.svg +1 -0
- package/nstc-g6/assets/svg/user.svg +1 -0
- package/nstc-g6/assets/svg/wechat.svg +1 -0
- package/nstc-g6/assets/svg/z-left-2-dis.svg +1 -0
- package/nstc-g6/assets/svg/z-left-2.svg +1 -0
- package/nstc-g6/assets/svg/z-right-2-dis.svg +1 -0
- package/nstc-g6/assets/svg/z-right-2.svg +1 -0
- package/nstc-g6/assets/svg/z-right.svg +1 -0
- package/nstc-g6/assets/svg/zip.svg +1 -0
- package/nstc-g6/components/Calendar/index.js +8 -0
- package/nstc-g6/components/Calendar/src/basic/month-table.vue +129 -0
- package/nstc-g6/components/Calendar/src/basic/year-table.vue +126 -0
- package/nstc-g6/components/Calendar/src/main.vue +442 -0
- package/nstc-g6/components/DialogForm/index.js +8 -0
- package/nstc-g6/components/DialogForm/src/demo/index.vue +56 -0
- package/nstc-g6/components/DialogForm/src/main.vue +189 -0
- package/nstc-g6/components/Form/A_DEMO/component/originalForm.vue +281 -0
- package/nstc-g6/components/Form/A_DEMO/config/config_3.js +1222 -0
- package/nstc-g6/components/Form/A_DEMO/index.vue +803 -0
- package/nstc-g6/components/Form/AutocompleteCustom/index.vue +72 -0
- package/nstc-g6/components/Form/BusinessSpecific/InputMultiple.vue +191 -0
- package/nstc-g6/components/Form/BusinessSpecific/InputWithUnit.vue +128 -0
- package/nstc-g6/components/Form/BusinessSpecific/SelectTreeDialog.vue +233 -0
- package/nstc-g6/components/Form/BusinessSpecific/readme.md +7 -0
- package/nstc-g6/components/Form/CascaderCustom/index.vue +101 -0
- package/nstc-g6/components/Form/CheckboxCustom/index.vue +84 -0
- package/nstc-g6/components/Form/Component.vue +661 -0
- package/nstc-g6/components/Form/ComponentSecond.vue +650 -0
- package/nstc-g6/components/Form/DatepickerCustom/index.vue +130 -0
- package/nstc-g6/components/Form/InputAndDialog/index.js +15 -0
- package/nstc-g6/components/Form/InputAndDialog/src/main.vue +395 -0
- package/nstc-g6/components/Form/InputCustom/demo/index.vue +65 -0
- package/nstc-g6/components/Form/InputCustom/index.vue +307 -0
- package/nstc-g6/components/Form/IntervalinputCustom/demo/index.vue +31 -0
- package/nstc-g6/components/Form/IntervalinputCustom/index.vue +118 -0
- package/nstc-g6/components/Form/Item.vue +330 -0
- package/nstc-g6/components/Form/ItemSecond.vue +269 -0
- package/nstc-g6/components/Form/List.vue +146 -0
- package/nstc-g6/components/Form/ListSecond.vue +130 -0
- package/nstc-g6/components/Form/RadioCustom/index.vue +73 -0
- package/nstc-g6/components/Form/SelectAccount/index.js +15 -0
- package/nstc-g6/components/Form/SelectAccount/src/demo/index.vue +58 -0
- package/nstc-g6/components/Form/SelectAccount/src/main.vue +283 -0
- package/nstc-g6/components/Form/SelectAndDialog/index.js +15 -0
- package/nstc-g6/components/Form/SelectAndDialog/src/main.vue +384 -0
- package/nstc-g6/components/Form/SelectCashFlow/index.js +15 -0
- package/nstc-g6/components/Form/SelectCashFlow/src/demo/index.vue +42 -0
- package/nstc-g6/components/Form/SelectCashFlow/src/main.vue +126 -0
- package/nstc-g6/components/Form/SelectCustom/demo/index.vue +82 -0
- package/nstc-g6/components/Form/SelectCustom/index.vue +488 -0
- package/nstc-g6/components/Form/SelectSubject/index.js +15 -0
- package/nstc-g6/components/Form/SelectSubject/src/demo/index.vue +85 -0
- package/nstc-g6/components/Form/SelectSubject/src/main.vue +182 -0
- package/nstc-g6/components/Form/SelectindialogCustom/demo/index.vue +188 -0
- package/nstc-g6/components/Form/SelectindialogCustom/index.vue +650 -0
- package/nstc-g6/components/Form/SelectindialogCustom/install.js +7 -0
- package/nstc-g6/components/Form/TableRadioCustom/demo/index.vue +53 -0
- package/nstc-g6/components/Form/TableRadioCustom/index.vue +183 -0
- package/nstc-g6/components/Form/TextCustom/index.vue +38 -0
- package/nstc-g6/components/Form/UploadCustom/demo/index.vue +31 -0
- package/nstc-g6/components/Form/UploadCustom/iconxitongshezhi-yichu.png +0 -0
- package/nstc-g6/components/Form/UploadCustom/index.vue +506 -0
- package/nstc-g6/components/Form/configs.js +191 -0
- package/nstc-g6/components/Form/configsSecond.js +161 -0
- package/nstc-g6/components/Form/index.js +8 -0
- package/nstc-g6/components/Form/index.scss +29 -0
- package/nstc-g6/components/Form/payeePersonSelect/index.js +15 -0
- package/nstc-g6/components/Form/payeePersonSelect/src/demo/index.vue +164 -0
- package/nstc-g6/components/Form/payeePersonSelect/src/main.vue +185 -0
- package/nstc-g6/components/Form/readme.txt +4 -0
- package/nstc-g6/components/FormGroup/index.js +8 -0
- package/nstc-g6/components/FormGroup/src/demo/config.js +23 -0
- package/nstc-g6/components/FormGroup/src/demo/index.vue +85 -0
- package/nstc-g6/components/FormGroup/src/main.vue +639 -0
- package/nstc-g6/components/FormGroup/src/validate.js +23 -0
- package/nstc-g6/components/InputTag/InputTag.vue +270 -0
- package/nstc-g6/components/NstcApprovel/NstcApprovel.vue +24 -0
- package/nstc-g6/components/NstcBackToTop/NstcBackToTop.vue +150 -0
- package/nstc-g6/components/NstcBranchLazyLoad/NstcBranchLazyLoad.vue +123 -0
- package/nstc-g6/components/NstcCharts/NstcCharts.vue +162 -0
- package/nstc-g6/components/NstcCharts/define.js +74 -0
- package/nstc-g6/components/NstcCharts/mixins/resize.js +56 -0
- package/nstc-g6/components/NstcConfirm/NstcConfirm.vue +152 -0
- package/nstc-g6/components/NstcConfirm/index.js +25 -0
- package/nstc-g6/components/NstcDialog/NstcDialog.vue +185 -0
- package/nstc-g6/components/NstcDialogForm/NstcDialogForm.vue +176 -0
- package/nstc-g6/components/NstcDialogTable/NstcDialogTable.vue +280 -0
- package/nstc-g6/components/NstcDropdown/NstcDropdown.vue +52 -0
- package/nstc-g6/components/NstcDropdownTree/NstcDropdownTree.vue +396 -0
- package/nstc-g6/components/NstcElectronicFile/NstcElectronicFile.vue +591 -0
- package/nstc-g6/components/NstcExcelCustomImport/NstcExcelCustomImport.vue +475 -0
- package/nstc-g6/components/NstcExcelCustomImport/img/upload@2x.png +0 -0
- package/nstc-g6/components/NstcExcelExport/NstcExcelExport.vue +145 -0
- package/nstc-g6/components/NstcExcelImport/NstcExcelImport.vue +1074 -0
- package/nstc-g6/components/NstcExcelImport/img/upload@2x.png +0 -0
- package/nstc-g6/components/NstcExcelImportN/NstcExcelImportN.vue +1166 -0
- package/nstc-g6/components/NstcExpandCollapse/NstcExpandCollapse.vue +130 -0
- package/nstc-g6/components/NstcExpandCollapse/index.scss +77 -0
- package/nstc-g6/components/NstcFileUpload/NstcFileUpload.vue +989 -0
- package/nstc-g6/components/NstcFileUpload/img/addFile.svg +32 -0
- package/nstc-g6/components/NstcFileUpload/img/delete.svg +24 -0
- package/nstc-g6/components/NstcFileUpload/img/deleteFile.svg +28 -0
- package/nstc-g6/components/NstcFileUpload/img/download.svg +24 -0
- package/nstc-g6/components/NstcFileUpload/img/inputUpload.svg +30 -0
- package/nstc-g6/components/NstcFileUpload/img/look-diabled.svg +24 -0
- package/nstc-g6/components/NstcFileUpload/img/look.svg +24 -0
- package/nstc-g6/components/NstcForm/A_DEMO/component/originalForm.vue +281 -0
- package/nstc-g6/components/NstcForm/A_DEMO/config/config_3.js +1222 -0
- package/nstc-g6/components/NstcForm/A_DEMO/index.vue +796 -0
- package/nstc-g6/components/NstcForm/AutocompleteCustom/index.vue +68 -0
- package/nstc-g6/components/NstcForm/BusinessSpecific/InputMultiple.vue +189 -0
- package/nstc-g6/components/NstcForm/BusinessSpecific/InputWithUnit.vue +128 -0
- package/nstc-g6/components/NstcForm/BusinessSpecific/SelectTreeDialog.vue +233 -0
- package/nstc-g6/components/NstcForm/BusinessSpecific/readme.md +7 -0
- package/nstc-g6/components/NstcForm/CascaderCustom/index.vue +101 -0
- package/nstc-g6/components/NstcForm/CheckboxCustom/index.vue +84 -0
- package/nstc-g6/components/NstcForm/Component.vue +684 -0
- package/nstc-g6/components/NstcForm/ComponentSecond.vue +650 -0
- package/nstc-g6/components/NstcForm/DatepickerCustom/index.vue +130 -0
- package/nstc-g6/components/NstcForm/InputAndDialog/NstcInputAndDialog.vue +389 -0
- package/nstc-g6/components/NstcForm/InputCustom/index.vue +314 -0
- package/nstc-g6/components/NstcForm/IntervalInputCustom/index.vue +116 -0
- package/nstc-g6/components/NstcForm/Item.vue +327 -0
- package/nstc-g6/components/NstcForm/ItemSecond.vue +269 -0
- package/nstc-g6/components/NstcForm/List.vue +146 -0
- package/nstc-g6/components/NstcForm/ListSecond.vue +130 -0
- package/nstc-g6/components/NstcForm/RadioCustom/index.vue +73 -0
- package/nstc-g6/components/NstcForm/SelectAccount/NstcSelectAccount.vue +334 -0
- package/nstc-g6/components/NstcForm/SelectAndDialog/NstcSelectAndDialog.vue +377 -0
- package/nstc-g6/components/NstcForm/SelectCashFlow/NstcSelectCashFlow.vue +123 -0
- package/nstc-g6/components/NstcForm/SelectCustom/index.vue +460 -0
- package/nstc-g6/components/NstcForm/SelectSubject/NstcSelectSubject.vue +185 -0
- package/nstc-g6/components/NstcForm/SelectindialogCustom/index.vue +648 -0
- package/nstc-g6/components/NstcForm/TableRadioCustom/index.vue +183 -0
- package/nstc-g6/components/NstcForm/TextCustom/index.vue +38 -0
- package/nstc-g6/components/NstcForm/UploadCustom/iconxitongshezhi-yichu.png +0 -0
- package/nstc-g6/components/NstcForm/UploadCustom/index.vue +500 -0
- package/nstc-g6/components/NstcForm/configs.js +191 -0
- package/nstc-g6/components/NstcForm/configsSecond.js +161 -0
- package/nstc-g6/components/NstcForm/index.js +8 -0
- package/nstc-g6/components/NstcForm/index.scss +29 -0
- package/nstc-g6/components/NstcForm/payeePersonSelect/NstcPayeePerson.vue +188 -0
- package/nstc-g6/components/NstcForm/readme.txt +4 -0
- package/nstc-g6/components/NstcPagination/NstcPagination.vue +428 -0
- package/nstc-g6/components/NstcPagination/setPageNum.png +0 -0
- package/nstc-g6/components/NstcPagination/setpagedefault.png +0 -0
- package/nstc-g6/components/NstcScreenFull/NstcScreenFull.vue +70 -0
- package/nstc-g6/components/NstcSelectTree/NstcSelectTree.vue +729 -0
- package/nstc-g6/components/NstcSelectTreeList/NstcSelectTreeList.vue +676 -0
- package/nstc-g6/components/NstcSticky/NstcSticky.vue +97 -0
- package/nstc-g6/components/NstcSvgIcon/NstcSvgIcon.vue +72 -0
- package/nstc-g6/components/NstcTab/NstcTab.vue +80 -0
- package/nstc-g6/components/NstcTabWithBadge/NstcTabWithBadge.vue +45 -0
- package/nstc-g6/components/NstcTabWithBadge/index.scss +31 -0
- package/nstc-g6/components/NstcTable/ElTableColumnCustom/index.vue +292 -0
- package/nstc-g6/components/NstcTable/NstcTable.vue +460 -0
- package/nstc-g6/components/NstcTableSet/NstcTableSet.vue +801 -0
- package/nstc-g6/components/NstcThemePicker/NstcThemePicker.vue +186 -0
- package/nstc-g6/components/NstcUploadCustomExcel/NstcUploadCustomExcel.vue +330 -0
- package/nstc-g6/components/NstcUploadExcel/NstcUploadExcel.vue +145 -0
- package/nstc-g6/components/NstcWorkBench/NstcWorkBench.vue +176 -0
- package/nstc-g6/components/Search/NstcSearch.vue +583 -0
- package/nstc-g6/components/Search/src/demo/index copy.vue +101 -0
- package/nstc-g6/components/Search/src/demo/index.vue +103 -0
- package/nstc-g6/components/Search/src/main copy.vue +607 -0
- package/nstc-g6/components/approvelTwo/main.vue +220 -0
- package/nstc-g6/components/approvelTwo/progress.vue +154 -0
- package/nstc-g6/directives/VCopy/index.js +60 -0
- package/nstc-g6/directives/VNstcNumber/index.js +14 -0
- package/nstc-g6/directives/VNstcNumber/temp.js +446 -0
- package/nstc-g6/index.js +193 -0
- package/nstc-g6/utils/auth.js +2 -0
- package/nstc-g6/utils/axios.js +2 -0
- package/nstc-g6/utils/dateAndValidator.js +649 -0
- package/nstc-g6/utils/debounce.js +40 -0
- package/nstc-g6/utils/parseTime.js +48 -0
- package/nstc-g6/utils/validate/index.js +7 -0
- package/nstc-g6/utils/vendor/Export2Excel.js +229 -0
- package/nstc-g6/utils/vendor/Export2Zip.js +24 -0
- package/nstc-g6/utils/vue-bus.js +5 -0
- package/package.json +8 -2
- package/src/assets/css/_coreLib.scss +9 -1
- package/src/components/ChildRange/index.vue +2 -37
- package/src/components/ChildRange/style.scss +34 -0
- package/src/components/PageHeader/index.vue +2 -44
- package/src/components/PageHeader/style.scss +39 -0
- package/src/components/Search/index.vue +1 -97
- package/src/components/Search/style.scss +93 -0
- package/src/components/Table/ThSelectHeader.vue +2 -11
- package/src/components/Table/index.vue +4 -2
- package/src/directives/VTitle/index.js +14 -17
- package/style/css/normalize.scss +6 -6
- package/style/index.css +3 -3
- package/style/index.css.map +1 -1
- package/style/server-config.jsonc +527 -410
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
功能: 工作台日历
|
|
3
|
+
作者: nstc
|
|
4
|
+
创建时间: 2021-02-05
|
|
5
|
+
-->
|
|
6
|
+
<template>
|
|
7
|
+
<div class="nstc-calendar" @click.stop="">
|
|
8
|
+
<div v-show="type === 'normal'">
|
|
9
|
+
<div class="nstc-calendar_header">
|
|
10
|
+
<div v-if="$i18n.locale === 'zh'">
|
|
11
|
+
<span @click="chooseYear">{{ yearStr }}年 </span>
|
|
12
|
+
<span @click="chooseMonth">{{ monthStr }}</span>
|
|
13
|
+
</div>
|
|
14
|
+
<div v-else>
|
|
15
|
+
<span @click="chooseMonth">{{ monthStr }} </span>
|
|
16
|
+
<span @click="chooseYear">{{ yearStr }}</span>
|
|
17
|
+
</div>
|
|
18
|
+
<div>
|
|
19
|
+
<i class="el-icon-arrow-up" @click="lastMonth"></i>
|
|
20
|
+
<i class="el-icon-arrow-down" @click="nextMonth"></i>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<el-divider />
|
|
24
|
+
<div class="nstc-calendar_weeKs">
|
|
25
|
+
<div v-for="(item, index) in weeks" :key="index">{{ item }}</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="nstc-calendar_date_box">
|
|
28
|
+
<div
|
|
29
|
+
v-for="(item, index) in showDates"
|
|
30
|
+
:key="index"
|
|
31
|
+
:date="item.date"
|
|
32
|
+
:class="{
|
|
33
|
+
notCurrentMonthDay: !item.isCurrentMonth,
|
|
34
|
+
'nstc-calendar-data-cell': true,
|
|
35
|
+
'nstc-calendar-current-day': item.isCurrentDate
|
|
36
|
+
}"
|
|
37
|
+
>
|
|
38
|
+
<span>{{ item.day }}</span>
|
|
39
|
+
<span v-if="item.festival.chn" class="festival-flag"></span>
|
|
40
|
+
<span v-if="item.festival.usa" class="festival-flag"></span>
|
|
41
|
+
<span v-if="item.festival.jpn" class="festival-flag"></span>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div v-if="type === 'year'">
|
|
46
|
+
<year-table :start-year="chooseYearStr" @pick="yearPick" />
|
|
47
|
+
</div>
|
|
48
|
+
<div v-if="type === 'month'">
|
|
49
|
+
<month-table :value="chooseYearStr" @pick="monthPick" />
|
|
50
|
+
</div>
|
|
51
|
+
<!-- 节日 -->
|
|
52
|
+
<div class="nstc-calendar-festival">
|
|
53
|
+
<div>{{ $t(`calendar.festival`) }}:</div>
|
|
54
|
+
<div v-for="(item, index) in festivalList" :key="index">
|
|
55
|
+
<span :style="`background-color: ${item.color};`"></span>
|
|
56
|
+
<span>{{ item.label }}</span>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<!-- <div>当月一号星期: {{ firstDayWeek }}</div>-->
|
|
60
|
+
<!-- <div>当月有多少天: {{ dayNum }}</div>-->
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script>
|
|
65
|
+
import monthTable from './basic/month-table'
|
|
66
|
+
import yearTable from './basic/year-table'
|
|
67
|
+
export default {
|
|
68
|
+
name: 'NstcCalendar',
|
|
69
|
+
components: {
|
|
70
|
+
monthTable,
|
|
71
|
+
yearTable
|
|
72
|
+
},
|
|
73
|
+
data() {
|
|
74
|
+
return {
|
|
75
|
+
year: '',
|
|
76
|
+
month: '',
|
|
77
|
+
currentDate: '',
|
|
78
|
+
weeks: [
|
|
79
|
+
this.$t('calendar.week_7'),
|
|
80
|
+
this.$t('calendar.week_1'),
|
|
81
|
+
this.$t('calendar.week_2'),
|
|
82
|
+
this.$t('calendar.week_3'),
|
|
83
|
+
this.$t('calendar.week_4'),
|
|
84
|
+
this.$t('calendar.week_5'),
|
|
85
|
+
this.$t('calendar.week_6')
|
|
86
|
+
],
|
|
87
|
+
firstDayWeek: null,
|
|
88
|
+
lastDateCell: [],
|
|
89
|
+
dateCell: [],
|
|
90
|
+
nextDateCell: [],
|
|
91
|
+
dayNum: 0,
|
|
92
|
+
lastMonthDayNum: 0,
|
|
93
|
+
showDates: [],
|
|
94
|
+
type: 'normal',
|
|
95
|
+
chooseMonthStr: '',
|
|
96
|
+
chooseYearStr: '',
|
|
97
|
+
festivalList: [
|
|
98
|
+
{ color: '#C03639', label: this.$t('calendar.chn') },
|
|
99
|
+
{ color: '#409eff', label: this.$t('calendar.usa') },
|
|
100
|
+
{ color: '#4AB7BD', label: this.$t('calendar.jpn') }
|
|
101
|
+
],
|
|
102
|
+
i18nFestivalList: {
|
|
103
|
+
chn: [
|
|
104
|
+
'2020/10/01',
|
|
105
|
+
'2020/10/02',
|
|
106
|
+
'2020/10/03',
|
|
107
|
+
'2020/10/04',
|
|
108
|
+
'2020/10/05',
|
|
109
|
+
'2020/10/06',
|
|
110
|
+
'2020/10/07',
|
|
111
|
+
'2020/10/08'
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
computed: {
|
|
117
|
+
yearStr() {
|
|
118
|
+
return this.year
|
|
119
|
+
},
|
|
120
|
+
monthStr() {
|
|
121
|
+
return this.$t(`calendar.month_${this.month}`)
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
created() {
|
|
125
|
+
this.initCalendar('init')
|
|
126
|
+
},
|
|
127
|
+
methods: {
|
|
128
|
+
// 根据年月获取给定月一号是星期几
|
|
129
|
+
getWeekByMonth(year, month) {
|
|
130
|
+
const t = new Date(`${year}/${month}`)
|
|
131
|
+
return t.getDay()
|
|
132
|
+
},
|
|
133
|
+
// 根据年月获取当月有多少天
|
|
134
|
+
getDayByMonth(year, month) {
|
|
135
|
+
const t = new Date(year, month - 1, 0)
|
|
136
|
+
return t.getDate()
|
|
137
|
+
},
|
|
138
|
+
// 小于10的添加0
|
|
139
|
+
formatter(v) {
|
|
140
|
+
if (typeof v === 'number') {
|
|
141
|
+
if (v < 10) {
|
|
142
|
+
return '0' + v
|
|
143
|
+
} else {
|
|
144
|
+
return v
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
return ''
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
// 初始化项目
|
|
151
|
+
initCalendar(flag) {
|
|
152
|
+
if (flag === 'init') {
|
|
153
|
+
const t = new Date()
|
|
154
|
+
this.year = t.getFullYear()
|
|
155
|
+
this.month = t.getMonth() + 1
|
|
156
|
+
this.currentDate = t.getDate()
|
|
157
|
+
}
|
|
158
|
+
// 本月第一天星期几
|
|
159
|
+
this.firstDayWeek = this.getWeekByMonth(this.year, this.month)
|
|
160
|
+
// 本月有多少天
|
|
161
|
+
this.dayNum = this.getDayByMonth(this.year, this.month)
|
|
162
|
+
// 上一月有多少天 (考虑1月)
|
|
163
|
+
let lastYear = ''
|
|
164
|
+
let lastMonth = ''
|
|
165
|
+
let nextYear = ''
|
|
166
|
+
let nextMonth = ''
|
|
167
|
+
if (Number(this.month) === 1) {
|
|
168
|
+
lastYear = this.year - 1
|
|
169
|
+
lastMonth = 12
|
|
170
|
+
} else {
|
|
171
|
+
lastYear = this.year
|
|
172
|
+
lastMonth = this.month - 1
|
|
173
|
+
if (Number(this.month) === 12) {
|
|
174
|
+
nextYear = this.year + 1
|
|
175
|
+
nextMonth = 1
|
|
176
|
+
} else {
|
|
177
|
+
nextYear = this.year
|
|
178
|
+
nextMonth = this.month + 1
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
this.lastMonthDayNum = this.getDayByMonth(lastYear, lastMonth)
|
|
182
|
+
// 上个月
|
|
183
|
+
this.lastDateCell = []
|
|
184
|
+
for (let i = 0; i < this.firstDayWeek; i++) {
|
|
185
|
+
const minDate = this.lastMonthDayNum - this.firstDayWeek
|
|
186
|
+
const day = minDate + i + 1
|
|
187
|
+
const date = `${lastYear}/${lastMonth}/${this.formatter(day)}`
|
|
188
|
+
this.lastDateCell.push({
|
|
189
|
+
day,
|
|
190
|
+
isCurrentMonth: false,
|
|
191
|
+
date,
|
|
192
|
+
festival: this.getFestival(date),
|
|
193
|
+
isCurrentDate: Number(day) === Number(this.currentDate)
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
// 本月
|
|
197
|
+
this.dateCell = []
|
|
198
|
+
for (let j = 1; j < this.dayNum; j++) {
|
|
199
|
+
const date = `${this.year}/${this.month}/${this.formatter(j)}`
|
|
200
|
+
this.dateCell.push({
|
|
201
|
+
day: j,
|
|
202
|
+
isCurrentMonth: true,
|
|
203
|
+
date,
|
|
204
|
+
festival: this.getFestival(date),
|
|
205
|
+
isCurrentDate: Number(j) === Number(this.currentDate)
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
// 下月 日历总共六行
|
|
209
|
+
this.nextDateCell = []
|
|
210
|
+
const fillDate = 42 - (this.lastDateCell.length + this.dateCell.length)
|
|
211
|
+
for (let n = 1; n <= fillDate; n++) {
|
|
212
|
+
const date = `${nextYear}/${nextMonth}/${this.formatter(n)}`
|
|
213
|
+
this.nextDateCell.push({
|
|
214
|
+
day: n,
|
|
215
|
+
isCurrentMonth: false,
|
|
216
|
+
date,
|
|
217
|
+
festival: this.getFestival(date),
|
|
218
|
+
isCurrentDate: Number(n) === Number(this.currentDate)
|
|
219
|
+
})
|
|
220
|
+
}
|
|
221
|
+
// 将要显示的内容显示出来
|
|
222
|
+
this.showDates = this.lastDateCell.concat(
|
|
223
|
+
this.dateCell,
|
|
224
|
+
this.nextDateCell
|
|
225
|
+
)
|
|
226
|
+
},
|
|
227
|
+
// 查看上月数据
|
|
228
|
+
lastMonth() {
|
|
229
|
+
if (Number(this.month) === 1) {
|
|
230
|
+
this.month = 12
|
|
231
|
+
this.year--
|
|
232
|
+
} else {
|
|
233
|
+
this.month--
|
|
234
|
+
}
|
|
235
|
+
this.initCalendar()
|
|
236
|
+
},
|
|
237
|
+
// 查看下月数据
|
|
238
|
+
nextMonth() {
|
|
239
|
+
if (Number(this.month) === 12) {
|
|
240
|
+
this.month = 1
|
|
241
|
+
this.year++
|
|
242
|
+
} else {
|
|
243
|
+
this.month++
|
|
244
|
+
}
|
|
245
|
+
this.initCalendar()
|
|
246
|
+
},
|
|
247
|
+
// 选择年
|
|
248
|
+
chooseYear() {
|
|
249
|
+
this.chooseYearStr = this.year
|
|
250
|
+
this.type = 'year'
|
|
251
|
+
},
|
|
252
|
+
chooseMonth() {
|
|
253
|
+
this.chooseYearStr = this.year
|
|
254
|
+
this.type = 'month'
|
|
255
|
+
},
|
|
256
|
+
// 选择月
|
|
257
|
+
monthPick(data) {
|
|
258
|
+
this.type = data.type
|
|
259
|
+
this.year = data.year
|
|
260
|
+
this.month = data.month
|
|
261
|
+
this.initCalendar()
|
|
262
|
+
},
|
|
263
|
+
// 选择月
|
|
264
|
+
yearPick(data) {
|
|
265
|
+
this.type = data.type
|
|
266
|
+
this.year = data.year
|
|
267
|
+
this.chooseYearStr = this.year
|
|
268
|
+
},
|
|
269
|
+
// 获得当前日期的节日
|
|
270
|
+
getFestival(date) {
|
|
271
|
+
const festivalObj = {
|
|
272
|
+
chn: false,
|
|
273
|
+
usa: false,
|
|
274
|
+
uk: false
|
|
275
|
+
}
|
|
276
|
+
if (this.i18nFestivalList.chn.includes(date)) {
|
|
277
|
+
festivalObj.chn = true
|
|
278
|
+
}
|
|
279
|
+
return festivalObj
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
</script>
|
|
284
|
+
|
|
285
|
+
<style scoped lang="scss">
|
|
286
|
+
// @import '~@/theme/theme1/styles/variables.scss';
|
|
287
|
+
$nstcCalendarBorderColor: #dfe6ec;
|
|
288
|
+
$festival_CHN: #c03639;
|
|
289
|
+
$festival_USA: #409eff;
|
|
290
|
+
$festival_JPN: #4ab7bd;
|
|
291
|
+
$festival_UK: #30b08f;
|
|
292
|
+
$festival_KOR: #fec171;
|
|
293
|
+
.nstc-calendar {
|
|
294
|
+
.el-divider {
|
|
295
|
+
margin: 0;
|
|
296
|
+
}
|
|
297
|
+
color: #606266;
|
|
298
|
+
border: 1px solid #e4e7ed;
|
|
299
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
300
|
+
background: #fff;
|
|
301
|
+
border-radius: 4px;
|
|
302
|
+
width: 100%;
|
|
303
|
+
min-width: 360px;
|
|
304
|
+
min-height: 300px;
|
|
305
|
+
.nstc-calendar_header {
|
|
306
|
+
display: flex;
|
|
307
|
+
> div {
|
|
308
|
+
flex: 1;
|
|
309
|
+
font-size: 14px;
|
|
310
|
+
margin: 10px;
|
|
311
|
+
}
|
|
312
|
+
> div:nth-child(1) {
|
|
313
|
+
> span {
|
|
314
|
+
cursor: pointer;
|
|
315
|
+
&:hover {
|
|
316
|
+
color: $eBaseColor;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
> div:nth-child(2) {
|
|
321
|
+
font-size: 16px;
|
|
322
|
+
text-align: right;
|
|
323
|
+
i {
|
|
324
|
+
margin-right: 20px;
|
|
325
|
+
&:hover {
|
|
326
|
+
cursor: pointer;
|
|
327
|
+
color: $eBaseColor;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
.nstc-calendar_weeKs {
|
|
333
|
+
margin: 7px auto;
|
|
334
|
+
display: flex;
|
|
335
|
+
> div {
|
|
336
|
+
flex: 1;
|
|
337
|
+
text-align: center;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
.nstc-calendar_date_box {
|
|
341
|
+
display: flex;
|
|
342
|
+
flex-wrap: wrap;
|
|
343
|
+
justify-content: center;
|
|
344
|
+
margin-bottom: 20px;
|
|
345
|
+
> div {
|
|
346
|
+
padding: 7px;
|
|
347
|
+
border: 1px solid $nstcCalendarBorderColor;
|
|
348
|
+
width: 14.285714%;
|
|
349
|
+
border-bottom: none;
|
|
350
|
+
border-right: none;
|
|
351
|
+
position: relative;
|
|
352
|
+
height: 35px;
|
|
353
|
+
> span:nth-child(1) {
|
|
354
|
+
}
|
|
355
|
+
&:hover {
|
|
356
|
+
background-color: $eBaseColor;
|
|
357
|
+
color: #fff;
|
|
358
|
+
cursor: pointer;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
> div:nth-child(7n) {
|
|
362
|
+
// border-right: 1px solid $nstcCalendarBorderColor;
|
|
363
|
+
}
|
|
364
|
+
> div:nth-child(7n + 1) {
|
|
365
|
+
border-left: none;
|
|
366
|
+
}
|
|
367
|
+
> div:nth-child(36) {
|
|
368
|
+
border-bottom: 1px solid $nstcCalendarBorderColor;
|
|
369
|
+
}
|
|
370
|
+
> div:nth-child(37) {
|
|
371
|
+
border-bottom: 1px solid $nstcCalendarBorderColor;
|
|
372
|
+
}
|
|
373
|
+
> div:nth-child(38) {
|
|
374
|
+
border-bottom: 1px solid $nstcCalendarBorderColor;
|
|
375
|
+
}
|
|
376
|
+
> div:nth-child(39) {
|
|
377
|
+
border-bottom: 1px solid $nstcCalendarBorderColor;
|
|
378
|
+
}
|
|
379
|
+
> div:nth-child(40) {
|
|
380
|
+
border-bottom: 1px solid $nstcCalendarBorderColor;
|
|
381
|
+
}
|
|
382
|
+
> div:nth-child(41) {
|
|
383
|
+
border-bottom: 1px solid $nstcCalendarBorderColor;
|
|
384
|
+
}
|
|
385
|
+
> div:nth-child(42) {
|
|
386
|
+
border-bottom: 1px solid $nstcCalendarBorderColor;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
.nstc-calendar-data-cell {
|
|
390
|
+
position: relative;
|
|
391
|
+
.festival-flag {
|
|
392
|
+
display: inline-block;
|
|
393
|
+
width: 4px;
|
|
394
|
+
height: 4px;
|
|
395
|
+
border-radius: 2px;
|
|
396
|
+
position: absolute;
|
|
397
|
+
bottom: 4px;
|
|
398
|
+
left: 10px;
|
|
399
|
+
border: 1px solid #000;
|
|
400
|
+
}
|
|
401
|
+
.festival-flag:nth-child(2) {
|
|
402
|
+
left: 10px;
|
|
403
|
+
border: 1px solid $festival_CHN;
|
|
404
|
+
background-color: $festival_CHN;
|
|
405
|
+
}
|
|
406
|
+
.festival-flag:nth-child(3) {
|
|
407
|
+
left: 18px;
|
|
408
|
+
border: 1px solid $festival_USA;
|
|
409
|
+
background-color: $festival_USA;
|
|
410
|
+
}
|
|
411
|
+
.festival-flag:nth-child(4) {
|
|
412
|
+
left: 26px;
|
|
413
|
+
border: 1px solid $festival_UK;
|
|
414
|
+
background-color: $festival_UK;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
.notCurrentMonthDay {
|
|
418
|
+
color: #c0c4cc !important;
|
|
419
|
+
}
|
|
420
|
+
.nstc-calendar-festival {
|
|
421
|
+
display: flex;
|
|
422
|
+
margin-bottom: 10px;
|
|
423
|
+
> div {
|
|
424
|
+
display: flex;
|
|
425
|
+
align-items: center;
|
|
426
|
+
margin-left: 10px;
|
|
427
|
+
> span:nth-child(1) {
|
|
428
|
+
display: inline-block;
|
|
429
|
+
width: 4px;
|
|
430
|
+
height: 4px;
|
|
431
|
+
border-radius: 2px;
|
|
432
|
+
margin-right: 10px;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
.nstc-calendar-current-day {
|
|
437
|
+
background-color: $eBaseColor;
|
|
438
|
+
color: #fff;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
</style>
|
|
442
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="">
|
|
3
|
+
<el-button @click="visible = true">
|
|
4
|
+
点我
|
|
5
|
+
</el-button>
|
|
6
|
+
<DialogFormCustom
|
|
7
|
+
:visible="visible"
|
|
8
|
+
:form-config="formConfig"
|
|
9
|
+
:rules="rules"
|
|
10
|
+
@confirm="handleConfirm"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import DialogFormCustom from '../main'
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
components: {
|
|
20
|
+
DialogFormCustom
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
visible: false,
|
|
26
|
+
formConfig: [[
|
|
27
|
+
{
|
|
28
|
+
mold: 'input',
|
|
29
|
+
name: '姓名',
|
|
30
|
+
prop: 'prop1'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
mold: 'datepicker',
|
|
34
|
+
name: '日期',
|
|
35
|
+
prop: 'prop2'
|
|
36
|
+
}
|
|
37
|
+
]],
|
|
38
|
+
rules: {
|
|
39
|
+
prop1: [
|
|
40
|
+
{ required: true, message: '姓名不能为空', trigger: 'blur' }
|
|
41
|
+
],
|
|
42
|
+
prop2: [
|
|
43
|
+
{ required: true, message: '日期不能为空', trigger: 'blur' }
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
methods: {
|
|
50
|
+
handleConfirm() {
|
|
51
|
+
this.visible = false
|
|
52
|
+
return Promise.resolve()
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
功能: 表单里面的弹框查询
|
|
3
|
+
作者: nstc
|
|
4
|
+
创建时间: 2021-02-04
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<DialogCustom
|
|
10
|
+
v-model="dialogVisible"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
@confirm="handleConfirm"
|
|
13
|
+
@cancel="handleCancel"
|
|
14
|
+
>
|
|
15
|
+
<slot name="before" />
|
|
16
|
+
<NstcForm
|
|
17
|
+
ref="dialogForm"
|
|
18
|
+
v-model="formModel"
|
|
19
|
+
:reset.sync="reset"
|
|
20
|
+
:mount-and-query="false"
|
|
21
|
+
:config="formConfig"
|
|
22
|
+
:rules="rules"
|
|
23
|
+
:pureable="pureable"
|
|
24
|
+
:label-position="labelPosition"
|
|
25
|
+
:label-width="labelWidth"
|
|
26
|
+
:show-message="showMessage"
|
|
27
|
+
:validate-on-rule-change="validateOnRuleChange"
|
|
28
|
+
:mode="mode"
|
|
29
|
+
/>
|
|
30
|
+
<slot name="after" />
|
|
31
|
+
</DialogCustom>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
import DialogCustom from '../../Dialog/src/main'
|
|
37
|
+
import NstcForm from '../../Form/Component'
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
name: 'DialogFormCustom',
|
|
41
|
+
components: {
|
|
42
|
+
DialogCustom,
|
|
43
|
+
NstcForm
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
inheritAttrs: false,
|
|
47
|
+
|
|
48
|
+
model: {
|
|
49
|
+
prop: 'formModel'
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
props: {
|
|
53
|
+
formModel: {
|
|
54
|
+
default: () => ({}),
|
|
55
|
+
type: Object
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
visible: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
showMessage: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
formConfig: {
|
|
69
|
+
type: Array,
|
|
70
|
+
default: () => []
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
rules: {
|
|
74
|
+
type: Object,
|
|
75
|
+
default: null
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
labelPosition: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: 'right'
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
labelWidth: {
|
|
84
|
+
type: [String, Number],
|
|
85
|
+
default: 80
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
resetAfterClose: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: true
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
// 是否是纯净模式 (删除 renderable === false 的item.prop对应model的值)
|
|
94
|
+
pureable: {
|
|
95
|
+
default: false,
|
|
96
|
+
type: Boolean
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
validateOnRuleChange: {
|
|
100
|
+
default: false,
|
|
101
|
+
type: Boolean
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
mode: {
|
|
105
|
+
default: 'horizontal',
|
|
106
|
+
validator: function(val) {
|
|
107
|
+
return ['horizontal', 'vertical'].includes(val)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
data() {
|
|
113
|
+
return {
|
|
114
|
+
reset: false
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
computed: {
|
|
119
|
+
dialogVisible: {
|
|
120
|
+
get() {
|
|
121
|
+
return this.visible
|
|
122
|
+
},
|
|
123
|
+
set(val) {
|
|
124
|
+
this.$emit('update:visible', val)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
watch: {
|
|
130
|
+
formModel: {
|
|
131
|
+
deep: true,
|
|
132
|
+
handler(val) {
|
|
133
|
+
this.$emit('input', val)
|
|
134
|
+
this.$emit('change', val)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
methods: {
|
|
140
|
+
async handleConfirm() {
|
|
141
|
+
try {
|
|
142
|
+
if (this.rules) {
|
|
143
|
+
await this.$refs.dialogForm.validate()
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (this.$listeners.confirm) {
|
|
147
|
+
await this.$listeners.confirm(this.formModel) // $listeners.confirm 须返回Promise
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
await this.$nextTick()
|
|
151
|
+
|
|
152
|
+
this.handleReset()
|
|
153
|
+
|
|
154
|
+
return Promise.resolve()
|
|
155
|
+
} catch (err) {
|
|
156
|
+
return Promise.reject(err)
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
async handleCancel() {
|
|
161
|
+
try {
|
|
162
|
+
const model = JSON.parse(JSON.stringify(this.formModel))
|
|
163
|
+
|
|
164
|
+
this.$listeners.cancel && await this.$listeners.cancel(model) // $listeners.confirm 须返回Promise
|
|
165
|
+
|
|
166
|
+
this.handleReset()
|
|
167
|
+
|
|
168
|
+
return Promise.resolve()
|
|
169
|
+
} catch (err) {
|
|
170
|
+
return Promise.reject(err)
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
clearFormValidate() {
|
|
175
|
+
this.$refs.dialogForm.clearValidate()
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
handleReset() {
|
|
179
|
+
if (this.resetAfterClose) {
|
|
180
|
+
this.reset = true
|
|
181
|
+
this.$nextTick(() => {
|
|
182
|
+
this.$refs.dialogForm && this.$refs.dialogForm.clearValidate()
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
</script>
|
|
189
|
+
|