|
@@ -23,21 +23,10 @@
|
|
|
:data="tableData"
|
|
|
:table-loading="tableLoading"
|
|
|
:option="tableOption"
|
|
|
+ :permission="permissionList"
|
|
|
@on-load="getList"
|
|
|
@refresh-change="refreshChange"
|
|
|
- @row-update="handleUpdate"
|
|
|
- @row-save="handleSave"
|
|
|
- @row-del="rowDel">
|
|
|
- <template slot-scope="scope"
|
|
|
- slot="menu">
|
|
|
- <el-button type="text"
|
|
|
- v-if="permissions.daemon_execution_log_del"
|
|
|
- icon="el-icon-delete"
|
|
|
- size="small"
|
|
|
- plain
|
|
|
- @click="handleDel(scope.row,scope.index)">删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
+ @row-del="handleDel">
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
</div>
|
|
@@ -68,7 +57,12 @@
|
|
|
mounted: function () {
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['permissions'])
|
|
|
+ ...mapGetters(['permissions']),
|
|
|
+ permissionList() {
|
|
|
+ return {
|
|
|
+ delBtn: this.vaildData(this.permissions.daemon_execution_log_del, false),
|
|
|
+ };
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
getList(page, params = {}) {
|
|
@@ -83,21 +77,7 @@
|
|
|
this.tableLoading = false
|
|
|
})
|
|
|
},
|
|
|
- /**
|
|
|
- * @title 打开新增窗口
|
|
|
- * @detail 调用crud的handleadd方法即可
|
|
|
- *
|
|
|
- **/
|
|
|
- handleAdd: function () {
|
|
|
- this.$refs.crud.rowAdd()
|
|
|
- },
|
|
|
- handleEdit(row, index) {
|
|
|
- this.$refs.crud.rowEdit(row, index)
|
|
|
- },
|
|
|
- handleDel(row, index) {
|
|
|
- this.$refs.crud.rowDel(row, index)
|
|
|
- },
|
|
|
- rowDel: function (row, index) {
|
|
|
+ handleDel: function (row, index) {
|
|
|
var _this = this
|
|
|
this.$confirm('是否确认删除ID为' + row.id, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
@@ -116,43 +96,6 @@
|
|
|
}).catch(function (err) {
|
|
|
})
|
|
|
},
|
|
|
- /**
|
|
|
- * @title 数据更新
|
|
|
- * @param row 为当前的数据
|
|
|
- * @param index 为当前更新数据的行数
|
|
|
- * @param done 为表单关闭函数
|
|
|
- *
|
|
|
- **/
|
|
|
- handleUpdate: function (row, index, done) {
|
|
|
- putObj(row).then(data => {
|
|
|
- this.tableData.splice(index, 1, Object.assign({}, row))
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: '修改成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- done()
|
|
|
- this.getList(this.page)
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @title 数据添加
|
|
|
- * @param row 为当前的数据
|
|
|
- * @param done 为表单关闭函数
|
|
|
- *
|
|
|
- **/
|
|
|
- handleSave: function (row, done) {
|
|
|
- addObj(row).then(data => {
|
|
|
- this.tableData.push(Object.assign({}, row))
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: '添加成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- done()
|
|
|
- this.getList(this.page)
|
|
|
- })
|
|
|
- },
|
|
|
/**
|
|
|
* 刷新回调
|
|
|
*/
|