代码优化
This commit is contained in:
@@ -80,15 +80,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
$tbProductList
|
||||
} from '@/http/yskApi/goods.js';
|
||||
import {
|
||||
reactive,
|
||||
onMounted,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import { reactive, onMounted, ref, watch } from 'vue';
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
@@ -176,19 +168,19 @@
|
||||
getGoods()
|
||||
function getGoods() {
|
||||
const arr=selArr
|
||||
$tbProductList(goods.query).then(res => {
|
||||
let selLen=0;
|
||||
goods.list = res.content.map(v => {
|
||||
const checked=$selGoodsMap[v.id]?true:false
|
||||
selLen+=(checked?1:0)
|
||||
return {
|
||||
...v,
|
||||
checked
|
||||
}
|
||||
})
|
||||
goods.allChecked = selLen==res.content.length?true:false
|
||||
goods.totalElements = res.totalElements
|
||||
})
|
||||
// $tbProductList(goods.query).then(res => {
|
||||
// let selLen=0;
|
||||
// goods.list = res.content.map(v => {
|
||||
// const checked=$selGoodsMap[v.id]?true:false
|
||||
// selLen+=(checked?1:0)
|
||||
// return {
|
||||
// ...v,
|
||||
// checked
|
||||
// }
|
||||
// })
|
||||
// goods.allChecked = selLen==res.content.length?true:false
|
||||
// goods.totalElements = res.totalElements
|
||||
// })
|
||||
}
|
||||
|
||||
function pageChange(page) {
|
||||
|
||||
Reference in New Issue
Block a user