代码优化
This commit is contained in:
parent
f452f3d8fb
commit
bbebcc112d
|
|
@ -18,6 +18,7 @@ declare module 'vue' {
|
|||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
||||
ElCol: typeof import('element-plus/es')['ElCol']
|
||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||
ElCountdown: typeof import('element-plus/es')['ElCountdown']
|
||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
||||
|
|
@ -31,6 +32,7 @@ declare module 'vue' {
|
|||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ VITE_API_URL = '/proxyApi'
|
|||
# 开发环境接口地址
|
||||
# VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭
|
||||
|
||||
VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅
|
||||
# VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅
|
||||
# VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅
|
||||
VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅
|
||||
# VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅
|
||||
|
||||
# VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型)
|
||||
|
|
|
|||
|
|
@ -1,66 +1,67 @@
|
|||
<script setup lang="ts">
|
||||
// 每页数量值改变
|
||||
const handleSizeChange = (val: Number) => {
|
||||
emit('update:pageSize', val)
|
||||
// 传递每页数量
|
||||
emit('getListChange')
|
||||
}
|
||||
// 页码值改变
|
||||
const handleCurrentChange = (val: Number) => {
|
||||
// 每页数量值改变
|
||||
const handleSizeChange = (val: Number) => {
|
||||
emit('update:pageSize', val)
|
||||
// 传递每页数量
|
||||
emit('getListChange')
|
||||
}
|
||||
// 页码值改变
|
||||
const handleCurrentChange = (val: Number) => {
|
||||
emit('update:pageNum', val)
|
||||
// 传递页码值
|
||||
emit('getListChange')
|
||||
}
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
page?: number
|
||||
size?: number
|
||||
total?: number
|
||||
}>(),
|
||||
{
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
},
|
||||
)
|
||||
|
||||
const emit = defineEmits(['getListChange', 'update:pageSize', 'update:pageNum'])
|
||||
|
||||
const currentPage = computed({
|
||||
get: () => {
|
||||
return props.page
|
||||
},
|
||||
set: (val: number) => {
|
||||
emit('update:pageNum', val)
|
||||
// 传递页码值
|
||||
emit('getListChange')
|
||||
}
|
||||
},
|
||||
})
|
||||
const pageSize = computed({
|
||||
get: () => {
|
||||
return props.size
|
||||
},
|
||||
set: (val: number) => {
|
||||
emit('update:pageSize', val)
|
||||
},
|
||||
})
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
page?: number
|
||||
size?: number
|
||||
total?: number
|
||||
}>(),
|
||||
{
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0
|
||||
}
|
||||
)
|
||||
// const paginationData = reactive({
|
||||
// pageSize: Props.pageSize,
|
||||
// pageNumber: Props.pageNumber
|
||||
// })
|
||||
|
||||
const emit = defineEmits(['getListChange', 'update:pageSize', 'update:pageNum'])
|
||||
|
||||
const currentPage = computed({
|
||||
get: () => {
|
||||
return props.page
|
||||
},
|
||||
set: (val: number) => {
|
||||
emit('update:pageNum', val)
|
||||
}
|
||||
})
|
||||
const pageSize = computed({
|
||||
get: () => {
|
||||
return props.size
|
||||
},
|
||||
set: (val: number) => {
|
||||
emit('update:pageSize', val)
|
||||
}
|
||||
})
|
||||
|
||||
// const paginationData = reactive({
|
||||
// pageSize: Props.pageSize,
|
||||
// pageNumber: Props.pageNumber
|
||||
// })
|
||||
|
||||
// const handleTotalText = () => {
|
||||
// const targetDom: any = document.querySelector('.el-pagination__total')
|
||||
// targetDom.innerText = `数量${total.value}`
|
||||
// }
|
||||
// onMounted(() => {
|
||||
// // handleTotalText()
|
||||
// })
|
||||
// const handleTotalText = () => {
|
||||
// const targetDom: any = document.querySelector('.el-pagination__total')
|
||||
// targetDom.innerText = `数量${total.value}`
|
||||
// }
|
||||
// onMounted(() => {
|
||||
// // handleTotalText()
|
||||
// })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
class="primary-lease"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[5, 10, 20, 40]"
|
||||
|
|
@ -69,11 +70,17 @@
|
|||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" />
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.el-pagination {
|
||||
margin-top: 15px;
|
||||
}
|
||||
<style scoped lang="scss">
|
||||
.el-pagination {
|
||||
justify-content: flex-end;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
:deep.el-pagination.is-background .el-pager li.is-active {
|
||||
background-color: #3cb4a6;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
.primary-lease {
|
||||
--el-color-primary:#00a288;
|
||||
--el-color-primary-light-3:#00ad9d;
|
||||
--el-color-primary-dark-2:#00ad9d;
|
||||
--el-color-primary-light-5:#78d3cb
|
||||
}
|
||||
|
||||
:root {
|
||||
--el-color-primary:#00a288;
|
||||
// --el-color-primary-light-9:#78d3cb
|
||||
}
|
||||
|
|
@ -450,7 +450,7 @@ const onCartSubmit = async () => {
|
|||
type: 'success',
|
||||
})
|
||||
|
||||
userStore.editcurrentMenuItem('orderManagementCz')
|
||||
userStore.editcurrentMenuItem('orderManagement')
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
name: 'my-user',
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ const onCartSubmit = async () => {
|
|||
message: '提交成功',
|
||||
type: 'success',
|
||||
})
|
||||
userStore.editcurrentMenuItem('orderManagementCz')
|
||||
userStore.editcurrentMenuItem('orderManagement')
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
name: 'my-user',
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue