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