diff --git a/package-lock.json b/package-lock.json index 49d24b7..b6f1b32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "drawstamputils", - "version": "0.2.3", + "version": "0.2.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "drawstamputils", - "version": "0.2.3", + "version": "0.2.5", "license": "Apache-2.0", "dependencies": { "rollup": "^4.27.4", diff --git a/src/DrawStampUtilsDemo.vue b/src/DrawStampUtilsDemo.vue index 9e42a34..b5d395e 100644 --- a/src/DrawStampUtilsDemo.vue +++ b/src/DrawStampUtilsDemo.vue @@ -33,602 +33,12 @@ - -
- -
- - - - -
- - -
-
-

{{ t('stamp.basic.title') }}

- -
-
- - - - - - - -
-
- - -
-
-

{{ t('stamp.company.title') }}

- -
-
-
-
- {{ t('stamp.common.line', { index: index + 1 }) }} - -
- - - - - - - - - -
- -
-
- - -
-
-

{{ t('stamp.stampType.title') }}

- -
-
-
-
- {{ t('stamp.stampType.line', { index: index + 1 }) }} - -
- - - - - - - -
- -
-
- - -
-
-

{{ t('stamp.code.title') }}

- -
-
- - - - - - - -
-
- - -
-
-

{{ t('stamp.taxNumber.title') }}

- -
-
- - - - - - -
-
- - -
-
-

{{ t('stamp.images.title') }}

- -
-
-
-
- {{ t('stamp.images.image', { index: index + 1 }) }} - -
-
- -
- - - - - - -
- -
-
- - -
-
-

{{ t('stamp.star.title') }}

- -
-
- -
- - -
-
-
- -
-
-

{{ t('stamp.security.title') }}

- -
-
- - - - - -
-
- - -
-
-

{{ t('stamp.roughEdge.title') }}

- -
-
- - - - - - - -
-
- - -
-
-

{{ t('stamp.aging.title') }}

- -
-
- - - - -
-
- - -
-
-

{{ t('stamp.innerCircle.title') }}

- -
-
- -
-
- 第 {{ index + 1 }} 行 - -
- - - -
-
-
-
- +
@@ -700,8 +110,11 @@ import { ICode, ICompany, IDrawImage, IDrawStampConfig, IDrawStar, IInnerCircle, import { useI18n } from 'vue-i18n' import stampTemplate1 from './assets/templates/stamp_template1.json' import stampTemplate2 from './assets/templates/stamp_template2.json' +import EditorControls from './EditorControls.vue' const { t } = useI18n() +// 添加一个标志来控制 EditorControls 的加载 +const isDrawStampUtilsReady = ref(false) const editorControls = ref(null) const stampCanvas = ref(null) @@ -1289,8 +702,8 @@ const loadSystemFonts = async () => { // 在组件挂载时加载字体 onMounted(async () => { - await loadSystemFonts() initDrawStampUtils() + await loadSystemFonts() restoreDrawConfigs() drawStamp() @@ -1300,6 +713,7 @@ onMounted(async () => { updateFontPreview({ target: element } as unknown as Event); } }); + isDrawStampUtilsReady.value = true }) // 监听所有响应式数据的变化 @@ -1601,6 +1015,11 @@ watch(showSecurityWarning, (newValue) => { localStorage.setItem('showSecurityWarning', String(newValue)) }) +// 更新印章绘制,从EditorControls组件中调用 +const updateDrawStamp = (newConfig: IDrawStampConfig, refreshSecurityPattern: boolean, refreshOld: boolean, refreshRoughEdge: boolean) => { + drawStampUtils.setDrawConfigs(newConfig) + drawStampUtils.refreshStamp(refreshSecurityPattern, refreshOld, refreshRoughEdge) +} diff --git a/src/EditorControls.vue b/src/EditorControls.vue new file mode 100644 index 0000000..c571e80 --- /dev/null +++ b/src/EditorControls.vue @@ -0,0 +1,1423 @@ + + + + \ No newline at end of file