|
|
@@ -4,6 +4,7 @@
|
|
|
|
|
|
<script>
|
|
|
import MForm from '@/components/MForm'
|
|
|
+import { getDatasourceList } from '@/api/dataOrigin'
|
|
|
|
|
|
export default {
|
|
|
name: 'CreateOrderDialog',
|
|
|
@@ -26,7 +27,8 @@ export default {
|
|
|
extracted_domains: [],
|
|
|
extracted_fields: [],
|
|
|
extraction_purpose: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ dataSourceItems: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -48,11 +50,13 @@ export default {
|
|
|
hideDetails: 'auto'
|
|
|
},
|
|
|
{
|
|
|
- type: 'text',
|
|
|
+ type: 'autocomplete',
|
|
|
key: 'data_source',
|
|
|
- label: '输出数据源',
|
|
|
- outlined: true,
|
|
|
- dense: true
|
|
|
+ label: '请选择输出数据源',
|
|
|
+ noAttach: true,
|
|
|
+ itemText: 'name_zh',
|
|
|
+ itemValue: 'id',
|
|
|
+ items: this.dataSourceItems
|
|
|
},
|
|
|
{
|
|
|
type: 'textarea',
|
|
|
@@ -81,6 +85,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
+ this.init()
|
|
|
if (this.itemData && this.itemData.id) {
|
|
|
this.formValues = {
|
|
|
title: this.itemData.title || '',
|
|
|
@@ -93,6 +98,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ async init () {
|
|
|
+ try {
|
|
|
+ const { data } = await getDatasourceList({})
|
|
|
+ this.dataSourceItems = data.data_source
|
|
|
+ } catch (error) {
|
|
|
+ this.$snackbar.error(error)
|
|
|
+ }
|
|
|
+ },
|
|
|
getValue () {
|
|
|
if (!this.$refs.form.validate()) {
|
|
|
return
|