v auth
This commit is contained in:
parent
5d492ff497
commit
21434b4ef8
|
|
@ -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 || "数据格式错误";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = {};
|
||||
|
|
|
|||
|
|
@ -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 = {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue