|
|
@ -208,6 +208,7 @@ |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
|
|
|
|
|
|
|
|
<div is="style" v-html="style" /> |
|
|
|
<div is="style" v-html="style" /> |
|
|
|
|
|
|
|
<div is="style" v-html="resizeColStyle" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -290,27 +291,17 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
style() { |
|
|
|
style() { |
|
|
|
let style = '' |
|
|
|
let style = '' |
|
|
|
for (const [key, val] of Object.entries(this.columnsWidth || {})) { |
|
|
|
for (const c of this.availableColumns) { |
|
|
|
if (val && key !== this.resizingCol) { |
|
|
|
const val = (this.columnsWidth && this.columnsWidth[c.alias]) || (c.virtual ? '200px' : (columnStyling[c.uidt] && columnStyling[c.uidt].w)) |
|
|
|
style += ` |
|
|
|
if (val && c.key !== this.resizingCol) { |
|
|
|
[data-col="${key}"]{ |
|
|
|
style += `[data-col="${c.alias}"]{min-width:${val};max-width:${val};width: ${val};}` |
|
|
|
min-width: ${val}; |
|
|
|
|
|
|
|
max-width: ${val}; |
|
|
|
|
|
|
|
width: ${val}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
` |
|
|
|
|
|
|
|
} else if (key === this.resizingCol) { |
|
|
|
|
|
|
|
style += ` |
|
|
|
|
|
|
|
[data-col="${key}"]{ |
|
|
|
|
|
|
|
min-width: ${this.resizingColWidth}; |
|
|
|
|
|
|
|
max-width: ${this.resizingColWidth}; |
|
|
|
|
|
|
|
width: ${this.resizingColWidth}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
` |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return style |
|
|
|
return style |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
resizeColStyle() { |
|
|
|
|
|
|
|
return this.resizingCol ? ` [data-col="${this.resizingCol}"]{min-width:${this.resizingColWidth};max-width:${this.resizingColWidth};width:${this.resizingColWidth};}` : '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
@ -344,20 +335,20 @@ export default { |
|
|
|
this.onCellValueChange(colIndex, rowIndex, columnObj) |
|
|
|
this.onCellValueChange(colIndex, rowIndex, columnObj) |
|
|
|
}, |
|
|
|
}, |
|
|
|
calculateColumnWidth() { |
|
|
|
calculateColumnWidth() { |
|
|
|
setTimeout(() => { |
|
|
|
// setTimeout(() => { |
|
|
|
const obj = {} |
|
|
|
// const obj = {} |
|
|
|
this.meta && this.meta.columns && this.meta.columns.forEach((c) => { |
|
|
|
// this.meta && this.meta.columns && this.meta.columns.forEach((c) => { |
|
|
|
obj[c._cn] = (columnStyling[c.uidt] && columnStyling[c.uidt].w) || undefined |
|
|
|
// obj[c._cn] = (columnStyling[c.uidt] && columnStyling[c.uidt].w) || undefined |
|
|
|
}) |
|
|
|
// }) |
|
|
|
this.meta && this.meta.v && this.meta.v.forEach((v) => { |
|
|
|
// this.meta && this.meta.v && this.meta.v.forEach((v) => { |
|
|
|
obj[v._cn] = v.bt ? '100px' : '200px' |
|
|
|
// obj[v._cn] = v.bt ? '100px' : '200px' |
|
|
|
}) |
|
|
|
// }) |
|
|
|
Array.from(this.$el.querySelectorAll('th')).forEach((el) => { |
|
|
|
// Array.from(this.$el.querySelectorAll('th')).forEach((el) => { |
|
|
|
const width = el.getBoundingClientRect().width |
|
|
|
// const width = el.getBoundingClientRect().width |
|
|
|
obj[el.dataset.col] = obj[el.dataset.col] || ((width < 100 ? 100 : width) + 'px') |
|
|
|
// obj[el.dataset.col] = obj[el.dataset.col] || ((width < 100 ? 100 : width) + 'px') |
|
|
|
}) |
|
|
|
// }) |
|
|
|
this.$emit('update:columnsWidth', { ...obj, ...(this.columnWidth || {}) }) |
|
|
|
// this.$emit('update:columnsWidth', { ...obj, ...(this.columnWidth || {}) }) |
|
|
|
}, 500) |
|
|
|
// }, 2000) |
|
|
|
}, |
|
|
|
}, |
|
|
|
isCentrallyAligned(col) { |
|
|
|
isCentrallyAligned(col) { |
|
|
|
return !['SingleLineText', |
|
|
|
return !['SingleLineText', |
|
|
@ -372,7 +363,9 @@ export default { |
|
|
|
'LastModifiedTime'].includes(col.uidt) |
|
|
|
'LastModifiedTime'].includes(col.uidt) |
|
|
|
}, |
|
|
|
}, |
|
|
|
async xcAuditModelCommentsCount() { |
|
|
|
async xcAuditModelCommentsCount() { |
|
|
|
if (this.isPublicView || !this.data || !this.data.length) { return } |
|
|
|
if (this.isPublicView || !this.data || !this.data.length) { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
const aggCount = await this.$store.dispatch('sqlMgr/ActSqlOp', [{ |
|
|
|
const aggCount = await this.$store.dispatch('sqlMgr/ActSqlOp', [{ |
|
|
|
dbAlias: this.nodes.dbAlias |
|
|
|
dbAlias: this.nodes.dbAlias |
|
|
|
}, 'xcAuditModelCommentsCount', { |
|
|
|
}, 'xcAuditModelCommentsCount', { |
|
|
@ -386,23 +379,33 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onKeyDown(e) { |
|
|
|
onKeyDown(e) { |
|
|
|
if (this.selected.col === null || this.selected.row === null) { return } |
|
|
|
if (this.selected.col === null || this.selected.row === null) { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
switch (e.keyCode) { |
|
|
|
switch (e.keyCode) { |
|
|
|
// left |
|
|
|
// left |
|
|
|
case 37: |
|
|
|
case 37: |
|
|
|
if (this.selected.col > 0) { this.selected.col-- } |
|
|
|
if (this.selected.col > 0) { |
|
|
|
|
|
|
|
this.selected.col-- |
|
|
|
|
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
// right |
|
|
|
// right |
|
|
|
case 39: |
|
|
|
case 39: |
|
|
|
if (this.selected.col < this.colLength - 1) { this.selected.col++ } |
|
|
|
if (this.selected.col < this.colLength - 1) { |
|
|
|
|
|
|
|
this.selected.col++ |
|
|
|
|
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
// up |
|
|
|
// up |
|
|
|
case 38: |
|
|
|
case 38: |
|
|
|
if (this.selected.row > 0) { this.selected.row-- } |
|
|
|
if (this.selected.row > 0) { |
|
|
|
|
|
|
|
this.selected.row-- |
|
|
|
|
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
// down |
|
|
|
// down |
|
|
|
case 40: |
|
|
|
case 40: |
|
|
|
if (this.selected.row < this.rowLength - 1) { this.selected.row++ } |
|
|
|
if (this.selected.row < this.rowLength - 1) { |
|
|
|
|
|
|
|
this.selected.row++ |
|
|
|
|
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
// enter |
|
|
|
// enter |
|
|
|
case 13: |
|
|
|
case 13: |
|
|
@ -424,7 +427,9 @@ export default { |
|
|
|
this.meta.columns && |
|
|
|
this.meta.columns && |
|
|
|
this.meta.columns[this.selected.col] && |
|
|
|
this.meta.columns[this.selected.col] && |
|
|
|
this.meta.columns[this.selected.col].virtual |
|
|
|
this.meta.columns[this.selected.col].virtual |
|
|
|
) { return } |
|
|
|
) { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
this.selected.col = null |
|
|
|
this.selected.col = null |
|
|
|
this.selected.row = null |
|
|
|
this.selected.row = null |
|
|
|
}, |
|
|
|
}, |
|
|
@ -452,7 +457,9 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
makeEditable(col, row) { |
|
|
|
makeEditable(col, row) { |
|
|
|
if (this.isPublicView || !this.isEditable) { return } |
|
|
|
if (this.isPublicView || !this.isEditable) { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
if (this.availableColumns[col].ai) { |
|
|
|
if (this.availableColumns[col].ai) { |
|
|
|
return this.$toast.info('Auto Increment field is not editable').goAway(3000) |
|
|
|
return this.$toast.info('Auto Increment field is not editable').goAway(3000) |
|
|
|
} |
|
|
|
} |
|
|
@ -777,8 +784,4 @@ th:first-child, td:first-child { |
|
|
|
transform: rotate(90deg); |
|
|
|
transform: rotate(90deg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
th { |
|
|
|
|
|
|
|
min-width: 100px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
</style> |
|
|
|