diff --git a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/controller/admin/app/AppBrandController.java b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/controller/admin/app/AppBrandController.java index adb7386..ce5944b 100644 --- a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/controller/admin/app/AppBrandController.java +++ b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/controller/admin/app/AppBrandController.java @@ -3,6 +3,7 @@ package cn.hangtag.module.oms.controller.admin.app; import cn.hangtag.framework.common.enums.CommonStatusEnum; import cn.hangtag.framework.common.pojo.CommonResult; import cn.hangtag.framework.common.pojo.PageResult; +import cn.hangtag.framework.common.util.FuncUtil; import cn.hangtag.framework.common.util.object.BeanUtils; import cn.hangtag.framework.security.core.LoginUser; import cn.hangtag.framework.security.core.util.SecurityFrameworkUtils; @@ -14,6 +15,7 @@ import cn.hangtag.module.oms.dal.dataobject.customerbrand.CustomerBrandDO; import cn.hangtag.module.oms.service.brand.BrandService; import cn.hangtag.module.oms.service.customer.CustomerService; import cn.hangtag.module.oms.service.customerbrand.CustomerBrandService; +import cn.hangtag.module.oms.service.saleorder.SaleOrderService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; @@ -42,6 +44,9 @@ public class AppBrandController { @Resource private CustomerBrandService customerBrandService; + @Resource + private SaleOrderService saleOrderService; + @@ -60,8 +65,21 @@ public class AppBrandController { for (CustomerBrandDO customerBrandDO : listByCustomerId) { brandIds.add(customerBrandDO.getBrandId()); } - List list = brandService.getBrandList( - new BrandListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()).setIds(brandIds)); + List list = brandService.getBrandList( new BrandListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()).setIds(brandIds)); + + Long id = saleOrderService.queryLastOrderBrand(customerId); + // 获取最近下单的品牌 + if(FuncUtil.isNotEmpty(id)){ + for (int i = 0; i < list.size(); i++) { + if(list.get(i).getId().equals(id)){ + BrandDO brandDO = list.get(i); + list.remove(i); + // 设置首位 + list.add(0,brandDO); + break; + } + } + } return success(BeanUtils.toBean(list, BrandSimpleRespVO.class)); } diff --git a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/dal/dataobject/saleorder/SaleOrderDO.java b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/dal/dataobject/saleorder/SaleOrderDO.java index 9f1be46..89a2ef6 100644 --- a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/dal/dataobject/saleorder/SaleOrderDO.java +++ b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/dal/dataobject/saleorder/SaleOrderDO.java @@ -145,7 +145,7 @@ public class SaleOrderDO extends BaseDO { /** * 品牌id */ - private Integer brandId; + private Long brandId; /** * 是否分批交货 分批交货以明细表中的交货日期为准 */ diff --git a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderService.java b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderService.java index 6b2fe05..afc8095 100644 --- a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderService.java +++ b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderService.java @@ -136,4 +136,12 @@ public interface SaleOrderService { * @return {@link CreateSaleOrderDTO } */ CreateSaleOrderDTO queryEditOrder(Long id); + + /** + * 查询上次订单品牌 + * + * @param customerId 客户id + * @return {@link Long } + */ + Long queryLastOrderBrand(Long customerId); } \ No newline at end of file diff --git a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java index b20a9e0..8871ccf 100644 --- a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java +++ b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java @@ -1080,6 +1080,20 @@ public class SaleOrderServiceImpl implements SaleOrderService { return res; } + @Override + public Long queryLastOrderBrand(Long customerId) { + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SaleOrderDO::getCustomerId, customerId); + queryWrapper.orderByDesc(SaleOrderDO::getCreateTime); + queryWrapper.last("limit 1"); + SaleOrderDO orderDO = saleOrderMapper.selectOne(queryWrapper); + if(FuncUtil.isNotEmpty(orderDO)){ + return orderDO.getBrandId(); + } + return null; + } + /** * 下载ZIP压缩包(会对下载后的压缩包进行删除) * diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue index 4c3b964..443d218 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue @@ -76,7 +76,6 @@ style="box-shadow: 0px 2px 5px 2px #dcdcdc;" v-if="that.propInfo[tmp.key].multiLanguage && that.propInfo[tmp.key].shape === ShapeType.vueTextCell"> -
- - - - + + + + + +
@@ -208,19 +220,30 @@ -
+
+
+
+
+ + + +
@@ -233,19 +256,16 @@
+
- - - +
添加 @@ -410,6 +430,15 @@ const initSucceed = () => { showPng(); emit('initSucceed') } +const changeInput =(index: number, key: string)=>{ + + if(!that.propInfo[key].dataInfo[index].showLabel){ + useMessage().notifyWarning('请输入'+getLabelName(that.propInfo[key])); + return; + } + that.propInfo[key].dataInfo[index].label = that.propInfo[key].dataInfo[index].showLabel + resetData(); +} const changeData = (index: number, key: string) => { const info = that.propInfo[key]; @@ -451,30 +480,44 @@ const changeData = (index: number, key: string) => { } } -const changeComboData = (item: any, label: string) => { - let info = []; - let startIndex = 0; - for (let i = 0; i < that.washingInfoList.length; i++) { - // @ts-ignore - if (that.washingInfoList[i].value === label) { - // @ts-ignore - item.dataInfo[0].url = that.washingInfoList[i].url - info = that.washingInfoList[i].langMapping - startIndex++; - break; - } +const changeComboData = (index: number, key: string) => { + const info = that.propInfo[key]; + const infoList = getIngredientInfoListByType(info.groupType) + let mapping = {} + for (let i = 0; i < infoList.length; i++) { + mapping[infoList[i].label] = infoList[i].langMapping; } - console.log("info", info) + console.log("111",infoList,mapping) + // 多语言变量替换 + const allData = [...that.propInfo[key].dataInfo] + const fLang = allData[1].locale; + let m1 = mapping[allData[1].showLabel] + if(m1){ + let ratio = allData[1].ratio + for (let i = 0; i < allData.length; i++) { - for (let i = startIndex; i < item.dataInfo.length; i++) { - for (let j = 0; j < info.length; j++) { - if (info[j].locale === item.dataInfo[i].locale) { - item.dataInfo[i].label = info[j].value - break; + if(i>0 && allData[i].locale === fLang){ + ratio = allData[i].ratio + m1 = mapping[allData[i].showLabel] + } + for (let j = 0; j < m1.length; j++) { + if( allData[i].locale === m1[j].locale){ + console.log("m1",m1[j],ratio) + let str = ratio; + if (str === null || str === undefined || str === -1) { + str = '' + } + allData[i].label= `${m1[j].value}`.replaceAll('${r}', `${str}`) + break; + } } } + + that.propInfo[key].dataInfo = [...allData]; + + console.log("allData",allData) + resetData(); } - resetData(); } const washingInfoListByType = (type) => { @@ -512,7 +555,36 @@ const uploadFile = async (fileName) => { }); }); } +const deleteImgList = (key, index) => { + // const item = JSON.parse(JSON.stringify(that.propInfo[key])) + // const group = findGroup(key,that.propInfo) + // const keys = Object.keys(group); + // + // if(keys.length > 1){ + // console.log(index) + // // 删除同一组数据 + // const firstLang = item.dataInfo[1].locale + // const indexs = []; + // for (let i = index; i < item.dataInfo.length; i++) { + // if(i > index && firstLang === item.dataInfo[i].locale){ + // break; + // } + // indexs.push(i); + // } + // const newArr = []; + // for (let i = 0; i < that.propInfo[key].dataInfo.length; i++) { + // if(!indexs.includes(i)){ + // newArr.push(that.propInfo[key].dataInfo[i]) + // } + // } + // that.propInfo[key].dataInfo = [...newArr] + // resetData(); + // }else { + // useMessage().notifyWarning("至少需要一个变量") + // return; + // } +} const deleteList = (key, index) => { const item = JSON.parse(JSON.stringify(that.propInfo[key])) const group = findGroup(key,that.propInfo) @@ -544,33 +616,34 @@ const deleteList = (key, index) => { } const appendImageList = (key) => { - const item = that.propInfo[key] - console.log("item.dataInfo",item) - const group = findGroup(key,that.propInfo) - const keys = Object.keys(group); - console.log("keys",keys) - // 有多少组变量 - if(keys.length >= item.maxSize ){ - useMessage().notifyWarning("最大数量为:"+item.maxSize) - return; - } - const locale = item.dataInfo[0].locale - const tmpArr = [...item.dataInfo] - - for (let i = 0; i < tmpArr.length; i++) { - if(i > 0 && tmpArr[i].locale === locale){ - break; - } - item.dataInfo.push( - { - label: '', - url: '', - ratio: 0, - ...tmpArr[i] - } - ) - } - resetData(); + // todo 待完成 + // const item = that.propInfo[key] + // console.log("item.dataInfo",item) + // const group = findGroup(key,that.propInfo) + // const keys = Object.keys(group); + // console.log("keys",keys) + // // 有多少组变量 + // if(keys.length >= item.maxSize ){ + // useMessage().notifyWarning("最大数量为:"+item.maxSize) + // return; + // } + // const locale = item.dataInfo[1].locale + // const tmpArr = [...item.dataInfo] + // + // for (let i = 1; i < tmpArr.length; i++) { + // if(i > 1 && tmpArr[i].locale === locale){ + // break; + // } + // item.dataInfo.push( + // { + // label: '', + // url: '', + // ratio: 0, + // ...tmpArr[i] + // } + // ) + // } + // resetData(); } const appendList = (key) => { @@ -791,6 +864,8 @@ const checkPropInfo = (info)=>{ let labelInfo = [] let rInfo = 0; const firstLang = newInfo[key].dataInfo[0].locale; + const linkChar = newInfo[key].linkChar || ','; + for (let i1 = 0; i1 < newInfo[key].dataInfo.length; i1++) { if(firstLang === newInfo[key].dataInfo[i1].locale){ @@ -824,13 +899,12 @@ const checkPropInfo = (info)=>{ } } if(row){ - row.label = str.join(","); + row.label = str.join(linkChar); newArr.push(row); } } newInfo[key].dataInfo = newArr; - console.log("that.propInfo",newArr) - console.log("that. newInfo[key]", newInfo[key]) + } resolve(newInfo) }); diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DynamicPropConfig.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DynamicPropConfig.vue index 3111a55..9d5d60c 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DynamicPropConfig.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DynamicPropConfig.vue @@ -42,8 +42,9 @@ - - +
+ +
@@ -51,16 +52,30 @@
- -
- + + +
+ 允许输入值
+ + +
+
变量链接符
+
+ +
+ 换行 +
+
+
+
@@ -98,7 +113,7 @@ @@ -183,6 +198,7 @@ const that = reactive({ maxSize: 100, canChange: false, canInput: false, + linkChar: ',', cellIds: [], // 节点id groupId: `g_${Math.random().toString(36).substring(2)}`, data: {}, //节点是数据 @@ -249,6 +265,7 @@ const init = (allGroupList, data) => { maxSize: 100, // 节点组最大数量 canChange: false, // 是否允许调整数量 canInput: false,// 是否允许输入值 + linkChar: ',',// 连接字符 cellIds: [], // 节点id data: {}, //节点是数据 shape: '', // 节点类型 diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue index c8e7ad4..7faa9e5 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue @@ -1158,6 +1158,7 @@ const getJson = () => { let combo = prop.isCombo === undefined ? false : prop.isCombo; let canChange = prop.canChange === undefined ? false : prop.canChange; let canInput = prop.canInput === undefined ? false : prop.canInput; + let linkChar = prop.linkChar === undefined ? ',' : prop.linkChar; if (combo) { min = Math.min(dataInfoList.length,min); @@ -1176,6 +1177,7 @@ const getJson = () => { maxSize: max, canChange: canChange, canInput: canInput, + linkChar: linkChar, shape: prop.shape, dataInfo: dataInfoList } @@ -1451,10 +1453,12 @@ const handlerGroupList = (cells, isCombo = false, min, max) => { let canChange = false; let canInput = false; + let linkChar = ','; for (let i = 0; i < that.pageConfig.propList.length; i++) { if (that.pageConfig.propList[i].groupId === cells[0].getData().propGroupId) { canChange = that.pageConfig.propList[i].canChange === true canInput = that.pageConfig.propList[i].canInput === true + linkChar = that.pageConfig.propList[i].linkChar || ',' break; } } @@ -1469,6 +1473,7 @@ const handlerGroupList = (cells, isCombo = false, min, max) => { maxSize: max, canChange: canChange, canInput: canInput, + linkChar: linkChar, data: info.data, //节点是数据 shape: info.shape, pointList: [...tmpPoint], //{ x:10,y:100} 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 d6a9964..381e380 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 @@ -69,7 +69,7 @@ 多语言拼接 @@ -191,6 +193,7 @@ const formRules = reactive({ }) const formRef = ref() // 表单 Ref const that = reactive({ + inputIndex: -1, langList: [{ locale: 'zh-CN', // 语言标识 value: '', // 翻译内容 @@ -290,6 +293,52 @@ const submitForm = () => { } +const inputFocus = (index)=>{ + that.inputIndex = index +} +// 处理按下 Alt + R 快捷键的函数 +const handleKeydown = (event) => { + // 判断是否按下了 Alt + R + if (event.altKey && event.key === 'r') { + onAltRPressed(); + } +}; + +// 处理 Alt + R 被按下时的逻辑 +const onAltRPressed = () => { + console.log('Alt + R 被按下了'); + if(that.inputIndex >= 0){ + const byId = document.getElementById("rowInput_"+that.inputIndex); + let pos = 0; + if(byId){ + pos = byId.selectionStart; + } + let str = that.langList[that.inputIndex].value; + if(str && str.length > 0 && pos > 0){ + if(pos >= str.length){ + that.langList[that.inputIndex].value = that.langList[that.inputIndex].value+"${r}"; + }else { + that.langList[that.inputIndex].value = str.substring(0,pos)+"${r}"+str.substring(pos); + } + + }else { + that.langList[that.inputIndex].value = "${r}"+that.langList[that.inputIndex].value; + } + } + + // 在这里可以执行任何自定义的操作 +}; + +// 在组件挂载时添加键盘事件监听 +onMounted(() => { + window.addEventListener('keydown', handleKeydown); +}); + +// 在组件卸载时移除键盘事件监听 +onBeforeUnmount(() => { + window.removeEventListener('keydown', handleKeydown); +}); + /** 重置表单 */ const resetForm = () => { formData.value = { diff --git a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DesignPropEdit.vue b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DesignPropEdit.vue index 4c3b964..443d218 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DesignPropEdit.vue +++ b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DesignPropEdit.vue @@ -76,7 +76,6 @@ style="box-shadow: 0px 2px 5px 2px #dcdcdc;" v-if="that.propInfo[tmp.key].multiLanguage && that.propInfo[tmp.key].shape === ShapeType.vueTextCell"> -
- - - - + + + + + +
@@ -208,19 +220,30 @@
-
+
+
+
+
+ + + +
@@ -233,19 +256,16 @@
+
- - - +
添加 @@ -410,6 +430,15 @@ const initSucceed = () => { showPng(); emit('initSucceed') } +const changeInput =(index: number, key: string)=>{ + + if(!that.propInfo[key].dataInfo[index].showLabel){ + useMessage().notifyWarning('请输入'+getLabelName(that.propInfo[key])); + return; + } + that.propInfo[key].dataInfo[index].label = that.propInfo[key].dataInfo[index].showLabel + resetData(); +} const changeData = (index: number, key: string) => { const info = that.propInfo[key]; @@ -451,30 +480,44 @@ const changeData = (index: number, key: string) => { } } -const changeComboData = (item: any, label: string) => { - let info = []; - let startIndex = 0; - for (let i = 0; i < that.washingInfoList.length; i++) { - // @ts-ignore - if (that.washingInfoList[i].value === label) { - // @ts-ignore - item.dataInfo[0].url = that.washingInfoList[i].url - info = that.washingInfoList[i].langMapping - startIndex++; - break; - } +const changeComboData = (index: number, key: string) => { + const info = that.propInfo[key]; + const infoList = getIngredientInfoListByType(info.groupType) + let mapping = {} + for (let i = 0; i < infoList.length; i++) { + mapping[infoList[i].label] = infoList[i].langMapping; } - console.log("info", info) + console.log("111",infoList,mapping) + // 多语言变量替换 + const allData = [...that.propInfo[key].dataInfo] + const fLang = allData[1].locale; + let m1 = mapping[allData[1].showLabel] + if(m1){ + let ratio = allData[1].ratio + for (let i = 0; i < allData.length; i++) { - for (let i = startIndex; i < item.dataInfo.length; i++) { - for (let j = 0; j < info.length; j++) { - if (info[j].locale === item.dataInfo[i].locale) { - item.dataInfo[i].label = info[j].value - break; + if(i>0 && allData[i].locale === fLang){ + ratio = allData[i].ratio + m1 = mapping[allData[i].showLabel] + } + for (let j = 0; j < m1.length; j++) { + if( allData[i].locale === m1[j].locale){ + console.log("m1",m1[j],ratio) + let str = ratio; + if (str === null || str === undefined || str === -1) { + str = '' + } + allData[i].label= `${m1[j].value}`.replaceAll('${r}', `${str}`) + break; + } } } + + that.propInfo[key].dataInfo = [...allData]; + + console.log("allData",allData) + resetData(); } - resetData(); } const washingInfoListByType = (type) => { @@ -512,7 +555,36 @@ const uploadFile = async (fileName) => { }); }); } +const deleteImgList = (key, index) => { + // const item = JSON.parse(JSON.stringify(that.propInfo[key])) + // const group = findGroup(key,that.propInfo) + // const keys = Object.keys(group); + // + // if(keys.length > 1){ + // console.log(index) + // // 删除同一组数据 + // const firstLang = item.dataInfo[1].locale + // const indexs = []; + // for (let i = index; i < item.dataInfo.length; i++) { + // if(i > index && firstLang === item.dataInfo[i].locale){ + // break; + // } + // indexs.push(i); + // } + // const newArr = []; + // for (let i = 0; i < that.propInfo[key].dataInfo.length; i++) { + // if(!indexs.includes(i)){ + // newArr.push(that.propInfo[key].dataInfo[i]) + // } + // } + // that.propInfo[key].dataInfo = [...newArr] + // resetData(); + // }else { + // useMessage().notifyWarning("至少需要一个变量") + // return; + // } +} const deleteList = (key, index) => { const item = JSON.parse(JSON.stringify(that.propInfo[key])) const group = findGroup(key,that.propInfo) @@ -544,33 +616,34 @@ const deleteList = (key, index) => { } const appendImageList = (key) => { - const item = that.propInfo[key] - console.log("item.dataInfo",item) - const group = findGroup(key,that.propInfo) - const keys = Object.keys(group); - console.log("keys",keys) - // 有多少组变量 - if(keys.length >= item.maxSize ){ - useMessage().notifyWarning("最大数量为:"+item.maxSize) - return; - } - const locale = item.dataInfo[0].locale - const tmpArr = [...item.dataInfo] - - for (let i = 0; i < tmpArr.length; i++) { - if(i > 0 && tmpArr[i].locale === locale){ - break; - } - item.dataInfo.push( - { - label: '', - url: '', - ratio: 0, - ...tmpArr[i] - } - ) - } - resetData(); + // todo 待完成 + // const item = that.propInfo[key] + // console.log("item.dataInfo",item) + // const group = findGroup(key,that.propInfo) + // const keys = Object.keys(group); + // console.log("keys",keys) + // // 有多少组变量 + // if(keys.length >= item.maxSize ){ + // useMessage().notifyWarning("最大数量为:"+item.maxSize) + // return; + // } + // const locale = item.dataInfo[1].locale + // const tmpArr = [...item.dataInfo] + // + // for (let i = 1; i < tmpArr.length; i++) { + // if(i > 1 && tmpArr[i].locale === locale){ + // break; + // } + // item.dataInfo.push( + // { + // label: '', + // url: '', + // ratio: 0, + // ...tmpArr[i] + // } + // ) + // } + // resetData(); } const appendList = (key) => { @@ -791,6 +864,8 @@ const checkPropInfo = (info)=>{ let labelInfo = [] let rInfo = 0; const firstLang = newInfo[key].dataInfo[0].locale; + const linkChar = newInfo[key].linkChar || ','; + for (let i1 = 0; i1 < newInfo[key].dataInfo.length; i1++) { if(firstLang === newInfo[key].dataInfo[i1].locale){ @@ -824,13 +899,12 @@ const checkPropInfo = (info)=>{ } } if(row){ - row.label = str.join(","); + row.label = str.join(linkChar); newArr.push(row); } } newInfo[key].dataInfo = newArr; - console.log("that.propInfo",newArr) - console.log("that. newInfo[key]", newInfo[key]) + } resolve(newInfo) }); diff --git a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DynamicPropConfig.vue b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DynamicPropConfig.vue index 3111a55..9d5d60c 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DynamicPropConfig.vue +++ b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DynamicPropConfig.vue @@ -42,8 +42,9 @@ - - +
+ +
@@ -51,16 +52,30 @@
- -
- + + +
+ 允许输入值
+ + +
+
变量链接符
+
+ +
+ 换行 +
+
+
+
@@ -98,7 +113,7 @@ @@ -183,6 +198,7 @@ const that = reactive({ maxSize: 100, canChange: false, canInput: false, + linkChar: ',', cellIds: [], // 节点id groupId: `g_${Math.random().toString(36).substring(2)}`, data: {}, //节点是数据 @@ -249,6 +265,7 @@ const init = (allGroupList, data) => { maxSize: 100, // 节点组最大数量 canChange: false, // 是否允许调整数量 canInput: false,// 是否允许输入值 + linkChar: ',',// 连接字符 cellIds: [], // 节点id data: {}, //节点是数据 shape: '', // 节点类型 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 c8e7ad4..7faa9e5 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue +++ b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue @@ -1158,6 +1158,7 @@ const getJson = () => { let combo = prop.isCombo === undefined ? false : prop.isCombo; let canChange = prop.canChange === undefined ? false : prop.canChange; let canInput = prop.canInput === undefined ? false : prop.canInput; + let linkChar = prop.linkChar === undefined ? ',' : prop.linkChar; if (combo) { min = Math.min(dataInfoList.length,min); @@ -1176,6 +1177,7 @@ const getJson = () => { maxSize: max, canChange: canChange, canInput: canInput, + linkChar: linkChar, shape: prop.shape, dataInfo: dataInfoList } @@ -1451,10 +1453,12 @@ const handlerGroupList = (cells, isCombo = false, min, max) => { let canChange = false; let canInput = false; + let linkChar = ','; for (let i = 0; i < that.pageConfig.propList.length; i++) { if (that.pageConfig.propList[i].groupId === cells[0].getData().propGroupId) { canChange = that.pageConfig.propList[i].canChange === true canInput = that.pageConfig.propList[i].canInput === true + linkChar = that.pageConfig.propList[i].linkChar || ',' break; } } @@ -1469,6 +1473,7 @@ const handlerGroupList = (cells, isCombo = false, min, max) => { maxSize: max, canChange: canChange, canInput: canInput, + linkChar: linkChar, data: info.data, //节点是数据 shape: info.shape, pointList: [...tmpPoint], //{ x:10,y:100} diff --git a/hangtag-ui/hangtag-ui-front/src/views/oms/order/createorder/index.vue b/hangtag-ui/hangtag-ui-front/src/views/oms/order/createorder/index.vue index edcaa23..25fa9bd 100644 --- a/hangtag-ui/hangtag-ui-front/src/views/oms/order/createorder/index.vue +++ b/hangtag-ui/hangtag-ui-front/src/views/oms/order/createorder/index.vue @@ -647,6 +647,8 @@ const addNewBill = () => { that.pageLoading.close() push("/") },3000) + }).catch(e=>{ + useMessage().warning("出错:"+ e.message ? e.message : e) }) }else { SaleOrderApi.placeOrder({ @@ -661,6 +663,8 @@ const addNewBill = () => { that.pageLoading.close() push("/") },3000) + }).catch(e=>{ + useMessage().warning("出错:"+ e.message ? e.message : e) }) } 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 cba390e..381e380 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 @@ -69,7 +69,7 @@ 多语言拼接 @@ -137,16 +139,7 @@
- - - - - + 是否启用 @@ -200,6 +193,7 @@ const formRules = reactive({ }) const formRef = ref() // 表单 Ref const that = reactive({ + inputIndex: -1, langList: [{ locale: 'zh-CN', // 语言标识 value: '', // 翻译内容 @@ -299,6 +293,52 @@ const submitForm = () => { } +const inputFocus = (index)=>{ + that.inputIndex = index +} +// 处理按下 Alt + R 快捷键的函数 +const handleKeydown = (event) => { + // 判断是否按下了 Alt + R + if (event.altKey && event.key === 'r') { + onAltRPressed(); + } +}; + +// 处理 Alt + R 被按下时的逻辑 +const onAltRPressed = () => { + console.log('Alt + R 被按下了'); + if(that.inputIndex >= 0){ + const byId = document.getElementById("rowInput_"+that.inputIndex); + let pos = 0; + if(byId){ + pos = byId.selectionStart; + } + let str = that.langList[that.inputIndex].value; + if(str && str.length > 0 && pos > 0){ + if(pos >= str.length){ + that.langList[that.inputIndex].value = that.langList[that.inputIndex].value+"${r}"; + }else { + that.langList[that.inputIndex].value = str.substring(0,pos)+"${r}"+str.substring(pos); + } + + }else { + that.langList[that.inputIndex].value = "${r}"+that.langList[that.inputIndex].value; + } + } + + // 在这里可以执行任何自定义的操作 +}; + +// 在组件挂载时添加键盘事件监听 +onMounted(() => { + window.addEventListener('keydown', handleKeydown); +}); + +// 在组件卸载时移除键盘事件监听 +onBeforeUnmount(() => { + window.removeEventListener('keydown', handleKeydown); +}); + /** 重置表单 */ const resetForm = () => { formData.value = { diff --git a/hangtag-ui/hangtag-ui-front/src/views/oms/productcareitem/index.vue b/hangtag-ui/hangtag-ui-front/src/views/oms/productcareitem/index.vue index bd18386..3607191 100644 --- a/hangtag-ui/hangtag-ui-front/src/views/oms/productcareitem/index.vue +++ b/hangtag-ui/hangtag-ui-front/src/views/oms/productcareitem/index.vue @@ -21,23 +21,7 @@ /> - - - - - - - + - - + + - - - - +