You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
773 B
33 lines
773 B
7 months ago
|
import { ref } from 'vue';
|
||
|
import { axios, Environment, Tools } from 'platform-core';
|
||
|
|
||
|
class UserDefinedFunctionsManager {
|
||
|
#functions: any;
|
||
|
|
||
|
constructor() {
|
||
|
this.#functions = ref([]);
|
||
|
}
|
||
|
|
||
|
public userDefinedFunctions(): any {
|
||
|
return this.#functions;
|
||
|
}
|
||
|
|
||
|
public load() {
|
||
|
// 获取自定义函数库中的函数
|
||
|
axios.get(Environment.apiContextPath('/api/re/function?pageable=false')).then((response) => {
|
||
|
const options: any[] = [];
|
||
|
const items: any[] = response.data?.content;
|
||
|
if (items && items.length > 0) {
|
||
|
items.forEach((item) => {
|
||
|
if (item.enable) {
|
||
|
options.push(item);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
this.#functions.value = options;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export { UserDefinedFunctionsManager };
|