在表單里使用v-model綁定了一個對象,之前使用的時候都沒有出現(xiàn)過這種.
正常的應(yīng)該全部屬性打印出來,現(xiàn)在雙向綁定全部失效了,下拉菜單全都選不上了;除非用單屬性,而不是放到一個對象上.
圖片描述
<template>
<div class="app-container">
<!--周期統(tǒng)計-->
<div class="count">
<div style="padding: 10px;">
<h2><span>周期統(tǒng)計</span><el-button @click="refUserCount()" size="small" type="primary">
<i class="iconfont icon-shuaxin" style="font-size:12px"></i>刷新</el-button></h2>
<ul v-if="userCount" class="Grid">
<li @click="$router.push({path:'/Operative/addday'})" style="cursor: pointer" class="Grid-cell Grid-cell.u-full">
<div>
<p><span>{{userCount.phoneRegTotal}}</span> / {{userCount.autoRegTotal}} / {{userCount.allTotal}}</p>
<h4><span>注冊用戶</span> / 分配賬號 / 用戶總數(shù)</h4>
</div>
</li>
<li @click="$router.push({path:'/Operative/addday'})" style="cursor: pointer" class="Grid-cell Grid-cell.u-full">
<div>
<p><span>{{userCount.todayPhoneRegTotal}}</span> / {{userCount.todayAutoRegTotal}} / {{userCount.todayTotal}}</p>
<h4><span>今日新增注冊</span> / 今日新增分配 / 今日新增用戶總數(shù)</h4>
</div>
</li>
<li @click="$router.push({path:'/Operative/addday'})" style="cursor: pointer" class="Grid-cell Grid-cell.u-full">
<div>
<p><span>{{userCount.currentOnlineTotal}}</span> / {{userCount.totalOnlineTop}} / {{userCount.historyOnlineTop}}</p>
<h4><span>當(dāng)前在線人數(shù)</span> / 當(dāng)天最高 / 歷史最高</h4>
</div>
</li>
<li @click="$router.push({path:'/Operative/activeday'})" style="cursor: pointer" class="Grid-cell">
<div>
<p>{{userCount.todayActiveTotal}}</p>
<h4>今日活躍人數(shù)</h4>
</div>
</li>
</ul>
</div>
</div>
<!-- 篩選 -->
<div class="public_nav">
<jg-systematics-border title="篩選 / 搜索">
<div style="margin:10px 0">
<div class="warp">
<span>用戶類型<i class="iconfont icon-maohao1"></i></span>
<el-select v-model="filter.useAccount" clearable placeholder="用戶類型">
<el-option label="全部" value=""></el-option>
<el-option label="分配賬號" value="0"></el-option>
<el-option label="注冊賬號" value="1"></el-option>
</el-select>
</div>
<div class="warp">
<span>渠道<i class="iconfont icon-maohao1"></i></span><jg-version @parentDate="cutoverVersion"></jg-version>
</div>
<div class="warp">
<span>版本<i class="iconfont icon-maohao1"></i></span><jg-channel @parentDate="cutoverChannel"></jg-channel>
</div>
<div class="warp">
<span>用戶狀態(tài)<i class="iconfont icon-maohao1"></i></span>
<el-select v-model="filter.status" clearable placeholder="處理狀態(tài)">
<el-option label="全部" value=""></el-option>
<el-option label="正常" value="1"></el-option>
<el-option label="封號" value="0"></el-option>
</el-select>
</div>
<div class="warp">
<span>時間類型<i class="iconfont icon-maohao1"></i></span>
<el-select v-model="filter.dateType" clearable placeholder="時間類型">
<el-option label="全部" value=""></el-option>
<el-option label="登錄時間" value="login"></el-option>
<el-option label="注冊時間" value="register"></el-option>
</el-select>
<jg-date-picker @parentDate='getChildData' :filter='initDate'></jg-date-picker>
</div>
<div class="warp">
<el-button class="el-icon-search" @click="Inquire">篩選</el-button>
</div>
</div>
<div style="margin:10px 0">
<div class="warp">
<span>賬號搜索<i class="iconfont icon-maohao1"></i></span>
<el-input placeholder="請輸入內(nèi)容" v-model="filter.keyword" style="width: 350px">
<el-select v-model="filter.userType" slot="prepend" placeholder="請選擇" style="width: 160px">
<el-option label="賬號名" value="name"></el-option>
<el-option label="賬號名ID" value="id"></el-option>
<el-option label="賬號名UUID" value="uuid"></el-option>
</el-select>
</el-input>
</div>
<div class="warp">
<el-button class="el-icon-search" @click="Inquire">搜索</el-button>
</div>
</div>
</jg-systematics-border>
</div>
<!-- 表格 -->
<div>
<p style="text-align: left;margin-left: 5px">用戶列表:<span
style="font-size: 16px;color: red">{{pagination.total}}</span>條結(jié)果
</p>
<el-table
:data="tableData"
border
stripe
style="width: 100%">
<el-table-column prop="id" label="ID"></el-table-column>
<el-table-column prop="name" label="賬號"></el-table-column>
<el-table-column prop="uuid" label="UUID"></el-table-column>
<el-table-column prop="reg_time" label="注冊時間">
<template scope="scope">
{{scope.row.reg_time}}
</template>
</el-table-column>
<el-table-column label="注冊版本">
<template scope="scope">
{{scope.row.channel}}_{{scope.row.edition}}_{{scope.row.app_version}}
</template>
</el-table-column>
<el-table-column prop="last_login_time" label="登錄時間">
<template scope="scope">
{{scope.row.last_login_time}}
</template>
</el-table-column>
<el-table-column prop="app_channel" label="登錄版本"></el-table-column>
<el-table-column prop="expiration" label="到期時間"></el-table-column>
<el-table-column prop="total_amount" label="充值金額"></el-table-column>
<el-table-column prop="status" label="用戶狀態(tài)">
<template scope="scope">
<el-tag :type="scope.row.status === 1 ? 'success' : 'primary'"
close-transition>{{scope.row.status === 1 ? '正常' : '封號'}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="date" label="詳情" width="80" fixed="right">
<template scope="scope">
<el-button size="small" @click="detail(scope.row)">詳情</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@current-change="handleCurrentChange"
:current-page="pagination.currentPage"
layout="total, prev, pager, next, jumper"
:page-size="pagination.pageSize"
:total="pagination.total"
class="page">
</el-pagination>
</div>
</div>
</template>
<script>
import { monthTimes } from '@/utils/index'
import * as API from 'api/userlist'
export default {
data() {
return {
userCount: {},
initDate: {
start: '',
end: ''
},
filter: {
useAccount: '',
status: '',
channel: '',
edition: '',
dateType: '',
startTime: '',
endTime: '',
userType: 'name',
keyword: ''
},
tableData: [],
pagination: {
pageSize: 15,
currentPage: 1,
total: 0
}
}
},
methods: {
refUserCount() {
this._getUserListAccountTotal()
},
getChildData(val) {
this.initDate = val
},
cutoverVersion(val) {
this.filter.edition = val
},
cutoverChannel(val) {
this.filter.channel = val
},
Inquire() {
this._getUserListAccountList()
},
handleCurrentChange(val) {
this.pagination.currentPage = val
this._getUserListAccountList()
},
detail(row) {
console.log(row)
},
_getUserListAccountTotal() {
API.fetchUserListAccountTotal().then(res => {
if (res.data.status === 'success') {
this.userCount = Object.assign({}, res.data.data)
}
})
},
_getUserListAccountList() {
if (!this.filter.keyword) {
this.filter.userType = ''
}
API.fetchUserListAccountList(this.filter).then(res => {
if (res.data.status === 'success') {
this.tableData = res.data.data.data
this.pagination.total = res.data.data.total
this.filter.userType = 'name'
}
})
}
},
mounted() {
console.log(this.filter)
this.initDate = monthTimes()
this._getUserListAccountTotal()
this._getUserListAccountList()
}
}
</script>我在這里定義一個變量options,之前的的傳參是直接傳this.filter,現(xiàn)在傳options后就可以了,不知道為什么是這里的問題
const options = Object.assign({}, this.filter)
API.fetchUserListAccountList(options).then(res => {
if (res.data.status === 'success') {
this.tableData = res.data.data.data
this.pagination.total = res.data.data.total
this.filter.userType = 'name'
}
})北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。