代码更新
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="w-full" v-for="item in pageData.list " :key="item.id">
|
||||
<printer-item :data="item" @init='init'></printer-item>
|
||||
</div>
|
||||
<view v-if="!pageData.list.length&&pageData.hasAjax">
|
||||
<view v-if="!pageData.list.length">
|
||||
<my-img-empty ></my-img-empty>
|
||||
</view>
|
||||
<view style="height: 100rpx;"></view>
|
||||
@@ -20,41 +20,39 @@
|
||||
|
||||
<script setup>
|
||||
import go from '@/commons/utils/go.js'
|
||||
import {
|
||||
onShow,
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
onMounted,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { reactive } from 'vue';
|
||||
import printerItem from './components/printer-item.vue';
|
||||
import * as Api from '@/http/yskApi/devices.js'
|
||||
import { getPrinter } from '@/api/printer.js'
|
||||
|
||||
const pageData = reactive({
|
||||
list: [],
|
||||
hasAjax:false,
|
||||
query: {
|
||||
sort: '',
|
||||
name: '',
|
||||
contentType: ''
|
||||
connectionType: ''
|
||||
}
|
||||
})
|
||||
|
||||
onShow(()=>{
|
||||
init()
|
||||
})
|
||||
|
||||
/**
|
||||
* 获取打印机列表
|
||||
*/
|
||||
async function init() {
|
||||
const res = await getPrinter(pageData.query)
|
||||
pageData.list = res.records
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加打印机
|
||||
*/
|
||||
function toAdd(){
|
||||
go.to('PAGES_PRINTER_ADD',{
|
||||
a:1
|
||||
})
|
||||
}
|
||||
async function init() {
|
||||
const res =await Api.tbPrintMachineGet(pageData.query)
|
||||
pageData.hasAjax=true
|
||||
pageData.list = res
|
||||
// pageData.list = res.filter(v=>v.address)
|
||||
}
|
||||
onShow(()=>{
|
||||
init()
|
||||
})
|
||||
// onMounted(() => {
|
||||
// init()
|
||||
// })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user