|
|
@ -39,11 +39,11 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<!--表单渲染--> |
|
|
|
<eForm ref="cuform" /> |
|
|
|
</div> |
|
|
|
<!--表单渲染--> |
|
|
|
<eForm ref="cuform" @refresh="initData" /> |
|
|
|
<!--排序对话框组件--> |
|
|
|
<sortDialog ref="sort" @doSort="doSort" /> |
|
|
|
<sortDialog ref="sort" @refresh="initData" /> |
|
|
|
<!--删除对话框组件--> |
|
|
|
<el-dialog title="移除字段" :visible.sync="deleteVisible"> |
|
|
|
<span class="dialog-right-top" /> |
|
|
@ -62,8 +62,10 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { FetchArchivesTypeManage } from '@/api/category/category' |
|
|
|
import { edit } from '@/api/category/listBrowsing' |
|
|
|
import eForm from './module/form' |
|
|
|
import sortDialog from './module/sortDialog' |
|
|
|
import Vue from 'vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { eForm, sortDialog }, |
|
|
@ -84,12 +86,6 @@ export default { |
|
|
|
sort: ['admin', 'orderingRule:sort'] |
|
|
|
}, |
|
|
|
deleteVisible: false, |
|
|
|
// form: { |
|
|
|
// verifyCode: '' |
|
|
|
// }, |
|
|
|
// formLabelWidth: '110px', |
|
|
|
// btn: '', |
|
|
|
// showVerifyDialog: true, |
|
|
|
sortLoading: false, |
|
|
|
delAllLoading: false, |
|
|
|
table: { |
|
|
@ -123,10 +119,10 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
initData() { |
|
|
|
FetchArchivesTypeManage({ categoryId: this.selectedCategory.id, isDataType: 2, isInput: 'true' }).then((res) => { |
|
|
|
FetchArchivesTypeManage({ categoryId: this.selectedCategory.id, isDataType: 2, isInput: 'true', isDisplay: 'true' }).then((res) => { |
|
|
|
this.table.right.data.splice(0, this.table.right.data.length) |
|
|
|
this.table.left.data.splice(0, this.table.left.data.length) |
|
|
|
res.forEach((item) => { |
|
|
|
res.sort((item) => { return item.queue - item.queue }).forEach((item) => { |
|
|
|
if (item.displayOrderBy) { |
|
|
|
this.table.right.data.push(item) |
|
|
|
} else { |
|
|
@ -142,18 +138,16 @@ export default { |
|
|
|
this.table[tableName].selections = val |
|
|
|
}, |
|
|
|
toAdd() { |
|
|
|
this.$refs.cuform.formData = this.table.left.selections.map((item) => { |
|
|
|
const field = { |
|
|
|
id: item.id, |
|
|
|
fieldCnName: item.fieldCnName, |
|
|
|
displayOrderBy: 'asc' |
|
|
|
} |
|
|
|
return field |
|
|
|
this.table.left.selections.forEach((item) => { |
|
|
|
Vue.set(item, 'displayOrderBy', 'asc') |
|
|
|
}) |
|
|
|
this.$refs.cuform.title = '新增字段' |
|
|
|
this.$refs.cuform.formData.fields = this.table.left.selections |
|
|
|
this.$refs.cuform.cuDialogVisible = true |
|
|
|
}, |
|
|
|
toEdit() { |
|
|
|
this.$refs.cuform.formData = this.table.right.selections |
|
|
|
this.$refs.cuform.title = '编辑字段' |
|
|
|
this.$refs.cuform.formData.fields = this.table.right.selections |
|
|
|
this.$refs.cuform.cuDialogVisible = true |
|
|
|
}, |
|
|
|
toDelete() { |
|
|
@ -162,7 +156,12 @@ export default { |
|
|
|
handleDelConfirm() { |
|
|
|
this.deleteVisible = false |
|
|
|
this.delAllLoading = true |
|
|
|
// sort(encrypt(this.form.verifyCode)).then((res) => { |
|
|
|
const deleteData = this.table.right.selections.map((item) => { |
|
|
|
item.displayOrderBy = null |
|
|
|
item.queue = null |
|
|
|
return item |
|
|
|
}) |
|
|
|
edit(deleteData).then((res) => { |
|
|
|
this.delAllLoading = false |
|
|
|
this.$notify({ |
|
|
|
title: '删除成功', |
|
|
@ -170,29 +169,11 @@ export default { |
|
|
|
duration: 2500 |
|
|
|
}) |
|
|
|
this.initData() |
|
|
|
// }).catch(() => { |
|
|
|
// this.delAllLoading = false |
|
|
|
// }) |
|
|
|
}) |
|
|
|
}, |
|
|
|
toSort() { |
|
|
|
// findSubsetById(data[0].id).then(res => { |
|
|
|
this.$refs.sort.sortTableData = this.table.right.data |
|
|
|
this.$refs.sort.sortVisible = true |
|
|
|
// }) |
|
|
|
}, |
|
|
|
doSort(data) { |
|
|
|
this.sortLoading = true |
|
|
|
// sort(encrypt(this.form.verifyCode)).then((res) => { |
|
|
|
this.sortLoading = false |
|
|
|
this.$notify({ |
|
|
|
title: '保存成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2500 |
|
|
|
}) |
|
|
|
this.getRightTableData() |
|
|
|
// }).catch(() => { |
|
|
|
// this.sortLoading = false |
|
|
|
// }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|