diff --git a/.gitignore b/.gitignore index 5b70a77b..f1193cd0 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ yarn-error.log* /oms/dist/ /project/*/index.js /project/*/dist +/ui/package-lock.json diff --git a/.npmignore b/.npmignore index 43798247..5066b6c6 100644 --- a/.npmignore +++ b/.npmignore @@ -6,6 +6,7 @@ core/ public/ project/ .idea/ +ui/lib/ # 忽略指定文件 vue.config.js diff --git a/.npmrc b/.npmrc index 81dffa18..d8bc5fe4 100644 --- a/.npmrc +++ b/.npmrc @@ -1,4 +1,4 @@ -registry=http://192.168.1.87:4873/ +registry=http://cli.sinoecare.net/ email=aixianling@sinoecare.com always-auth=true _auth="YWRtaW46YWRtaW4xMjM=" diff --git a/components/AiAddressBookMenu.vue b/components/AiAddressBookMenu.vue index 4688ca48..7ee7af26 100644 --- a/components/AiAddressBookMenu.vue +++ b/components/AiAddressBookMenu.vue @@ -109,7 +109,7 @@ export default { if (res?.data) { this.list = res.data?.filter(e => !e.parentid) this.list.map(p => this.addChild(p, res.data, {parent: 'parentid'})) - + this.$nextTick(() => { this.$refs.tree.setCurrentKey(res.data[0].id) this.$emit('select', res.data[0]) @@ -209,7 +209,7 @@ export default { font-size: 14px; } - ::v-deep .el-tree { + :deep( .el-tree ){ width: 100%; margin-top: 4px; background: transparent; diff --git a/components/AiDrag.vue b/components/AiDrag.vue index e563a288..78941b00 100644 --- a/components/AiDrag.vue +++ b/components/AiDrag.vue @@ -28,7 +28,7 @@ export default { right: 0; pointer-events: none; - ::v-deep.vdr { + :deep(.vdr ){ pointer-events: auto; } } diff --git a/components/AiDvPartyOrg.vue b/components/AiDvPartyOrg.vue index a2494f02..3b547140 100644 --- a/components/AiDvPartyOrg.vue +++ b/components/AiDvPartyOrg.vue @@ -132,7 +132,7 @@ export default { height: 300%; } - ::v-deep .org-chart-container { + :deep( .org-chart-container ){ color: #FFFFFF; font-size: 16px; diff --git a/components/AiDvRender.vue b/components/AiDvRender.vue index 672a2dfa..7cb62c9a 100644 --- a/components/AiDvRender.vue +++ b/components/AiDvRender.vue @@ -178,7 +178,7 @@ export default { \ No newline at end of file + diff --git a/packages/conv/creditScore/AppIntegralAudit/components/Detail.vue b/packages/conv/creditScore/AppIntegralAudit/components/Detail.vue index b3e465c2..950a4c0c 100644 --- a/packages/conv/creditScore/AppIntegralAudit/components/Detail.vue +++ b/packages/conv/creditScore/AppIntegralAudit/components/Detail.vue @@ -218,15 +218,15 @@ export default { display: flex; align-items: center; - ::v-deep .el-form-item .el-form-item__content { + :deep( .el-form-item .el-form-item__content ){ margin-left: 0 !important; } - ::v-deep .ai-select { + :deep( .ai-select ){ margin: 0 !important; } - ::v-deep .el-form-item { + :deep( .el-form-item ){ width: auto; margin-bottom: 0; diff --git a/packages/conv/creditScore/AppIntegralAudit/components/List.vue b/packages/conv/creditScore/AppIntegralAudit/components/List.vue index c20e9e4e..f4c3ba54 100644 --- a/packages/conv/creditScore/AppIntegralAudit/components/List.vue +++ b/packages/conv/creditScore/AppIntegralAudit/components/List.vue @@ -114,9 +114,9 @@ { prop: 'residentName', label: '申请人' }, { prop: 'residentPhone', align: 'center', label: '联系电话' }, { prop: 'createTime', align: 'center', label: '申请时间' }, - { prop: 'applyIntegralType', align: 'center', label: '积分类型', formart: v => this.dict.getLabel('atWillReportType', v) }, - { prop: 'auditStatus', align: 'center', label: '状态', formart: v => v ? this.dict.getLabel('auditStatus', v) : '-' }, - { prop: 'auditUserName', align: 'center', label: '审批人' }, + { prop: 'applyIntegralType', align: 'center', label: '积分类型', formart: v => this.dict.getLabel('atWillReportType', v) }, + { prop: 'auditStatus', align: 'center', label: '状态', formart: v => v ? this.dict.getLabel('auditStatus', v) : '-' }, + { prop: 'auditUserName', align: 'center', label: '审批人' }, { prop: 'auditTime', align: 'center', label: '审批时间' } ], tableData: [], @@ -186,7 +186,7 @@ diff --git a/packages/extra/AppNavConfig/components/List.vue b/packages/extra/AppNavConfig/components/List.vue index 461cdc12..28f1b133 100644 --- a/packages/extra/AppNavConfig/components/List.vue +++ b/packages/extra/AppNavConfig/components/List.vue @@ -123,7 +123,7 @@ node-key="id" check-strictly ref="tree" - show-checkbox + show-checkbox :default-checked-keys="defaultChecked" :default-expanded-keys="defaultExpanded" default-expand-all> @@ -254,7 +254,7 @@ return false } - + this.info = e this.isLoading = true @@ -402,7 +402,7 @@ diff --git a/packages/wxwork/AnnounceResident/AppAnnounceResident/components/Detail.vue b/packages/wxwork/AnnounceResident/AppAnnounceResident/components/Detail.vue index f3ba08ca..c9bae1cb 100644 --- a/packages/wxwork/AnnounceResident/AppAnnounceResident/components/Detail.vue +++ b/packages/wxwork/AnnounceResident/AppAnnounceResident/components/Detail.vue @@ -421,7 +421,7 @@ background: rgba($color: #000000, $alpha: 0.6); } - ::v-deep .phone-container { + :deep( .phone-container ){ position: absolute; left: 50%; top: 50%; @@ -582,7 +582,7 @@ } } - ::v-deep .AppAnnounceDetail-title { + :deep( .AppAnnounceDetail-title ){ display: flex; align-items: center; @@ -673,7 +673,7 @@ } } - ::v-deep .right-tips { + :deep( .right-tips ){ display: flex; align-items: center; diff --git a/packages/wxwork/AnnounceResident/AppAnnounceResidentStatistics/AppAnnounceResidentStatistics.vue b/packages/wxwork/AnnounceResident/AppAnnounceResidentStatistics/AppAnnounceResidentStatistics.vue index 72b71145..c8f14898 100644 --- a/packages/wxwork/AnnounceResident/AppAnnounceResidentStatistics/AppAnnounceResidentStatistics.vue +++ b/packages/wxwork/AnnounceResident/AppAnnounceResidentStatistics/AppAnnounceResidentStatistics.vue @@ -687,11 +687,11 @@ } - ::v-deep .el-calendar-table:not(.is-range) td.next, - ::v-deep .el-calendar-table:not(.is-range) td.prev { + :deep( .el-calendar-table:not(.is-range) td.next), + :deep( .el-calendar-table:not(.is-range) td.prev ){ color: #ccc; } - ::v-deep .el-calendar-table .el-calendar-day{ + :deep( .el-calendar-table .el-calendar-day){ height: 48px; line-height: 32px; padding-left: 12px; @@ -701,48 +701,48 @@ .el-calendar-table:not(.is-range) td .current{ color: #888; } - ::v-deep .el-calendar__header{ + :deep( .el-calendar__header){ display: none; } - ::v-deep .el-calendar__body{ + :deep( .el-calendar__body){ padding: 0; } - ::v-deep .el-calendar-table thead th:nth-of-type(1){ + :deep( .el-calendar-table thead th:nth-of-type(1)){ border-left: 1px solid #eee; } - ::v-deep .el-calendar-table thead th:nth-of-type(7){ + :deep( .el-calendar-table thead th:nth-of-type(7)){ border-right: 1px solid #eee; } - ::v-deep .el-calendar-table tr td:first-child { + :deep( .el-calendar-table tr td:first-child ){ border-left: 1px solid #eee; } - ::v-deep .el-calendar-table tr:first-child td { + :deep( .el-calendar-table tr:first-child td ){ border-top: 1px solid #eee; } - ::v-deep .el-calendar-table td { + :deep( .el-calendar-table td ){ border-bottom: 1px solid #eee; border-right: 1px solid #eee; } - ::v-deep .el-timeline-item__timestamp.is-top{ + :deep( .el-timeline-item__timestamp.is-top){ margin-bottom: 0; padding-top: 0; } - ::v-deep .el-timeline-item__node{ + :deep( .el-timeline-item__node){ background-color: #26F; width: 8px; height: 8px; border-radius: 50%; left: 1px; } - ::v-deep .el-card{ + :deep( .el-card){ border: none; } - ::v-deep .el-card__body{ + :deep( .el-card__body){ padding: 8px; } } - ::v-deep .ai-list__content { + :deep( .ai-list__content ){ padding: 0!important; .ai-list__content--right-wrapper { @@ -753,7 +753,7 @@ } } - ::v-deep .AiPicker{ + :deep( .AiPicker){ display: inline-block; } diff --git a/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Detail.vue b/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Detail.vue index b5fa2d6d..d321395f 100644 --- a/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Detail.vue +++ b/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Detail.vue @@ -386,7 +386,7 @@ background: rgba($color: #000000, $alpha: 0.6); } - ::v-deep .phone-container { + :deep( .phone-container ){ position: absolute; left: 50%; top: 50%; @@ -547,7 +547,7 @@ } } - ::v-deep .AppAnnounceDetail-title { + :deep( .AppAnnounceDetail-title ){ display: flex; align-items: center; @@ -638,7 +638,7 @@ } } - ::v-deep .right-tips { + :deep( .right-tips ){ display: flex; align-items: center; diff --git a/packages/wxwork/AnnounceWeChat/AppAnnounceWeChatStatistics/AppAnnounceWeChatStatistics.vue b/packages/wxwork/AnnounceWeChat/AppAnnounceWeChatStatistics/AppAnnounceWeChatStatistics.vue index e8efd4ae..9e110f07 100644 --- a/packages/wxwork/AnnounceWeChat/AppAnnounceWeChatStatistics/AppAnnounceWeChatStatistics.vue +++ b/packages/wxwork/AnnounceWeChat/AppAnnounceWeChatStatistics/AppAnnounceWeChatStatistics.vue @@ -687,11 +687,11 @@ } - ::v-deep .el-calendar-table:not(.is-range) td.next, - ::v-deep .el-calendar-table:not(.is-range) td.prev { + :deep( .el-calendar-table:not(.is-range) td.next), + :deep( .el-calendar-table:not(.is-range) td.prev ){ color: #ccc; } - ::v-deep .el-calendar-table .el-calendar-day{ + :deep( .el-calendar-table .el-calendar-day){ height: 48px; line-height: 32px; padding-left: 12px; @@ -701,48 +701,48 @@ .el-calendar-table:not(.is-range) td .current{ color: #888; } - ::v-deep .el-calendar__header{ + :deep( .el-calendar__header){ display: none; } - ::v-deep .el-calendar__body{ + :deep( .el-calendar__body){ padding: 0; } - ::v-deep .el-calendar-table thead th:nth-of-type(1){ + :deep( .el-calendar-table thead th:nth-of-type(1)){ border-left: 1px solid #eee; } - ::v-deep .el-calendar-table thead th:nth-of-type(7){ + :deep( .el-calendar-table thead th:nth-of-type(7)){ border-right: 1px solid #eee; } - ::v-deep .el-calendar-table tr td:first-child { + :deep( .el-calendar-table tr td:first-child ){ border-left: 1px solid #eee; } - ::v-deep .el-calendar-table tr:first-child td { + :deep( .el-calendar-table tr:first-child td ){ border-top: 1px solid #eee; } - ::v-deep .el-calendar-table td { + :deep( .el-calendar-table td ){ border-bottom: 1px solid #eee; border-right: 1px solid #eee; } - ::v-deep .el-timeline-item__timestamp.is-top{ + :deep( .el-timeline-item__timestamp.is-top){ margin-bottom: 0; padding-top: 0; } - ::v-deep .el-timeline-item__node{ + :deep( .el-timeline-item__node){ background-color: #26F; width: 8px; height: 8px; border-radius: 50%; left: 1px; } - ::v-deep .el-card{ + :deep( .el-card){ border: none; } - ::v-deep .el-card__body{ + :deep( .el-card__body){ padding: 8px; } } - ::v-deep .ai-list__content { + :deep( .ai-list__content ){ padding: 0!important; .ai-list__content--right-wrapper { @@ -753,7 +753,7 @@ } } - ::v-deep .AiPicker{ + :deep( .AiPicker){ display: inline-block; } diff --git a/packages/wxwork/AppBuddyMessage/components/Add.vue b/packages/wxwork/AppBuddyMessage/components/Add.vue index 5602e357..8caa1d23 100644 --- a/packages/wxwork/AppBuddyMessage/components/Add.vue +++ b/packages/wxwork/AppBuddyMessage/components/Add.vue @@ -324,7 +324,7 @@ border-color: #2266FF; } - ::v-deep { + :deep( ){ .el-radio__label { display: none; } diff --git a/packages/wxwork/AppClientMassTextin/components/NewClientMass.vue b/packages/wxwork/AppClientMassTextin/components/NewClientMass.vue index 6bb262d5..87e07b88 100644 --- a/packages/wxwork/AppClientMassTextin/components/NewClientMass.vue +++ b/packages/wxwork/AppClientMassTextin/components/NewClientMass.vue @@ -311,7 +311,7 @@ } } - ::v-deep .AiPersonSelect { + :deep( .AiPersonSelect ){ & > button { background: #F5F5F5; border-radius: 0px 2px 2px 0px; @@ -327,7 +327,7 @@ color: #222222; } - ::v-deep .msg-title { + :deep( .msg-title ){ & > .aibar { justify-content: flex-start; diff --git a/packages/wxwork/AppMassNotification/components/Add.vue b/packages/wxwork/AppMassNotification/components/Add.vue index d63b2251..67f148bc 100644 --- a/packages/wxwork/AppMassNotification/components/Add.vue +++ b/packages/wxwork/AppMassNotification/components/Add.vue @@ -20,7 +20,7 @@ 居民群 居民 - + @@ -254,7 +254,7 @@ export default { accessUrl: item.url, } }) - } + } this.form.fileList = [...contentList, ...this.imgs, ...this.videos, ...this.files] @@ -328,7 +328,7 @@ export default { border-color: #2266FF; } - ::v-deep { + :deep( ){ .el-radio__label { display: none; } diff --git a/packages/wxwork/AppMassNotification/components/SelectDeptUser.vue b/packages/wxwork/AppMassNotification/components/SelectDeptUser.vue index 48a1aaa4..ae8bd3cc 100644 --- a/packages/wxwork/AppMassNotification/components/SelectDeptUser.vue +++ b/packages/wxwork/AppMassNotification/components/SelectDeptUser.vue @@ -180,7 +180,7 @@ export default { diff --git a/packages/wxwork/AppVillageCode/components/List.vue b/packages/wxwork/AppVillageCode/components/List.vue index 9f0aa0cc..b2e37657 100644 --- a/packages/wxwork/AppVillageCode/components/List.vue +++ b/packages/wxwork/AppVillageCode/components/List.vue @@ -286,7 +286,7 @@ .addressBook-left__list--search { flex: 1; - ::v-deep input { + :deep( input ){ width: 100%; } } @@ -303,7 +303,7 @@ font-size: 14px; } - ::v-deep .el-tree { + :deep( .el-tree ){ background: transparent; .el-tree-node__expand-icon.is-leaf { @@ -340,7 +340,7 @@ } background: #2266FF; - + span { color: #fff; } @@ -396,7 +396,7 @@ } } - ::v-deep .ai-list__content--right { + :deep( .ai-list__content--right ){ .ai-list__content--right-wrapper { min-height: 100%; diff --git a/project/hlj/app/AppRatingTask/components/FormDetail.vue b/project/hlj/app/AppRatingTask/components/FormDetail.vue index 2508e92b..1a196508 100644 --- a/project/hlj/app/AppRatingTask/components/FormDetail.vue +++ b/project/hlj/app/AppRatingTask/components/FormDetail.vue @@ -366,7 +366,7 @@ } } - ::v-deep .AppAnnounceDetail-title { + :deep( .AppAnnounceDetail-title ){ display: flex; align-items: center; diff --git a/project/hlj/app/AppScoringTemplate/components/Add.vue b/project/hlj/app/AppScoringTemplate/components/Add.vue index 3eb7f1f6..ea2887e5 100644 --- a/project/hlj/app/AppScoringTemplate/components/Add.vue +++ b/project/hlj/app/AppScoringTemplate/components/Add.vue @@ -641,13 +641,13 @@ } .right-item__content--select-answer { - ::v-deep .el-checkbox { + :deep( .el-checkbox ){ display: flex!important; align-items: center; margin-right: 0; } - ::v-deep .el-checkbox__label { + :deep( .el-checkbox__label ){ flex: 1; color: #222; overflow: hidden; @@ -704,14 +704,14 @@ word-break: break-all; } - ::v-deep .ai-detail__content { + :deep( .ai-detail__content ){ height: calc(100% - 52px)!important; padding: 0!important; overflow: hidden!important; } .ai-dialog__success { - ::v-deep .ai-dialog__content { + :deep( .ai-dialog__content ){ max-height: initial!important; } } @@ -905,14 +905,14 @@ } } - ::v-deep .ai-detail__title { + :deep( .ai-detail__title ){ margin: 0!important; margin-bottom: 4px!important; padding: 0 20px; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); } - ::v-deep .ai-detail__content--wrapper { + :deep( .ai-detail__content--wrapper ){ display: flex; max-width: 100%!important; height: 100%!important; @@ -924,7 +924,7 @@ flex: 1; height: 100%; - ::v-deep .el-scrollbar__view { + :deep( .el-scrollbar__view ){ height: 100%; } } @@ -938,14 +938,14 @@ .right-item__select--wrapper { - ::v-deep .el-upload--picture-card { + :deep( .el-upload--picture-card ){ // display: none; width: 100%; height: 100%; line-height: 1; } - ::v-deep .uploader { + :deep( .uploader ){ background: #FFFFFF; border-radius: 4px; margin: 0 10px; @@ -996,7 +996,7 @@ } } - ::v-deep .el-upload-list__item { + :deep( .el-upload-list__item ){ width: 40px!important; height: 40px!important; object-fit: cover; @@ -1026,13 +1026,13 @@ background: #F3F6F9; border-radius: 4px; - ::v-deep .el-upload--picture-card { + :deep( .el-upload--picture-card ){ width: 100%; height: 100%; line-height: 1; } - ::v-deep .uploader { + :deep( .uploader ){ width: 260px; height: 163px; overflow: hidden; @@ -1123,13 +1123,13 @@ white-space: nowrap; } - ::v-deep .el-checkbox { + :deep( .el-checkbox ){ display: flex!important; align-items: center; margin-bottom: 0!important; } - ::v-deep .el-checkbox__label { + :deep( .el-checkbox__label ){ max-width: 140px; color: #222; overflow: hidden; @@ -1137,7 +1137,7 @@ white-space: nowrap; } - ::v-deep .el-input { + :deep( .el-input ){ width: 100px; .el-input__suffix { diff --git a/project/huizhili/apps/AnnounceBeta/AppAnnounce/components/Detail.vue b/project/huizhili/apps/AnnounceBeta/AppAnnounce/components/Detail.vue index dfe924fd..80e3f416 100644 --- a/project/huizhili/apps/AnnounceBeta/AppAnnounce/components/Detail.vue +++ b/project/huizhili/apps/AnnounceBeta/AppAnnounce/components/Detail.vue @@ -502,7 +502,7 @@ background: rgba($color: #000000, $alpha: 0.6); } - ::v-deep .phone-container { + :deep( .phone-container ){ position: absolute; left: 50%; top: 50%; @@ -663,7 +663,7 @@ } } - ::v-deep .AppAnnounceDetail-title { + :deep( .AppAnnounceDetail-title ){ display: flex; align-items: center; @@ -754,7 +754,7 @@ } } - ::v-deep .right-tips { + :deep( .right-tips ){ display: flex; align-items: center; diff --git a/project/huizhili/apps/AnnounceBeta/AppAnnounceStatistics/AppAnnounceStatisticsBeta.vue b/project/huizhili/apps/AnnounceBeta/AppAnnounceStatistics/AppAnnounceStatisticsBeta.vue index 98c87c82..572c4724 100644 --- a/project/huizhili/apps/AnnounceBeta/AppAnnounceStatistics/AppAnnounceStatisticsBeta.vue +++ b/project/huizhili/apps/AnnounceBeta/AppAnnounceStatistics/AppAnnounceStatisticsBeta.vue @@ -680,11 +680,11 @@ } - ::v-deep .el-calendar-table:not(.is-range) td.next, - ::v-deep .el-calendar-table:not(.is-range) td.prev { + :deep( .el-calendar-table:not(.is-range) td.next), + :deep( .el-calendar-table:not(.is-range) td.prev ){ color: #ccc; } - ::v-deep .el-calendar-table .el-calendar-day{ + :deep( .el-calendar-table .el-calendar-day){ height: 48px; line-height: 32px; padding-left: 12px; @@ -694,48 +694,48 @@ .el-calendar-table:not(.is-range) td .current{ color: #888; } - ::v-deep .el-calendar__header{ + :deep( .el-calendar__header){ display: none; } - ::v-deep .el-calendar__body{ + :deep( .el-calendar__body){ padding: 0; } - ::v-deep .el-calendar-table thead th:nth-of-type(1){ + :deep( .el-calendar-table thead th:nth-of-type(1)){ border-left: 1px solid #eee; } - ::v-deep .el-calendar-table thead th:nth-of-type(7){ + :deep( .el-calendar-table thead th:nth-of-type(7)){ border-right: 1px solid #eee; } - ::v-deep .el-calendar-table tr td:first-child { + :deep( .el-calendar-table tr td:first-child ){ border-left: 1px solid #eee; } - ::v-deep .el-calendar-table tr:first-child td { + :deep( .el-calendar-table tr:first-child td ){ border-top: 1px solid #eee; } - ::v-deep .el-calendar-table td { + :deep( .el-calendar-table td ){ border-bottom: 1px solid #eee; border-right: 1px solid #eee; } - ::v-deep .el-timeline-item__timestamp.is-top{ + :deep( .el-timeline-item__timestamp.is-top){ margin-bottom: 0; padding-top: 0; } - ::v-deep .el-timeline-item__node{ + :deep( .el-timeline-item__node){ background-color: #26F; width: 8px; height: 8px; border-radius: 50%; left: 1px; } - ::v-deep .el-card{ + :deep( .el-card){ border: none; } - ::v-deep .el-card__body{ + :deep( .el-card__body){ padding: 8px; } } - ::v-deep .ai-list__content { + :deep( .ai-list__content ){ padding: 0!important; .ai-list__content--right-wrapper { @@ -746,7 +746,7 @@ } } - ::v-deep .AiPicker{ + :deep( .AiPicker){ display: inline-block; } diff --git a/project/oms/apps/AppArticles/components/Add.vue b/project/oms/apps/AppArticles/components/Add.vue index d9f9c3bc..f1016172 100644 --- a/project/oms/apps/AppArticles/components/Add.vue +++ b/project/oms/apps/AppArticles/components/Add.vue @@ -160,7 +160,7 @@ export default { } } - ::v-deep .el-form-item__content { + :deep( .el-form-item__content ){ margin-left: 140px !important; } @@ -185,17 +185,17 @@ export default { padding: 0 90px 0 50px; } - ::v-deep .ai-detail__footer { + :deep( .ai-detail__footer ){ background: #fff !important; } - ::v-deep .ai-detail { + :deep( .ai-detail ){ div { box-sizing: border-box; } } - ::v-deep .ai-detail__content--active { + :deep( .ai-detail__content--active ){ padding: 20px; box-sizing: border-box; @@ -212,7 +212,7 @@ export default { } } - ::v-deep .ai-wrapper { + :deep( .ai-wrapper ){ align-items: inherit !important; } diff --git a/project/oms/apps/AppArticles/components/Event.vue b/project/oms/apps/AppArticles/components/Event.vue index 70f8006a..0e8bdfab 100644 --- a/project/oms/apps/AppArticles/components/Event.vue +++ b/project/oms/apps/AppArticles/components/Event.vue @@ -236,11 +236,11 @@ export default { .event { height: 100%; - ::v-deep th { + :deep( th ){ font-weight: bold !important; } - ::v-deep .table-options { + :deep( .table-options ){ span { font-size: 14px !important; } diff --git a/project/oms/apps/AppCompany/components/Statistics.vue b/project/oms/apps/AppCompany/components/Statistics.vue index b10e11d0..37b42a61 100644 --- a/project/oms/apps/AppCompany/components/Statistics.vue +++ b/project/oms/apps/AppCompany/components/Statistics.vue @@ -358,7 +358,7 @@ export default { .chart-content { height: calc(100% - 240px); - ::v-deep .ai-card__body { + :deep( .ai-card__body ){ height: calc(100% - 70px); } @@ -374,7 +374,7 @@ export default { } } -::v-deep .ai-detail__content--wrapper { +:deep( .ai-detail__content--wrapper ){ height: 100%; } diff --git a/project/oms/apps/AppRoleRightsManager/AppRoleRightsManager.vue b/project/oms/apps/AppRoleRightsManager/AppRoleRightsManager.vue index 87b68366..0dc9a94e 100644 --- a/project/oms/apps/AppRoleRightsManager/AppRoleRightsManager.vue +++ b/project/oms/apps/AppRoleRightsManager/AppRoleRightsManager.vue @@ -346,7 +346,7 @@ export default { height: 100%; - ::v-deep .ai-dialog { + :deep( .ai-dialog ){ .ai-card { box-shadow: none; border: 1px solid #eee; @@ -362,7 +362,7 @@ export default { } } - ::v-deep .rightsGraphDialog { + :deep( .rightsGraphDialog ){ .el-dialog__body { padding: 0; } @@ -372,7 +372,7 @@ export default { } } - ::v-deep .datail-table-body { + :deep( .datail-table-body ){ width: 100%; height: auto; margin-bottom: 16px; diff --git a/project/oms/apps/AppRoleRightsManager/rightsGraph.vue b/project/oms/apps/AppRoleRightsManager/rightsGraph.vue index f25b62c2..a9379619 100644 --- a/project/oms/apps/AppRoleRightsManager/rightsGraph.vue +++ b/project/oms/apps/AppRoleRightsManager/rightsGraph.vue @@ -183,7 +183,7 @@ export default { .rightsGraph { height: 100%; - ::v-deep #RightGraph { + :deep( #RightGraph ){ width: 100%; height: 100%; min-height: 500px; diff --git a/project/oms/apps/develop/AppAiCode/detailLayout.vue b/project/oms/apps/develop/AppAiCode/detailLayout.vue index fab9c438..51623e3b 100644 --- a/project/oms/apps/develop/AppAiCode/detailLayout.vue +++ b/project/oms/apps/develop/AppAiCode/detailLayout.vue @@ -623,7 +623,7 @@ export default { } } - ::v-deep .ai-card { + :deep( .ai-card ){ cursor: move; &.active { @@ -631,14 +631,14 @@ export default { } } - ::v-deep .ai-detail__content { + :deep( .ai-detail__content ){ height: calc(100% - 52px) !important; padding: 0 !important; overflow: hidden !important; } .ai-dialog__success { - ::v-deep .ai-dialog__content { + :deep( .ai-dialog__content ){ max-height: initial !important; } } @@ -848,14 +848,14 @@ export default { } } - ::v-deep .ai-detail__title { + :deep( .ai-detail__title ){ margin: 0 !important; margin-bottom: 4px !important; padding: 0 20px; box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.08); } - ::v-deep .ai-detail__content--wrapper { + :deep( .ai-detail__content--wrapper ){ display: flex; max-width: 100% !important; height: 100% !important; @@ -867,7 +867,7 @@ export default { flex: 1; height: 100%; - ::v-deep .el-scrollbar__view { + :deep( .el-scrollbar__view ){ height: 100%; } } @@ -902,7 +902,7 @@ export default { } } - ::v-deep .el-upload-list__item { + :deep( .el-upload-list__item ){ width: 40px !important; height: 40px !important; object-fit: cover; diff --git a/project/oms/apps/develop/AppDeploy/AppDeploy.vue b/project/oms/apps/develop/AppDeploy/AppDeploy.vue index fbaa6cb2..35f1b1f0 100644 --- a/project/oms/apps/develop/AppDeploy/AppDeploy.vue +++ b/project/oms/apps/develop/AppDeploy/AppDeploy.vue @@ -252,7 +252,7 @@ export default { .AppDeploy { height: 100%; - ::v-deep.textRight { + :deep(.textRight ){ direction: rtl; overflow: hidden; text-overflow: ellipsis; diff --git a/project/oms/apps/develop/AppForm/components/Add.vue b/project/oms/apps/develop/AppForm/components/Add.vue index 466e4248..20747d1c 100644 --- a/project/oms/apps/develop/AppForm/components/Add.vue +++ b/project/oms/apps/develop/AppForm/components/Add.vue @@ -183,7 +183,7 @@ \ No newline at end of file + diff --git a/project/pengliuyang/apps/AppCommunityResource/components/resourceMap.vue b/project/pengliuyang/apps/AppCommunityResource/components/resourceMap.vue index c49b305d..d5caad97 100644 --- a/project/pengliuyang/apps/AppCommunityResource/components/resourceMap.vue +++ b/project/pengliuyang/apps/AppCommunityResource/components/resourceMap.vue @@ -117,7 +117,7 @@ export default { renderMarker(context) { const resourceId = context.data[0].id - + let el = `` context.marker.setContent(el); @@ -234,7 +234,7 @@ export default { \ No newline at end of file + diff --git a/project/pingchang/apps/AppBayonetRegistration/components/List.vue b/project/pingchang/apps/AppBayonetRegistration/components/List.vue index d6e3c5b0..fc88509b 100644 --- a/project/pingchang/apps/AppBayonetRegistration/components/List.vue +++ b/project/pingchang/apps/AppBayonetRegistration/components/List.vue @@ -251,7 +251,7 @@ \ No newline at end of file + diff --git a/project/pingchang/apps/AppCommunityMember/List.vue b/project/pingchang/apps/AppCommunityMember/List.vue index d98ec551..03bd6559 100644 --- a/project/pingchang/apps/AppCommunityMember/List.vue +++ b/project/pingchang/apps/AppCommunityMember/List.vue @@ -91,7 +91,7 @@ export default { this.dict.load('partyReportActionStatus', 'partyReportSignupStatus').then(() => { this.getList() }) - + }, methods: { getListInit() { @@ -111,7 +111,7 @@ export default { this.loading = false }) }, - + toDetail(id) { this.$emit("showDetail", id) }, @@ -129,15 +129,15 @@ export default { align-items: center; } - ::v-deep .audit-0 { + :deep( .audit-0 ){ color: #FF8822 !important; } - ::v-deep .audit-1 { + :deep( .audit-1 ){ color: #2EA222 !important; } - ::v-deep .ai-list__content--right { + :deep( .ai-list__content--right ){ flex: 1; min-width: 0; margin-left: 1px; @@ -147,7 +147,7 @@ export default { width: 100%; } } - ::v-deep .is-current>.el-tree-node__content{ + :deep( .is-current>.el-tree-node__content){ width: 100%!important; padding-right: 16px!important; } diff --git a/project/pingchang/apps/AppCommunityMember/Organization.vue b/project/pingchang/apps/AppCommunityMember/Organization.vue index bdc88ca6..316450e5 100644 --- a/project/pingchang/apps/AppCommunityMember/Organization.vue +++ b/project/pingchang/apps/AppCommunityMember/Organization.vue @@ -294,20 +294,20 @@ export default { font-weight: bold; } - ::v-deep .el-button--text [class*="iconfont"] { + :deep( .el-button--text [class*="iconfont"] ){ color: #5088ff; } } } } - ::v-deep .el-dialog { + :deep( .el-dialog ){ .el-dialog__body { padding: 16px; } } - ::v-deep .el-tree { + :deep( .el-tree ){ margin-top: 16px; min-height: 300px; max-height: 600px; @@ -321,7 +321,7 @@ export default { } } - ::v-deep .organizations_tree .el-tree .is-current>.el-tree-node__content { + :deep( .organizations_tree .el-tree .is-current>.el-tree-node__content ){ background-color: #26f; color: #fff; } diff --git a/project/pingchang/apps/AppCommunityMember/Statistics.vue b/project/pingchang/apps/AppCommunityMember/Statistics.vue index b18516c8..84804d09 100644 --- a/project/pingchang/apps/AppCommunityMember/Statistics.vue +++ b/project/pingchang/apps/AppCommunityMember/Statistics.vue @@ -646,15 +646,15 @@ export default { } } - ::v-deep .el-col-24 { + :deep( .el-col-24 ){ width: auto; } - ::v-deep .ai-list__content--right-wrapper { + :deep( .ai-list__content--right-wrapper ){ background-color: none!important; padding: 0!important; } - ::v-deep .el-tree .is-current>.el-tree-node__content { + :deep( .el-tree .is-current>.el-tree-node__content ){ min-width: 100%!important; } } - \ No newline at end of file + diff --git a/project/pingchang/apps/AppDataPermissionConfig/components/List.vue b/project/pingchang/apps/AppDataPermissionConfig/components/List.vue index e416a6b3..fa9c69b6 100644 --- a/project/pingchang/apps/AppDataPermissionConfig/components/List.vue +++ b/project/pingchang/apps/AppDataPermissionConfig/components/List.vue @@ -585,7 +585,7 @@ export default { padding: 0; font-size: 12px; - ::v-deep span { + :deep( span ){ margin-left: 0; } } @@ -598,7 +598,7 @@ export default { .addressBook-left__list--search { flex: 1; - ::v-deep input { + :deep( input ){ width: 100%; } } @@ -653,12 +653,12 @@ export default { height: 100%; overflow: auto; - ::v-deep .el-tree { + :deep( .el-tree ){ width: fit-content; min-width: 100%; } - ::v-deep .el-scrollbar__wrap { + :deep( .el-scrollbar__wrap ){ margin-bottom: 0 !important; overflow-x: hidden; @@ -702,7 +702,7 @@ export default { font-size: 14px; } - ::v-deep .el-tree { + :deep( .el-tree ){ background: transparent; .el-tree-node__expand-icon.is-leaf { @@ -748,7 +748,7 @@ export default { } } - ::v-deep .ai-list__content--right { + :deep( .ai-list__content--right ){ flex: 1; min-width: 0; margin-left: 1px; diff --git a/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue b/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue index 1f3fd70b..2225f7c8 100644 --- a/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue +++ b/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue @@ -75,11 +75,11 @@ 等额选举:候选人数与应选人数相等的选举方式。" placement="top"> - + 等额 差额 - + @@ -265,7 +265,7 @@ export default { .electionAdd { height: 100%; - ::v-deep .el-date-editor .el-input { + :deep( .el-date-editor .el-input ){ width: 100%; } @@ -281,4 +281,4 @@ export default { font-size: 13px; } } - \ No newline at end of file + diff --git a/project/pingchang/apps/AppHealthReport/components/List.vue b/project/pingchang/apps/AppHealthReport/components/List.vue index d4cf90a3..4b9954ab 100644 --- a/project/pingchang/apps/AppHealthReport/components/List.vue +++ b/project/pingchang/apps/AppHealthReport/components/List.vue @@ -252,7 +252,7 @@ diff --git a/project/pingchang/apps/AppNewSociety/components/Add.vue b/project/pingchang/apps/AppNewSociety/components/Add.vue index f688bb7f..7326650d 100644 --- a/project/pingchang/apps/AppNewSociety/components/Add.vue +++ b/project/pingchang/apps/AppNewSociety/components/Add.vue @@ -620,7 +620,7 @@ export default { diff --git a/project/pingchang/apps/AppOrganizationChange/components/List.vue b/project/pingchang/apps/AppOrganizationChange/components/List.vue index 0c1d2e81..d24043da 100644 --- a/project/pingchang/apps/AppOrganizationChange/components/List.vue +++ b/project/pingchang/apps/AppOrganizationChange/components/List.vue @@ -82,7 +82,7 @@ export default { .List { position: relative; - ::v-deep.ai-detail__content--wrapper { + :deep(.ai-detail__content--wrapper ){ height: 100%; & > * { @@ -101,7 +101,7 @@ export default { } } - ::v-deep .is-current > .el-tree-node__content { + :deep( .is-current > .el-tree-node__content ){ width: 100% !important; padding-right: 16px !important; } diff --git a/project/pingchang/apps/AppOrganizationChange/components/detailPanel.vue b/project/pingchang/apps/AppOrganizationChange/components/detailPanel.vue index 966d51b5..1b1d895f 100644 --- a/project/pingchang/apps/AppOrganizationChange/components/detailPanel.vue +++ b/project/pingchang/apps/AppOrganizationChange/components/detailPanel.vue @@ -128,7 +128,7 @@ export default { margin-top: 24px; } - ::v-deep .table-header { + :deep( .table-header ){ box-sizing: border-box; border-right: 1px solid #d0d4dc !important; @@ -141,7 +141,7 @@ export default { } } - ::v-deep .table-cell { + :deep( .table-cell ){ height: 44px; color: #333; diff --git a/project/pingchang/apps/AppPartyMember/components/Add.vue b/project/pingchang/apps/AppPartyMember/components/Add.vue index 9b85855e..c2670744 100644 --- a/project/pingchang/apps/AppPartyMember/components/Add.vue +++ b/project/pingchang/apps/AppPartyMember/components/Add.vue @@ -765,7 +765,7 @@ ")}catch(l){console&&console.log(l)}}function F(){m||(m=!0,z())}function o(){try{h.documentElement.doScroll("left")}catch(l){return void setTimeout(o,50)}F()}a=function(){var l,a;(a=document.createElement("div")).innerHTML=i,i=null,(l=a.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",a=l,(l=document.body).firstChild?p(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),a()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(z=a,h=l.document,m=!1,o(),h.onreadystatechange=function(){"complete"==h.readyState&&(h.onreadystatechange=null,F())})}(window); diff --git a/ui/lib/styles/iconfont/logofont.css b/ui/lib/styles/iconfont/logofont.css new file mode 100644 index 00000000..52dfd6b6 --- /dev/null +++ b/ui/lib/styles/iconfont/logofont.css @@ -0,0 +1,78 @@ +@font-face { + font-family: "logofont"; /* Project id 1557923 */ + src: url('//at.alicdn.com/t/c/font_1557923_ymu4rpvijlo.woff2?t=1661421638099') format('woff2'), + url('//at.alicdn.com/t/c/font_1557923_ymu4rpvijlo.woff?t=1661421638099') format('woff'), + url('//at.alicdn.com/t/c/font_1557923_ymu4rpvijlo.ttf?t=1661421638099') format('truetype'); +} + +.logofont { + font-family: "logofont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.iconhuizhili:before { + content: "\e720"; +} + +.iconxiuxingtong1:before { + content: "\e71e"; +} + +.iconhuizhengwu2:before { + content: "\e71a"; +} + +.iconhuizhengwu:before { + content: "\e719"; +} + +.iconxiuxingtong:before { + content: "\e717"; +} + +.iconzgydzhsq:before { + content: "\e6fb"; +} + +.iconzhongguoyidong2:before { + content: "\e6fa"; +} + +.iconzhongguoyidong:before { + content: "\e6f8"; +} + +.iconcunwei:before { + content: "\e6f3"; +} + +.iconcunwei1:before { + content: "\e6f0"; +} + +.iconccb:before { + content: "\e6d7"; +} + +.iconzhongzhi:before { + content: "\e6cb"; +} + +.iconzxjy:before { + content: "\e6c2"; +} + +.iconLogo:before { + content: "\e6a9"; +} + +.iconminzhengju:before { + content: "\e667"; +} + +.iconzhongguoliantong:before { + content: "\e618"; +} diff --git a/ui/lib/styles/theme.hzl.scss b/ui/lib/styles/theme.hzl.scss new file mode 100644 index 00000000..2affc60a --- /dev/null +++ b/ui/lib/styles/theme.hzl.scss @@ -0,0 +1,72 @@ +$theme: "hzl"; +@import "common"; +.signLeftContent { + color: #333; + font-family: -apple-system, BlinkMacSystemFont, PingFang SC, Source Han Sans CN, Microsoft Yahei, sans-serif; + + .titlePane { + margin-top: 84px; + margin-bottom: 40px; + font-family: MicrosoftYaHei, sans-serif; + } + + .subTitle:before { + border-color: #333; + } +} + +.projectName { + font-family: MicrosoftYaHeiS0pxibold; + font-size: 48px; +} + +.ai-sign { + width: 420px !important; + + & > .el-row--flex { + align-items: flex-start; + } + + .is-always-shadow { + box-shadow: 0 24px 48px 0 rgba(15, 56, 139, 0.05); + width: 420px !important; + min-height: 430px; + + & > .el-card__body { + padding: 20px 40px; + } + + .ai-scan { + right: -30px; + + .iconfont { + line-height: normal; + } + } + + } + + .reset-password-row { + text-align: center !important; + } +} + +.headerNav { + .AiIcon { + font-size: 28px !important; + -webkit-text-fill-color: white !important; + font-weight: normal !important; + } + + .headerTitle { + font-family: FZZZHONGJW--GB1-0 !important; + line-height: normal !important; + font-weight: normal !important; + -webkit-text-fill-color: white !important; + } + + .textShadow { + display: none; + } +} + diff --git a/ui/lib/styles/theme.yellow.scss b/ui/lib/styles/theme.yellow.scss new file mode 100644 index 00000000..71762927 --- /dev/null +++ b/ui/lib/styles/theme.yellow.scss @@ -0,0 +1,7 @@ +$theme: "yellow"; +$primaryColor: #f62; +$primaryBtnColor: linear-gradient(90deg, #FFA322 0%, #FF6622 100%); +$projectName: linear-gradient(180deg, #FFA322 0%, #FF6622 100%); +$primaryLightColor: #FFF7F4; +$textShadow: #CA693E; +@import "common"; diff --git a/ui/lib/styles/vars.scss b/ui/lib/styles/vars.scss new file mode 100644 index 00000000..4d141002 --- /dev/null +++ b/ui/lib/styles/vars.scss @@ -0,0 +1,12 @@ +$primaryColor: #26f !default; +$borderColor: #d0d4dc !default; +$primaryBtnColor: linear-gradient(90deg, #299FFF 0%, #0C61FF 100%) !default; +$successColor: #2EA222 !default; +$warnColor: #F82 !default; +$errorColor: #F46 !default; +$infoColor: #8D96A9 !default; +$theme: "blue" !default; +$projectName: linear-gradient(180deg, #5AC4FF 11%, #1347B6 100%) !default; +$primaryLightColor: rgba(239, 246, 255, 1) !default; +$textShadow: #384DC3 !default; +$placeholderColor: #888 !default; diff --git a/ui/package.json b/ui/package.json new file mode 100644 index 00000000..cf34c736 --- /dev/null +++ b/ui/package.json @@ -0,0 +1,33 @@ +{ + "name": "dui", + "version": "2.0.0", + "author": "kubbo", + "scripts": { + "lib": "npm unpublish --force&&npm publish" + }, + "files": [ + "lib", + "packages" + ], + "main": "packages/index.js", + "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", + "@ckeditor/ckeditor5-vue2": "^3.0.1", + "@jiaminghi/data-view": "^2.10.0", + "axios": "^1.2.0", + "crypto-js": "^4.1.1", + "dayjs": "^1.8.35", + "echarts": "^5.1.2", + "v-viewer": "^1.5.1", + "vue-cropper": "^0.5.5", + "vue-qr": "^2.2.1", + "vuedraggable": "^2.24.3", + "element-ui": "^2.13.2", + "vue": "^2.6.11" + }, + "web-types": "docs/web-types.json", + "vetur": { + "tags": "docs/tags.json", + "attributes": "docs/attributes.json" + } +} diff --git a/ui/packages/basic/AiArticle.vue b/ui/packages/basic/AiArticle.vue new file mode 100644 index 00000000..a5a0986b --- /dev/null +++ b/ui/packages/basic/AiArticle.vue @@ -0,0 +1,331 @@ + + + + + diff --git a/ui/packages/basic/AiAudio.vue b/ui/packages/basic/AiAudio.vue new file mode 100644 index 00000000..6cd95563 --- /dev/null +++ b/ui/packages/basic/AiAudio.vue @@ -0,0 +1,238 @@ + + + + diff --git a/ui/packages/basic/AiBadge.vue b/ui/packages/basic/AiBadge.vue new file mode 100644 index 00000000..70e7823f --- /dev/null +++ b/ui/packages/basic/AiBadge.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/ui/packages/basic/AiBar.vue b/ui/packages/basic/AiBar.vue new file mode 100644 index 00000000..9756fed1 --- /dev/null +++ b/ui/packages/basic/AiBar.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/ui/packages/basic/AiBigTable.vue b/ui/packages/basic/AiBigTable.vue new file mode 100644 index 00000000..3cab7358 --- /dev/null +++ b/ui/packages/basic/AiBigTable.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/ui/packages/basic/AiCron.vue b/ui/packages/basic/AiCron.vue new file mode 100644 index 00000000..d93091b0 --- /dev/null +++ b/ui/packages/basic/AiCron.vue @@ -0,0 +1,522 @@ + + + + + diff --git a/ui/packages/basic/AiDialog.vue b/ui/packages/basic/AiDialog.vue new file mode 100644 index 00000000..f4cfe81a --- /dev/null +++ b/ui/packages/basic/AiDialog.vue @@ -0,0 +1,163 @@ + + + + diff --git a/ui/packages/basic/AiDrawer.vue b/ui/packages/basic/AiDrawer.vue new file mode 100644 index 00000000..f6b2aa70 --- /dev/null +++ b/ui/packages/basic/AiDrawer.vue @@ -0,0 +1,139 @@ + + + + + diff --git a/ui/packages/basic/AiEditor/AiEditor.vue b/ui/packages/basic/AiEditor/AiEditor.vue new file mode 100644 index 00000000..47c53a3b --- /dev/null +++ b/ui/packages/basic/AiEditor/AiEditor.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/ui/packages/basic/AiEditor/models.js b/ui/packages/basic/AiEditor/models.js new file mode 100644 index 00000000..cf30391d --- /dev/null +++ b/ui/packages/basic/AiEditor/models.js @@ -0,0 +1,24 @@ +import {Loading} from "element-ui" + +export class UploadAdapter { + constructor(loader, instance, action, params) { + this.instance = instance + this.action = action + this.loader = loader + this.params = params + } + + async upload() { + const formData = new FormData() + formData.append('file', await this.loader.file) + const loading = Loading.service({}) + return this.instance.post(this.action, formData, {...this.params, returnError: true}).then(res => { + if (res?.data) { + return res.data.map(m => m.split(";")?.[0]) + } else return this.loader.status = "aborted" && Promise.reject() + }).finally(() => loading.close()) + } + + abort() { + } +} diff --git a/ui/packages/basic/AiEmpty.vue b/ui/packages/basic/AiEmpty.vue new file mode 100644 index 00000000..2746c29e --- /dev/null +++ b/ui/packages/basic/AiEmpty.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/ui/packages/basic/AiFileList.vue b/ui/packages/basic/AiFileList.vue new file mode 100644 index 00000000..228bd644 --- /dev/null +++ b/ui/packages/basic/AiFileList.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/ui/packages/basic/AiIcon.vue b/ui/packages/basic/AiIcon.vue new file mode 100644 index 00000000..5e5f2d16 --- /dev/null +++ b/ui/packages/basic/AiIcon.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/ui/packages/basic/AiImport.vue b/ui/packages/basic/AiImport.vue new file mode 100644 index 00000000..dea98801 --- /dev/null +++ b/ui/packages/basic/AiImport.vue @@ -0,0 +1,321 @@ + + + + + diff --git a/ui/packages/basic/AiInfoItem.vue b/ui/packages/basic/AiInfoItem.vue new file mode 100644 index 00000000..ccfe517d --- /dev/null +++ b/ui/packages/basic/AiInfoItem.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/ui/packages/basic/AiNumber.vue b/ui/packages/basic/AiNumber.vue new file mode 100644 index 00000000..dce38b8a --- /dev/null +++ b/ui/packages/basic/AiNumber.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/ui/packages/basic/AiOperate.vue b/ui/packages/basic/AiOperate.vue new file mode 100644 index 00000000..e7dcadb2 --- /dev/null +++ b/ui/packages/basic/AiOperate.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/ui/packages/basic/AiPullDown.vue b/ui/packages/basic/AiPullDown.vue new file mode 100644 index 00000000..c8a089a3 --- /dev/null +++ b/ui/packages/basic/AiPullDown.vue @@ -0,0 +1,76 @@ + + + + diff --git a/ui/packages/basic/AiRange.vue b/ui/packages/basic/AiRange.vue new file mode 100644 index 00000000..2cdf8dd2 --- /dev/null +++ b/ui/packages/basic/AiRange.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/ui/packages/basic/AiSelect.vue b/ui/packages/basic/AiSelect.vue new file mode 100644 index 00000000..f9e857ef --- /dev/null +++ b/ui/packages/basic/AiSelect.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/ui/packages/basic/AiTable.vue b/ui/packages/basic/AiTable.vue new file mode 100644 index 00000000..213b3bd9 --- /dev/null +++ b/ui/packages/basic/AiTable.vue @@ -0,0 +1,446 @@ + + + + + diff --git a/ui/packages/basic/AiTableSelect.vue b/ui/packages/basic/AiTableSelect.vue new file mode 100644 index 00000000..3d70799d --- /dev/null +++ b/ui/packages/basic/AiTableSelect.vue @@ -0,0 +1,242 @@ + + + + + diff --git a/ui/packages/basic/AiTitle.vue b/ui/packages/basic/AiTitle.vue new file mode 100644 index 00000000..ab7837b2 --- /dev/null +++ b/ui/packages/basic/AiTitle.vue @@ -0,0 +1,163 @@ + + + + + diff --git a/ui/packages/basic/AiTransSpeech.vue b/ui/packages/basic/AiTransSpeech.vue new file mode 100644 index 00000000..017529ea --- /dev/null +++ b/ui/packages/basic/AiTransSpeech.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/ui/packages/basic/AiUploader.vue b/ui/packages/basic/AiUploader.vue new file mode 100644 index 00000000..0b716276 --- /dev/null +++ b/ui/packages/basic/AiUploader.vue @@ -0,0 +1,514 @@ + + + + + diff --git a/ui/packages/basic/AiWrapper.vue b/ui/packages/basic/AiWrapper.vue new file mode 100644 index 00000000..05995a1d --- /dev/null +++ b/ui/packages/basic/AiWrapper.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/ui/packages/common/AiArea.vue b/ui/packages/common/AiArea.vue new file mode 100644 index 00000000..806912d6 --- /dev/null +++ b/ui/packages/common/AiArea.vue @@ -0,0 +1,368 @@ + + + diff --git a/ui/packages/common/AiAreaGet.vue b/ui/packages/common/AiAreaGet.vue new file mode 100644 index 00000000..287f82db --- /dev/null +++ b/ui/packages/common/AiAreaGet.vue @@ -0,0 +1,295 @@ + + + + + + diff --git a/ui/packages/common/AiAreaSelect.vue b/ui/packages/common/AiAreaSelect.vue new file mode 100644 index 00000000..79bda273 --- /dev/null +++ b/ui/packages/common/AiAreaSelect.vue @@ -0,0 +1,273 @@ + + + + + diff --git a/ui/packages/common/AiAvatar.vue b/ui/packages/common/AiAvatar.vue new file mode 100644 index 00000000..259b9a93 --- /dev/null +++ b/ui/packages/common/AiAvatar.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/ui/packages/common/AiEvaluation.vue b/ui/packages/common/AiEvaluation.vue new file mode 100644 index 00000000..17b601b8 --- /dev/null +++ b/ui/packages/common/AiEvaluation.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/ui/packages/common/AiId.vue b/ui/packages/common/AiId.vue new file mode 100644 index 00000000..16d7a8ef --- /dev/null +++ b/ui/packages/common/AiId.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/ui/packages/common/AiLog.vue b/ui/packages/common/AiLog.vue new file mode 100644 index 00000000..bb9abb18 --- /dev/null +++ b/ui/packages/common/AiLog.vue @@ -0,0 +1,154 @@ + + + + diff --git a/ui/packages/common/AiParty/AiParty.vue b/ui/packages/common/AiParty/AiParty.vue new file mode 100644 index 00000000..148fad3b --- /dev/null +++ b/ui/packages/common/AiParty/AiParty.vue @@ -0,0 +1,321 @@ + + + + diff --git a/ui/packages/common/AiParty/partyTrans.vue b/ui/packages/common/AiParty/partyTrans.vue new file mode 100644 index 00000000..e6125030 --- /dev/null +++ b/ui/packages/common/AiParty/partyTrans.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/ui/packages/common/AiPartyMember.vue b/ui/packages/common/AiPartyMember.vue new file mode 100644 index 00000000..3c80da7b --- /dev/null +++ b/ui/packages/common/AiPartyMember.vue @@ -0,0 +1,835 @@ + + + + + diff --git a/ui/packages/common/AiPartyMemberSelect.vue b/ui/packages/common/AiPartyMemberSelect.vue new file mode 100644 index 00000000..6372f569 --- /dev/null +++ b/ui/packages/common/AiPartyMemberSelect.vue @@ -0,0 +1,361 @@ + + + + + diff --git a/ui/packages/common/AiPartyTree.vue b/ui/packages/common/AiPartyTree.vue new file mode 100644 index 00000000..5ee89dab --- /dev/null +++ b/ui/packages/common/AiPartyTree.vue @@ -0,0 +1,188 @@ + + + + + diff --git a/ui/packages/common/AiPeople.vue b/ui/packages/common/AiPeople.vue new file mode 100644 index 00000000..32cd8047 --- /dev/null +++ b/ui/packages/common/AiPeople.vue @@ -0,0 +1,510 @@ + + + + + diff --git a/ui/packages/common/AiPersonSelect.vue b/ui/packages/common/AiPersonSelect.vue new file mode 100644 index 00000000..d5fba9a5 --- /dev/null +++ b/ui/packages/common/AiPersonSelect.vue @@ -0,0 +1,560 @@ + + + + + diff --git a/ui/packages/common/AiPhone.vue b/ui/packages/common/AiPhone.vue new file mode 100644 index 00000000..ac28212c --- /dev/null +++ b/ui/packages/common/AiPhone.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/ui/packages/common/AiPicker.vue b/ui/packages/common/AiPicker.vue new file mode 100644 index 00000000..700e9aa2 --- /dev/null +++ b/ui/packages/common/AiPicker.vue @@ -0,0 +1,283 @@ + + + + + diff --git a/ui/packages/common/AiSign/AiSign.vue b/ui/packages/common/AiSign/AiSign.vue new file mode 100644 index 00000000..1c166f0e --- /dev/null +++ b/ui/packages/common/AiSign/AiSign.vue @@ -0,0 +1,231 @@ + + + + diff --git a/ui/packages/common/AiSign/changePwd.vue b/ui/packages/common/AiSign/changePwd.vue new file mode 100644 index 00000000..26330be9 --- /dev/null +++ b/ui/packages/common/AiSign/changePwd.vue @@ -0,0 +1,185 @@ + + + + diff --git a/ui/packages/common/AiSign/identify.vue b/ui/packages/common/AiSign/identify.vue new file mode 100644 index 00000000..2fef54ad --- /dev/null +++ b/ui/packages/common/AiSign/identify.vue @@ -0,0 +1,132 @@ + + diff --git a/ui/packages/common/AiSign/signIn.vue b/ui/packages/common/AiSign/signIn.vue new file mode 100644 index 00000000..6eb4c55b --- /dev/null +++ b/ui/packages/common/AiSign/signIn.vue @@ -0,0 +1,333 @@ + + + + diff --git a/ui/packages/common/AiUserGet/AiUserGet.vue b/ui/packages/common/AiUserGet/AiUserGet.vue new file mode 100644 index 00000000..48dc36c4 --- /dev/null +++ b/ui/packages/common/AiUserGet/AiUserGet.vue @@ -0,0 +1,728 @@ + + + + + diff --git a/ui/packages/common/AiUserGet/tree/model/node.js b/ui/packages/common/AiUserGet/tree/model/node.js new file mode 100644 index 00000000..657b3b82 --- /dev/null +++ b/ui/packages/common/AiUserGet/tree/model/node.js @@ -0,0 +1,485 @@ +import objectAssign from 'element-ui/src/utils/merge'; +import { markNodeData, NODE_KEY } from './util'; +import { arrayFindIndex } from 'element-ui/src/utils/util'; + +export const getChildState = node => { + let all = true; + let none = true; + let allWithoutDisable = true; + for (let i = 0, j = node.length; i < j; i++) { + const n = node[i]; + if (n.checked !== true || n.indeterminate) { + all = false; + if (!n.disabled) { + allWithoutDisable = false; + } + } + if (n.checked !== false || n.indeterminate) { + none = false; + } + } + + return { all, none, allWithoutDisable, half: !all && !none }; +}; + +const reInitChecked = function(node) { + if (node.childNodes.length === 0) return; + + const {all, none, half} = getChildState(node.childNodes); + if (all) { + node.checked = true; + node.indeterminate = false; + } else if (half) { + node.checked = false; + node.indeterminate = true; + } else if (none) { + node.checked = false; + node.indeterminate = false; + } + + const parent = node.parent; + if (!parent || parent.level === 0) return; + + if (!node.store.checkStrictly) { + reInitChecked(parent); + } +}; + +const getPropertyFromData = function(node, prop) { + const props = node.store.props; + const data = node.data || {}; + const config = props[prop]; + + if (typeof config === 'function') { + return config(data, node); + } else if (typeof config === 'string') { + return data[config]; + } else if (typeof config === 'undefined') { + const dataProp = data[prop]; + return dataProp === undefined ? '' : dataProp; + } +}; + +let nodeIdSeed = 0; + +export default class Node { + constructor(options) { + this.id = nodeIdSeed++; + this.text = null; + this.checked = false; + this.indeterminate = false; + this.data = null; + this.expanded = false; + this.parent = null; + this.visible = true; + this.isCurrent = false; + + for (let name in options) { + if (options.hasOwnProperty(name)) { + this[name] = options[name]; + } + } + + // internal + this.level = 0; + this.loaded = false; + this.childNodes = []; + this.loading = false; + + if (this.parent) { + this.level = this.parent.level + 1; + } + + const store = this.store; + if (!store) { + throw new Error('[Node]store is required!'); + } + store.registerNode(this); + + const props = store.props; + if (props && typeof props.isLeaf !== 'undefined') { + const isLeaf = getPropertyFromData(this, 'isLeaf'); + if (typeof isLeaf === 'boolean') { + this.isLeafByUser = isLeaf; + } + } + + if (store.lazy !== true && this.data) { + this.setData(this.data); + + if (store.defaultExpandAll) { + this.expanded = true; + } + } else if (this.level > 0 && store.lazy && store.defaultExpandAll) { + this.expand(); + } + if (!Array.isArray(this.data)) { + markNodeData(this, this.data); + } + if (!this.data) return; + const defaultExpandedKeys = store.defaultExpandedKeys; + const key = store.key; + if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) { + this.expand(null, store.autoExpandParent); + } + + if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) { + store.currentNode = this; + store.currentNode.isCurrent = true; + } + + if (store.lazy) { + store._initDefaultCheckedNode(this); + } + + this.updateLeafState(); + } + + setData(data) { + if (!Array.isArray(data)) { + markNodeData(this, data); + } + + this.data = data; + this.childNodes = []; + + let children; + if (this.level === 0 && this.data instanceof Array) { + children = this.data; + } else { + children = getPropertyFromData(this, 'children') || []; + } + + for (let i = 0, j = children.length; i < j; i++) { + this.insertChild({ data: children[i] }); + } + } + + get label() { + return getPropertyFromData(this, 'label'); + } + + get key() { + const nodeKey = this.store.key; + if (this.data) return this.data[nodeKey]; + return null; + } + + get disabled() { + return getPropertyFromData(this, 'disabled'); + } + + get nextSibling() { + const parent = this.parent; + if (parent) { + const index = parent.childNodes.indexOf(this); + if (index > -1) { + return parent.childNodes[index + 1]; + } + } + return null; + } + + get previousSibling() { + const parent = this.parent; + if (parent) { + const index = parent.childNodes.indexOf(this); + if (index > -1) { + return index > 0 ? parent.childNodes[index - 1] : null; + } + } + return null; + } + + contains(target, deep = true) { + const walk = function(parent) { + const children = parent.childNodes || []; + let result = false; + for (let i = 0, j = children.length; i < j; i++) { + const child = children[i]; + if (child === target || (deep && walk(child))) { + result = true; + break; + } + } + return result; + }; + + return walk(this); + } + + remove() { + const parent = this.parent; + if (parent) { + parent.removeChild(this); + } + } + + insertChild(child, index, batch) { + if (!child) throw new Error('insertChild error: child is required.'); + + if (!(child instanceof Node)) { + if (!batch) { + const children = this.getChildren(true); + if (children.indexOf(child.data) === -1) { + if (typeof index === 'undefined' || index < 0) { + children.push(child.data); + } else { + children.splice(index, 0, child.data); + } + } + } + objectAssign(child, { + parent: this, + store: this.store + }); + child = new Node(child); + } + + child.level = this.level + 1; + + if (typeof index === 'undefined' || index < 0) { + this.childNodes.push(child); + } else { + this.childNodes.splice(index, 0, child); + } + + this.updateLeafState(); + } + + insertBefore(child, ref) { + let index; + if (ref) { + index = this.childNodes.indexOf(ref); + } + this.insertChild(child, index); + } + + insertAfter(child, ref) { + let index; + if (ref) { + index = this.childNodes.indexOf(ref); + if (index !== -1) index += 1; + } + this.insertChild(child, index); + } + + removeChild(child) { + const children = this.getChildren() || []; + const dataIndex = children.indexOf(child.data); + if (dataIndex > -1) { + children.splice(dataIndex, 1); + } + + const index = this.childNodes.indexOf(child); + + if (index > -1) { + this.store && this.store.deregisterNode(child); + child.parent = null; + this.childNodes.splice(index, 1); + } + + this.updateLeafState(); + } + + removeChildByData(data) { + let targetNode = null; + + for (let i = 0; i < this.childNodes.length; i++) { + if (this.childNodes[i].data === data) { + targetNode = this.childNodes[i]; + break; + } + } + + if (targetNode) { + this.removeChild(targetNode); + } + } + + expand(callback, expandParent) { + const done = () => { + if (expandParent) { + let parent = this.parent; + while (parent.level > 0) { + parent.expanded = true; + parent = parent.parent; + } + } + this.expanded = true; + if (callback) callback(); + }; + + if (this.shouldLoadData()) { + this.loadData((data) => { + if (data instanceof Array) { + if (this.checked) { + this.setChecked(true, true); + } else if (!this.store.checkStrictly) { + reInitChecked(this); + } + done(); + } + }); + } else { + done(); + } + } + + doCreateChildren(array, defaultProps = {}) { + array.forEach((item) => { + this.insertChild(objectAssign({ data: item }, defaultProps), undefined, true); + }); + } + + collapse() { + this.expanded = false; + } + + shouldLoadData() { + return this.store.lazy === true && this.store.load && !this.loaded; + } + + updateLeafState() { + if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') { + this.isLeaf = this.isLeafByUser; + return; + } + const childNodes = this.childNodes; + if (!this.store.lazy || (this.store.lazy === true && this.loaded === true)) { + this.isLeaf = !childNodes || childNodes.length === 0; + return; + } + this.isLeaf = false; + } + + setChecked(value, deep, recursion, passValue) { + this.indeterminate = value === 'half'; + this.checked = value === true; + + if (this.store.checkStrictly) return; + + if (!(this.shouldLoadData() && !this.store.checkDescendants)) { + let { all, allWithoutDisable } = getChildState(this.childNodes); + + if (!this.isLeaf && (!all && allWithoutDisable)) { + this.checked = false; + value = false; + } + + const handleDescendants = () => { + if (deep) { + const childNodes = this.childNodes; + for (let i = 0, j = childNodes.length; i < j; i++) { + const child = childNodes[i]; + passValue = passValue || value !== false; + const isCheck = child.disabled ? child.checked : passValue; + child.setChecked(isCheck, deep, true, passValue); + } + const { half, all } = getChildState(childNodes); + if (!all) { + this.checked = all; + this.indeterminate = half; + } + } + }; + + if (this.shouldLoadData()) { + // Only work on lazy load data. + this.loadData(() => { + handleDescendants(); + reInitChecked(this); + }, { + checked: value !== false + }); + return; + } else { + handleDescendants(); + } + } + + const parent = this.parent; + if (!parent || parent.level === 0) return; + + if (!recursion) { + reInitChecked(parent); + } + } + + getChildren(forceInit = false) { // this is data + if (this.level === 0) return this.data; + const data = this.data; + if (!data) return null; + + const props = this.store.props; + let children = 'children'; + if (props) { + children = props.children || 'children'; + } + + if (data[children] === undefined) { + data[children] = null; + } + + if (forceInit && !data[children]) { + data[children] = []; + } + + return data[children]; + } + + updateChildren() { + const newData = this.getChildren() || []; + const oldData = this.childNodes.map((node) => node.data); + + const newDataMap = {}; + const newNodes = []; + + newData.forEach((item, index) => { + const key = item[NODE_KEY]; + const isNodeExists = !!key && arrayFindIndex(oldData, data => data[NODE_KEY] === key) >= 0; + if (isNodeExists) { + newDataMap[key] = { index, data: item }; + } else { + newNodes.push({ index, data: item }); + } + }); + + if (!this.store.lazy) { + oldData.forEach((item) => { + if (!newDataMap[item[NODE_KEY]]) this.removeChildByData(item); + }); + } + + newNodes.forEach(({ index, data }) => { + this.insertChild({ data }, index); + }); + + this.updateLeafState(); + } + + loadData(callback, defaultProps = {}) { + if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) { + this.loading = true; + + const resolve = (children) => { + this.loaded = true; + this.loading = false; + this.childNodes = []; + + this.doCreateChildren(children, defaultProps); + + this.updateLeafState(); + if (callback) { + callback.call(this, children); + } + }; + + this.store.load(this, resolve); + } else { + if (callback) { + callback.call(this); + } + } + } +} diff --git a/ui/packages/common/AiUserGet/tree/model/tree-store.js b/ui/packages/common/AiUserGet/tree/model/tree-store.js new file mode 100644 index 00000000..68f58e6d --- /dev/null +++ b/ui/packages/common/AiUserGet/tree/model/tree-store.js @@ -0,0 +1,367 @@ +import Node from './node'; +import { getNodeKey } from './util'; + +export default class TreeStore { + constructor(options) { + this.currentNode = null; + this.currentNodeKey = null; + + for (let option in options) { + if (options.hasOwnProperty(option)) { + this[option] = options[option]; + } + } + + this.nodesMap = {}; + this.myNodesMap = []; + this.root = new Node({ + data: this.data, + store: this + }); + + if (this.lazy && this.load) { + const loadFn = this.load; + loadFn(this.root, (data) => { + this.root.doCreateChildren(data); + this._initDefaultCheckedNodes(); + }); + } else { + this._initDefaultCheckedNodes(); + } + } + + filter(value) { + const filterNodeMethod = this.filterNodeMethod; + const lazy = this.lazy; + const traverse = function(node) { + const childNodes = node.root ? node.root.childNodes : node.childNodes; + + childNodes.forEach((child) => { + child.visible = filterNodeMethod.call(child, value, child.data, child); + + traverse(child); + }); + + if (!node.visible && childNodes.length) { + let allHidden = true; + allHidden = !childNodes.some((child) => child.visible); + + if (node.root) { + node.root.visible = allHidden === false; + } else { + node.visible = allHidden === false; + } + } + if (!value) return; + + if (node.visible && !node.isLeaf && !lazy) node.expand(); + }; + + traverse(this); + } + + setData(newVal) { + const instanceChanged = newVal !== this.root.data; + if (instanceChanged) { + this.root.setData(newVal); + this._initDefaultCheckedNodes(); + } else { + this.root.updateChildren(); + } + } + + getNode(data) { + if (data instanceof Node) return data; + const key = typeof data !== 'object' ? data : getNodeKey(this.key, data); + return this.nodesMap[key] || null; + } + + insertBefore(data, refData) { + const refNode = this.getNode(refData); + refNode.parent.insertBefore({ data }, refNode); + } + + insertAfter(data, refData) { + const refNode = this.getNode(refData); + refNode.parent.insertAfter({ data }, refNode); + } + + remove(data) { + const node = this.getNode(data); + + if (node && node.parent) { + if (node === this.currentNode) { + this.currentNode = null; + } + node.parent.removeChild(node); + } + } + + append(data, parentData) { + const parentNode = parentData ? this.getNode(parentData) : this.root; + + if (parentNode) { + parentNode.insertChild({ data }); + } + } + + _initDefaultCheckedNodes() { + const defaultCheckedKeys = this.defaultCheckedKeys || []; + const nodesMap = this.nodesMap; + + defaultCheckedKeys.forEach((checkedKey) => { + const node = nodesMap[checkedKey]; + + if (node) { + node.setChecked(true, !this.checkStrictly); + } + }); + } + + _initDefaultCheckedNode(node) { + const defaultCheckedKeys = this.defaultCheckedKeys || []; + + if (defaultCheckedKeys.indexOf(node.key) !== -1) { + node.setChecked(true, !this.checkStrictly); + } + } + + setDefaultCheckedKey(newVal) { + if (newVal !== this.defaultCheckedKeys) { + this.defaultCheckedKeys = newVal; + this._initDefaultCheckedNodes(); + } + } + + registerNode(node) { + const key = this.key; + if (!key || !node || !node.data) return; + + const nodeKey = node.key; + if (nodeKey !== undefined) this.nodesMap[node.key] = node; + if (nodeKey !== undefined) { + this.myNodesMap.push({ + [node.key]: node + }); + } + } + setMyChecked(data, checked, deep) { + const nodes = this.getMyNode(data); + if (nodes && nodes.length > 0) { + for (let index = 0; index < nodes.length; index++) { + const element = nodes[index]; + let node = Object.values(element)[0]; + if (node && node.checked !== checked) { + node.setChecked(!!checked, deep); + } + } + } + } + + //mycode + getMyNode(data) { + const key = typeof data !== 'object' ? data : getNodeKey(this.key, data); + const result = this.myNodesMap.filter((item) => item[key]); + return result || []; + } + + deregisterNode(node) { + const key = this.key; + if (!key || !node || !node.data) return; + + node.childNodes.forEach((child) => { + this.deregisterNode(child); + }); + + delete this.nodesMap[node.key]; + } + + getCheckedNodes(leafOnly = false, includeHalfChecked = false) { + const checkedNodes = []; + const traverse = function(node) { + const childNodes = node.root ? node.root.childNodes : node.childNodes; + + childNodes.forEach((child) => { + if ( + (child.checked || (includeHalfChecked && child.indeterminate)) && + (!leafOnly || (leafOnly && child.isLeaf)) + ) { + checkedNodes.push(child.data); + } + + traverse(child); + }); + }; + + traverse(this); + + return checkedNodes; + } + + getCheckedKeys(leafOnly = false) { + return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]); + } + + getHalfCheckedNodes() { + const nodes = []; + const traverse = function(node) { + const childNodes = node.root ? node.root.childNodes : node.childNodes; + + childNodes.forEach((child) => { + if (child.indeterminate) { + nodes.push(child.data); + } + + traverse(child); + }); + }; + + traverse(this); + + return nodes; + } + + getHalfCheckedKeys() { + return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]); + } + + _getAllNodes() { + const allNodes = []; + const nodesMap = this.nodesMap; + for (let nodeKey in nodesMap) { + if (nodesMap.hasOwnProperty(nodeKey)) { + allNodes.push(nodesMap[nodeKey]); + } + } + + return allNodes; + } + + updateChildren(key, data) { + const node = this.nodesMap[key]; + if (!node) return; + const childNodes = node.childNodes; + for (let i = childNodes.length - 1; i >= 0; i--) { + const child = childNodes[i]; + this.remove(child.data); + } + for (let i = 0, j = data.length; i < j; i++) { + const child = data[i]; + this.append(child, node.data); + } + } + + _setCheckedKeys(key, leafOnly = false, checkedKeys) { + const allNodes = this._getAllNodes().sort((a, b) => b.level - a.level); + const cache = Object.create(null); + const keys = Object.keys(checkedKeys); + allNodes.forEach((node) => node.setChecked(false, false)); + for (let i = 0, j = allNodes.length; i < j; i++) { + const node = allNodes[i]; + const nodeKey = node.data[key].toString(); + let checked = keys.indexOf(nodeKey) > -1; + if (!checked) { + if (node.checked && !cache[nodeKey]) { + node.setChecked(false, false); + } + continue; + } + + let parent = node.parent; + while (parent && parent.level > 0) { + cache[parent.data[key]] = true; + parent = parent.parent; + } + + if (node.isLeaf || this.checkStrictly) { + node.setChecked(true, false); + continue; + } + node.setChecked(true, true); + + if (leafOnly) { + node.setChecked(false, false); + const traverse = function(node) { + const childNodes = node.childNodes; + childNodes.forEach((child) => { + if (!child.isLeaf) { + child.setChecked(false, false); + } + traverse(child); + }); + }; + traverse(node); + } + } + } + + setCheckedNodes(array, leafOnly = false) { + const key = this.key; + const checkedKeys = {}; + array.forEach((item) => { + checkedKeys[(item || {})[key]] = true; + }); + + this._setCheckedKeys(key, leafOnly, checkedKeys); + } + + setCheckedKeys(keys, leafOnly = false) { + this.defaultCheckedKeys = keys; + const key = this.key; + const checkedKeys = {}; + keys.forEach((key) => { + checkedKeys[key] = true; + }); + + this._setCheckedKeys(key, leafOnly, checkedKeys); + } + + setDefaultExpandedKeys(keys) { + keys = keys || []; + this.defaultExpandedKeys = keys; + + keys.forEach((key) => { + const node = this.getNode(key); + if (node) node.expand(null, this.autoExpandParent); + }); + } + + setChecked(data, checked, deep) { + const node = this.getNode(data); + + if (node) { + node.setChecked(!!checked, deep); + } + } + + getCurrentNode() { + return this.currentNode; + } + + setCurrentNode(currentNode) { + const prevCurrentNode = this.currentNode; + if (prevCurrentNode) { + prevCurrentNode.isCurrent = false; + } + this.currentNode = currentNode; + this.currentNode.isCurrent = true; + } + + setUserCurrentNode(node) { + const key = node[this.key]; + const currNode = this.nodesMap[key]; + this.setCurrentNode(currNode); + } + + setCurrentNodeKey(key) { + if (key === null || key === undefined) { + this.currentNode && (this.currentNode.isCurrent = false); + this.currentNode = null; + return; + } + const node = this.getNode(key); + if (node) { + this.setCurrentNode(node); + } + } +} diff --git a/ui/packages/common/AiUserGet/tree/model/util.js b/ui/packages/common/AiUserGet/tree/model/util.js new file mode 100644 index 00000000..dcc891b1 --- /dev/null +++ b/ui/packages/common/AiUserGet/tree/model/util.js @@ -0,0 +1,27 @@ +export const NODE_KEY = '$treeNodeId'; + +export const markNodeData = function(node, data) { + if (!data || data[NODE_KEY]) return; + Object.defineProperty(data, NODE_KEY, { + value: node.id, + enumerable: false, + configurable: false, + writable: false + }); +}; + +export const getNodeKey = function(key, data) { + if (!key) return data[NODE_KEY]; + return data[key]; +}; + +export const findNearestComponent = (element, componentName) => { + let target = element; + while (target && target.tagName !== 'BODY') { + if (target.__vue__ && target.__vue__.$options.name === componentName) { + return target.__vue__; + } + target = target.parentNode; + } + return null; +}; diff --git a/ui/packages/common/AiUserGet/tree/tree-node.vue b/ui/packages/common/AiUserGet/tree/tree-node.vue new file mode 100644 index 00000000..3c922dbe --- /dev/null +++ b/ui/packages/common/AiUserGet/tree/tree-node.vue @@ -0,0 +1,279 @@ + + + diff --git a/ui/packages/common/AiUserGet/tree/tree.vue b/ui/packages/common/AiUserGet/tree/tree.vue new file mode 100644 index 00000000..da049622 --- /dev/null +++ b/ui/packages/common/AiUserGet/tree/tree.vue @@ -0,0 +1,500 @@ + + + diff --git a/ui/packages/common/AiUserSelecter.vue b/ui/packages/common/AiUserSelecter.vue new file mode 100644 index 00000000..90d0f11e --- /dev/null +++ b/ui/packages/common/AiUserSelecter.vue @@ -0,0 +1,887 @@ + + + + + diff --git a/ui/packages/common/AiWechatSelecter/AiWechatSelecter.vue b/ui/packages/common/AiWechatSelecter/AiWechatSelecter.vue new file mode 100644 index 00000000..d350ef43 --- /dev/null +++ b/ui/packages/common/AiWechatSelecter/AiWechatSelecter.vue @@ -0,0 +1,785 @@ + + + + + diff --git a/ui/packages/common/AiWechatSelecter/tree/model/node.js b/ui/packages/common/AiWechatSelecter/tree/model/node.js new file mode 100644 index 00000000..657b3b82 --- /dev/null +++ b/ui/packages/common/AiWechatSelecter/tree/model/node.js @@ -0,0 +1,485 @@ +import objectAssign from 'element-ui/src/utils/merge'; +import { markNodeData, NODE_KEY } from './util'; +import { arrayFindIndex } from 'element-ui/src/utils/util'; + +export const getChildState = node => { + let all = true; + let none = true; + let allWithoutDisable = true; + for (let i = 0, j = node.length; i < j; i++) { + const n = node[i]; + if (n.checked !== true || n.indeterminate) { + all = false; + if (!n.disabled) { + allWithoutDisable = false; + } + } + if (n.checked !== false || n.indeterminate) { + none = false; + } + } + + return { all, none, allWithoutDisable, half: !all && !none }; +}; + +const reInitChecked = function(node) { + if (node.childNodes.length === 0) return; + + const {all, none, half} = getChildState(node.childNodes); + if (all) { + node.checked = true; + node.indeterminate = false; + } else if (half) { + node.checked = false; + node.indeterminate = true; + } else if (none) { + node.checked = false; + node.indeterminate = false; + } + + const parent = node.parent; + if (!parent || parent.level === 0) return; + + if (!node.store.checkStrictly) { + reInitChecked(parent); + } +}; + +const getPropertyFromData = function(node, prop) { + const props = node.store.props; + const data = node.data || {}; + const config = props[prop]; + + if (typeof config === 'function') { + return config(data, node); + } else if (typeof config === 'string') { + return data[config]; + } else if (typeof config === 'undefined') { + const dataProp = data[prop]; + return dataProp === undefined ? '' : dataProp; + } +}; + +let nodeIdSeed = 0; + +export default class Node { + constructor(options) { + this.id = nodeIdSeed++; + this.text = null; + this.checked = false; + this.indeterminate = false; + this.data = null; + this.expanded = false; + this.parent = null; + this.visible = true; + this.isCurrent = false; + + for (let name in options) { + if (options.hasOwnProperty(name)) { + this[name] = options[name]; + } + } + + // internal + this.level = 0; + this.loaded = false; + this.childNodes = []; + this.loading = false; + + if (this.parent) { + this.level = this.parent.level + 1; + } + + const store = this.store; + if (!store) { + throw new Error('[Node]store is required!'); + } + store.registerNode(this); + + const props = store.props; + if (props && typeof props.isLeaf !== 'undefined') { + const isLeaf = getPropertyFromData(this, 'isLeaf'); + if (typeof isLeaf === 'boolean') { + this.isLeafByUser = isLeaf; + } + } + + if (store.lazy !== true && this.data) { + this.setData(this.data); + + if (store.defaultExpandAll) { + this.expanded = true; + } + } else if (this.level > 0 && store.lazy && store.defaultExpandAll) { + this.expand(); + } + if (!Array.isArray(this.data)) { + markNodeData(this, this.data); + } + if (!this.data) return; + const defaultExpandedKeys = store.defaultExpandedKeys; + const key = store.key; + if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) { + this.expand(null, store.autoExpandParent); + } + + if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) { + store.currentNode = this; + store.currentNode.isCurrent = true; + } + + if (store.lazy) { + store._initDefaultCheckedNode(this); + } + + this.updateLeafState(); + } + + setData(data) { + if (!Array.isArray(data)) { + markNodeData(this, data); + } + + this.data = data; + this.childNodes = []; + + let children; + if (this.level === 0 && this.data instanceof Array) { + children = this.data; + } else { + children = getPropertyFromData(this, 'children') || []; + } + + for (let i = 0, j = children.length; i < j; i++) { + this.insertChild({ data: children[i] }); + } + } + + get label() { + return getPropertyFromData(this, 'label'); + } + + get key() { + const nodeKey = this.store.key; + if (this.data) return this.data[nodeKey]; + return null; + } + + get disabled() { + return getPropertyFromData(this, 'disabled'); + } + + get nextSibling() { + const parent = this.parent; + if (parent) { + const index = parent.childNodes.indexOf(this); + if (index > -1) { + return parent.childNodes[index + 1]; + } + } + return null; + } + + get previousSibling() { + const parent = this.parent; + if (parent) { + const index = parent.childNodes.indexOf(this); + if (index > -1) { + return index > 0 ? parent.childNodes[index - 1] : null; + } + } + return null; + } + + contains(target, deep = true) { + const walk = function(parent) { + const children = parent.childNodes || []; + let result = false; + for (let i = 0, j = children.length; i < j; i++) { + const child = children[i]; + if (child === target || (deep && walk(child))) { + result = true; + break; + } + } + return result; + }; + + return walk(this); + } + + remove() { + const parent = this.parent; + if (parent) { + parent.removeChild(this); + } + } + + insertChild(child, index, batch) { + if (!child) throw new Error('insertChild error: child is required.'); + + if (!(child instanceof Node)) { + if (!batch) { + const children = this.getChildren(true); + if (children.indexOf(child.data) === -1) { + if (typeof index === 'undefined' || index < 0) { + children.push(child.data); + } else { + children.splice(index, 0, child.data); + } + } + } + objectAssign(child, { + parent: this, + store: this.store + }); + child = new Node(child); + } + + child.level = this.level + 1; + + if (typeof index === 'undefined' || index < 0) { + this.childNodes.push(child); + } else { + this.childNodes.splice(index, 0, child); + } + + this.updateLeafState(); + } + + insertBefore(child, ref) { + let index; + if (ref) { + index = this.childNodes.indexOf(ref); + } + this.insertChild(child, index); + } + + insertAfter(child, ref) { + let index; + if (ref) { + index = this.childNodes.indexOf(ref); + if (index !== -1) index += 1; + } + this.insertChild(child, index); + } + + removeChild(child) { + const children = this.getChildren() || []; + const dataIndex = children.indexOf(child.data); + if (dataIndex > -1) { + children.splice(dataIndex, 1); + } + + const index = this.childNodes.indexOf(child); + + if (index > -1) { + this.store && this.store.deregisterNode(child); + child.parent = null; + this.childNodes.splice(index, 1); + } + + this.updateLeafState(); + } + + removeChildByData(data) { + let targetNode = null; + + for (let i = 0; i < this.childNodes.length; i++) { + if (this.childNodes[i].data === data) { + targetNode = this.childNodes[i]; + break; + } + } + + if (targetNode) { + this.removeChild(targetNode); + } + } + + expand(callback, expandParent) { + const done = () => { + if (expandParent) { + let parent = this.parent; + while (parent.level > 0) { + parent.expanded = true; + parent = parent.parent; + } + } + this.expanded = true; + if (callback) callback(); + }; + + if (this.shouldLoadData()) { + this.loadData((data) => { + if (data instanceof Array) { + if (this.checked) { + this.setChecked(true, true); + } else if (!this.store.checkStrictly) { + reInitChecked(this); + } + done(); + } + }); + } else { + done(); + } + } + + doCreateChildren(array, defaultProps = {}) { + array.forEach((item) => { + this.insertChild(objectAssign({ data: item }, defaultProps), undefined, true); + }); + } + + collapse() { + this.expanded = false; + } + + shouldLoadData() { + return this.store.lazy === true && this.store.load && !this.loaded; + } + + updateLeafState() { + if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') { + this.isLeaf = this.isLeafByUser; + return; + } + const childNodes = this.childNodes; + if (!this.store.lazy || (this.store.lazy === true && this.loaded === true)) { + this.isLeaf = !childNodes || childNodes.length === 0; + return; + } + this.isLeaf = false; + } + + setChecked(value, deep, recursion, passValue) { + this.indeterminate = value === 'half'; + this.checked = value === true; + + if (this.store.checkStrictly) return; + + if (!(this.shouldLoadData() && !this.store.checkDescendants)) { + let { all, allWithoutDisable } = getChildState(this.childNodes); + + if (!this.isLeaf && (!all && allWithoutDisable)) { + this.checked = false; + value = false; + } + + const handleDescendants = () => { + if (deep) { + const childNodes = this.childNodes; + for (let i = 0, j = childNodes.length; i < j; i++) { + const child = childNodes[i]; + passValue = passValue || value !== false; + const isCheck = child.disabled ? child.checked : passValue; + child.setChecked(isCheck, deep, true, passValue); + } + const { half, all } = getChildState(childNodes); + if (!all) { + this.checked = all; + this.indeterminate = half; + } + } + }; + + if (this.shouldLoadData()) { + // Only work on lazy load data. + this.loadData(() => { + handleDescendants(); + reInitChecked(this); + }, { + checked: value !== false + }); + return; + } else { + handleDescendants(); + } + } + + const parent = this.parent; + if (!parent || parent.level === 0) return; + + if (!recursion) { + reInitChecked(parent); + } + } + + getChildren(forceInit = false) { // this is data + if (this.level === 0) return this.data; + const data = this.data; + if (!data) return null; + + const props = this.store.props; + let children = 'children'; + if (props) { + children = props.children || 'children'; + } + + if (data[children] === undefined) { + data[children] = null; + } + + if (forceInit && !data[children]) { + data[children] = []; + } + + return data[children]; + } + + updateChildren() { + const newData = this.getChildren() || []; + const oldData = this.childNodes.map((node) => node.data); + + const newDataMap = {}; + const newNodes = []; + + newData.forEach((item, index) => { + const key = item[NODE_KEY]; + const isNodeExists = !!key && arrayFindIndex(oldData, data => data[NODE_KEY] === key) >= 0; + if (isNodeExists) { + newDataMap[key] = { index, data: item }; + } else { + newNodes.push({ index, data: item }); + } + }); + + if (!this.store.lazy) { + oldData.forEach((item) => { + if (!newDataMap[item[NODE_KEY]]) this.removeChildByData(item); + }); + } + + newNodes.forEach(({ index, data }) => { + this.insertChild({ data }, index); + }); + + this.updateLeafState(); + } + + loadData(callback, defaultProps = {}) { + if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) { + this.loading = true; + + const resolve = (children) => { + this.loaded = true; + this.loading = false; + this.childNodes = []; + + this.doCreateChildren(children, defaultProps); + + this.updateLeafState(); + if (callback) { + callback.call(this, children); + } + }; + + this.store.load(this, resolve); + } else { + if (callback) { + callback.call(this); + } + } + } +} diff --git a/ui/packages/common/AiWechatSelecter/tree/model/tree-store.js b/ui/packages/common/AiWechatSelecter/tree/model/tree-store.js new file mode 100644 index 00000000..68f58e6d --- /dev/null +++ b/ui/packages/common/AiWechatSelecter/tree/model/tree-store.js @@ -0,0 +1,367 @@ +import Node from './node'; +import { getNodeKey } from './util'; + +export default class TreeStore { + constructor(options) { + this.currentNode = null; + this.currentNodeKey = null; + + for (let option in options) { + if (options.hasOwnProperty(option)) { + this[option] = options[option]; + } + } + + this.nodesMap = {}; + this.myNodesMap = []; + this.root = new Node({ + data: this.data, + store: this + }); + + if (this.lazy && this.load) { + const loadFn = this.load; + loadFn(this.root, (data) => { + this.root.doCreateChildren(data); + this._initDefaultCheckedNodes(); + }); + } else { + this._initDefaultCheckedNodes(); + } + } + + filter(value) { + const filterNodeMethod = this.filterNodeMethod; + const lazy = this.lazy; + const traverse = function(node) { + const childNodes = node.root ? node.root.childNodes : node.childNodes; + + childNodes.forEach((child) => { + child.visible = filterNodeMethod.call(child, value, child.data, child); + + traverse(child); + }); + + if (!node.visible && childNodes.length) { + let allHidden = true; + allHidden = !childNodes.some((child) => child.visible); + + if (node.root) { + node.root.visible = allHidden === false; + } else { + node.visible = allHidden === false; + } + } + if (!value) return; + + if (node.visible && !node.isLeaf && !lazy) node.expand(); + }; + + traverse(this); + } + + setData(newVal) { + const instanceChanged = newVal !== this.root.data; + if (instanceChanged) { + this.root.setData(newVal); + this._initDefaultCheckedNodes(); + } else { + this.root.updateChildren(); + } + } + + getNode(data) { + if (data instanceof Node) return data; + const key = typeof data !== 'object' ? data : getNodeKey(this.key, data); + return this.nodesMap[key] || null; + } + + insertBefore(data, refData) { + const refNode = this.getNode(refData); + refNode.parent.insertBefore({ data }, refNode); + } + + insertAfter(data, refData) { + const refNode = this.getNode(refData); + refNode.parent.insertAfter({ data }, refNode); + } + + remove(data) { + const node = this.getNode(data); + + if (node && node.parent) { + if (node === this.currentNode) { + this.currentNode = null; + } + node.parent.removeChild(node); + } + } + + append(data, parentData) { + const parentNode = parentData ? this.getNode(parentData) : this.root; + + if (parentNode) { + parentNode.insertChild({ data }); + } + } + + _initDefaultCheckedNodes() { + const defaultCheckedKeys = this.defaultCheckedKeys || []; + const nodesMap = this.nodesMap; + + defaultCheckedKeys.forEach((checkedKey) => { + const node = nodesMap[checkedKey]; + + if (node) { + node.setChecked(true, !this.checkStrictly); + } + }); + } + + _initDefaultCheckedNode(node) { + const defaultCheckedKeys = this.defaultCheckedKeys || []; + + if (defaultCheckedKeys.indexOf(node.key) !== -1) { + node.setChecked(true, !this.checkStrictly); + } + } + + setDefaultCheckedKey(newVal) { + if (newVal !== this.defaultCheckedKeys) { + this.defaultCheckedKeys = newVal; + this._initDefaultCheckedNodes(); + } + } + + registerNode(node) { + const key = this.key; + if (!key || !node || !node.data) return; + + const nodeKey = node.key; + if (nodeKey !== undefined) this.nodesMap[node.key] = node; + if (nodeKey !== undefined) { + this.myNodesMap.push({ + [node.key]: node + }); + } + } + setMyChecked(data, checked, deep) { + const nodes = this.getMyNode(data); + if (nodes && nodes.length > 0) { + for (let index = 0; index < nodes.length; index++) { + const element = nodes[index]; + let node = Object.values(element)[0]; + if (node && node.checked !== checked) { + node.setChecked(!!checked, deep); + } + } + } + } + + //mycode + getMyNode(data) { + const key = typeof data !== 'object' ? data : getNodeKey(this.key, data); + const result = this.myNodesMap.filter((item) => item[key]); + return result || []; + } + + deregisterNode(node) { + const key = this.key; + if (!key || !node || !node.data) return; + + node.childNodes.forEach((child) => { + this.deregisterNode(child); + }); + + delete this.nodesMap[node.key]; + } + + getCheckedNodes(leafOnly = false, includeHalfChecked = false) { + const checkedNodes = []; + const traverse = function(node) { + const childNodes = node.root ? node.root.childNodes : node.childNodes; + + childNodes.forEach((child) => { + if ( + (child.checked || (includeHalfChecked && child.indeterminate)) && + (!leafOnly || (leafOnly && child.isLeaf)) + ) { + checkedNodes.push(child.data); + } + + traverse(child); + }); + }; + + traverse(this); + + return checkedNodes; + } + + getCheckedKeys(leafOnly = false) { + return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]); + } + + getHalfCheckedNodes() { + const nodes = []; + const traverse = function(node) { + const childNodes = node.root ? node.root.childNodes : node.childNodes; + + childNodes.forEach((child) => { + if (child.indeterminate) { + nodes.push(child.data); + } + + traverse(child); + }); + }; + + traverse(this); + + return nodes; + } + + getHalfCheckedKeys() { + return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]); + } + + _getAllNodes() { + const allNodes = []; + const nodesMap = this.nodesMap; + for (let nodeKey in nodesMap) { + if (nodesMap.hasOwnProperty(nodeKey)) { + allNodes.push(nodesMap[nodeKey]); + } + } + + return allNodes; + } + + updateChildren(key, data) { + const node = this.nodesMap[key]; + if (!node) return; + const childNodes = node.childNodes; + for (let i = childNodes.length - 1; i >= 0; i--) { + const child = childNodes[i]; + this.remove(child.data); + } + for (let i = 0, j = data.length; i < j; i++) { + const child = data[i]; + this.append(child, node.data); + } + } + + _setCheckedKeys(key, leafOnly = false, checkedKeys) { + const allNodes = this._getAllNodes().sort((a, b) => b.level - a.level); + const cache = Object.create(null); + const keys = Object.keys(checkedKeys); + allNodes.forEach((node) => node.setChecked(false, false)); + for (let i = 0, j = allNodes.length; i < j; i++) { + const node = allNodes[i]; + const nodeKey = node.data[key].toString(); + let checked = keys.indexOf(nodeKey) > -1; + if (!checked) { + if (node.checked && !cache[nodeKey]) { + node.setChecked(false, false); + } + continue; + } + + let parent = node.parent; + while (parent && parent.level > 0) { + cache[parent.data[key]] = true; + parent = parent.parent; + } + + if (node.isLeaf || this.checkStrictly) { + node.setChecked(true, false); + continue; + } + node.setChecked(true, true); + + if (leafOnly) { + node.setChecked(false, false); + const traverse = function(node) { + const childNodes = node.childNodes; + childNodes.forEach((child) => { + if (!child.isLeaf) { + child.setChecked(false, false); + } + traverse(child); + }); + }; + traverse(node); + } + } + } + + setCheckedNodes(array, leafOnly = false) { + const key = this.key; + const checkedKeys = {}; + array.forEach((item) => { + checkedKeys[(item || {})[key]] = true; + }); + + this._setCheckedKeys(key, leafOnly, checkedKeys); + } + + setCheckedKeys(keys, leafOnly = false) { + this.defaultCheckedKeys = keys; + const key = this.key; + const checkedKeys = {}; + keys.forEach((key) => { + checkedKeys[key] = true; + }); + + this._setCheckedKeys(key, leafOnly, checkedKeys); + } + + setDefaultExpandedKeys(keys) { + keys = keys || []; + this.defaultExpandedKeys = keys; + + keys.forEach((key) => { + const node = this.getNode(key); + if (node) node.expand(null, this.autoExpandParent); + }); + } + + setChecked(data, checked, deep) { + const node = this.getNode(data); + + if (node) { + node.setChecked(!!checked, deep); + } + } + + getCurrentNode() { + return this.currentNode; + } + + setCurrentNode(currentNode) { + const prevCurrentNode = this.currentNode; + if (prevCurrentNode) { + prevCurrentNode.isCurrent = false; + } + this.currentNode = currentNode; + this.currentNode.isCurrent = true; + } + + setUserCurrentNode(node) { + const key = node[this.key]; + const currNode = this.nodesMap[key]; + this.setCurrentNode(currNode); + } + + setCurrentNodeKey(key) { + if (key === null || key === undefined) { + this.currentNode && (this.currentNode.isCurrent = false); + this.currentNode = null; + return; + } + const node = this.getNode(key); + if (node) { + this.setCurrentNode(node); + } + } +} diff --git a/ui/packages/common/AiWechatSelecter/tree/model/util.js b/ui/packages/common/AiWechatSelecter/tree/model/util.js new file mode 100644 index 00000000..dcc891b1 --- /dev/null +++ b/ui/packages/common/AiWechatSelecter/tree/model/util.js @@ -0,0 +1,27 @@ +export const NODE_KEY = '$treeNodeId'; + +export const markNodeData = function(node, data) { + if (!data || data[NODE_KEY]) return; + Object.defineProperty(data, NODE_KEY, { + value: node.id, + enumerable: false, + configurable: false, + writable: false + }); +}; + +export const getNodeKey = function(key, data) { + if (!key) return data[NODE_KEY]; + return data[key]; +}; + +export const findNearestComponent = (element, componentName) => { + let target = element; + while (target && target.tagName !== 'BODY') { + if (target.__vue__ && target.__vue__.$options.name === componentName) { + return target.__vue__; + } + target = target.parentNode; + } + return null; +}; diff --git a/ui/packages/common/AiWechatSelecter/tree/tree-node.vue b/ui/packages/common/AiWechatSelecter/tree/tree-node.vue new file mode 100644 index 00000000..3c922dbe --- /dev/null +++ b/ui/packages/common/AiWechatSelecter/tree/tree-node.vue @@ -0,0 +1,279 @@ + + + diff --git a/ui/packages/common/AiWechatSelecter/tree/tree.vue b/ui/packages/common/AiWechatSelecter/tree/tree.vue new file mode 100644 index 00000000..da049622 --- /dev/null +++ b/ui/packages/common/AiWechatSelecter/tree/tree.vue @@ -0,0 +1,500 @@ + + + diff --git a/ui/packages/index.js b/ui/packages/index.js new file mode 100644 index 00000000..c5ebbee1 --- /dev/null +++ b/ui/packages/index.js @@ -0,0 +1,45 @@ +//本地仓库外部组件 + +// 存储组件列表 +let components = []; +// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册 +const install = function (Vue) { + if (install.installed) return; + // 遍历注册全局组件 + let contexts = require.context('.', true, /[\\\/]Ai([^\\\/]+)\.vue$/); + Vue.directive('throttle', { + bind: function (el, obj) { + let timerId = null + let flag = true + + el.addEventListener('input', function () { + if (!flag) return + + flag = false + timerId && clearTimeout(timerId) + timerId = setTimeout(function () { + flag = true + obj.value() + }, 800) + }) + } + }) + if (contexts) { + contexts.keys().map((e) => { + components.push(contexts(e).default); + Vue.component(contexts(e).default.name, contexts(e).default); + }); + } +}; + +// 判断是否是直接引入文件 +if (typeof window !== 'undefined' && window.Vue) { + install(window.Vue); +} + +export default { + // 导出的对象必须具有 install,才能被 Vue.use() 方法安装 + install, + // 以下组件列表 + ...components +}; diff --git a/ui/packages/layout/AiCard.vue b/ui/packages/layout/AiCard.vue new file mode 100644 index 00000000..2a97e547 --- /dev/null +++ b/ui/packages/layout/AiCard.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ui/packages/layout/AiDetail.vue b/ui/packages/layout/AiDetail.vue new file mode 100644 index 00000000..29af08b5 --- /dev/null +++ b/ui/packages/layout/AiDetail.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/ui/packages/layout/AiDialogBtn.vue b/ui/packages/layout/AiDialogBtn.vue new file mode 100644 index 00000000..594fd6d6 --- /dev/null +++ b/ui/packages/layout/AiDialogBtn.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/ui/packages/layout/AiHighlight.vue b/ui/packages/layout/AiHighlight.vue new file mode 100644 index 00000000..5265235c --- /dev/null +++ b/ui/packages/layout/AiHighlight.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/ui/packages/layout/AiIntro.vue b/ui/packages/layout/AiIntro.vue new file mode 100644 index 00000000..d3cced76 --- /dev/null +++ b/ui/packages/layout/AiIntro.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/ui/packages/layout/AiList.vue b/ui/packages/layout/AiList.vue new file mode 100644 index 00000000..0a294140 --- /dev/null +++ b/ui/packages/layout/AiList.vue @@ -0,0 +1,248 @@ + + + + + diff --git a/ui/packages/layout/AiSearch.vue b/ui/packages/layout/AiSearch.vue new file mode 100644 index 00000000..1323e408 --- /dev/null +++ b/ui/packages/layout/AiSearch.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/ui/packages/layout/AiSearchBar.vue b/ui/packages/layout/AiSearchBar.vue new file mode 100644 index 00000000..47f865b1 --- /dev/null +++ b/ui/packages/layout/AiSearchBar.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/ui/packages/layout/AiSidebar.vue b/ui/packages/layout/AiSidebar.vue new file mode 100644 index 00000000..3ae42cd4 --- /dev/null +++ b/ui/packages/layout/AiSidebar.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/ui/packages/layout/AiTreeMenu.vue b/ui/packages/layout/AiTreeMenu.vue new file mode 100644 index 00000000..db1f3b56 --- /dev/null +++ b/ui/packages/layout/AiTreeMenu.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/ui/packages/tools/AiCodeEditor.vue b/ui/packages/tools/AiCodeEditor.vue new file mode 100644 index 00000000..224ea843 --- /dev/null +++ b/ui/packages/tools/AiCodeEditor.vue @@ -0,0 +1,675 @@ + + + + + diff --git a/ui/packages/tools/AiDownload.vue b/ui/packages/tools/AiDownload.vue new file mode 100644 index 00000000..5020e48a --- /dev/null +++ b/ui/packages/tools/AiDownload.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/ui/packages/tools/AiEchart.vue b/ui/packages/tools/AiEchart.vue new file mode 100644 index 00000000..ac692d4d --- /dev/null +++ b/ui/packages/tools/AiEchart.vue @@ -0,0 +1,183 @@ + + + + + diff --git a/ui/packages/tools/AiFlow.vue b/ui/packages/tools/AiFlow.vue new file mode 100644 index 00000000..7be926f5 --- /dev/null +++ b/ui/packages/tools/AiFlow.vue @@ -0,0 +1,205 @@ + + + + + diff --git a/ui/packages/tools/AiMap.vue b/ui/packages/tools/AiMap.vue new file mode 100644 index 00000000..f8b4e5c5 --- /dev/null +++ b/ui/packages/tools/AiMap.vue @@ -0,0 +1,257 @@ + + + + + diff --git a/ui/packages/tools/AiProcess.vue b/ui/packages/tools/AiProcess.vue new file mode 100644 index 00000000..f827e2d0 --- /dev/null +++ b/ui/packages/tools/AiProcess.vue @@ -0,0 +1,178 @@ + + + + + diff --git a/ui/packages/tools/AiQMap.vue b/ui/packages/tools/AiQMap.vue new file mode 100644 index 00000000..5b29d269 --- /dev/null +++ b/ui/packages/tools/AiQMap.vue @@ -0,0 +1,313 @@ + + + + + diff --git a/ui/packages/tools/AiTMap.vue b/ui/packages/tools/AiTMap.vue new file mode 100644 index 00000000..29a9045d --- /dev/null +++ b/ui/packages/tools/AiTMap.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/ui/packages/wx/AiOpenData.vue b/ui/packages/wx/AiOpenData.vue new file mode 100644 index 00000000..a4d0ad15 --- /dev/null +++ b/ui/packages/wx/AiOpenData.vue @@ -0,0 +1,41 @@ + + + diff --git a/vue.config.js b/vue.config.js index 159e475a..921fed1f 100644 --- a/vue.config.js +++ b/vue.config.js @@ -5,7 +5,7 @@ module.exports = { css: { loaderOptions: { scss: { - data: `@import "~dvcp-ui/lib/styles/vars.scss";` + data: `@import "~dui/lib/styles/vars.scss";` } } }, @@ -17,7 +17,7 @@ module.exports = { filename: 'index.html' } }, - transpileDependencies: [/node_modules[\\\/]dvcp-ui[\\\/]lib[\\\/]js/], + transpileDependencies: [/dui[\\\/]lib[\\\/]js/], chainWebpack: (config) => { config.module .rule('js') @@ -25,7 +25,7 @@ module.exports = { .add(path.resolve(__dirname, 'components')) .add(path.resolve(__dirname, 'project')) .add(path.resolve(__dirname, 'examples')) - .add(path.resolve(__dirname, 'node_modules/dvcp-ui')) + .add(path.resolve(__dirname, 'ui')) .end() .use('babel') .loader('babel-loader')