Files
laws_weilai/jero-web/src/views/projectManagement/components/TaskParameterCollection.vue
T

418 lines
11 KiB
Java

<template>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-row :gutter="24">
<a-col :md="6" :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" 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>
</span>
</a-row>
</div>
<div class="table-operator">
<div @click="handleAdd" class="operator-text">
<a-icon type="plus"/>
{{$t('add')}}{{ $t('detailedList') }}
</div>
<div @click="handleModule" class="operator-text">
<a-icon type="bulb"/>
{{$t('changeExtension')}}
</div>
<div @click="handleCody" class="operator-text">
<a-icon type="copy"/>
{{$t('copy')}}{{$t('parameter')}}{{ $t('detailedList') }}
</div>
<div @click="handleDel" class="operator-text" v-has="'document:deleteBatch'">
<a-icon type="delete"/>
{{$t('BatchDelete')}}
</div>
</div>
<div style="width: 100%">
<a-table
class='table-area'
ref='table'
size='middle'
rowKey='id'
:columns='columns'
:dataSource='dataSource'
:pagination='false'
:loading='loading'
:scroll='{x: 600}'
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@change='handleTableChange'>
<span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="configure(record)">{{$t('configure')}}</a>
<a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
<a class="text-operation" @click="historicalVersion(record)">{{$t('historicalVersion')}}</a>
</span>
</a-table>
</div>
<div class="page">
<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>
<a-modal v-model="areaVisible" :title="$t('parameterTemplate')" width='750px' :footer="null">
<parameter-template v-if='areaVisible' @areaVisible='handleCancel' :templateTitle='templatetitle'
:selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version'></parameter-template>
</a-modal>
<configure ref="configureRef"/>
</a-card>
</template>
<script>
import ImportFile from '@/components/ImportFile/index'
import ParameterTemplate from '../dialog/ParameterTemplate'
import { getAction,postAction } from '../../../api/manage'
import Configure from '../dialog/configure'
import axios from 'axios'
export default {
name: 'TaskParameterCollection',
components:{
ImportFile,
ParameterTemplate,
Configure
},
data(){
return{
columns:[
{
title: this.$t('title'),
align: 'center',
dataIndex: 'title',
},
{
title: this.$t('status'),
align: 'center',
dataIndex: 'state',
},
{
title: this.$t('parameterTemplateName'),
align: 'center',
dataIndex: 'paramsTemplateName',
},
{
title: this.$t('collectionCompletionTime'),
align: 'center',
dataIndex: 'finishTime',
},
{
title: this.$t('Version'),
align: 'center',
dataIndex: 'version',
},
{
title: this.$t('creator'),
align: 'center',
dataIndex: 'createBy',
},
{
title: this.$t('createTime'),
align: 'center',
dataIndex: 'createTime',
},
{
title: this.$t('operation'),
align: 'center',
fixed: 'right',
width: 200,
scopedSlots: { customRender: 'operation' }
}
],
selectedRowKeys: [],
queryParam: {},
url: {
list: 'params/manifest/page',
add: 'params/manifest/add',
edit: 'params/manifest/edit',
queryById: 'params/manifest/queryById',
deleteBatch: 'params/manifest/delete',
deleteAll: 'params/manifest/deleteBatch',
},
loading: false,
dataSource: [],
areaVisible: false, // 弹框的控制
configureareaVisible: false, // 配置的彈框
pageNo: 1,
pageSize: 10,
total: 0,
selectedRowKeysArray: '',
templatetitle: '',
templatetitleId: '',
rowId: '',
version: 0
}
},
mounted() {
this.getlist()
},
methods:{
deleteLib(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
getAction(_this.url.deleteBatch, { id: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getlist()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
handleTableChange() {
},
//
historicalVersion() {
},
// 配置
configure() {
this.$refs.configureRef.addModel()
},
handleCancel(val) {
this.areaVisible = val
this.getlist()
},
searchQuery() {
this.pageNo = 1
this.getlist()
},
searchReset() {
this.queryParam = {}
this.pageNo = 1
this.getlist()
},
onSelectChange(val) {
this.selectedRowKeys = val
this.selectedRowKeysArray = val.join(',')
},
edit(edit){
this.areaVisible = true
let _this = this
let query = {
id: edit.id
}
getAction(_this.url.queryById, query).then((res) => {
if (res.success) {
console.log(res,'res..')
this.templatetitle = res.result.title
this.selectedRowKeys = res.result.paramsTemplateId.split(',')
this.rowId = res.result.id
this.version = res.result.paramsTemplatePublishVersion
console.log(this.selectedRowKeys,'this.selectedRowKeys')
console.log(typeof this.version)
} else {
}
})
},
handleExport(){
},
handleAdd(){
this.areaVisible = true
},
handleModule(){
},
handleDel(){
let param={
ids: this.selectedRowKeysArray
}
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
postAction(_this.url.deleteAll, param).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getlist()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
handleCody() {
},
getPersonnelList(){
},
pageOnChange() {
},
SizeChange() {
},
getlist() {
let query = {
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.queryParam
}
console.log(this.$route.query,'this.query')
getAction(this.url.list, 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 lang="less" scoped>
@import '~@assets/less/common.less';
.doc-detail {
background: #fff;
height: 100%;
.Virtual-detail-header {
width: 100%;
height: 68px;
line-height: 68px;
padding: 0 32px 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
border-bottom: 2px #eff1f3 solid;
background: #fff;
.Virtual-detail-title {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 20px;
font-weight: 400;
color: #040B29;
line-height: 68px;
}
.doc-detail-right {
width: 800px;
line-height: 68px;
display: flex;
}
}
.Virtual-detail-content {
padding: 0 38px 0 38px;
box-sizing: border-box;
font-size: 16px;
.box-title-text-add {
line-height: 1.4;
}
.title-text-add {
display: inline-block;
font-weight: 500;
margin-right: 16px;
height: 42px;
line-height: 42px;
}
}
}
.header-text {
font-size: 16px;
font-weight: 400;
height: 60px;
color: #000F16;
line-height: 40px;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
}
.text-operation {
margin-right: 8px;
}
.page {
text-align: right;
margin-top: 20px;
}
.operator-text-left {
font-size: 14px;
margin-right: 20px;
background: #eff1f3;
padding: 8px 8px;
cursor: pointer;
border-radius: 4px;
}
</style>
<style>
.box-input .ant-select-selection {
height: 38px !important;
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
}
</style>