Commit 435e1443 authored by tianhongyang's avatar tianhongyang

企业详情菜单 优化首次不展开,初始化后命中

表头设置组件优化,最少保证一个自适应列存在
parent 26316b29
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
<!-- 已选字段 --> <!-- 已选字段 -->
<div class="use-header-container" v-if="useColumn.length"> <div class="use-header-container" v-if="useColumn.length">
<div class="use-header-title">已选字段</div> <div class="use-header-title">已选字段</div>
<vuedraggable v-model="useColumn" class="use-header-container-inner" ghostClass="dragClass"> <vuedraggable v-model="useColumn" class="use-header-container-inner" ghostClass="dragClass" handle=".use-header-item-drag-icon">
<transition-group name="fade" tag="div"> <transition-group name="fade" tag="div">
<div class="use-header-item" v-for="(item,index) of useColumn" :key="item.uid"> <div class="use-header-item" v-for="(item,index) of useColumn" :key="item.uid">
<el-checkbox v-model="item.use" class="use-header-item-label" <el-checkbox v-model="item.use" class="use-header-item-label"
@change="flag => checkedChange(index,flag,item)">{{item.label}}</el-checkbox> @change="flag => checkedChange(index,flag,item)">{{item.label}}</el-checkbox>
<img src="@/assets/images/consultingAgencyManagement/use-header-btn.png" alt=""> <img src="@/assets/images/consultingAgencyManagement/use-header-btn.png" alt="" class="use-header-item-drag-icon">
</div> </div>
</transition-group> </transition-group>
</vuedraggable> </vuedraggable>
...@@ -129,6 +129,13 @@ export default { ...@@ -129,6 +129,13 @@ export default {
} }
}, },
checkedChange(index, flag, item) { checkedChange(index, flag, item) {
// 至少保证一个自适应列存在
const hasOnly = this.checkeOnlySelfAdaptation();
if (!hasOnly && !flag) {
this.$message.warning("列表至少保证一个自适应列存在");
item.use = true;
return;
}
// 选中 往use push // 选中 往use push
if (flag) { if (flag) {
this.notUseColumn.splice(index, 1); this.notUseColumn.splice(index, 1);
...@@ -138,6 +145,17 @@ export default { ...@@ -138,6 +145,17 @@ export default {
this.useColumn.splice(index, 1); this.useColumn.splice(index, 1);
this.notUseColumn.push(item); this.notUseColumn.push(item);
}, },
checkeOnlySelfAdaptation() {
const _array = this.useColumn.filter(item => {
// 判断是否是自适应列
const isSelfAdaptationColumn = item.hasOwnProperty("minWidth") || item.width == "auto" || (!item.hasOwnProperty("minWidth") && !item.hasOwnProperty("width"));
return isSelfAdaptationColumn;
});
const len = _array.length;
// len等于1时仅剩一个自适应列
return len == 1 ? false : true;
},
cancel() { cancel() {
this.$emit("settingClose"); this.$emit("settingClose");
}, },
......
...@@ -305,7 +305,7 @@ export default { ...@@ -305,7 +305,7 @@ export default {
const _temp = this.sideAddUid(JSON.parse(JSON.stringify(this.sideRoute))); const _temp = this.sideAddUid(JSON.parse(JSON.stringify(this.sideRoute)));
this.sideRoute = _temp; this.sideRoute = _temp;
this.defaultRoute = JSON.parse(JSON.stringify(this.sideRoute)); this.defaultRoute = JSON.parse(JSON.stringify(this.sideRoute));
this.searchIndex = this.findNodeIndex(this.defaultRoute, "overview").index; // this.searchIndex = this.findNodeIndex(this.defaultRoute, "overview").index;
}, },
// 查找菜单中的元素 // 查找菜单中的元素
findNodeIndex(tree, key, findKey = "pathName", findParent = false, parenNode = null) { findNodeIndex(tree, key, findKey = "pathName", findParent = false, parenNode = null) {
......
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
// 合作项目详情弹窗 // 合作项目详情弹窗
cooperationRecordDialog: false, cooperationRecordDialog: false,
dialogQueryParams: { dialogQueryParams: {
companyId: "", companyId: this.companyId,
combineId: "", combineId: "",
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
...@@ -264,8 +264,7 @@ export default { ...@@ -264,8 +264,7 @@ export default {
} }
}, },
viewProject(row) { viewProject(row) {
this.dialogQueryParams.companyId = row.companyId; this.dialogQueryParams.combineId = row.companyId;
this.dialogQueryParams.combineId = row.counterpartCompanyId;
this.cooperationRecordDialog = true; this.cooperationRecordDialog = true;
}, },
async dialogHandleQurey(params) { async dialogHandleQurey(params) {
......
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
// 合作项目详情弹窗 // 合作项目详情弹窗
cooperationRecordDialog: false, cooperationRecordDialog: false,
dialogQueryParams: { dialogQueryParams: {
companyId: "", companyId: this.companyId,
combineId: "", combineId: "",
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
...@@ -264,7 +264,6 @@ export default { ...@@ -264,7 +264,6 @@ export default {
} }
}, },
viewProject(row) { viewProject(row) {
this.dialogQueryParams.companyId = row.companyId;
this.dialogQueryParams.combineId = row.companyId; this.dialogQueryParams.combineId = row.companyId;
this.cooperationRecordDialog = true; this.cooperationRecordDialog = true;
}, },
......
...@@ -203,7 +203,7 @@ export default { ...@@ -203,7 +203,7 @@ export default {
isCompany: false, //判断是否有建设库数据 isCompany: false, //判断是否有建设库数据
isCustomer: false, //判断是否展示修改客户信息 isCustomer: false, //判断是否展示修改客户信息
currentPath: { currentPath: {
pathName: 'overview' //默认展示页 pathName: '' //默认展示页
}, },
statisticObj: { statisticObj: {
basic: {}, basic: {},
......
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