diff --git a/src/components/tiny-mce/index.vue b/src/components/tiny-mce/index.vue index 705b535..fb712da 100644 --- a/src/components/tiny-mce/index.vue +++ b/src/components/tiny-mce/index.vue @@ -152,9 +152,7 @@ const destroyTinymce = () => { const resourcesUrl = import.meta.env.VITE_APP_RESOURCES_URL // eslint-disable-next-line no-unused-vars const imageSuccessCBK = (response, file, fileList) => { - fileList.forEach(v => { - window.tinymce.get(props.id).insertContent(``) - }) + window.tinymce.get(props.id).insertContent(``) } /** diff --git a/src/stores/prod.js b/src/stores/prod.js index 65ce0e8..ef07f3c 100644 --- a/src/stores/prod.js +++ b/src/stores/prod.js @@ -27,7 +27,7 @@ export const scoreProdStore = defineStore('prod', { removeSkuTag (tagIndex) { this.skuTags.splice(tagIndex, 1) }, - removeSkuTagItem ({ tagIndex, tagItemIndex }) { + removeSkuTagItem (tagIndex, tagItemIndex) { this.skuTags[tagIndex].tagItems.splice(tagItemIndex, 1) }, addSkuTagItem ({ tagIndex, tagItem }) { diff --git a/src/views/modules/order/order/components/order-info.vue b/src/views/modules/order/order/components/order-info.vue index defe31e..e4a6038 100644 --- a/src/views/modules/order/order/components/order-info.vue +++ b/src/views/modules/order/order/components/order-info.vue @@ -512,4 +512,7 @@ const changeOrder = (orderNumber) => { } } } +:deep(.el-steps--horizontal) { + flex: 25% 1 1; +} diff --git a/src/views/modules/prod/prodInfo/components/sku-table.vue b/src/views/modules/prod/prodInfo/components/sku-table.vue index 9a6813c..ceeff69 100644 --- a/src/views/modules/prod/prodInfo/components/sku-table.vue +++ b/src/views/modules/prod/prodInfo/components/sku-table.vue @@ -160,8 +160,8 @@ let initing = false const tableLeftTitles = computed(() => { const res = [] - for (let i = 0; i < skuTags.length; i++) { - const skuTag = skuTags[i] + for (let i = 0; i < skuTags.value.length; i++) { + const skuTag = skuTags.value[i] res.push(skuTag.tagName) } return res diff --git a/src/views/modules/prod/prodInfo/components/sku-tag.vue b/src/views/modules/prod/prodInfo/components/sku-tag.vue index 24a52fc..9f3908f 100644 --- a/src/views/modules/prod/prodInfo/components/sku-tag.vue +++ b/src/views/modules/prod/prodInfo/components/sku-tag.vue @@ -126,9 +126,10 @@ const type = ref(0) const tagItemName = ref('') const tagItemInputs = ref([]) const dbTagValues = ref([]) // 根据选定的规格所查询出来的规格值 +const dbTags = ref([]) // 数据库中的规格 + let tagName = '' let tagNameIndex = 0 -let dbTags = [] // 数据库中的规格 let maxValueId = 0 // 规格值id最大 let maxPropId = 0 // 规格id 最大 let initing = false @@ -138,7 +139,20 @@ const skuTags = computed({ set (val) { prod.updateSkuTags(val) } }) -const unUseTags = ref([]) +/** + * 未使用的规格, 通过计算属性计算 + */ +const unUseTags = computed(() => { + const res = [] + for (let i = 0; i < dbTags.value.length; i++) { + const dbTag = dbTags.value[i] + const specIndex = skuTags.value?.findIndex(tag => tag.tagName === dbTag.propName) + if (specIndex === -1) { + res.push(dbTag) + } + } + return res +}) const defalutSku = computed(() => { return prod.defalutSku @@ -245,18 +259,9 @@ onMounted(() => { params: http.adornParams() }) .then(({ data }) => { - dbTags = data + dbTags.value = data if (data) { maxPropId = Math.max.apply(Math, data.map(item => item.propId)) - const res = [] - for (let i = 0; i < dbTags.length; i++) { - const dbTag = dbTags[i] - const specIndex = skuTags.value?.findIndex(tag => tag.tagName === dbTag.propName) - if (specIndex === -1) { - res.push(dbTag) - } - } - unUseTags.value = res } else { maxPropId = 0 } @@ -310,7 +315,7 @@ defineExpose({ init }) * 显示规格名、规格值输入框 */ const shopTagInput = () => { - isShowTagInput.value = !isShowTagInput.value + isShowTagInput.value = true } /** @@ -378,12 +383,12 @@ const handleTagClick = () => { dbTagValues.value = [] addTagInput.value.selectValues = [] // 判断规格名输入的值是否为数据库中已有的值 - const specsIndex = dbTags.findIndex(spec => spec.propName === addTagInput.value.propName) + const specsIndex = dbTags.value?.findIndex(spec => spec.propName === addTagInput.value.propName) // 如果不是,则说明为用户随便输入 if (specsIndex === -1) return // 如果数据库已有该规格名,则获取根据id获取该规格名称含有的规格值 http({ - url: http.adornUrl(`/prod/spec/listSpecValue/${dbTags[specsIndex].propId}`), + url: http.adornUrl(`/prod/spec/listSpecValue/${dbTags.value[specsIndex].propId}`), method: 'get', params: http.adornParams() }).then(({ data }) => { @@ -523,4 +528,7 @@ const checkTagItem = (tagIndex) => { margin-left: 18px; padding-bottom:8px; } +.el-form-item__content div { + width: 100%; +} diff --git a/src/views/modules/prod/prodInfo/index.vue b/src/views/modules/prod/prodInfo/index.vue index c3c9ef9..f60a30b 100644 --- a/src/views/modules/prod/prodInfo/index.vue +++ b/src/views/modules/prod/prodInfo/index.vue @@ -268,7 +268,9 @@ const onSubmit = Debounce(() => { type: 'success', duration: 1500, onClose: () => { - router.push({ name: 'prod-prodList' }) + router.push({ + path: '/prod/prodList' + }) emit('refreshDataList') } }) diff --git a/src/views/modules/sys/area/index.vue b/src/views/modules/sys/area/index.vue index 395a324..5959b25 100644 --- a/src/views/modules/sys/area/index.vue +++ b/src/views/modules/sys/area/index.vue @@ -22,7 +22,7 @@ :expand-on-click-node="false" >