This commit is contained in:
曹前明 2022-07-18 11:16:32 +08:00
parent 5d492ff497
commit 21434b4ef8
4 changed files with 34 additions and 20 deletions

View File

@ -310,7 +310,7 @@ export default {
this.$emit("dataChange", res, this.tableData);
} catch (error) {
this.loading = false;
if(error.response.data){
if(error.response && error.response.data){
this.emptyText = error.response.data.err_msg;
}else{
this.emptyText = error.statusText || "数据格式错误";

View File

@ -2,6 +2,9 @@ import tool from '@/utils/tool';
export function permission(data) {
let permissions = tool.data.get("PERMISSIONS");
if (permissions.indexOf('superuser')>-1){
return true
}
if(!permissions){
return false;
}

View File

@ -2,34 +2,37 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-refresh" @click="syncData"
<el-button type="primary" icon="el-icon-refresh" @click="syncData" :syncLoading="syncLoading"
>同步</el-button
>
</div>
<div class="right-panel">
<el-input
v-model="search.keyword"
<!-- <el-input
v-model="query.code"
placeholder="编号"
clearable
@click="upsearch"
@click="handleQuery"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
@click="handleQuery"
></el-button> -->
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
:pageStr="pageStr"
:pageSizeStr="pageSizeStr"
:parseData="parseData"
row-key="id"
@selection-change="selectionChange"
stripe
@resetQuery="resetQuery"
>
<el-table-column type="selection" width="50"></el-table-column>
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column
label="喇叭名称"
@ -46,14 +49,14 @@
<el-table-column
label="设备sn"
prop="sn"
min-width="90"
min-width="150"
></el-table-column>
<el-table-column label="ip" prop="extra" min-width="90">
<template #default="scope">
<span v-if="scope.row.extra">{{ scope.row.extra.ip }}</span>
</template>
</el-table-column>
<el-table-column label="状态" prop="extra" min-width="90">
<el-table-column label="在线状态" prop="extra" min-width="90">
<template #default="scope">
<span v-if="scope.row.extra">{{ scope.row.extra.online }}</span>
</template>
@ -105,6 +108,15 @@ export default {
return {
syncLoading: false,
apiObj: this.$API.am.tdevice.speaker,
pageStr: "page",
pageSizeStr: "pageSize",
parseData: (res) => {
return {
data: res, //
rows: res.rows, //
total: res.total, //
};
},
dialogSave: false,
limitedVisible: false,
query: {},
@ -128,7 +140,9 @@ export default {
},
//
upsearch() {},
handleQuery() {
this.$refs.table.refresh();
},
resetQuery() {
this.query = {};

View File

@ -11,17 +11,17 @@
>
</div>
<div class="right-panel">
<el-input
v-model="search.keyword"
<!-- <el-input
v-model="query.channelCode"
placeholder="编号"
clearable
@click="upsearch"
@click="handleQuery"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
@click="handleQuery"
></el-button> -->
</div>
</el-header>
<el-main class="nopadding">
@ -151,9 +151,6 @@ export default {
syncLoading: false,
query: {},
selection: [],
search: {
keyword: null,
},
channelId: "",
params: {
json: {
@ -246,7 +243,7 @@ export default {
},
//
upsearch() {},
handleQuery() {this.$refs.table.refresh();},
resetQuery() {
this.query = {};