更改访问
This commit is contained in:
@@ -33,7 +33,6 @@ import { ref, reactive, toRefs, nextTick } from 'vue';
|
||||
import { ElMessage, type FormInstance, type FormRules } from 'element-plus';
|
||||
import Editor from '/@/components/editor/index.vue';
|
||||
import { getscriptAdd, updatescript } from '/@/api/customerService/script';
|
||||
import { Session } from '/@/utils/storage';
|
||||
// console.log(Session.get('userInfo').userNickname, 'user');
|
||||
|
||||
// 定义类型接口
|
||||
@@ -49,6 +48,7 @@ interface DialogRow {
|
||||
tag: string;
|
||||
creator: string;
|
||||
content: string;
|
||||
modifier: '';
|
||||
}
|
||||
|
||||
// 定义事件
|
||||
@@ -134,14 +134,11 @@ const onSubmit = async () => {
|
||||
state.loading = true;
|
||||
|
||||
if (state.formData.id === 0) {
|
||||
state.formData.creator = Session.get('userInfo').userNickname;
|
||||
|
||||
// 新增模式
|
||||
await getscriptAdd(state.formData);
|
||||
console.log(state.formData);
|
||||
ElMessage.success('添加成功');
|
||||
} else {
|
||||
state.formData.modifier = Session.get('userInfo').userNickname;
|
||||
// 编辑模式
|
||||
await updatescript(state.formData);
|
||||
ElMessage.success('修改成功');
|
||||
@@ -170,6 +167,7 @@ const resetForm = () => {
|
||||
tag: '',
|
||||
content: '',
|
||||
creator: '',
|
||||
modifier: '',
|
||||
};
|
||||
|
||||
// 重置表单验证状态
|
||||
|
||||
Reference in New Issue
Block a user