zhengyiming
5 天以前 52c17cc9efa1f8d1dda29faa9e1d2de7094682ed
fix: saveContractTemplateValues
1个文件已添加
2个文件已修改
12 ■■■■■ 已修改文件
src/fabric-editor/constants/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/fabric-editor/hooks/context.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/fabric-editor/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/fabric-editor/constants/index.ts
New file
@@ -0,0 +1,2 @@
export const CanvasWidth = 595;
export const CanvasHeight = 842;
src/fabric-editor/hooks/context.ts
@@ -12,6 +12,7 @@
  checkTemplateParamObjectListNotNull,
  convertJsonMapToTemplateParamObjectList,
} from '../utils';
import { CanvasHeight, CanvasWidth } from '../constants';
export interface TemplateDetailContext {
  templateDetail: Ref<API.GetContractTemplateQueryResult>;
@@ -186,8 +187,8 @@
              recorder: x.recorder,
              userType: x.userType,
              bindProperty: x.bindProperty,
              x: x.left,
              y: x.top,
              x: x.left / CanvasWidth,
              y: x.top / CanvasHeight,
              page: x.pageNum + 1,
            } as API.SaveContractTemplateValuesCommandItem)
        ),
src/fabric-editor/index.vue
@@ -72,6 +72,7 @@
import './plugin/fabric-history';
import { MyHistoryPlugin } from './plugin/MyHistoryPlugin';
import { TemplateParamExtensionKey } from './customObject';
import { CanvasHeight, CanvasWidth } from './constants';
const route = useRoute();
const id = (route.params.id as string) ?? '';
@@ -109,8 +110,8 @@
    controlsAboveOverlay: true, // 超出clipPath后仍然展示控制条
    // imageSmoothingEnabled: false, // 解决文字导出后不清晰问题
    preserveObjectStacking: true, // 当选择画布中的对象时,让对象不在顶层。
    width: 595,
    height: 842,
    width: CanvasWidth,
    height: CanvasHeight,
  });
  console.log('canvas: ', canvas);