[update] 上宝库

This commit is contained in:
zhaomeijing
2022-06-22 17:58:11 +08:00
parent c9538cfb5a
commit c9d0a2c8da
4 changed files with 380 additions and 36 deletions
+4 -1
View File
@@ -618,7 +618,7 @@ module.exports = {
TaskRequirements: 'Task Requirements',
CertificationProgress: 'Homologation Progress',
CurrentProjectStatusEvaluation: 'Current State',
NiONumber: 'NiO number',
NiONumber: 'NIO number',
ParameterName: 'Parameter name',
ParameterDescription: 'Parameter description',
Version: 'Version',
@@ -982,4 +982,7 @@ module.exports = {
Enable: 'Enable',
Latestupdatetime: 'Latest update time',
Exporthistory: 'Exporthistory',
Exporttype: 'Export Type',
Exporttime: 'Export Time',
file: 'File'
}
+3
View File
@@ -987,4 +987,7 @@ module.exports = {
Enable: '启用',
Latestupdatetime: '最新更新时间',
Exporthistory: '导出历史',
Exporttype: '导出类型',
Exporttime: '导出时间',
file: '文件'
}
@@ -0,0 +1,361 @@
<template>
<div class='diolag-area'>
<a-spin :spinning='spinLoading'>
<a-form-model
class='tag-module'
ref='ruleForm'
:model='formData'
:rules='rules'
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<a-row :gutter='24'>
<a-col :span='9'>
<a-form-model-item :label="$t('entryName')" prop='projectName'>
<a-input
:placeholder="$t('PleaseEnter')+$t('entryName')"
v-model='formData.projectName' />
</a-form-model-item>
</a-col>
<a-col :span='9'>
<a-form-model-item :label="$t('ListTitle')" prop='ListTitle'>
<a-input
:placeholder="$t('PleaseEnter')+$t('ListTitle')"
v-model='formData.projectName' />
</a-form-model-item>
</a-col>
<a-col :span='6' style='margin-top: 4px;'>
<a-button class='box-button' type='primary' @click='searchQuery'>{{ $t('query') }}</a-button>
<a-button class='box-button' style='margin-left: 8px' @click='searchReset'>{{ $t('reset') }}</a-button>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<a-table
class='table-area'
ref='table'
size='middle'
rowKey='id'
:columns='columns'
:dataSource='areaTable'
:pagination='false'
:loading='loading'
:scroll='{x: 600}'
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@change='handleTableChange'>
<span slot='click' slot-scope='text, record'>
<a class='action-edit' @click='editArea(record)' v-has="'area:edit'">{{ text }}</a>
</span>
</a-table>
<div class="page" style='display: flex;justify-content: flex-end;'>
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
<div class='drawer-bootom-button'>
<a-button style='margin-right: .8rem' @click='handleCancel'>{{ $t('cancel') }}</a-button>
<a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('submit') }}</a-button>
</div>
</div>
</template>
<script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
import axios from 'axios'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default {
name: 'diolagArea',
components: {},
data() {
return {
token:Vue.ls.get(ACCESS_TOKEN),
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
loading: false,
editId: '',
columns: [
{
title: this.$t('entryName'),
dataIndex: 'projectName',
key: 'showArea',
align: 'center',
ellipsis: true
},
{
title: this.$t('ListTitle'),
align: 'center',
dataIndex: 'title',
ellipsis: true
},
{
title: this.$t('Exporttype'),
align: 'center',
dataIndex: 'paramsTemplateName',
ellipsis: true
},
{
title: this.$t('Exporttime'),
align: 'center',
dataIndex: 'paramsTemplateName',
ellipsis: true
},
{
title: this.$t('file'),
align: 'center',
dataIndex: 'paramsTemplateName',
ellipsis: true
}
],
newVisible: false,
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
form: {},
formData: {},
rules: {
title: [
{ required: true, message: this.$t('enterTitle'), trigger: 'blur' }
]
},
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
selectedRowKeys: [],
pageNo: 1,
pageSize: 10,
listVisible: false,
listVisibleRowDate: {}
}
},
props: {
version: {
type: Number,
default: '',
required: false
},
projectId: {
type: String,
default: '',
require: true
},
url: {
type: Object,
default: '',
require: true
}
},
mounted() {
this.loadData()
},
methods: {
// 清单列表传出数据
listVisibleRow(val) {
this.selectedRowKeys = []
let newAreaTable=JSON.parse(JSON.stringify(this.areaTable))
newAreaTable.forEach((item, index) => {
if( item.id == this.listVisibleRowDate.id ) {
let _obj = {...item}
_obj.paramsTemplateId = val[0].id
_obj.paramsTemplateName = val[0].paramsTemplateName
this.areaTable.splice(index, 1,_obj)
}
})
console.log(this.areaTable,'this.areaTable')
this.listVisible = false
},
editArea(val) {
this.listVisibleRowDate = val
console.log(val)
this.listVisible = true
},
pageOnChange(page, pageSize) {
this.pageNo = page
this.loadData()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.loadData()
},
loadData() {
let _this = this
let params = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.formData
}
this.loading = true
axios({
url: `/jero-boot/params/manifest/getAllManifest`,
method: 'post',
data: params,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
if (res.data.success) {
console.log(res.data)
this.loading = false
this.areaTable = res.data.result.records || []
this.total = res.data.result.total
}else{
this.loading = false
}
})
.catch( (error) =>{
console.log(error);
});
},
searchQuery() {
this.loadData()
},
searchReset() {
this.formData = {}
this.loadData()
},
handleCancel() {
this.$emit('areaVisible', false)
},
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
this.selectedRowKeysDate = selectedRowKeysDate
this.selectedRowKeys = selectedRowKeys
},
handleTableChange(val) {
console.log(',,,')
},
showModal() {
this.title = this.$t('add')
this.newVisible = true
this.form = {}
},
//新增
handleSubmit() {
let _this = this
if (this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('pleaseSelectData'))
} else if (this.selectedRowKeys.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
} else {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.spinLoading = true
this.confirmLoading = true
let _tt = {
paramsTemplateId: this.selectedRowKeysDate[0].paramsTemplateId,
projectId: this.selectedRowKeysDate[0].projectId,
title: this.selectedRowKeysDate[0].title,
paramsTemplatePublishVersion: this.selectedRowKeysDate[0].paramsTemplatePublishVersion,
sourceManifestId: this.selectedRowKeysDate[0].id,
}
axios({
url: `/jero-boot/params/manifest/copy`,
method: 'post',
data: _tt,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
if (res.data.success) {
_this.$emit('copysubmit')
_this.$message.success(res.data.message)
_this.flag = false
_this.spinLoading = false
_this.confirmLoading = false
}else{
_this.$message.warning(res.data.message)
_this.flag = false
_this.spinLoading = false
_this.confirmLoading = false
}
})
.catch( (error) =>{
console.log(error);
});
} else {
return false
}
})
}
},
},
watch: {
selectedRowKeyS(val) {
this.selectedRowKeys = val
}
}
}
</script>
<style lang='less' scoped>
@import '~@assets/less/common.less';
.diolag-area {
.table-area {
margin: 20px 0;
.action-edit {
margin-right: 10px;
}
}
.table-del {
color: red;
}
}
.drawer-bootom-button{
display: flex;
justify-content: center;
}
.Required {
color: red;
margin-right: 4px;
}
</style>
<style lang='less'>
.area-module {
.ant-modal-wrap {
.ant-modal {
.ant-modal-content {
.ant-modal-footer {
text-align: center;
}
}
}
}
}
</style>
@@ -45,11 +45,8 @@
{{ text && text.length > 15 ? text.slice(0, 14) + '...' : text }}
</a>
</span>
<span slot="titleName" slot-scope="text,record" :title="text">
{{ text && text.length > 30 ? text.slice(0, 29) + '...' : text }}
</span>
<span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="edit(record)">{{$t('Exporthistory')}}</a>
<a class="text-operation" @click="handlecody(record)">{{$t('Exporthistory')}}</a>
<a class="text-operation" @click="deleteLib(record)">{{$t('See')}}</a>
</span>
</a-table>
@@ -65,37 +62,16 @@
@showSizeChange="SizeChange"
/>
</div>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
<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-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text add-text-text">
<span class="Required">*</span>
<span class="title-text-text"
:title="$t('templateName')">{{$t('templateName')}}</span>
</div>
<a-form-model-item class="itemModel" prop="paramsTemplateName">
<a-input class="box-input add-input"
v-model="formInline.paramsTemplateName"
:placeholder="$t('PleaseEnter')+$t('templateName')"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
<div class="drawer-bootom-button">
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
<!-- 复制参数模板-->
<a-modal class="show-drawer" :title="titleTag" width="900px" v-model="drawerVisible" :footer="null">
<export-history v-if='drawerVisible' @areaVisible='drawerVisible = false'></export-history>
</a-modal>
</a-card>
</template>
<script>
import ExportHistory from '@/components/exporthistory/index'
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import addModel from './components/addModel'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import eventBUs from '../../../common/event'
@@ -103,7 +79,7 @@ import Vue from 'vue'
export default {
name: 'index',
components: {
addModel,
ExportHistory
},
data() {
return {
@@ -123,11 +99,6 @@ export default {
confirmLoading: false,
url: {
list: 'params/report/page',
add: 'params/template/add',
edit: 'params/template/edit',
deleteBatch: 'params/template/delete',
deleteAll: 'params/template/deleteBatch',
copy: 'params/template/copyById'
},
total: 0,
pageSize: 10,
@@ -161,6 +132,8 @@ export default {
queryParam: {},
areaVisible:false,
paramsTemplateName: '',
drawerVisible: false,
titleTag: '导出历史'
}
},
mounted() {
@@ -196,6 +169,10 @@ export default {
this.selectedRowKeys = value
this.selectedRowKeysArray = this.selectedRowKeys.join(',')
},
// 复制
handlecody(){
this.drawerVisible=true
},
hideModal(){
this.visible = false;
},