@@ -308,10 +359,15 @@
uploadOther: {
token: ""
},
- action: `${process.env.VUE_APP_UPLOAD_API}`,
+ action: `${process.env.VUE_APP_UPLOAD_API}`,
+ showProgress:false,
+ uploadProgress:0,
pcSubList: [], // 存储多选的category id
categoryList: [],
- pictureList: [],
+ pictureList: [],
+ pictureList2: [],
+ videoPosterList:[],
+ videoList:[],
downloadsList: [],
applicationsList: [],
selectList: [],
@@ -354,7 +410,10 @@
sort: 0,
is_recommend: 0,
is_sample: 0,
- picture_id: '',
+ picture_id: '',
+ picture_id_2:'',
+ video_image_id:'',
+ video_id:'',
description: '',
product_category_phase: [],
@@ -400,17 +459,47 @@
return
}
this.downloadsList = fileList
+ },
+ handleProgress(event, file, fileList) {
+ this.showProgress = true;
+ this.uploadProgress = event.percent;
},
- handleRemoveP(file, fileList) {
- this.pictureList = fileList
+ handleRemoveP(file, fileList,type) {
+ if(type=='picture_id'){
+ this.pictureList = fileList
+ }else if(type=='picture_id_2'){
+ this.pictureList2 = fileList
+ }else if(type=='video_image_id'){
+ this.videoPosterList = fileList
+ }else if(type=='video_id'){
+ this.videoList = fileList
+ }
+
},
- handlesuccessP(response, file, fileList) {
+ handlesuccessP(response, file, fileList,type) {
if (response && response.hasOwnProperty('errcode')) {
- this.$Message.warning(response.errmsg || '')
- this.pictureList = []
+ this.$Message.warning(response.errmsg || '')
+ if(type=='picture_id'){
+ this.pictureList = []
+ }else if(type=='picture_id_2'){
+ this.pictureList2 = []
+ }else if(type=='video_image_id'){
+ this.videoPosterList = []
+ }else if(type=='video_id'){
+ this.videoList = []
+ }
return
- }
- this.pictureList = fileList
+ }
+ if(type=='picture_id'){
+ this.pictureList = fileList
+ }else if(type=='picture_id_2'){
+ this.pictureList2 = fileList
+ }else if(type=='video_image_id'){
+ this.videoPosterList = fileList
+ }else if(type=='video_id'){
+ this.videoList = fileList
+ }
+
},
async getCategoryList() {
@@ -612,7 +701,49 @@
this.form.picture_id = p_files[0]
} else {
this.form.picture_id = ''
- }
+ }
+
+ let p2_files = []
+ if (this.pictureList2.length > 0) {
+ for (var h of this.pictureList2) {
+ if (h.response) {
+ p2_files.push(h.response.id)
+ } else {
+ p2_files.push(h.id)
+ }
+ }
+ this.form.picture_id_2 = p_files[0]
+ } else {
+ this.form.picture_id_2 = ''
+ }
+
+ let v_files = []
+ if (this.videoPosterList.length > 0) {
+ for (var h of this.videoPosterList) {
+ if (h.response) {
+ v_files.push(h.response.id)
+ } else {
+ v_files.push(h.id)
+ }
+ }
+ this.form.video_image_id = v_files[0]
+ } else {
+ this.form.video_image_id = ''
+ }
+ let v2_files = []
+ if (this.videoList.length > 0) {
+ for (var h of this.videoList) {
+ if (h.response) {
+ v2_files.push(h.response.id)
+ } else {
+ v2_files.push(h.id)
+ }
+ }
+ this.form.video_id = v2_files[0]
+ } else {
+ this.form.video_id = ''
+ }
+
// application
let a_ids = []
if (this.applicationsList.length > 0) {
@@ -710,6 +841,27 @@
id: res.picture.id,
url: res.picture.url
})
+ }
+ if (res.picture_id2) {
+ this.pictureList2.push({
+ name: res.picture_id2.original_name,
+ id: res.picture_id2.id,
+ url: res.picture_id2.url
+ })
+ }
+ if (res.video_image) {
+ this.videoPosterList.push({
+ name: res.video_image.original_name,
+ id: res.video_image.id,
+ url: res.video_image.url
+ })
+ }
+ if (res.video) {
+ this.videoList.push({
+ name: res.video.original_name,
+ id: res.video.id,
+ url: res.video.url
+ })
}
})
@@ -747,10 +899,15 @@
this.showWang = false
this.showPacking = false
this.downloadsList = []
- this.pictureList = []
+ this.pictureList = []
+ this.pictureList2 = []
+ this.videoPosterList = []
+ this.videoList = []
this.applicationsList = []
this.selectList = []
- this.pcSubList = []
+ this.pcSubList = []
+ this.showProgress = false
+ this.uploadProgress = 0
this.form = {
product_category_links_by_sub: [],
name: '',
@@ -758,7 +915,10 @@
sort: 0,
is_recommend: 0,
is_sample: 0,
- picture_id: '',
+ picture_id: '',
+ picture_id_2:'',
+ video_image_id:'',
+ video_id:'',
description: '',
product_category_phase: [],
product_category_details: [],
@@ -790,7 +950,11 @@
{
flex-basis: 100%;
}
-
+ ::v-deep .picture_id,
+ ::v-deep .picture_id_2,
+ ::v-deep .video_image_id{
+ flex-basis: 50%;
+ }
::v-deep .sort,
::v-deep .time,
::v-deep .is_recommend,
diff --git a/src/views/product/components/addProduct.vue b/src/views/product/components/addProduct.vue
index a175dd9..7d51174 100644
--- a/src/views/product/components/addProduct.vue
+++ b/src/views/product/components/addProduct.vue
@@ -86,7 +86,7 @@
- Visible:
+ Product Visible:
@@ -112,7 +112,7 @@
- Web Visibility:
+ Price Visible:
diff --git a/src/views/product/components/imports.vue b/src/views/product/components/imports.vue
new file mode 100644
index 0000000..44eabc0
--- /dev/null
+++ b/src/views/product/components/imports.vue
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+ Do not modify the title name of the template when importing
+
+
+
+
+ Drag the file here, or click Upload
+ Only xls/xlsx files can be uploaded
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/product/index.vue b/src/views/product/index.vue
index 892daa6..202d03c 100644
--- a/src/views/product/index.vue
+++ b/src/views/product/index.vue
@@ -53,6 +53,9 @@
export
+
+
+ import
@@ -85,7 +88,8 @@
-
+
+
@@ -103,10 +107,12 @@
} from "@/utils/downloadRequest";
import {
getToken
- } from '@/utils/auth'
+ } from '@/utils/auth'
+ import imports from "./components/imports.vue"
export default {
components: {
- addProduct
+ addProduct,
+ imports
},
data() {
return {
@@ -182,7 +188,7 @@
},
{
prop: 'is_visible',
- label: 'Visible',
+ label: 'Product Visible',
align: 'center',
width: 120,
is_text:true,
@@ -204,7 +210,7 @@
},
{
prop: 'show_price',
- label: 'Web Visibility',
+ label: 'Price Visible',
align: 'center',
width: 180,
is_text:true,
@@ -231,7 +237,10 @@
this.getCategoryList()
this.getList()
},
- methods: {
+ methods: {
+ importTable(row) {
+ this.$refs.imports.show()
+ },
editProduct(type, id) {
if (type == 'editor') {
this.$refs.addProduct.id = id