mirror of https://github.com/certd/certd
chore: 优化
parent
0f5b9564c6
commit
11d1f6e141
|
@ -40,5 +40,8 @@ export default {
|
||||||
return str.length > length ? str.slice(0, length) + "..." : str;
|
return str.length > length ? str.slice(0, length) + "..." : str;
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
},
|
||||||
|
transformLink(desc: string = "") {
|
||||||
|
return desc.replace(/\[(.*)\]\((.*)\)/g, '<a href="$2" target="_blank">$1</a>');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,6 +3,7 @@ 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 { forEach, get, merge, set } from "lodash-es";
|
||||||
import SecretPlainGetter from "/@/views/certd/access/access-selector/access/secret-plain-getter.vue";
|
import SecretPlainGetter from "/@/views/certd/access/access-selector/access/secret-plain-getter.vue";
|
||||||
|
import { utils } from "/@/utils";
|
||||||
|
|
||||||
export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||||
provide("accessApi", api);
|
provide("accessApi", api);
|
||||||
|
@ -117,13 +118,15 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||||
buildDefineFields(define, form, mode);
|
buildDefineFields(define, form, mode);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
helper: computed(() => {
|
helper: {
|
||||||
const define = currentDefine.value;
|
render: () => {
|
||||||
if (define == null) {
|
const define = currentDefine.value;
|
||||||
return "";
|
if (define == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return <div innerHTML={utils.transformLink(define.desc)}></div>;
|
||||||
}
|
}
|
||||||
return define.desc;
|
}
|
||||||
})
|
|
||||||
},
|
},
|
||||||
addForm: {
|
addForm: {
|
||||||
value: typeRef
|
value: typeRef
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<vip-button v-if="item.needPlus" mode="icon" />
|
<vip-button v-if="item.needPlus" mode="icon" />
|
||||||
</template>
|
</template>
|
||||||
<template #description>
|
<template #description>
|
||||||
<span :title="item.desc">{{ item.desc }}</span>
|
<span :title="item.desc" v-html="transformDesc(item.desc)"></span>
|
||||||
</template>
|
</template>
|
||||||
</a-card-meta>
|
</a-card-meta>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
@ -66,7 +66,11 @@
|
||||||
<pi-container v-else class="pi-step-form">
|
<pi-container v-else class="pi-step-form">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="mb-10">
|
<div class="mb-10">
|
||||||
<a-alert type="info" :message="currentPlugin.title" :description="currentPlugin.desc"> </a-alert>
|
<a-alert type="info" :message="currentPlugin.title">
|
||||||
|
<template #description>
|
||||||
|
<div v-html="transformDesc(currentPlugin.desc)"></div>
|
||||||
|
</template>
|
||||||
|
</a-alert>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="w-100 h-100">
|
<div class="w-100 h-100">
|
||||||
|
@ -114,6 +118,7 @@ import { useReference } from "/@/use/use-refrence";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/modules/settings";
|
||||||
import * as pluginApi from "../../../api.plugin";
|
import * as pluginApi from "../../../api.plugin";
|
||||||
import { mitter } from "/@/utils/util.mitt";
|
import { mitter } from "/@/utils/util.mitt";
|
||||||
|
import { utils } from "/@/utils";
|
||||||
export default {
|
export default {
|
||||||
name: "PiStepForm",
|
name: "PiStepForm",
|
||||||
// eslint-disable-next-line vue/no-unused-components
|
// eslint-disable-next-line vue/no-unused-components
|
||||||
|
@ -126,6 +131,10 @@ export default {
|
||||||
},
|
},
|
||||||
emits: ["update"],
|
emits: ["update"],
|
||||||
setup(props: any, context: any) {
|
setup(props: any, context: any) {
|
||||||
|
function transformDesc(desc: string = "") {
|
||||||
|
return utils.transformLink(desc);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* step drawer
|
* step drawer
|
||||||
* @returns
|
* @returns
|
||||||
|
@ -395,7 +404,8 @@ export default {
|
||||||
...useStepForm(),
|
...useStepForm(),
|
||||||
labelCol: { span: 6 },
|
labelCol: { span: 6 },
|
||||||
wrapperCol: { span: 16 },
|
wrapperCol: { span: 16 },
|
||||||
runStrategyProps
|
runStrategyProps,
|
||||||
|
transformDesc
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue