|
@@ -23,35 +23,24 @@
|
|
|
: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.sys_client_edit"
|
|
|
- icon="el-icon-check"
|
|
|
- size="mini"
|
|
|
- plain
|
|
|
- @click="handleEdit(scope.row,scope.index)">编辑
|
|
|
- </el-button>
|
|
|
- <el-button type="text"
|
|
|
- v-if="permissions.sys_client_del"
|
|
|
- icon="el-icon-delete"
|
|
|
- size="mini"
|
|
|
- plain
|
|
|
- @click="handleDel(scope.row,scope.index)">删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
+ @row-del="handleDelete">
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {addObj, delObj, fetchList, putObj} from '@/api/admin/client'
|
|
|
+ import {
|
|
|
+ addObj,
|
|
|
+ delObj,
|
|
|
+ fetchList,
|
|
|
+ putObj
|
|
|
+ } from '@/api/admin/client'
|
|
|
import {tableOption} from '@/const/crud/admin/client'
|
|
|
import {mapGetters} from 'vuex'
|
|
|
|
|
@@ -74,7 +63,14 @@
|
|
|
mounted: function () {
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['permissions'])
|
|
|
+ ...mapGetters(['permissions']),
|
|
|
+ permissionList() {
|
|
|
+ return {
|
|
|
+ addBtn: this.vaildData(this.permissions.sys_client_add, false),
|
|
|
+ delBtn: this.vaildData(this.permissions.sys_client_del, false),
|
|
|
+ editBtn: this.vaildData(this.permissions.sys_client_edit, false)
|
|
|
+ };
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
getList(page, params) {
|
|
@@ -88,21 +84,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) {
|
|
|
+ handleDelete: function (row, index) {
|
|
|
var _this = this
|
|
|
this.$confirm('是否确认删除ID为' + row.clientId, '提示', {
|
|
|
confirmButtonText: '确定',
|