[update] 标签管理国内标准和国外标准改成外来标准;增加外来标准法规文本库模块

This commit is contained in:
lideqin
2024-06-17 16:29:02 +08:00
parent c0b2227819
commit e43bbdfc09
15 changed files with 1764 additions and 36 deletions
+51
View File
@@ -68,6 +68,39 @@ const editOverseasStandard = (params) => postAction('/laws/standard/overseas/com
// 海外标准-提出问题
const submitOverseasQuestion = (params) => postAction('/laws/library/lawsProblemLibrary/addProblem/FB', params)
// 外来标准法规-获取查询条件
const getForeignStandardSearchForm = (params) => getAction('/laws/standard/foreign/getQueryCondition', params)
// 外来标准法规-获取表单模型
const getForeignStandardFormModal = (params) => getAction('/laws/standard/foreign/getFormModel', params)
// 外来标准法规-获取信息
const getForeignStandardDocumentInfo = (params) => getAction('/laws/standard/foreign/getByIdAndModule', params)
// 外来标准法规-获取表头信息
const getForeignStandardTableHeader = (params) => getAction('/laws/standard/foreign/getCommonHeader', params)
// 外来标准法规-收藏
const collectionForeignStandard = (params) => postAction('/personal/lawsStandardCollection/foreign/add', params)
// 外来标准法规-取消收藏
const cancelCollectionForeignStandard = (params) => postAction('/personal/lawsStandardCollection/foreign/delete', params)
// 外来标准法规-体系新增
const addForeignSystemTree = (params) => postAction('/laws/standard/lawsTreeNode/foreign/add', params)
// 外来标准法规-体系编辑
const editForeignSystemTree = (params) => postAction('/laws/standard/lawsTreeNode/foreign/edit', params)
// 外来标准法规-体系删除
const deleteForeignSystemTree = (params) => postAction('/laws/standard/lawsTreeNode/foreign/delete', params)
// 外来标准法规-配置标准
const configForeignStandard = (params) => getAction('/laws/standard/foreign/relatedStandard', params)
// 外来标准法规-移出标准
const removeForeignStandard = (params) => getAction('/laws/standard/foreign/removeStandard', params)
// 外来标准法规-获取体系树
const getForeignStandardTree = (params) => getAction('/laws/standard/lawsTreeNode/foreign', params)
// 外来标准法规-新增标准
const addForeignStandard = (params) => postAction('/laws/standard/foreign/commonAdd', params)
// 外来标准法规-编辑标准
const editForeignStandard = (params) => postAction('/laws/standard/foreign/commonEdit', params)
// 外来标准法规-配置标准-过滤没有选中体系的数据
const getForeignStandardNoSystem = (params) => getAction('/laws/standard/common/getStandardRightBox', params)
// 外来标准法规-获取详情信息
const getForeignStandardDetail = (params) => getAction('/laws/standard/foreign/getByIdAndModule', params)
// 动态消息-保存
const saveDynamicMessage = (params) => postAction('/laws/standard/lawsNewsFeed/save', params)
// 动态消息-发布
@@ -139,6 +172,24 @@ export {
editOverseasStandard,
submitOverseasQuestion,
// 外来标准法规
getForeignStandardSearchForm,
getForeignStandardFormModal,
getForeignStandardDocumentInfo,
getForeignStandardTableHeader,
collectionForeignStandard,
cancelCollectionForeignStandard,
addForeignSystemTree,
editForeignSystemTree,
deleteForeignSystemTree,
configForeignStandard,
removeForeignStandard,
getForeignStandardTree,
addForeignStandard,
editForeignStandard,
getForeignStandardNoSystem,
getForeignStandardDetail,
// 动态消息
saveDynamicMessage,
releaseDynamicMessage,
@@ -52,8 +52,48 @@ module.exports = {
dynamicDetails: 'Dynamic details',
dataText: 'Data text'
},
// 资料中心
profileCenter: {
typeOfOwnership: 'Type of ownership',
uploadData: 'Upload data'
}
uploadData: 'Upload data',
addAPeer: '新增同级',
newChild: '新增子级',
pleaseSelectTheDirectoryOnTheLeft: '请选择左侧目录'
},
// 市场法规清单
marketRegulationsList: {
listNumber: '清单编号',
listName: '清单名称',
countryRegion: '国家/地区',
drivingPosition: '驾驶位置',
author: '作者',
exportName: '市场法规清单表',
listVersion: '清单版本',
releaseTime: '发布时间',
listState: '清单状态',
customName: '自定义名称',
securityClass: '密级',
listDeclaration: '清单说明',
templateName: '市场法规清单导入模版'
},
// 市场清单详情列表字段
marketListField: {
standardEnglishName: '标准英文名称',
newProductionVehicleImplementationDate: '新生产车实施日期',
newCertifiedVehicleImplementationDate: '新认证车实施日期',
dateOfRegistration: '注册日期',
applicableCountryRegion: '适用国家/地区',
applicableVehicleType: '适用车型',
authenticationObject: '认证对象',
certifiedDeliverables: '认证交付物',
type: '类型',
dynamicType: '动力类型',
mainControlDepartment: '主控部门',
masterControlDepartmentProfessionalModule: '主控部门专业模块',
relatedDepartment: '关联部门',
associateDepartmentSpecializedModules: '关联部门专业模块',
batchRestriction: '批量限制',
automaticDrivingLevel: '自动驾驶等级',
requirementType: '要求类型'
},
}
@@ -23,7 +23,7 @@ module.exports = {
dynamicType: '动力类型', // 动力类型
inputExample: '输入示例:',
// 国内标准
domesticStandard: {
foreignStandard: {
treeSearchPlaceholder: '请输入树状图体系',
collection: '收藏',
cancelCollection: '取消收藏',
@@ -79,8 +79,27 @@ module.exports = {
customName: '自定义名称',
securityClass: '密级',
listDeclaration: '清单说明',
templateName: '市场法规清单导入模版',
templateName: '市场法规清单导入模版'
},
// 市场清单详情列表字段
marketListField: {
standardEnglishName: '标准英文名称',
newProductionVehicleImplementationDate: '新生产车实施日期',
newCertifiedVehicleImplementationDate: '新认证车实施日期',
dateOfRegistration: '注册日期',
applicableCountryRegion: '适用国家/地区',
applicableVehicleType: '适用车型',
authenticationObject: '认证对象',
certifiedDeliverables: '认证交付物',
type: '类型',
dynamicType: '动力类型',
mainControlDepartment: '主控部门',
masterControlDepartmentProfessionalModule: '主控部门专业模块',
relatedDepartment: '关联部门',
associateDepartmentSpecializedModules: '关联部门专业模块',
batchRestriction: '批量限制',
automaticDrivingLevel: '自动驾驶等级',
requirementType: '要求类型'
},
// 标准主计划
standardMasterPlan: {
@@ -106,26 +125,5 @@ module.exports = {
rectifyFinishingDate: '整改完成日期',
viewMarketList: '查看市场清单',
viewTroubleshootingResults: '查看排查结果'
},
// 市场清单详情列表字段
marketListField: {
standardEnglishName: '标准英文名称',
newProductionVehicleImplementationDate: '新生产车实施日期',
newCertifiedVehicleImplementationDate: '新认证车实施日期',
dateOfRegistration: '注册日期',
applicableCountryRegion: '适用国家/地区',
applicableVehicleType: '适用车型',
authenticationObject: '认证对象',
certifiedDeliverables: '认证交付物',
type: '类型',
dynamicType: '动力类型',
mainControlDepartment: '主控部门',
masterControlDepartmentProfessionalModule: '主控部门专业模块',
relatedDepartment: '关联部门',
associateDepartmentSpecializedModules: '关联部门专业模块',
batchRestriction: '批量限制',
automaticDrivingLevel: '自动驾驶等级',
requirementType: '要求类型',
},
}
}
+1
View File
@@ -17,6 +17,7 @@ module.exports = {
essentialInformation: '基本信息',
domesticLaws: '国内法规',
foreignStandards: '海外标准',
foreignStandardRegulations: '外来标准法规',
enterpriseStandards: '企业标准',
clauseSplitting: '条款拆分',
// 新增模态框中字段
+1
View File
@@ -17,6 +17,7 @@ module.exports = {
essentialInformation: '基本信息',
domesticLaws: '国内法规',
foreignStandards: '海外标准',
foreignStandardRegulations: '外来标准法规',
enterpriseStandards: '企业标准',
clauseSplitting: '条款拆分',
// 新增模态框中字段
+3 -3
View File
@@ -32,8 +32,7 @@ export const FieldType = {
}
export const TagsTypeEnums = new EsEnums({
DOMESTIC_LIST: { text: '国内法规', langKey: 'system.tag.domesticLaws', value: 1 },
FOREIGN_LIST: { text: '海外标准', langKey: 'system.tag.foreignStandards', value: 2 },
FOREIGN_STANDARD_LIST: { text: '外来标准法规', langKey: 'system.tag.foreignStandardRegulations', value: 1 },
ENTERPRISE_LIST: { text: '企业标准', langKey: 'system.tag.enterpriseStandards', value: 3 },
CLAUSE_SPLITTING_LIST: { text: '条款拆分', langKey: 'system.tag.clauseSplitting', value: 4 }
})
@@ -61,7 +60,8 @@ export const ProjectSource = {
export const StandardSource = {
DOMESTIC: { text: '国内', value: '1' },
OVERSEAS: { text: '海外', value: '2' },
ENTERPRISE: { text: '企标', value: '3' }
ENTERPRISE: { text: '企标', value: '3' },
FOREIGN: { text: '外来标准', value: '4' }
}
// 动态分类
@@ -0,0 +1,692 @@
<template>
<a-card :bordered="false" class="page-left-right-layout">
<!-- 树部分-->
<div class="page-left-box">
<a-input-search v-model="treeInput" class="tree-search"
:placeholder="$t('standardRegulationLibrary.foreignStandard.treeSearchPlaceholder')"
@search="handleTreeSearch" />
<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"
:expanded-keys.sync="expandedKeys"
:selected-keys="selectedTreeKeys">
<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 }}
</template>
<span class="tree-node-custom-title">{{ record.title }}</span>
</a-tooltip>
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.key !== mouseInNodeKey}">
<!-- 新增-->
<a-button icon="plus"
class="tree-operate-node-btn"
@click.stop="handleAddTreeNode(record)"
v-if="record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
v-has="'foreignStandard:tree:add'"></a-button>
<!-- 编辑根节点不能编辑-->
<a-button class="tree-operate-node-btn"
@click.stop="handleEditTreeNode(record)"
v-has="'foreignStandard:tree:edit'"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value">
<i class="iconfont icon-bianji" />
</a-button>
<!-- 删除根节点不能删除-->
<a-button class="tree-operate-node-btn"
v-has="'foreignStandard:tree:delete'"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
@click.stop="handleDelTreeNode(record)">
<i class="iconfont icon-shanchu_" />
</a-button>
</div>
</div>
</template>
</a-tree>
</a-spin>
</div>
</div>
<!-- 表格部分-->
<div class="page-right-box">
<div class="table-page-search-wrapper">
<search ref="searchRef"
:url="url"
:get-query-condition-func="getQueryConditionFunc"
search-has="foreignStandard:search"
@search="searchQuery"
@reset="searchReset" />
</div>
<div class="table-operator">
<!-- 新增-->
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'foreignStandard:add'">{{ $t('newlyAdded') }}</a-button>
<!-- 导入-->
<a-upload name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
v-has="'foreignStandard:import'"
@change="handleImportExcel">
<a-button type="primary" icon="download" ghost>{{ $t('import') }}</a-button>
</a-upload>
<!-- 导出-->
<a-button icon="upload"
type="primary"
ghost
v-has="'foreignStandard:export'"
@click="handleExportXls($t('standardRegulationLibrary.foreignStandard.exportFileName'))">
{{ $t('export') }}
</a-button>
<!-- 带文件导出-->
<a-button icon="upload"
type="primary"
ghost
v-has="'foreignStandard:exportFile'"
@click="handleFileExport($t('standardRegulationLibrary.foreignStandard.exportFileName'))">
{{ $t('exportWithFile') }}
</a-button>
<!-- 模板下载-->
<a-button type="primary"
icon="download"
ghost
v-has="'foreignStandard:downTemplate'"
@click="downTemplate($t('standardRegulationLibrary.foreignStandard.templateName'))">
{{ $t('templateDownload') }}
</a-button>
<!-- 批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'foreignStandard:batchDel'">{{
$t('batchDelete')
}}
</a-button>
<!-- 配置标准-->
<a-button type="primary" icon="setting" ghost @click="handleConfigStandard" v-has="'foreignStandard:configStandard'">
{{ $t('standardRegulationLibrary.configStandard') }}
</a-button>
<!-- 移出标准-->
<a-button type="primary"
icon="minus-circle"
ghost
@click="handleRemoveStandard"
v-has="'foreignStandard:removeStandard'">
{{ $t('standardRegulationLibrary.removeStandard') }}
</a-button>
</div>
<div>
<j-table
v-if="columns && columns.length > 0"
ref="tableRef"
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:scroll="{x: '100%', y: yScrollHeight}"
:loading="loading"
@change="tableOnChange">
<!-- 标准编号-->
<template v-slot:standard_number="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{
text
}}
</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 标准名称-->
<template v-slot:standard_name="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{
text
}}
</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<template v-slot:operation="{text, record}">
<template v-if="operationList.length > operateMaxNum + 1">
<!-- 收藏-->
<a @click="operationClick(operationList[0],record)"
v-if="operationList[0].text === $t('standardRegulationLibrary.foreignStandard.cancelCollection')">
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
</a>
<a v-else @click="operationClick(operationList[0],record)">
<div class="operate-btn">
<!-- 查看图标-->
<i class="iconfont icon-link operate-btn-icon" v-if="operationList[0].text === $t('viewDetail')" />
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operationList[0].text === $t('edit')" />
<!-- 删除图标-->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operationList[0].text === $t('delete')" />
{{ operationList[0].text }}
</div>
</a>
<a-divider type="vertical" />
<a-dropdown placement="bottomCenter">
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
<a-menu slot="overlay">
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
<a @click="operationClick(operation,record)">
<div class="operate-btn">
<!-- 查看图标-->
<i class="iconfont icon-link operate-btn-icon" v-if="operation.text === $t('viewDetail')" />
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
<!-- 删除图标-->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
{{ operation.text }}
</div>
</a>
</a-menu-item>
</a-menu>
</a-dropdown>
</template>
<template v-else-if="operationList.length > 0">
<template v-for="(operation, index) in operationList">
<!-- 收藏-->
<a :key="index" @click="operationClick(operationList[0],record)"
v-if="operation.text === $t('standardRegulationLibrary.foreignStandard.cancelCollection')">
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
</a>
<a v-else @click="operationClick(operation,record)" style="display: inline-block">
<div class="operate-btn">
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
<!-- 删除图标-->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
{{ operation.text }}
</div>
</a>
<a-divider type="vertical" v-if="index !== operationList.length - 1" />
</template>
</template>
</template>
</j-table>
</div>
</div>
<!-- 新增编辑-->
<foreign-standard-modal ref="modalForm" @ok="modalFormOk" />
<!-- 树新增编辑-->
<foreign-system-tree-modal ref="treeModal" @ok="modalFormOk" />
<!-- 配置标准-->
<selection-foreign-standard-drawer ref="standardSelectionModal"
:node-code="selectedTreeNodeCodes[0]"
@change="continueConfigStandard" />
</a-card>
</template>
<script>
import Search from '../../../components/customField/Search'
import JTable from '../../../components/jero/JTable'
import ForeignStandardModal from './modules/ForeignStandardModal'
import ForeignSystemTreeModal from './modules/ForeignSystemTreeModal'
import SelectionForeignStandardDrawer from './modules/SelectionForeignStandardDrawer'
import { OperationType, StandardSource, StandardSystemTreeNodeType, YesOrNoEnum } from '../../../enums/commonEnums'
import {
cancelCollectionForeignStandard, collectionForeignStandard, configForeignStandard, deleteForeignSystemTree,
getForeignStandardSearchForm,
getForeignStandardTableHeader, getForeignStandardTree, removeForeignStandard
} from '../../../api/standardRegulationLibraryApi'
import { mapGetters } from 'vuex'
import { ConfigurableTableMixin } from '../../../mixins/ConfigurableTableMixin'
export default {
name: 'ForeignStandardList',
components: {
Search,
JTable,
ForeignStandardModal,
ForeignSystemTreeModal,
SelectionForeignStandardDrawer
},
mixins: [ConfigurableTableMixin],
data () {
return {
StandardSystemTreeNodeType,
treeInput: null, // 树查询绑定值
treeData: [],
mouseInNodeKey: null, // 鼠标悬浮的节点key值
showAction: true,
operationList: [
// 收藏
{
text: this.$t('standardRegulationLibrary.foreignStandard.cancelCollection'),
clickEvent: 'handleCollection',
has: 'foreignStandard:collection'
},
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: 'foreignStandard:edit'
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: 'foreignStandard:delete'
}
],
getTableHeaderFunc: getForeignStandardTableHeader,
getQueryConditionFunc: getForeignStandardSearchForm,
url: {
list: '/laws/standard/foreign/getCommonPage',
delete: '/laws/standard/foreign/deleteByIdsAndModule',
deleteBatch: '/laws/standard/foreign/deleteByIdsAndModule',
downTemplateUrl: '/laws/standard/foreign/templateDownload', // 下载模板
exportXlsUrl: '/laws/standard/foreign/exportData', // 导出
exportZipUrl: '/laws/standard/foreign/exportDataWithFile', // 带文件导出
importExcelUrl: '/laws/standard/foreign/importExcelWithData' // 导入
},
yesValue: YesOrNoEnum.YES.value,
noValue: YesOrNoEnum.NO.value,
selectedTreeKeys: [], // 选中的树节点key
selectedTreeNodeCodes: [], // 选中树节点的code
tableSlotField: ['standard_name', 'standard_number'], // 表格中需要插槽的字段
treeLoading: false,
isCollection: false,
expandedKeys: [], // 展开的节点
needFilterTableBtn: true
}
},
computed: {
...mapGetters(['userInfo']),
importExcelUrl () {
return `${window._CONFIG.domianURL}/${this.url.importExcelUrl}`
},
// 当前用户是否管理员
isAdmin () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
},
created () {
this.initTreeData()
},
methods: {
/**
* 获取树数据
*/
initTreeData () {
this.treeLoading = true
const params = {
nodeName: this.treeInput
}
if (!params.nodeName) {
delete params.nodeName
}
getForeignStandardTree(params).then(res => {
this.treeData = []
this.selectedTreeKeys = []
this.selectedTreeNodeCodes = []
this.filters.nodeCode = null
if (res.success) {
this.treeData = res.result || []
// 根节点默认展开
this.expandedKeys = [this.treeData[0].key]
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.treeLoading = false
})
},
/**
* 树节点查询
*/
handleTreeSearch () {
this.initTreeData()
},
/**
* 树节点鼠标移入
* @param key
*/
handleTreeMouseover (key) {
this.mouseInNodeKey = key
},
/**
* 树节点鼠标移出
* @param key
*/
handleTreeMouseout (key) {
if (this.mouseInNodeKey === key) {
this.mouseInNodeKey = null
}
},
/**
* 收藏/取消收藏
* @param record
*/
handleCollection ({ collectionFlag, id: standardId, standard_number: standardNumber }) {
if (this.isCollection) {
return
}
this.isCollection = true
let params
let submitFunc
// 取消收藏
if (collectionFlag) {
params = { id: standardId, standardNumber }
submitFunc = cancelCollectionForeignStandard
} else {
params = { standardId, standardNumber }
submitFunc = collectionForeignStandard
}
// 收藏
submitFunc(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.isCollection = false
})
},
modalFormOk () {
this.selectedTreeKeys = []
this.filters.nodeCode = null
this.initTreeData()
// 新增/修改 成功时,重载列表
this.loadData()
// 清空列表选中
this.onClearSelected()
},
/**
* 新增树节点
* @param dataRef
*/
handleAddTreeNode ({ dataRef }) {
this.$refs.treeModal.add({ parentId: dataRef.id, parentCode: dataRef.nodeCode })
},
/**
* 编辑树节点
* @param dataRef
*/
handleEditTreeNode ({ dataRef }) {
this.$refs.treeModal.edit(dataRef)
},
/**
* 删除树节点
* @param dataRef
*/
handleDelTreeNode ({ dataRef }) {
this.$confirm({
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
deleteForeignSystemTree({ id: dataRef.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warning(res.message)
}
})
}
})
},
/**
* 选中树节点
* @param dataRef
*/
handleSelectTreeNode ({ dataRef }) {
this.selectedTreeKeys = [dataRef.key]
this.selectedTreeNodeCodes = [dataRef.nodeCode]
this.filters.nodeCode = dataRef.nodeCode
this.loadData(1)
},
/**
* 配置标准
*/
handleConfigStandard () {
if (!this.selectedTreeNodeCodes || this.selectedTreeNodeCodes.length === 0 ||
this.selectedTreeNodeCodes.includes('MyCollection') || this.selectedTreeNodeCodes.includes('A02')) {
this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode'))
return
}
this.$refs.standardSelectionModal.open()
},
/**
* 配置标准-提交
* @param dbFieldName
* @param standardIds
*/
continueConfigStandard (dbFieldName, standardIds) {
this.loading = true
const params = {
nodeCode: this.selectedTreeNodeCodes[0],
ids: standardIds
}
configForeignStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 移出标准
*/
handleRemoveStandard () {
// 没选择左侧树节点,需要提示“请先选择二级及以下体系”
if (!this.selectedTreeNodeCodes || this.selectedTreeNodeCodes.length === 0 || this.selectedTreeNodeCodes.includes('A02')) {
this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode'))
return
}
// 左侧节点选的是我的收藏,不可移出标准
if (this.selectedTreeNodeCodes[0] === 'MyCollection') {
this.$message.warn(this.$t('enterpriseStandardLibrary.standard.myCollectNotRemove'))
return
}
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('standardRegulationLibrary.selectLeastOneTableData'))
return
}
this.loading = true
const params = {
nodeCode: this.selectedTreeNodeCodes[0],
ids: this.selectedRowKeys.join(',')
}
removeForeignStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
if (this.ipagination.current > 1 && ((this.ipagination.current - 1) * this.ipagination.pageSize) + 1 === this.ipagination.total) {
this.ipagination.current -= 1
}
this.loadData()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 跳转详情页
* @param id
* @param standardNumber
*/
toDetailPage ({ id }) {
this.$openPageNewSheet({
path: '/standardRegulationLibrary/ForeignStandardDetail',
query: {
id
}
})
},
/**
* 重置查询
*/
searchReset (params) {
this.searchParams = Object.assign({}, params)
this.selectedRowKeys = []
this.selectedTreeKeys = []
delete this.filters.nodeCode
this.getTableHeader()
this.loadData()
},
// 导出改成用post
handleExportXls (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
postDownFile(this.url.exportXlsUrl, param).then((data) => {
if (!data || data.size === 0) {
this.$message.warning('文件下载失败')
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName + '.xls')
} else {
const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName + '.xls')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
// 带文件导出
handleFileExport (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
param.module = StandardSource.FOREIGN.value
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
postDownFile(this.url.exportZipUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName + '.zip')
} else {
const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName + '.zip')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
// }
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
/**
* 新增-非管理员用户跳转流程发起页面,不能修改操作类型
*/
handleAdd () {
if (!this.isAdmin) {
this.$router.push({
path: '/workCenter/StandardEntryOrChangeProcess',
query: {
source: StandardSource.Foreign.value, // 国内标准
operateType: OperationType.ENTRY.value // 入库
}
})
return
}
this.$refs.modalForm.add()
this.$refs.modalForm.title = this.$t('newlyAdded')
this.$refs.modalForm.disableSubmit = false
},
handleEdit (record) {
if (!this.isAdmin) {
this.$router.push({
path: '/workCenter/StandardEntryOrChangeProcess',
query: {
source: StandardSource.Foreign.value, // 国内标准
operateType: OperationType.CHANGE.value, // 变更
standardId: record.id // 标准id
}
})
return
}
this.$refs.modalForm.edit(record)
this.$refs.modalForm.title = this.$t('edit')
this.$refs.modalForm.disableSubmit = false
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
/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,378 @@
<template>
<div class="detail-page">
<a-spin :spinning="loading">
<div class="detail-page-title">{{ pageTitle }}{{ $t('details') }}</div>
<div class="detail-page-part" v-for="(part, index) in partList" :key="part + index">
<div class="detail-page-part-title">
<span>{{ part }}</span>
</div>
<div class="detail-page-part-form" v-if="part !== '过程稿件' && part !== 'Process Manuscript'">
<div class="detail-page-part-form-item" v-for="formItem in form[part]" :key="formItem.id">
<label>{{ formItem.dbFieldTxt }}</label>
<!--标准需要跳转是标准字段且有内容的情况下在这处理-->
<template v-if="standardFields.includes(formItem.dbFieldName) && !!detailData[formItem.dbFieldName]">
<div class="div-form-content">
<template v-for="(standard, standardIndex) in detailData[formItem.dbFieldName].split(',')">
<div class="can-click" :key="'standardKey' + standardIndex" @click="toStandardDetailPage(standard)">{{ standard }}</div>
<div v-if="standardIndex!==detailData[formItem.dbFieldName].split(',').length - 1">,</div>
</template>
</div>
</template>
<!--文件需要显示预览-->
<div class="file-box" v-else-if="fileField.includes(formItem.dbFieldName)">
<template v-if="detailData[formItem.dbFieldName + 'List'] && detailData[formItem.dbFieldName + 'List'].length > 0">
<div class="detail-page-process-manuscript-file"
v-for="file in detailData[formItem.dbFieldName + 'List']"
:key="file.id">
<div class="detail-page-process-manuscript-file-info">
<a-icon type="link" />
<div class="detail-page-process-manuscript-file-name" @click="handlePreview(file)">{{ file.fileName }}</div>
</div>
<!-- 下载-->
<a-button type="link"
icon="download"
v-has="btnPermission.download"
class="file-btn"
@click="handleDownload(file)">
{{
$t('download')
}}
</a-button>
<!-- 无水印下载-->
<!--<a-button type="link" v-has="btnPermission.unwatermarkedDownload" class="file-btn">-->
<!-- <i class="iconfont icon-water-drop-slash"></i>-->
<!-- {{ $t('unwatermarkedDownload') }}-->
<!--</a-button>-->
</div>
</template>
<span v-else>{{ global.emptyLine }}</span>
</div>
<!-- 需要显示查看全部按钮 -->
<a-button v-else-if="showViewAllField.includes(formItem.dbFieldName) &&
(detailData[formItem.dbFieldName + '_dictText'] || detailData[formItem.dbFieldName])"
type="primary" ghost @click="viewAll(formItem.dbFieldName)">
{{ $t('enterpriseStandardLibrary.standard.viewAll')}}
</a-button>
<span v-else>
{{
detailData[needDictFieldList.includes(formItem.fieldShowType) ? formItem.dbFieldName + '_dictText' : formItem.dbFieldName] || global.emptyLine
}}
</span>
</div>
</div>
<!-- 过程稿件特殊处理-->
<div class="detail-page-process-manuscript" v-if="part === '过程稿件' || part === 'Process Manuscript'">
<div class="detail-page-process-manuscript-item" v-for="formItem in form[part]" :key="formItem.id">
<div class="detail-page-process-manuscript-title">
<span>{{ formItem.dbFieldTxt }}</span>
<!-- 标准分解单-->
<a-button type="primary"
ghost
icon="file-text"
@click="previewStandardResolutionSheet(detailData[formItem.dbFieldName + '_standardSplit'])"
v-has="btnPermission.standardResolutionSheet"
:disabled="!detailData[formItem.dbFieldName + '_standardSplit']">
{{ $t('standardRegulationLibrary.standardResolutionSheet') }}
</a-button>
</div>
<div class="detail-page-process-manuscript-file"
v-for="file in detailData[formItem.dbFieldName + 'List']"
:key="file.id">
<div class="detail-page-process-manuscript-file-info">
<a-icon type="link" />
<div class="detail-page-process-manuscript-file-name" @click="handlePreview(file)">{{ file.fileName }}</div>
</div>
<div class="detail-page-process-manuscript-file-operate">
<!-- 下载-->
<a-button type="link" icon="download" v-has="btnPermission.download" @click="handleWatermarkedDownload(file)">
{{ $t('download') }}
</a-button>
<!-- 无水印下载-->
<a-button type="link" v-has="btnPermission.unwatermarkedDownload" @click="handleDownload(file)">
<i class="iconfont icon-water-drop-slash"></i>
{{ $t('unwatermarkedDownload') }}
</a-button>
</div>
</div>
</div>
</div>
</div>
</a-spin>
<div id="images">
<div class="image" v-viewer="{movable: false}">
<img v-show="image" :src="imageUrl" alt="">
</div>
</div>
<!-- 标准分解单-->
<standard-resolution-sheet-modal ref="standardResolutionSheetModal" />
<!-- 查看全部弹框 -->
<text-content-modal ref="textContentModal"></text-content-modal>
</div>
</template>
<script>
import { getForeignStandardDetail, getForeignStandardFormModal } from '@/api/standardRegulationLibraryApi'
import StandardResolutionSheetModal from '../../commonPage/modules/StandardResolutionSheetModal'
import TextContentModal from '../../../enterpriseStandardLibrary/standard/detail/module/TextContentModal'
import { FieldType, StandardSource } from '../../../../enums/commonEnums'
import { getFileInfo } from '../../../../api/api'
import Vue from 'vue'
import { ACCESS_TOKEN } from '../../../../store/mutation-types'
import { downloadFile, getFileAccessHttpUrl } from '../../../../api/manage'
import { previewPdf } from '../../../../utils/previewPdf'
import { kkFilePreview } from '../../../../utils/kkFilePreview'
import { queryStandardInfoByStandardNumber } from '../../../../utils/util'
// 外来标准法规权限
const ForeignStandardPermission = {
standardResolutionSheet: 'foreignStandard:standardResolutionSheet', // 标准分解单
download: 'foreignStandard:download', // 下载
unwatermarkedDownload: 'foreignStandard:unwatermarkedDownload' // 无水印下载
}
// 外来标准法规接口
const ForeignApi = {
getFormFunc: getForeignStandardFormModal, // 获取字段
getDetailData: getForeignStandardDetail // 获取详情数据
}
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
const FILE_TYPE_PDF = 'pdf'
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
export default {
name: 'ForeignStandardDetailPage',
components: { StandardResolutionSheetModal, TextContentModal },
data () {
return {
loading: false,
partList: [], // 页面模块列表
form: {}, // 页面字段
// 页面数据
detailData: {},
// 文件的字段
fileField: [],
// 需要数据字段翻译的属性类型
needDictFieldList: [FieldType.USER_SINGLE.value, FieldType.ORGAN_SINGLE.value, FieldType.ORGAN_MORE.value, FieldType.OPTION_SINGLE.value, FieldType.OPTION_MORE.value, FieldType.TREE.value, FieldType.TREE_SINGLE.value],
image: false,
imageUrl: null,
// 标准字段,需要跳转标准详情
standardFields: ['substitute_standard_number', 'replaced_by_standard_number', 'reference_standard', 'referenced_standard', 'adopt_the_international_standard_number', 'associated_foreign_standards'],
showViewAllField: ['auth_dept'] // 需要显示展示查看全部按钮的字段
}
},
computed: {
pageTitle () {
return this.$t('system.tag.foreignStandards')
},
// 按钮权限
btnPermission () {
const permission = ForeignStandardPermission
return permission
},
// 操作接口
operateApiFunc () {
const func = ForeignApi
return func
}
},
async created () {
await this.initForm()
this.initDetailData()
},
methods: {
/**
* 获取页面字段
*/
initForm () {
return new Promise(resolve => {
this.operateApiFunc.getFormFunc({ type: 1 }).then(res => {
if (res.success) {
const data = res.result || {}
this.partList = Object.keys(data)
const formList = Object.values(data).reduce((acc, cur) => acc.concat(cur), [])
this.fileField = []
formList.forEach(item => {
if (item.fieldShowType === FieldType.FILE_UP.value) {
this.fileField.push(item.dbFieldName)
}
})
this.form = data
} else {
this.$message.warn(res.message)
}
}).finally(() => {
resolve()
})
})
},
// 获取数据
initDetailData () {
this.loading = true
this.operateApiFunc.getDetailData({ id: this.$route.query.id, type: 1 }).then(res => {
if (res.success) {
this.detailData = Object.assign({}, res.result || {})
this.fileField.forEach(item => {
if (this.detailData[item]) {
const fileList = this.detailData[item].split(',')
const fileInfoList = []
fileList.forEach(async id => {
const fileInfo = await this.getFileInfo(id)
if (fileInfo) {
fileInfoList.push(fileInfo)
}
})
this.$set(this.detailData, item + 'List', fileInfoList)
}
})
console.log(this.detailData)
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
getFileInfo (fileId) {
return new Promise(resolve => {
let fileInfo
getFileInfo({ id: fileId }).then(res => {
if (res.success) {
fileInfo = res.result
}
}).finally(() => {
resolve(fileInfo)
})
})
},
/**
* 查看标准分解单
*/
previewStandardResolutionSheet (id) {
this.$refs.standardResolutionSheetModal.open(id)
},
// 查看全部
viewAll (fieldName) {
const data = this.detailData[fieldName + '_dictText'] || this.detailData[fieldName]
this.$refs.textContentModal.open(data)
},
handlePreview (file) {
if (!file || !file.url) {
return
}
// 截取文件后缀名
const fileSuffix = file.fileName ? file.fileName.split('.')[file.fileName.split('.').length - 1] : ''
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)
// 判断是否为可预览格式的文件
if (!canPreview) {
this.$message.loading('该文件类型不支持预览,正在为您准备下载...').then(() => {
this.handleDownload(file)
})
return
}
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
console.log(fileFullUrl)
// 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
this.imageUrl = getFileAccessHttpUrl(file.id)
// 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer
// 调用show方法进行显示预览图
viewer.show()
// this.$refs.imagePreviewModal.open(file)
return
}
// pdf预览
if (canPreview && FILE_TYPE_PDF.includes(fileSuffix.toLowerCase())) {
const url = previewPdf(file.id)
window.open(url)
return
}
// 其余可预览文件仍使用KKFile进行预览
kkFilePreview(fileFullUrl)
},
/**
* 无水印下载
* @param file
*/
handleDownload (file) {
// 下载文件
downloadFile(`/sys/common/noEncryptDownloadWithoutWaterMark/${file.id}`, file.fileName)
},
/**
* 有水印下载
* @param file
*/
handleWatermarkedDownload (file) {
downloadFile(`/sys/common/noEncryptDownload/${file.id}`, file.fileName)
},
async toStandardDetailPage (standardNumber) {
const standardInfo = await queryStandardInfoByStandardNumber(standardNumber)
if (!standardInfo) {
return
}
let path
// 根据来源跳转不同的详情页
switch (standardInfo.source) {
// 国内
case StandardSource.FOREIGN.value:
path = '/standardRegulationLibrary/ForeignStandardDetail'
break
// 企标
case StandardSource.ENTERPRISE.value:
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
break
default:
break
}
if (!path) {
return
}
const query = {
id: standardInfo.id
}
this.$openPageNewSheet({
path, query
})
}
}
}
</script>
<style scoped lang="less">
.file-box {
flex: 1;
width: 0;
}
.file-btn > ::v-deep span {
display: inline;
color: @primary-color;
font-size: 14px;
}
.div-form-content {
word-break: break-all;
white-space: pre-wrap;
font-size: 16px;
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
color: #1D2129;
-ms-flex: 1;
flex: 1;
width: 0;
}
.div-form-content > div {
display: inline-block;
}
.can-click {
display: inline-block;
color: @primary-color;
cursor: pointer;
}
</style>
@@ -0,0 +1,84 @@
<template>
<j-modal
:title="$t('standardRegulationLibrary.standardResolutionSheet')"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
fullscreen
switchFullscreen
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<div class="page-container">
<standard-resolution-sheet ref="resolutionSheet" />
</div>
</a-spin>
<template v-slot:footer>
<a-button @click="handleCancel">{{ $t('close') }}</a-button>
</template>
</j-modal>
</template>
<script>
import StandardResolutionSheet from '../../../../../components/StandardResolutionSheet'
export default {
name: 'StandardResolutionSheetModal',
components: { StandardResolutionSheet },
data () {
return {
width: '90%',
visible: false,
confirmLoading: false,
splitId: null,
isFullScreen: false
}
},
methods: {
open (id) {
this.visible = true
this.$nextTick(() => {
const ids = id.split(',')
this.$refs.resolutionSheet.queryParams = {
id: ids[0],
publishBeforeId: ids[1]
}
this.$refs.resolutionSheet.initClauseFieldList()
this.$refs.resolutionSheet.initDetailInfo()
})
},
handleCancel () {
this.visible = false
}
}
}
</script>
<style scoped lang="less">
.page-container {
min-height: 250px;
height: calc(100vh - 200px - 55px - 54px - 48px);
}
/deep/ .ant-modal-body {
background: #F0F2F4;
}
// 处理全屏状态下的样式问题
.j-modal-box.fullscreen .ant-modal-content .ant-modal-body {
.ant-spin-nested-loading {
height: 100%;
/deep/ .ant-spin-container {
height: 100%;
}
}
.page-container {
height: 100%;
}
}
</style>
@@ -0,0 +1,143 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
:maskClosable="false"
destroyOnClose
class="custom-drawer-style"
>
<div class="custom-drawer-style-scroll">
<a-spin :spinning="confirmLoading" style="width: 100%;height:100%">
<add-form ref="addForm"
:flag="StandardSource.FOREIGN.value"
:get-form-func="getFormFunc"
:get-document-info-func="getDocumentInfoFunc"
:special-placeholder="specialPlaceholder"
:default-value="defaultValue"
:disabled-field-list="disabledField"
:open-selected-all-field-list="openSelectedAllFieldList"
:exclude-standard-fields="excludeStandardFields"
:flag-by-field="{associated_foreign_standards: StandardSource.OVERSEAS.value}"
@submitFormData="submitFormData" />
</a-spin>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleCancel" style="margin-bottom: 0;" :loading="confirmLoading">{{ $t('close') }}</a-button>
<a-button @click="handleOk" type="primary" style="margin-bottom: 0;" :loading="confirmLoading">
{{ $t('preservation') }}
</a-button>
</div>
</a-drawer>
</template>
<script>
import AddForm from '../../../../components/customField/AddForm'
import { StandardSource } from '../../../../enums/commonEnums'
import {
addForeignStandard,
editForeignStandard,
getForeignStandardDocumentInfo,
getForeignStandardFormModal
} from '../../../../api/standardRegulationLibraryApi'
export default {
name: 'ForeignStandardModal',
components: { AddForm },
data () {
return {
StandardSource,
visible: false,
title: '',
width: 800,
// 存储表单的数据
form: {},
confirmLoading: false,
getFormFunc: getForeignStandardFormModal,
getDocumentInfoFunc: getForeignStandardDocumentInfo,
// 特殊的placeholder
specialPlaceholder: {
standard_number_temp: `${this.$t('standardRegulationLibrary.inputExample')}7258`
},
defaultValue: {
year_number: new Date().getFullYear() + ''
},
// 数据字典多选,需要全选功能的字段
openSelectedAllFieldList: [
'applicable_vehicle', // 适用车型
'dynamic_type' // 动力类型
],
isEdit: null // 是否编辑
}
},
computed: {
// 不可编辑的字段
disabledField () {
if (this.isEdit) {
// 标准编号,被代替标准号,被引用标准号,标准类别,年代号
return ['standard_number_temp', 'replaced_by_standard_number', 'referenced_standard', 'standard_class', 'year_number']
}
return ['replaced_by_standard_number', 'referenced_standard']
},
excludeStandardFields () {
if (this.isEdit) {
return ['substitute_standard_number', 'reference_standard']
}
return []
}
},
methods: {
add () {
this.visible = true
this.isEdit = false
this.$nextTick(() => {
this.$refs.addForm.add()
})
},
edit (record) {
this.visible = true
this.isEdit = true
this.$nextTick(() => {
this.$refs.addForm.edit(record)
})
},
handleOk () {
this.$refs.addForm.submit()
},
// 表单提交的回调,获取表单数据
submitFormData (formInline) {
this.confirmLoading = true
let submitFunc
if (formInline.id) {
submitFunc = editForeignStandard
} else {
submitFunc = addForeignStandard
}
submitFunc(formInline).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
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,103 @@
<template>
<j-modal
:title="title"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardRegulationLibrary.nodeName')">
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.nodeName')"
:maxLength="50"
v-decorator="['nodeName', validatorRules.nodeName]" />
</a-form-item>
</a-form>
</j-modal>
</template>
<script>
import { addForeignSystemTree, editForeignSystemTree } from '../../../../api/standardRegulationLibraryApi'
export default {
name: 'ForeignSystemTreeModal',
data () {
return {
title: this.$t('operation'),
width: 800,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
validatorRules: {
// 节点名称
nodeName: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.nodeName') }],
validateTrigger: 'blur'
}
}
}
},
methods: {
add (parentInfo) {
this.edit(parentInfo)
},
edit (record) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(this.model)
})
},
close () {
this.visible = false
},
handleOk () {
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
const formData = Object.assign(this.model, values)
formData.nodeOrder = '0'
let submitFunc
if (this.model.id) {
submitFunc = editForeignSystemTree
} else {
submitFunc = addForeignSystemTree
}
submitFunc(formData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}
})
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,238 @@
<template>
<a-drawer
:title="$t('standardSelect.standardSelection')"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
class="custom-drawer-style">
<div class="custom-drawer-style-scroll">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :sm="8">
<a-form-item :label="$t('standardSelect.standardNumOrName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('standardSelect.standardNumOrName')"
v-model="queryParam.standardNumberOrName"></a-input>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;margin-right: 41px;margin-bottom: 20px"
class="table-page-search-submitButtons">
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{
$t('query')
}}
</a-button>
</div>
</a-row>
</a-form>
</div>
<a-table
:columns="columns"
rowKey="serial_number"
:scroll="{x: 900}"
:data-source="dataList"
:pagination="ipagination"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:loading="loading"
@change="handleTableChange">
<!-- 标准编号标准名称跳转详情-->
<template v-slot:detail="text, record">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{ text }}</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
</a-table>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleCancel">{{ $t('cancel') }}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{ $t('submit') }}</a-button>
</div>
</a-drawer>
</template>
<script>
import { StandardSource } from '../../../../enums/commonEnums'
import { getForeignStandardNoSystem } from '../../../../api/standardRegulationLibraryApi'
export default {
name: 'SelectionForeignStandardDrawer',
props: {
// 选中节点code
nodeCode: {
type: String,
required: false,
default: null
},
query: {
type: Object,
required: false,
default: () => {
return {}
}
}
},
data () {
return {
visible: false,
confirmLoading: false,
labelCol: {
sm: 8
},
wrapperCol: {
sm: 14
},
selectedRowKeys: [],
selectedRowList: [],
loading: false,
queryParam: {},
/* 分页参数 */
ipagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
columns: [
// 标准号
{
title: this.$t('standardSelect.standardNumber'),
dataIndex: 'standardNumber',
align: 'center',
width: 150,
scopedSlots: { customRender: 'detail' }
},
// 标准名称
{
title: this.$t('standardSelect.standardName'),
dataIndex: 'standardName',
align: 'center',
width: 150,
scopedSlots: { customRender: 'detail' }
},
// 发布日期
{
title: this.$t('standardSelect.releaseDate'),
dataIndex: 'releaseDate',
align: 'center',
width: 120,
scopedSlots: { customRender: 'text' }
},
// 标准状态
{
title: this.$t('projectLibrary.vehicleItemLibrary.standardState'),
dataIndex: 'standardState_dictText',
align: 'center',
width: 120,
scopedSlots: { customRender: 'text' }
}
],
dataList: [],
url: {
searchList: 'document/bussDocumentLibraryEO/queryCondition' // 搜索字段
}
}
},
methods: {
open () {
this.visible = true
this.queryParam = {}
this.replacePage()
},
// 获取表格数据
replacePage () {
const query = {
...this.queryParam,
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize,
nodeCode: this.nodeCode,
source: StandardSource.FOREIGN.value
}
this.selectedRowKeys = []
this.loading = true
getForeignStandardNoSystem(query).then((res) => {
if (res.success) {
this.dataList = res.result.records
this.ipagination.total = res.result.total
this.selectedRowKeys = this.standard[this.query.db_field_name] ? this.standard[this.query.db_field_name].split(',') : []
} else {
this.dataList = []
}
}).finally(() => {
this.loading = false
})
},
searchQuery () {
this.replacePage()
},
searchReset () {
this.queryParam = {}
this.replacePage()
},
// 表格选择改变
onSelectChange (value, row) {
this.selectedRowKeys = value
this.selectedRowList = row
},
handleCancel () {
this.visible = false
},
handleSubmit () {
const serialNumber = []
const replaceStandardId = []
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
// let content = JSON.parse(JSON.stringify(this.selectedRowList))
this.selectedRowList.forEach(res => {
serialNumber.push(res.serial_number)
replaceStandardId.push(res.id)
})
this.$emit('input', serialNumber.join(','))
this.$emit('change', this.query.dbFieldName, replaceStandardId.join(','))
// this.$emit('changecontent', this.content)
this.visible = false
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
/**
* 跳转详情页
* @param id
*/
toDetailPage ({ id }) {
this.$openPageNewSheet({
path: '/standardRegulationLibrary/ForeignStandardDetail',
query: {
id
}
})
},
handleTableChange (pagination) {
this.ipagination = pagination
this.replacePage()
}
}
}
</script>
<style scoped>
</style>
@@ -62,8 +62,8 @@ export default {
type: {
required: false,
type: Number,
// 默认显示国内法规的
default: TagsTypeEnums.DOMESTIC_LIST.value
// 默认显示外来标准法规的
default: TagsTypeEnums.FOREIGN_STANDARD_LIST.value
}
},
data () {
+2 -2
View File
@@ -58,8 +58,8 @@ export default {
type: {
required: false,
type: Number,
// 默认显示国内法规的
default: TagsTypeEnums.DOMESTIC_LIST.value
// 默认显示外来标准法规的
default: TagsTypeEnums.FOREIGN_STANDARD_LIST.value
}
},
components: {
+1 -2
View File
@@ -24,8 +24,7 @@ export default {
return {
spinning: false,
tabArr: [
{ name: '国内法规', showText: this.$t('system.tag.domesticLaws'), value: 1, comp: StandardList },
{ name: '海外标准', showText: this.$t('system.tag.foreignStandards'), value: 2, comp: StandardList },
{ name: '外来标准法规', showText: this.$t('system.tag.foreignStandardRegulations'), value: 1, comp: StandardList },
{ name: '企业标准', showText: this.$t('system.tag.enterpriseStandards'), value: 3, comp: StandardList },
{ name: '条款拆分', showText: this.$t('system.tag.clauseSplitting'), value: 4, comp: ClauseSplittingList }
]