diff --git a/src/api/index.js b/src/api/index.js index 2176924..61aef9c 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -113,6 +113,7 @@ export default { categoryFind: `/iasf/categoryService/Category/findById`, categoryList: `/iasf/categoryService/Category/list`, categorySave: `/iasf/categoryService/Category/saveOrUpdate`, + categoryCheck: `/iasf/categoryService/Category/checkDelete`, productDetailsSave: `/iasf/productDetails/saveOrUpdate`, productDetailsFind: `/iasf/productDetails/findById`, diff --git a/src/components/modules/link.vue b/src/components/modules/link.vue index 82e2f06..c8a1110 100644 --- a/src/components/modules/link.vue +++ b/src/components/modules/link.vue @@ -1,16 +1,9 @@ -
+ +
@@ -264,7 +269,7 @@ export default { ]), // 处理form表单参数 handleForm () { - const { type, forms, form, dialogWidth, labelWidth } = this.data + const { type, forms, form, dialogWidth, labelWidth, list } = this.data if (!this.data.labelWidth) this.data.labelWidth = '70px' this.fixed = false if (type === 'form' || type === 'forms') { @@ -310,6 +315,18 @@ export default { } this.articleNums = nums } + if (type === 'introduce') { + forms.map(e => { + if (e.type === 'editor' && e.pureText && list) { + list.map(n => { + console.log(444, n[e.prop]) + const el = document.createElement('div') + el.innerHTML = n[e.prop] + n[e.pureProp] = el.innerText + }) + } + }) + } form && form.site && this.siteChange(form.site) this.dialogWidth = dialogWidth || '1000px' if (labelWidth) this.labelWidth = labelWidth @@ -420,9 +437,13 @@ export default { this.$set(row, item.type === 'video' ? 'video' : 'pic', res.url) this.$set(row, 'mediaType', res.original.substr(res.original.lastIndexOf('.') + 1)) this.$set(row, 'fileName', res.original) + this.fileList = [{ + name: res.original, + url: res.url + }] } }, - beforeRemove (file, fileList) { + beforeRemove (file) { return this.$confirm(`确定移除 ${file.name}?`); }, handleRemove (file, fileList, form, prop) { diff --git a/src/const/modules.js b/src/const/modules.js index 0efab78..7c229e3 100644 --- a/src/const/modules.js +++ b/src/const/modules.js @@ -461,7 +461,9 @@ export default { { type: 'editor', prop: 'des', - label: '描述' + label: '描述', + pureText: true, // 编辑的时候是富文本,但是外面表格里展示的时候是纯文本(富文本里文字图片过大影响表格展示才需要用此方式) + pureProp: 'pureDes', // 跟pureText绑定的属性,有pureText才会有此字段,用以表格里展示纯文本 }, { type: 'link', diff --git a/src/pages/article/add/product.vue b/src/pages/article/add/product.vue index 437212d..e2a10ab 100644 --- a/src/pages/article/add/product.vue +++ b/src/pages/article/add/product.vue @@ -652,9 +652,10 @@ export default { this.$set(row, 'edit', 1) }, // 删除分类 - delClass (row, i) { + async delClass (row, i) { if (row.categoryId) { - this.$confirm('确定要删除吗?', '提示', { + const { code, msg } = await this.$post(`${this.api.categoryCheck}?categoryId=${row.categoryId}`) + this.$confirm(code === 200 ? '确定要删除吗?' : msg, '提示', { type: 'warning' }).then(() => { this.$post(this.api.categoryDel, [row.categoryId]).then(res => { @@ -731,9 +732,10 @@ export default { this.$set(row, 'edit', 1) }, // 删除类型 - delLabel (row, i) { + async delLabel (row, i) { if (row.categoryId) { - this.$confirm('确定要删除吗?', '提示', { + const { code, msg } = await this.$post(`${this.api.categoryCheck}?categoryId=${row.categoryId}`) + this.$confirm(code === 200 ? '确定要删除吗?' : msg, '提示', { type: 'warning' }).then(() => { this.$post(this.api.categoryDel, [row.categoryId]).then(res => { diff --git a/src/pages/column/add/index.vue b/src/pages/column/add/index.vue index 797d4bd..8ab8d82 100644 --- a/src/pages/column/add/index.vue +++ b/src/pages/column/add/index.vue @@ -55,8 +55,10 @@