This commit is contained in:
神仙都没用 2024-03-27 17:34:47 +08:00
parent 69180cbf6b
commit 9bed5f3183

View File

@ -114,7 +114,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import { Plus, Setting } from "@element-plus/icons-vue"; import { Plus, Setting } from "@element-plus/icons-vue";
import { marked } from "marked"; import { marked } from "marked";
import { useForm } from "@cool-vue/crud"; import { useForm } from "@cool-vue/crud";
import { merge, template } from "lodash-es"; import { isString, merge, template } from "lodash-es";
const { service, refs, setRefs } = useCool(); const { service, refs, setRefs } = useCool();
const Form = useForm(); const Form = useForm();
@ -190,8 +190,14 @@ function toSet(item: Eps.PluginInfoEntity) {
on: { on: {
submit(data, { done, close }) { submit(data, { done, close }) {
try {
const config = JSON.parse(data.config);
service.plugin.info service.plugin.info
.update(data) .update({
...data,
config
})
.then(() => { .then(() => {
ElMessage.success("修改成功"); ElMessage.success("修改成功");
merge(item, data); merge(item, data);
@ -201,6 +207,10 @@ function toSet(item: Eps.PluginInfoEntity) {
ElMessage.error(err.message); ElMessage.error(err.message);
done(); done();
}); });
} catch (e) {
ElMessage.error("参数格式错误,请检查");
done();
}
} }
} }
}); });