update 自定义拆分
This commit is contained in:
@@ -96,6 +96,8 @@ const getTableData = (params) => getAction('/customCompare/lawsCustomCompareInfo
|
|||||||
const getMaintainList = (params) => getAction('/customCompare/lawsCustomCompareInfo/queryInventory', params)
|
const getMaintainList = (params) => getAction('/customCompare/lawsCustomCompareInfo/queryInventory', params)
|
||||||
// 自定义比对-编辑特点、对比项列表
|
// 自定义比对-编辑特点、对比项列表
|
||||||
const editMaintainList = (params) => postAction('/customCompare/lawsCustomCompareInfo/editInventory', params)
|
const editMaintainList = (params) => postAction('/customCompare/lawsCustomCompareInfo/editInventory', params)
|
||||||
|
// 自定义比对-对比分析结果保存
|
||||||
|
const editComparsionResult = (params) => postAction('/customCompare/lawsCustomCompareInfo/saveCellCompareResult', params)
|
||||||
|
|
||||||
export {
|
export {
|
||||||
// 文档拆分
|
// 文档拆分
|
||||||
@@ -150,5 +152,6 @@ export {
|
|||||||
saveStandard,
|
saveStandard,
|
||||||
getTableData,
|
getTableData,
|
||||||
getMaintainList,
|
getMaintainList,
|
||||||
editMaintainList
|
editMaintainList,
|
||||||
|
editComparsionResult
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,3 +111,9 @@ export const Recheck = {
|
|||||||
ANNUL: { text: '废止', value: '1' },
|
ANNUL: { text: '废止', value: '1' },
|
||||||
SEAL_SAVE: { text: '封存', value: '1' }
|
SEAL_SAVE: { text: '封存', value: '1' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清单维护类型
|
||||||
|
export const InventoryType = {
|
||||||
|
SPECIALTY: { text: '特点', value: '1' },
|
||||||
|
COMPARISON_ITEM: { text: '对比项', value: '2' }
|
||||||
|
}
|
||||||
@@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getMaintainList, editMaintainList } from '../../../../api/documentToolApi'
|
import { getMaintainList, editMaintainList } from '../../../../api/documentToolApi'
|
||||||
|
import { InventoryType } from '../../../../enums/commonEnums'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ComparisonMaintainDrawer',
|
name: 'ComparisonMaintainDrawer',
|
||||||
@@ -91,11 +92,13 @@ export default {
|
|||||||
this.specialtyList = [
|
this.specialtyList = [
|
||||||
{
|
{
|
||||||
cellTitle: '章节',
|
cellTitle: '章节',
|
||||||
infoId: this.infoId
|
infoId: this.infoId,
|
||||||
|
inventoryType: InventoryType.SPECIALTY.value
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cellTitle: '法规内容',
|
cellTitle: '法规内容',
|
||||||
infoId: this.infoId
|
infoId: this.infoId,
|
||||||
|
inventoryType: InventoryType.SPECIALTY.value
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -103,11 +106,13 @@ export default {
|
|||||||
this.comparisonItemList = [
|
this.comparisonItemList = [
|
||||||
{
|
{
|
||||||
cellTitle: '适用范围',
|
cellTitle: '适用范围',
|
||||||
infoId: this.infoId
|
infoId: this.infoId,
|
||||||
|
inventoryType: InventoryType.COMPARISON_ITEM.value
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cellTitle: '定义',
|
cellTitle: '定义',
|
||||||
infoId: this.infoId
|
infoId: this.infoId,
|
||||||
|
inventoryType: InventoryType.COMPARISON_ITEM.value
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -149,7 +154,8 @@ export default {
|
|||||||
addSpecialty (index) {
|
addSpecialty (index) {
|
||||||
this.specialtyList.splice(index + 1, 0, {
|
this.specialtyList.splice(index + 1, 0, {
|
||||||
cellTitle: null,
|
cellTitle: null,
|
||||||
infoId: this.infoId
|
infoId: this.infoId,
|
||||||
|
inventoryType: InventoryType.SPECIALTY.value
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -164,7 +170,8 @@ export default {
|
|||||||
addComparisonItem (index) {
|
addComparisonItem (index) {
|
||||||
this.comparisonItemList.splice(index + 1, 0, {
|
this.comparisonItemList.splice(index + 1, 0, {
|
||||||
cellTitle: null,
|
cellTitle: null,
|
||||||
infoId: this.infoId
|
infoId: this.infoId,
|
||||||
|
inventoryType: InventoryType.COMPARISON_ITEM.value
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,124 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
:ok-text="$t('preservation')"
|
||||||
|
:cancel-text="$t('cancel')"
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel">
|
||||||
|
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<!--颜色选择-->
|
||||||
|
<div class="color-box">
|
||||||
|
<div class="color-item" :class="{'color-item-selected': color === '#ff7168'}" @click="handleChangeColor('#ff7168')">
|
||||||
|
<div class="color-item-bg color-red"></div>
|
||||||
|
</div>
|
||||||
|
<div class="color-item" :class="{'color-item-selected': color === 'green'}" @click="handleChangeColor('green')">
|
||||||
|
<div class="color-item-bg color-green"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--文本-->
|
||||||
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('docTool.split.text')">
|
||||||
|
<a-input v-decorator="['compareResult']" :placeholder="$t('pleaseEnter') + $t('docTool.split.text')" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { editComparsionResult } from '../../../../api/documentToolApi'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ComparisonResultModal',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
title: this.$t('docTool.customComparison.comparativeAnalysisResult'),
|
||||||
|
width: 500,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
model: {},
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 3 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 20 }
|
||||||
|
},
|
||||||
|
color: 'green'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open (record) {
|
||||||
|
this.model = Object.assign(this.model, record)
|
||||||
|
this.color = record.color
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(this.model)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleOk () {
|
||||||
|
this.form.validateFields((errors, values) => {
|
||||||
|
if (!errors) {
|
||||||
|
this.confirmLoading = true
|
||||||
|
const formData = Object.assign(this.model, values)
|
||||||
|
formData.colour = this.color
|
||||||
|
editComparsionResult(formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.$emit('ok')
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel () {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.visible = false
|
||||||
|
this.form.resetFields()
|
||||||
|
this.color = null
|
||||||
|
},
|
||||||
|
handleChangeColor (value) {
|
||||||
|
this.color = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.color-red {
|
||||||
|
background-color: #ff7168;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-green {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-item {
|
||||||
|
height: 50px;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-item-selected {
|
||||||
|
border: 1px solid rgba(128, 128, 128, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-item-bg {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -53,7 +53,10 @@
|
|||||||
<!--在线对比-->
|
<!--在线对比-->
|
||||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('docTool.customComparison.onlineComparison')">
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('docTool.customComparison.onlineComparison')">
|
||||||
<a-switch default-checked v-model="isStartComparison" @change="handleSwitchChange" />
|
<a-switch default-checked v-model="isStartComparison" @change="handleSwitchChange" />
|
||||||
<a-button type="primary" class="submit-btn" ghost v-if="!isDetail" @click="handleSaveForm">{{ $t('submit') }}</a-button>
|
<a-button type="primary" class="submit-btn" ghost v-if="!isDetail" @click="handleSaveForm">{{
|
||||||
|
$t('submit')
|
||||||
|
}}
|
||||||
|
</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<div v-show="isStartComparison" class="comparison-box">
|
<div v-show="isStartComparison" class="comparison-box">
|
||||||
<div class="operation-box" v-if="!isDetail">
|
<div class="operation-box" v-if="!isDetail">
|
||||||
@@ -113,7 +116,7 @@
|
|||||||
<template v-slot:resultCell="text, record">
|
<template v-slot:resultCell="text, record">
|
||||||
<a-tooltip overlay-class-name="tooltip-style">
|
<a-tooltip overlay-class-name="tooltip-style">
|
||||||
<template slot="title">{{ text }}</template>
|
<template slot="title">{{ text }}</template>
|
||||||
<div class="table-text" :style="{background: record.color}" @click="handleEditCell(text,record)">
|
<div class="table-text" :style="{background: record.colour}" @click="handleEditResult(text,record)">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</div>
|
</div>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
@@ -131,6 +134,8 @@
|
|||||||
<comparison-maintain-drawer ref="comparisonMaintainDrawer" @ok="reloadTableData" />
|
<comparison-maintain-drawer ref="comparisonMaintainDrawer" @ok="reloadTableData" />
|
||||||
<!--单元格数据处理-->
|
<!--单元格数据处理-->
|
||||||
<custom-comparison-cell-drawer ref="cellDrawer" @ok="reloadTableData" />
|
<custom-comparison-cell-drawer ref="cellDrawer" @ok="reloadTableData" />
|
||||||
|
<!--对比分析结果-->
|
||||||
|
<comparison-result-modal ref="resultModal" @ok="reloadTableHasResult" />
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -149,10 +154,18 @@ import {
|
|||||||
} from '../../../../api/documentToolApi'
|
} from '../../../../api/documentToolApi'
|
||||||
import CustomComparisonCellDrawer from './CustomComparisonCellDrawer'
|
import CustomComparisonCellDrawer from './CustomComparisonCellDrawer'
|
||||||
import { getFormDictTreeList } from '../../../../api/api'
|
import { getFormDictTreeList } from '../../../../api/api'
|
||||||
|
import { YesOrNoEnum } from '../../../../enums/commonEnums'
|
||||||
|
import ComparisonResultModal from './ComparisonResultModal'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CustomComparisonDrawer',
|
name: 'CustomComparisonDrawer',
|
||||||
components: { StandardSelection, StandardListDrawer, ComparisonMaintainDrawer, CustomComparisonCellDrawer },
|
components: {
|
||||||
|
StandardSelection,
|
||||||
|
StandardListDrawer,
|
||||||
|
ComparisonMaintainDrawer,
|
||||||
|
CustomComparisonCellDrawer,
|
||||||
|
ComparisonResultModal
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
@@ -203,13 +216,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
title() {
|
title () {
|
||||||
this.isDetail = this.title === this.$t('details')
|
this.isDetail = this.title === this.$t('details')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add () {
|
add () {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
this.modal.isShow = YesOrNoEnum.NO.value
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(this.modal)
|
||||||
|
})
|
||||||
this.initDictConfig()
|
this.initDictConfig()
|
||||||
},
|
},
|
||||||
edit (id) {
|
edit (id) {
|
||||||
@@ -258,7 +275,7 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
|
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
|
||||||
})
|
})
|
||||||
downFile(this.url.exportXlsUrl).then((data) => {
|
downFile('/customCompare/lawsCustomCompareInfo/exportExcel').then((data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
this.$message.warning('文件下载失败')
|
this.$message.warning('文件下载失败')
|
||||||
return
|
return
|
||||||
@@ -291,7 +308,6 @@ export default {
|
|||||||
* 查看标准列表
|
* 查看标准列表
|
||||||
*/
|
*/
|
||||||
viewStandardList () {
|
viewStandardList () {
|
||||||
console.log(this.form.getFieldValue('serialNumber'))
|
|
||||||
this.$refs.standardListDrawer.open(this.modal.id)
|
this.$refs.standardListDrawer.open(this.modal.id)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -307,6 +323,10 @@ export default {
|
|||||||
this.getFormData()
|
this.getFormData()
|
||||||
this.initTableData()
|
this.initTableData()
|
||||||
},
|
},
|
||||||
|
async reloadTableHasResult () {
|
||||||
|
await this.initTableData()
|
||||||
|
this.handleResult()
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 对比维护
|
* 对比维护
|
||||||
*/
|
*/
|
||||||
@@ -349,7 +369,7 @@ export default {
|
|||||||
if (this.specialtyItemList && this.specialtyItemList.length > 0) {
|
if (this.specialtyItemList && this.specialtyItemList.length > 0) {
|
||||||
this.specialtyItemList.forEach((specialtyItem, specialtyItemIndex) => {
|
this.specialtyItemList.forEach((specialtyItem, specialtyItemIndex) => {
|
||||||
objLevelTwo.children.push({
|
objLevelTwo.children.push({
|
||||||
dataIndex: `${standard.standardNumber}-${specialtyItem.id}-label`,
|
dataIndex: `${standard.id}-${specialtyItem.id}-label`,
|
||||||
slots: { title: 'specialtyItem' + standardIndex + specialtyItemIndex },
|
slots: { title: 'specialtyItem' + standardIndex + specialtyItemIndex },
|
||||||
width: 200,
|
width: 200,
|
||||||
customCell (record) {
|
customCell (record) {
|
||||||
@@ -380,15 +400,15 @@ export default {
|
|||||||
const maintainObj = {
|
const maintainObj = {
|
||||||
maintainData, // 维护项的数据
|
maintainData, // 维护项的数据
|
||||||
maintainItem: maintainData.cellTitle, // 维护项显示字段
|
maintainItem: maintainData.cellTitle, // 维护项显示字段
|
||||||
color: maintainData.color, // 对比分析结果列的背景颜色
|
colour: maintainData.colour, // 对比分析结果列的背景颜色
|
||||||
result: maintainData.result // 对比分析结果文本
|
compareResult: maintainData.compareResult // 对比分析结果文本
|
||||||
}
|
}
|
||||||
// 按行筛选出符合条件的单元格数据
|
// 按行筛选出符合条件的单元格数据
|
||||||
const listData = result.list.filter(tt => tt.itemId === maintainData.id)
|
const listData = result.list.filter(tt => tt.compareItemId === maintainData.id)
|
||||||
const obj = {}
|
const obj = {}
|
||||||
listData.forEach(item => {
|
listData.forEach(item => {
|
||||||
obj[`${item.standardId}-${item.compareItemId}-label`] = item.formContent
|
obj[`${item.standardId}-${item.featureId}-label`] = item.content
|
||||||
obj[`${item.standardId}-${item.compareItemId}`] = item
|
obj[`${item.standardId}-${item.featureId}`] = item
|
||||||
|
|
||||||
})
|
})
|
||||||
return { ...maintainObj, ...obj }
|
return { ...maintainObj, ...obj }
|
||||||
@@ -436,14 +456,15 @@ export default {
|
|||||||
* @param record 行数据内容,包含对比项数据
|
* @param record 行数据内容,包含对比项数据
|
||||||
*/
|
*/
|
||||||
handleEditCell (standard, specialtyItem, record) {
|
handleEditCell (standard, specialtyItem, record) {
|
||||||
|
console.log(record)
|
||||||
const params = {
|
const params = {
|
||||||
compareItemId: record.maintainData.id,
|
compareItemId: record.maintainData.id,
|
||||||
featureId: specialtyItem.id,
|
featureId: specialtyItem.id,
|
||||||
infoId: this.modal.id,
|
infoId: this.modal.id,
|
||||||
standardId: standard.id,
|
standardId: standard.id,
|
||||||
content: record.content,
|
content: (record[`${standard.id}-${specialtyItem.id}`] || {}).content,
|
||||||
id: record.id,
|
id: (record[`${standard.id}-${specialtyItem.id}`] || {}).id,
|
||||||
fileId: record.fileId
|
fileId: (record[`${standard.id}-${specialtyItem.id}`] || {}).fileId
|
||||||
}
|
}
|
||||||
this.$refs.cellDrawer.open(params, this.isEdit)
|
this.$refs.cellDrawer.open(params, this.isEdit)
|
||||||
},
|
},
|
||||||
@@ -451,12 +472,12 @@ export default {
|
|||||||
* 比对分析结果,在末尾加一列,如果已经有了,就隐藏这列
|
* 比对分析结果,在末尾加一列,如果已经有了,就隐藏这列
|
||||||
*/
|
*/
|
||||||
handleResult () {
|
handleResult () {
|
||||||
if (this.columns && this.columns.length > 0 && this.columns[this.columns.length - 1].dataIndex === 'result') {
|
if (this.columns && this.columns.length > 0 && this.columns[this.columns.length - 1].dataIndex === 'compareResult') {
|
||||||
this.columns.splice(this.columns.length - 1, 1)
|
this.columns.splice(this.columns.length - 1, 1)
|
||||||
} else {
|
} else {
|
||||||
this.columns.push({
|
this.columns.push({
|
||||||
title: this.$t('docTool.customComparison.comparativeAnalysisResult'),
|
title: this.$t('docTool.customComparison.comparativeAnalysisResult'),
|
||||||
dataIndex: 'result',
|
dataIndex: 'compareResult',
|
||||||
width: 150,
|
width: 150,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
scopedSlots: { customRender: 'resultCell' }
|
scopedSlots: { customRender: 'resultCell' }
|
||||||
@@ -550,22 +571,35 @@ export default {
|
|||||||
* 获取表格数据
|
* 获取表格数据
|
||||||
*/
|
*/
|
||||||
initTableData () {
|
initTableData () {
|
||||||
this.confirmLoading = true
|
return new Promise(resolve => {
|
||||||
getTableData({ infoId: this.modal.id }).then(res => {
|
this.confirmLoading = true
|
||||||
if (res.success) {
|
getTableData({ infoId: this.modal.id }).then(res => {
|
||||||
// 平铺一些数据
|
if (res.success) {
|
||||||
this.processData(res.result || {})
|
// 平铺一些数据
|
||||||
// 把数据处理成表格需要的样子
|
this.processData(res.result || {})
|
||||||
this.processTableData(res.result || {})
|
// 把数据处理成表格需要的样子
|
||||||
} else {
|
this.processTableData(res.result || {})
|
||||||
this.$message.warning(res.message)
|
} else {
|
||||||
}
|
this.$message.warning(res.message)
|
||||||
}).finally(() => {
|
}
|
||||||
this.confirmLoading = false
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
customCell (record, rowIndex) {
|
/**
|
||||||
console.log(record, rowIndex)
|
* 编辑对比分析结果
|
||||||
|
* @param text
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
handleEditResult (text, record) {
|
||||||
|
const params = {
|
||||||
|
id: record.maintainData.id,
|
||||||
|
colour: record.colour,
|
||||||
|
compareResult: record.compareResult
|
||||||
|
}
|
||||||
|
this.$refs.resultModal.open(params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user