|
@@ -50,7 +50,7 @@
|
|
|
</el-row>
|
|
|
<relationTable
|
|
|
v-if="tableHeight"
|
|
|
- @updata="relManualQuery"
|
|
|
+ @updata="addRelationSucess(0)"
|
|
|
@openMoreRelation="openMoreRelation"
|
|
|
:tableHeader="tableHeader"
|
|
|
:tableData="tableData"
|
|
@@ -72,7 +72,7 @@
|
|
|
</div>
|
|
|
<addRelationDialog
|
|
|
@closeAddRelation="addRelationValue = false"
|
|
|
- @update="relManualQuery"
|
|
|
+ @update="addRelationSucess(1)"
|
|
|
:addRelationValue="addRelationValue"
|
|
|
:values="values"
|
|
|
/>
|
|
@@ -209,8 +209,8 @@ export default class extends Vue {
|
|
|
*/
|
|
|
mainSelect(val: any) {
|
|
|
this.categoryFrom = val;
|
|
|
+ this.page.currentPage = 1; //初始化页面
|
|
|
this.relManualQuery();
|
|
|
- console.log("mainSelect", val);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -218,18 +218,21 @@ export default class extends Vue {
|
|
|
*/
|
|
|
minorSelect(val: any) {
|
|
|
this.categoryTo = val;
|
|
|
+ this.page.currentPage = 1; //初始化页面
|
|
|
this.relManualQuery();
|
|
|
}
|
|
|
|
|
|
// 主关系模糊搜索
|
|
|
mainSerch(val: string) {
|
|
|
this.vagueFrom = val;
|
|
|
+ this.page.currentPage = 1; //初始化页面
|
|
|
this.relManualQuery();
|
|
|
}
|
|
|
|
|
|
// 从关系模糊搜索
|
|
|
minorSearch(val: string) {
|
|
|
this.vagueTo = val;
|
|
|
+ this.page.currentPage = 1; //初始化页面
|
|
|
this.relManualQuery();
|
|
|
}
|
|
|
|
|
@@ -241,6 +244,17 @@ export default class extends Vue {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 添加关系成功后
|
|
|
+ */
|
|
|
+ addRelationSucess(initPage) {
|
|
|
+ if (initPage) {
|
|
|
+ this.page.currentPage = 1; //初始化页面
|
|
|
+ }
|
|
|
+ this.relManualQuery();
|
|
|
+ this.relToTfype(); //重新f获取关系对象
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取主对象从对象关系
|
|
|
*/
|
|
|
relToType() {
|
|
@@ -302,13 +316,14 @@ export default class extends Vue {
|
|
|
relManualQuery() {
|
|
|
this.loading = true;
|
|
|
// 获取table数据
|
|
|
+ const objectType = this.vagueTo.length && this.vagueFrom.length ? 3 : this.vagueTo.length ? 2 :1;
|
|
|
const data = {
|
|
|
projectId: this.$route.query.projectId,
|
|
|
categoryFrom: this.categoryFrom,
|
|
|
categoryTo: this.categoryTo,
|
|
|
- vagueTo: this.vagueTo, //主关系
|
|
|
- vagueFrom: this.vagueFrom, //从关系
|
|
|
- objectType: 1,
|
|
|
+ vagueTo: this.vagueTo, //从关系
|
|
|
+ vagueFrom: this.vagueFrom, //主关系
|
|
|
+ objectType: objectType,
|
|
|
relType: this.$route.query.relationType,
|
|
|
pageSize: this.page.pageSize,
|
|
|
pageNumber: this.page.currentPage,
|
|
@@ -341,8 +356,8 @@ export default class extends Vue {
|
|
|
// 取9个
|
|
|
if (item.objectInfo.length >= 9) {
|
|
|
objList = [...item.objectInfo.slice(0, 9)];
|
|
|
- }else{
|
|
|
- objList = item.objectInfo.slice(0, 9)
|
|
|
+ } else {
|
|
|
+ objList = item.objectInfo.slice(0, 9);
|
|
|
}
|
|
|
const objInfo = JSON.parse(JSON.stringify(objList));
|
|
|
objInfo.forEach((objItem: any, index: number) => {
|
|
@@ -350,6 +365,7 @@ export default class extends Vue {
|
|
|
Object.assign(newItem, {
|
|
|
objectInfo: [objItem],
|
|
|
rowspan: index == 0 ? objInfo.length : 0,
|
|
|
+ firstSpan: true, //首行是否合并
|
|
|
});
|
|
|
newList.push(newItem);
|
|
|
});
|
|
@@ -358,12 +374,14 @@ export default class extends Vue {
|
|
|
newList.push(
|
|
|
Object.assign(item, {
|
|
|
moreMsg: true,
|
|
|
+ firstSpan: true, //首行是否合并
|
|
|
})
|
|
|
);
|
|
|
}
|
|
|
} else {
|
|
|
Object.assign(item, {
|
|
|
rowspan: 1,
|
|
|
+ firstSpan: false,
|
|
|
});
|
|
|
newList.push(item);
|
|
|
}
|