64 行
2.7 KiB
HTML
可执行文件
64 行
2.7 KiB
HTML
可执行文件
<!--[1.8.50]-->
|
|
<div id="agentPlug" v-cloak>
|
|
<el-table size="small" border :data="plugList" :header-cell-style="{background:'#F5F7FA',color:'#606266'}">
|
|
<el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
|
|
<el-table-column align="center" prop="plug_name" label="应用名称"></el-table-column>
|
|
<el-table-column align="center" prop="information" label="应用简介"></el-table-column>
|
|
<el-table-column align="center" prop="right" label="当前状态">
|
|
<template slot-scope="scope">
|
|
<el-switch
|
|
@change="changeStatus(scope.$index)"
|
|
:disabled="disabled"
|
|
v-model="scope.row.status"
|
|
:active-text="scope.row.status?'开启':'关闭'">
|
|
</el-switch>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<script>
|
|
var agentPlug = new Vue({
|
|
el: '#agentPlug',
|
|
data () {
|
|
return {
|
|
id: '',
|
|
plugList: {$plugList},
|
|
disabled: "$authArr['doChangePlug']" ? false : true
|
|
}
|
|
},
|
|
methods: {
|
|
changeStatus(index) {
|
|
let text = this.plugList[index].status == 1 ? '开启' : '关闭';
|
|
this.$confirm("确认" + text + "该应用吗?", "温馨提示", {
|
|
confirmButtonText: '确认',
|
|
cancelButtonText: '取消',
|
|
type: 'info'
|
|
}).then(() => {
|
|
this.sendRequest("{:U('doChangePlug')}", {
|
|
data: {
|
|
id: this.id,
|
|
p_id: this.plugList[index].id,
|
|
type: this.plugList[index].status ? 1 : 2,
|
|
identification: this.plugList[index].identification
|
|
},
|
|
success: (res) => {
|
|
if (res.status == 1) {
|
|
this.$message.success(res.message);
|
|
} else {
|
|
this.$message.error(res.message);
|
|
this.plugList[index].status = this.plugList[index].status ? false : true;
|
|
}
|
|
}
|
|
|
|
})
|
|
}).catch(() => {
|
|
this.plugList[index].status = this.plugList[index].status ? false : true;
|
|
})
|
|
}
|
|
},
|
|
created() {
|
|
this.id = MenuApp.getQueryVariable('id')
|
|
}
|
|
});
|
|
</script>
|