diff --git a/src/views/products/components/EditorImage.vue b/src/views/products/components/EditorImage.vue index 8b92bcb6..3b1d618c 100644 --- a/src/views/products/components/EditorImage.vue +++ b/src/views/products/components/EditorImage.vue @@ -1,28 +1,36 @@ @@ -32,34 +40,49 @@ export default { props: { - color: { + item: { + type: Object, + default: function() { + return { + name: 'BROKEN!-KEROSENOS-BROKEN!', + _id: 'THIS-ID-IS-BROKEN!' + } + } + }, + type: { type: String, - default: '#1890ff' + default: 'chad' } }, data() { return { dialogVisible: false, - isNameCorrect: true, input: '', - type: 'product', - name: 'Kerosenos' + isNameCorrect: false, + viewState: 'initialState' } }, methods: { + openDeletePopup() { + this.dialogVisible = true + this.viewState = 'initialState' + }, checkAllSuccess() { return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess) }, handleSubmit() { - const arr = Object.keys(this.listObj).map(v => this.listObj[v]) - if (!this.checkAllSuccess()) { - this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!') - return + console.log(this.input) + console.log(this.item._id) + if (this.input) { + this.viewState = 'Success' + } else if (!this.input) { + this.viewState = 'Error' } - this.$emit('successCBK', arr) - this.listObj = {} - this.fileList = [] - this.dialogVisible = false + // const arr = Object.keys(this.listObj).map(v => this.listObj[v]) + // if (!this.checkAllSuccess()) { + // this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!') + // return + // } }, handleSuccess(response, file) { const uid = file.uid diff --git a/src/views/products/list.vue b/src/views/products/list.vue index 95b1005c..2ac6c9e4 100644 --- a/src/views/products/list.vue +++ b/src/views/products/list.vue @@ -41,8 +41,10 @@ - - +