增加防抖函数等配置
This commit is contained in:
parent
7606cab67e
commit
1d4a28988b
|
|
@ -58,6 +58,7 @@
|
|||
"@dcloudio/uni-mp-xhs": "3.0.0-4020920240930001",
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4020920240930001",
|
||||
"@rollup/rollup-darwin-arm64": "^4.27.2",
|
||||
"lodash-es": "^4.17.21",
|
||||
"pinia": "^2.2.2",
|
||||
"pinia-plugin-persistedstate": "^3.2.3",
|
||||
"sass": "^1.32.13",
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ importers:
|
|||
'@rollup/rollup-darwin-arm64':
|
||||
specifier: ^4.27.2
|
||||
version: 4.27.2
|
||||
lodash-es:
|
||||
specifier: ^4.17.21
|
||||
version: 4.17.21
|
||||
pinia:
|
||||
specifier: ^2.2.2
|
||||
version: 2.2.6(vue@3.5.13)
|
||||
|
|
@ -2748,6 +2751,9 @@ packages:
|
|||
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
lodash-es@4.17.21:
|
||||
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
|
||||
|
||||
lodash.camelcase@4.3.0:
|
||||
resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==}
|
||||
|
||||
|
|
@ -7555,6 +7561,8 @@ snapshots:
|
|||
dependencies:
|
||||
p-locate: 5.0.0
|
||||
|
||||
lodash-es@4.17.21: {}
|
||||
|
||||
lodash.camelcase@4.3.0: {}
|
||||
|
||||
lodash.debounce@4.0.8: {}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const loginForm = reactive({
|
|||
// 登录按钮
|
||||
const onHandleLogin = async () => {
|
||||
const res = await appLoginAPI(loginForm)
|
||||
console.log(res)
|
||||
console.log(res)
|
||||
if (res.code === 200) {
|
||||
// 1. 获取 token 并存储
|
||||
memberStore.setToken(res.data.access_token)
|
||||
|
|
|
|||
|
|
@ -62,8 +62,9 @@
|
|||
background-color: #fff7eb;
|
||||
border: 1px solid #fe9a09;
|
||||
"
|
||||
>编码检索</view
|
||||
>
|
||||
@tap="onCodeSearch"
|
||||
>编码检索
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
|
|
@ -150,13 +151,22 @@ const getCodeDeviceListData = async () => {
|
|||
// console.log('queryCodeParams', queryCodeParams)
|
||||
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
||||
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
|
||||
}
|
||||
getCodeDeviceListData()
|
||||
|
||||
// 编码搜索按钮
|
||||
const onCodeSearch = () => {
|
||||
codeDeviceList.value = []
|
||||
getCodeDeviceListData()
|
||||
}
|
||||
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = () => {
|
||||
console.log('滚动触底--')
|
||||
|
|
|
|||
|
|
@ -19,47 +19,47 @@
|
|||
class="table-list-item"
|
||||
@tap="onCodingItem(item)"
|
||||
>
|
||||
<div class="line"></div>
|
||||
<view class="line"></view>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.maTypeName }}</div></uni-col
|
||||
>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.maTypeName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">规格型号:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.typeName }}</div></uni-col
|
||||
>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.typeName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">预领数量:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.preNum }}</div></uni-col
|
||||
>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.preNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">已领数量:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.alNum }}</div></uni-col
|
||||
>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.alNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">待领数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<div class="cont">{{ item.preNum - item.alNum }}</div>
|
||||
<view class="cont">{{ item.preNum - item.alNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">单位:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<div class="cont">{{ item.unitName }}</div>
|
||||
<view class="cont">{{ item.unitName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { getPickingOutboundListAPI } from '@/services/picking/outbound.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
const total = ref(0) // 数据总量
|
||||
const active = ref(1) // tap索引
|
||||
|
|
@ -167,12 +167,12 @@ onShow(() => {
|
|||
})
|
||||
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = () => {
|
||||
const onScrollTolower = debounce(() => {
|
||||
if (total.value > tableList.value.length) {
|
||||
queryParams.value.pageNum++
|
||||
getTableList()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// tap 栏切换
|
||||
const changeTab = (index) => {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { useMemberStore } from '@/stores'
|
|||
* baseURL 设置请求ip地址和端口
|
||||
*/
|
||||
const ENV = process.env.NODE_ENV
|
||||
const baseURL = ENV === 'development' ? 'http://192.168.2.76:18080' : '***'
|
||||
const baseURL = ENV === 'development' ? '/api' : '***'
|
||||
|
||||
/**
|
||||
* httpInterceptor 分别拦截 request 和 uploadFile 请求
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export default defineConfig({
|
|||
proxy: {
|
||||
// 在此处编写代理规则
|
||||
'/api': {
|
||||
target: 'http://192.168.2.76:18080',
|
||||
target: 'http://192.168.0.110:18080',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => {
|
||||
return path.replace(/\/api/, '')
|
||||
|
|
|
|||
Loading…
Reference in New Issue