[update] 增加企标详情页,未完全写完,添加企标操作弹框

This commit is contained in:
lideqin
2023-09-08 17:42:21 +08:00
parent 798774b291
commit c7c1a9aa27
9 changed files with 682 additions and 39 deletions
@@ -49,16 +49,16 @@
<div class="table-operator">
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button icon="upload">{{ $t('import') }}</a-button>
<a-button icon="upload" type="primary" ghost>{{ $t('import') }}</a-button>
</a-upload>
<a-button icon="export" @click="handleExportXls">{{ $t('export') }}</a-button>
<a-button icon="mail" @click="handleFileExport">{{ $t('exportWithFile') }}</a-button>
<a-button icon="download" @click="downTemplate($t('enterpriseStandardLibrary.enterpriseStandard.templateExport'))">{{ $t('templateDownload') }}</a-button>
<a-button icon="delete" @click="batchDel">{{ $t('batchDelete') }}</a-button>
<a-button icon="setting" @click="handleAllocationStandard">{{ $t('enterpriseStandardLibrary.enterpriseStandard.allocationStandard') }}</a-button>
<a-button icon="setting" @click="handleShiftOutStandard">{{ $t('enterpriseStandardLibrary.enterpriseStandard.shiftOutStandard') }}</a-button>
<a-button icon="setting" @click="handleInitChange">{{ $t('enterpriseStandardLibrary.enterpriseStandard.initChange') }}</a-button>
<a-button icon="setting" @click="handleTemporaryPermissSet">{{ $t('enterpriseStandardLibrary.enterpriseStandard.temporaryPermissionSet') }}</a-button>
<a-button icon="export" type="primary" ghost @click="handleExportXls">{{ $t('export') }}</a-button>
<a-button icon="mail" type="primary" ghost @click="handleFileExport">{{ $t('exportWithFile') }}</a-button>
<a-button icon="download" type="primary" ghost @click="downTemplate($t('enterpriseStandardLibrary.standard.templateExport'))">{{ $t('templateDownload') }}</a-button>
<a-button icon="delete" type="primary" ghost @click="batchDel">{{ $t('batchDelete') }}</a-button>
<a-button icon="setting" type="primary" ghost @click="handleAllocationStandard">{{ $t('enterpriseStandardLibrary.standard.allocationStandard') }}</a-button>
<a-button icon="minus-circle" type="primary" ghost @click="handleShiftOutStandard">{{ $t('enterpriseStandardLibrary.standard.shiftOutStandard') }}</a-button>
<a-button icon="setting" type="primary" ghost @click="handleInitChange">{{ $t('enterpriseStandardLibrary.standard.initChange') }}</a-button>
<a-button icon="setting" type="primary" ghost @click="handleTemporaryPermissSet">{{ $t('enterpriseStandardLibrary.standard.temporaryPermissionSet') }}</a-button>
</div>
<div>
<j-table
@@ -74,7 +74,7 @@
<!-- 在混入里已经过滤过没有权限的按钮了 -->
<template slot="operation" slot-scope="{text, record}">
<a v-for="(operation, index) in operationList.slice(0, operateMaxNum)" :key="index" @click="operationClick(operation,record)">
<template v-if="operation.text === $t('enterpriseStandardLibrary.enterpriseStandard.collection')">
<template v-if="operation.text === $t('enterpriseStandardLibrary.standard.collection')">
<i class="iconfont icon-star1" v-show="record.collectFlag === 1" />
<i class="iconfont icon-star" v-show="!record.collectFlag || record.collectFlag === 0" />
</template>
@@ -110,7 +110,10 @@
</j-table>
</div>
</div>
<!-- 新增、编辑弹框 -->
<enterprise-standard-modal ref="modalForm" @ok="modalFormOk"></enterprise-standard-modal>
<standard-selection-modal ref="standardSelectionModal" @change="allocationStandardChange"></standard-selection-modal>
<temporary-permission-set ref="temporaryPermissionSet" @ok="modalFormOk"></temporary-permission-set>
</a-card>
</template>
@@ -120,12 +123,26 @@ import JTable from '@/components/jero/JTable'
// 搜索组件
import Search from '@/components/customField/Search'
import { ConfigurableTableMixin } from '@/mixins/ConfigurableTableMixin'
import { getEnterpriseStandardTableHeader, getEnterpriseStandardSearchForm } from '@api/enterpriseStandardLibraryApi'
import {
getTreeList,
getEnterpriseStandardTableHeader,
getEnterpriseStandardSearchForm,
allocationStandard,
shiftStandard,
initChange,
collectStandard,
shareStandard
} from '@api/enterpriseStandardLibraryApi'
// 添加、编辑弹框
import EnterpriseStandardModal from './modules/EnterpriseStandardModal'
// 选择标准组件
import StandardSelectionModal from '@/components/selection/StandardSelectionModal'
// 临时权限设置
import TemporaryPermissionSet from './modules/TemporaryPermissionSet'
export default {
name: 'EnterpriseStandardList',
components: { EnterpriseStandardModal, JTable, Search },
components: { TemporaryPermissionSet, StandardSelectionModal, EnterpriseStandardModal, JTable, Search },
mixins: [ConfigurableTableMixin],
data () {
return {
@@ -139,7 +156,7 @@ export default {
mouseInNodeKey: null, // 鼠标悬浮的节点key值
operationList: [
{
text: this.$t('enterpriseStandardLibrary.enterpriseStandard.collection'),
text: this.$t('enterpriseStandardLibrary.standard.collection'),
clickEvent: 'handleCollection',
has: 'enterpriseStandard:collection'
},
@@ -173,27 +190,13 @@ export default {
exportZipUrl: '', // 带文件导出
downTemplateUrl: '' // 下载导入模板
},
showAction: true, // 是否显示操作列
dataSource: [
{
collectFlag: '0',
id: 'fd045f5c5d734087a884a63664ee91f1',
issue_time: '',
region: '',
serial_number: '0621001编号',
state: '现行',
subscribeFlag: '0',
technology_territory: '',
title: '0621001标题',
title_en: '0621001Title'
}
]
showAction: true // 是否显示操作列
}
},
methods: {
// 获取左侧树数据
initTreeData (params) {
getWorkGroupTreeList(params).then(res => {
getTreeList(params).then(res => {
if (res.success) {
this.treeData = this.dealTreeData(res.result)
// this.treeData = res.result
@@ -262,19 +265,89 @@ export default {
},
// 配置标准
handleAllocationStandard () {
// 没选择左侧树节点,需要提示“请先选择二级及以下体系”
if (!this.currentTreeNode || this.currentTreeNode.length === 0) {
this.$message.warn(this.$t('enterpriseStandardLibrary.standard.pleaseSelectLeastOneNode'))
return
}
this.$refs.standardSelectionModal.open()
},
// 配置标准确定
allocationStandardChange (dbFieldName, standardIds) {
this.loading = true
const params = {
nodeId: this.currentTreeNode[0],
standardIds
}
allocationStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 移出标准
handleShiftOutStandard () {
// 没选择左侧树节点,需要提示“请先选择二级及以下体系”
if (!this.currentTreeNode || this.currentTreeNode.length === 0) {
this.$message.warn(this.$t('enterpriseStandardLibrary.standard.pleaseSelectLeastOneNode'))
return
}
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
return
}
this.loading = true
const params = {
nodeId: this.currentTreeNode[0],
ids: this.selectedRowKeys.join(',')
}
shiftStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 发起更改
handleInitChange () {
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
return
}
this.loading = true
const params = {
ids: this.selectedRowKeys.join(',')
}
initChange(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 临时权限设置
handleTemporaryPermissSet () {
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
return
}
this.$refs.temporaryPermissionSet.open(this.selectedRowKeys.join(','))
},
// 操作栏的点击
operationClick (operation, record) {
@@ -286,11 +359,36 @@ export default {
},
// 收藏
handleCollection (record) {
const params = {}
params.id = record.id
collectStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
},
// 分享
handleShare (record) {
const params = {}
params.id = record.id
shareStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
},
// 跳转详情
detailClick (record) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
id: record.id
}
})
}
}
}