增加防抖函数等配置

This commit is contained in:
BianLzhaoMin 2024-11-20 10:20:39 +08:00
parent 7606cab67e
commit 1d4a28988b
8 changed files with 46 additions and 27 deletions

View File

@ -58,6 +58,7 @@
"@dcloudio/uni-mp-xhs": "3.0.0-4020920240930001", "@dcloudio/uni-mp-xhs": "3.0.0-4020920240930001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4020920240930001", "@dcloudio/uni-quickapp-webview": "3.0.0-4020920240930001",
"@rollup/rollup-darwin-arm64": "^4.27.2", "@rollup/rollup-darwin-arm64": "^4.27.2",
"lodash-es": "^4.17.21",
"pinia": "^2.2.2", "pinia": "^2.2.2",
"pinia-plugin-persistedstate": "^3.2.3", "pinia-plugin-persistedstate": "^3.2.3",
"sass": "^1.32.13", "sass": "^1.32.13",

View File

@ -56,6 +56,9 @@ importers:
'@rollup/rollup-darwin-arm64': '@rollup/rollup-darwin-arm64':
specifier: ^4.27.2 specifier: ^4.27.2
version: 4.27.2 version: 4.27.2
lodash-es:
specifier: ^4.17.21
version: 4.17.21
pinia: pinia:
specifier: ^2.2.2 specifier: ^2.2.2
version: 2.2.6(vue@3.5.13) version: 2.2.6(vue@3.5.13)
@ -2748,6 +2751,9 @@ packages:
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
engines: {node: '>=10'} engines: {node: '>=10'}
lodash-es@4.17.21:
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
lodash.camelcase@4.3.0: lodash.camelcase@4.3.0:
resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==}
@ -7555,6 +7561,8 @@ snapshots:
dependencies: dependencies:
p-locate: 5.0.0 p-locate: 5.0.0
lodash-es@4.17.21: {}
lodash.camelcase@4.3.0: {} lodash.camelcase@4.3.0: {}
lodash.debounce@4.0.8: {} lodash.debounce@4.0.8: {}

View File

@ -39,7 +39,7 @@ const loginForm = reactive({
// //
const onHandleLogin = async () => { const onHandleLogin = async () => {
const res = await appLoginAPI(loginForm) const res = await appLoginAPI(loginForm)
console.log(res) console.log(res)
if (res.code === 200) { if (res.code === 200) {
// 1. token // 1. token
memberStore.setToken(res.data.access_token) memberStore.setToken(res.data.access_token)

View File

@ -62,8 +62,9 @@
background-color: #fff7eb; background-color: #fff7eb;
border: 1px solid #fe9a09; border: 1px solid #fe9a09;
" "
>编码检索</view @tap="onCodeSearch"
> >编码检索
</view>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
@ -150,13 +151,22 @@ const getCodeDeviceListData = async () => {
// console.log('queryCodeParams', queryCodeParams) // console.log('queryCodeParams', queryCodeParams)
const res = await getCodeDeviceListAPI(queryCodeParams.value) const res = await getCodeDeviceListAPI(queryCodeParams.value)
codeDeviceList.value.push(...res.rows) codeDeviceList.value.push(...res.rows)
codeDeviceList.value = codeDeviceList.value.map((e) => {
return { ...e, checked: false } if (codeDeviceList.value.length > 0) {
}) codeDeviceList.value = codeDeviceList.value.map((e) => {
return { ...e, checked: false }
})
}
total.value = res.total total.value = res.total
} }
getCodeDeviceListData() getCodeDeviceListData()
//
const onCodeSearch = () => {
codeDeviceList.value = []
getCodeDeviceListData()
}
// //
const onScrollTolower = () => { const onScrollTolower = () => {
console.log('滚动触底--') console.log('滚动触底--')

View File

@ -19,47 +19,47 @@
class="table-list-item" class="table-list-item"
@tap="onCodingItem(item)" @tap="onCodingItem(item)"
> >
<div class="line"></div> <view class="line"></view>
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="2">{{ index + 1 }}</uni-col> <uni-col :span="2">{{ index + 1 }}</uni-col>
<uni-col :span="6">物资名称</uni-col> <uni-col :span="6">物资名称</uni-col>
<uni-col :span="16" <uni-col :span="16">
><div class="cont">{{ item.maTypeName }}</div></uni-col <view class="cont">{{ item.maTypeName }}</view>
> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col> <uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">规格型号</uni-col> <uni-col :span="6">规格型号</uni-col>
<uni-col :span="16" <uni-col :span="16">
><div class="cont">{{ item.typeName }}</div></uni-col <view class="cont">{{ item.typeName }}</view>
> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col> <uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">预领数量</uni-col> <uni-col :span="6">预领数量</uni-col>
<uni-col :span="16" <uni-col :span="16">
><div class="cont">{{ item.preNum }}</div></uni-col <view class="cont">{{ item.preNum }}</view>
> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col> <uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">已领数量</uni-col> <uni-col :span="6">已领数量</uni-col>
<uni-col :span="16" <uni-col :span="16">
><div class="cont">{{ item.alNum }}</div></uni-col <view class="cont">{{ item.alNum }}</view>
> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col> <uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">待领数量</uni-col> <uni-col :span="6">待领数量</uni-col>
<uni-col :span="16"> <uni-col :span="16">
<div class="cont">{{ item.preNum - item.alNum }}</div> <view class="cont">{{ item.preNum - item.alNum }}</view>
</uni-col> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col> <uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">单位</uni-col> <uni-col :span="6">单位</uni-col>
<uni-col :span="16"> <uni-col :span="16">
<div class="cont">{{ item.unitName }}</div> <view class="cont">{{ item.unitName }}</view>
</uni-col> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24"> <uni-row :gutter="24">

View File

@ -115,8 +115,8 @@
<script setup> <script setup>
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import { getPickingOutboundListAPI } from '@/services/picking/outbound.js' import { getPickingOutboundListAPI } from '@/services/picking/outbound.js'
import { onLoad } from '@dcloudio/uni-app' import { onLoad, onShow } from '@dcloudio/uni-app'
import { onShow } from '@dcloudio/uni-app' import { debounce } from 'lodash-es'
const total = ref(0) // const total = ref(0) //
const active = ref(1) // tap const active = ref(1) // tap
@ -167,12 +167,12 @@ onShow(() => {
}) })
// //
const onScrollTolower = () => { const onScrollTolower = debounce(() => {
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageNum++
getTableList() getTableList()
} }
} })
// tap // tap
const changeTab = (index) => { const changeTab = (index) => {

View File

@ -6,7 +6,7 @@ import { useMemberStore } from '@/stores'
* baseURL 设置请求ip地址和端口 * baseURL 设置请求ip地址和端口
*/ */
const ENV = process.env.NODE_ENV const ENV = process.env.NODE_ENV
const baseURL = ENV === 'development' ? 'http://192.168.2.76:18080' : '***' const baseURL = ENV === 'development' ? '/api' : '***'
/** /**
* httpInterceptor 分别拦截 request uploadFile 请求 * httpInterceptor 分别拦截 request uploadFile 请求

View File

@ -20,7 +20,7 @@ export default defineConfig({
proxy: { proxy: {
// 在此处编写代理规则 // 在此处编写代理规则
'/api': { '/api': {
target: 'http://192.168.2.76:18080', target: 'http://192.168.0.110:18080',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => { rewrite: (path) => {
return path.replace(/\/api/, '') return path.replace(/\/api/, '')