设备配置

This commit is contained in:
刘仕伟
2022-06-28 18:18:43 +08:00
parent b117cf9d51
commit 84bf07717a
2 changed files with 40 additions and 2 deletions

View File

@@ -39,6 +39,12 @@
</div>
</template>
</el-table-column>
<el-table-column slot="flag" align="center" label="状态" width="100">
<template v-slot="{ row }">
<el-switch v-model="row.flag" @change="onChange(row)" active-value="1" inactive-value="0"
active-color="#5088FF" inactive-color="#D0D4DC"></el-switch>
</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">
@@ -126,7 +132,7 @@
return [
{type: "selection"},
{ prop: 'corpId', label: 'CorpId', fixed: 'left', width: 220 },
{ prop: 'flag', align: 'center', label: '状态', fixed: 'left', width: 120 },
{ slot: 'flag', align: 'center', label: '状态', fixed: 'left', width: 120 },
{ prop: 'appId', align: 'center', label: 'AppId', width: 240 },
{ prop: 'rsa', align: 'center', label: 'RSA', width: 240 },
{ prop: 'secret', align: 'center', label: 'SECRET', width: 180 },
@@ -213,6 +219,19 @@
})
})
},
onChange(row) {
this.instance.post(`/app/appzyaccountconfig/setFlag`, null, {
params: {
id: row.id,
flag: row.flag
}
}).then((res) => {
if (res.code == 0) {
this.$message.success(+row.flag ? '已启用' : '已禁用');
this.getList();
}
})
},
}
}
</script>

View File

@@ -39,6 +39,12 @@
</div>
</template>
</el-table-column>
<el-table-column slot="flag" align="center" label="状态" width="100">
<template v-slot="{ row }">
<el-switch v-model="row.flag" @change="onChange(row)" active-value="1" inactive-value="0"
active-color="#5088FF" inactive-color="#D0D4DC"></el-switch>
</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">
@@ -117,7 +123,7 @@
return [
{type: "selection"},
{ prop: 'corpId', label: 'CorpId', fixed: 'left', width: 220 },
{ prop: 'flag', align: 'center', label: '状态', fixed: 'left', width: 120 },
{ slot: 'flag', align: 'center', label: '状态', fixed: 'left', width: 120 },
{ prop: 'slwUserId', align: 'center', label: '用户ID', width: 180 },
{ prop: 'slwAreaId', align: 'center', label: '地区编码', width: 180 },
{ prop: 'slwToken', align: 'center', label: 'TOKEN', width: 220 },
@@ -200,6 +206,19 @@
})
})
},
onChange(row) {
this.instance.post(`/app/appzyaccountconfig/setFlag`, null, {
params: {
id: row.id,
flag: row.flag
}
}).then((res) => {
if (res.code == 0) {
this.$message.success(+row.flag ? '已启用' : '已禁用');
this.getList();
}
})
}
}
}
</script>