修改OTA管理的表格变色

This commit is contained in:
范强强
2023-09-15 14:37:48 +08:00
parent c5536f7672
commit 5ac493610b
@@ -29,29 +29,29 @@
</div> </div>
</a-col> </a-col>
<!-- <a-col :md="6" :sm="8">--> <!-- <a-col :md="6" :sm="8">-->
<!-- <div class="box-title-text">--> <!-- <div class="box-title-text">-->
<!-- <div class="title-text" :title="$t('softwareplatform')">--> <!-- <div class="title-text" :title="$t('softwareplatform')">-->
<!-- <span>{{ $t('softwareplatform') }}</span>--> <!-- <span>{{ $t('softwareplatform') }}</span>-->
<!-- </div>--> <!-- </div>-->
<!-- <a-select :placeholder="$t('PleaseSelect')+$t('softwareplatform')"--> <!-- <a-select :placeholder="$t('PleaseSelect')+$t('softwareplatform')"-->
<!-- class="box-input"--> <!-- class="box-input"-->
<!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"--> <!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
<!-- allowClear--> <!-- allowClear-->
<!-- showSearch--> <!-- showSearch-->
<!-- optionFilterProp="children"--> <!-- optionFilterProp="children"-->
<!-- :autoClearSearchValue="false"--> <!-- :autoClearSearchValue="false"-->
<!-- v-model="queryParam.softwareplatform">--> <!-- v-model="queryParam.softwareplatform">-->
<!-- <a-select-option v-for="(item, key) in softwareplatformList"--> <!-- <a-select-option v-for="(item, key) in softwareplatformList"-->
<!-- :key="key"--> <!-- :key="key"-->
<!-- :value="item.value">--> <!-- :value="item.value">-->
<!-- <span style="display: inline-block;width: 100%" :title=" item.name">--> <!-- <span style="display: inline-block;width: 100%" :title=" item.name">-->
<!-- {{ item.name }}--> <!-- {{ item.name }}-->
<!-- </span>--> <!-- </span>-->
<!-- </a-select-option>--> <!-- </a-select-option>-->
<!-- </a-select>--> <!-- </a-select>-->
<!-- </div>--> <!-- </div>-->
<!-- </a-col>--> <!-- </a-col>-->
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<div class="box-title-text"> <div class="box-title-text">
@@ -145,7 +145,7 @@
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a @click="handleToggleSearch"> <a @click="handleToggleSearch">
{{ !toggleSearchStatus ? $t('open') : $t('away') }} {{ !toggleSearchStatus ? $t('open') : $t('away') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'" /> <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a> </a>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button> <a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{ $t('query') }}</a-button> <a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{ $t('query') }}</a-button>
@@ -157,339 +157,354 @@
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" @click="handleExportManage" <div class="operator-text" @click="handleExportManage"
v-has="'ota:export'"> v-has="'ota:export'">
<a-icon type="export" :rotate="-90" /> <a-icon type="export" :rotate="-90"/>
{{ $t('export') }} {{ $t('export') }}
</div> </div>
</div> </div>
<div> <div>
<a-table ref="table" size="middle" :components="drag(columns, 'columns')" :loading="loading" :pagination="false" <a-table ref="table"
:scroll="{ x: '100%', y: 'calc(100vh - 140px)' }" rowKey="id" :data-source="dataSource" @change="tableOnChange" size="middle"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :columns="columns"> :components="drag(columns, 'columns')"
:loading="loading" :pagination="false"
:rowClassName="rowClassName"
:scroll="{ x: '100%', y: 'calc(100vh - 140px)' }" rowKey="id" :data-source="dataSource"
@change="tableOnChange"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :columns="columns">
<!-- --> <!-- -->
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="detailclick(record)">{{text}}</a> <a class="text-operation" @click="detailclick(record)">{{text}}</a>
</span> </span>
</a-table> </a-table>
<div class="page" v-if="dataSource && dataSource.length > 0"> <div class="page" v-if="dataSource && dataSource.length > 0">
<a-pagination :show-total="total => $t('total') + ` ${total} ` + $t('strip')" show-quick-jumper show-size-changer <a-pagination :show-total="total => $t('total') + ` ${total} ` + $t('strip')" show-quick-jumper
:page-size.sync="pageSize" :total="total" :current="pageNo" @change="pageOnChange" show-size-changer
@showSizeChange="SizeChange" /> :page-size.sync="pageSize" :total="total" :current="pageNo" @change="pageOnChange"
@showSizeChange="SizeChange"/>
</div> </div>
</div> </div>
</a-card> </a-card>
</template> </template>
<script> <script>
import { getAction, postAction, deleteAction,downloadFile } from '@/api/manage' import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header' import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
import ImportFile from '@/components/ImportFileData/index' import ImportFile from '@/components/ImportFileData/index'
import moment from 'moment' import moment from 'moment'
export default { export default {
name: 'index', name: 'index',
components: { components: {
ImportFile ImportFile
}, },
mixins: [ResizeHeader, ResizeColumnProvide], mixins: [ResizeHeader, ResizeColumnProvide],
data() { data() {
return { return {
//url传参严格按照当前命名 //url传参严格按照当前命名
url: { url: {
list: '/lawsTechnologyEvaluation/lawsTechnologyEvaluationEO/page', list: '/lawsTechnologyEvaluation/lawsTechnologyEvaluationEO/page',
deleteBatch: '/lawsTechnologyEvaluation/lawsTechnologyEvaluationEO/deleteBatch', deleteBatch: '/lawsTechnologyEvaluation/lawsTechnologyEvaluationEO/deleteBatch',
exportData: '/ota/otaBaCxList/exportData', exportData: '/ota/otaBaCxList/exportData',
importZipUrl: '/ota/otaBaCxList/importData',//导入 importZipUrl: '/ota/otaBaCxList/importData'//导入
}, },
number:'', number: '',
visible: false, visible: false,
loading: false, loading: false,
toggleSearchStatus: false, toggleSearchStatus: false,
dataSource: [], dataSource: [],
selectedRowKeys: [], selectedRowKeys: [],
selectedRowKeysRecord: [], selectedRowKeysRecord: [],
serialNumber: '', serialNumber: '',
total: 0, total: 0,
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
CategoryTreeList: [], CategoryTreeList: [],
softwareversionList: [], softwareversionList: [],
softwareplatformList: [], softwareplatformList: [],
vehicleTypeList: [], vehicleTypeList: [],
marketList: [], marketList: [],
queryParam: { queryParam: {},
}, formInline: {},
formInline: {}, releaseTypeList: ['BUILD', 'MARKETING', 'POC'],
releaseTypeList:['BUILD','MARKETING','POC'], rules: {
rules: { whetherTobring: [
whetherTobring: [ {
required: true,
message: this.$t('standardDecompositionDocument') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
columns: [
{ {
required: true, title: this.$t('softwareversion'),
message: this.$t('standardDecompositionDocument') + this.$t('cannotEmpty'), align: 'left',
trigger: 'change' dataIndex: 'plannedBpLaunchBatch',
ellipsis: true,
sorter: true,
width: 150,
scopedSlots: { customRender: 'operation' }
},
// {
// title: this.$t('softwareplatform'),
// align: 'left',
// dataIndex: 'ggpc',
// ellipsis: true,
// width: 170
// },
{
title: this.$t('market'),
align: 'left',
width: 150,
ellipsis: true,
sorter: true,
dataIndex: 'market'
},
{
title: this.$t('releaseType'),
align: 'left',
width: 150,
ellipsis: true,
sorter: true,
dataIndex: 'releaseType'
},
{
title: this.$t('vehicleType'),
align: 'left',
width: 600,
ellipsis: true,
sorter: true,
dataIndex: 'appliedVehicleProject'
},
{
title: this.$t('softwarereleasetime'),
align: 'left',
width: 120,
ellipsis: true,
sorter: true,
dataIndex: 'releaseDate'
} }
] // {
// title: this.$t('operation'),
// align: 'left',
// fixed: 'right',
// width: 100,
// scopedSlots: { customRender: 'operation' }
// }
],
userInfoQuery: {},
administrators: false,
orderBy: '1',
orderByField: ''
}
},
mounted() {
this.getSelectData()
this.getList()
this.administrators = false
},
methods: {
...mapGetters(['userInfo']),
getSelectData() {
getAction('/ota/otaManageApplyEO/getPullDownList', {}).then((res) => {
if (res.success) {
this.softwareversionList = res.result.plannedBpLaunchBatchList
this.vehicleTypeList = res.result.carSet
this.marketList = res.result.marketSet
} else {
}
})
}, },
columns: [ tableOnChange(pagination, filters, sorter) {
{ this.orderBy = sorter.order == 'ascend' ? '1' : '2'
title: this.$t('softwareversion'), this.orderByField = sorter.columnKey
align: 'left', this.getList()
dataIndex: 'plannedBpLaunchBatch', },
ellipsis: true, handleToggleSearch() {
sorter:true, this.toggleSearchStatus = !this.toggleSearchStatus
width: 150, },
scopedSlots: { customRender: 'operation' } searchQuery() {
}, this.pageNo = 1
// { this.getList()
// title: this.$t('softwareplatform'), },
// align: 'left', searchReset() {
// dataIndex: 'ggpc', this.queryParam = {}
// ellipsis: true, this.$route.query.serialNumber = ''
// width: 170 this.$route.query.flowStatus = ''
// }, this.pageNo = 1
{ this.getList()
title: this.$t('market'), },
align: 'left', pageOnChange(page) {
width: 150, this.pageNo = page
ellipsis: true, this.getList()
sorter:true, },
dataIndex: 'market' SizeChange(page, pageSize) {
}, this.pageNo = 1
{ this.pageSize = pageSize
title: this.$t('releaseType'), this.getList()
align: 'left', },
width: 150, getList() {
ellipsis: true, let queryParam = JSON.parse(JSON.stringify(this.queryParam))
sorter:true, Object.keys(queryParam).forEach(val => {
dataIndex: 'releaseType' if (queryParam[val] instanceof Array) {
}, queryParam[val] = queryParam[val].join(',')
{
title: this.$t('vehicleType'),
align: 'left',
width: 600,
ellipsis: true,
sorter:true,
dataIndex: 'appliedVehicleProject'
},
{
title: this.$t('softwarereleasetime'),
align: 'left',
width: 120,
ellipsis: true,
sorter:true,
dataIndex: 'releaseDate'
},
// {
// title: this.$t('operation'),
// align: 'left',
// fixed: 'right',
// width: 100,
// scopedSlots: { customRender: 'operation' }
// }
],
userInfoQuery: {},
administrators: false,
orderBy: '1',
orderByField: ''
}
},
mounted() {
this.getSelectData()
this.getList()
this.administrators = false
},
methods: {
...mapGetters(['userInfo']),
getSelectData(){
getAction('/ota/otaManageApplyEO/getPullDownList', {}).then((res) => {
if (res.success) {
this.softwareversionList = res.result.plannedBpLaunchBatchList
this.vehicleTypeList = res.result.carSet
this.marketList = res.result.marketSet
} else {
}
})
},
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
this.orderByField = sorter.columnKey
this.getList()
},
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
},
searchQuery() {
this.pageNo = 1
this.getList()
},
searchReset() {
this.queryParam = {}
this.$route.query.serialNumber = ''
this.$route.query.flowStatus = ''
this.pageNo = 1
this.getList()
},
pageOnChange(page) {
this.pageNo = page
this.getList()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.getList()
},
getList() {
let queryParam = JSON.parse(JSON.stringify(this.queryParam))
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
})
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
orderBy: this.orderBy,
orderByField: this.orderByField,
...queryParam
}
this.loading = true
getAction('/ota/otaManageApplyEO/getOtaPage', query).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length == 0) {
this.pageNo = 1
this.getList()
return
} }
this.dataSource = res.result.records || [] })
this.total = res.result.total let query = {
this.loading = false pageNo: this.pageNo,
} else { pageSize: this.pageSize,
this.loading = false orderBy: this.orderBy,
orderByField: this.orderByField,
...queryParam
}
this.loading = true
getAction('/ota/otaManageApplyEO/getOtaPage', query).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length == 0) {
this.pageNo = 1
this.getList()
return
}
this.dataSource = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
},
onSelectChange(value, record) {
this.selectedRowKeys = value
this.selectedRowKeysRecord = record
},
//导出
handleExportManage() {
// console.log('menuId',this.menuId)
let dateName = moment(new Date()).format('YYYYMMDD')
let name = 'OTA' + this.$t('softwareversion') + ' ' + dateName + '.xlsx'
let long = localStorage.getItem('language')
let cut = ''
if (long && long == 'zh-cn') {
this.cut = 'cn'
} else if (long && long == 'en-us') {
this.cut = 'en'
}
let query = {
exportName: name,
selections: this.selectedRowKeys.join(','),
...this.queryParam,
cut: this.cut
} }
})
},
onSelectChange(value, record) {
this.selectedRowKeys = value
this.selectedRowKeysRecord = record
},
//导出
handleExportManage() {
// console.log('menuId',this.menuId)
let dateName = moment(new Date()).format('YYYYMMDD')
let name = 'OTA' + this.$t('softwareversion') + ' ' + dateName + '.xlsx'
let long = localStorage.getItem('language')
let cut = ''
if (long && long == 'zh-cn') {
this.cut = 'cn'
} else if (long && long == 'en-us') {
this.cut = 'en'
}
let query = {
exportName: name,
selections: this.selectedRowKeys.join(','),
...this.queryParam,
cut:this.cut
}
downloadFile('ota/otaManageApplyEO/otaExportXls', name, query, this.selectClear) downloadFile('ota/otaManageApplyEO/otaExportXls', name, query, this.selectClear)
}, },
// 查看 // 查看
detailclick(item){ detailclick(item) {
this.$router.push({ this.$router.push({
path: '/components/detil', path: '/components/detil',
query: item query: item
}) })
}, },
onChange(value, dateString) { onChange(value, dateString) {
if (this.queryParam.releaseDate && this.queryParam.releaseDate.length > 0) { if (this.queryParam.releaseDate && this.queryParam.releaseDate.length > 0) {
let dateOne = moment(dateString[0]).format('YYYY-MM-DD') let dateOne = moment(dateString[0]).format('YYYY-MM-DD')
let dateTwo = moment(dateString[1]).format('YYYY-MM-DD') let dateTwo = moment(dateString[1]).format('YYYY-MM-DD')
this.queryParam.softwareIssueTimeStart = dateOne this.queryParam.softwareIssueTimeStart = dateOne
this.queryParam.softwareIssueTimeEnd = dateTwo this.queryParam.softwareIssueTimeEnd = dateTwo
} else { } else {
this.queryParam.releaseDate = [] this.queryParam.releaseDate = []
// this.queryParamOne[item + '_name'] = [] // this.queryParamOne[item + '_name'] = []
}
},
rowClassName(row, index) {
if (row.isNew) {
return 'rowClassRedYellow'
}
} }
}, }
} }
}
</script> </script>
<style> <style>
.tree-select .ant-select-tree-dropdown { .tree-select .ant-select-tree-dropdown {
height: 298px !important; height: 298px !important;
} }
</style> </style>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.page { .page {
text-align: right; text-align: right;
margin-top: 20px; margin-top: 20px;
} }
.box-title-text { .box-title-text {
line-height: 1.4; line-height: 1.4;
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
} }
.title-text { .title-text {
width: 20%; width: 20%;
min-width: 110px; min-width: 110px;
color: #000F16; color: #000F16;
display: inline-block; display: inline-block;
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
margin-right: 16px; margin-right: 16px;
margin-top: 3px; margin-top: 3px;
text-align: right; text-align: right;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.box-input { .box-input {
display: inline-block; display: inline-block;
width: 70%; width: 70%;
height: 38px; height: 38px;
margin-top: 2px; margin-top: 2px;
} }
.box-button { .box-button {
height: 38px; height: 38px;
/*margin-top: 2px;*/ /*margin-top: 2px;*/
} }
.text-operation { .text-operation {
margin-right: 8px; margin-right: 8px;
} }
.itemModel { .itemModel {
width: calc(100% - 130px); width: calc(100% - 130px);
display: inline-block; display: inline-block;
margin-top: 2px; margin-top: 2px;
} }
.Required { .Required {
color: red; color: red;
margin-right: 4px; margin-right: 4px;
} }
::v-deep .ant-table-row:first-child { /*::v-deep .ant-table-row:first-child {*/
background: #fff !important; /* background: #fff !important;*/
opacity: 0.9; /* opacity: 0.9;*/
} /*}*/
::v-deep .ant-table-body { ::v-deep .ant-table-body {
background: transparent !important; background: transparent !important;
} }
::v-deep .ant-table-placeholder { ::v-deep .ant-table-placeholder {
margin-top: 8px !important; margin-top: 8px !important;
} }
/deep/ .ant-calendar-range-picker-input{
margin-left: -2px !important; /deep/ .ant-calendar-range-picker-input {
} margin-left: -2px !important;
}
::v-deep .rowClassRedYellow {
background: yellow!important;
}
</style> </style>