Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
贾志伟 committed Apr 8, 2024
1 parent 55c6b79 commit 1d1eaae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@easily-tools/mock-server-web",
"version": "1.0.1",
"version": "1.0.2",
"files": [
"dist"
],
Expand Down
5 changes: 5 additions & 0 deletions src/components/CodeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ onMounted(() => {
});
}
// 如果是ts,添加全员变量
if(props.language === 'typescript') {
monaco.languages.typescript.typescriptDefaults.addExtraLib(`declare const pathParams: string[];`);
}
// 数据绑定
monacoEditor.getModel()?.onDidChangeContent(() => {
const value = monacoEditor.getValue();
Expand Down
6 changes: 5 additions & 1 deletion src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const handleSearch = (param: any) => {
// 保存迭代期列表
const handleIterationListChange = async (list: string[]) => {
const res = await saveIterationList(list);
const res = await saveIterationList({list});
if (res.code !== 200) {
ElMessage.error(`${t('global.save')}${t('global.iteration')}: ${t('global.fail')}`);
}
Expand Down Expand Up @@ -203,6 +203,8 @@ const handleMockItemSceneOperation = async (operation: string, mockItemBasicInfo
name: t('global.sceneName'),
iteration: iterationList.value[0] ?? '',
param: '{\r\n \r\n}',
requestMethod: 'GET',
type: 'HTTP',
responseConf: 'export default (param: any) => {\r\n \r\n}',
};
isShowCodeEditor.value = true;
Expand Down Expand Up @@ -247,6 +249,7 @@ const handleMockItemSceneOperation = async (operation: string, mockItemBasicInfo
// 保存场景
const handleSaveSceneItem = async (isCloseCodeEditor = false) => {
console.log('some00000000', {...currentEditingSceneItem.value, mockItemId: currentEditingMockItemBaseInfo.value.id})
const res = await saveSceneItem({
...currentEditingSceneItem.value,
mockItemId: currentEditingMockItemBaseInfo.value.id,
Expand All @@ -255,6 +258,7 @@ const handleSaveSceneItem = async (isCloseCodeEditor = false) => {
ElMessage.success(`${t('global.save')}: ${t('global.success')}`);
const item = res.data.find((item: any) => item.id === currentEditingSceneItem.value.id);
if (item) {
console.log('some-----', res);
currentEditingSceneItem.value = item;
}
if (isCloseCodeEditor) {
Expand Down

0 comments on commit 1d1eaae

Please sign in to comment.