|
|
@ -6,7 +6,7 @@ |
|
|
|
<el-dialog title="模块管理" :visible.sync="visible" :width="dialogWidth" custom-class="module" |
|
|
|
<el-dialog title="模块管理" :visible.sync="visible" :width="dialogWidth" custom-class="module" |
|
|
|
:close-on-click-modal="false" :before-close="close"> |
|
|
|
:close-on-click-modal="false" :before-close="close"> |
|
|
|
<template v-if="data.type === 'introduce'"> |
|
|
|
<template v-if="data.type === 'introduce'"> |
|
|
|
<el-table class="module-table" :data="data.list" header-align="center" row-key="id"> |
|
|
|
<el-table class="module-table" :data="data.list" ref="introduceTable" header-align="center" row-key="id"> |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column v-for="(item, i) in data.forms" :key="i" :prop="item.prop" :label="item.label" |
|
|
|
<el-table-column v-for="(item, i) in data.forms" :key="i" :prop="item.prop" :label="item.label" |
|
|
@ -186,6 +186,7 @@ import Setting from '@/setting' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import 'tinymce-paragraphspacing' |
|
|
|
import 'tinymce-paragraphspacing' |
|
|
|
import editorConfig from '@/components/editor' |
|
|
|
import editorConfig from '@/components/editor' |
|
|
|
|
|
|
|
import Sortable from 'sortablejs' |
|
|
|
import Cropper from '@/components/img-upload/Cropper' |
|
|
|
import Cropper from '@/components/img-upload/Cropper' |
|
|
|
import Axios from 'axios' |
|
|
|
import Axios from 'axios' |
|
|
|
import { mapActions } from 'vuex' |
|
|
|
import { mapActions } from 'vuex' |
|
|
@ -326,16 +327,32 @@ export default { |
|
|
|
this.articleNums = nums |
|
|
|
this.articleNums = nums |
|
|
|
} |
|
|
|
} |
|
|
|
if (type === 'introduce') { |
|
|
|
if (type === 'introduce') { |
|
|
|
|
|
|
|
list && list.map((n, i) => { |
|
|
|
|
|
|
|
this.$set(n, 'id', i++) |
|
|
|
|
|
|
|
}) |
|
|
|
forms.map(e => { |
|
|
|
forms.map(e => { |
|
|
|
if (e.type === 'editor' && e.pureText && list) { |
|
|
|
if (e.type === 'editor' && e.pureText && list) { |
|
|
|
list.map(n => { |
|
|
|
list.map((n, i) => { |
|
|
|
console.log(444, n[e.prop]) |
|
|
|
|
|
|
|
const el = document.createElement('div') |
|
|
|
const el = document.createElement('div') |
|
|
|
el.innerHTML = n[e.prop] |
|
|
|
el.innerHTML = n[e.prop] |
|
|
|
n[e.pureProp] = el.innerText |
|
|
|
n[e.pureProp] = el.innerText |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
const tbody = document.querySelector('.el-table__body tbody') |
|
|
|
|
|
|
|
const that = this |
|
|
|
|
|
|
|
// 表格拖拽 |
|
|
|
|
|
|
|
this.$refs.introduceTable && Sortable.create(tbody, { |
|
|
|
|
|
|
|
onUpdate ({ newIndex, oldIndex }) { |
|
|
|
|
|
|
|
if (newIndex == oldIndex) return |
|
|
|
|
|
|
|
const currentRow = that.data.list.splice(oldIndex, 1)[0] |
|
|
|
|
|
|
|
that.data.list.splice(newIndex, 0, currentRow) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
form && form.site && this.siteChange(form.site) |
|
|
|
form && form.site && this.siteChange(form.site) |
|
|
|
this.dialogWidth = dialogWidth || '1000px' |
|
|
|
this.dialogWidth = dialogWidth || '1000px' |
|
|
|