Merge branch 'master' into feature/bfi-api-rate
# Conflicts: # src/components/vehicle-attachment-table/main.vue # src/option/payment/paymentApplication.js # src/views/payment/payment-application.vue # src/views/payment/receipt-claim-record.vue # src/views/vehicle/customer-archive.vue
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
<el-option
|
||||
v-for="item in contracts"
|
||||
:key="item.id"
|
||||
:label="`${item.contractNo} / ${item.contractName}`"
|
||||
:label="formatContractOptionLabel(item)"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -176,6 +176,17 @@
|
||||
<section-card title="结算明细">
|
||||
<template #extra>
|
||||
<div class="formal-editor__actions">
|
||||
<el-button
|
||||
v-if="hasPermission('formal_settlement_export')"
|
||||
type="primary"
|
||||
plain
|
||||
@click="exportDetails"
|
||||
>
|
||||
导出
|
||||
</el-button>
|
||||
<el-button v-if="editable" type="primary" plain @click="openDetailDialog">
|
||||
选择结算明细
|
||||
</el-button>
|
||||
<el-button type="primary" text @click="detailCollapsed = !detailCollapsed">
|
||||
{{ detailCollapsed ? '展开明细' : '收起明细' }}
|
||||
</el-button>
|
||||
@@ -183,33 +194,46 @@
|
||||
</template>
|
||||
<el-form
|
||||
:model="detailQuery"
|
||||
inline
|
||||
label-position="right"
|
||||
label-width="88px"
|
||||
label-width="auto"
|
||||
class="formal-editor__detail-filter"
|
||||
@submit.prevent
|
||||
>
|
||||
<el-form-item label="单据号">
|
||||
<el-input v-model="detailQuery.documentNo" clearable @keyup.enter="handleDetailQuery" />
|
||||
<el-input
|
||||
v-model="detailQuery.documentNo"
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
@keyup.enter="handleDetailQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="运单号">
|
||||
<el-input v-model="detailQuery.waybillNo" clearable @keyup.enter="handleDetailQuery" />
|
||||
<el-input
|
||||
v-model="detailQuery.waybillNo"
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
@keyup.enter="handleDetailQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="detailQuery.batchNo" clearable @keyup.enter="handleDetailQuery" />
|
||||
<el-input
|
||||
v-model="detailQuery.batchNo"
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
@keyup.enter="handleDetailQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货物名称">
|
||||
<el-input v-model="detailQuery.cargoName" clearable @keyup.enter="handleDetailQuery" />
|
||||
<el-input
|
||||
v-model="detailQuery.cargoName"
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
@keyup.enter="handleDetailQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item class="formal-editor__detail-filter-actions">
|
||||
<el-button type="primary" @click="handleDetailQuery">查询</el-button>
|
||||
<el-button @click="resetDetailQuery">重置</el-button>
|
||||
<el-button type="primary" :disabled="!details.length" @click="exportDetails">
|
||||
导出
|
||||
</el-button>
|
||||
<el-button v-if="editable" type="primary" @click="openDetailDialog">
|
||||
选择结算明细
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-show="!detailCollapsed" :data="pagedDetails" border>
|
||||
@@ -299,15 +323,23 @@
|
||||
<span v-else>{{ attachmentTypeName(row.type) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="文件名" min-width="220" align="left" show-overflow-tooltip>
|
||||
<el-table-column
|
||||
label="文件名"
|
||||
min-width="220"
|
||||
align="left"
|
||||
show-overflow-tooltip
|
||||
class-name="is-ellipsis-link"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
:disabled="!getAttachmentUrl(row)"
|
||||
type="primary"
|
||||
@click="previewAttachment(row)"
|
||||
>
|
||||
{{ row.originalName || row.name || '-' }}
|
||||
</el-link>
|
||||
<span
|
||||
class="attachment-file-name"
|
||||
:class="{ 'is-disabled': !getAttachmentUrl(row) }"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="getAttachmentUrl(row) && previewAttachment(row)"
|
||||
@keydown.enter="getAttachmentUrl(row) && previewAttachment(row)"
|
||||
@keydown.space.prevent="getAttachmentUrl(row) && previewAttachment(row)"
|
||||
>{{ row.originalName || row.name || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="uploadUserName" label="上传人" min-width="120" align="center">
|
||||
@@ -610,9 +642,10 @@
|
||||
</section-card>
|
||||
</div>
|
||||
<template v-if="!pageMode" #footer>
|
||||
<el-button v-if="editable" @click="handleSyncPlaceholder">同步</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button
|
||||
v-if="editable && !recordId"
|
||||
v-if="editable"
|
||||
type="primary"
|
||||
plain
|
||||
:loading="draftSaving"
|
||||
@@ -625,9 +658,10 @@
|
||||
>
|
||||
</template>
|
||||
<div v-if="pageMode && !publicMode" class="formal-editor__page-actions">
|
||||
<el-button v-if="editable" @click="handleSyncPlaceholder">同步</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button
|
||||
v-if="editable && !recordId"
|
||||
v-if="editable"
|
||||
type="primary"
|
||||
plain
|
||||
:loading="draftSaving"
|
||||
@@ -966,6 +1000,7 @@ import { getDictionary } from '@/api/system/dictbiz';
|
||||
import { h } from 'vue';
|
||||
import { InfoFilled } from '@element-plus/icons-vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { formatContractOptionLabel } from '@/utils/contract';
|
||||
import { downloadFileByUrl } from '@/utils/util';
|
||||
import {
|
||||
downloadKingdeeInvoiceFile,
|
||||
@@ -974,6 +1009,7 @@ import {
|
||||
} from '@/utils/kingdee-attachment';
|
||||
import KingdeeInvoicePoolDialog from '@/components/kingdee-invoice-pool-dialog/main.vue';
|
||||
import * as XLSX from 'xlsx';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'FormalSettlementEditor',
|
||||
@@ -1110,7 +1146,7 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo']),
|
||||
...mapGetters(['permission', 'userInfo']),
|
||||
visible: {
|
||||
get() {
|
||||
return this.modelValue;
|
||||
@@ -1138,6 +1174,9 @@ export default {
|
||||
editable() {
|
||||
return !this.readonly;
|
||||
},
|
||||
isAdmin() {
|
||||
return isAdministrator(this.userInfo);
|
||||
},
|
||||
title() {
|
||||
return this.readonly ? '查看正式结算单' : this.recordId ? '编辑正式结算单' : '新增正式结算单';
|
||||
},
|
||||
@@ -1203,6 +1242,10 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
formatContractOptionLabel,
|
||||
hasPermission(code) {
|
||||
return this.isAdmin || this.validData(this.permission?.[code], false);
|
||||
},
|
||||
async loadFormalDetail(id) {
|
||||
const response = this.publicMode
|
||||
? await getMkPublicDetail('formal-settlement', id)
|
||||
@@ -2506,7 +2549,11 @@ export default {
|
||||
remark: this.form.remark,
|
||||
};
|
||||
},
|
||||
handleSyncPlaceholder() {
|
||||
this.$message.info('开发中');
|
||||
},
|
||||
async handleDraftSave() {
|
||||
// 保存草稿:不做表单校验,直接落草稿并返回列表刷新
|
||||
this.draftSaving = true;
|
||||
try {
|
||||
await save({
|
||||
@@ -2514,8 +2561,8 @@ export default {
|
||||
approvalStatus: 'draft',
|
||||
});
|
||||
this.$message.success('保存成功');
|
||||
this.visible = false;
|
||||
this.$emit('success');
|
||||
this.visible = false;
|
||||
} finally {
|
||||
this.draftSaving = false;
|
||||
}
|
||||
@@ -2819,20 +2866,24 @@ export default {
|
||||
}
|
||||
.formal-editor__actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.formal-editor__detail-filter {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
|
||||
align-items: center;
|
||||
gap: 8px 16px;
|
||||
margin-bottom: 8px;
|
||||
margin-bottom: 12px;
|
||||
padding: 12px 12px 4px;
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
.formal-editor__detail-filter-actions {
|
||||
grid-column: 1 / -1;
|
||||
width: auto;
|
||||
margin-left: 0;
|
||||
white-space: nowrap;
|
||||
justify-self: end;
|
||||
}
|
||||
.formal-editor__page-actions {
|
||||
@@ -2862,7 +2913,7 @@ export default {
|
||||
gap: 8px;
|
||||
}
|
||||
.formal-editor :deep(.el-form-item) {
|
||||
margin-bottom: 14px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.formal-editor :deep(.el-form-item__content) {
|
||||
line-height: normal;
|
||||
@@ -2963,9 +3014,29 @@ export default {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
/* 结算明细筛选区:覆盖全局 el-form-item 24px 行距,保证筛选控件与「查询/重置」同行居中对齐 */
|
||||
.formal-editor__detail-filter :deep(.el-form-item) {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
margin-right: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.formal-editor__detail-filter :deep(.el-form-item__content) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.formal-editor__detail-filter :deep(.el-input) {
|
||||
width: 100%;
|
||||
}
|
||||
.formal-editor__detail-filter-actions :deep(.el-form-item__content) {
|
||||
flex: none;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.formal-editor__detail-filter {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -40,16 +40,20 @@
|
||||
>导出</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="fs-table-panel__toolbar-right">
|
||||
<el-tooltip content="刷新" placement="top">
|
||||
<el-button :icon="Refresh" text @click="$emit('refresh')" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<settlement-table-tools
|
||||
:columns="columnSettingOptions"
|
||||
v-model:visible-column-keys="visibleColumnKeys"
|
||||
v-model:table-size="tableSize"
|
||||
:search-visible="searchVisible"
|
||||
@update:search-visible="$emit('update:searchVisible', $event)"
|
||||
@refresh="$emit('refresh')"
|
||||
/>
|
||||
</div>
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
v-loading="loading"
|
||||
:data="rows"
|
||||
:size="tableSize"
|
||||
border
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
@@ -58,7 +62,7 @@
|
||||
<el-table-column type="index" label="序号" width="64" fixed="left" align="center" />
|
||||
<el-table-column type="selection" width="52" fixed="left" align="center" />
|
||||
<el-table-column
|
||||
v-for="column in columns"
|
||||
v-for="column in visibleColumns"
|
||||
:key="column.prop"
|
||||
v-bind="column"
|
||||
align="center"
|
||||
@@ -126,15 +130,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Refresh } from '@element-plus/icons-vue';
|
||||
import {
|
||||
invoiceStatusName,
|
||||
kingdeeSyncStatusOptions,
|
||||
paymentStatusOptions,
|
||||
} from '@/option/settlement/formalSettlementSearch';
|
||||
import SettlementTableTools from './settlement-table-tools.vue';
|
||||
|
||||
export default {
|
||||
name: 'FormalSettlementTablePanel',
|
||||
components: { SettlementTableTools },
|
||||
props: {
|
||||
rows: { type: Array, default: () => [] },
|
||||
columns: { type: Array, default: () => [] },
|
||||
@@ -143,6 +148,7 @@ export default {
|
||||
page: { type: Object, required: true },
|
||||
hasPermission: { type: Function, required: true },
|
||||
mkEnabled: { type: Boolean, default: false },
|
||||
searchVisible: { type: Boolean, default: true },
|
||||
},
|
||||
emits: [
|
||||
'create',
|
||||
@@ -154,14 +160,47 @@ export default {
|
||||
'page-change',
|
||||
'action',
|
||||
'update:selection',
|
||||
'update:searchVisible',
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
Refresh,
|
||||
selection: [],
|
||||
tableSize: 'default',
|
||||
visibleColumnKeys: [],
|
||||
knownColumnProps: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
columnSettingOptions() {
|
||||
return this.columns.map(column => ({
|
||||
prop: column.prop,
|
||||
label: column.label,
|
||||
}));
|
||||
},
|
||||
visibleColumns() {
|
||||
if (!this.visibleColumnKeys.length) return this.columns;
|
||||
return this.columns.filter(column => this.visibleColumnKeys.includes(column.prop));
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
columns: {
|
||||
immediate: true,
|
||||
handler(columns) {
|
||||
const props = columns.map(column => column.prop);
|
||||
if (!this.visibleColumnKeys.length) {
|
||||
this.visibleColumnKeys = props;
|
||||
this.knownColumnProps = props;
|
||||
return;
|
||||
}
|
||||
const visible = new Set(this.visibleColumnKeys);
|
||||
const known = new Set(this.knownColumnProps || []);
|
||||
props.forEach(prop => {
|
||||
if (!known.has(prop)) visible.add(prop);
|
||||
});
|
||||
this.knownColumnProps = props;
|
||||
this.visibleColumnKeys = props.filter(prop => visible.has(prop));
|
||||
},
|
||||
},
|
||||
rows() {
|
||||
this.selection = [];
|
||||
this.$refs.tableRef?.clearSelection();
|
||||
@@ -202,7 +241,11 @@ export default {
|
||||
actions.push({ type: 'delete', label: '删除', danger: true });
|
||||
if (this.hasPermission('formal_settlement_submit') && this.isEditable(row))
|
||||
actions.push({ type: 'submit', label: '提交' });
|
||||
if (this.mkEnabled && this.hasPermission('formal_settlement_approve') && row.approvalStatus === 'reviewing') {
|
||||
if (
|
||||
this.mkEnabled &&
|
||||
this.hasPermission('formal_settlement_approve') &&
|
||||
['reviewing', 'approved'].includes(row.approvalStatus)
|
||||
) {
|
||||
actions.push({ type: 'mkAudit', label: '流程' });
|
||||
}
|
||||
if (!this.mkEnabled && this.hasPermission('formal_settlement_approve') && row.approvalStatus === 'reviewing') {
|
||||
@@ -271,11 +314,6 @@ export default {
|
||||
align-items: center;
|
||||
padding: 12px 0;
|
||||
}
|
||||
.fs-table-panel__toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.fs-table-panel__links {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<el-form-item :label="field.label" :prop="field.prop">
|
||||
<el-input
|
||||
v-if="field.type === 'contract'"
|
||||
v-model="form.contractName"
|
||||
:model-value="formatContractOptionLabel(form)"
|
||||
readonly
|
||||
:disabled="!editable || details.length > 0"
|
||||
placeholder="请选择合同"
|
||||
@@ -354,11 +354,21 @@
|
||||
<span v-else>{{ attachmentTypeName(row.type) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="文件名称" min-width="260" show-overflow-tooltip>
|
||||
<el-table-column
|
||||
label="文件名称"
|
||||
min-width="260"
|
||||
show-overflow-tooltip
|
||||
class-name="is-ellipsis-link"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" @click="previewAttachment(row)">
|
||||
{{ attachmentName(row) }}
|
||||
</el-link>
|
||||
<span
|
||||
class="attachment-file-name"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="previewAttachment(row)"
|
||||
@keydown.enter="previewAttachment(row)"
|
||||
@keydown.space.prevent="previewAttachment(row)"
|
||||
>{{ attachmentName(row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="附件描述" min-width="220">
|
||||
@@ -963,6 +973,7 @@ import {
|
||||
settlementDetailColumns,
|
||||
settlementSummaryColumns,
|
||||
} from '@/option/settlement/preSettlementTable';
|
||||
import { formatContractOptionLabel } from '@/utils/contract';
|
||||
import { downloadFileByUrl } from '@/utils/util';
|
||||
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import * as XLSX from 'xlsx';
|
||||
@@ -1266,6 +1277,7 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
formatContractOptionLabel,
|
||||
hasPermission(code) {
|
||||
return this.isAdmin || this.validData(this.permission?.[code], false);
|
||||
},
|
||||
@@ -3003,7 +3015,7 @@ export default {
|
||||
}
|
||||
|
||||
:deep(.pre-settlement-editor .el-form-item) {
|
||||
margin-bottom: 14px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
:deep(.pre-settlement-editor .el-table),
|
||||
|
||||
@@ -193,11 +193,21 @@
|
||||
<el-table :data="attachments" border @selection-change="selectedAttachments = $event">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" label="序号" width="64" align="center" />
|
||||
<el-table-column label="文件名" min-width="220" show-overflow-tooltip>
|
||||
<el-table-column
|
||||
label="文件名"
|
||||
min-width="220"
|
||||
show-overflow-tooltip
|
||||
class-name="is-ellipsis-link"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" @click="previewAttachment(row)">
|
||||
{{ attachmentName(row) }}
|
||||
</el-link>
|
||||
<span
|
||||
class="attachment-file-name"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="previewAttachment(row)"
|
||||
@keydown.enter="previewAttachment(row)"
|
||||
@keydown.space.prevent="previewAttachment(row)"
|
||||
>{{ attachmentName(row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="附件描述" min-width="240">
|
||||
@@ -638,7 +648,7 @@ export default {
|
||||
gap: 8px;
|
||||
}
|
||||
.settlement-adjustment-editor :deep(.el-form-item) {
|
||||
margin-bottom: 14px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.settlement-adjustment-editor :deep(.el-table) {
|
||||
--el-table-border-color: #eff1f7;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<table-header-tools v-bind="$attrs" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHeaderTools from '@/components/table-header-tools/main.vue';
|
||||
|
||||
export default {
|
||||
name: 'SettlementTableTools',
|
||||
components: { TableHeaderTools },
|
||||
inheritAttrs: false,
|
||||
};
|
||||
</script>
|
||||
@@ -2072,7 +2072,7 @@ export default {
|
||||
display: none;
|
||||
}
|
||||
.reconciliation-editor :deep(.el-form-item) {
|
||||
margin-bottom: 14px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.reconciliation-editor :deep(.el-table) {
|
||||
--el-table-border-color: #eff1f7;
|
||||
|
||||
@@ -10,22 +10,26 @@
|
||||
>
|
||||
<el-button type="primary" plain @click="$emit('export')">导出</el-button>
|
||||
</div>
|
||||
<div class="tr-table-panel__toolbar-right">
|
||||
<el-tooltip content="刷新" placement="top">
|
||||
<el-button :icon="Refresh" text @click="$emit('refresh')" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<settlement-table-tools
|
||||
:columns="columnSettingOptions"
|
||||
v-model:visible-column-keys="visibleColumnKeys"
|
||||
v-model:table-size="tableSize"
|
||||
:search-visible="searchVisible"
|
||||
@update:search-visible="$emit('update:searchVisible', $event)"
|
||||
@refresh="$emit('refresh')"
|
||||
/>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="rows"
|
||||
:size="tableSize"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="52" fixed="left" align="center" />
|
||||
<el-table-column type="index" label="序号" width="64" fixed="left" align="center" />
|
||||
<el-table-column
|
||||
v-for="column in columns"
|
||||
v-for="column in visibleColumns"
|
||||
:key="column.prop"
|
||||
v-bind="column"
|
||||
align="center"
|
||||
@@ -73,24 +77,68 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Refresh } from '@element-plus/icons-vue';
|
||||
import SettlementTableTools from './settlement-table-tools.vue';
|
||||
|
||||
export default {
|
||||
name: 'TransportReconciliationTablePanel',
|
||||
components: { SettlementTableTools },
|
||||
props: {
|
||||
rows: { type: Array, default: () => [] },
|
||||
columns: { type: Array, default: () => [] },
|
||||
loading: { type: Boolean, default: false },
|
||||
page: { type: Object, required: true },
|
||||
hasPermission: { type: Function, required: true },
|
||||
searchVisible: { type: Boolean, default: true },
|
||||
},
|
||||
emits: ['create', 'export', 'refresh', 'page-change', 'update:selection', 'action'],
|
||||
emits: [
|
||||
'create',
|
||||
'export',
|
||||
'refresh',
|
||||
'page-change',
|
||||
'update:selection',
|
||||
'action',
|
||||
'update:searchVisible',
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
Refresh,
|
||||
selection: [],
|
||||
tableSize: 'default',
|
||||
visibleColumnKeys: [],
|
||||
knownColumnProps: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
columnSettingOptions() {
|
||||
return this.columns.map(column => ({
|
||||
prop: column.prop,
|
||||
label: column.label,
|
||||
}));
|
||||
},
|
||||
visibleColumns() {
|
||||
if (!this.visibleColumnKeys.length) return this.columns;
|
||||
return this.columns.filter(column => this.visibleColumnKeys.includes(column.prop));
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
columns: {
|
||||
immediate: true,
|
||||
handler(columns) {
|
||||
const props = columns.map(column => column.prop);
|
||||
if (!this.visibleColumnKeys.length) {
|
||||
this.visibleColumnKeys = props;
|
||||
this.knownColumnProps = props;
|
||||
return;
|
||||
}
|
||||
const visible = new Set(this.visibleColumnKeys);
|
||||
const known = new Set(this.knownColumnProps || []);
|
||||
props.forEach(prop => {
|
||||
if (!known.has(prop)) visible.add(prop);
|
||||
});
|
||||
this.knownColumnProps = props;
|
||||
this.visibleColumnKeys = props.filter(prop => visible.has(prop));
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(value) {
|
||||
this.selection = value;
|
||||
@@ -127,11 +175,6 @@ export default {
|
||||
align-items: center;
|
||||
padding: 12px 0;
|
||||
}
|
||||
.tr-table-panel__toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.tr-table-panel__links {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
Reference in New Issue
Block a user