diff --git a/frontend/src/views/dataset/data/ViewTable.vue b/frontend/src/views/dataset/data/ViewTable.vue
index b78ea0c3d2..bc40625337 100644
--- a/frontend/src/views/dataset/data/ViewTable.vue
+++ b/frontend/src/views/dataset/data/ViewTable.vue
@@ -190,7 +190,7 @@
v-dialogDrag
:visible.sync="showExport"
width="600px"
- class="de-dialog-form"
+ class="de-dialog-form form-tree-cont"
:title="$t('dataset.export_dataset')"
append-to-body
>
@@ -216,11 +216,9 @@
:label="$t('dataset.export_filter')"
prop="expressionTree"
>
-
-
+
+
+
提示:最多支持导出10万条数据
@@ -251,6 +249,8 @@ import FieldEdit from './FieldEdit'
import { pluginLoaded } from '@/api/user'
import PluginCom from '@/views/system/plugin/PluginCom'
import UpdateRecords from './UpdateRecords'
+import rowAuth from './components/rowAuth.vue'
+
export default {
name: 'ViewTable',
components: {
@@ -259,8 +259,14 @@ export default {
UpdateInfo,
TabDataPreview,
UpdateRecords,
+ rowAuth,
PluginCom
},
+ provide() {
+ return {
+ filedList: () => this.filedList
+ }
+ },
props: {
param: {
type: Object,
@@ -273,6 +279,7 @@ export default {
name: ''
},
fields: [],
+ filedList: [],
data: [],
syncStatus: '',
lastRequestComplete: true,
@@ -289,8 +296,7 @@ export default {
isPluginLoaded: false,
showExport: false,
exportForm: {
- name: '',
- expressionTree: ''
+ name: ''
},
exportFormRules: {
name: [
@@ -345,6 +351,13 @@ export default {
this.initTable(this.param.id)
},
methods: {
+ fetchFiledList() {
+ this.filedList = []
+ post('dataset/field/listForPermissionSeting/' + this.param.id,
+ {}).then((res) => {
+ this.filedList = res.data
+ })
+ },
initTable(id) {
this.resetPage()
this.tableViewRowForm.row = 1000
@@ -455,8 +468,8 @@ export default {
exportDataset() {
this.showExport = true
+ this.fetchFiledList()
this.exportForm.name = this.table.name
- this.exportForm.expressionTree = ''
},
closeExport() {
this.showExport = false
@@ -467,7 +480,16 @@ export default {
if (this.table.id) {
this.table.row = 100000
this.table.filename = this.exportForm.name
- this.table.expressionTree = this.exportForm.expressionTree
+ const { logic, items, errorMessage } = this.$refs.rowAuth.submit()
+ if (errorMessage) {
+ this.$message({
+ message: errorMessage,
+ type: 'error',
+ showClose: true
+ })
+ return
+ }
+ this.table.expressionTree = JSON.stringify({ items, logic })
exportDataset(this.table).then((res) => {
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
@@ -488,7 +510,14 @@ export default {
}
-
+
+
diff --git a/frontend/src/views/dataset/data/components/rowAuth.vue b/frontend/src/views/dataset/data/components/rowAuth.vue
new file mode 100644
index 0000000000..e480e91405
--- /dev/null
+++ b/frontend/src/views/dataset/data/components/rowAuth.vue
@@ -0,0 +1,350 @@
+
+
+
del(idx)"
+ @addCondReal="addCondReal"
+ @removeRelationList="removeRelationList"
+ @changeAndOrDfs="(type) => changeAndOrDfs(relationList, type)"
+ />
+
+
+
+
+
+
+
+
diff --git a/frontend/src/views/dataset/data/components/rowAuthTree.vue b/frontend/src/views/dataset/data/components/rowAuthTree.vue
new file mode 100644
index 0000000000..d57c4dc971
--- /dev/null
+++ b/frontend/src/views/dataset/data/components/rowAuthTree.vue
@@ -0,0 +1,251 @@
+
+
+
+
+
+ {{ logic === 'or' ? "OR" : "AND" }}
+
+
+
+ {{ logic === 'or' ? "OR" : "AND" }}
+
+
+ AND
+ OR
+
+
+
+
+
+
+
+
+
+ del(idx, item.child)"
+ @addCondReal="(type, logic) => add(type, item.child, logic)"
+ @removeRelationList="removeRelationList(index)"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/views/dataset/data/options.js b/frontend/src/views/dataset/data/options.js
new file mode 100644
index 0000000000..36a1f426bc
--- /dev/null
+++ b/frontend/src/views/dataset/data/options.js
@@ -0,0 +1,24 @@
+function formatEnum(ele) {
+ return {
+ value: ele,
+ label: `chart.filter_${ele.replace(' ', '_')}`
+ }
+}
+
+const textEnum = ['eq', 'not_eq', 'like', 'not like', 'null', 'not_null', 'empty', 'not_empty']
+const textOptions = textEnum.map(formatEnum)
+
+const dateEnum = ['eq', 'not_eq', 'lt', 'gt', 'le', 'ge']
+const dateOptions = dateEnum.map(formatEnum)
+
+const valueEnum = [...dateEnum]
+const valueOptions = valueEnum.map(formatEnum)
+
+const fieldEnum = ['text', 'time', 'value', 'value', '', 'location']
+
+export {
+ textOptions,
+ dateOptions,
+ valueOptions,
+ fieldEnum
+}