设备管理

This commit is contained in:
liuye
2022-06-28 11:53:49 +08:00
parent 09cced8bc3
commit 7ae4e92a93
2 changed files with 36 additions and 32 deletions

View File

@@ -4,7 +4,7 @@
<ai-search-bar bottomBorder> <ai-search-bar bottomBorder>
<template #left> <template #left>
<el-button type="primary" icon="iconfont iconAdd" size="small" @click="add('添加设备', {})">添加</el-button> <el-button type="primary" icon="iconfont iconAdd" size="small" @click="add('添加设备', {})">添加</el-button>
<el-button icon="el-icon-delete" class="delete-btn del-btn-list" :disabled="!Boolean(ids.length)" @click="remove(ids)">删除</el-button> <el-button icon="el-icon-delete" class="delete-btn del-btn-list" :disabled="!ids.length" @click="remove(ids)">删除</el-button>
</template> </template>
</ai-search-bar> </ai-search-bar>
<ai-table <ai-table
@@ -15,7 +15,8 @@
style="margin-top: 16px;" style="margin-top: 16px;"
:current.sync="search.current" :current.sync="search.current"
:size.sync="search.size" :size.sync="search.size"
@getList="getList"> @getList="getList"
@selection-change="v=>ids=v.map(e=>e.id)">
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center"> <el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div class="table-options"> <div class="table-options">
@@ -104,20 +105,20 @@
}, },
rules() { rules() {
return { return {
corpId: [{required: true, message: "请输入租户id"}], corpId: [{required: true, message: "请输入CorpId"}],
} }
}, },
colConfigs() { colConfigs() {
return [ return [
{type: "selection"}, {type: "selection"},
{ prop: 'corpId', label: '租户id' }, { prop: 'corpId', label: 'CorpId' },
{ prop: 'flag', align: 'center', label: '中移账号开启状态' }, { prop: 'flag', align: 'center', label: '状态' },
{ prop: 'appId', align: 'center', label: '中移账号appid' }, { prop: 'appId', align: 'center', label: 'AppId' },
{ prop: 'rsa', align: 'center', label: '中移账号rsa' }, { prop: 'rsa', align: 'center', label: 'RSA' },
{ prop: 'secret', align: 'center', label: '中移账号secret' }, { prop: 'secret', align: 'center', label: 'SECRET' },
{ prop: 'token', align: 'center', label: 'TOKEN信息' }, { prop: 'token', align: 'center', label: 'TOKEN' },
{ prop: 'orgIds', align: 'center', label: '中移组织结构结点ids' }, { prop: 'orgIds', align: 'center', label: '结点ids' },
{ prop: 'version', align: 'center', label: '中移账号版本号' }, { prop: 'version', align: 'center', label: '版本号' },
{ prop: 'dlbName', align: 'center', label: '大喇叭账号' }, { prop: 'dlbName', align: 'center', label: '大喇叭账号' },
{ prop: 'dlbPwd', align: 'center', label: '大喇叭密码' }, { prop: 'dlbPwd', align: 'center', label: '大喇叭密码' },
{ prop: 'dlbToken', align: 'center', label: '大喇叭Token' }, { prop: 'dlbToken', align: 'center', label: '大喇叭Token' },
@@ -139,6 +140,7 @@
this.instance.post(`/app/appzyaccountconfig/list`, null, { this.instance.post(`/app/appzyaccountconfig/list`, null, {
params: { params: {
...this.search, ...this.search,
type: 0
} }
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
@@ -174,7 +176,7 @@
addForm() { addForm() {
this.$refs.addForm.validate((valid) => { this.$refs.addForm.validate((valid) => {
if (valid) { if (valid) {
this.dialogForm.type = 1 this.dialogForm.type = 0
this.instance.post(`/app/appzyaccountconfig/addOrUpdate`, this.dialogForm).then((res) => { this.instance.post(`/app/appzyaccountconfig/addOrUpdate`, this.dialogForm).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success(`${this.dialogForm.id ? '编辑成功' : '添加成功'}`) this.$message.success(`${this.dialogForm.id ? '编辑成功' : '添加成功'}`)
@@ -187,14 +189,14 @@
} }
}); });
}, },
refresh() { refresh(row) {
this.$confirm('确定刷新该数据token').then(() => { this.$confirm('确定刷新该数据token').then(() => {
// this.instance.post(`/app/appzyaccountconfig/delete`).then(res => { this.instance.post(`/app/appzyaccountconfig/refresh?id=${row.id}`).then(res => {
// if (res.code == 0) { if (res.code == 0) {
// this.$message.success('刷新成功!') this.$message.success('刷新成功!')
// this.getList() this.getList()
// } }
// }) })
}) })
}, },
} }

View File

@@ -15,7 +15,8 @@
style="margin-top: 16px;" style="margin-top: 16px;"
:current.sync="search.current" :current.sync="search.current"
:size.sync="search.size" :size.sync="search.size"
@getList="getList"> @getList="getList"
@selection-change="v=>ids=v.map(e=>e.id)">
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center"> <el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div class="table-options"> <div class="table-options">
@@ -101,11 +102,11 @@
colConfigs() { colConfigs() {
return [ return [
{type: "selection"}, {type: "selection"},
{ prop: 'corpId', label: '租户id' }, { prop: 'corpId', label: 'CorpId' },
{ prop: 'flag', align: 'center', label: '视联网账号开启状态' }, { prop: 'flag', align: 'center', label: '状态' },
{ prop: 'slwAreaId', align: 'center', label: '视联网地区ID' }, { prop: 'slwUserId', align: 'center', label: '用户ID' },
{ prop: 'slwUserId', align: 'center', label: '视联网用户ID' }, { prop: 'slwAreaId', align: 'center', label: '地区编码' },
{ prop: 'slwToken', align: 'center', label: '视联网TOKEN' }, { prop: 'slwToken', align: 'center', label: 'TOKEN' },
{ prop: 'dlbName', align: 'center', label: '大喇叭账号' }, { prop: 'dlbName', align: 'center', label: '大喇叭账号' },
{ prop: 'dlbPwd', align: 'center', label: '大喇叭密码' }, { prop: 'dlbPwd', align: 'center', label: '大喇叭密码' },
{ prop: 'dlbToken', align: 'center', label: '大喇叭Token' }, { prop: 'dlbToken', align: 'center', label: '大喇叭Token' },
@@ -127,6 +128,7 @@
this.instance.post(`/app/appzyaccountconfig/list`, null, { this.instance.post(`/app/appzyaccountconfig/list`, null, {
params: { params: {
...this.search, ...this.search,
type: 1
} }
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
@@ -175,14 +177,14 @@
} }
}); });
}, },
refresh() { refresh(row) {
this.$confirm('确定刷新该数据token').then(() => { this.$confirm('确定刷新该数据token').then(() => {
// this.instance.post(`/app/appzyaccountconfig/delete`).then(res => { this.instance.post(`/app/appzyaccountconfig/refresh?id=${row.id}`).then(res => {
// if (res.code == 0) { if (res.code == 0) {
// this.$message.success('刷新成功!') this.$message.success('刷新成功!')
// this.getList() this.getList()
// } }
// }) })
}) })
}, },
} }