dataMeta.ts 1.06 KB
const useDataMetaStore = defineStore("dataMeta", () => {
  const guid: Ref<string> = ref("")
  const databaseName = ref("")
  const tableName = ref("")
  const databaseChName = ref("");
  const databaseGuid = ref('');
  const fieldGuid = ref("");
  const fieldEnName = ref('');
  const isFieldLineage = ref(false);
  const set = (prop?: {
    tableGuid: string;
    table: string;
    databas: string;
    databaseCh: string;
    dsGuid: string;
    fGuid?: string;
    fEnName?: string;
    isFieldLine?: boolean;
  }) => {
    guid.value = prop?.tableGuid || "";
    databaseName.value = prop?.databas || "";
    tableName.value = prop?.table || "";
    databaseChName.value = prop?.databaseCh || "";
    databaseGuid.value = prop?.dsGuid || "";
    fieldGuid.value = prop?.fGuid || "";
    fieldEnName.value = prop?.fEnName || "";
    isFieldLineage.value = prop?.isFieldLine ?? false;
  }
  return {
    guid,
    databaseName,
    tableName,
    databaseChName,
    databaseGuid,
    fieldGuid,
    fieldEnName,
    isFieldLineage,
    set
  }
})

export default useDataMetaStore