diff --git a/hangtag-ui/hangtag-ui-admin/src/components/Dialog/src/Dialog.vue b/hangtag-ui/hangtag-ui-admin/src/components/Dialog/src/Dialog.vue index 59412bb..7d41a73 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/Dialog/src/Dialog.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/Dialog/src/Dialog.vue @@ -8,7 +8,7 @@ const slots = useSlots() const props = defineProps({ modelValue: propTypes.bool.def(false), title: propTypes.string.def('Dialog'), - fullscreen: propTypes.bool.def(true), + fullscreen: propTypes.bool.def(false), width: propTypes.oneOfType([String, Number]).def('40%'), scroll: propTypes.bool.def(false), // 是否开启滚动条。如果是的话,按照 maxHeight 设置最大高度 maxHeight: propTypes.oneOfType([String, Number]).def('400px') @@ -78,7 +78,6 @@ const dialogStyle = computed(() => { class="absolute right-15px top-[50%] h-54px flex translate-y-[-50%] items-center justify-between" > { - console.log("convertImageToBase64",this.cellInfo.style.shape.href,res) // @ts-ignore this.hrefBase64 = res // this.cellInfo.style.shape.hrefBase64 = res diff --git a/hangtag-ui/hangtag-ui-admin/src/views/oms/draftdesigndata/detials/index.vue b/hangtag-ui/hangtag-ui-admin/src/views/oms/draftdesigndata/detials/index.vue index 6854595..1f76003 100644 --- a/hangtag-ui/hangtag-ui-admin/src/views/oms/draftdesigndata/detials/index.vue +++ b/hangtag-ui/hangtag-ui-admin/src/views/oms/draftdesigndata/detials/index.vue @@ -6,9 +6,6 @@ label-width="100px" v-loading="formLoading" > -
- -
@@ -26,8 +23,12 @@ +
+ +
+ - + { data.details = JSON.stringify(detailsData) console.log("data",data) if (formType.value === 'create') { - await DraftDesignDataApi.createDraftDesignData(data) + const resId = await DraftDesignDataApi.createDraftDesignData(data) message.success(t('common.createSuccess')) - resetForm() + if(copyData.value){ + console.log("resId",resId) + await router.push({path: '/base/oms/draftdesigndata/detials',query: { + id: resId + }}) + }else { + resetForm() + } + } else { await DraftDesignDataApi.updateDraftDesignData(data) message.success(t('common.updateSuccess')) diff --git a/hangtag-ui/hangtag-ui-admin/src/views/oms/productcareitem/ProductCareItemForm.vue b/hangtag-ui/hangtag-ui-admin/src/views/oms/productcareitem/ProductCareItemForm.vue index 3289c82..cba390e 100644 --- a/hangtag-ui/hangtag-ui-admin/src/views/oms/productcareitem/ProductCareItemForm.vue +++ b/hangtag-ui/hangtag-ui-admin/src/views/oms/productcareitem/ProductCareItemForm.vue @@ -21,7 +21,7 @@ clearable placeholder="请输入名称"/> - + { +const submitForm = () => { // 校验表单 - await formRef.value.validate() - // 提交请求 - formLoading.value = true - try { - const data = formData.value as unknown as ProductCareItemVO - let countInfo = {}; - for (let i = 0; i < that.langList.length; i++) { - const l = that.langList[i].locale - if (!l) { - message.error(`第${i + 1}行语言不能为空`) - return; + formRef.value.validate().then(async ()=>{ + // 提交请求 + formLoading.value = true + try { + const data = formData.value as unknown as ProductCareItemVO + let countInfo = {}; + for (let i = 0; i < that.langList.length; i++) { + const l = that.langList[i].locale + if (!l) { + message.error(`第${i + 1}行语言不能为空`) + return; + } + if (!that.langList[i].value) { + message.error(`第${i + 1}行翻译内容不能为空`) + return; + } + if (countInfo[l]) { + message.error(`${l} 翻译内容重复`) + return; + } + countInfo[l] = 1; } - if (!that.langList[i].value) { - message.error(`第${i + 1}行翻译内容不能为空`) - return; + data.langMapping = JSON.stringify(that.langList) + if (formType.value === 'create') { + await ProductCareItemApi.createProductCareItem(data) + message.success(t('common.createSuccess')) + } else { + await ProductCareItemApi.updateProductCareItem(data) + message.success(t('common.updateSuccess')) } - if (countInfo[l]) { - message.error(`${l} 翻译内容重复`) - return; - } - countInfo[l] = 1; + dialogVisible.value = false + // 发送操作成功的事件 + emit('success') + } finally { + formLoading.value = false } - data.langMapping = JSON.stringify(that.langList) - if (formType.value === 'create') { - await ProductCareItemApi.createProductCareItem(data) - message.success(t('common.createSuccess')) - } else { - await ProductCareItemApi.updateProductCareItem(data) - message.success(t('common.updateSuccess')) - } - dialogVisible.value = false - // 发送操作成功的事件 - emit('success') - } finally { - formLoading.value = false - } + }).catch(()=>{ + message.error('请填写必填项') + }) + } /** 重置表单 */ diff --git a/hangtag-ui/hangtag-ui-front/src/components/Dialog/src/Dialog.vue b/hangtag-ui/hangtag-ui-front/src/components/Dialog/src/Dialog.vue index 59412bb..7d41a73 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/Dialog/src/Dialog.vue +++ b/hangtag-ui/hangtag-ui-front/src/components/Dialog/src/Dialog.vue @@ -8,7 +8,7 @@ const slots = useSlots() const props = defineProps({ modelValue: propTypes.bool.def(false), title: propTypes.string.def('Dialog'), - fullscreen: propTypes.bool.def(true), + fullscreen: propTypes.bool.def(false), width: propTypes.oneOfType([String, Number]).def('40%'), scroll: propTypes.bool.def(false), // 是否开启滚动条。如果是的话,按照 maxHeight 设置最大高度 maxHeight: propTypes.oneOfType([String, Number]).def('400px') @@ -78,7 +78,6 @@ const dialogStyle = computed(() => { class="absolute right-15px top-[50%] h-54px flex translate-y-[-50%] items-center justify-between" > diff --git a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/node/ShapeImageNode.vue b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/node/ShapeImageNode.vue index 4f52231..95ad212 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/node/ShapeImageNode.vue +++ b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/node/ShapeImageNode.vue @@ -14,7 +14,7 @@ :style="svgStyle" > { // @ts-ignore this.hrefBase64 = res + // this.cellInfo.style.shape.hrefBase64 = res }) } setTimeout(() => { diff --git a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue index 1f6e0fe..c0f5594 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue +++ b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue @@ -59,7 +59,7 @@ import { mergeDeepObject, objectHasKey, } from "@/components/DraftDesign/utils/FuncUtil"; -import {register, getTeleport} from '@antv/x6-vue-shape' +import {register} from '@antv/x6-vue-shape' import './icons/style.css' @@ -169,8 +169,6 @@ const regNode = () => { }) } } -const TeleportContainer = defineComponent(getTeleport()); - // @ts-nocheck const emit = defineEmits(["save"]) const {t} = useI18n() // 国际化 @@ -699,9 +697,9 @@ const toPngUrl = (callback: (url: string) => void, options?: { bottom: number } }) => { + let widthScale = options && options.widthScale ? options.widthScale : 5 let heightScale = options && options.heightScale ? options.heightScale : 5 - graph.toPNG((dataUri) => { that.previewUrl = dataUri; callback(that.previewUrl) @@ -1489,6 +1487,7 @@ const submitProp = (data) => { newNode.attr('body/scaling', 'none') data.cellIds.push(newNode.id) graph.addNode(newNode) + } removeGroup(data.groupId); data.maxSize = Math.min(data.pointList.length, data.maxSize) @@ -1510,14 +1509,24 @@ const removeEmptyGroup = () => { } let delIndex = [] + let allKey = [] for (let i = 0; i < that.pageConfig.propList.length; i++) { if(!propGroupIdList.includes(that.pageConfig.propList[i].groupId)){ delIndex.push(i) + continue; } + allKey.push(that.pageConfig.propList[i].groupId) } for (let i = 0; i < delIndex.length; i++) { that.pageConfig.propList.splice(delIndex[i], 1) } + let newArr = [] + for (let i = 0; i < that.pageConfig.propOrderByList.length; i++) { + if(allKey.includes(that.pageConfig.propOrderByList[i].key)){ + newArr.push(that.pageConfig.propOrderByList[i]) + } + } + that.pageConfig.propOrderByList = newArr } const orderByPropList = () => { diff --git a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/utils/Dpi.ts b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/utils/Dpi.ts index 574b99c..df314c8 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/utils/Dpi.ts +++ b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/utils/Dpi.ts @@ -37,26 +37,22 @@ export function calcDpiFromSize( screenSize=16,opt = 'd'){ return calcDpi(widthValue, heightValue, screenSize, opt); } const tmpImage = {} -export function convertImageToBase64(url) { - return new Promise(async (resolve, reject)=>{ - FileApi.getDomain().then(async (domain) => { - url = replaceDomain(domain, url) - if(tmpImage[url]){ - resolve(tmpImage[url]); - console.log('缓存') - return; - } - try { - const response = await fetch(url); - const blob = await response.blob(); - const base = `data:${response.headers.get('content-type')};base64,${btoa(String.fromCharCode(...new Uint8Array(await blob.arrayBuffer())))}` - tmpImage[url] = base - resolve(base) - }catch (e) { - resolve(url); - } - }) - +export function convertImageToBase64(url:string) { + return new Promise(async (resolve)=>{ + if(tmpImage[url]){ + resolve(tmpImage[url]); + console.log('缓存') + return; + } + try { + const response = await fetch(url); + const blob = await response.blob(); + const base = `data:${response.headers.get('content-type')};base64,${btoa(String.fromCharCode(...new Uint8Array(await blob.arrayBuffer())))}` + tmpImage[url] = base + resolve(base) + }catch (e) { + resolve(url); + } }) } diff --git a/hangtag-ui/hangtag-ui-front/src/views/oms/draftdesigndata/detials/index.vue b/hangtag-ui/hangtag-ui-front/src/views/oms/draftdesigndata/detials/index.vue index 6854595..1f76003 100644 --- a/hangtag-ui/hangtag-ui-front/src/views/oms/draftdesigndata/detials/index.vue +++ b/hangtag-ui/hangtag-ui-front/src/views/oms/draftdesigndata/detials/index.vue @@ -6,9 +6,6 @@ label-width="100px" v-loading="formLoading" > -
- -
@@ -26,8 +23,12 @@ +
+ +
+ - + { data.details = JSON.stringify(detailsData) console.log("data",data) if (formType.value === 'create') { - await DraftDesignDataApi.createDraftDesignData(data) + const resId = await DraftDesignDataApi.createDraftDesignData(data) message.success(t('common.createSuccess')) - resetForm() + if(copyData.value){ + console.log("resId",resId) + await router.push({path: '/base/oms/draftdesigndata/detials',query: { + id: resId + }}) + }else { + resetForm() + } + } else { await DraftDesignDataApi.updateDraftDesignData(data) message.success(t('common.updateSuccess')) diff --git a/hangtag-ui/hangtag-ui-front/src/views/oms/productcareitem/ProductCareItemForm.vue b/hangtag-ui/hangtag-ui-front/src/views/oms/productcareitem/ProductCareItemForm.vue index 3289c82..cba390e 100644 --- a/hangtag-ui/hangtag-ui-front/src/views/oms/productcareitem/ProductCareItemForm.vue +++ b/hangtag-ui/hangtag-ui-front/src/views/oms/productcareitem/ProductCareItemForm.vue @@ -21,7 +21,7 @@ clearable placeholder="请输入名称"/> - + { +const submitForm = () => { // 校验表单 - await formRef.value.validate() - // 提交请求 - formLoading.value = true - try { - const data = formData.value as unknown as ProductCareItemVO - let countInfo = {}; - for (let i = 0; i < that.langList.length; i++) { - const l = that.langList[i].locale - if (!l) { - message.error(`第${i + 1}行语言不能为空`) - return; + formRef.value.validate().then(async ()=>{ + // 提交请求 + formLoading.value = true + try { + const data = formData.value as unknown as ProductCareItemVO + let countInfo = {}; + for (let i = 0; i < that.langList.length; i++) { + const l = that.langList[i].locale + if (!l) { + message.error(`第${i + 1}行语言不能为空`) + return; + } + if (!that.langList[i].value) { + message.error(`第${i + 1}行翻译内容不能为空`) + return; + } + if (countInfo[l]) { + message.error(`${l} 翻译内容重复`) + return; + } + countInfo[l] = 1; } - if (!that.langList[i].value) { - message.error(`第${i + 1}行翻译内容不能为空`) - return; + data.langMapping = JSON.stringify(that.langList) + if (formType.value === 'create') { + await ProductCareItemApi.createProductCareItem(data) + message.success(t('common.createSuccess')) + } else { + await ProductCareItemApi.updateProductCareItem(data) + message.success(t('common.updateSuccess')) } - if (countInfo[l]) { - message.error(`${l} 翻译内容重复`) - return; - } - countInfo[l] = 1; + dialogVisible.value = false + // 发送操作成功的事件 + emit('success') + } finally { + formLoading.value = false } - data.langMapping = JSON.stringify(that.langList) - if (formType.value === 'create') { - await ProductCareItemApi.createProductCareItem(data) - message.success(t('common.createSuccess')) - } else { - await ProductCareItemApi.updateProductCareItem(data) - message.success(t('common.updateSuccess')) - } - dialogVisible.value = false - // 发送操作成功的事件 - emit('success') - } finally { - formLoading.value = false - } + }).catch(()=>{ + message.error('请填写必填项') + }) + } /** 重置表单 */