update 树节点修改,标准分解单样式调整

This commit is contained in:
赵霄
2023-09-21 15:29:16 +08:00
parent 02a9f8e792
commit 0396d2ac40
13 changed files with 482 additions and 358 deletions
+3
View File
@@ -7,6 +7,8 @@ const releaseSplitStandard = (params) => postAction('', params)
const getDocSplitTableHeader = (params) => getAction('', params)
// 文档拆分详情-查询条件
const getDocSplitSearch = (params) => getAction('', params)
// 文档拆分-拆分已入库文本-拆分
const addDocSplit = (params) => postAction('/split/sarFileSplitInfo/add', params)
// 文档对比-发布/撤回
const withdrawPublication = (params) => postAction('/compare/sarFileCompareInfo/changeState', params)
@@ -40,6 +42,7 @@ export {
// 文档拆分-详情
getDocSplitTableHeader,
getDocSplitSearch,
addDocSplit,
// 文档比对
withdrawPublication,
+4
View File
@@ -376,6 +376,10 @@ module.exports = {
batchCopy: 'Batch copy',
batchEdit: 'Batch edit',
mergerClause: 'Merge Item',
dataType: 'Data type',
split: 'Split',
article: 'Article',
clauseLabel: 'Clause label',
selectFileType: 'Please select a file type',
onlyWord: 'Only word files can be imported',
+4
View File
@@ -376,6 +376,10 @@ module.exports = {
batchCopy: '批量复制',
batchEdit: '批量编辑',
mergerClause: '合并条款',
dataType: '资料类型',
split: '拆分',
article: '条文',
clauseLabel: '条文标签',
selectFileType: '请选择文件类型',
onlyWord: '只能导入word文件',
+149 -34
View File
@@ -1,10 +1,18 @@
<template>
<div class="sheet-box">
<!--标准目录-->
<div class="standard-catalogue part-common">
<div class="part-title">{{ $t('standardRegulationLibrary.standardCatalogue') }}</div>
<div class="has-title-part-content">
<a-tree :show-line="false" :show-icon="false" :tree-data="treeData" :selected-keys="selectedTreeKeys" @select="handleTreeSelected">
<div class="standard-catalogue part-common"
:class="isCatalogueExpand ? 'expand-catalogue' : 'no-expand-catalogue'">
<div class="control-standard-catalogue-expand" @click="expandCatalogue">
<a-icon :type="isCatalogueExpand ? 'left' : 'right'" />
</div>
<div class="part-title" v-show="isCatalogueExpand">{{ $t('standardRegulationLibrary.standardCatalogue') }}</div>
<div class="has-title-part-content" v-show="isCatalogueExpand">
<a-tree :tree-data="treeData" :selected-keys="selectedTreeKeys" @select="handleTreeSelected">
<a-icon slot="switcherIcon" type="down" :style="{ fontSize: '12px', color: '#103770' }" />
<template slot="title" slot-scope="{termsNum}">
<span :style="termsNum && termsNum.indexOf('.')===-1?'font-weight: 600;':''">{{ termsNum + '' + termsName }}</span>
</template>
</a-tree>
</div>
</div>
@@ -18,15 +26,15 @@
</template>
<span></span>
</a-tooltip>
<a-button type="link" :icon="showClauseLable ? 'fullscreen' : 'fullscreen-exit'" @click="handleClauseChange(!showClauseLable)">
{{ showClauseLable ? $t('open') : $t('putAway') }}
<a-button type="link" :icon="isContainerExpand ? 'fullscreen-exit' : 'fullscreen'" @click="handleContainerExpand">
{{ isContainerExpand ? $t('putAway') : $t('open') }}
</a-button>
</div>
<!--条文内容-->
<div class="standard-content"></div>
</div>
<!--条文标签-->
<div class="clause-label part-ml part-common" v-show="showClauseLable">
<div class="clause-label part-ml part-common" :class="{'hide-clause-label': !showClauseLabel || isContainerExpand}">
<div class="part-title">{{ $t('standardRegulationLibrary.clauseLabel') }}</div>
<div class="has-title-part-content">
<div class="clause-item" v-for="(clause, index) in clauseField" :key="index">
@@ -36,17 +44,26 @@
</div>
</div>
<!--条文条文标签切换-->
<div class="clause-label-change part-ml part-common">
<div class="clause-label-change part-ml part-common" :class="{'no-expand-clause-label': !isClauseLabelExpand}">
<div class="control-clause-label-expand" @click="expandClauseLabel">
<a-icon :type="isClauseLabelExpand ? 'right' : 'left'" />
</div>
<!--条文-->
<div class="clause-label-change-item" :class="{'clause-label-change-item-selected': !showClauseLable}" @click="handleClauseChange(false)">
<i class="iconfont icon-ios-list-box" />
<span>条文</span>
</div>
<a-tooltip placement="left">
<template #title>{{ $t('docTool.split.article') }}</template>
<div class="clause-label-change-item" :class="{'clause-label-change-item-selected': !showClauseLabel}" @click="handleClauseChange(false)">
<i class="iconfont icon-ios-list-box" />
<span v-show="isClauseLabelExpand">{{ $t('docTool.split.article') }}</span>
</div>
</a-tooltip>
<!--条文标签-->
<div class="clause-label-change-item" :class="{'clause-label-change-item-selected': showClauseLable}" @click="handleClauseChange(true)">
<i class="iconfont icon-biaoqian-mianxing" />
<span>条文标签</span>
</div>
<a-tooltip placement="left">
<template #title>{{ $t('docTool.split.clauseLabel') }}</template>
<div class="clause-label-change-item" :class="{'clause-label-change-item-selected': showClauseLabel}" @click="handleClauseChange(true)">
<i class="iconfont icon-biaoqian-mianxing" />
<span v-show="isClauseLabelExpand">{{ $t('docTool.split.clauseLabel') }}</span>
</div>
</a-tooltip>
</div>
</div>
</template>
@@ -58,7 +75,8 @@ export default {
name: 'StandardResolutionSheet',
data () {
return {
showClauseLable: true, // 是否展示条文标签
showClauseLabel: true, // 是否展示条文标签
// 条文标签字段
clauseField: [
// 条文号
{
@@ -121,6 +139,7 @@ export default {
fieldName: ''
}
],
// 目录数据
treeData: [
{
title: '0-0',
@@ -147,15 +166,42 @@ export default {
]
}
],
selectedTreeKeys: []
selectedTreeKeys: [],
isClauseLabelExpand: true, // 条文/条文标签切换部分是否展开,控制是否只显示图标
isCatalogueExpand: true, // 标准目录收起
isContainerExpand: false, // 条文是否展开
isInitPage: true // 是否初始化页面
}
},
mounted () {
this.$nextTick(() => {
this.isInitPage = false
})
},
methods: {
handleTreeSelected (selectedKeys) {
this.selectedTreeKeys = selectedKeys
},
handleContainerExpand () {
this.isContainerExpand = !this.isContainerExpand
if (this.isContainerExpand) {
this.isCatalogueExpand = false
} else {
this.isCatalogueExpand = true
}
},
/**
*
* @param flag
*/
handleClauseChange (flag) {
this.showClauseLable = flag
this.showClauseLabel = flag
},
expandClauseLabel () {
this.isClauseLabelExpand = !this.isClauseLabelExpand
},
expandCatalogue () {
this.isCatalogueExpand = !this.isCatalogueExpand
}
}
}
@@ -180,8 +226,8 @@ export default {
.standard-catalogue {
height: 100%;
width: 15%;
min-width: 280px;
position: relative;
transition: width .2s linear;
/deep/ .ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected {
background-color: transparent !important;
@@ -189,27 +235,59 @@ export default {
}
}
.control-standard-catalogue-expand {
width: 12px;
height: 24px;
border-radius: 0 12px 12px 0;
background-color: @primary-color;
color: white;
position: absolute;
left: 100%;
top: calc(50% - 52px);
.anticon {
position: absolute;
top: 50%;
left: -2px;
transform: translateY(-50%);
cursor: pointer;
}
}
.expand-catalogue {
width: 280px;
}
.no-expand-catalogue {
width: 0;
}
.sheet-container {
height: 100%;
flex: 1;
width: 0;
transition: width .2s linear;
}
.clause-label {
width: 25%;
min-width: 400px;
width: 400px;
height: 100%;
overflow: hidden;
transition: width .2s linear;
.clause-item {
display: flex;
margin-bottom: 20px;
label {
width: 12rem;
width: 7em;
font-size: 14px;
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
color: #86909C;
margin-right: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
span {
@@ -222,14 +300,20 @@ export default {
}
}
.hide-clause-label {
width: 0;
margin-left: 0;
}
.clause-label-change {
width: 6%;
min-width: 130px;
width: 130px;
height: 100%;
padding-top: 56px;
padding-top: 40px;
position: relative;
transition: width .2s linear;
&-item {
height: 56px;
height: 40px;
display: flex;
align-items: center;
padding: 0 16px;
@@ -245,6 +329,8 @@ export default {
span {
margin-left: 8px;
white-space: nowrap;
overflow: hidden;
}
}
@@ -253,33 +339,40 @@ export default {
}
}
.no-expand-clause-label {
width: 45px;
min-width: 45px;
}
.part-title {
height: 56px;
height: 40px;
background: rgba(213, 44, 38, 0.12);
border-radius: 8px 8px 0 0;
line-height: 56px;
line-height: 40px;
padding: 0 24px;
font-size: 16px;
font-family: PingFang SC-Semibold, PingFang SC, sans-serif;
font-weight: 600;
color: #1D2129;
white-space: nowrap;
overflow: hidden;
}
.has-title-part-content {
height: calc(100% - 56px);
height: calc(100% - 40px);
overflow: auto;
padding: 24px;
}
.standard-name {
height: 56px;
height: 40px;
background: #FFFFFF;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24px;
margin-bottom: 16px;
margin-bottom: 5px;
}
.standard-name > span {
@@ -296,10 +389,32 @@ export default {
}
.standard-content {
height: calc(100% - 72px);
height: calc(100% - 45px);
background: #FFFFFF;
border-radius: 8px;
overflow: auto;
padding: 24px;
}
.control-clause-label-expand {
position: absolute;
width: 12px;
height: 24px;
background-color: @primary-color;
border-radius: 12px 0 0 12px;
left: -12px;
top: calc(50% - 52px);
color: white;
cursor: pointer;
.anticon {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
}
/deep/ .ant-tree li span.ant-tree-switcher {
float: right;
}
</style>
@@ -205,7 +205,8 @@ export default {
clickEvent: 'edit',
has: 'documentComparison:edit',
show: (record) => {
return (record.createBy === this.userInfo.username || this.administrators) && record.releaseState === 'draft'
// return (record.createBy === this.userInfo.username || this.administrators) && record.releaseState === 'draft'
return true
}
},
// 删除
@@ -693,6 +693,7 @@ export default {
overflow-y: auto;
transition: all 1s;
scroll-behavior: smooth;
flex: 1;
}
.detail-content-content-right-right-top {
@@ -700,15 +701,11 @@ export default {
overflow-y: auto;
transition: all 1s;
scroll-behavior: smooth;
flex: 1;
.standard-name {
margin-right: 0;
}
.detail-content-content-right-right {
margin-right: 0;
width: calc(100% - 10px);
}
}
.detail-content-content-right {
@@ -717,14 +714,16 @@ export default {
display: inline-block;
margin: 0 10px 0 10px;
overflow: auto;
background-color: white;
}
.detail-content-content-right-right {
height: calc(100% - 25px - 40px);
width: calc(100% - 20px);
width: calc(100% - 10px);
display: inline-block;
margin: 0 10px 0 10px;
margin-left: 10px;
overflow: auto;
background-color: white;
}
.detail-content-content-right-data {
@@ -838,10 +837,10 @@ export default {
.standard-catalogue {
height: calc(100% - 20px);
width: 15%;
min-width: 200px;
width: 200px;
margin: 10px 10px 10px 0;
position: relative;
transition: width .2s linear;
/deep/ .ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected {
background-color: transparent !important;
@@ -884,6 +883,8 @@ export default {
font-family: PingFang SC-Semibold, PingFang SC, sans-serif;
font-weight: 600;
color: #1D2129;
white-space: nowrap;
overflow: hidden;
}
.has-title-part-content {
@@ -96,7 +96,7 @@
import '../../../assets/less/common.less'
import JTable from '../../../components/jero/JTable.vue'
// 拆分已入库文本弹框
import SplitText from '../modules/SplitText.vue'
import SplitText from './modules/SplitText.vue'
// 导入拆分结果弹框
import ImportResult from '../modules/ImportResult.vue'
import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
@@ -137,25 +137,25 @@ export default {
columns: [
// 标准号
{
dataIndex: '1',
dataIndex: 'serialNumber',
title: this.$t('standardSelect.standardNumber'),
width: 150
},
// 标准名称
{
dataIndex: '2',
dataIndex: 'title',
title: this.$t('standardSelect.standardName'),
width: 150
},
// 文件状态
{
dataIndex: '3',
dataIndex: 'fileType',
title: this.$t('docTool.split.fileStatus'),
width: 150
},
// 文件名称
{
dataIndex: '4',
dataIndex: 'fileName',
title: this.$t('fileName'),
width: 150
},
@@ -173,13 +173,13 @@ export default {
},
// 拆分时间
{
dataIndex: '7',
dataIndex: 'createTime',
title: this.$t('docTool.split.splitTime'),
width: 150
},
// 拆分结果
{
dataIndex: '91',
dataIndex: 'splitResult',
title: this.$t('docTool.split.splitResult'),
sorter: true,
width: 150
@@ -246,6 +246,11 @@ export default {
}
})
},
handleDetail (record) {
this.$openPageNewSheet({
path: '/documentTool/StandardSplitSheet'
})
},
splitTextVisible (val, num) {
if (num === 1) {
this.$refs.tableData.$emit('searchGetData')
@@ -6,15 +6,14 @@
<a-input-search class="tree-search" v-model="searchValue" :placeholder="$t('nodeQuickLookup')" @search="onSearch" />
<div class="page-tree-box page-tree-box-has-search">
<a-spin :spinning="loading">
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData" :selected-keys="selectedKeys">
<a-icon type="folder" slot="folder" class="tree-icon" />
<a-icon type="file" slot="file" class="tree-icon" />
<a-tree :show-line="true" :show-icon="false" :tree-data="treeData" :selected-keys="selectedKeys">
<template #custom="record">
<template #title="record">
<div class="tree-operate-node"
@mouseenter="handleTreeMouseover(record.key)"
@mouseleave="handleTreeMouseout(record.key)"
@click="handleSelectTreeNode(record)">
<a-icon class="parent-node-icon" type="folder" v-if="record.dataRef.children && record.dataRef.children.length > 0" />
<a-tooltip>
<template #title>
{{ record.title }}
@@ -561,4 +560,15 @@ export default {
width: 100%;
display: flex;
}
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
color: #1D2129;
}
.parent-node-icon {
color: #1D2129;
font-size: 16px;
margin-right: 10px;
}
</style>
@@ -0,0 +1,27 @@
<template>
<div class="split-content">
<standard-resolution-sheet></standard-resolution-sheet>
</div>
</template>
<script>
import '@assets/less/common.less'
import StandardResolutionSheet from '../../../components/StandardResolutionSheet.vue'
export default {
name: 'StandardSplitSheet',
components: { StandardResolutionSheet }
}
</script>
<style scoped lang="less">
.split-content {
height: 100vh;
padding: 20px 0 20px 20px;
background-color: #eff1f4;
}
/deep/ .clause-label-change {
border-radius: 0;
}
</style>
@@ -0,0 +1,241 @@
<template>
<a-drawer
:title="$t('docTool.split.splitText')"
placement="right"
:visible="visible"
@close="onClose"
width="1100"
class="custom-drawer-style">
<div class="custom-drawer-style-scroll">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row :gutter="24">
<!--来源-->
<a-col :md="8" :sm="12">
<a-form-item :label="$t('standardSelect.source')">
<j-dict-select-tag
class="box-input"
v-model="queryParam.projectHealth"
:placeholder="$t('pleaseSelect') + $t('standardSelect.source')"
:type="'select'"
:triggerChange="false"
:dictCode="'project_health'" />
</a-form-item>
</a-col>
<!--标准号-->
<a-col :md="8" :sm="12">
<a-form-item :label="$t('standardSelect.standardNumber')">
<j-input :placeholder="$t('pleaseEnter') + $t('standardSelect.standardNumber')" v-model="queryParam.projectName"></j-input>
</a-form-item>
</a-col>
<!--标准名称-->
<a-col :md="8" :sm="12">
<a-form-item :label="$t('standardSelect.standardName')">
<j-input :placeholder="$t('pleaseEnter') + $t('standardSelect.standardName')" v-model="queryParam.projectName"></j-input>
</a-form-item>
</a-col>
<!--文本状态-->
<a-col :md="8" :sm="12">
<a-form-item :label="$t('docTool.comparison.textStatus')">
<j-dict-select-tag
class="box-input"
v-model="queryParam.projectHealth"
:placeholder="$t('pleaseSelect') + $t('docTool.comparison.textStatus')"
:type="'select'"
:triggerChange="false"
:dictCode="'project_health'" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<div 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">
{{ $t('query') }}
</a-button>
</div>
</div>
<j-table
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:loading="loading"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }"
:pagination="ipagination"
@change="handleTableChange">
</j-table>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="cancelSplit" style='margin-right: 15px'>{{ $t('cancel') }}</a-button>
<a-button type="primary" :loading="loading" @click="submitSplit">{{ $t('docTool.split.split') }}</a-button>
</div>
</a-drawer>
</template>
<script>
import JTable from '../../../../components/jero/JTable.vue'
import { postAction, httpAction } from '../../../../api/manage.js'
import { JeroListMixin } from '../../../../mixins/JeroListMixin.js'
import { addDocSplit } from '../../../../api/documentToolApi.js'
export default {
name: 'SplitText',
components: { JTable },
mixins: [JeroListMixin],
data () {
return {
visible: false,
loading: false,
fileGroup: '',
selectedRowKeys: [],
selectedRows: [],
queryParam: {},
labelCol: {
span: 6
},
wrapperCol: {
span: 14
},
columns: [
// 资料类型
{
dataIndex: '1',
title: this.$t('docTool.split.dataType'),
width: 150
},
// 标准号
{
dataIndex: 'serial_number',
title: this.$t('standardSelect.standardNumber'),
width: 150
},
// 标准名称
{
dataIndex: 'title',
title: this.$t('standardSelect.standardName'),
width: 150
},
// 文件状态
{
dataIndex: 'text_info',
title: this.$t('docTool.split.fileStatus'),
width: 150
},
// 附件
{
dataIndex: 'file_name',
title: this.$t('businessSupport.questionAnswer.attach'),
width: 150
}
],
url: {
list: '/split/sarFileSplitInfo/splitFilePageInfo', // 表格数据
addSplit: '/split/sarFileSplitInfo/add'
},
type: 'pdfdoc',
operationList: [],
showAction: false,
flag: 'header',
disableMixinCreated: true
}
},
methods: {
open () {
this.visible = true
this.loadData()
},
// 抽屉关闭
onClose () {
this.visible = false
this.$emit('visible', false)
},
loadData (arg) {
if (!this.url.list) {
this.$message.error('请设置url.list属性!')
return
}
// 加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1
}
const params = this.getQueryParams()// 查询条件
this.loading = true
postAction(this.url.list, params).then((res) => {
if (res.success) {
// update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
this.dataSource = res.result.records || res.result
if (res.result.total) {
this.ipagination.total = res.result.total
} else {
this.ipagination.total = 0
}
// update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 取消
cancelSplit () {
this.visible = false
this.$emit('visible', false)
},
// 拆分
submitSplit () {
if (this.loading) {
return
}
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectOne'))
return
}
const file = this.selectedRows[0]
if (file.file_name) {
const name = file.file_name.split('.')
const nameSuffix = name[name.length - 1]
if (nameSuffix.toLowerCase() === 'doc' || nameSuffix.toLowerCase() === 'docx') {
const params = {
attId: file.id,
title: file.title,
titleEn: file.title_en,
fileName: file.file_name,
serialNumber: file.serial_number,
connectId: file.connect_id,
fileGroup: this.fileGroup,
fileType: file.text_info_id
}
this.loading = true
addDocSplit(params).then(res => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.visible = false
this.$emit('visible', false, 1)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
} else {
this.$message.warning(this.$t('docTool.split.onlyWord'))
}
}
}
}
}
</script>
<style scoped lang="less">
@import '~../../../../assets/less/common.less';
.table-page-search-wrapper {
display: flex;
}
.table-page-search-submitButtons {
margin-left: 10px;
}
</style>
@@ -1,238 +0,0 @@
<template>
<a-drawer
:title="$t('docTool.split.splitText')"
placement="right"
:visible="visible"
@close="onClose"
width="1100"
>
<div class="table-page-search-wrapper">
<search :url="url" flag="condition" :minLength="2" @search="searchQuery" @reset="searchReset"></search>
</div>
<div class="operator-select">
<a-row :gutter="24">
<a-col :md="8">
<div class="box-title-text">
<div class="title-text" :title="$t('docTool.split.fileType')">
<span><i class="required">*</i>{{ $t('docTool.split.fileType') }}</span>
</div>
<a-select v-model="fileGroup" :placeholder="$t('pleaseSelect') + $t('docTool.split.fileType')"
class="box-input">
<a-select-option value="GSO" key="GSO" :title="$t('docTool.split.gso')">
{{$t('docTool.split.gso')}}
</a-select-option>
<a-select-option value="KMVSS_Table" key="KMVSS_Table" :title="$t('docTool.split.kmvssTable')">
{{$t('docTool.split.kmvssTable')}}
</a-select-option>
<a-select-option value="KMVSS_Article" key="KMVSS_Article" :title="$t('docTool.split.kmvssArticle')">
{{$t('docTool.split.kmvssArticle')}}
</a-select-option>
<a-select-option value="CFR" key="CFR" :title="$t('docTool.split.cfr')">
{{$t('docTool.split.cfr')}}
</a-select-option>
<a-select-option value="UNECE" key="UNECE" :title="$t('docTool.split.unece')">
{{$t('docTool.split.unece')}}
</a-select-option>
<a-select-option value="JPN_Attachment" key="JPN_Attachment" :title="$t('docTool.split.jpnAttachment')">
{{$t('docTool.split.jpnAttachment')}}
</a-select-option>
<a-select-option value="JPN_Article" key="JPN_Article" :title="$t('docTool.split.jpnArticle')">
{{$t('docTool.split.jpnArticle')}}
</a-select-option>
<a-select-option value="GB" key="GB" :title="$t('docTool.split.gb')">
{{$t('docTool.split.gb')}}
</a-select-option>
<a-select-option value="GBT" key="GBT" :title="$t('docTool.split.gbt')">
{{$t('docTool.split.gbt')}}
</a-select-option>
</a-select>
</div>
</a-col>
</a-row>
</div>
<j-table
v-if="columns && columns.length > 0"
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }"
:pagination="ipagination"
:scroll="{x: '100%'}"
@change="tableOnChange">
</j-table>
<div class="drawer-bootom-button">
<a-button @click="cancelSplit" style='margin-right: 15px'>{{$t('cancel')}}</a-button>
<a-button type="primary" :loading="loading" @click="submitSplit">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import Search from '@/components/customField/Search'
import JTable from '@/components/jero/JTable'
import { httpAction } from '@/api/manage'
import { ConfigurableTableMixin } from '../../../mixins/ConfigurableTableMixin'
export default {
name: 'SplitText',
components: { Search, JTable },
mixins: [ConfigurableTableMixin],
data () {
return {
visible: false,
loading: false,
fileGroup: '',
selectedRowKeys: [],
selectedRows: [],
url: {
// tableHeader: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplitResult', // 表格头部字段
searchList: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplitResult', // 搜索字段
tableList: 'split/sarFileSplitInfo/splitFilePageInfo', // 表格数据
addSplit: ''
},
type: 'pdfdoc',
operationList: [],
showAction: false,
flag: 'header'
}
},
methods: {
open () {
this.visible = true
},
// 抽屉关闭
onClose () {
this.visible = false
this.$emit('visible', false)
},
// 表格选中改变
onSelectChange (keys, rows) {
this.selectedRowKeys = keys
this.selectedRows = rows
},
// 取消
cancelSplit () {
this.visible = false
this.$emit('visible', false)
},
// 拆分
submitSplit () {
if (this.loading) {
return
}
if (!this.fileGroup) {
this.$message.warning(this.$t('docTool.split.selectFileType'))
} else if (this.selectedRowKeys === undefined || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectOne'))
} else if (this.selectedRowKeys && this.selectedRowKeys.length === 1) {
const file = this.selectedRows[0]
if (file.file_name) {
const name = file.file_name.split('.')
const nameSuffix = name[name.length - 1]
if (this.fileGroup === 'GSO') {
if (nameSuffix.toLowerCase() === 'doc' || nameSuffix.toLowerCase() === 'docx' || nameSuffix.toLowerCase() === 'pdf') {
const params = {
attId: file.id,
title: file.title,
titleEn: file.title_en,
fileName: file.file_name,
serialNumber: file.serial_number,
connectId: file.connect_id,
fileGroup: this.fileGroup,
fileType: file.text_info_id
}
this.loading = true
httpAction(this.url.addSplit, params, 'post').then(res => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.visible = false
this.$emit('visible', false, 1)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
} else {
this.$message.warning(this.$t('docTool.split.onlyWord'))
}
} else {
const params = {
attId: file.id,
title: file.title,
fileName: file.file_name,
titleEn: file.title_en,
serialNumber: file.serial_number,
connectId: file.connect_id,
fileGroup: this.fileGroup,
fileType: file.text_info_id
}
this.loading = true
httpAction(this.url.addSplit, params, 'post').then(res => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.visible = false
this.$emit('visible', false, 1)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
}
}
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.operator-select {
margin-bottom: 20px;
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
.title-text {
width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.required {
color: red;
margin-right: 4px;
}
.box-input {
/*min-width: 200px;*/
display: inline-block;
width: calc(100% - 116px);
height: 38px;
margin-top: 2px;
/deep/ .ant-select-selection--single {
height: 38px;
}
/deep/ .ant-select-selection__rendered {
line-height: 38px;
height: 38px;
}
}
}
}
</style>
@@ -9,14 +9,12 @@
<div class="page-tree-box page-tree-box-has-search">
<a-spin :spinning="treeLoading">
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData" :selected-keys="selectedTreeKeys">
<a-icon type="folder" slot="folder" class="tree-icon" />
<a-icon type="file" slot="file" class="tree-icon" />
<template #custom="record">
<template #title="record">
<div class="tree-operate-node"
@mouseenter="handleTreeMouseover(record.key)"
@mouseleave="handleTreeMouseout(record.key)"
@click="handleSelectTreeNode(record)">
<a-icon class="parent-node-icon" type="folder" v-if="record.dataRef.children && record.dataRef.children.length > 0" />
<a-tooltip>
<template #title>
{{ record.title }}
@@ -282,8 +280,7 @@ export default {
this.selectedTreeNodeCodes = []
this.filters.nodeCode = null
if (res.success) {
const treeData = res.result || []
this.treeData = this.dealTreeData(treeData)
this.treeData = res.result || []
} else {
this.$message.warn(res.message)
}
@@ -291,24 +288,6 @@ export default {
this.treeLoading = false
})
},
/**
* 处理树数据,加入自定义的节点插槽
* @param treeData
* @returns {*}
*/
dealTreeData (treeData) {
return treeData.map(item => {
if (item.children && item.children.length > 0) {
item.scopedSlots = { icon: 'folder', title: 'custom' }
item.children = this.dealTreeData(item.children)
} else if (item.nodeType === StandardSystemTreeNodeType.ROOT_NODE.value) {
item.scopedSlots = { icon: 'folder', title: 'custom' }
} else {
item.scopedSlots = { icon: 'file', title: 'custom' }
}
return item
})
},
/**
* 树节点查询
*/
@@ -533,17 +512,13 @@ export default {
</script>
<style scoped lang="less">
/deeo/ .ant-tree li span.ant-tree-iconEle {
display: flex;
justify-content: center;
align-items: center;
}
.tree-icon {
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
color: #1D2129;
}
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
display: none;
.parent-node-icon {
color: #1D2129;
font-size: 16px;
margin-right: 10px;
}
</style>
@@ -8,14 +8,13 @@
<div class="page-tree-box page-tree-box-has-search">
<a-spin :spinning="treeLoading">
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData" :selected-keys="selectedTreeKeys">
<a-icon type="folder" slot="folder" class="tree-icon" />
<a-icon type="file" slot="file" class="tree-icon" />
<template #custom="record">
<template #title="record">
<div class="tree-operate-node"
@mouseenter="handleTreeMouseover(record.key)"
@mouseleave="handleTreeMouseout(record.key)"
@click="handleSelectTreeNode(record)">
<a-icon class="parent-node-icon" type="folder" v-if="record.dataRef.children && record.dataRef.children.length > 0" />
<a-tooltip>
<template #title>
{{ record.title }}
@@ -281,8 +280,7 @@ export default {
this.selectedTreeNodeCodes = []
this.filters.nodeCode = null
if (res.success) {
const treeData = res.result || []
this.treeData = this.dealTreeData(treeData)
this.treeData = res.result || []
} else {
this.$message.warn(res.message)
}
@@ -290,24 +288,6 @@ export default {
this.treeLoading = false
})
},
/**
* 处理树数据,加入自定义的节点插槽
* @param treeData
* @returns {*}
*/
dealTreeData (treeData) {
return treeData.map(item => {
if (item.children && item.children.length > 0) {
item.scopedSlots = { icon: 'folder', title: 'custom' }
item.children = this.dealTreeData(item.children)
} else if (item.nodeType === StandardSystemTreeNodeType.ROOT_NODE.value) {
item.scopedSlots = { icon: 'folder', title: 'custom' }
} else {
item.scopedSlots = { icon: 'file', title: 'custom' }
}
return item
})
},
/**
* 树节点查询
*/
@@ -532,17 +512,13 @@ export default {
</script>
<style scoped lang="less">
/deeo/ .ant-tree li span.ant-tree-iconEle {
display: flex;
justify-content: center;
align-items: center;
}
.tree-icon {
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
color: #1D2129;
}
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
display: none;
.parent-node-icon {
color: #1D2129;
font-size: 16px;
margin-right: 10px;
}
</style>