perf: access 插件支持remote-select等配置

This commit is contained in:
xiaojunnuo
2026-02-09 14:45:56 +08:00
parent 99f5b8ebc1
commit d286c040a5
4 changed files with 37 additions and 17 deletions
@@ -10,6 +10,9 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
provide("get:plugin:type", () => { provide("get:plugin:type", () => {
return "access"; return "access";
}); });
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
const AccessTypeDictRef = dict({ const AccessTypeDictRef = dict({
url: "/pi/access/accessTypeDict", url: "/pi/access/accessTypeDict",
}); });
@@ -1,12 +1,11 @@
import { ColumnCompositionProps, compute, dict } from "@fast-crud/fast-crud"; import { ColumnCompositionProps, compute, dict } from "@fast-crud/fast-crud";
import { Modal } from "ant-design-vue";
import { forEach, get, merge, set } from "lodash-es";
import { computed, provide, ref, toRef } from "vue"; import { computed, provide, ref, toRef } from "vue";
import { useReference } from "/@/use/use-refrence"; import { useReference } from "/@/use/use-refrence";
import { forEach, get, merge, set } from "lodash-es";
import { Modal } from "ant-design-vue";
import { mitter } from "/@/utils/util.mitt"; import { mitter } from "/@/utils/util.mitt";
import { useI18n } from "/src/locales";
import * as pipelineApi from "/@/views/certd/pipeline/api";
import { getAddonTypeDefine } from "/@/views/certd/addon/api"; import { getAddonTypeDefine } from "/@/views/certd/addon/api";
import { useI18n } from "/src/locales";
export function addonProvide(api: any) { export function addonProvide(api: any) {
provide("addonApi", api); provide("addonApi", api);
@@ -30,6 +29,10 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
}, },
}; };
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
function buildDefineFields(define: any, form: any, mode: string) { function buildDefineFields(define: any, form: any, mode: string) {
const formWrapperRef = crudExpose.getFormWrapperRef(); const formWrapperRef = crudExpose.getFormWrapperRef();
const columnsRef = toRef(formWrapperRef.formOptions, "columns"); const columnsRef = toRef(formWrapperRef.formOptions, "columns");
@@ -26,6 +26,10 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
}, },
}; };
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
function buildDefineFields(define: any, form: any, mode: string) { function buildDefineFields(define: any, form: any, mode: string) {
const formWrapperRef = crudExpose.getFormWrapperRef(); const formWrapperRef = crudExpose.getFormWrapperRef();
const columnsRef = toRef(formWrapperRef.formOptions, "columns"); const columnsRef = toRef(formWrapperRef.formOptions, "columns");
@@ -22,9 +22,27 @@ export class AliossAccess extends BaseAccess {
@AccessInput({ @AccessInput({
title: "大区", title: "大区",
component: { component: {
name: "a-auto-complete", name: "remote-auto-complete",
vModel: "value", vModel: "value",
options: [ type: "access",
typeName: "alioss",
action: AliossAccess.prototype.onGetRegionList.name
},
required: true,
})
region!: string;
@AccessInput({
title: "Bucket",
helper: "存储桶名称",
required: true,
})
bucket!: string;
onGetRegionList(){
return {
list: [
{ value: "oss-cn-hangzhou", label: "华东1(杭州)" }, { value: "oss-cn-hangzhou", label: "华东1(杭州)" },
{ value: "oss-cn-shanghai", label: "华东2(上海)" }, { value: "oss-cn-shanghai", label: "华东2(上海)" },
{ value: "oss-cn-nanjing", label: "华东5(南京-本地地域)" }, { value: "oss-cn-nanjing", label: "华东5(南京-本地地域)" },
@@ -54,18 +72,10 @@ export class AliossAccess extends BaseAccess {
{ value: "oss-eu-west-1", label: "英国(伦敦)" }, { value: "oss-eu-west-1", label: "英国(伦敦)" },
{ value: "oss-me-east-1", label: "阿联酋(迪拜)①" }, { value: "oss-me-east-1", label: "阿联酋(迪拜)①" },
{ value: "oss-rg-china-mainland", label: "无地域属性(中国内地)" }, { value: "oss-rg-china-mainland", label: "无地域属性(中国内地)" },
], ]
}, }
required: true, }
})
region!: string;
@AccessInput({
title: "Bucket",
helper: "存储桶名称",
required: true,
})
bucket!: string;
} }
new AliossAccess(); new AliossAccess();