Browse Source

下载文件,居民图谱联动事件,房屋家庭标签回填

feature
mk 2 years ago
parent
commit
8d3210fc1a
  1. 45
      src/views/modules/base/smartImport/cpts/createdTask.vue
  2. 26
      src/views/modules/portrayal/house/index.vue
  3. 149
      src/views/modules/portrayal/jumin/cpts/graph.vue
  4. 2
      src/views/modules/portrayal/jumin/index.vue

45
src/views/modules/base/smartImport/cpts/createdTask.vue

@ -400,6 +400,7 @@ export default {
data: params,
})
.then((res) => {
console.log(res);
const url = window.URL.createObjectURL(new Blob([res.data]));
const aLink = document.createElement("a");
aLink.style.display = "none";
@ -424,32 +425,44 @@ export default {
await this.$http({
method: "POST",
url,
responseType: "blob",
// responseType: "blob",
data: params,
})
.then((res) => {
if (res.status==200) {
// if (res.status==200) {
// let fileName = window.decodeURI(
// res.headers["content-disposition"]
// .split(";")[1]
// .split("=")[1]
// );
let fileName = `${
// let fileName = `${
// this.$store.state.user.agencyName + this.categoryName
// }`;
// let blob = new Blob([res.data], {
// type: "application/vnd.ms-excel",
// });
// var url = window.URL.createObjectURL(blob);
// var aLink = document.createElement("a");
// aLink.style.display = "none";
// aLink.href = url;
// aLink.setAttribute("download", fileName);
// document.body.appendChild(aLink);
// aLink.click();
// document.body.removeChild(aLink); //
// window.URL.revokeObjectURL(url); //blob
// } else this.$message.error("");
let fileName = `${
this.$store.state.user.agencyName + this.categoryName
}导入模板`;
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel",
});
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
} else this.$message.error("下载失败");
const url = res.data.data;
const aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download",`${fileName}.xlsx`);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink);
window.URL.revokeObjectURL(url);
})
.catch((err) => {
console.log(err);

26
src/views/modules/portrayal/house/index.vue

@ -43,8 +43,8 @@
<el-col :span="6" class="f-flex">
<div class="f-label">家庭标签</div>
<div class="f-left8 f-font-color" v-if="houseDetailObj">
{{houseDetailObj.familyTags || "--" }}
<div class="f-left8 f-font-color" v-if="houseDetailObj.familyTags">
{{familyTags() }}
</div>
</el-col>
<el-col :span="6" class="f-flex">
@ -202,10 +202,12 @@ export default {
rules: {
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
},
familyTagList:[]
};
},
components: { graph, businessRecord, changeRecord },
created() {
this.getFamilyTagsDict()
},
mounted() {},
activated() {},
@ -298,7 +300,25 @@ export default {
params: { agencyId: "1673584241869238273",gridId: "1673585475279826946",villageId:"1673600667388780545",buildId:"1673600667527192577",unitId:"1673600667577524226",homeId:"1673600737530126338"},
});
},
getFamilyTagsDict(){
this.$http.post("sys/dict/data/dictlist", {
dictType: 'family_tag',
}).then(res=>{
if(res.data.code === 0){
this.familyTagList = res.data.data;
}
}).catch(err=>{
console.log(err);
})
},
familyTags(){
const labels = this.houseDetailObj.familyTags.map(value => {
const item = this.familyTagList.find(obj => obj.value === value);
return item ? item.label : null;
});
return labels?labels.join(','):'--';
},
async handleSaveTuomin(password) {
const url = `/actual/base/communityHouse/getClearHouseDeatilById/${this.houseId}`;
let parm = {

149
src/views/modules/portrayal/jumin/cpts/graph.vue

@ -45,7 +45,6 @@ export default {
},
mounted() {
this.$nextTick(() => {
// this.showSeeksGraph();
this.getFamilyRelationshipList()
})
},
@ -62,10 +61,8 @@ export default {
let url = `/actual/base/peopleRoomOverview/getFamilyRelationshipList?type=0&resid=` + this.userInfo.resiId;
let { code, data, msg } = await requestPost(url)
if (code == 0) {
//
let index = data.findIndex(item => item.name == this.userInfo.name);
if (index !== -1) {
//
const [item] = data.splice(index, 1);
data.unshift(item);
}
@ -74,7 +71,8 @@ export default {
'text': item.name,
'innerHTML': `<div class="c-my-node${index == 0 ? '1' : '2'} c-my-node-${item.type == 1?'home':index == 0 ? item.gender == 1 ? 'father' : 'mother' : item.houseHolderRel == '配偶' ? item.gender == '1' ? 'mother' : 'father' : item.houseHolderRel == '女儿' ? 'girl' : item.houseHolderRel == '儿子' ? 'gon' : item.houseHolderRel == '父亲' || item.houseHolderRel == '祖父母' ? item.gender == 1 ? 'grandpa' : 'grandma' : item.houseHolderRel == '母亲' ? 'grandma' : 'father'}"><div class="c-node-name${index == 0 ? '1' : '2'}" style="color:#000">${item.type == 1?`${item.name}`:item.name.length === 2 ?
item.name.substring(0, 1) + '*' :
item.name.substring(0, 1) + '*' + item.name.substring(2)} ${item.age?`${item.age})岁`:''}</div></div>`
item.name.substring(0, 1) + '*' + item.name.substring(2)} ${item.age?`${item.age})岁`:''}</div></div>`,
'data':{id: item.id,type:item.type,name:item.name},
}))
let lineList = data.map((item, index) => ({
'from': 'N1',
@ -82,7 +80,8 @@ export default {
'text':item.type ==1?'房屋':data[index].houseHolderRel || '未知',
'isHideArrow': true,
'color': item.houseHolderRel === '父亲' ? '#3876f2' : (item.houseHolderRel === '母亲' || item.houseHolderRel === '祖父母' ? '#ff9696' : (item.houseHolderRel === '女儿' ? '#ffd5d5' : '#3876f2')),
'fontColor': item.houseHolderRel === '父亲' ? '#3876f2' : (item.houseHolderRel === '母亲' || item.houseHolderRel === '祖父母' ? '#ff9696' : (item.houseHolderRel === '女儿' ? '#ffd5d5' : '#3876f2'))
'fontColor': item.houseHolderRel === '父亲' ? '#3876f2' : (item.houseHolderRel === '母亲' || item.houseHolderRel === '祖父母' ? '#ff9696' : (item.houseHolderRel === '女儿' ? '#ffd5d5' : '#3876f2')),
}));
lineList = lineList.slice(1)
const __graph_json_data = { rootId: 'root', nodes: familyList, lines: lineList }
@ -94,109 +93,32 @@ export default {
this.$message.error(msg)
}
},
showSeeksGraph() {
const __graph_json_data = {
'rootId': 'N13', 'nodes': [
{ 'id': 'N1', 'text': '', 'borderColor': '#6cc0ff', 'data': { 'isGoodMan': false, 'sexType': '男' }, 'innerHTML': '<div class="c-my-node1 c-my-node-father"><div class="c-node-name1" style="color:#6cc0ff"></div></div>' }, { 'id': 'N2', 'text': '李*康', 'data': { 'isGoodMan': true, 'sexType': '男' }, 'innerHTML': '<div class="c-my-node2 c-my-node-girl" ><div class="c-node-name2" style="color:#ff875e">李*康</div></div>' }, { 'id': 'N3', 'text': '祁*伟', 'borderColor': '#6cc0ff', 'data': { 'isGoodMan': false, 'sexType': '男' }, 'innerHTML': '<div class="c-my-node2 c-my-node-son" ><div class="c-node-name2" style="color:#6cc0ff">祁*伟</div></div>' }, { 'id': 'N4', 'text': '陈*石', 'data': { 'isGoodMan': true, 'sexType': '男' }, 'innerHTML': '<div class="c-my-node2 c-my-node-mother" ><div class="c-node-name2" style="color:#ff875e">陈*石</div></div>' }, { 'id': 'N5', 'text': '陆*可', 'data': { 'isGoodMan': true, 'sexType': '女' }, 'innerHTML': '<div class="c-my-node2 c-my-node-grandpa" ><div class="c-node-name2" style="color:#ff875e">陆*可(25岁)</div></div>' }, { 'id': 'N6', 'text': '高*良', 'data': { 'isGoodMan': false, 'sexType': '男' }, 'innerHTML': '<div class="c-my-node2 c-my-node-grandma" ><div class="c-node-name2" style="color:#6cc0ff">高*良</div></div>' }, { 'id': 'N7', 'text': '沙*金', 'data': { 'isGoodMan': true, 'sexType': '男' }, 'innerHTML': '<div class="c-my-node2 c-my-node-home" ><div class="c-node-name2" style="color:#ff875e">沙*金</div></div>' }, { 'id': 'N9', 'text': '沙*金2', 'data': { 'isGoodMan': true, 'sexType': '男' }, 'innerHTML': '<div class="c-my-node2 c-my-node-home" ><div class="c-node-name2" style="color:#ff875e">沙*金2</div></div>' },], 'lines': [
{
'from': 'N1',
'to': 'N6',
'text': '',
'color': '#3b3b3b',
'fontColor': '#3b3b3b',
'isHideArrow': true,
'data': {
'type': '父亲'
},
},
{
'from': 'N1',
'to': 'N7',
'text': '父亲',
'color': '#3b3b3b',
'fontColor': '#3b3b3b',
'isHideArrow': true,
'data': {
'type': '母亲'
}
},
{
'from': 'N1',
'to': 'N8',
'text': '母亲',
'color': '#3b3b3b',
'fontColor': '#3b3b3b',
'isHideArrow': true,
'data': {
'type': '儿子'
}
},
{
'from': 'N1',
'to': 'N2',
'text': '儿子',
'color': '#3b3b3b',
'fontColor': '#3b3b3b',
'isHideArrow': true,
'data': {
'type': '女儿'
}
},
{
'from': 'N1',
'to': 'N3',
'text': '女儿',
'color': '#3b3b3b',
'fontColor': '#3b3b3b',
'isHideArrow': true,
'data': {
'type': '配偶'
}
},
{
'from': 'N1',
'to': 'N4',
'text': '配偶',
'color': '#d7e5ff',
'fontColor': '#3b3b3b',
'isHideArrow': true,
'data': {
'type': '岳父'
}
},
{
'from': 'N1',
'to': 'N5',
'text': '岳父',
'color': '#3b3b3b',
'fontColor': '#3b3b3b',
'isHideArrow': true,
'data': {
'type': '岳母'
}
},
{
'from': 'N1',
'to': 'N9',
'text': '岳母',
'isHideArrow': true,
'color': '#ffe4e4',
'fontColor': '#3b3b3b',
'data': {
'type': '岳母'
}
},
]
};
this.$refs.seeksRelationGraph.setJsonData(__graph_json_data, (graphInstance) => {
//
});
},
onNodeClick(nodeObject, $event) {
console.log('onNodeClick:', nodeObject);
let {name,id,type} = nodeObject.data
if(type === 0){
this.$store.dispatch("saveData", {
resiId:id,
name
});
this.$store.state.contentTabs = this.$store.state.contentTabs.map(
(item) => {
if (item.name === "jumin-huaxiang") {
return { ...item, title: name };
}
return item;
}
);
}else if(type === 1){
this.$store.dispatch('saveDataH', { houseId:id, houseName:name});
this.$router.push({ name: 'house-huaxiang' });
this.$store.state.contentTabs = this.$store.state.contentTabs.map(item => {
if (item.name === "house-huaxiang") {
return { ...item, title: name };
}
return item;
});
}
},
onLineClick(lineObject, $event) {
console.log('onLineClick:', lineObject);
@ -216,9 +138,9 @@ export default {
}
.c-node-name2 {
margin-left: -5px;
margin-left: 2px;
text-align: center;
margin-top: 63px;
margin-top: 83px;
line-height: 20px;
position: absolute;
width: 96px;
@ -267,7 +189,16 @@ export default {
}
.c-node-name1 {
display: none;
margin-left: 2px;
text-align: center;
margin-top: 83px;
line-height: 20px;
position: absolute;
width: 96px;
height: 20px;
background: #FFFFFF;
box-shadow: 0px 4px 6px 0px rgba(211, 213, 214, 0.4);
border-radius: 10px;
}
.rel-node-checked {

2
src/views/modules/portrayal/jumin/index.vue

@ -242,7 +242,7 @@
<div class="f-flex" style="width: 600px">
<div class="f-label"><b>所属房屋</b></div>
<span class="f-left8 f-font-color">
{{ item.gridName + "-" + item.homeName || "--" }}
{{ item.agencyName?item.agencyName:'' + item.homeName || "--" }}
</span>
</div>
</div>

Loading…
Cancel
Save