Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions packages/business/src/components/TablePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
:page-sizes="[10, 20, 50, 100]"
:page-size.sync="page.size"
:total="page.total"
@size-change="fetch(1)"
@size-change="handleSizeChange"
@current-change="handleCurrent"
>
</el-pagination>
Expand All @@ -118,6 +118,44 @@ import { makeDragNodeImage } from '../shared'

import SelectClassify from './SelectClassify'

const tableSettings = {
settings: {},

init() {
this.load()
},

getPageSize(routeName, defaultSize = 20) {
return this.settings[routeName]?.pageSize || defaultSize
},

setPageSize(routeName, pageSize) {
const setting = this.settings[routeName]

if (setting) {
setting.pageSize = pageSize
} else {
this.settings[routeName] = { pageSize }
}

this.save()
},

save() {
localStorage.setItem('TAPDATA_TABLE_SETTINGS', JSON.stringify(this.settings))
},

load() {
const settings = localStorage.getItem('TAPDATA_TABLE_SETTINGS')
if (settings) {
this.settings = JSON.parse(settings)
}
}
}

// Initialize settings on creation
tableSettings.init()

export default {
components: {
Classification,
Expand Down Expand Up @@ -148,11 +186,16 @@ export default {
draggable: Boolean
},
data() {
const isDaas = process.env.VUE_APP_PLATFORM === 'DAAS'

console.log('settings', localStorage.getItem('TAPDATA_TABLE_SETTINGS'), this.settings,)

return {
isDaas,
loading: false,
page: {
current: 1,
size: this.defaultPageSize,
size: tableSettings.getPageSize(this.$route.name, this.defaultPageSize),
total: 0
},
list: [],
Expand Down Expand Up @@ -306,11 +349,14 @@ export default {
} catch (e) {
console.error(e)
}
},
handleSizeChange(val) {
tableSettings.setPageSize(this.$route.name, val)
this.fetch(1)
}
}
}
</script>

<style lang="scss">
.table-page-container {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion packages/dag/src/components/FormPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
const formSchema = this.$store.getters['dataflow/formSchema'] || {}

// 重置TAB
this.scope?.formTab?.setActiveKey('tab1')
// this.scope?.formTab?.setActiveKey('tab1')

if (!this.ins) {
// 节点不存在,比如删掉了,清除表单
Expand Down
4 changes: 2 additions & 2 deletions packages/dag/src/components/form/field-inference/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
:open-delay="200"
transition="none"
>
<span class="flex align-center">
<span class="inline-flex align-center">
<VIcon size="12">fingerprint</VIcon>
<span :style="`--index: '${indicesMap[scope.row.field_name][1]}';`" class="fingerprint-sub"></span>
</span>
</ElTooltip>
<VIcon v-else-if="partitionMap[scope.row.field_name]" size="14" class="ml-1 align-middle"
>circle-dashed-letter-p</VIcon
>circle-dashed-letter-p</VIcon
>
<VIcon v-else-if="scope.row.source === 'virtual_hash'" size="14">file-hash</VIcon>
<span class="ellipsis ml-1" :style="scope.row.source === 'virtual_hash' ? 'font-style:italic' : ''">{{
Expand Down
13 changes: 9 additions & 4 deletions packages/dag/src/components/form/schema-panel/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, onBeforeUnmount, watch } from '@vue/composition-api'
import { defineComponent, onBeforeUnmount, watch, nextTick } from '@vue/composition-api'
import { useForm } from '@tap/form'
import MigrateMetaPane from '../../migration/MigrateMetaPane'
import { observe } from '@formily/reactive'
Expand All @@ -11,14 +11,19 @@ export const SchemaPanel = defineComponent({
loadData()
})
const loadData = () => {
if (props.formTab.activeKey === 'tab2') {
refs.pane.loadData()
if (props.formTab?.activeKey === 'tab2') {
nextTick(() => {
refs.pane?.loadData()
})
}
}
const unWatch = watch(
() => props.formTab.activeKey,
() => props.formTab?.activeKey,
() => {
loadData()
},
{
immediate: true
}
)

Expand Down
2 changes: 1 addition & 1 deletion packages/dag/src/nodes/Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ export class Database extends NodeType {
}
}
},
tab3: {
alarmTab: {
type: 'void',
'x-component': 'FormTab.TabPane',
'x-component-props': {
Expand Down
4 changes: 2 additions & 2 deletions packages/dag/src/nodes/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ export class Table extends NodeType {
}
}
},
tab2: {
advancedTab: {
type: 'void',
'x-component': 'FormTab.TabPane',
'x-component-props': {
Expand Down Expand Up @@ -1761,7 +1761,7 @@ export class Table extends NodeType {
}
}
},
tab3: {
alarmTab: {
type: 'void',
'x-component': 'FormTab.TabPane',
'x-component-props': {
Expand Down
10 changes: 10 additions & 0 deletions packages/dag/src/nodes/extends/NodeType.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,18 @@ export class NodeType {
}

if (this.group === 'processor') {
if (formSchema.properties.tabs.properties.tab1) {
formSchema.properties.tabs.properties.tab1['x-index'] = 1
}

if (formSchema.properties.tabs.properties.tab2) {
formSchema.properties.tabs.properties.tab2['x-index'] = 3
}

if (!formSchema.properties.tabs.properties.advancedTab) {
formSchema.properties.tabs.properties.advancedTab = {
type: 'void',
'x-index': 2,
'x-component': 'FormTab.TabPane',
'x-component-props': {
label: i18n.t('public_advanced_settings')
Expand Down Expand Up @@ -99,6 +108,7 @@ export class NodeType {
if (!formSchema.properties.tabs.properties.alarmTab) {
formSchema.properties.tabs.properties.alarmTab = {
type: 'void',
'x-index': 4,
'x-component': 'FormTab.TabPane',
'x-component-props': {
label: i18n.t('packages_dag_migration_configpanel_gaojingshezhi'),
Expand Down
Loading