Commit b58ffb7f by raojiaguan

林草落图代码

parent a49f80e3
import lincaoView from '../control/lincaoView.vue'
export default {
execute: function (bill, param) {
// if (param.param.ipAddress && param.param.layerIds && bill.dom.billdata.JBR) {
GMS.$hideContainer.addComponent(lincaoView, {}, function (c) {
debugger
c.url =`http://${param.param.ipAddress}/jq/addAssociateDatas.do?unitCode=${nros.getUser().loginUnit}&layerIds=${param.param.layerIds}&projectNum=${bill.dom.billdata.JBR}`
let name = GMS.$hideContainer.addComponent(lincaoView, {}, function (c) {
const year = nros.getUser().loginDate.substring(0,4)
c.bill = bill.dom
c.url =`http://${param.param.ipAddress}/jq/addAssociateDatas.do?unitCode=130324&type=${param.param.type}&projectNum=1&year=${year}`
c.name = name
c.modalShow = true;
})
// } else {
// GAMS.Common.messagePrompt('缺少参数')
// }
}
}
\ No newline at end of file
import lincaoReadView from '../control/lincaoReadView.vue'
import axios from 'axios'
export default {
execute: function (bill, param) {
let nowBill = bill.dom
let ipAddress = param.param.ipAddress
let name = GMS.$hideContainer.addComponent(lincaoReadView, {}, function (c) {
const index = nowBill.getSubFocus()
let nowSubData =nowBill.getSubDataRow("XMJHLTZB",index)
if(nowSubData.getValue("LAYERID") && nowSubData.getValue("MZGUID")){
let param = []
let rowData = {
"layerId" : nowSubData.getValue("LAYERID"),
"type" : nowSubData.getValue("LTTYPE"),
"year" : nowSubData.getValue("LTYEAR"),
"tbNums" : nowSubData.getValue("MZGUID"),
//预留后期会修改
// tbNums : "3583682,3583686",
}
param.push(rowData)
c.param = param
c.ipAddress = ipAddress
// const datas = new FormData()
// datas.append("param",JSON.stringify(param))
// let url = `http://${ipAddress}/jq/getDatasView.do`
// const options = {
// method: 'POST',
// headers: { 'content-type': 'application/x-www-form-urlencoded' },
// data: datas,
// url,
// };
// axios(options).then((res) => {
// console.log(res)
// c.htmlValue = res.data
// });
}
c.name = name
c.modalShow = true;
})
}
}
\ No newline at end of file
<template>
<el-dialog
class = "abow_dialog_lincao"
:fullscreen ="true"
width="90%"
:visible.sync="dialogVisible"
v-dialogDrag
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="closeDialog"
>
<iframe class="iframeStyle" id="_iframe" name ="_iframe_name" src="" > </iframe>
</el-dialog>
</template>
<script>
export default {
props: {},
data() {
return {
param :null,
dialogVisible:true,
htmlValue : null,
ipAddress:null,
name :null,
};
},
watch: {
ipAddress() {
debugger
if (!this.ipAddress) return
var data = this.param
var form=document.createElement('form');
form.action=`http://${this.ipAddress}/jq/getDatasView.do`;
form.target='_iframe_name';
form.method='post';
form.style='display:none;';
var paramInput =document.createElement('input');
paramInput.name ='param';
paramInput.type='hidden';
paramInput.value =JSON.stringify(data)
form.appendChild(paramInput)
document.body.appendChild(form)
form.submit();
document.body.removeChild(form);
}
},
methods: {
closeDialog(){
GMS.$hideContainer.remove(this.name)
}
},
mounted() {
},
};
</script>
<style lang="less">
.iframeStyle{
height:100%;
width:100%
}
.abow_dialog_lincao {
.el-dialog {
.el-dialog__body{
height:100%;
}
.el-dialog__header{
padding: 5px 20px 10px;
}
}
}
</style>
<template>
<div>
<el-dialog
<el-dialog
class = "abow_dialog_lincao"
:fullscreen ="true"
width="90%"
:visible.sync="dialogVisible"
width="80%"
v-dialogDrag
:close-on-click-modal="false"
:close-on-press-escape="false"
:close-on-press-escape="false"
>
<iframe :src="url"></iframe>
<iframe class="iframeStyle" :src="url"></iframe>
</el-dialog>
</div>
</template>
<script>
export default {
......@@ -20,18 +18,72 @@ export default {
return {
dialogVisible:true,
url:"",
bill:null,
name :null,
subBillName :"XMJHLTZB"
};
},
watch: {
},
methods: {
eventListener(message){
lincaoEventListener(message){
debugger
const valueAll = []
//获取iframe的回调数据
const datas = message.data.datas;
for (let i = 0; i < datas.length; i++) {
for (let a = 0; a < datas[i].tbInfos.length; a++) {
//处理给子表赋值的数据
let value = {
"LAYERID": datas[i].layerId,
"LTTYPE" :datas[i].type,
"LTYEAR": datas[i].year,
"SHENG" : datas[i].tbInfos[a].SHENG_DESC,
"SHI" : datas[i].tbInfos[a].SHI_DESC,
"XIANG" : datas[i].tbInfos[a].XIANG_DESC,
"XIAN" : datas[i].tbInfos[a].XIAN_DESC,
"MZGUID" : datas[i].tbInfos[a].MZGUID,
"ZL_TU_BAN" :datas[i].tbInfos[a].ZL_TU_BAN
}
valueAll.push(value)
}
}
for (let i = 0; i < valueAll.length; i++) {
//先增行,然后给增行的子表进行赋值
this.bill.addSubData(this.subBillName)
const obj = this.bill.getSubData(this.subBillName)
const index = obj.length - 1
for (let key of Object.keys(valueAll[i])) {
const keyVal = valueAll[i][key]
obj[index].setValue(key, keyVal)
}
}
GMS.$hideContainer.remove(this.name)
//刷新子表
this.bill.refreshSubDataRow(this.subBillName)
}
},
mounted() {
windows.addEventListener('message',eventListener)
window.addEventListener('message',this.lincaoEventListener)
},
};
</script>
<style scoped lang="less"></style>
<style lang="less">
.iframeStyle{
height:100%;
width:100%
}
.abow_dialog_lincao {
.el-dialog {
.el-dialog__body{
height:100%;
}
.el-dialog__header{
padding: 5px 20px 10px;
}
}
}
</style>
......@@ -1592,8 +1592,8 @@ export default {
"type": "String",
},{
"isRequired": false,
"title": "layerIds",
"key": "layerIds",
"title": "type",
"key": "type",
"type": "String",
}]
},
......@@ -1604,6 +1604,22 @@ export default {
},
{
"discard": false,
"path": "林草报销/专用",
"extends": {
"param": [{
"isRequired": false,
"title": "请求路径ip地址",
"key": "ipAddress",
"type": "String",
}]
},
"description": "",
"title": "林草查看视图[lincaoReadView]",
"value": "lincaoReadView",
"alwaysUse":true
},
{
"discard": false,
"path": "资产/通用",
"extends": {
"param": [{
......
......@@ -40,6 +40,8 @@ import relateInvoiceAction from './actions/relateInvoiceAction.js'
import deleteInvoiceAction from './actions/deleteInvoiceAction.js'
import saveActionBXD from './actions/saveActionBXD';
import lincaoAddView from './actions/lincaoAddView';
import lincaoReadView from './actions/lincaoReadView';
//queryAction
import leafletGenerationAction from './query-actions/leafletGenerationAction.js'
import leafletGenerationTYAction from './query-actions/leafletGenerationTYAction.js'
......@@ -197,6 +199,7 @@ export default {
simpleAdvanceDeleteAction,
queryDeleteBill,
lincaoAddView,
lincaoReadView,
openNewPageDetail
},
billAction: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment