表单提交
parent
6a1f44f6ce
commit
b275f706c3
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询需求清单列表
|
||||
export function listRequire(query) {
|
||||
return request({
|
||||
url: '/system/require/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询需求清单详细
|
||||
export function getRequire(id) {
|
||||
return request({
|
||||
url: '/system/require/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增需求清单
|
||||
export function addRequire(data) {
|
||||
return request({
|
||||
url: '/system/require',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改需求清单
|
||||
export function updateRequire(data) {
|
||||
return request({
|
||||
url: '/system/require',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除需求清单
|
||||
export function delRequire(id) {
|
||||
return request({
|
||||
url: '/system/require/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
22
pages.json
22
pages.json
|
|
@ -25,12 +25,7 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/demo/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "示例"
|
||||
}
|
||||
}, {
|
||||
}, {
|
||||
"path": "pages/control/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "控制中心"
|
||||
|
|
@ -66,6 +61,16 @@
|
|||
"navigationBarTitleText": "常见问题"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/mqtt/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "mqtt工具"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/require/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "需求清单"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/about/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "关于我们"
|
||||
|
|
@ -100,11 +105,6 @@
|
|||
"text": "工作台"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/demo/index",
|
||||
"iconPath": "static/images/tabbar/work.png",
|
||||
"selectedIconPath": "static/images/tabbar/work_.png",
|
||||
"text": "示例"
|
||||
},{
|
||||
"pagePath": "pages/mine/index",
|
||||
"iconPath": "static/images/tabbar/mine.png",
|
||||
"selectedIconPath": "static/images/tabbar/mine_.png",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,19 @@
|
|||
<view>编辑资料</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleMqtt" v-if="name === 'admin'">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-service menu-icon"></view>
|
||||
<view>mqtt工具</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="list-cell list-cell-arrow" @click="handleRequire" v-if="name === 'admin'">
|
||||
<view class="menu-item-box">
|
||||
<uni-icons type="wallet" size="19" color="#007AFF"></uni-icons>
|
||||
<view style="margin-left: 4rpx"> 需求清单</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleHelp">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-help menu-icon"></view>
|
||||
|
|
@ -77,7 +90,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
|
||||
|
||||
export default {
|
||||
components: {UniIcons},
|
||||
data() {
|
||||
return {
|
||||
name: this.$store.state.user.name
|
||||
|
|
@ -91,6 +107,7 @@
|
|||
return uni.getSystemInfoSync().windowHeight - 50
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleToInfo() {
|
||||
this.$tab.navigateTo('/pages/mine/info/index')
|
||||
|
|
@ -110,6 +127,12 @@
|
|||
handleHelp() {
|
||||
this.$tab.navigateTo('/pages/mine/help/index')
|
||||
},
|
||||
handleMqtt() {
|
||||
this.$tab.navigateTo('/pages/mine/mqtt/index')
|
||||
},
|
||||
handleRequire() {
|
||||
this.$tab.navigateTo('/pages/mine/require/index')
|
||||
},
|
||||
handleAbout() {
|
||||
this.$tab.navigateTo('/pages/mine/about/index')
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,156 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="uni-container">
|
||||
<!-- 1. 给table加宽度100%,关闭默认固定列宽 -->
|
||||
<uni-table
|
||||
ref="table"
|
||||
:loading="loading"
|
||||
border
|
||||
stripe
|
||||
type="selection"
|
||||
emptyText="暂无更多数据"
|
||||
@selection-change="selectionChange"
|
||||
style="width: 100%;"
|
||||
:border-width="1"
|
||||
>
|
||||
<uni-tr>
|
||||
<!-- 2. 列宽设为auto(自适应),调整表头行高 -->
|
||||
<uni-th align="center" style="width: auto; height: 30px; line-height: 30px;">选择</uni-th>
|
||||
<uni-th align="center" style="width: auto; height: 30px; line-height: 30px;">需求标题</uni-th>
|
||||
<uni-th align="center" style="width: auto; height: 30px; line-height: 30px;">需求详情</uni-th>
|
||||
<uni-th align="center" style="width: auto; height: 30px; line-height: 30px;">优先级</uni-th>
|
||||
<uni-th align="center" style="width: auto; height: 30px; line-height: 30px;">进度</uni-th>
|
||||
<uni-th align="center" style="width: auto; height: 30px; line-height: 30px;">需求类型</uni-th>
|
||||
<uni-th align="center" style="width: auto; height: 30px; line-height: 30px;">经办人名称</uni-th>
|
||||
<uni-th align="center" style="width: auto; height: 30px; line-height: 30px;">操作</uni-th>
|
||||
</uni-tr>
|
||||
<!-- 3. 缩小表格行高 -->
|
||||
<uni-tr v-for="(item, index) in tableData" :key="index" style="height: 35px; line-height: 35px;">
|
||||
<uni-td style="width: auto; padding: 2px 0;">
|
||||
<uni-checkbox :value="index" @change="handleCheckboxChange"></uni-checkbox>
|
||||
</uni-td>
|
||||
<uni-td style="width: auto; padding: 2px 0;">{{ item.title }}</uni-td>
|
||||
<uni-td style="width: auto; padding: 2px 0;">
|
||||
<view class="name">{{ item.detail }}</view>
|
||||
</uni-td>
|
||||
<uni-td align="center" style="width: auto; padding: 2px 0;">{{ item.priority }}</uni-td>
|
||||
<uni-td align="center" style="width: auto; padding: 2px 0;">{{ item.progress }}</uni-td>
|
||||
<uni-td align="center" style="width: auto; padding: 2px 0;">{{ item.reqType }}</uni-td>
|
||||
<uni-td align="center" style="width: auto; padding: 2px 0;">{{ item.assigneeName }}</uni-td>
|
||||
<uni-td style="width: auto; padding: 2px 0;">
|
||||
<view class="uni-group">
|
||||
<!-- 4. 缩小按钮尺寸 -->
|
||||
<button class="uni-button" size="mini" type="primary" style="padding: 2px 8px; font-size: 12px;">修改</button>
|
||||
<button class="uni-button" size="mini" type="warn" style="padding: 2px 8px; font-size: 12px; margin-left: 5px;">删除</button>
|
||||
</view>
|
||||
</uni-td>
|
||||
</uni-tr>
|
||||
</uni-table>
|
||||
<view class="uni-pagination-box" style="margin-top: 10px;">
|
||||
<uni-pagination
|
||||
show-icon
|
||||
:page-size="pageSize"
|
||||
:current="pageCurrent"
|
||||
:total="total"
|
||||
@change="change"
|
||||
style="font-size: 12px;"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UniTh from "../../../uni_modules/uni-table/components/uni-th/uni-th.vue";
|
||||
import UniTr from "../../../uni_modules/uni-table/components/uni-tr/uni-tr.vue";
|
||||
import UniTd from "../../../uni_modules/uni-table/components/uni-td/uni-td.vue";
|
||||
import UniPagination from "../../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue";
|
||||
import { listRequire } from "../../../api/system/require";
|
||||
import UniTable from "../../../uni_modules/uni-table/components/uni-table/uni-table.vue";
|
||||
|
||||
export default {
|
||||
components: {UniTable, UniPagination, UniTd, UniTr, UniTh },
|
||||
data() {
|
||||
return {
|
||||
searchVal: '',
|
||||
tableData: [],
|
||||
pageSize: 10,
|
||||
pageCurrent: 1,
|
||||
total: 0,
|
||||
loading: false,
|
||||
selectedIndexs: [] // 已选择的行索引
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
// 多选处理
|
||||
selectedItems() {
|
||||
return this.selectedIndexs.map(i => this.tableData[i])
|
||||
},
|
||||
// 多选(替换原selection-change,适配自定义checkbox)
|
||||
handleCheckboxChange(e, index) {
|
||||
if (e.detail.value) {
|
||||
this.selectedIndexs.push(index)
|
||||
} else {
|
||||
this.selectedIndexs = this.selectedIndexs.filter(item => item !== index)
|
||||
}
|
||||
},
|
||||
// 批量删除
|
||||
delTable() {
|
||||
console.log(this.selectedItems())
|
||||
},
|
||||
// 分页触发
|
||||
change(e) {
|
||||
this.selectedIndexs = []
|
||||
this.getData(e.current)
|
||||
},
|
||||
// 搜索
|
||||
search() {
|
||||
this.getData()
|
||||
},
|
||||
// 获取数据
|
||||
getData(pageCurrent) {
|
||||
this.loading = true
|
||||
this.pageCurrent = pageCurrent || this.pageCurrent
|
||||
const queryParams = {
|
||||
imei: this.imei,
|
||||
pageNum: this.pageCurrent,
|
||||
pageSize: this.pageSize,
|
||||
}
|
||||
listRequire(queryParams).then(response => {
|
||||
if (response.code === 200 && response.rows) {
|
||||
this.tableData = response.rows
|
||||
this.total = response.total
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 适配微信小程序,取消页面默认padding */
|
||||
page {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.uni-container {
|
||||
padding: 10px;
|
||||
box-sizing: border-box; /* 保证padding不超出屏幕 */
|
||||
}
|
||||
|
||||
.uni-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* 缩小需求详情的行高 */
|
||||
.name {
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue