用户权限调整
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import addGroup from '../components/addGroup'
|
||||
import { hasPermission } from '@/utils/limits.js'
|
||||
import { tbProductGroupGet, tbProductGroupDelete, tbProductGroupPut, upGroupSort } from '@/api/shop'
|
||||
export default {
|
||||
components: {
|
||||
@@ -92,12 +93,15 @@ export default {
|
||||
return a + ' - ' + ciri + b
|
||||
},
|
||||
//表格拖拽
|
||||
tableDrag() {
|
||||
async tableDrag() {
|
||||
|
||||
const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
||||
new Sortable(el, {
|
||||
animation: 150,
|
||||
onEnd: async e => {
|
||||
// console.log('拖拽结束===', e);
|
||||
let res = await hasPermission('允许修改分组');
|
||||
if ( !res) { return; }
|
||||
if (e.oldIndex == e.newIndex) return
|
||||
let oid = this.tableData.list[e.oldIndex].id
|
||||
let nid = this.tableData.list[e.newIndex].id
|
||||
@@ -117,6 +121,9 @@ export default {
|
||||
},
|
||||
// 状态切换
|
||||
async showChange(e, row) {
|
||||
let res = await hasPermission('允许修改分组');
|
||||
if ( !res) { row.isShow = (e == 0 ? 1 : 0);return; }
|
||||
|
||||
try {
|
||||
await tbProductGroupPut(row)
|
||||
this.getTableData()
|
||||
@@ -136,6 +143,8 @@ export default {
|
||||
},
|
||||
// 删除
|
||||
async delHandle(ids) {
|
||||
let res = await hasPermission('允许修改分组');
|
||||
if ( !res) { return; }
|
||||
try {
|
||||
await tbProductGroupDelete(ids)
|
||||
this.$notify({
|
||||
|
||||
Reference in New Issue
Block a user