Commit 8ad7dc9f by wusiyi

chore: 升级 element-plus 至2.14版本

parent f2eff035
......@@ -15,6 +15,8 @@ declare module 'vue' {
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCascaderPanel: typeof import('element-plus/es')['ElCascaderPanel']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
......
......@@ -18,7 +18,7 @@
"bignumber.js": "^9.3.0",
"dayjs": "^1.11.13",
"echarts": "^6.0.0",
"element-plus": "^2.6.0",
"element-plus": "^2.14.3",
"lodash-es": "^4.17.21",
"luxon": "^3.7.1",
"pinia": "^2.1.7",
......
......@@ -126,11 +126,11 @@ const attrs = useAttrs()
const slots = useSlots() as Record<string, Slot>
const setCurrentRow = (row: T) => {
tableRef.value?.setCurrentRow(row)
tableRef.value?.setCurrentRow(row as Record<PropertyKey, any>)
}
const toggleRowSelection = (row: T, selected: boolean = true) => {
tableRef.value?.toggleRowSelection(row, selected)
tableRef.value?.toggleRowSelection(row as Record<PropertyKey, any>, selected)
}
const clearSelection = () => {
......@@ -139,11 +139,11 @@ const clearSelection = () => {
const toggleAllSelection = () => {
tableRef.value?.toggleAllSelection()
}
const rowClick = (row:NonNullable<unknown>)=>{
const rowClick = (row: NonNullable<unknown>) => {
console.log(row)
console.log(tableRef.value,props.rowClickSelect)
if(props.rowClickSelect){
tableRef.value?.toggleRowSelection(row,true)
console.log(tableRef.value, props.rowClickSelect)
if (props.rowClickSelect) {
tableRef.value?.toggleRowSelection(row as Record<PropertyKey, any>, true)
}
}
const handleTableHeaderClick = (column: { type?: string }, event: Event) => {
......@@ -170,7 +170,10 @@ const selectAllRows = (select: boolean, setInternalIsMore?: boolean) => {
nextTick(() => {
if (tableRef.value && props.paginatedData.length > 0) {
props.paginatedData.forEach((row) => {
tableRef.value?.toggleRowSelection(row, select)
tableRef.value?.toggleRowSelection(
row as Record<PropertyKey, any>,
select,
)
})
}
......
......@@ -516,9 +516,14 @@
</template>
<script setup lang="ts">
import { ElMessage, ElRadioGroup, ElTree, TableColumnCtx } from 'element-plus'
import {
ElMessage,
ElRadioGroup,
ElTree,
TableColumnCtx,
type TableInstance,
} from 'element-plus'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { ElTable } from 'element-plus'
import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue'
import {
......@@ -554,7 +559,9 @@ interface Tree {
code?: string
children?: Tree[]
}
interface SummaryMethodProps<T = AccountStatementNote> {
interface SummaryMethodProps<
T extends Record<PropertyKey, any> = AccountStatementNote,
> {
columns: TableColumnCtx<T>[]
data: T[]
}
......@@ -568,7 +575,7 @@ const dateRange = ref<string[]>([])
const selections = ref<AccountStatementNote[]>([])
const detailList = ref<ItemList[]>([])
const tabsValue = ref<string>('0')
const singleTableRef = ref<InstanceType<typeof ElTable>>()
const singleTableRef = ref<TableInstance>()
const currentRow = ref<AccountStatementNote | null>(null)
const logList = ref<LogList[]>([])
......@@ -583,7 +590,7 @@ const {
refresh: search,
onCurrentPageChange: handleCurrentChange,
onPageSizeChange: handleSizeChange,
} = usePageList({
} = usePageList<AccountStatementNote>({
query: (page, pageSize) =>
customJomallReconciliation(
{
......@@ -623,7 +630,7 @@ const getTreeNum = async () => {
console.error(e)
}
}
const rowClick = (row: AccountStatementNote) => {
const rowClick = (row: AccountStatementNote | null) => {
if (!row) {
currentRow.value = null
}
......@@ -789,7 +796,7 @@ const submitConfirmOrder = async () => {
search()
await getTreeNum()
if (singleTableRef.value) {
singleTableRef.value!.setCurrentRow(currentRow.value)
singleTableRef.value!.setCurrentRow(currentRow.value ?? undefined)
}
}
watch(
......
......@@ -901,7 +901,7 @@
</template>
<script setup lang="ts">
import { ElMessage, ElTable, ElTree, TableColumnCtx } from 'element-plus'
import { ElMessage, ElTree, TableColumnCtx, type TableInstance } from 'element-plus'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { CircleClose, Plus } from '@element-plus/icons-vue'
// import pendingReconciliation from './pendingReconciliation.vue'
......@@ -945,7 +945,9 @@ interface Tree {
children?: Tree[]
}
interface SummaryMethodProps<T = AccountStatementNote> {
interface SummaryMethodProps<
T extends Record<PropertyKey, any> = AccountStatementNote,
> {
columns: TableColumnCtx<T>[]
data: T[]
}
......@@ -973,7 +975,7 @@ const selections = ref<AccountStatementNote[]>([])
const detailSelections = ref<ItemList[]>([])
const detailList = ref<ItemList[]>([])
const tabsValue = ref<string>('0')
const singleTableRef = ref<InstanceType<typeof ElTable>>()
const singleTableRef = ref<TableInstance>()
const currentRow = ref<AccountStatementNote | null>(null)
const paymentDialogVisible = ref(false)
......@@ -1008,7 +1010,7 @@ const {
refresh: search,
onCurrentPageChange: handleCurrentChange,
onPageSizeChange: handleSizeChange,
} = usePageList({
} = usePageList<AccountStatementNote>({
query: (page, pageSize) =>
podReconciliationList(
{
......@@ -1152,7 +1154,7 @@ const getTreeNum = async () => {
console.error(e)
}
}
const rowClick = (row: AccountStatementNote) => {
const rowClick = (row: AccountStatementNote | null) => {
if (!row) {
currentRow.value = null
}
......@@ -1362,7 +1364,7 @@ const submitConfirmOrder = async (type: number) => {
search()
await getTreeNum()
if (singleTableRef.value) {
singleTableRef.value!.setCurrentRow(currentRow.value)
singleTableRef.value!.setCurrentRow(currentRow.value ?? undefined)
}
}
watch(
......
......@@ -34,7 +34,7 @@ const {
refresh: search,
onCurrentPageChange: handleCurrentChange,
onPageSizeChange: handleSizeChange,
} = usePageList({
} = usePageList<AccountStatementNote>({
query: (page, pageSize) =>
getPodShipmentDetailsById(
{
......
<script setup lang="ts">
import { ElMessage, ElTable } from 'element-plus'
import { ElMessage } from 'element-plus'
import type { PropType } from 'vue'
import { ProductDetails } from '@/types/api/billOrder.ts'
const selection = ref<ProductDetails[]>([])
defineProps({
list: {
type: Array,
type: Array as PropType<ProductDetails[]>,
default: () => [],
},
})
const handleDetailSelectionChange = (arr:ProductDetails[]) => {
const handleDetailSelectionChange = (arr: ProductDetails[]) => {
selection.value = arr
}
......
......@@ -1040,7 +1040,7 @@
<script setup lang="ts">
import DetailView from './detail.vue'
import EditOrder from './editOrder.vue'
import { ElMessage, ElTable, ElTree, TableColumnCtx } from 'element-plus'
import { ElMessage, ElTree, TableColumnCtx, type TableInstance } from 'element-plus'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue'
......@@ -1084,7 +1084,9 @@ interface Tree {
children?: Tree[]
}
interface SummaryMethodProps<T = AccountStatementNote> {
interface SummaryMethodProps<
T extends Record<PropertyKey, any> = AccountStatementNote,
> {
columns: TableColumnCtx<T>[]
data: T[]
}
......@@ -1105,7 +1107,7 @@ const orderSelections = ref<OrderDetails[]>([])
const detailList = ref<ProductDetails[]>([])
const orderList = ref<OrderDetails[]>([])
const tabsValue = ref<string>('0')
const singleTableRef = ref<InstanceType<typeof ElTable>>()
const singleTableRef = ref<TableInstance>()
const currentRow = ref<AccountStatementNote | null>(null)
const batchSave = async () => {
......@@ -1182,7 +1184,7 @@ const {
refresh: search,
onCurrentPageChange: handleCurrentChange,
onPageSizeChange: handleSizeChange,
} = usePageList({
} = usePageList<AccountStatementNote>({
query: (page, pageSize) =>
podUsReconciliationList(
{
......@@ -1254,7 +1256,7 @@ const getTreeNum = async () => {
console.error(e)
}
}
const rowClick = (row: AccountStatementNote) => {
const rowClick = (row: AccountStatementNote | null) => {
if (!row) {
currentRow.value = null
}
......@@ -1414,7 +1416,7 @@ const submitConfirmOrder = async (type: number) => {
search()
await getTreeNum()
if (singleTableRef.value) {
singleTableRef.value!.setCurrentRow(currentRow.value)
singleTableRef.value!.setCurrentRow(currentRow.value ?? undefined)
}
}
watch(
......
......@@ -34,7 +34,7 @@ const {
refresh: search,
onCurrentPageChange: handleCurrentChange,
onPageSizeChange: handleSizeChange,
} = usePageList({
} = usePageList<AccountStatementNote>({
query: (page, pageSize) =>
getPodShipmentDetailsById(
{
......
......@@ -894,10 +894,9 @@
</template>
<script setup lang="ts">
import { ElMessage, ElRadioGroup, ElTree } from 'element-plus'
import { ElMessage, ElRadioGroup, ElTree, type TableInstance } from 'element-plus'
import { CirclePlusFilled } from '@element-plus/icons-vue'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { ElTable } from 'element-plus'
import usePageList from '@/utils/hooks/usePageList'
import { checkUpdateParams, AnyObject } from '@/utils/hooks/commonUtil'
import { useValue } from '@/utils/hooks/useValue'
......@@ -1064,7 +1063,7 @@ const tradingTime = ref<string[]>([])
const selections = ref<InterWarehousePage[]>([])
const detailList = ref<InterProductList[]>([])
const tabsValue = ref<string>('0')
const singleTableRef = ref<InstanceType<typeof ElTable>>()
const singleTableRef = ref<TableInstance>()
const currentRow = ref<InterWarehousePage | null>(null)
const logList = ref<LogListData[]>([])
const rules = {
......@@ -1399,7 +1398,7 @@ const getWarehouseList = async () => {
console.error(e)
}
}
const rowClick = (row: InterWarehousePage) => {
const rowClick = (row: InterWarehousePage | null) => {
if (!row) {
currentRow.value = null
}
......
......@@ -629,9 +629,8 @@
</template>
<script setup lang="ts">
import { ElMessage, ElRadioGroup, ElTree } from 'element-plus'
import { ElMessage, ElRadioGroup, ElTree, type TableInstance } from 'element-plus'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { ElTable } from 'element-plus'
import ReceiptProductDialog from './components/ReceiptProductDialog.vue'
import usePageList from '@/utils/hooks/usePageList'
import { checkUpdateParams, AnyObject } from '@/utils/hooks/commonUtil'
......@@ -807,7 +806,7 @@ const tradingTime = ref<string[]>([])
const selections = ref<InterWarehousePage[]>([])
const detailList = ref<InterProductList[]>([])
const tabsValue = ref<string>('0')
const singleTableRef = ref<InstanceType<typeof ElTable>>()
const singleTableRef = ref<TableInstance>()
const currentRow = ref<InterWarehousePage | null>(null)
const logList = ref<LogListData[]>([])
const detailLoading = ref(false)
......@@ -1085,7 +1084,7 @@ const getWarehouseList = async () => {
console.error(e)
}
}
const rowClick = (row: InterWarehousePage) => {
const rowClick = (row: InterWarehousePage | null) => {
if (!row) {
currentRow.value = null
}
......
......@@ -998,10 +998,9 @@
</template>
<script setup lang="ts">
import { ElMessage, ElRadioGroup, ElTree } from 'element-plus'
import { ElMessage, ElRadioGroup, ElTree, type TableInstance } from 'element-plus'
import { CirclePlusFilled } from '@element-plus/icons-vue'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { ElTable } from 'element-plus'
import usePageList from '@/utils/hooks/usePageList'
import { checkUpdateParams, AnyObject } from '@/utils/hooks/commonUtil'
import { useValue } from '@/utils/hooks/useValue'
......@@ -1174,7 +1173,7 @@ const tradingTime = ref<string[]>([])
const selections = ref<InterWarehousePage[]>([])
const detailList = ref<InterProductList[]>([])
const tabsValue = ref<string>('0')
const singleTableRef = ref<InstanceType<typeof ElTable>>()
const singleTableRef = ref<TableInstance>()
const currentRow = ref<InterWarehousePage | null>(null)
const logList = ref<LogListData[]>([])
const rules = {
......@@ -1509,7 +1508,7 @@ const getWarehouseList = async () => {
console.error(e)
}
}
const rowClick = (row: InterWarehousePage) => {
const rowClick = (row: InterWarehousePage | null) => {
if (!row) {
currentRow.value = null
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment