修改上报库管理

This commit is contained in:
范强强
2024-01-15 09:16:09 +08:00
parent b423214ee5
commit a34c8ab0b1
4 changed files with 390 additions and 2 deletions
+2
View File
@@ -2041,4 +2041,6 @@ module.exports = {
maintainer:'Maintainer', maintainer:'Maintainer',
setupMaintainer:'Setup maintainer', setupMaintainer:'Setup maintainer',
maximumOfBeSelected:'A maximum of 30 personnel can be selected', maximumOfBeSelected:'A maximum of 30 personnel can be selected',
syncToList:'Sync to list',
pleaseSelectPublishedData:'Please select published data',
} }
+2
View File
@@ -3775,4 +3775,6 @@ module.exports = {
maintainer:'维护人', maintainer:'维护人',
setupMaintainer:'设置维护人', setupMaintainer:'设置维护人',
maximumOfBeSelected:'最多只能选择30个人员', maximumOfBeSelected:'最多只能选择30个人员',
syncToList:'同步至清单',
pleaseSelectPublishedData:'请选择已经发布的数据',
} }
@@ -0,0 +1,307 @@
<template>
<a-drawer
:title="$t('syncToList')"
:maskClosable="false"
:width="1200"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24" class='add-padding'>
<a-col :md="7" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('title')">
<span>{{$t('title')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
v-model="queryParam.title"></a-input>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button class="box-button" @click="searchReset">{{$t('reset')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<div style="width: 100%">
<a-table
class='table-area'
ref='table'
size='middle'
rowKey='id'
:components="drag(columns,'columns')"
:columns='columns'
:dataSource='dataSource'
:pagination='false'
:loading='loading'
:scroll="{x: '100%',y:'calc(100vh - 320px)'}"
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@change='handleTableChange'>
<span slot="paramsManifestClick" slot-scope="text,record">
<a class="textName" :title="text" @click="paramsManifestClick(record)">
{{ text && text.length > 50 ? text.slice(0, 49) + '...' : text }}
</a>
</span>
<span slot="collectionCompletionTime" slot-scope="text,record">
<span class="textName" :title="record.finishTime">
{{record.finishTime ? record.finishTime : '-'}}
</span>
</span>
</a-table>
</div>
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: 8px" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getAction, postAction } from '../../../../api/manage'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default {
name: 'syncToList',
mixins: [ResizeHeader, ResizeColumnProvide],
data() {
return {
confirmLoading: false,
visible: false,
queryParam: {},
dataSource: [],
loading: false,
dataQuery: {},
selectedRowKeys: [],
columns: [
{
title: this.$t('title'),
align: 'left',
dataIndex: 'title',
width: 280,
scopedSlots: { customRender: 'paramsManifestClick' }
},
{
title: this.$t('status'),
align: 'left',
width: 100,
ellipsis: true,
sorter: true,
dataIndex: 'state'
},
{
title: this.$t('parameterTemplateName'),
align: 'left',
width: 200,
ellipsis: true,
dataIndex: 'paramsTemplateName'
},
{
title: this.$t('relatedProjectVersion'),
align: 'left',
width: 150,
ellipsis: true,
sorter: true,
dataIndex: 'projectVersion'
},
{
title: this.$t('collectionCompletionTime'),
align: 'left',
dataIndex: 'finishTime',
width: 200,
ellipsis: true,
sorter: true,
scopedSlots: { customRender: 'collectionCompletionTime' }
},
{
title: this.$t('Version'),
align: 'left',
width: 100,
ellipsis: true,
sorter: true,
dataIndex: 'version'
},
{
title: this.$t('creator'),
align: 'left',
width: 110,
ellipsis: true,
dataIndex: 'createBy'
},
{
title: this.$t('created'),
align: 'left',
width: 200,
ellipsis: true,
sorter: true,
dataIndex: 'createTime'
}
]
}
},
methods: {
getData(val) {
this.dataQuery = JSON.parse(JSON.stringify(val))
this.visible = true
this.pageNo = 1
this.queryParam = {}
this.selectedRowKeys = []
this.getlist()
},
handleCancel() {
this.visible = false
},
handleSubmit() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
if (this.selectedRowKeys.length == 1) {
let dataList = []
this.selectedRowKeys.forEach(res => {
this.dataSource.forEach(val => {
if (res == val.id) {
dataList.push(val)
}
})
})
let query = {
}
this.confirmLoading = true
postAction('/params/manifest/updateModel', query).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.visible = false
this.confirmLoading = false
this.$emit('syncToListForm')
} else {
this.confirmLoading = false
this.$message.warning(res.message)
}
})
} else {
this.$message.warning(this.$t('OnlyOneSelected'))
}
} else {
this.$message.warning(this.$t('PleaseSelectData'))
}
},
searchQuery() {
this.pageNo = 1
this.getlist()
},
searchReset() {
this.queryParam = {}
this.pageNo = 1
this.getlist()
},
handleTableChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
if (sorter.columnKey == 'projectVersion') {
this.orderByField = 'project_version'
} else if (sorter.columnKey == 'finishTime') {
this.orderByField = 'finish_time'
} else if (sorter.columnKey == 'createTime') {
this.orderByField = 'create_time'
} else {
this.orderByField = sorter.columnKey
}
this.getlist()
},
onSelectChange(val) {
this.selectedRowKeys = val
},
getlist() {
this.selectedRowKeys = []
let query = {
// pageSize: this.pageSize,
// pageNo: this.pageNo,
orderBy: this.orderBy,
orderByField: this.orderByField,
...this.queryParam
}
this.loading = true
getAction('params/manifest/page', query).then((res) => {
if (res.success) {
this.total = res.result.total
this.dataSource = res.result.records || []
this.loading = false
} else {
this.loading = false
}
})
}
}
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 94px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 42px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 110px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.formAdd {
margin-bottom: 40px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
/deep/ .add-input {
min-height: 135px !important;
}
</style>
@@ -33,6 +33,10 @@
</a-form> </a-form>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div @click="syncToListClick" class="operator-text" v-has="'params:template:syncToList'">
<a-icon type="plus"/>
{{$t('syncToList')}}
</div>
<div @click="handleAdd" class="operator-text" v-has="'params:template:add'"> <div @click="handleAdd" class="operator-text" v-has="'params:template:add'">
<a-icon type="plus"/> <a-icon type="plus"/>
{{$t('newlyAdded')}} {{$t('newlyAdded')}}
@@ -72,6 +76,12 @@
<a class="text-operation" v-has="'params:template:setupMaintainer'" <a class="text-operation" v-has="'params:template:setupMaintainer'"
@click="setupMaintainerClick(record)">{{$t('setupMaintainer')}}</a> @click="setupMaintainerClick(record)">{{$t('setupMaintainer')}}</a>
<a class="text-operation"
v-has="'params:template:subscribe'"
:disabled="record.authorityFlag == '1'? true : false"
@click="subscribeClick(record)">
{{!record.readFlag || record.readFlag == 0 ? $t('subscribe') : $t('CancelSubscribe')}}
</a>
<a class="text-operation" <a class="text-operation"
:disabled="record.status == '1' || record.authorityFlag == '1'? true : false" :disabled="record.status == '1' || record.authorityFlag == '1'? true : false"
v-has="'params:template:edit'" v-has="'params:template:edit'"
@@ -110,6 +120,7 @@
<JLoading :loading="JLoading">{{ $t('pleaseWaitWhileRunning') }}</JLoading> <JLoading :loading="JLoading">{{ $t('pleaseWaitWhileRunning') }}</JLoading>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/> <addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
<setupMaintainerModel ref="setupMaintainerModelRef" @setupMaintainerModelForm="setupMaintainerModelForm"/> <setupMaintainerModel ref="setupMaintainerModelRef" @setupMaintainerModelForm="setupMaintainerModelForm"/>
<syncToList ref="syncToListRef" @syncToListForm="syncToListForm"/>
<a-modal class="show-copy" v-model="areaVisible" :title="$t('templateCopy')" :footer="null" @cancel="hideModal"> <a-modal class="show-copy" v-model="areaVisible" :title="$t('templateCopy')" :footer="null" @cancel="hideModal">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm"> <a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24"> <a-row :gutter="24">
@@ -142,18 +153,21 @@
<script> <script>
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import addModel from './components/addModel' import addModel from './components/addModel'
import syncToList from './components/syncToList'
import setupMaintainerModel from './components/setupMaintainerModel' import setupMaintainerModel from './components/setupMaintainerModel'
import axios from 'axios' import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import eventBUs from '../../../common/event' import eventBUs from '../../../common/event'
import Vue from 'vue' import Vue from 'vue'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header' import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
import { mapGetters } from 'vuex'
export default { export default {
name: 'index', name: 'index',
components: { components: {
addModel, addModel,
setupMaintainerModel setupMaintainerModel,
syncToList
}, },
mixins: [ResizeHeader, ResizeColumnProvide], mixins: [ResizeHeader, ResizeColumnProvide],
data() { data() {
@@ -262,7 +276,7 @@
title: this.$t('operation'), title: this.$t('operation'),
align: 'left', align: 'left',
fixed: 'right', fixed: 'right',
width: 280, width: 360,
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
} }
], ],
@@ -275,6 +289,40 @@
this.getList() this.getList()
}, },
methods: { methods: {
...mapGetters(['userInfo']),
subscribeClick(val) {
let _this = this
this.$confirm({
content: val.readFlag == 0 || !val.readFlag ? _this.$t('ConfirmSubscribe') : _this.$t('cancelConfirmSubscribe'),
onOk() {
let url = ''
let action
let query = {}
if (val.readFlag == 0 || !val.readFlag) {
url = 'template/paramsTemplateSubscribeEO/add'
action = postAction
query = {
paramsTemplateId: val.id,
userId: _this.userInfo().id
}
} else {
url = 'template/paramsTemplateSubscribeEO/cancelSubscribe'
action = getAction
query = {
id: val.id
}
}
action(url, query).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
handleCancel() { handleCancel() {
this.areaVisible = false this.areaVisible = false
this.$refs['ruleForm'].resetFields() this.$refs['ruleForm'].resetFields()
@@ -305,6 +353,35 @@
this.selectedRowKeys = value this.selectedRowKeys = value
this.selectedRowKeysArray = this.selectedRowKeys.join(',') this.selectedRowKeysArray = this.selectedRowKeys.join(',')
}, },
syncToListForm() {
this.selectedRowKeys = []
this.getList()
},
syncToListClick() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
if (this.selectedRowKeys.length == 1) {
let dataList = []
this.selectedRowKeys.forEach(res => {
this.dataSource.forEach(val => {
if (res == val.id) {
dataList.push(val)
}
})
})
if (dataList && dataList.length > 0) {
if (dataList[0].status == 1) {
this.$refs.syncToListRef.getData(dataList[0])
} else {
this.$message.warning(this.$t('pleaseSelectPublishedData'))
}
}
} else {
this.$message.warning(this.$t('OnlyOneSelected'))
}
} else {
this.$message.warning(this.$t('PleaseSelectData'))
}
},
//添加 //添加
handleAdd() { handleAdd() {
this.$refs.addModelRef.addModel() this.$refs.addModelRef.addModel()