Commit 7a07fb8c authored by 张海景's avatar 张海景

update:提交质量的修改

parent 2d2dd714
...@@ -15,6 +15,8 @@ const install = (Vue, vm) => { ...@@ -15,6 +15,8 @@ const install = (Vue, vm) => {
vm.$u.get(config.adminPath + '/mobile/index', params), vm.$u.get(config.adminPath + '/mobile/index', params),
getUserInfo: (params = {}) => getUserInfo: (params = {}) =>
vm.$u.get(config.adminPath + '/mobile/user/getUserInfo', params), vm.$u.get(config.adminPath + '/mobile/user/getUserInfo', params),
getUserList: (params = {}) =>
vm.$u.get(config.adminPath + '/system/user/list', params),
getUserPrintInfo: () => getUserPrintInfo: () =>
vm.$u.get(config.adminPath + '/system/print/printer'), vm.$u.get(config.adminPath + '/system/print/printer'),
getPrintDown: (params) => getPrintDown: (params) =>
......
<template>
<view class="dmodel-table">
<view class="search">
<u-form :model="tableParams" labelAlign="right" class="tableForm">
<u-form-item label="编号" label-width="60px" name="userName">
<uni-easyinput type="text" v-model="tableParams.userName" placeholder="请输入编号" />
</u-form-item>
<u-form-item label="名称" label-width="60px" name="nickName">
<uni-easyinput type="text" v-model="tableParams.nickName" placeholder="请输入名称" />
</u-form-item>
<u-form-item>
<u-button class="btn" @click="handleClick" type="primary" size="medium">搜索</u-button>
</u-form-item>
</u-form>
</view>
<view>
<zb-table ref="zbTable" rowKey="userName" :columns="tableColumn" :data="tableData" :stripe="true" @toggleRowSelection="toggleRowSelection"></zb-table>
</view>
<view class="uni-pagination-box"><uni-pagination show-icon :page-size="params.pageSize" :current="params.pageNum" :total="total" @change="change" /></view>
</view>
</template>
<script>
export default {
name: 'User',
data() {
return {
params: {
pageNum: 1,
pageSize: 10
},
total: 0,
tableParams: {
nickName: null,
userName: null
},
tableData: [],
tableSelectData: [],
tableColumn: [
{
type: 'radio',
width: 40
},
{
name: 'userName',
label: '编号',
width: 160
},
{
name: 'nickName',
label: '名称',
width: 200
}
]
};
},
// computed: {
// tableData() {
// return this.data || []
// }
// },
mounted() {
this.getList();
},
methods: {
handleClick( ){
if (this.tableParams.userName) {
this.params.userName = this.tableParams.userName;
}
if (this.tableParams.nickName) {
this.params.nickName = this.tableParams.nickName;
}
this.params.pageNum = 1
this.getList()
},
async getList() {
const res = await this.$u.api.getUserList(this.params);
console.log(res, 'res');
if (res.code == 200) {
this.tableData = res.rows;
this.total = res.total;
}
},
// 分页触发
change(e) {
this.params.pageNum = e.current
this.getList()
},
toggleRowSelection(checked, arr) {
this.tableSelectData = arr;
}
}
};
</script>
<style lang="scss" scoped>
.dmodel-table {
height: 1200rpx;
margin-top: 20rpx;
padding: 0 20rpx;
position: relative;
}
.tableForm {
display: flex;
margin-bottom: 20rpx;
}
.btn {
margin-left: 10px;
}
.uni-pagination-box {
position: absolute;
right: 20rpx;
bottom: 40rpx;
}
</style>
...@@ -9,15 +9,18 @@ ...@@ -9,15 +9,18 @@
<uni-easyinput type="text" v-model="tableParams.nickName" placeholder="请输入名称" /> <uni-easyinput type="text" v-model="tableParams.nickName" placeholder="请输入名称" />
</u-form-item> </u-form-item>
<u-form-item> <u-form-item>
<u-button class="btn" @click="getList" type="primary" size="medium">搜索</u-button> <u-button class="btn" @click="handleClick" type="primary" size="medium">搜索</u-button>
</u-form-item> </u-form-item>
</u-form> </u-form>
</view> </view>
<zb-table ref="zbTable" rowKey="recordId" <view>
<zb-table ref="zbTable" rowKey="userName"
:columns="tableColumn" :data="tableData" :stripe="true" :columns="tableColumn" :data="tableData" :stripe="true"
@toggleRowSelection="toggleRowSelection"> @toggleRowSelection="toggleRowSelection">
</zb-table> </zb-table>
</view> </view>
<view class="uni-pagination-box"><uni-pagination show-icon :page-size="params.pageSize" :current="params.pageNum" :total="total" @change="change" /></view>
</view>
</template> </template>
<script> <script>
...@@ -30,6 +33,12 @@ ...@@ -30,6 +33,12 @@
}, },
data() { data() {
return { return {
params: {
pageNum: 1,
pageSize: 10,
workstationId: this.data?.workstationId || null
},
total: 0,
tableParams: { tableParams: {
nickName: null, nickName: null,
userName: null, userName: null,
...@@ -56,7 +65,6 @@ ...@@ -56,7 +65,6 @@
label: '工作站', label: '工作站',
width: 160, width: 160,
}, },
], ],
} }
}, },
...@@ -70,30 +78,34 @@ ...@@ -70,30 +78,34 @@
// this.data.workstationName // this.data.workstationName
}, },
methods: { methods: {
async getList() { handleClick( ){
let params = { if (this.tableParams.userName) {
pageNum: 1, this.params.userName = this.tableParams.userName;
pageSize: 10,
workstationId: this.data.workstationId
} }
if (this.userName) { if (this.tableParams.nickName) {
params.userName = this.tableParams.userName this.params.nickName = this.tableParams.nickName;
} }
if (this.nickName) { this.params.pageNum = 1
params.nickName = this.tableParams.nickName this.getList()
} },
const res = await this.$u.api.userQuery(params) async getList() {
const res = await this.$u.api.userQuery(this.params)
console.log(res, 'res') console.log(res, 'res')
if (res.code == 200) { if (res.code == 200) {
this.tableData=res.rows.map(item => { this.tableData= res.rows.map(item => {
return { return {
...item, ...item,
workstationName: this.data.workstationName workstationName: this.data?.workstationName || null
} }
}) })
this.total = res.total
} }
}, },
// 分页触发
change(e) {
this.params.pageNum = e.current
this.getList()
},
toggleRowSelection(checked, arr) { toggleRowSelection(checked, arr) {
this.tableSelectData = arr this.tableSelectData = arr
}, },
...@@ -101,11 +113,12 @@ ...@@ -101,11 +113,12 @@
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
.dmodel-table { .dmodel-table {
height: 500rpx; height: 1200rpx;
margin-top: 20rpx; margin-top: 20rpx;
padding: 0 20rpx; padding: 0 20rpx;
position: relative;
} }
.tableForm{ .tableForm{
display: flex; display: flex;
...@@ -114,4 +127,9 @@ ...@@ -114,4 +127,9 @@
.btn{ .btn{
margin-left:10px; margin-left:10px;
} }
.uni-pagination-box{
position: absolute;
right:20rpx;
bottom:40rpx;
}
</style> </style>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment