From 2a2a7b85675f9a6a52157db100cc6de02c52d2fe Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Tue, 29 Nov 2022 12:02:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=96=E8=BE=91=E7=94=A8=E6=88=B7=20?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8D=E8=83=BD=E5=88=A0=E9=99=A4=EF=BC=8C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=8A=8A=E2=80=9D=E5=88=A0=E9=99=A4=E2=80=9C?= =?UTF-8?q?=E5=AD=97=E6=A0=B7=E6=94=B9=E6=88=90=E2=80=9D=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E2=80=9C=20#3901=EF=BC=8C=20=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=8D=A1-tab=E5=86=85=E9=83=A8=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE-=E8=BD=AE=E6=92=AD-=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=B0=83=E8=AF=95-=E6=97=B6=E9=97=B4=E8=A2=AB=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E8=B0=83=E8=8A=82=E6=8C=89=E9=92=AE=E9=81=AE=E6=8C=A1?= =?UTF-8?q?=EF=BC=8C=E6=98=8E=E7=BB=86=E8=A1=A8=E7=9A=84=E9=A1=B5=E7=A0=81?= =?UTF-8?q?=E5=9C=A8=E6=B7=B1=E8=89=B2=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9C=8B?= =?UTF-8?q?=E4=B8=8D=E6=B8=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/TextAttr.vue | 18 +- .../canvas/components/editor/DeEditor.vue | 2 +- .../canvas/components/editor/SettingMenu.vue | 8 +- .../canvas/customComponent/UserView.vue | 1 - .../src/components/deCustomCm/DeDatePick.vue | 2 +- .../src/components/deCustomCm/DePager.vue | 180 +++++++++++++ .../src/components/deCustomCm/pagination.js | 241 ++++++++++++++++++ .../src/components/widget/deWidget/DeTabs.vue | 4 +- .../components/widget/deWidget/TabStyle.vue | 11 +- frontend/src/lang/en.js | 2 +- frontend/src/lang/tw.js | 2 +- frontend/src/lang/zh.js | 2 +- frontend/src/views/background/index.vue | 2 +- .../chart/components/ChartComponentS2.vue | 10 +- .../chart/components/table/TableNormal.vue | 8 +- frontend/src/views/chart/view/ChartEdit.vue | 60 ++--- frontend/src/views/dataset/data/FieldEdit.vue | 43 ++-- .../panel/appTemplate/AppTemplateContent.vue | 4 +- .../views/panel/appTemplateMarket/index.vue | 2 +- .../src/views/panel/edit/ComponentWait.vue | 4 +- frontend/src/views/panel/edit/index.vue | 49 ++-- .../panel/filter/filterMain/FilterControl.vue | 16 +- frontend/src/views/panel/list/PanelList.vue | 16 +- frontend/src/views/system/user/UserEditer.vue | 7 +- 24 files changed, 563 insertions(+), 131 deletions(-) create mode 100644 frontend/src/components/deCustomCm/DePager.vue create mode 100644 frontend/src/components/deCustomCm/pagination.js diff --git a/frontend/src/components/canvas/components/TextAttr.vue b/frontend/src/components/canvas/components/TextAttr.vue index 67a029c2c2..5b42a930bd 100644 --- a/frontend/src/components/canvas/components/TextAttr.vue +++ b/frontend/src/components/canvas/components/TextAttr.vue @@ -24,7 +24,7 @@ > - + @@ -47,7 +47,7 @@ :value="item.value" > - + {{ item.label }} @@ -257,7 +257,7 @@ @click="goColor" /> -
+
-
+
-
+
- +
@@ -327,7 +327,7 @@ style="width: 20px;float: left;margin-top: 2px;margin-left: 2px;" > - +
@@ -336,7 +336,7 @@ style="width: 20px;float: left;margin-top: 2px;margin-left: 2px;" > - +
- +
diff --git a/frontend/src/components/canvas/components/editor/DeEditor.vue b/frontend/src/components/canvas/components/editor/DeEditor.vue index 661432bfe1..fec084e0b4 100644 --- a/frontend/src/components/canvas/components/editor/DeEditor.vue +++ b/frontend/src/components/canvas/components/editor/DeEditor.vue @@ -121,7 +121,7 @@ :canvas-id="canvasId" /> - + - + - {{ $t('panel.level') }} + {{ $t('panel.level') }} - + {{ $t('panel.hyperlinks') }} - + {{ $t('panel.position_adjust') }} diff --git a/frontend/src/components/canvas/customComponent/UserView.vue b/frontend/src/components/canvas/customComponent/UserView.vue index c9a5137afd..d90135d98e 100644 --- a/frontend/src/components/canvas/customComponent/UserView.vue +++ b/frontend/src/components/canvas/customComponent/UserView.vue @@ -658,7 +658,6 @@ export default { } catch (e) { console.error('reDrawView-error:', this.element.propValue.id) } - } }, bindPluginEvent() { diff --git a/frontend/src/components/deCustomCm/DeDatePick.vue b/frontend/src/components/deCustomCm/DeDatePick.vue index 2e8b8914f6..396c261a2e 100644 --- a/frontend/src/components/deCustomCm/DeDatePick.vue +++ b/frontend/src/components/deCustomCm/DeDatePick.vue @@ -26,7 +26,7 @@ export default { }, methods: { handleChange(val) { - const [ pre, next ] = val + const [pre, next] = val this.$emit('input', [pre, next ? new Date(+new Date(next) + (23 * 3600 + 59 * 61) * 1000) : '']) } } diff --git a/frontend/src/components/deCustomCm/DePager.vue b/frontend/src/components/deCustomCm/DePager.vue new file mode 100644 index 0000000000..1f852d3974 --- /dev/null +++ b/frontend/src/components/deCustomCm/DePager.vue @@ -0,0 +1,180 @@ + + + diff --git a/frontend/src/components/deCustomCm/pagination.js b/frontend/src/components/deCustomCm/pagination.js new file mode 100644 index 0000000000..8e0541141c --- /dev/null +++ b/frontend/src/components/deCustomCm/pagination.js @@ -0,0 +1,241 @@ +import Pager from './DePager.vue' + +export default { + name: 'DePagination', + + props: { + pageSize: { + type: Number, + default: 10 + }, + + customStyle: { + default: () => {}, + type: Object + }, + + small: Boolean, + + total: Number, + + pageCount: Number, + + pagerCount: { + type: Number, + validator(value) { + return (value | 0) === value && value > 4 && value < 22 && (value % 2) === 1 + }, + default: 7 + }, + + currentPage: { + type: Number, + default: 1 + }, + + layout: { + default: 'prev, pager, next' + }, + + popperClass: String, + + prevText: String, + + nextText: String, + + background: Boolean, + + disabled: Boolean, + + hideOnSinglePage: Boolean + }, + + data() { + return { + internalCurrentPage: 1, + internalPageSize: 0, + lastEmittedPage: -1, + userChangePageSize: false + } + }, + + render(h) { + const layout = this.layout + if (!layout) return null + if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null + + const template =
+ const TEMPLATE_MAP = { + prev: , + pager: , + next: + } + const components = layout.split(',').map((item) => item.trim()) + + template.children = template.children || [] + components.forEach(compo => { + template.children.push(TEMPLATE_MAP[compo]) + }) + return template + }, + + components: { + Prev: { + props: { + customStyle: { + default: () => {}, + type: Object + } + }, + render(h) { + return ( + + ) + } + }, + + Next: { + props: { + customStyle: { + default: () => {}, + type: Object + } + }, + render(h) { + return ( + + ) + } + }, + Pager + }, + + methods: { + handleCurrentChange(val) { + this.internalCurrentPage = this.getValidCurrentPage(val) + this.userChangePageSize = true + this.emitChange() + }, + + prev() { + if (this.disabled) return + const newVal = this.internalCurrentPage - 1 + this.internalCurrentPage = this.getValidCurrentPage(newVal) + this.$emit('prev-click', this.internalCurrentPage) + this.emitChange() + }, + + next() { + if (this.disabled) return + const newVal = this.internalCurrentPage + 1 + this.internalCurrentPage = this.getValidCurrentPage(newVal) + this.$emit('next-click', this.internalCurrentPage) + this.emitChange() + }, + + getValidCurrentPage(value) { + value = parseInt(value, 10) + + const havePageCount = typeof this.internalPageCount === 'number' + + let resetValue + if (!havePageCount) { + if (isNaN(value) || value < 1) resetValue = 1 + } else { + if (value < 1) { + resetValue = 1 + } else if (value > this.internalPageCount) { + resetValue = this.internalPageCount + } + } + + if (resetValue === undefined && isNaN(value)) { + resetValue = 1 + } else if (resetValue === 0) { + resetValue = 1 + } + + return resetValue === undefined ? value : resetValue + }, + + emitChange() { + this.$nextTick(() => { + if (this.internalCurrentPage !== this.lastEmittedPage || this.userChangePageSize) { + this.$emit('current-change', this.internalCurrentPage) + this.lastEmittedPage = this.internalCurrentPage + this.userChangePageSize = false + } + }) + } + }, + + computed: { + internalPageCount() { + if (typeof this.total === 'number') { + return Math.max(1, Math.ceil(this.total / this.internalPageSize)) + } else if (typeof this.pageCount === 'number') { + return Math.max(1, this.pageCount) + } + return null + } + }, + + watch: { + currentPage: { + immediate: true, + handler(val) { + this.internalCurrentPage = this.getValidCurrentPage(val) + } + }, + + pageSize: { + immediate: true, + handler(val) { + this.internalPageSize = isNaN(val) ? 10 : val + } + }, + + internalCurrentPage: { + immediate: true, + handler(newVal) { + this.$emit('update:currentPage', newVal) + this.lastEmittedPage = -1 + } + }, + + internalPageCount(newVal) { + /* istanbul ignore if */ + const oldPage = this.internalCurrentPage + if (newVal > 0 && oldPage === 0) { + this.internalCurrentPage = 1 + } else if (oldPage > newVal) { + this.internalCurrentPage = newVal === 0 ? 1 : newVal + this.userChangePageSize && this.emitChange() + } + this.userChangePageSize = false + } + } +} diff --git a/frontend/src/components/widget/deWidget/DeTabs.vue b/frontend/src/components/widget/deWidget/DeTabs.vue index eae0d0c38e..511b907769 100644 --- a/frontend/src/components/widget/deWidget/DeTabs.vue +++ b/frontend/src/components/widget/deWidget/DeTabs.vue @@ -202,7 +202,9 @@ @@ -198,5 +198,12 @@ export default { diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index d60c2b56fa..1ab2176296 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -43,7 +43,7 @@ export default { }, track: { upload_limit_format: 'The image format is incorrect. It supports JPG and PNG', - upload_limit_size: 'Picture size shall not exceed', + upload_limit_size: 'Picture size shall not exceed' }, route: { dashboard: 'Dashboard', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 15539a4f3b..e4ce6b8e57 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -43,7 +43,7 @@ export default { }, track: { upload_limit_format: '圖片格式錯誤,支持JPG,PNG', - upload_limit_size: '圖片大小不超過', + upload_limit_size: '圖片大小不超過' }, route: { dashboard: '首頁', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 2980adb9cd..5ed1e27d35 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -43,7 +43,7 @@ export default { }, track: { upload_limit_format: '图片格式错误,支持JPG,PNG', - upload_limit_size: '图片大小不超过', + upload_limit_size: '图片大小不超过' }, route: { dashboard: '首页', diff --git a/frontend/src/views/background/index.vue b/frontend/src/views/background/index.vue index 4fa88fb8d1..c3b0652f71 100644 --- a/frontend/src/views/background/index.vue +++ b/frontend/src/views/background/index.vue @@ -112,7 +112,7 @@ :http-request="upload" :file-list="fileList" > - + {{ $t('chart.items') }}
- {{ $t('chart.items') }} - - + - + {{ $t('chart.change_chart_type') }} - + @@ -490,8 +490,8 @@ > {{ - $t('chart.drag_block_table_data_column') - }} + $t('chart.drag_block_table_data_column') + }} {{ $t('chart.drag_block_type_axis') }} @@ -499,18 +499,18 @@ v-else-if="view.type && view.type.includes('pie')" >{{ $t('chart.drag_block_pie_label') }} {{ - $t('chart.drag_block_funnel_split') - }} + $t('chart.drag_block_funnel_split') + }} {{ - $t('chart.drag_block_radar_label') - }} + $t('chart.drag_block_radar_label') + }} {{ $t('chart.area') }} {{ - $t('chart.drag_block_treemap_label') - }} + $t('chart.drag_block_treemap_label') + }} {{ - $t('chart.drag_block_word_cloud_label') - }} + $t('chart.drag_block_word_cloud_label') + }} {{ $t('chart.drag_block_label') }} / {{ $t('chart.dimension') }} @@ -633,8 +633,8 @@ > {{ - $t('chart.drag_block_table_data_column') - }} + $t('chart.drag_block_table_data_column') + }} {{ $t('chart.drag_block_value_axis') }} @@ -642,30 +642,30 @@ v-else-if="view.type && view.type.includes('pie')" >{{ $t('chart.drag_block_pie_angel') }} {{ - $t('chart.drag_block_funnel_width') - }} + $t('chart.drag_block_funnel_width') + }} {{ - $t('chart.drag_block_radar_length') - }} + $t('chart.drag_block_radar_length') + }} {{ - $t('chart.drag_block_gauge_angel') - }} + $t('chart.drag_block_gauge_angel') + }} {{ $t('chart.drag_block_label_value') }} {{ $t('chart.chart_data') }} {{ - $t('chart.drag_block_treemap_size') - }} + $t('chart.drag_block_treemap_size') + }} {{ - $t('chart.drag_block_value_axis_main') - }} + $t('chart.drag_block_value_axis_main') + }} {{ $t('chart.drag_block_progress') }} {{ - $t('chart.drag_block_word_cloud_size') - }} + $t('chart.drag_block_word_cloud_size') + }} / {{ $t('chart.quota') }} - +
@@ -1281,7 +1281,7 @@ width="800px" class="dialog-css" > - + - + @@ -271,7 +268,7 @@ />
- +
@@ -284,15 +281,18 @@ @click="changeRightDrawOpen(false)" /> - {{ $t('panel.position_adjust') }} - -
- {{ $t('panel.select_view') }} + +
+ {{ $t('panel.select_view') }}
@@ -452,8 +452,7 @@ /> - {{ $t('panel.panel_cache_use_tips') }} + {{ $t('panel.panel_cache_use_tips') }}
{ - if (this.show) { - this.showIndex === -1 - } - this.show = !this.show + if (this.show) { + this.showIndex === -1 } + this.show = !this.show + } ) } this.showIndex = type diff --git a/frontend/src/views/panel/filter/filterMain/FilterControl.vue b/frontend/src/views/panel/filter/filterMain/FilterControl.vue index d6dfacc517..6c000cf16b 100644 --- a/frontend/src/views/panel/filter/filterMain/FilterControl.vue +++ b/frontend/src/views/panel/filter/filterMain/FilterControl.vue @@ -184,25 +184,25 @@ @change="val => {changeDynamicParams(val, item.name)}" >
{{ item.alias }} + >{{ ele.alias }} - {{ item.alias }} + {{ ele.alias }}
diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 829d27a3c1..913dac3d1f 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -109,7 +109,7 @@ icon="el-icon-delete" :command="beforeClickMore('delete', data, node)" > - {{ $t('panel.delete') }} + {{ $t('emailtask.default') + $t('commons.cancel') }} @@ -174,7 +174,7 @@ /> - + - + {{ $t('panel.groupAdd') }} - +
{{ - $t('panel.cancel') - }} + $t('panel.cancel') + }} {{ - $t('dataset.cancel') - }} + $t('dataset.cancel') + }} @@ -636,7 +635,7 @@ export default { } } - .form-gender-select { + .de-form-gender-select { width: 100%; } }