Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
zhaoxuebing 7 months ago
parent
commit
5fbda0ee76
  1. 21
      src/components/Table/src/Table.vue
  2. 20
      src/components/rowDrop/index.vue

21
src/components/Table/src/Table.vue

@ -247,6 +247,25 @@ export default defineComponent({
})
}
//
const updateSort= (val)=>{
val.forEach(item=>{
if(!item.sortDefault){
if(item.fixed=='left'){
item.sortDefault = 0
}else if(item.fixed=='right'){
item.sortDefault = 9999
}else{
item.sortDefault = 999 // 999
}
}
})
val.sort((column1,column2)=>{
return column1.sortDefault - column2.sortDefault
})
}
const rnderTableColumn = (columnsChildren?: TableColumn[]) => {
const {
columns,
@ -258,6 +277,8 @@ export default defineComponent({
showOverflowTooltip,
border
} = unref(getProps)
//
updateSort(columns)
return [...[renderTableExpand()], ...[renderTableSelection()]].concat(
(columnsChildren || columns).map((v) => {
//

20
src/components/rowDrop/index.vue

@ -84,11 +84,13 @@ const save = () => {
saveDate.push(props.allSchemas.tableColumns[0])
allData.value.forEach((item) => {
const _item:any = props.allSchemas.tableColumns.find(itemColumns => (itemColumns.label == item ))
if(_item){
_item.isTable = false
if (checkedDataList.value.indexOf(_item.label) > -1) {
_item.isTable = true
saveDate.push(_item)
}
}
})
//
saveDate.push(props.allSchemas.tableColumns[props.allSchemas.tableColumns.length-1])
@ -130,6 +132,7 @@ const initSelectSta = () => {
if(props.detailAllSchemas){
_myTableColumns = [...props.allSchemas?.tableColumns,...props.detailAllSchemas?.tableMainColumns]
}
updateSort(_myTableColumns)
//
if (res) {
checkedDataList.value = []
@ -197,7 +200,22 @@ const initSelectSta = () => {
console.log(err)
})
}
const updateSort= (val)=>{
val.forEach(item=>{
if(!item.sortDefault){
if(item.fixed=='left'){
item.sortDefault = 0
}else if(item.fixed=='right'){
item.sortDefault = 9999
}else{
item.sortDefault = 999 // 999
}
}
})
val.sort((column1,column2)=>{
return column1.sortDefault - column2.sortDefault
})
}
//
const updataTableColumns = (val) => {
emit('updataTableColumns', val)

Loading…
Cancel
Save