mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
优化
This commit is contained in:
parent
69180cbf6b
commit
9bed5f3183
@ -114,7 +114,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { Plus, Setting } from "@element-plus/icons-vue";
|
||||
import { marked } from "marked";
|
||||
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 Form = useForm();
|
||||
@ -190,8 +190,14 @@ function toSet(item: Eps.PluginInfoEntity) {
|
||||
|
||||
on: {
|
||||
submit(data, { done, close }) {
|
||||
try {
|
||||
const config = JSON.parse(data.config);
|
||||
|
||||
service.plugin.info
|
||||
.update(data)
|
||||
.update({
|
||||
...data,
|
||||
config
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage.success("修改成功");
|
||||
merge(item, data);
|
||||
@ -201,6 +207,10 @@ function toSet(item: Eps.PluginInfoEntity) {
|
||||
ElMessage.error(err.message);
|
||||
done();
|
||||
});
|
||||
} catch (e) {
|
||||
ElMessage.error("参数格式错误,请检查");
|
||||
done();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user