|
@ -34,7 +34,7 @@ |
|
|
<div class="des-title"> |
|
|
<div class="des-title"> |
|
|
<p>界面预览效果</p> |
|
|
<p>界面预览效果</p> |
|
|
</div> |
|
|
</div> |
|
|
<PreviewForm :is-disabled="false" :all-fields-data="allFieldsData" /> |
|
|
|
|
|
|
|
|
<PreviewForm ref="previewForm1" :is-has-code="true" :is-disabled="false" :form-preview-data.sync="isInputFields" :selected-category="selectedCategory" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 修改字段 --> |
|
|
<!-- 修改字段 --> |
|
@ -42,7 +42,7 @@ |
|
|
<span class="dialog-right-top" /> |
|
|
<span class="dialog-right-top" /> |
|
|
<span class="dialog-left-bottom" /> |
|
|
<span class="dialog-left-bottom" /> |
|
|
<div class="setting-dialog"> |
|
|
<div class="setting-dialog"> |
|
|
<SettingForm ref="editForm" :is-disabled="false" :is-add="false" :this-fields="thisFields" /> |
|
|
|
|
|
|
|
|
<SettingForm ref="editForm" :is-disabled="false" :is-add="false" :this-fields="editField" /> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="editSubmit">保存</el-button> |
|
|
<el-button type="primary" @click="editSubmit">保存</el-button> |
|
|
</div> |
|
|
</div> |
|
@ -55,9 +55,10 @@ |
|
|
<span class="dialog-left-bottom" /> |
|
|
<span class="dialog-left-bottom" /> |
|
|
<div class="setting-dialog"> |
|
|
<div class="setting-dialog"> |
|
|
<i class="drag-tip">提示:请通过拖动鼠标来调整当前顺序</i> |
|
|
<i class="drag-tip">提示:请通过拖动鼠标来调整当前顺序</i> |
|
|
<PreviewForm :is-disabled="true" :all-fields-data="allFieldsData" /> |
|
|
|
|
|
|
|
|
<!-- <PreviewForm :is-disabled="true" :all-fields-data="allFieldsData" /> --> |
|
|
|
|
|
<PreviewForm ref="previewForm" :is-has-code="true" :is-disabled="false" :is-draggable="true" :form-preview-data.sync="isInputFields" :selected-category="selectedCategory" /> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="previewFormVisible = false">保存</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" @click.native="handleSort">保存</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
@ -69,6 +70,7 @@ import PreviewForm from '@/views/components/category/PreviewForm' |
|
|
import SettingForm from '@/views/components/category/SettingForm' |
|
|
import SettingForm from '@/views/components/category/SettingForm' |
|
|
import { FetchArchivesTypeManage } from '@/api/category/category' |
|
|
import { FetchArchivesTypeManage } from '@/api/category/category' |
|
|
import { edit } from '@/api/category/fieldManage' |
|
|
import { edit } from '@/api/category/fieldManage' |
|
|
|
|
|
import { previewFormOrder } from '@/api/category/listBrowsing' |
|
|
export default { |
|
|
export default { |
|
|
name: 'DescriptionPreview', |
|
|
name: 'DescriptionPreview', |
|
|
components: { PreviewForm, SettingForm }, |
|
|
components: { PreviewForm, SettingForm }, |
|
@ -87,7 +89,9 @@ export default { |
|
|
settingFormVisible: false, // 修改编辑字段 - dialog |
|
|
settingFormVisible: false, // 修改编辑字段 - dialog |
|
|
previewFormVisible: false, // 界面预览form - dialog |
|
|
previewFormVisible: false, // 界面预览form - dialog |
|
|
fieldsActive: 0, // 当前字段index |
|
|
fieldsActive: 0, // 当前字段index |
|
|
thisFields: { dictionaryConfigId: { dicName: null, id: null }} // 当前项字段内容 |
|
|
|
|
|
|
|
|
thisFields: { dictionaryConfigId: { dicName: null, id: null }}, // 当前项字段内容 |
|
|
|
|
|
editField: {}, |
|
|
|
|
|
isInputFields: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
@ -97,18 +101,25 @@ export default { |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.getArchivesType() |
|
|
this.getArchivesType() |
|
|
|
|
|
this.$refs.previewForm.rendered = true |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
getArchivesType() { |
|
|
getArchivesType() { |
|
|
FetchArchivesTypeManage({ categoryId: this.selectedCategory.id, isType: 2 }).then(res => { |
|
|
FetchArchivesTypeManage({ categoryId: this.selectedCategory.id, isType: 2 }).then(res => { |
|
|
this.allFieldsData.splice(0, this.allFieldsData.length) |
|
|
this.allFieldsData.splice(0, this.allFieldsData.length) |
|
|
res.forEach((item, index) => { |
|
|
|
|
|
|
|
|
this.isInputFields.splice(0, this.isInputFields.length) |
|
|
|
|
|
let setField = false |
|
|
|
|
|
res.sort(this.compare).forEach((item, index) => { |
|
|
// 防止对应字典是null时报错 |
|
|
// 防止对应字典是null时报错 |
|
|
item.dictionaryConfigId = item.dictionaryConfigId || { dicName: null, id: null } |
|
|
item.dictionaryConfigId = item.dictionaryConfigId || { dicName: null, id: null } |
|
|
this.allFieldsData.push(item) |
|
|
this.allFieldsData.push(item) |
|
|
if (item.isInput && !this.thisFields.id) { |
|
|
|
|
|
|
|
|
if (item.isInput && !setField) { |
|
|
this.fieldsActive = index |
|
|
this.fieldsActive = index |
|
|
this.thisFields = item |
|
|
this.thisFields = item |
|
|
|
|
|
setField = true |
|
|
|
|
|
} |
|
|
|
|
|
if (item.isInput) { |
|
|
|
|
|
this.isInputFields.push(item) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
@ -119,7 +130,11 @@ export default { |
|
|
// this.editResetForm() |
|
|
// this.editResetForm() |
|
|
done() |
|
|
done() |
|
|
}, |
|
|
}, |
|
|
|
|
|
compare(a, b) { |
|
|
|
|
|
return a.isSequence - b.isSequence |
|
|
|
|
|
}, |
|
|
settingForm() { |
|
|
settingForm() { |
|
|
|
|
|
this.editField = JSON.parse(JSON.stringify(this.thisFields)) |
|
|
this.settingFormVisible = true |
|
|
this.settingFormVisible = true |
|
|
}, |
|
|
}, |
|
|
// 当前选中的字段 |
|
|
// 当前选中的字段 |
|
@ -134,7 +149,7 @@ export default { |
|
|
if (!valid) { |
|
|
if (!valid) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
edit(this.thisFields).then(() => { |
|
|
|
|
|
|
|
|
edit(this.editField).then(() => { |
|
|
this.$notify({ |
|
|
this.$notify({ |
|
|
title: '保存成功', |
|
|
title: '保存成功', |
|
|
type: 'success', |
|
|
type: 'success', |
|
@ -147,6 +162,18 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
return false |
|
|
return false |
|
|
|
|
|
}, |
|
|
|
|
|
handleSort() { |
|
|
|
|
|
const sortParam = this.$refs.previewForm.formPreviewData.map((item, index) => { |
|
|
|
|
|
return { |
|
|
|
|
|
isSequence: index + 1, |
|
|
|
|
|
id: item.id |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
previewFormOrder(sortParam).then(() => { |
|
|
|
|
|
this.previewFormVisible = false |
|
|
|
|
|
this.getArchivesType() |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|