This commit is contained in:
lVAL 2020-12-28 17:40:05 +08:00
commit 8297ebcf98
3 changed files with 73 additions and 3 deletions

View File

@ -83,3 +83,11 @@ export function copyIbpData(data) {
data: data
});
}
// 删除ibp数据绘图数据(发布的)
export function deletePublishIbp(id) {
return request({
url: `/api/ibp/${id}`,
method: 'delete'
});
}

View File

@ -463,10 +463,14 @@ export default {
if (this.queryList.afterQuery && this.queryList.afterQuery instanceof Function) {
this.queryList.afterQuery(response.data);
}
const resultData = response.data;
this.$set(this.queryList, 'data', resultData.list);
this.$set(this.queryList, 'total', resultData.total);
if (resultData.pageNum) {
this.pageIndex = resultData.pageNum;
this.queryData[this.currentpagerConfig.pageIndex] = resultData.pageNum;
}
}).catch(() => {
self.enableQuery();
});

View File

@ -4,7 +4,8 @@
</div>
</template>
<script>
import { getIbpList } from '@/api/ibp';
import { getIbpList, deletePublishIbp } from '@/api/ibp';
import { getStationList } from '@/api/runplan';
import {getPublishMapListOnline } from '@/api/jmap/map';
export default {
name: 'PublishIBP',
@ -24,7 +25,8 @@ export default {
label: '地图名称',
config: {
data: []
}
},
selectChange:this.changeMap
},
stationCode: {
type: 'select',
@ -56,11 +58,33 @@ export default {
{
title: '创建时间',
prop: 'createTime'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '300',
buttons: [
// {
// name: this.$t('publish.copy'),
// handleClick: this.handleCopy
// },
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger',
showControl: () => { return this.isShow != -1; }
}
]
}
]
}
};
},
computed: {
isShow() {
return this.$store.getters['roles'].indexOf('05');
}
},
mounted() {
this.loadInitData();
},
@ -74,6 +98,40 @@ export default {
},
covertMap(row) {
return this.mapListMap[row.mapId];
},
changeMap(form) {
if (form.mapId) {
getStationList(form.mapId).then(res=>{
this.queryForm.queryObject.stationCode.config.data = [];
if (res.code == 200) {
res.data.forEach(station => {
const param = {
label: station.name,
value: station.code
};
this.queryForm.queryObject.stationCode.config.data.push(param);
});
}
});
}
},
handleDelete(index, row) {
this.$confirm('此操作将删除ibp盘数据是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deletePublishIbp(row.id).then(res=>{
this.$message.success(this.$t('publish.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
}
// covertData(row) {
// // const staitonlist = this.stationList.filter(element => {