mirror of https://github.com/certd/certd
chore:
parent
840a7b7c73
commit
59a6043549
|
@ -63,9 +63,12 @@
|
||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
"highlight.js": "^11.9.0",
|
"highlight.js": "^11.9.0",
|
||||||
"humanize-duration": "^3.27.3",
|
"humanize-duration": "^3.27.3",
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"lucide-vue-next": "^0.477.0",
|
"lucide-vue-next": "^0.477.0",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
|
"monaco-editor": "^0.52.2",
|
||||||
|
"monaco-yaml": "^5.3.1",
|
||||||
"nanoid": "^4.0.0",
|
"nanoid": "^4.0.0",
|
||||||
"node-forge": "^1.3.1",
|
"node-forge": "^1.3.1",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
|
@ -93,9 +96,7 @@
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"watermark-js-plus": "^1.5.8",
|
"watermark-js-plus": "^1.5.8",
|
||||||
"zod": "^3.24.2",
|
"zod": "^3.24.2",
|
||||||
"zod-defaults": "^0.1.3",
|
"zod-defaults": "^0.1.3"
|
||||||
"monaco-editor": "^0.52.2",
|
|
||||||
"monaco-yaml": "^5.3.1"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/lib-iframe": "^1.32.0",
|
"@certd/lib-iframe": "^1.32.0",
|
||||||
|
|
|
@ -40,11 +40,11 @@ const { buildFormOptions } = useColumns();
|
||||||
const passwordFormOptions: CrudOptions = {
|
const passwordFormOptions: CrudOptions = {
|
||||||
form: {
|
form: {
|
||||||
col: {
|
col: {
|
||||||
span: 24
|
span: 24,
|
||||||
},
|
},
|
||||||
wrapper: {
|
wrapper: {
|
||||||
title: "修改密码",
|
title: "修改密码",
|
||||||
width: "500px"
|
width: "500px",
|
||||||
},
|
},
|
||||||
async doSubmit({ form }) {
|
async doSubmit({ form }) {
|
||||||
await api.changePassword(form);
|
await api.changePassword(form);
|
||||||
|
@ -53,15 +53,15 @@ const passwordFormOptions: CrudOptions = {
|
||||||
},
|
},
|
||||||
async afterSubmit() {
|
async afterSubmit() {
|
||||||
notification.success({ message: "修改成功" });
|
notification.success({ message: "修改成功" });
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
columns: {
|
columns: {
|
||||||
password: {
|
password: {
|
||||||
title: "旧密码",
|
title: "旧密码",
|
||||||
type: "password",
|
type: "password",
|
||||||
form: {
|
form: {
|
||||||
rules: [{ required: true, message: "请输入旧密码" }]
|
rules: [{ required: true, message: "请输入旧密码" }],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
newPassword: {
|
newPassword: {
|
||||||
title: "新密码",
|
title: "新密码",
|
||||||
|
@ -70,9 +70,9 @@ const passwordFormOptions: CrudOptions = {
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: "请输入确认密码" },
|
{ required: true, message: "请输入确认密码" },
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
{ validator: validatePass1, trigger: "blur" }
|
{ validator: validatePass1, trigger: "blur" },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
confirmNewPassword: {
|
confirmNewPassword: {
|
||||||
title: "确认新密码",
|
title: "确认新密码",
|
||||||
|
@ -81,11 +81,11 @@ const passwordFormOptions: CrudOptions = {
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: "请输入确认密码" },
|
{ required: true, message: "请输入确认密码" },
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
{ validator: validatePass2, trigger: "blur" }
|
{ validator: validatePass2, trigger: "blur" },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
async function open(opts: { password: "" }) {
|
async function open(opts: { password: "" }) {
|
||||||
|
@ -93,13 +93,13 @@ async function open(opts: { password: "" }) {
|
||||||
formOptions.newInstance = true; //新实例打开
|
formOptions.newInstance = true; //新实例打开
|
||||||
passwordFormRef.value = await openDialog(formOptions);
|
passwordFormRef.value = await openDialog(formOptions);
|
||||||
passwordFormRef.value.setFormData({
|
passwordFormRef.value.setFormData({
|
||||||
password: opts.password
|
password: opts.password,
|
||||||
});
|
});
|
||||||
console.log(passwordFormRef.value);
|
console.log(passwordFormRef.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const scope = ref({
|
const scope = ref({
|
||||||
open: open
|
open: open,
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose(scope.value);
|
defineExpose(scope.value);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="inputs">
|
<div class="inputs">
|
||||||
<div class="inputs-inner">
|
<div class="inputs-inner">
|
||||||
<a-collapse v-model:active-key="activeKey">
|
<a-collapse v-model:active-key="activeKey">
|
||||||
<a-collapse-panel v-for="(item, index) in inputs" :key="index">
|
<a-collapse-panel v-for="(item, index) of inputs" :key="index">
|
||||||
<template #header> {{ item.key }} : {{ item.title }} </template>
|
<template #header> {{ item.key }} : {{ item.title }} </template>
|
||||||
<a-form :label-col="{ style: { width: '80px' } }">
|
<a-form :label-col="{ style: { width: '80px' } }">
|
||||||
<a-form-item label="字段名称">
|
<a-form-item label="字段名称">
|
||||||
|
@ -37,22 +37,62 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, Ref } from "vue";
|
import { ref, Ref, inject, toRef } from "vue";
|
||||||
|
import { useFormWrapper } from "@fast-crud/fast-crud";
|
||||||
|
|
||||||
const activeKey = ref([]);
|
const activeKey = ref([]);
|
||||||
const inputs: Ref = ref([]);
|
|
||||||
|
|
||||||
|
const getPlugin: any = inject("get:plugin");
|
||||||
|
const pluginRef = getPlugin();
|
||||||
|
const inputs = toRef(pluginRef.value.metadata, "input");
|
||||||
|
if (!inputs.value) {
|
||||||
|
inputs.value = {};
|
||||||
|
}
|
||||||
function addNewField() {
|
function addNewField() {
|
||||||
inputs.value.push({
|
const { openCrudFormDialog } = useFormWrapper();
|
||||||
key: "newInput",
|
|
||||||
title: "新字段",
|
openCrudFormDialog({
|
||||||
component: `
|
crudOptions: {
|
||||||
|
form: {
|
||||||
|
labelCol: { style: { width: "80px" } },
|
||||||
|
wrapperCol: { span: 18 },
|
||||||
|
wrapper: {
|
||||||
|
title: "添加输入",
|
||||||
|
},
|
||||||
|
doSubmit({ form }: any) {
|
||||||
|
debugger;
|
||||||
|
const key = form.key;
|
||||||
|
const title = form.title;
|
||||||
|
inputs.value[key] = {
|
||||||
|
key,
|
||||||
|
title,
|
||||||
|
component: `
|
||||||
name: a-input
|
name: a-input
|
||||||
|
|
||||||
`,
|
`,
|
||||||
helper: "",
|
helper: "",
|
||||||
value: undefined,
|
value: undefined,
|
||||||
required: false,
|
required: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columns: {
|
||||||
|
key: {
|
||||||
|
title: "字段名称",
|
||||||
|
type: "text",
|
||||||
|
form: {
|
||||||
|
helper: "英文字段名称",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
title: "字段标题",
|
||||||
|
type: "text",
|
||||||
|
form: {
|
||||||
|
helper: "字段标题",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
|
|
||||||
<div v-if="metadataActive === 'source'" class="metadata-source">
|
<div v-if="metadataActive === 'source'" class="metadata-source">
|
||||||
<fs-editor-code v-model="plugin.metadata" language="yaml"></fs-editor-code>
|
<fs-editor-code :model-value="metadataStr" language="yaml" @update:model-value="onMetadataStrUpdate"></fs-editor-code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,10 +39,12 @@
|
||||||
</fs-page>
|
</fs-page>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, watch } from "vue";
|
import { onMounted, ref, watch, provide } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
|
import yaml from "js-yaml";
|
||||||
import PluginInput from "/@/views/sys/plugin/components/plugin-input.vue";
|
import PluginInput from "/@/views/sys/plugin/components/plugin-input.vue";
|
||||||
|
import { merge } from "lodash-es";
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "SysPluginEdit",
|
name: "SysPluginEdit",
|
||||||
});
|
});
|
||||||
|
@ -50,15 +52,30 @@ const route = useRoute();
|
||||||
|
|
||||||
const plugin = ref<any>({});
|
const plugin = ref<any>({});
|
||||||
|
|
||||||
|
const metadataStr = ref("");
|
||||||
|
function onMetadataStrUpdate(value: string) {
|
||||||
|
metadataStr.value = value;
|
||||||
|
}
|
||||||
const metadataActive = ref("editor");
|
const metadataActive = ref("editor");
|
||||||
async function getPlugin() {
|
async function getPlugin() {
|
||||||
const id = route.query.id;
|
const id = route.query.id;
|
||||||
plugin.value = await api.GetObj(id);
|
const pluginObj = await api.GetObj(id);
|
||||||
|
if (!pluginObj.metadata) {
|
||||||
|
pluginObj.metadata = {
|
||||||
|
input: {},
|
||||||
|
output: {},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
plugin.value = pluginObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getPlugin();
|
await getPlugin();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
provide("get:plugin", () => {
|
||||||
|
return plugin;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
|
|
@ -1160,6 +1160,9 @@ importers:
|
||||||
humanize-duration:
|
humanize-duration:
|
||||||
specifier: ^3.27.3
|
specifier: ^3.27.3
|
||||||
version: 3.32.1
|
version: 3.32.1
|
||||||
|
js-yaml:
|
||||||
|
specifier: ^4.1.0
|
||||||
|
version: 4.1.0
|
||||||
lodash-es:
|
lodash-es:
|
||||||
specifier: ^4.17.21
|
specifier: ^4.17.21
|
||||||
version: 4.17.21
|
version: 4.17.21
|
||||||
|
|
Loading…
Reference in New Issue