|
@@ -14,17 +14,18 @@
|
|
* See the License for the specific language governing permissions and
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
* limitations under the License.
|
|
*/
|
|
*/
|
|
-import { ref, onMounted } from 'vue'
|
|
+import { ref, onMounted, computed } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
import { useI18n } from 'vue-i18n'
|
|
import { queryResourceList } from '@/service/modules/resources'
|
|
import { queryResourceList } from '@/service/modules/resources'
|
|
import { removeUselessChildren } from '@/utils/tree-format'
|
|
import { removeUselessChildren } from '@/utils/tree-format'
|
|
|
|
+import { useUdfs } from './use-udfs'
|
|
import type { IJsonItem } from '../types'
|
|
import type { IJsonItem } from '../types'
|
|
|
|
|
|
export function useSql(model: { [field: string]: any }): IJsonItem[] {
|
|
export function useSql(model: { [field: string]: any }): IJsonItem[] {
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
const options = ref([])
|
|
const options = ref([])
|
|
-
|
|
|
|
const loading = ref(false)
|
|
const loading = ref(false)
|
|
|
|
+ const hiveSpan = computed(() => (model.type === 'HIVE' ? 24 : 0))
|
|
|
|
|
|
const getResourceList = async () => {
|
|
const getResourceList = async () => {
|
|
if (loading.value) return
|
|
if (loading.value) return
|
|
@@ -40,6 +41,16 @@ export function useSql(model: { [field: string]: any }): IJsonItem[] {
|
|
})
|
|
})
|
|
|
|
|
|
return [
|
|
return [
|
|
|
|
+ {
|
|
|
|
+ type: 'input',
|
|
|
|
+ field: 'connParams',
|
|
|
|
+ name: t('project.node.sql_parameter'),
|
|
|
|
+ props: {
|
|
|
|
+ placeholder:
|
|
|
|
+ t('project.node.format_tips') + ' key1=value1;key2=value2...'
|
|
|
|
+ },
|
|
|
|
+ span: hiveSpan
|
|
|
|
+ },
|
|
{
|
|
{
|
|
type: 'editor',
|
|
type: 'editor',
|
|
field: 'sql',
|
|
field: 'sql',
|
|
@@ -50,6 +61,7 @@ export function useSql(model: { [field: string]: any }): IJsonItem[] {
|
|
message: t('project.node.sql_empty_tips')
|
|
message: t('project.node.sql_empty_tips')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ useUdfs(model),
|
|
{
|
|
{
|
|
type: 'tree-select',
|
|
type: 'tree-select',
|
|
field: 'resourceList',
|
|
field: 'resourceList',
|