123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <template>
- <v-container fluid>
- <CommonQueryCard :query-model="queryModel" v-on:searchDone="search" :col="4"></CommonQueryCard>
- <v-card style="margin-top: 15px" tile>
- <v-card-title>设备
- <v-spacer></v-spacer>
- <!-- <v-btn @click="addOpen" elevation="0" tile dark color="primary" class="mr-2">-->
- <!-- <v-icon left>-->
- <!-- mdi-plus-->
- <!-- </v-icon>-->
- <!-- 新增-->
- <!-- </v-btn>-->
- <v-btn icon slot="widget-header-action" @click="search(null)">
- <v-icon class="text--secondary">mdi-refresh</v-icon>
- </v-btn>
- </v-card-title>
- <v-divider/>
- <v-data-table
- :headers="headers"
- :items="desserts"
- loading-text="加载中..."
- :loading="loading"
- class="elevation-1"
- :items-per-page="50"
- >
- <template v-slot:item.account="{ item }">
- {{ item.accountObj.username }}[{{ item.accountObj.name }}]
- </template>
- <template v-slot:item.deviceName="{ item }">
- {{ item.deviceBrand }}
- </template>
- <template v-slot:item.option="{item}">
- <v-btn elevation="0" tile @click="unBoundingDialogOpen(item)" dark color="red" class="mr-2">
- <v-icon left>
- mdi-alert-remove
- </v-icon>
- 解绑
- </v-btn>
- </template>
- </v-data-table>
- </v-card>
- <CommonDialog
- title="确认解绑设备?"
- ref="unBoundingDialog"
- v-on:done="unBoundingDone"
- ></CommonDialog>
- <!-- <RoleAuthDialog v-on:done="search" :roles="roles" :user="currentUser" ref="roleDialog"></permissionAuthDialog>-->
- </v-container>
- </template>
- <script>
- // import RoleAuthDialog from '../../components/dialog/permissionAuthDialog'
- // import CommonForm from '../../components/dialog/CommonForm'
- import CommonDialog from '../../components/dialog/CommonDialog'
- import request from '../../axios/request'
- import CommonQueryCard from '../../components/dialog/CommonQueryCard.vue'
- import Device from '../../data/system/device/Device'
- export default {
- name: 'Device',
- components: {
- CommonQueryCard,
- // RoleAuthDialog,
- CommonDialog
- },
- data () {
- return {
- show: false,
- headers: [
- {
- text: 'uuid',
- align: 'center',
- sortable: false,
- value: 'uuid'
- },
- {
- text: '所属用户',
- align: 'center',
- sortable: false,
- value: 'account'
- },
- {
- text: '手机型号',
- align: 'center',
- sortable: false,
- value: 'deviceName'
- },
- {
- text: 'IMEI标识',
- align: 'center',
- sortable: false,
- value: 'androidId'
- },
- {
- text: '注册时间',
- align: 'center',
- sortable: false,
- value: 'registerAt'
- },
- {
- text: '操作',
- align: 'center',
- sortable: false,
- value: 'option'
- }
- ],
- desserts: [],
- loading: true,
- query: {
- username: ''
- },
- temp: null,
- type: 'add',
- formModel: [
- {
- code: 'packageName',
- name: '包名',
- formType: 'text',
- value: '',
- notNull: true,
- option: [],
- col: 6
- },
- {
- code: 'name',
- name: 'App名称',
- formType: 'text',
- value: '',
- notNull: true,
- option: [],
- col: 6
- },
- {
- code: 'supportVersion',
- name: '支持版本',
- formType: 'json',
- mode: 'text',
- value: '',
- notNull: true,
- option: [],
- col: 6
- }
- ],
- file: null,
- importLoading: false,
- queryModel: Device.queryModel
- }
- },
- methods: {
- unBoundingDialogOpen (item) {
- this.temp = item
- this.$refs.unBoundingDialog.show()
- },
- unBoundingDone () {
- request({
- url: '/api/unBundleDevice/' + this.temp.uuid,
- method: 'get'
- })
- .then((resp) => {
- this.search(null)
- this.$refs.unBoundingDialog.close()
- })
- .catch((resp) => {
- })
- },
- search (params) {
- if (!this.$util.isNullOrUndefined(params)) {
- this.$util.replaceNull(params)
- this.query = params
- }
- this.loading = true
- request({
- url: '/device/search',
- method: 'get',
- params: {
- userId: this.query.username
- }
- })
- .then((resp) => {
- this.loading = false
- this.desserts = resp.data
- })
- .catch((resp) => {
- })
- }
- },
- created () {
- this.search()
- }
- }
- </script>
- <style scoped>
- </style>
|