diff --git a/package.json b/package.json
index 064181303..3cbcc3ff3 100644
--- a/package.json
+++ b/package.json
@@ -38,6 +38,7 @@
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"vue": "2.6.10",
+ "vue-cookie": "^1.1.4",
"vue-i18n": "^8.15.5",
"vue-router": "3.0.6",
"vue-select": "^3.9.5",
diff --git a/src/components/AutoDataTable/index.vue b/src/components/AutoDataTable/index.vue
new file mode 100644
index 000000000..aeaf523b6
--- /dev/null
+++ b/src/components/AutoDataTable/index.vue
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
diff --git a/src/components/DataTable/compenents/el-data-table/el-data-table.vue b/src/components/DataTable/compenents/el-data-table/el-data-table.vue
index 14d4c33d5..74d78fd45 100644
--- a/src/components/DataTable/compenents/el-data-table/el-data-table.vue
+++ b/src/components/DataTable/compenents/el-data-table/el-data-table.vue
@@ -103,6 +103,7 @@
:key="row.id"
:table-data="data"
:row="row"
+ :url="url"
:reload="getList"
:col="col"
:cell-value="row[col.prop]"
diff --git a/src/components/ListTable/formatters/ActionsFormatter.vue b/src/components/ListTable/formatters/ActionsFormatter.vue
index f116edf7b..56c6a4e36 100644
--- a/src/components/ListTable/formatters/ActionsFormatter.vue
+++ b/src/components/ListTable/formatters/ActionsFormatter.vue
@@ -8,7 +8,7 @@ import BaseFormatter from './base'
const defaultPerformDelete = function({ row, col }) {
const id = row.id
- const url = `/api/v1/users/groups/${id}/`
+ const url = `${this.url}${id}/`
return this.$axios.delete(url)
}
const defaultUpdateCallback = function({ row, col }) {
@@ -56,16 +56,16 @@ export default {
name: 'update',
title: this.$tc('Update'),
type: 'primary',
- has: colActions.hasUpdate || true,
- can: colActions.canUpdate || true,
+ has: colActions.hasUpdate !== false,
+ can: colActions.canUpdate !== false,
callback: colActions.onUpdate || defaultUpdateCallback.bind(this)
},
{
name: 'delete',
title: this.$tc('Delete'),
type: 'danger',
- has: colActions.hasDelete || true,
- can: colActions.canDelete || true,
+ has: colActions.hasDelete !== false,
+ can: colActions.canDelete !== false,
callback: colActions.onDelete || defaultDeleteCallback.bind(this)
}
]
diff --git a/src/components/ListTable/formatters/base.vue b/src/components/ListTable/formatters/base.vue
index 0510045c1..17a47d822 100644
--- a/src/components/ListTable/formatters/base.vue
+++ b/src/components/ListTable/formatters/base.vue
@@ -25,6 +25,10 @@ export default {
tableData: {
type: Array,
default: () => ({})
+ },
+ url: {
+ type: String,
+ default: ''
}
}
}
diff --git a/src/components/ListTable/formatters/index.js b/src/components/ListTable/formatters/index.js
index 1721ab078..00b5c18fc 100644
--- a/src/components/ListTable/formatters/index.js
+++ b/src/components/ListTable/formatters/index.js
@@ -1,5 +1,5 @@
export { default as DetailFormatter } from './DetailFormatter'
export { default as DisplayFormatter } from './DisplayFormatter'
-export { default as ChoicesFormatter } from './ChoicesFormatter'
+export { default as BooleanFormatter } from './ChoicesFormatter'
export { default as ActionsFormatter } from './ActionsFormatter'
diff --git a/src/components/ListTable/index.vue b/src/components/ListTable/index.vue
index 06be59438..a88458c03 100644
--- a/src/components/ListTable/index.vue
+++ b/src/components/ListTable/index.vue
@@ -2,7 +2,7 @@