update 导入拆分结果,国内海外标准细节调整

This commit is contained in:
赵霄
2023-09-25 15:06:17 +08:00
parent 515ee6d68d
commit 6776041df9
11 changed files with 231 additions and 42 deletions
+9
View File
@@ -380,6 +380,15 @@ module.exports = {
split: 'Split',
article: 'Article',
clauseLabel: 'Clause label',
splitResultFile: 'Split result file',
splitImportResultTip: 'Upload the split result file in accordance with the relevant format requirements, please ',
clickToView: 'click to view',
gotIt: 'Got It',
formatRequirement: 'Format requirement',
formatRequirementContentOne: '1.The imported document is in zip format',
formatRequirementContentTwo: '2.The images are in jpg, jpeg, png, gif format',
formatRequirementContentThree: '3.The image in the document is displayed in the form of a link in the exported excel, click the link to jump to the specified local file',
formatRequirementContentFour: '4.The table in the document is displayed in the form of a link in the exported excel. Click the link to jump to the specified sheet page',
selectFileType: 'Please select a file type',
onlyWord: 'Only word files can be imported',
+9
View File
@@ -380,6 +380,15 @@ module.exports = {
split: '拆分',
article: '条文',
clauseLabel: '条文标签',
splitResultFile: '拆分结果文件',
splitImportResultTip: '上传拆分结果文件需遵循相关格式要求,具体要求请',
clickToView: '点击查看',
gotIt: '知道了',
formatRequirement: '格式要求',
formatRequirementContentOne: '1.导入的文档是zip格式',
formatRequirementContentTwo: '2.图片为jpg、jpeg、png、gif格式',
formatRequirementContentThree: '3.文档中的图片,在导出excel中以链接的形式展示,点击链接跳转到本地指定的文件',
formatRequirementContentFour: '4.文档中的表格,在导出excel中以链接的形式展示,点击链接跳转到指定的sheet页面',
selectFileType: '请选择文件类型',
onlyWord: '只能导入word文件',
+3
View File
@@ -214,6 +214,7 @@
v-model="formInline[item.dbFieldName]"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:tree-data="optionsData[item.dbFieldName]"
tree-checkable
treeCheckStrictly
@@ -232,6 +233,7 @@
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<j-date show-type="year"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
v-model="formInline[item.dbFieldName]"
:default-value="defaultValue[item.dbFieldName]"
date-format="YYYY"
@@ -251,6 +253,7 @@
v-model="formInline[item.dbFieldName]"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:tree-data="optionsData[item.dbFieldName]"
:label-in-value="false"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
@@ -30,7 +30,7 @@
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchReset" icon="reload" ghost>{{ $t('reset') }}</a-button>
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px" v-has="'split:sarFileSplitInfo:search'">
{{ $t('query') }}
</a-button>
</span>
@@ -86,25 +86,23 @@
</div>
<!--拆分已入库文本弹框-->
<split-text ref="splitText" @visible="splitTextVisible"></split-text>
<!--导入拆分结果弹框-->
<import-result ref="importResult" @visible="importResultVisible"></import-result>
<split-text ref="splitText" @ok="modalFormOk" />
<!--导入拆分结果-->
<import-split-result-modal ref="importResultModal" @ok="modalFormOk" />
</a-card>
</template>
<script>
import '../../../assets/less/common.less'
import JTable from '../../../components/jero/JTable.vue'
// 拆分已入库文本弹框
import SplitText from './modules/SplitText.vue'
// 导入拆分结果弹框
import ImportResult from '../modules/ImportResult.vue'
import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
import { releaseSplitStandard } from '../../../api/documentToolApi.js'
import ImportSplitResultModal from './modules/ImportSplitResultModal.vue'
export default {
name: 'DocumentSplit',
components: { JTable, SplitText, ImportResult },
components: { JTable, SplitText, ImportSplitResultModal },
mixins: [JeroListMixin],
data () {
return {
@@ -113,25 +111,25 @@ export default {
{
text: this.$t('release'),
clickEvent: 'handleRelease',
has: ''
has: 'split:sarFileSplitInfo:release'
},
// 查看
{
text: this.$t('view'),
clickEvent: 'handleDetail',
has: ''
has: 'split:sarFileSplitItems:page'
},
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: ''
has: 'split:sarFileSplitItems:edit'
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: ''
has: 'split:sarFileSplitInfo:delete'
}
],
columns: [
@@ -210,7 +208,7 @@ export default {
},
// 导入拆分结果
handleExport () {
this.$refs.importResult.open()
this.$refs.importResultModal.open()
},
/**
* 发布
@@ -234,7 +232,7 @@ export default {
}
})
},
// 表格操作列的查看
// 编辑
handleEdit (record) {
this.$router.push({
path: '/documentTool/DocumentSplitDetail',
@@ -246,6 +244,10 @@ export default {
}
})
},
/**
* 表格操作列的查看
* @param record
*/
handleDetail (record) {
this.$openPageNewSheet({
path: '/documentTool/StandardSplitSheet'
@@ -87,20 +87,21 @@
<search ref="searchRef"
:url="url"
:get-query-condition-func="getQueryConditionFunc"
search-has="domesticStandard:search"
search-has="split:sarFileSplitItems:search"
@search="searchQuery"
@reset="searchReset" />
</div>
<!--操作按钮-->
<div class="table-operator">
<!--新增-->
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'domesticStandard:add'">{{ $t('newlyAdded') }}</a-button>
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'split:sarFileSplitItems:add'">{{ $t('newlyAdded') }}</a-button>
<!--导入-->
<a-upload name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
v-has="'split:sarFileSplitItems:import'"
@change="handleImportExcel">
<a-button type="primary" icon="download" ghost>{{ $t('import') }}</a-button>
</a-upload>
@@ -108,24 +109,32 @@
<a-button icon="upload"
type="primary"
ghost
v-has="'split:sarFileSplitItems:export'"
@click="handleExportXls($t('standardRegulationLibrary.domesticStandard.exportFileName'))">
{{ $t('export') }}
</a-button>
<!--批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'domesticStandard:batchDel'">{{ $t('batchDelete') }}</a-button>
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'split:sarFileSplitItems:delete'">{{ $t('batchDelete') }}</a-button>
<!--模板下载-->
<a-button type="primary"
icon="download"
ghost
v-has="'split:sarFileSplitItems:template'"
@click="downTemplate($t('standardRegulationLibrary.domesticStandard.templateName'))">
{{ $t('templateDownload') }}
</a-button>
<!--批量复制-->
<a-button type="primary" ghost @click="handleCopyManage">{{ $t('docTool.split.batchCopy') }}</a-button>
<a-button type="primary" ghost @click="handleCopyManage" v-has="'split:sarFileSplitItems:copy'">
{{ $t('docTool.split.batchCopy') }}
</a-button>
<!--批量编辑-->
<a-button type="primary" ghost @click="handleManage">{{ $t('docTool.split.batchEdit') }}</a-button>
<a-button type="primary" ghost @click="handleManage" v-has="'split:sarFileSplitItems:batchUpdate'">
{{ $t('docTool.split.batchEdit') }}
</a-button>
<!--合并条款-->
<a-button type="primary" ghost @click="handleMergeManage">{{ $t('docTool.split.mergerClause') }}</a-button>
<a-button type="primary" ghost @click="handleMergeManage" v-has="'split:sarFileSplitItems:merge'">
{{ $t('docTool.split.mergerClause') }}
</a-button>
</div>
<div>
<j-table
@@ -137,17 +146,9 @@
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:scroll="{x: '100%'}"
:operation-list="operationList"
@change="tableOnChange">
<template slot="operation" slot-scope="{text, record}">
<a v-for="(operation, index) in operationList" :key="index" @click="operationClick(operation,record)">
<!-- v-has="operation.has"-->
<span class="text">
{{ operation.text }}
</span>
</a>
</template>
<!-- 详情-->
<template slot="detailClick" slot-scope="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
@@ -248,11 +249,13 @@ export default {
operationList: [
{
text: this.$t('edit'),
ClickEvent: 'handleEdit'
clickEvent: 'handleEdit',
has: 'split:sarFileSplitItems:update'
},
{
text: this.$t('delete'),
ClickEvent: 'handleDelete'
clickEvent: 'handleDelete',
has: 'split:sarFileSplitItems:delete'
}
],
url: {
@@ -0,0 +1,152 @@
<template>
<j-modal
:title="$t('docTool.split.importResults')"
:width="width"
:visible="visible"
switchFullscreen
:maskClosable="false"
:confirmLoading="confirmLoading"
:ok-text="$t('docTool.split.split')"
:cancel-text="$t('cancel')"
@ok="handleOk"
@cancel="handleCancel">
<a-form :form="form">
<!--标准号-->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardSelect.standardNumber')">
<standard-selection :placeholder="$t('pleaseSelect') + $t('standardSelect.standardNumber')"
v-decorator="['projectSource', validatorRules.projectSource]" />
</a-form-item>
<!--标准名称-->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardSelect.standardName')">
<a-input :placeholder="$t('pleaseEnter') + $t('standardSelect.standardName')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="50"
v-decorator="['projectName', validatorRules.projectName]" />
</a-form-item>
<!--文本状态-->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('docTool.comparison.textStatus')">
<j-dict-select-tag v-decorator="['projectSource', validatorRules.projectSource]"
dict-code="process_manuscript"
:placeholder="$t('pleaseSelect') + $t('docTool.comparison.textStatus')" />
</a-form-item>
<!--拆分结果文件-->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('docTool.split.splitResultFile')">
<j-upload v-decorator="['resultFileId', validatorRules.resultFileId]" class="line-btn" />
<a-button class="line-btn">{{ $t('templateDownload') }}</a-button>
</a-form-item>
</a-form>
<div class="tip">
<a-icon type="exclamation-circle" class="tip-icon" />
<span>{{ $t('docTool.split.splitImportResultTip') }}</span>
<span class="tip-click" @click="showTips">{{ $t('docTool.split.clickToView') }}</span>
</div>
</j-modal>
</template>
<script>
import StandardSelection from '../../../../components/selection/StandardSelection.vue'
export default {
name: 'ImportSplitResultModal',
components: { StandardSelection },
data () {
return {
width: 600,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
validatorRules: {
// 项目来源
projectSource: {
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.nodeName') }],
validateTrigger: 'change'
},
// 项目名称
projectName: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('projectLibrary.projectName') }],
validateTrigger: 'blur'
},
// 工作令编号
workNumber: {
rules: [{ required: false, message: this.$t('pleaseEnter') + this.$t('projectLibrary.workOrderNumber') }],
validateTrigger: 'blur'
},
// 项目负责人
projectLeader: {
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('projectLibrary.vehicleItemLibrary.projectLeader') }],
validateTrigger: 'change'
},
// 项目健康度
projectHealth: {
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('projectLibrary.projectHealthStatus') }],
validateTrigger: 'change'
}
}
}
},
methods: {
open () {
this.visible = true
},
handleOk () {
},
handleCancel () {
this.close()
},
close () {
this.visible = false
},
showTips () {
this.$info({
closeable: true, // 展示右上角关闭
cancelText: this.$t('docTool.split.gotIt'),
title: this.$t('docTool.split.formatRequirement'),
content: (h) => {
const contentArr = [this.$t('docTool.split.formatRequirementContentOne'), this.$t('docTool.split.formatRequirementContentTwo'), this.$t('docTool.split.formatRequirementContentThree'), this.$t('docTool.split.formatRequirementContentFour')]
const contentDomArr = []
for (const content of contentArr) {
console.log(content)
contentDomArr.push(h('div', {}, content))
}
return contentDomArr
}
})
}
}
}
</script>
<style scoped lang="less">
.line-btn {
display: inline-block;
}
.line-btn:last-child {
margin-left: 12px;
}
.tip {
margin: 0 42px;
&-icon {
color: @primary-color;
margin-right: 8px;
}
&-click {
color: @primary-color;
cursor: pointer;
}
}
</style>
@@ -143,12 +143,10 @@ export default {
// 抽屉关闭
onClose () {
this.visible = false
this.$emit('visible', false)
},
// 取消
cancelSplit () {
this.visible = false
this.$emit('visible', false)
},
// 拆分
submitSplit () {
@@ -166,14 +164,15 @@ export default {
const nameSuffix = name[name.length - 1]
if (nameSuffix.toLowerCase() === 'doc' || nameSuffix.toLowerCase() === 'docx') {
const params = {
id: file.id
fileId: file.id,
id: '2'
}
this.loading = true
addDocSplit(params).then(res => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.visible = false
this.$emit('visible', false, 1)
this.$emit('ok')
} else {
this.$message.warning(res.message)
}
@@ -275,7 +275,13 @@ export default {
*/
initTreeData () {
this.treeLoading = true
getDomesticStandardTree({ nodeName: this.treeInput }).then(res => {
const params = {
nodeName: this.treeInput
}
if (!params.nodeName) {
delete params.nodeName
}
getDomesticStandardTree(params).then(res => {
this.treeData = []
this.selectedTreeKeys = []
this.selectedTreeNodeCodes = []
@@ -53,7 +53,7 @@ export default {
getDocumentInfoFunc: getDomesticStandardDocumentInfo,
// 特殊的placeholder
specialPlaceholder: {
standard_number: `${this.$t('standardRegulationLibrary.inputExample')}7258`
standard_number_temp: `${this.$t('standardRegulationLibrary.inputExample')}7258`
},
defaultValue: {
year_number: new Date().getFullYear() + ''
@@ -65,8 +65,8 @@ export default {
// 不可编辑的字段
disabledField () {
if (this.isEdit) {
// 标准编号,被代替标准号,被引用标准号
return ['standard_number_temp', 'replaced_by_standard_number', 'referenced_standard']
// 标准编号,被代替标准号,被引用标准号,标准类别,年代号
return ['standard_number_temp', 'replaced_by_standard_number', 'referenced_standard', 'standard_class', 'year_number']
}
return ['replaced_by_standard_number', 'referenced_standard']
}
@@ -275,7 +275,13 @@ export default {
*/
initTreeData () {
this.treeLoading = true
getOverseasStandardSystem({ nodeName: this.treeInput }).then(res => {
const params = {
nodeName: this.treeInput
}
if (!params.nodeName) {
delete params.nodeName
}
getOverseasStandardSystem(params).then(res => {
this.treeData = []
this.selectedTreeKeys = []
this.selectedTreeNodeCodes = []
@@ -593,7 +599,7 @@ export default {
// 销毁这个提示
modalLoading.destroy()
})
},
}
}
}
</script>
@@ -53,7 +53,7 @@ export default {
getDocumentInfoFunc: getOverseasStandardDocumentInfo,
// 特殊的placeholder
specialPlaceholder: {
standard_number: `${this.$t('standardRegulationLibrary.inputExample')}7258`
standard_number_temp: `${this.$t('standardRegulationLibrary.inputExample')}7258`
},
defaultValue: {
year_number: new Date().getFullYear() + ''