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,17 +190,27 @@ function toSet(item: Eps.PluginInfoEntity) {
on: { on: {
submit(data, { done, close }) { submit(data, { done, close }) {
service.plugin.info try {
.update(data) const config = JSON.parse(data.config);
.then(() => {
ElMessage.success("修改成功"); service.plugin.info
merge(item, data); .update({
close(); ...data,
}) config
.catch((err) => { })
ElMessage.error(err.message); .then(() => {
done(); ElMessage.success("修改成功");
}); merge(item, data);
close();
})
.catch((err) => {
ElMessage.error(err.message);
done();
});
} catch (e) {
ElMessage.error("参数格式错误,请检查");
done();
}
} }
} }
}); });