add 标准详情;更新记录

This commit is contained in:
赵霄
2023-09-07 17:57:47 +08:00
parent 397f30423a
commit 3432c9c322
15 changed files with 749 additions and 128 deletions
+21 -13
View File
@@ -1,7 +1,7 @@
<template>
<a-config-provider :locale="locale">
<div id="app">
<router-view v-if="isRouterAlive"/>
<router-view v-if="isRouterAlive" />
<div class="watermark" v-if="show" v-watermark="{text: watermark, textColor: 'rgba(180, 180, 180, 0.2)'}"></div>
</div>
</a-config-provider>
@@ -16,6 +16,7 @@ import 'moment/locale/zh-cn'
import '@/utils/warterMark'
// 引入自定义icon
import '@/assets/icon/iconfont.less'
import Vue from 'vue'
moment.locale('zh-cn')
@@ -93,20 +94,27 @@ export default {
moment.locale('en-us')
}
})
// 新标签页打开
Vue.prototype.$openPageNewSheet = (params) => {
const { href } = this.$router.resolve(params)
window.open(href, '_blank')
}
}
}
</script>
<style scoped lang="less">
#app {
height: 100%;
}
.watermark {
pointer-events: none;
position: fixed;
z-index: 999999999;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#app {
height: 100%;
}
.watermark {
pointer-events: none;
position: fixed;
z-index: 999999999;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
</style>
+17 -5
View File
@@ -16,6 +16,12 @@ const shareDomesticStandard = (params) => postAction('', params)
const addDomesticSystemTree = (params) => postAction('', params)
// 国内标准-体系编辑
const editDomesticSystemTree = (params) => postAction('', params)
// 国内标准-体系删除
const deleteDomesticSystemTree = (params) => postAction('', params)
// 国内标准-配置标准
const configDomesticStandard = (params) => postAction('', params)
// 国内标准-移出标准
const removeDomesticStandard = (params) => postAction('', params)
// 海外标准-获取查询条件
const getOverseasStandardSearchForm = (params) => getAction('/laws/standard/overseas/getQueryCondition', params)
@@ -27,16 +33,22 @@ const getOverseasStandardDocumentInfo = (params) => getAction('/laws/standard/ov
const getOverseasStandardTableHeader = (params) => getAction('/laws/standard/overseas/getCommonHeader', params)
export {
// 国内标准
getDomesticStandardSearchForm,
getDomesticStandardFormModal,
getDomesticStandardDocumentInfo,
getDomesticStandardTableHeader,
getOverseasStandardSearchForm,
getOverseasStandardForm,
getOverseasStandardDocumentInfo,
getOverseasStandardTableHeader,
collectionDomesticStandard,
shareDomesticStandard,
addDomesticSystemTree,
editDomesticSystemTree
editDomesticSystemTree,
deleteDomesticSystemTree,
configDomesticStandard,
removeDomesticStandard,
// 海外标准
getOverseasStandardSearchForm,
getOverseasStandardForm,
getOverseasStandardDocumentInfo,
getOverseasStandardTableHeader
}
+153
View File
@@ -338,6 +338,11 @@
text-overflow: ellipsis;
}
.can-click-table-text {
color: @primary-color;
cursor: pointer;
}
/* switch的样式 */
.table-operator-tab {
width: fit-content;
@@ -519,3 +524,151 @@
}
}
}
/*详情样式start*/
.detail-page {
padding: 24px;
&-title {
font-size: 20px;
font-family: PingFang SC-Medium, PingFang SC, sans-serif;
color: #1D2129;
font-weight: 600;
text-align: center;
margin-bottom: 24px;
}
&-part {
border-radius: 8px;
border: 1px solid #E5E6EB;
margin-bottom: 20px;
}
&-part-title {
height: 56px;
background: rgba(245, 245, 245, 0.6);
border-radius: 8px 8px 0 0;
opacity: 1;
border-bottom: 1px solid #E5E6EB;
padding: 0 20px;
display: flex;
align-items: center;
justify-content: space-between;
}
&-part-title > span {
font-size: 16px;
font-family: PingFang SC-Medium, PingFang SC, sans-serif;
font-weight: 550;
color: #1D2129;
}
&-part-title-operate-box {
.ant-btn > .anticon + span {
margin-left: 10px;
}
.ant-btn > .iconfont + span {
margin-left: 10px;
}
.ant-btn > .iconfont {
height: 20px;
}
}
&-part-form {
padding: 20px;
display: flex;
flex-wrap: wrap;
&-item {
width: calc((100% - 32px) / 3);
display: flex;
margin: 0 16px 16px 0;
label {
width: 40%;
font-size: 16px;
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
font-weight: 400;
color: #86909C;
}
span {
white-space: pre-wrap;
word-break: break-all;
font-size: 16px;
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
color: #1D2129;
}
}
&-item:nth-child(3n) {
margin-right: 0;
}
}
&-process-manuscript {
padding: 20px;
&-item {
padding: 20px 0;
border-bottom: 1px solid #E5E6EB;
}
&-title {
font-size: 16px;
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
color: #86909C;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
&-file {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
&-file:last-child {
margin-bottom: 0;
}
&-file-info {
display: flex;
align-items: center;
color: @primary-color;
cursor: pointer;
flex: 1;
width: 0;
}
&-file-info > .anticon {
margin-right: 8px;
}
&-file-name {
white-space: nowrap;
overflow: hidden;
flex: 1;
width: 0;
text-overflow: ellipsis;
}
&-file-operate {
.ant-btn > .anticon + span, .ant-btn > .iconfont + span {
margin-left: 10px;
}
.ant-btn:first-child {
margin-left: 15px;
}
}
}
}
/*详情样式end*/
+1
View File
@@ -98,6 +98,7 @@ module.exports = {
selectOne: 'Please select a data',
essentialInformation: 'General Information',
download: 'Download',
unwatermarkedDownload: 'Unwatermarked download',
fileName: 'File Name',
fileDeclaration: 'File Declaration',
newNode: 'New node',
@@ -1,6 +1,12 @@
module.exports = {
configStandard: 'Configuration standard', // 配置标准
removeStandard: 'Removal criteria', // 移出标准
nodeName: 'Node name', // 节点名称
configStandardNoTreeNode: 'Please select Level 2 and below system first', // 请先选择二级及以下体系
selectLeastOneTableData: 'Select at least one list data', // 选中至少一条列表数据
standardResolutionSheet: 'Standard resolution sheet', // 标准分解单
updateRecord: 'Update record', // 更新记录
submitQuestion: 'Submit a question', // 提交问题
// 国内标准
domesticStandard: {
treeSearchPlaceholder: 'Please enter the tree system', // 请输入树状图体系
@@ -2,6 +2,11 @@ module.exports = {
configStandard: '配置标准',
removeStandard: '移出标准',
nodeName: '节点名称',
configStandardNoTreeNode: '请先选择二级及以下体系',
selectLeastOneTableData: '选中至少一条列表数据',
standardResolutionSheet: '标准分解单',
updateRecord: '更新记录',
submitQuestion: '提交问题',
// 国内标准
domesticStandard: {
treeSearchPlaceholder: '请输入树状图体系',
@@ -10,5 +15,8 @@ module.exports = {
exportFileName: '国内标准法规',
exportZipName: '国内标准法规(带文件)',
templateName: '国内标准法规导入模板'
},
standardDetail: {
title: ''
}
}
+1
View File
@@ -98,6 +98,7 @@ module.exports = {
selectOne: '请选择一条数据',
essentialInformation: '基本信息',
download: '下载',
unwatermarkedDownload: '无水印下载',
fileName: '文件名称',
fileDeclaration: '文件说明',
newNode: '新增节点',
+105 -94
View File
@@ -1,34 +1,37 @@
<template>
<global-layout @dynamicRouterShow="dynamicRouterShow">
<!-- update-begin- author:sunjianlei --- date:20191009 --- for: 提升右键菜单的层级 -->
<contextmenu :itemList="menuItemList" :visible.sync="menuVisible" style="z-index: 9999;" @select="onMenuSelect"/>
<!-- update-end- author:sunjianlei --- date:20191009 --- for: 提升右键菜单的层级 -->
<a-tabs
@contextmenu.native="e => onContextmenu(e)"
v-if="multipage"
:active-key="activePage"
class="tab-layout-tabs"
style="height:52px"
:hide-add="true"
type="editable-card"
@change="changePage"
@tabClick="tabCallBack"
@edit="editPage">
<a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList">
<span slot="tab" :pagekey="page.fullPath">{{ page.meta.title }}</span>
</a-tab-pane>
</a-tabs>
<div style="margin: 12px 12px 0;">
<!-- update-begin-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 -->
<keep-alive v-if="multipage">
<router-view v-if="reloadFlag"/>
</keep-alive>
<template v-else>
<router-view v-if="reloadFlag"/>
</template>
<!-- update-end-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 -->
</div>
</global-layout>
<div>
<global-layout @dynamicRouterShow="dynamicRouterShow" v-if="!isInternalOrExternal">
<!-- update-begin- author:sunjianlei --- date:20191009 --- for: 提升右键菜单的层级 -->
<contextmenu :itemList="menuItemList" :visible.sync="menuVisible" style="z-index: 9999;" @select="onMenuSelect" />
<!-- update-end- author:sunjianlei --- date:20191009 --- for: 提升右键菜单的层级 -->
<a-tabs
@contextmenu.native="e => onContextmenu(e)"
v-if="multipage"
:active-key="activePage"
class="tab-layout-tabs"
style="height:52px"
:hide-add="true"
type="editable-card"
@change="changePage"
@tabClick="tabCallBack"
@edit="editPage">
<a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList">
<span slot="tab" :pagekey="page.fullPath">{{ page.meta.title }}</span>
</a-tab-pane>
</a-tabs>
<div style="margin: 12px 12px 0;">
<!-- update-begin-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 -->
<keep-alive v-if="multipage">
<router-view v-if="reloadFlag" />
</keep-alive>
<template v-else>
<router-view v-if="reloadFlag" />
</template>
<!-- update-end-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 -->
</div>
</global-layout>
<blank-layout v-else></blank-layout>
</div>
</template>
<script>
@@ -38,12 +41,14 @@ import { mixin, mixinDevice } from '@/utils/mixin.js'
import { triggerWindowResizeEvent } from '@/utils/util'
import Vue from 'vue'
import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types'
import BlankLayout from './BlankLayout.vue'
const indexKey = '/'
export default {
name: 'TabLayout',
components: {
BlankLayout,
GlobalLayout,
Contextmenu
},
@@ -78,9 +83,14 @@ export default {
} else {
return this.$store.state.app.multipage
}
},
// 是否外部打开
isInternalOrExternal () {
return this.$route.meta.internalOrExternal
}
},
created () {
console.log(this.$route)
// 复制一个route对象出来,不能影响原route
const currentRoute = Object.assign({}, this.$route)
currentRoute.meta = Object.assign({}, currentRoute.meta)
@@ -299,84 +309,85 @@ export default {
<style lang="less">
/*
* The following styles are auto-applied to elements with
* transition="page-transition" when their visibility is toggled
* by Vue.js.
*
* You can easily play with the page transition by editing
* these styles.
*/
/*
* The following styles are auto-applied to elements with
* transition="page-transition" when their visibility is toggled
* by Vue.js.
*
* You can easily play with the page transition by editing
* these styles.
*/
.page-transition-enter {
opacity: 0;
.page-transition-enter {
opacity: 0;
}
.page-transition-leave-active {
opacity: 0;
}
.page-transition-enter .page-transition-container,
.page-transition-leave-active .page-transition-container {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
/*美化弹出Tab样式*/
.ant-tabs-nav-container {
margin-top: 4px;
}
/* 修改 ant-tabs 样式 */
.tab-layout-tabs.ant-tabs {
border-bottom: 1px solid #ccc;
border-left: 1px solid #ccc;
background-color: white;
padding: 0 20px;
.ant-tabs-bar {
margin: 4px 0 0;
border: none;
}
.page-transition-leave-active {
opacity: 0;
}
}
.page-transition-enter .page-transition-container,
.page-transition-leave-active .page-transition-container {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
.tab-layout-tabs.ant-tabs {
/*美化弹出Tab样式*/
.ant-tabs-nav-container {
margin-top: 4px;
}
&.ant-tabs-card .ant-tabs-tab {
/* 修改 ant-tabs 样式 */
.tab-layout-tabs.ant-tabs {
border-bottom: 1px solid #ccc;
border-left: 1px solid #ccc;
background-color: white;
padding: 0 20px;
padding: 0 24px !important;
background-color: white !important;
margin-right: 10px !important;
.ant-tabs-bar {
margin: 4px 0 0;
border: none;
.ant-tabs-close-x {
width: 12px !important;
height: 12px !important;
opacity: 0 !important;
cursor: pointer !important;
font-size: 12px !important;
margin: 0 !important;
position: absolute;
top: 36%;
right: 6px;
}
&:hover .ant-tabs-close-x {
opacity: 1 !important;
}
}
.tab-layout-tabs.ant-tabs {
&.ant-tabs-card .ant-tabs-tab {
padding: 0 24px !important;
background-color: white !important;
margin-right: 10px !important;
.ant-tabs-close-x {
width: 12px !important;
height: 12px !important;
opacity: 0 !important;
cursor: pointer !important;
font-size: 12px !important;
margin: 0 !important;
position: absolute;
top: 36%;
right: 6px;
}
&:hover .ant-tabs-close-x {
opacity: 1 !important;
}
}
}
.tab-layout-tabs.ant-tabs.ant-tabs-card > .ant-tabs-bar {
.ant-tabs-tab {
border: none !important;
border-bottom: 1px solid transparent !important;
}
.tab-layout-tabs.ant-tabs.ant-tabs-card > .ant-tabs-bar {
.ant-tabs-tab {
border: none !important;
border-bottom: 1px solid transparent !important;
}
.ant-tabs-tab-active {
border-color: @primary-color!important;
}
.ant-tabs-tab-active {
border-color: @primary-color !important;
}
}
</style>
+2 -2
View File
@@ -94,8 +94,8 @@ export default class EsEnum {
}
for (const i in this) {
const e = this[i]
if (e.index !== undefined && e.index !== null && e.index.toString() === index.toString()) {
return e.name
if (e.value !== undefined && e.value !== null && e.value.toString() === index.toString()) {
return e.text
}
}
return '--'
+8 -1
View File
@@ -43,7 +43,8 @@ export const ConfigurableTableMixin = {
filters: {}, // 固定的搜索条件
needFilterTableBtn: true, // 是否需要过滤没有权限的按钮
tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
getTableHeaderFunc: null // 获取表头的方法
getTableHeaderFunc: null, // 获取表头的方法
tableSlotField: [] // 表格需要使用插槽的字段,dbFieldName
}
},
computed: {
@@ -124,6 +125,12 @@ export const ConfigurableTableMixin = {
item.width = 215
item.title = item.dbFieldTxt
item.dataIndex = item.dbFieldName
// 在各自页面写此页面需要使用插槽的字段
if (this.tableSlotField && this.tableSlotField.includes(item.dbFieldName)) {
item.scopedSlots = {
customRender: item.dbFieldName
}
}
tempColumns.push(item)
})
if (this.showAction && this.operateColumn) {
@@ -0,0 +1,146 @@
<template>
<div class="detail-page">
<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 class="detail-page-part-title-operate-box" v-if="index === 0">
<!-- 更新记录-->
<a-button type="link" @click="handleOpenUpdateRecord">
<i class="iconfont icon-root-list" />
{{ $t('standardRegulationLibrary.updateRecord') }}
</a-button>
<!-- 提交问题-->
<a-button type="link" @click="submitQuestion">
<a-icon type="database" />
{{ $t('standardRegulationLibrary.submitQuestion') }}
</a-button>
<!-- 分享-->
<a-button type="link"><i class="iconfont icon-root-list" />{{ $t('share') }}</a-button>
</div>
</div>
<div class="detail-page-part-form" v-if="index !== 3">
<div class="detail-page-part-form-item" v-for="formItem in form[part]" :key="formItem.id">
<label>{{ formItem.dbFieldTxt }}</label>
<span>{{ detailData[formItem.dbFieldName] }}</span>
</div>
</div>
<!-- 过程稿件特殊处理-->
<div class="detail-page-process-manuscript" v-if="index === 3">
<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">{{ $t('standardRegulationLibrary.standardResolutionSheet') }}</a-button>
</div>
<div class="detail-page-process-manuscript-file" v-for="file in detailData[formItem.dbFieldName]" :key="file.id">
<div class="detail-page-process-manuscript-file-info">
<a-icon type="link" />
<div class="detail-page-process-manuscript-file-name">{{ file.fileName }}</div>
</div>
<div class="detail-page-process-manuscript-file-operate">
<a-button type="link" icon="download">{{ $t('download') }}</a-button>
<a-button type="link">
<i class="iconfont icon-water-drop-slash"></i>
{{ $t('unwatermarkedDownload') }}
</a-button>
</div>
</div>
</div>
</div>
</div>
<!-- 更新记录-->
<upload-record-modal ref="uploadRecordModal" />
<!-- 提交问题-->
<submit-question-modal ref="submitQuestionModal" />
</div>
</template>
<script>
import '@assets/less/common.less'
import { TagsTypeEnums } from '../../../enums/commonEnums'
import { getDomesticStandardFormModal } from '../../../api/standardRegulationLibraryApi'
import UploadRecordModal from './modules/UploadRecordModal.vue'
import SubmitQuestionModal from './modules/SubmitQuestionModal.vue'
export default {
name: 'StandardDetailPage',
components: { UploadRecordModal, SubmitQuestionModal },
data () {
return {
partList: [], // 页面模块列表
form: {}, // 页面字段
detailData: {
modification_list: [
{
id: 1,
fileName: '国内文字占位符段落标题标准.pdf'
},
{
id: 2,
fileName: '国内标准国内文字占位符段落标题标准.pdf'
},
{
id: 3,
fileName: '国内标准国内标准.pdf'
}
],
draft_for_review: [{
id: 11,
fileName: '国内文字占位符段落标题标准.pdf'
}],
draft_for_approval: [{
id: 21,
fileName: '国内标准国内文字占位符段落标题标准.pdf'
}],
draft_for_comment: [{
id: 31,
fileName: '国内标准国内标准.pdf'
}],
draft: [{
id: 311,
fileName: '国内标准国内标准.pdf'
}]
} // 页面数据
}
},
computed: {
pageTitle () {
return TagsTypeEnums.nameOfIndex(this.$route.query.type)
}
},
created () {
this.initForm()
},
methods: {
initForm () {
getDomesticStandardFormModal().then(res => {
if (res.success) {
const data = res.result || {}
this.partList = Object.keys(data)
this.form = data
} else {
this.$message.warn(res.message)
}
})
},
/**
* 更新记录
*/
handleOpenUpdateRecord () {
this.$refs.uploadRecordModal.open()
},
/**
* 提交问题
*/
submitQuestion () {
this.$refs.submitQuestionModal.open()
}
}
}
</script>
<style scoped lang="less">
</style>
@@ -0,0 +1,70 @@
<template>
<j-modal
:title="$t('standardRegulationLibrary.submitQuestion')"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel">
<a-form :form="form">
<a-row :gutter="24">
<a-col :span="12">
<!-- 标题-->
<a-form-item :label="$t('title')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter') + $t('title')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="50"
v-decorator="[ 'title', validatorRules.title]" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</j-modal>
</template>
<script>
export default {
name: 'SubmitQuestionModal',
data () {
return {
width: 800,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
modal: {},
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
validatorRules: {
// 标题
title: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('title') }],
validateTrigger: 'blur'
}
}
}
},
methods: {
open () {
this.visible = true
},
handleOk () {
},
handleCancel () {
}
}
}
</script>
<style scoped lang="less">
</style>
@@ -0,0 +1,54 @@
<template>
<j-modal
:title="$t('standardRegulationLibrary.updateRecord')"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
@cancel="handleCancel">
<div class="record-item" v-for="record in recordList" :key="record">
{{ record }}
</div>
<template v-slot:footer>
<a-button @click="handleCancel">{{ $t('close') }}</a-button>
</template>
</j-modal>
</template>
<script>
export default {
name: 'UploadRecordModal',
data () {
return {
width: 800,
visible: false,
confirmLoading: false,
recordList: [
'111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111',
'222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222'
]
}
},
methods: {
open () {
this.visible = true
},
handleCancel () {
this.visible = false
}
}
}
</script>
<style scoped lang="less">
.record-item {
padding: 20px 0;
border-bottom: 1px solid #E5E6EB;
}
.record-item:first-child {
padding-top: 0;
}
</style>
@@ -5,11 +5,14 @@
<!-- $t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')-->
<a-input-search v-model="treeInput" :placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
@search="handleTreeSearch" />
<a-tree :show-line="true" :show-icon="true" :tree-data=treeData>
<a-tree :show-line="true" :show-icon="true" :tree-data=treeData :selected-keys="selectedTreeKeys">
<a-icon type="folder" slot="folder" class="tree-icon" />
<template #custom="record">
<div class="tree-operate-node" @mouseenter="handleTreeMouseover(record.key)" @mouseleave="handleTreeMouseout(record.key)">
<div class="tree-operate-node"
@mouseenter="handleTreeMouseover(record.key)"
@mouseleave="handleTreeMouseout(record.key)"
@click="handleSelectTreeNode(record)">
<a-tooltip>
<template #title>
{{ record.nodeName }}
@@ -18,13 +21,15 @@
</a-tooltip>
<template v-if="record.key === mouseInNodeKey">
<!-- 新增-->
<a-button icon="plus" class="tree-operate-node-btn" @click="handleAddTreeNode(record)"></a-button>
<a-button icon="plus" class="tree-operate-node-btn" @click.stop="handleAddTreeNode(record)"></a-button>
<!-- 编辑-->
<a-button class="tree-operate-node-btn" @click="handleEditTreeNode(record)">
<a-button class="tree-operate-node-btn" @click.stop="handleEditTreeNode(record)">
<i class="iconfont icon-bianji" />
</a-button>
<!-- 删除根节点不能删除-->
<a-button class="tree-operate-node-btn" v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value">
<a-button class="tree-operate-node-btn"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
@click.stop="handleDelTreeNode(record)">
<i class="iconfont icon-shanchu_" />
</a-button>
</template>
@@ -75,9 +80,11 @@
<!-- 批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel">{{ $t('batchDelete') }}</a-button>
<!-- 配置标准-->
<a-button type="primary" icon="setting" ghost>{{ $t('standardRegulationLibrary.configStandard') }}</a-button>
<a-button type="primary" icon="setting" ghost @click="handleConfigStandard">{{ $t('standardRegulationLibrary.configStandard') }}</a-button>
<!-- 移出标准-->
<a-button type="primary" icon="minus-circle" ghost>{{ $t('standardRegulationLibrary.removeStandard') }}</a-button>
<a-button type="primary" icon="minus-circle" ghost @click="handleRemoveStandard">
{{ $t('standardRegulationLibrary.removeStandard') }}
</a-button>
</div>
<div>
<j-table
@@ -91,6 +98,24 @@
:scroll="{x: '100%'}"
@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}">
<!-- 收藏-->
<a @click="operationClick(operationList[0],record)">
@@ -127,6 +152,8 @@
<user-select-modal ref="userSelectModal" type="checkbox" @change="continueShare" />
<!-- 树新增编辑-->
<domestic-system-tree-modal ref="treeModal" @ok="modalFormOk" />
<!-- 配置标准-->
<standard-selection-modal ref="standardSelectionModal" @change="continueConfigStandard" />
</a-card>
</template>
@@ -136,10 +163,18 @@ import { ConfigurableTableMixin } from '../../../mixins/ConfigurableTableMixin'
import Search from '../../../components/customField/Search.vue'
import JTable from '../../../components/jero/JTable.vue'
import DomesticStandardModal from './modules/DomesticStandardModal.vue'
import { getDomesticStandardTableHeader, getDomesticStandardSearchForm, shareDomesticStandard } from '../../../api/standardRegulationLibraryApi'
import { YesOrNoEnum, StandardSystemTreeNodeType } from '../../../enums/commonEnums'
import {
getDomesticStandardTableHeader,
getDomesticStandardSearchForm,
shareDomesticStandard,
deleteDomesticSystemTree,
configDomesticStandard,
removeDomesticStandard
} from '../../../api/standardRegulationLibraryApi'
import { YesOrNoEnum, StandardSystemTreeNodeType, TagsTypeEnums } from '../../../enums/commonEnums'
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
import DomesticSystemTreeModal from './modules/DomesticSystemTreeModal.vue'
import StandardSelectionModal from '../../../components/selection/StandardSelectionModal.vue'
const apiTreeData = [
{
@@ -166,7 +201,7 @@ const apiTreeData = [
export default {
name: 'DomesticStandardList',
components: { Search, JTable, DomesticStandardModal, UserSelectModal, DomesticSystemTreeModal },
components: { Search, JTable, DomesticStandardModal, UserSelectModal, DomesticSystemTreeModal, StandardSelectionModal },
mixins: [ConfigurableTableMixin],
data () {
return {
@@ -208,10 +243,12 @@ export default {
exportZipUrl: '', // 带文件导出
importExcelUrl: '' // 导入
},
dataSource: [{ id: 1, collectionFlag: '1' }],
dataSource: [{ id: 1, collectionFlag: '1', standard_name: '标准001', standard_number: 'BZ001' }],
yesValue: YesOrNoEnum.YES.value,
noValue: YesOrNoEnum.NO.value,
nowShareId: null // 当前正在分享的数据的id
nowShareId: null, // 当前正在分享的数据的id
selectedTreeKeys: [], // 选中的树节点
tableSlotField: ['standard_name', 'standard_number'] // 表格中需要插槽的字段
}
},
computed: {
@@ -324,11 +361,118 @@ export default {
// 清空列表选中
this.onClearSelected()
},
/**
* 新增树节点
* @param dataRef
*/
handleAddTreeNode ({ dataRef }) {
this.$refs.treeModal.add({ parentId: dataRef.key })
},
/**
* 编辑树节点
* @param dataRef
*/
handleEditTreeNode ({ dataRef }) {
this.$refs.treeModal.edit(dataRef)
},
/**
* 删除树节点
* @param dataRef
*/
handleDelTreeNode ({ dataRef }) {
this.$confirm({
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
deleteDomesticSystemTree({ ids: 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]
},
/**
* 配置标准
*/
handleConfigStandard () {
// 没选择左侧树节点,需要提示“请先选择二级及以下体系”
if (!this.selectedTreeKeys || this.selectedTreeKeys.length === 0) {
this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode'))
return
}
this.$refs.standardSelectionModal.open()
},
/**
* 配置标准-提交
* @param dbFieldName
* @param standardIds
*/
continueConfigStandard (dbFieldName, standardIds) {
this.loading = true
const params = {
nodeId: this.selectedTreeKeys[0],
standardIds
}
configDomesticStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 移出标准
*/
handleRemoveStandard () {
// 没选择左侧树节点,需要提示“请先选择二级及以下体系”
if (!this.selectedTreeKeys || this.selectedTreeKeys.length === 0) {
this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode'))
return
}
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('standardRegulationLibrary.selectLeastOneTableData'))
return
}
this.loading = true
const params = {
nodeId: this.selectedTreeKeys[0],
ids: this.selectedRowKeys.join(',')
}
removeDomesticStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
toDetailPage ({ id }) {
this.$openPageNewSheet({
path: '/standardRegulationLibrary/DomesticStandardDetail',
query: {
id,
type: TagsTypeEnums.DOMESTIC_LIST.value
}
})
}
}
}
@@ -42,7 +42,7 @@ export default {
sm: { span: 20 }
},
validatorRules: {
// 上级节点
// 节点名称
nodeName: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.nodeName') }],
validateTrigger: 'blur'