修复周三测试提出的住数据bug

This commit is contained in:
hyt 2024-07-12 10:30:47 +08:00
parent 13a7898880
commit 325af2ffc4
19 changed files with 261 additions and 194 deletions

View File

@ -44,7 +44,7 @@ export default {
if (!this.showTagsView) { if (!this.showTagsView) {
top = "5px"; top = "5px";
} else { } else {
top = "50px"; top = "63px";
} }
return top; return top;
}, },
@ -67,6 +67,7 @@ export default {
margin-left: 136px; margin-left: 136px;
} }
.app-main { .app-main {
border-radius: 8px;
/* 50= navbar 50 */ /* 50= navbar 50 */
// padding-top: 104px; // padding-top: 104px;
// min-height: calc(100vh - 50px); // min-height: calc(100vh - 50px);
@ -75,16 +76,14 @@ export default {
// width: calc(100% - 20px); // width: calc(100% - 20px);
// margin:0 10px; // margin:0 10px;
position: relative; position: relative;
border-radius: 4px;
top: 80px; top: 80px;
padding: 0 10px;
margin-left: 10px; margin-left: 10px;
} }
.h-10{ .h-10{
height: calc(100vh - 10px); height: calc(100vh - 10px);
} }
.h-65{ .h-65{
height: calc(100vh - 60px); height: calc(100vh - 73px);
} }
.fixed-header + .app-main { .fixed-header + .app-main {

View File

@ -502,6 +502,7 @@ export default {
.avatar-container { .avatar-container {
margin-right: 15px; margin-right: 15px;
background-color: #fff;
.avatar-wrapper { .avatar-wrapper {
// margin-top: 5px; // margin-top: 5px;

View File

@ -378,7 +378,7 @@ export default {
width: 90%; width: 90%;
padding-top: 10px; padding-top: 10px;
border-top: 1px solid #eaeaea; border-top: 1px solid #eaeaea;
background: #f4f5f7; background: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -410,4 +410,4 @@ export default {
} }
} }
} }
</style> </style>

View File

@ -2,7 +2,7 @@
<div <div
id="tags-view-container" id="tags-view-container"
class="tags-view-container" class="tags-view-container"
style="top:5px;margin:0 10px;" style="top:10px;margin:0 10px;"
> >
<scroll-pane <scroll-pane
ref="scrollPane" ref="scrollPane"
@ -288,7 +288,7 @@ export default {
this.left = left; this.left = left;
} }
this.top = e.clientY; this.top = e.clientY;
this.visible = true; this.visible = true;
this.selectedTag = tag; this.selectedTag = tag;
@ -316,7 +316,7 @@ export default {
width: 100%; width: 100%;
// width: calc(100% - 180px); // width: calc(100% - 180px);
margin-left: 10px; margin-left: 10px;
background: #f7f7f7; background: #fff;
border-radius: 4px; border-radius: 4px;
padding: 0px 10px; padding: 0px 10px;
// border-bottom: 1px solid #d8dce5; // border-bottom: 1px solid #d8dce5;

View File

@ -106,6 +106,7 @@ export default {
} }
.newMenuWidth { .newMenuWidth {
width: 114px; width: 114px;
background-color: #fff;
} }
.newMenuAppMain { .newMenuAppMain {
width: calc(100% - 114px); width: calc(100% - 114px);

View File

@ -66,7 +66,7 @@
</div> </div>
</div> </div>
</div v-> </div v->
<baseDialog title="数据设置" v-model="dialogShow" @confirm="dialogConfirm" :lookFlag="lookFlag"> <baseDialog title="数据设置" v-model="dialogShow" @confirm="dialogConfirm" :lookFlag="lookFlag" width="78%">
<h1 style="margin: 20px 10px; font-size: 18px; font-weight: 700"> <h1 style="margin: 20px 10px; font-size: 18px; font-weight: 700">
基本信息 基本信息
</h1> </h1>

View File

@ -86,15 +86,18 @@ export default {
tableColumn: [ tableColumn: [
{ {
title: '来源类型', title: '来源类型',
id: 'sourceType' id: 'sourceType',
width:150,
}, },
{ {
title: '来源应用', title: '来源应用',
id: 'appName' id: 'appName',
width:150,
}, },
{ {
title: '触发类型', title: '触发类型',
id: 'triggerType' id: 'triggerType',
width:120,
}, },
{ {
title: '来源编码', title: '来源编码',
@ -115,9 +118,10 @@ export default {
}, },
{ {
title: '启用/停用', title: '启用/停用',
id: 'enabledState' id: 'enabledState',
width:120,
}, },
{ title: '操作', id: 'operation' } { title: '操作', id: 'operation',width:120, }
], ],
tableData: [], tableData: [],
pageModel: { pageModel: {
@ -185,7 +189,6 @@ export default {
} }
// //
if (item.sourceType == 1 && item.sourceCode) { if (item.sourceType == 1 && item.sourceCode) {
this.openLoading('detail')
const res = await authApi('sysApplicationPluginService', '', 'queryEntity', '', { const res = await authApi('sysApplicationPluginService', '', 'queryEntity', '', {
appId: item.sourceName appId: item.sourceName
}) })
@ -301,7 +304,7 @@ export default {
.wrap { .wrap {
background-color: #fbfbfb; background-color: #fbfbfb;
width: 100%; width: 99.5%;
overflow: auto; overflow: auto;
margin-left: 5px; margin-left: 5px;

View File

@ -175,7 +175,6 @@ export default {
async initSelect() { async initSelect() {
// //
this.serviceOptions = [] this.serviceOptions = []
this.openLoading('detail')
const service = await getApiModuleApi({ const service = await getApiModuleApi({
tl: 'mdmModuleService', tl: 'mdmModuleService',
as: '', as: '',
@ -211,7 +210,6 @@ export default {
} }
//appidapp //appidapp
if ((row.id === 'sourceName' || row.id === 'sourceType') && this.ruleForm.sourceName) { if ((row.id === 'sourceName' || row.id === 'sourceType') && this.ruleForm.sourceName) {
this.openLoading('detail')
const res = await authApi('sysApplicationApiService', '', 'queryEntity', '', { const res = await authApi('sysApplicationApiService', '', 'queryEntity', '', {
appId: this.ruleForm.sourceName appId: this.ruleForm.sourceName
}) })
@ -237,7 +235,6 @@ export default {
}) })
// //
if (this.ruleForm.sourceType == 1) { if (this.ruleForm.sourceType == 1) {
this.openLoading('detail')
const res = await authApi('sysApplicationPluginService', '', 'queryEntity', '', { const res = await authApi('sysApplicationPluginService', '', 'queryEntity', '', {
appId: this.ruleForm.sourceName appId: this.ruleForm.sourceName
}) })
@ -272,7 +269,6 @@ export default {
}, },
// //
async getAppList() { async getAppList() {
this.openLoading('detail')
const res = await authApi('sysApplicationService', '', 'queryEntity', '', {}) const res = await authApi('sysApplicationService', '', 'queryEntity', '', {})
this.formRow[1].elCol[0].options = [] this.formRow[1].elCol[0].options = []
res.attribute.forEach(item => { res.attribute.forEach(item => {
@ -285,7 +281,6 @@ export default {
}, },
// //
async getrowDetails(id) { async getrowDetails(id) {
this.openLoading('detail')
const res = await authApi('mdmModuleService', '', 'getMdmSource', '', { const res = await authApi('mdmModuleService', '', 'getMdmSource', '', {
id id
}) })

View File

@ -2,7 +2,6 @@
<div class="wrap"> <div class="wrap">
<!--数据表--> <!--数据表-->
<div class="mainTable"> <div class="mainTable">
<div class="bigTitle">数据表</div>
<div class="rule"> <div class="rule">
<div class="name">单据规则</div> <div class="name">单据规则</div>
<template v-if="!receiptsTableData.length"> <template v-if="!receiptsTableData.length">
@ -17,16 +16,17 @@
<img src="./images/设置.png" alt=""> <img src="./images/设置.png" alt="">
</div> </div>
</div> </div>
<div class="bigTitle" style="margin: 10px 0">数据表</div>
<div class="table"> <div class="table">
<BaseTable <BaseTable
ref="mainTable" ref="mainTable"
:tableData="mainTableData" :tableData="mainTableData"
:tabLoading="mainTabLoading" :tabLoading="mainTabLoading"
:tableColumn="mainTableColumn" :tableColumn="mainTableColumn"
:border="false" :border="false"
tableMaxHeight="600" tableMaxHeight="600"
:highlightCurrent="true" :highlightCurrent="true"
@radioChange="mainOnClick" @radioChange="mainOnClick"
> >
<template #dbType="{row}"> <template #dbType="{row}">
{{ row.dbType === '1' ? '主表' : '子表' }} {{ row.dbType === '1' ? '主表' : '子表' }}
@ -44,9 +44,9 @@
</BaseTable> </BaseTable>
<div class="mainAddRow"> <div class="mainAddRow">
<el-link <el-link
type="primary" type="primary"
@click="addMainAddRow" @click="addMainAddRow"
:underline="false" :underline="false"
>+ 数据表添加 >+ 数据表添加
</el-link </el-link
> >
@ -58,15 +58,15 @@
<div class="bigTitle">表字段</div> <div class="bigTitle">表字段</div>
<div class="table"> <div class="table">
<BaseTable <BaseTable
ref="activedTable" ref="activedTable"
:tableData="activedTableData" :tableData="activedTableData"
:tabLoading="activedTabLoading" :tabLoading="activedTabLoading"
:tableColumn="activedTableColumn" :tableColumn="activedTableColumn"
:border="false" :border="false"
tableMaxHeight="650" tableMaxHeight="650"
:highlightCurrent="true" :highlightCurrent="true"
@radioChange="activedOnClick" @radioChange="activedOnClick"
@onFunc="activedOnFunc" @onFunc="activedOnFunc"
> >
<template #filedType="{row}"> <template #filedType="{row}">
{{ dataTypeDist[row.filedType] }} {{ dataTypeDist[row.filedType] }}
@ -84,10 +84,10 @@
</BaseTable> </BaseTable>
<div class="mainAddRow" v-if="mainTempClick.id"> <div class="mainAddRow" v-if="mainTempClick.id">
<el-link <el-link
v-if="mainTempClick.id" v-if="mainTempClick.id"
type="primary" type="primary"
@click="activedAddRow" @click="activedAddRow"
:underline="false" :underline="false"
>+ 表字段添加 >+ 表字段添加
</el-link </el-link
> >
@ -96,14 +96,14 @@
</div> </div>
<!-- 单据规则--> <!-- 单据规则-->
<base-right-dialog <base-right-dialog
ref="baseRightDialog" ref="baseRightDialog"
:footerShow="true" :footerShow="true"
:dialogVisible.sync="ruleAddDialogShow" :dialogVisible.sync="ruleAddDialogShow"
title="单据规则" title="单据规则"
@handleClose="ruleAddDialogShow=false" @handleClose="ruleAddDialogShow=false"
:submitShow="true" :submitShow="true"
:size="'50%'" :size="'50%'"
@handleConfirmClick="ruleAddSaveHanlde" @handleConfirmClick="ruleAddSaveHanlde"
> >
<div class="receiptsTable"> <div class="receiptsTable">
<ruleAddTable ref="ruleAddTable"></ruleAddTable> <ruleAddTable ref="ruleAddTable"></ruleAddTable>
@ -111,14 +111,14 @@
</base-right-dialog> </base-right-dialog>
<!-- 数据表 --> <!-- 数据表 -->
<base-right-dialog <base-right-dialog
ref="mainTableAddtDialog" ref="mainTableAddtDialog"
:footerShow="true" :footerShow="true"
:dialogVisible.sync="mainTableDialogShow" :dialogVisible.sync="mainTableDialogShow"
title="数据表" title="数据表"
@handleClose="mainTableDialogShow=false" @handleClose="mainTableDialogShow=false"
:submitShow="true" :submitShow="true"
:size="'30%'" :size="'30%'"
@handleConfirmClick="mainTableSaveHandle" @handleConfirmClick="mainTableSaveHandle"
> >
<div class="mainTable"> <div class="mainTable">
<mainTable ref="mainTable"></mainTable> <mainTable ref="mainTable"></mainTable>
@ -126,14 +126,14 @@
</base-right-dialog> </base-right-dialog>
<!-- 表字段--> <!-- 表字段-->
<base-right-dialog <base-right-dialog
ref="sonTableAddtDialog" ref="sonTableAddtDialog"
:footerShow="true" :footerShow="true"
:dialogVisible.sync="sonTableDialogShow" :dialogVisible.sync="sonTableDialogShow"
title="表字段" title="表字段"
@handleClose="sonTableDialogShow=false" @handleClose="sonTableDialogShow=false"
:submitShow="true" :submitShow="true"
:size="'40%'" :size="'40%'"
@handleConfirmClick="sonTableSaveHandle" @handleConfirmClick="sonTableSaveHandle"
> >
<div class="mainTable"> <div class="mainTable">
<sonTable ref="sonTable" :activedTableData="activedTableData" :mainTempClick="mainTempClick" <sonTable ref="sonTable" :activedTableData="activedTableData" :mainTempClick="mainTempClick"
@ -252,21 +252,21 @@ export default {
console.log(row, 'row') console.log(row, 'row')
let msg = row.dbType == 1 ? '删除主表将会导致所有相关子表一并删除,是否确认继续删除操作?' : '是否确定删除?' let msg = row.dbType == 1 ? '删除主表将会导致所有相关子表一并删除,是否确认继续删除操作?' : '是否确定删除?'
this.$confirm(msg) this.$confirm(msg)
.then(async(_) => { .then(async(_) => {
this.openLoading('submit') this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'deleteMdmDb', '', { const res = await authApi('mdmModuleService', '', 'deleteMdmDb', '', {
mdmId: this.$route.query.id, mdmId: this.$route.query.id,
...row ...row
})
this.$vmNews('删除成功!', 'success')
if (this.mainTempClick.id === row.id || row.dbType == 1) {
this.activedTableData = []
this.mainTempClick = {}
}
this.getMainTableHandle()
})
.catch((_) => {
}) })
this.$vmNews('删除成功!', 'success')
if (this.mainTempClick.id === row.id || row.dbType == 1) {
this.activedTableData = []
this.mainTempClick = {}
}
this.getMainTableHandle()
})
.catch((_) => {
})
}, },
// //
addMainAddRow() { addMainAddRow() {
@ -300,22 +300,22 @@ export default {
// //
activedOnFunc(row) { activedOnFunc(row) {
this.$confirm('是否确定删除?') this.$confirm('是否确定删除?')
.then(async(_) => { .then(async(_) => {
this.openLoading('submit') this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'deleteMdmDbField', '', { const res = await authApi('mdmModuleService', '', 'deleteMdmDbField', '', {
id: row.id, id: row.id,
mdmId: this.$route.query.id, mdmId: this.$route.query.id,
dbId: this.mainTempClick.id, dbId: this.mainTempClick.id,
dbName: this.mainTempClick.dbName, dbName: this.mainTempClick.dbName,
enName: row.enName, enName: row.enName,
filedType: row.filedType filedType: row.filedType
})
this.$vmNews('删除成功', 'success')
this.mainOnClick(this.mainTempClick)
this.activedTableData.splice(row.index, 1)
})
.catch((_) => {
}) })
this.$vmNews('删除成功', 'success')
this.mainOnClick(this.mainTempClick)
this.activedTableData.splice(row.index, 1)
})
.catch((_) => {
})
}, },
// //
sonTableEditHandle(row) { sonTableEditHandle(row) {
@ -469,7 +469,6 @@ export default {
}, },
// //
async getMainTableHandle() { async getMainTableHandle() {
this.openLoading('detail')
const res = await authApi('mdmModuleService', '', 'queryMdmDb', '', { const res = await authApi('mdmModuleService', '', 'queryMdmDb', '', {
mdmId: this.$route.query.id mdmId: this.$route.query.id
}) })
@ -560,7 +559,6 @@ export default {
border-right: 1px solid #EBEBEB;; border-right: 1px solid #EBEBEB;;
.rule { .rule {
margin-top: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;

View File

@ -1,13 +1,14 @@
<template> <template>
<div class="mainTable"> <div class="mainTable">
<baseNewForm <baseNewForm
ref="mainOptionForm" ref="mainOptionForm"
:spanNumber="24" :spanNumber="24"
:isFunBtn="false" :isFunBtn="false"
:formRow="mainOptionRow" :formRow="mainOptionRow"
:ruleForm="mainOptionForm" :ruleForm="mainOptionForm"
:labelPosition="'top'" :labelPosition="'top'"
@onSubmit="mainOptionOnSubmit" :rules="rules"
@onSubmit="mainOptionOnSubmit"
> >
</baseNewForm> </baseNewForm>
</div> </div>
@ -53,7 +54,19 @@ export default {
] ]
} }
], ],
mainOptionForm: {} mainOptionForm: {},
rules: {
dbName: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
remark: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
}
} }
}, },
methods: { methods: {

View File

@ -11,9 +11,11 @@
@onSelect="selectChangeHanlde" @onSelect="selectChangeHanlde"
@inputBlur="optionFormInputBlur" @inputBlur="optionFormInputBlur"
@onSubmit="optionOnSubmit" @onSubmit="optionOnSubmit"
:rules="rules"
> >
</baseNewForm> </baseNewForm>
<baseNewForm <baseNewForm
:rules="rules"
ref="typeOptionForm" ref="typeOptionForm"
:spanNumber="24" :spanNumber="24"
:isFunBtn="false" :isFunBtn="false"
@ -25,6 +27,7 @@
> >
</baseNewForm> </baseNewForm>
<baseNewForm <baseNewForm
:rules="rules"
ref="propertyForm" ref="propertyForm"
:spanNumber="24" :spanNumber="24"
:isFunBtn="false" :isFunBtn="false"
@ -74,6 +77,58 @@ export default {
}, },
data() { data() {
return { return {
rules:{
chName: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
enName: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
filedType: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
filedLength: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
title: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
row: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
type: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
service: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
label: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
upId: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
},
activedTableRow: {},// activedTableRow: {},//
optionFormRow: [ optionFormRow: [
{ {

View File

@ -339,7 +339,6 @@ export default {
}, },
// //
async getRuleForm() { async getRuleForm() {
this.openLoading('detail')
this.ruleForm = {} this.ruleForm = {}
const res = await authApi('mdmModuleService', '', 'queryMdmView', '', { const res = await authApi('mdmModuleService', '', 'queryMdmView', '', {
mdmId: this.$route.query.id mdmId: this.$route.query.id
@ -439,11 +438,10 @@ export default {
} }
.displayInfo { .displayInfo {
background-color: #fbfbfb; background-color: #f5f5f5;
position: relative; position: relative;
margin-left: 5px;
width: 99%; width: 99.5%;
margin: 10px 10px 0 5px;
> .btn { > .btn {
display: flex; display: flex;
@ -463,9 +461,11 @@ export default {
width: 100%; width: 100%;
> .btn { > .btn {
padding-top: 10px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.title { .title {
font-weight: 600; font-weight: 600;
margin-left: 20px; margin-left: 20px;
@ -518,7 +518,7 @@ export default {
.showItem { .showItem {
flex: 1; flex: 1;
margin-left: 15px; margin-left: 15px;
height: 58vh; height: 55vh;
background: #FFFFFF; background: #FFFFFF;
border-radius: 8px; border-radius: 8px;
border: 1px solid #EBEBEB; border: 1px solid #EBEBEB;
@ -563,7 +563,6 @@ export default {
} }
.value { .value {
margin-top: 10px;
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;

View File

@ -124,7 +124,6 @@ export default {
// //
if (this.dist[key]) { if (this.dist[key]) {
this.openLoading('detail')
const res = await authApi('mdmModuleService', '', 'queryMdmViewField', '', { const res = await authApi('mdmModuleService', '', 'queryMdmViewField', '', {
id: this.$route.query.id id: this.$route.query.id
}) })

View File

@ -211,7 +211,6 @@ export default {
activedOnFunc(row) { activedOnFunc(row) {
this.$confirm('确定删除?') this.$confirm('确定删除?')
.then(async(_) => { .then(async(_) => {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'deleteMdmDistribute', '', { const res = await authApi('mdmModuleService', '', 'deleteMdmDistribute', '', {
id: row.id id: row.id
}) })
@ -301,7 +300,7 @@ export default {
.wrap { .wrap {
margin-left: 5px; margin-left: 5px;
background-color: #fbfbfb; background-color: #fbfbfb;
width: 100%; width: 99.5%;
overflow: auto; overflow: auto;
> .btn { > .btn {

View File

@ -410,7 +410,6 @@ export default {
}) })
}) })
// //
this.openLoading('detail')
const res2 = await authApi('sysApplicationService', '', 'queryAppScript', '', { const res2 = await authApi('sysApplicationService', '', 'queryAppScript', '', {
appId: val appId: val
}) })
@ -562,7 +561,6 @@ export default {
}, },
// //
async getrowDetails(id) { async getrowDetails(id) {
this.openLoading('detail')
const res = await authApi('mdmModuleService', '', 'getMdmDistribute', '', { const res = await authApi('mdmModuleService', '', 'getMdmDistribute', '', {
id id
}) })

View File

@ -299,7 +299,9 @@ export default {
.monitoring { .monitoring {
position: relative; position: relative;
width: 100%; width: 100%;
background: #fff;
overflow: auto; overflow: auto;
border-radius: 8px;
header { header {
display: flex; display: flex;
@ -327,7 +329,7 @@ export default {
main { main {
margin-top: 5px; margin-top: 5px;
padding: 5px 20px 5px; padding: 5px 20px 5px;
height: calc(100% - 140px); height: calc(100vh - 200px);
border-radius: 20px; border-radius: 20px;
background-color: #fff; background-color: #fff;
overflow: auto; overflow: auto;

View File

@ -233,7 +233,6 @@ export default {
this.ruleForm.accessMode = JSON.parse(res.attribute.accessMode) this.ruleForm.accessMode = JSON.parse(res.attribute.accessMode)
}, },
async initEditFormData() { async initEditFormData() {
this.openLoading('detail')
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: 'mdmModuleService', tl: 'mdmModuleService',
as: '', as: '',
@ -301,7 +300,7 @@ export default {
} }
.wrap { .wrap {
width: 100%; width: 99.5%;
overflow: auto; overflow: auto;
border-radius: 8px; border-radius: 8px;
margin-left: 5px; margin-left: 5px;
@ -318,7 +317,6 @@ export default {
} }
> .main { > .main {
margin-top: 10px;
background-color: #fff; background-color: #fff;
border-radius: 16px; border-radius: 16px;

View File

@ -130,12 +130,10 @@ export default {
width: 100%; width: 100%;
display: flex; display: flex;
position: relative; position: relative;
background: #fafafa !important; background: #f5f5f5 !important;
overflow: auto;
.menu { .menu {
position: fixed; position: fixed;
width: 180px; width: 162px;
height: calc(100% - 75px); height: calc(100% - 75px);
//margin-right: 1%; //margin-right: 1%;
background-color: #fff; background-color: #fff;
@ -237,9 +235,10 @@ export default {
.content { .content {
margin-top: 10px; margin-top: 10px;
margin-left: 185px; margin-left: 170px;
margin-right: 10px;
flex: 1; flex: 1;
width: calc(100% - 195px); width: calc(100% - 205px);
border-radius: 8px; border-radius: 8px;
} }
} }

View File

@ -3,137 +3,143 @@
<h3 class="workbench-title">全部应用</h3> <h3 class="workbench-title">全部应用</h3>
<el-tabs> <el-tabs>
<el-tab-pane <el-tab-pane
v-for="(item, index) in routeData" v-for="(item, index) in routeData"
:key="index" :key="index"
:label="item.meta ? item.meta.title : ''" :label="item.meta ? item.meta.title : ''"
v-if="item.meta" v-if="item.meta"
> >
<div class="menuContainer"> <div class="menuContainer">
<div <div
v-for="(list, listIndex) in item.children" v-for="(list, listIndex) in item.children"
class="menuBox" class="menuBox"
@click="goRoute(item, list)" @click="goRoute(item, list)"
v-if="!list.meta.hidden" v-if="!list.meta.hidden"
> >
<img <img
class="menuIcon" class="menuIcon"
:src="list.meta.icon" :src="list.meta.icon"
v-if="list.meta.icon" v-if="list.meta.icon"
/> />
<img class="menuIcon" src="../logo1.png" v-else /> <img class="menuIcon" src="../logo1.png" v-else/>
<p class="menuContent">{{ list.meta.title }}</p> <p class="menuContent">{{ list.meta.title }}</p>
</div> </div>
</div></el-tab-pane </div>
</el-tab-pane
> >
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
<script> <script>
import { TagsView } from "@/layout/components"; import { TagsView } from '@/layout/components'
import request from "@/utils/request"; import request from '@/utils/request'
export default { export default {
name: "Workbench", name: 'Workbench',
components: { components: {
TagsView, TagsView
}, },
created() { created() {
this.$store.dispatch("settings/changeSetting", { this.$store.dispatch('settings/changeSetting', {
key: "showTagsView", key: 'showTagsView',
value: true, value: true
}); })
}, },
data() { data() {
return { return {
routeData: [], // routeData: [] //
}; }
}, },
mounted() { mounted() {
let routeList = localStorage.getItem("routeList") let routeList = localStorage.getItem('routeList')
? JSON.parse(localStorage.getItem("routeList")) ? JSON.parse(localStorage.getItem('routeList'))
: []; : []
this.routeData = this.OrganizeMenus(routeList); this.routeData = this.OrganizeMenus(routeList)
}, },
methods: { methods: {
goRoute(val, item) { goRoute(val, item) {
let routeData = this.$router.resolve({ let routeData = this.$router.resolve({
path: item.path, path: item.path,
name: item.name, name: item.name,
query: {mdmCode: item.meta.mdmCode, viewType: item.meta.viewType} query: { mdmCode: item.meta.mdmCode, viewType: item.meta.viewType }
}); })
window.open(routeData.href, "_self"); window.open(routeData.href, '_self')
}, },
// icon // icon
handlerIcon(item) { handlerIcon(item) {
let str = ""; let str = ''
if (item.includes("?")) { if (item.includes('?')) {
str = item.split("?")[1]; str = item.split('?')[1]
} else { } else {
str = item; str = item
} }
return str; return str
}, },
handlerIconColor(item) { handlerIconColor(item) {
let color = ""; let color = ''
if (item.includes("?")) { if (item.includes('?')) {
color = item.split("?")[0]; color = item.split('?')[0]
} else { } else {
color = "#1478F6"; color = '#1478F6'
} }
return color; return color
}, },
// //
OrganizeMenus(data) { OrganizeMenus(data) {
let arrData = []; let arrData = []
data.forEach((bItem) => { data.forEach((bItem) => {
if (bItem.children && bItem.children.length > 0) { if (bItem.children && bItem.children.length > 0) {
bItem.children.forEach((cItem) => { bItem.children.forEach((cItem) => {
if (cItem.meta.icon) { if (cItem.meta.icon) {
this.getLogoUrl(cItem.meta.icon).then((res) => { this.getLogoUrl(cItem.meta.icon).then((res) => {
let imageUrl = let imageUrl =
"data:image/png/jpg;base64," + 'data:image/png/jpg;base64,' +
btoa( btoa(
new Uint8Array(res).reduce( new Uint8Array(res).reduce(
(data, byte) => data + String.fromCharCode(byte), (data, byte) => data + String.fromCharCode(byte),
"" ''
)
) )
);
this.$set(cItem.meta, 'icon', imageUrl) this.$set(cItem.meta, 'icon', imageUrl)
}); })
} }
}); })
} }
arrData.push(bItem); arrData.push(bItem)
}); })
return arrData; return arrData
}, },
getLogoUrl(id) { getLogoUrl(id) {
return request({ return request({
url: url:
"/kangarooDataCenterV3/entranceController/fileDownloadNew?id=" + id, '/kangarooDataCenterV3/entranceController/fileDownloadNew?id=' + id,
method: "get", method: 'get',
responseType: "arraybuffer", responseType: 'arraybuffer'
}).then((res) => { }).then((res) => {
return res; return res
}); })
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.workbench { .workbench {
background: #fff; background: #fff;
// padding: 15px; padding: 15px;
margin: 0 10px; //margin: 0 10px;
} }
.workbench-title { .workbench-title {
margin: 15px 0; margin: 15px 0;
} }
.menuContainer { .menuContainer {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
background-color: #fff;
} }
.menuBox { .menuBox {
display: flex; display: flex;
align-items: center; align-items: center;
@ -144,6 +150,7 @@ export default {
margin: 10px; margin: 10px;
cursor: pointer; cursor: pointer;
} }
.menuIcon { .menuIcon {
width: 36px; width: 36px;
height: 36px; height: 36px;
@ -151,6 +158,7 @@ export default {
border-radius: 12px; border-radius: 12px;
margin-right: 10px; margin-right: 10px;
} }
.menuContent { .menuContent {
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;