|
|
@ -12,11 +12,13 @@ |
|
|
|
@sort-change="tableSortChange" |
|
|
|
@row-click="handleTableSelect" |
|
|
|
> |
|
|
|
<!-- 删除按钮多选 --> |
|
|
|
<el-table-column fixed="left" type="selection" width="50" v-if="isShowReduceButtonSelection" /> |
|
|
|
<!-- 删除按钮 --> |
|
|
|
<el-table-column |
|
|
|
fixed="left" |
|
|
|
:width="50" |
|
|
|
v-if="isShowReduceButton" |
|
|
|
v-else-if="isShowReduceButton" |
|
|
|
v-slot="{ row, $index }" |
|
|
|
> |
|
|
|
<Icon icon="ep:remove" color="#757575" :size="26" style="cursor: pointer;margin-top: -16px;" @click="handleDeleteTable (row, $index)" /> |
|
|
@ -299,18 +301,34 @@ |
|
|
|
<!-- </el-form-item> --> |
|
|
|
</el-form> |
|
|
|
</el-table-column> |
|
|
|
<!-- 删除按钮 --> |
|
|
|
<el-table-column |
|
|
|
fixed="right" |
|
|
|
:label="t('ts.操作')" |
|
|
|
align="center" |
|
|
|
:width="60" |
|
|
|
v-if="isShowReduceButtonSelection" |
|
|
|
v-slot="{ row, $index }" |
|
|
|
> |
|
|
|
<ButtonBase :Butttondata="[defaultButtons.mainListDeleteBtn(),]" @button-base-click="handleDeleteTable (row, $index)" /> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<div class="button flex" v-if="isShowButton"> |
|
|
|
<div class="p-12px" @click="handleAddTable"> |
|
|
|
<div class="button flex" v-if="isShowButton||isShowReduceButtonSelection"> |
|
|
|
<div class="p-12px" v-if="isShowButton" @click="handleAddTable"> |
|
|
|
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer;" /> |
|
|
|
<div>{{t('ts.添加明细')}}</div> |
|
|
|
</div> |
|
|
|
<div class="p-12px" v-if="isShowReduceButtonSelection" @click="handleSelectionDelete"> |
|
|
|
<Icon icon="ep:delete" color="#409eff" size="26" style="cursor: pointer;" /> |
|
|
|
<div>{{t('ts.批量删除')}}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict' |
|
|
|
const props = defineProps({ |
|
|
|
// 是否显示添加按钮 |
|
|
@ -328,6 +346,11 @@ const props = defineProps({ |
|
|
|
type: Boolean, |
|
|
|
default: false, |
|
|
|
}, |
|
|
|
// 是否显示删除按钮--多选 |
|
|
|
isShowReduceButtonSelection:{ |
|
|
|
type: Boolean, |
|
|
|
default: false, |
|
|
|
}, |
|
|
|
// 是否显示删除按钮 |
|
|
|
isShowReduceButton:{ |
|
|
|
type: Boolean, |
|
|
@ -379,6 +402,7 @@ const props = defineProps({ |
|
|
|
// 传递给父类 |
|
|
|
const emit = defineEmits([ |
|
|
|
'tableSelectionChange', |
|
|
|
'tableSelectionDelete', |
|
|
|
'extendedButtonsClick', |
|
|
|
'formSelectChange', |
|
|
|
'tableSortChange', |
|
|
@ -413,10 +437,21 @@ const inputNumberChange = (field, index, row, e) => { |
|
|
|
emit('inputNumberChange', field, index, row, e) |
|
|
|
} |
|
|
|
|
|
|
|
// 勾选的删除数据 |
|
|
|
const deleteTableData = ref([]) |
|
|
|
|
|
|
|
// 点击selection框 |
|
|
|
const tableSelectionChange = (val) => { |
|
|
|
if(props.isShowReduceButtonSelection){ |
|
|
|
//勾选删除 |
|
|
|
deleteTableData.value = val |
|
|
|
}else{ |
|
|
|
emit('tableSelectionChange', val) |
|
|
|
} |
|
|
|
} |
|
|
|
const handleSelectionDelete = ()=>{ |
|
|
|
emit('tableSelectionDelete', deleteTableData.value) |
|
|
|
} |
|
|
|
// 列表排序 |
|
|
|
const tableSortChange = (column, prop, order) => { |
|
|
|
emit('tableSortChange', column, prop, order) |
|
|
|