|
@@ -67,6 +67,67 @@ watch(
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+const tableOriginColumnsField = ref()
|
|
|
|
|
+// 获取表格列
|
|
|
|
|
+const getTableColumns = async () => {
|
|
|
|
|
+ await $api.getOperationTableColumns().then((res: any) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ tableData.value.columns = [
|
|
|
|
|
+ { type: 'checkbox', width: 50, fixed: 'left' },
|
|
|
|
|
+ ...handleColumns(res.data.OperationTableColumns),
|
|
|
|
|
+ {}
|
|
|
|
|
+ ]
|
|
|
|
|
+ const index = tableData.value.columns.findIndex((item: any) => item.title === 'Action')
|
|
|
|
|
+ if (index !== -1) {
|
|
|
|
|
+ tableData.value.columns.push({
|
|
|
|
|
+ title: 'Action',
|
|
|
|
|
+ fixed: 'right',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ slots: { default: 'action' }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ tableOriginColumnsField.value = res.data.OperationTableColumns
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+let searchdata: any = {}
|
|
|
|
|
+// 获得表格数据后赋值
|
|
|
|
|
+const assignTableData = (data: any) => {
|
|
|
|
|
+ tableData.value.data = data.searchData || []
|
|
|
|
|
+
|
|
|
|
|
+ if (tableData.value.columns.length > 0) {
|
|
|
|
|
+ const index = tableData.value.columns.findIndex((item: any) => item.title === 'Action')
|
|
|
|
|
+ if (index === -1) {
|
|
|
|
|
+ tableData.value.columns.push({
|
|
|
|
|
+ title: 'Action',
|
|
|
|
|
+ fixed: 'right',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ slots: { default: 'action' }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 获取表格数据
|
|
|
|
|
+const getTableData = async () => {
|
|
|
|
|
+ const rc = -1
|
|
|
|
|
+ await $api
|
|
|
|
|
+ .SearchOperationLog({
|
|
|
|
|
+ cp: 1,
|
|
|
|
|
+ ps: 6,
|
|
|
|
|
+ rc,
|
|
|
|
|
+ ...searchdata
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res: any) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ assignTableData(res.data)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ Promise.all([getTableColumns(), getTableData()]).finally(() => {})
|
|
|
|
|
+})
|
|
|
// 实现行点击样式
|
|
// 实现行点击样式
|
|
|
useRowClickStyle(tableRef)
|
|
useRowClickStyle(tableRef)
|
|
|
</script>
|
|
</script>
|
|
@@ -74,7 +135,7 @@ useRowClickStyle(tableRef)
|
|
|
<template>
|
|
<template>
|
|
|
<div class="shipment-infor-table">
|
|
<div class="shipment-infor-table">
|
|
|
<div class="label">Shipment Information</div>
|
|
<div class="label">Shipment Information</div>
|
|
|
- <vxe-grid ref="tableRef" v-bind="tableData">
|
|
|
|
|
|
|
+ <vxe-grid ref="tableRef" v-bind="tableData" height="240">
|
|
|
<template #empty>
|
|
<template #empty>
|
|
|
<div class="empty">No data</div>
|
|
<div class="empty">No data</div>
|
|
|
</template>
|
|
</template>
|