2022-06-28 10:40:13 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<ai-list class="eyeList" isTabs>
|
|
|
|
|
|
<template slot="content">
|
|
|
|
|
|
<ai-search-bar bottomBorder>
|
|
|
|
|
|
<template #left>
|
|
|
|
|
|
<el-button type="primary" icon="iconfont iconAdd" size="small" @click="add('添加设备', {})">添加</el-button>
|
2022-06-28 11:53:49 +08:00
|
|
|
|
<el-button icon="el-icon-delete" class="delete-btn del-btn-list" :disabled="!ids.length" @click="remove(ids)">删除</el-button>
|
2022-06-28 10:40:13 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</ai-search-bar>
|
|
|
|
|
|
<ai-table
|
|
|
|
|
|
:tableData="tableData"
|
|
|
|
|
|
:col-configs="colConfigs"
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
|
style="margin-top: 16px;"
|
|
|
|
|
|
:current.sync="search.current"
|
|
|
|
|
|
:size.sync="search.size"
|
2022-06-28 11:53:49 +08:00
|
|
|
|
@getList="getList"
|
|
|
|
|
|
@selection-change="v=>ids=v.map(e=>e.id)">
|
2022-06-28 10:40:13 +08:00
|
|
|
|
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
|
|
|
|
|
|
<template slot-scope="{ row }">
|
|
|
|
|
|
<div class="table-options">
|
|
|
|
|
|
<el-button type="text" @click="edit('编辑设备', row)">编辑</el-button>
|
|
|
|
|
|
<el-button type="text" @click="refresh(row)">刷新</el-button>
|
|
|
|
|
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</ai-table>
|
|
|
|
|
|
<ai-dialog :title="dialogTitle" :visible.sync="dialog" width="800px" @onConfirm="addForm" @closed="dialogForm={}">
|
|
|
|
|
|
<el-form ref="addForm" :model="dialogForm" :rules="rules" size="small" label-width="160px">
|
|
|
|
|
|
<el-form-item label="租户id" prop="corpId">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.corpId" placeholder="请输入..." clearable :maxLength="50"/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item required label="中移账号开启状态">
|
|
|
|
|
|
<el-radio-group v-model="dialogForm.flag">
|
|
|
|
|
|
<el-radio :label="0">关闭</el-radio>
|
|
|
|
|
|
<el-radio :label="1">开启</el-radio>
|
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="中移账号appid">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.appId" placeholder="请输入..." clearable :maxLength="50" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="中移账号rsa">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.rsa" placeholder="请输入..." clearable :maxLength="500" type="textarea" :rows="5"/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="中移账号secret">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.secret" placeholder="请输入..." clearable :maxLength="50" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="TOKEN信息">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.token" placeholder="请输入..." clearable :maxLength="200" type="textarea" :rows="2"/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="中移组织结构结点ids">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.orgIds" placeholder="请输入..." clearable :maxLength="50" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="中移账号版本号">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.version" placeholder="请输入..." clearable :maxLength="50" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="大喇叭账号">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.dlbName" placeholder="请输入..." clearable :maxLength="50" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="大喇叭密码">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.dlbPwd" placeholder="请输入..." clearable :maxLength="50" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="大喇叭Token">
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.dlbToken" placeholder="请输入..." clearable :maxLength="50" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</ai-dialog>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</ai-list>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'eyeList',
|
|
|
|
|
|
props: {
|
|
|
|
|
|
instance: Function,
|
|
|
|
|
|
dict: Object,
|
|
|
|
|
|
areaId: String
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
search: {
|
|
|
|
|
|
current: 1,
|
|
|
|
|
|
size: 10,
|
|
|
|
|
|
},
|
|
|
|
|
|
ids: [],
|
|
|
|
|
|
tableData: [],
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
dialog: false,
|
|
|
|
|
|
dialogTitle: '',
|
|
|
|
|
|
dialogForm: {}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
...mapState(['user']),
|
|
|
|
|
|
|
|
|
|
|
|
param () {
|
|
|
|
|
|
return this.search
|
|
|
|
|
|
},
|
|
|
|
|
|
rules() {
|
|
|
|
|
|
return {
|
2022-06-28 11:53:49 +08:00
|
|
|
|
corpId: [{required: true, message: "请输入CorpId"}],
|
2022-06-28 10:40:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
colConfigs() {
|
|
|
|
|
|
return [
|
|
|
|
|
|
{type: "selection"},
|
2022-06-28 11:53:49 +08:00
|
|
|
|
{ prop: 'corpId', label: 'CorpId' },
|
|
|
|
|
|
{ prop: 'flag', align: 'center', label: '状态' },
|
|
|
|
|
|
{ prop: 'appId', align: 'center', label: 'AppId' },
|
|
|
|
|
|
{ prop: 'rsa', align: 'center', label: 'RSA' },
|
|
|
|
|
|
{ prop: 'secret', align: 'center', label: 'SECRET' },
|
|
|
|
|
|
{ prop: 'token', align: 'center', label: 'TOKEN' },
|
|
|
|
|
|
{ prop: 'orgIds', align: 'center', label: '结点ids' },
|
|
|
|
|
|
{ prop: 'version', align: 'center', label: '版本号' },
|
2022-06-28 10:40:13 +08:00
|
|
|
|
{ prop: 'dlbName', align: 'center', label: '大喇叭账号' },
|
|
|
|
|
|
{ prop: 'dlbPwd', align: 'center', label: '大喇叭密码' },
|
|
|
|
|
|
{ prop: 'dlbToken', align: 'center', label: '大喇叭Token' },
|
|
|
|
|
|
{ prop: 'createTime', align: 'center', label: '创建时间' },
|
|
|
|
|
|
{ slot: 'options'},
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
created () {
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
getListInit() {
|
|
|
|
|
|
this.search.current = 1
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
},
|
|
|
|
|
|
getList () {
|
|
|
|
|
|
this.instance.post(`/app/appzyaccountconfig/list`, null, {
|
|
|
|
|
|
params: {
|
|
|
|
|
|
...this.search,
|
2022-06-28 11:53:49 +08:00
|
|
|
|
type: 0
|
2022-06-28 10:40:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
|
this.tableData = res.data.records
|
|
|
|
|
|
this.total = res.data.total
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
remove(id) {
|
|
|
|
|
|
this.$confirm('确定删除该数据?').then(() => {
|
|
|
|
|
|
this.instance.post(`/app/appzyaccountconfig/delete?ids=${id}`).then(res => {
|
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
|
this.$message.success('删除成功!')
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
add(title, item) {
|
|
|
|
|
|
this.dialog = true
|
|
|
|
|
|
this.dialogTitle = title
|
|
|
|
|
|
this.dialogForm = item
|
|
|
|
|
|
if(title == '添加设备') {
|
|
|
|
|
|
this.dialogForm.flag = 1
|
|
|
|
|
|
this.dialogForm.version = '1.0.0'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
addForm() {
|
|
|
|
|
|
this.$refs.addForm.validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
2022-06-28 11:53:49 +08:00
|
|
|
|
this.dialogForm.type = 0
|
2022-06-28 10:40:13 +08:00
|
|
|
|
this.instance.post(`/app/appzyaccountconfig/addOrUpdate`, this.dialogForm).then((res) => {
|
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
|
this.$message.success(`${this.dialogForm.id ? '编辑成功' : '添加成功'}`)
|
|
|
|
|
|
this.getListInit()
|
|
|
|
|
|
this.dialog = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2022-06-28 11:53:49 +08:00
|
|
|
|
refresh(row) {
|
2022-06-28 10:40:13 +08:00
|
|
|
|
this.$confirm('确定刷新该数据token?').then(() => {
|
2022-06-28 11:53:49 +08:00
|
|
|
|
this.instance.post(`/app/appzyaccountconfig/refresh?id=${row.id}`).then(res => {
|
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
|
this.$message.success('刷新成功!')
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2022-06-28 10:40:13 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|