主数据修改

This commit is contained in:
hyt 2024-06-13 14:48:19 +08:00
parent e99bb385b6
commit f82ae5ea2f
8 changed files with 1921 additions and 1379 deletions

View File

@ -12,34 +12,6 @@ const addForm = [
}
]
},
{
elCol: [
{
type: 'select',
title: '主数据类型',
id: 'mdmType',
row: 24,
disabled: false,
required: true,
options: [],
fontSize: 16
}
]
},
// {
// elCol: [
// {
// type: "input",
// title: "服务名",
// id: "mdmCode",
// row: 24,
// disabled: true,
// required: false,
// fontSize: 16,
// placeholder: "编辑时自动带出"
// },
// ],
// },
{
elCol: [
{

View File

@ -257,819 +257,18 @@ import baseDialog from '@/views/integrationOption/compoments/baseDialog'
export default {
data() {
return {
sonFormDisabled: false,
saveLoading: false,
mainLoading: false,
//options
optionFormRow: configData.optionFormRow,
//option
mainOptionRow: configData.mainOptionRow,
//type
typeOptionFormRow: [],
propertyFormRow: [],//
mainTableData: [],//
activedTableData: [],//
mainTabLoading: false,//loading
activedTabLoading: false,//loading
optionRuleForm: {},//options
mainOptionForm: {},//
typeOptionRuleForm: {},//type
propertyRuleForm: {},//
mainTableColumn: [
{ title: '英文名', id: 'dbName' },
{ title: '表类型', id: 'dbType' },
{ title: '表说明', id: 'remark' }
],
mainActivedRow: false, //
activedTableRow: false, //
activedTableColumn: [
{ title: '中文名', id: 'chName' },
{ title: '英文名', id: 'enName' },
{ title: '字段类型', id: 'filedType' },
{ title: '长度', id: 'filedLength' }
],//
mainFunData: [
{
text: '删除',
color: 'red'
}
],//
activedFunData: [
{
text: '删除',
color: 'red'
}
],//
propertyActiveList: [],//v-model)
propertyList: [
{
label: '大于',
id: 'up'
}, {
label: '小于',
id: 'low'
},
{
label: '正则',
id: 'pattern'
},
{ label: '正则提示', id: 'message' }
],//
//radiolist
propertyDist: {
up: {
type: 'select',
id: 'up',
title: '大于',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
},
low: {
type: 'select',
id: 'low',
title: '小于',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
},
pattern: {
type: 'input',
id: 'pattern',
title: '正则',
row: 24,
disabled: false,
required: true,
fontSize: 16
},
message: {
type: 'input',
id: 'message',
title: '正则提示',
row: 24,
disabled: false,
required: true,
fontSize: 16
}
},
//
typeDist: {
select: [
{
type: 'select',
id: 'service',
title: '服务名称',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
},
{
type: 'select',
id: 'label',
title: 'label',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}, {
type: 'input',
id: 'value',
title: 'value',
row: 24,
disabled: true,
required: true,
fontSize: 16,
options: []
}
],
radio: [
{
type: 'select',
id: 'service',
title: '服务名称',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
},
{
type: 'select',
id: 'label',
title: 'label',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}, {
type: 'input',
id: 'value',
title: 'value',
row: 24,
disabled: true,
required: true,
fontSize: 16,
options: []
}
],
treeselect: [
{
type: 'select',
id: 'service',
title: '服务名称',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
},
{
type: 'select',
id: 'label',
title: 'label',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}, {
type: 'input',
id: 'value',
title: 'value',
row: 24,
disabled: true,
required: false,
fontSize: 16,
options: []
},
{
type: 'select',
id: 'upId',
title: 'upId',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
serviceOptions: [],
labelOptions: [],
//
receiptsShow: false,//dialog
receiptsTableData: [{}],//
receiptsFunData: [
{
text: '删除',
color: 'red'
}
],
receiptsTableColumn: [
{
title: '类型',
id: 'dbType'
},
{
title: '格式规则',
id: 'dbValue'
}
],
ruleTypeOptions: [
{
label: '连接符号',
value: '1'
}, {
label: '字符串',
value: '2'
}, {
label: '日期',
value: '3'
}, {
label: '流水号',
value: '4'
}
],
dateOptions: [
{
label: 'yyyy-MM-dd',
value: 'yyyy-MM-dd'
}, {
label: 'yyyyMMdd',
value: 'yyyyMMdd'
}, {
label: 'yyyy-MM-dd HH:mm:ss',
value: 'yyyy-MM-dd HH:mm:ss'
}, {
label: 'yyyyMMddHHmmss',
value: 'yyyyMMddHHmmss'
}, {
label: 'yyyyMMddHHmmssSSS',
value: 'yyyyMMddHHmmssSSS'
}
],
receiptsShowTableData: [],
//
dataTypeDist: {}
}
},
methods: {
//
async initSelect() {
//
const type = await getApiModuleApi({
tl: 'generalServiceImpl',
as: 'dictionaryshop',
dj: 'selectDictionaryshop'
}, { tab_name: 'mdm', column_name: 'mdm_filed_type' })
this.optionFormRow[2].elCol[0].options = []
type.attribute.forEach(item => {
//
this.$set(this.dataTypeDist, item.column_value, item.column_content)
this.optionFormRow[2].elCol[0].options.push({
label: item.column_content,
id: item.column_value
})
})
//
const service = await getApiModuleApi({
tl: 'mdmService',
as: 'mdmService',
dj: 'queryMdmModuleServer'
}, { remark: '' })
service.attribute.forEach(item => {
this.serviceOptions.push({
id: item.dbName,
label: item.remark
})
})
},
//
async init() {
this.mainLoading = true
const res = await getApiModuleApi({
tl: 'mdmService',
as: 'mdmService',
dj: 'queryMdmModuleDb'
}, { id: this.$route.query.id })
this.mainTableData = []
this.receiptsShowTableData = res.attribute.mdmTableCodeRuleEntityList
if (res.attribute.mainMdmModuleDb.id) {
this.mainTableData.push({ ...res.attribute.mainMdmModuleDb })
} else {
console.log(123)
let tempObj = {
dbType: '1', sublistMdmModuleDbFileds: [{
'index': 0,
'chName': '数据状态',
'enName': 'dataStatus',
'filedType': '3',
'filedLength': '1',
'mdmModuleDbFiledsRules': [
{
'ruleName': '显示名',
'ruleCode': 'title',
'ruleValue': '数据状态',
'ruleType': 2,
'formName': 'optionRuleForm'
},
{
'ruleName': '宽度',
'ruleCode': 'row',
'ruleValue': '12',
'ruleType': 2,
'formName': 'optionRuleForm'
},
{
'ruleName': '单元格宽度',
'ruleCode': 'width',
'ruleType': 2,
'formName': 'optionRuleForm'
},
{
'ruleName': '数据类型',
'ruleCode': 'type',
'ruleValue': 'input',
'ruleType': 2,
'formName': 'optionRuleForm'
},
{
'ruleName': '必填',
'ruleCode': 'required',
'ruleType': 2,
'formName': 'optionRuleForm'
},
{
'ruleName': '禁止修改',
'ruleCode': 'disabled',
'ruleValue': true,
'ruleType': 2,
'formName': 'optionRuleForm'
}
]
}]
}
this.mainTableData.push(tempObj)
}
res.attribute.sublistMdmModuleDb.forEach(item => {
if (item.id) {
this.mainTableData.push({ ...item })
}
})
this.mainLoading = false
},
//
receiptsAddRow() {
this.receiptsTableData.push({})
},
//
integerNumber(val, row) {
row['dbValue'] = row['dbValue'].replace(/[^\d]/g, '')
},
//
openReceiptsHandle() {
this.receiptsTableData = deepClone(this.receiptsShowTableData)
this.receiptsShow = true
},
//
ruleTypeSeleceChangHandle(val, row) {
this.$set(row, 'dbValue', '')
if (val === '1') {
row['dbValue'] = '-'
}
},
//type
selectChangeHanlde(val, index, indexRow, row, init = false) {
if (row.id === 'type') {
this.typeOptionFormRow = []
if (!init) {
this.typeOptionRuleForm = {
value: 'id'
}
}
if (val && this.typeDist[val]) {
this.typeDist[val].forEach(item => {
//
if (item.id === 'service') {
item.options = deepClone(this.serviceOptions)
}
let tempObj = {
elCol: [
{
...item
}
]
}
this.typeOptionFormRow.push(tempObj)
})
}
}
},
//typelabel
async typeSelectChangeHanlde(val, index, indexRow, row, initFlag = false) {
if (row.id === 'service') {
if (val) {
const res = await getApiModuleApi({
tl: 'mdmService',
as: 'mdmService',
dj: 'queryMdmModuleServerFiled'
}, { dbName: val })
this.labelOptions = []
res.attribute.forEach(item => {
this.labelOptions.push({
id: item.enName,
label: item.chName
})
})
} else {
this.labelOptions = []
}
this.typeOptionFormRow.forEach(item => {
if (item.elCol[0].id === 'label' || item.elCol[0].id === 'upId') {
if (!initFlag) {
this.$set(this.typeOptionRuleForm, item.elCol[0].id, '')
}
item.elCol[0].options = deepClone(this.labelOptions)
}
})
}
},
//
mainActivedRowSaveHandle() {
//mainOptionOnSubmit
this.$refs.mainOptionForm.submitForm()
},
//(){
activedRowSaveHandle() {
//
let flag = this.activedTableData.some(item => {
if (item['enName'] === this.optionRuleForm['enName'] && item.index != this.optionRuleForm.index) {
this.$vmNews('英文名不允许重复', 'warning')
return true
} else {
return false
}
})
if (flag) return
this.$refs.optionForm.submitForm()
},
//
mainOptionOnSubmit() {
let disabledWords = ['id', 'document_rule', 'document_rule_num', 'sorts', 'create_user_id', 'create_time', 'modify_user_id', 'modify_time', 'sts', 'org_id']
if (disabledWords.includes(this.mainOptionForm.dbName)) {
this.$vmNews(`暂存失败,英文名${this.mainOptionForm.dbName}不合法。`)
return
}
//
let flag = this.mainTableData.some(item => {
if (item['dbName'] === this.mainOptionForm['dbName'] && item.index != this.mainOptionForm.index) {
this.$vmNews('英文名不允许重复', 'warning')
return true
} else {
return false
}
})
if (flag) return
// mainActivedRow
this.$set(this.mainActivedRow, 'dbName', this.mainOptionForm['dbName'])
this.$set(this.mainActivedRow, 'remark', this.mainOptionForm['remark'])
//activedTableData
// this.activedTableData = this.mainActivedRow.sublistMdmModuleDbFileds
//
// this.$refs.mainTable.setCurrent({index: -1})
// this.mainActivedRow = false
},
//
propertyActiveListChangeHanlde(val) {
this.propertyFormRow = []
//
Object.keys(this.propertyRuleForm).forEach(item => {
if (!val.includes(item)) {
this.$delete(this.propertyRuleForm, item)
}
})
if (val === 'up' || val === 'low') {
this.activedTableData.forEach(item => {
tempOptions.push({ label: item.id, chName: item.enName })
})
}
//
val.forEach(item => {
let tempOptions = []
if (item === 'up' || item === 'low') {
this.activedTableData.some(ele => {
if (this.activedTableRow.id === ele.id) return false
ele.mdmModuleDbFiledsRules.forEach(ele02 => {
if (ele02.ruleValue === 'datepick') {
tempOptions.push({ label: ele.chName, id: ele.enName })
}
})
})
}
let tempObj = {
elCol: [
{
...this.propertyDist[item],
options: tempOptions
}
]
}
this.propertyFormRow.push(tempObj)
})
},
//
mainOnClick(val) {
if (val.index === -1) return
this.activedTableRow = false
this.mainActivedRow = val
this.activedTableData = []
this.$nextTick(() => {
this.$refs.mainOptionForm.resetForm()
this.mainOptionForm = deepClone(val)
this.activedTableData = val.sublistMdmModuleDbFileds
})
},
//
activedOnClick(val) {
//dataStatus
if (val.enName === 'dataStatus' && this.mainActivedRow.dbType == 1) {
this.sonFormDisabled = true
} else {
this.sonFormDisabled = false
}
this.activedTableRow = val
//typeruleForm
this.typeOptionFormRow = []
this.typeOptionRuleForm = {
value: 'id'
}
this.propertyFormRow = []
this.propertyRuleForm = {}
this.propertyActiveList = []
let propertyRuleForm = []
let optionRuleForm = []
let typeOptionRuleForm = []
this.$nextTick(() => {
//
this.$refs.optionForm.resetForm()
this.optionRuleForm = deepClone(val)
console.log(this.optionRuleForm, 'this.optionRuleForm')
let dom = document.querySelector('.optionForm')
dom.scrollTo({
top: 0,
behavior: 'smooth'
})
//
if (!val.mdmModuleDbFiledsRules) return
val.mdmModuleDbFiledsRules.forEach(item => {
if (item.ruleCode === 'required' || item.ruleCode === 'disabled') {
if (!item.ruleValue) {
this.$set(this[item.formName], item.ruleCode, false)
} else if (typeof item.ruleValue === 'boolean') {
this.$set(this[item.formName], item.ruleCode, item.ruleValue)
} else {
this.$set(this[item.formName], item.ruleCode, JSON.parse(item.ruleValue))
}
} else {
this.$set(this[item.formName], item.ruleCode, item.ruleValue)
}
if (item.formName === 'propertyRuleForm') {
propertyRuleForm.push(item.ruleCode)
}
})
if (this.typeOptionRuleForm.service) {
this.typeSelectChangeHanlde(this.typeOptionRuleForm.service, '', '', { id: 'service' }, true)
}
this.selectChangeHanlde(this.optionRuleForm.type, '', '', { id: 'type' }, true)
this.propertyActiveList = propertyRuleForm
this.propertyActiveListChangeHanlde(this.propertyActiveList)
})
},
//
optionOnSubmit() {
this.$refs.typeOptionForm.submitForm()
},
//type
typeOptionOnSubmit() {
this.$refs.propertyForm.submitForm()
},
//
propertyOnSubmit() {
//
let tempDist = {
title: true,
row: true,
type: true,
required: true,
disabled: true,
width: true
}
let tempArr = []
let disabledWords = ['id', 'document_rule', 'document_rule_num', 'sorts', 'create_user_id', 'create_time', 'modify_user_id', 'modify_time', 'sts', 'org_id']
if (disabledWords.includes(this.optionRuleForm.enName)) {
this.$vmNews(`暂存失败,英文名${this.optionRuleForm.enName}不合法。`)
return
}
if (this.optionRuleForm.type === 'datepick' || this.optionRuleForm.type === 'daterange') {
if (this.optionRuleForm.filedType != 4) {
this.$vmNews('字段类型与数据类型不合法,请选择日期类型', 'warning')
return
}
}
if (this.optionRuleForm.filedType == 4) {
if (this.optionRuleForm.type !== 'datepick' && this.optionRuleForm.type !== 'daterange') {
this.$vmNews('字段类型与数据类型不合法', 'warning')
return
}
}
this.$set(this.activedTableRow, 'chName', this.optionRuleForm.chName)
this.$set(this.activedTableRow, 'enName', this.optionRuleForm.enName)
this.$set(this.activedTableRow, 'filedType', this.optionRuleForm.filedType)
this.$set(this.activedTableRow, 'filedLength', this.optionRuleForm.filedLength)
this.optionFormRow.forEach(item => {
if (tempDist[item.elCol[0].id]) {
tempArr.push({
ruleName: item.elCol[0].title,
ruleCode: item.elCol[0].id,
ruleValue: this.optionRuleForm[item.elCol[0].id],
ruleType: 2,
formName: 'optionRuleForm'
})
}
})
this.typeOptionFormRow.forEach(item => {
tempArr.push({
ruleName: item.elCol[0].title,
ruleCode: item.elCol[0].id,
ruleValue: this.typeOptionRuleForm[item.elCol[0].id],
ruleType: 2,
formName: 'typeOptionRuleForm'
})
})
this.propertyFormRow.forEach(item => {
tempArr.push({
ruleName: item.elCol[0].title,
ruleCode: item.elCol[0].id,
ruleValue: this.propertyRuleForm[item.elCol[0].id],
ruleType: 2,
formName: 'propertyRuleForm'
})
})
this.activedTableRow.mdmModuleDbFiledsRules = tempArr
},
//
async saveHandle() {
console.log(this.mainTableData)
//
if (!this.receiptsShowTableData.length) {
this.$vmNews('单据规则不能为空', 'warning')
return
}
let flag = this.mainTableData.some((mainItem, index) => {
if (!mainItem.dbName) {
this.$vmNews(`数据表第${index + 1}行的英文名不能为空`, 'warning')
return true
}
return mainItem.sublistMdmModuleDbFileds.some((item, index02) => {
if (!item.chName) {
this.$vmNews(`数据表第${index + 1}行表中的${index02 + 1}行表字段数据填写不全`, 'warning')
return true
}
})
})
if (flag) return
this.saveLoading = true
let params = {
id: this.$route.query.id,
mainMdmModuleDb: this.mainTableData[0],
sublistMdmModuleDb: [],
mdmTableCodeRuleEntityList: this.receiptsShowTableData
}
this.mainTableData.forEach((item, index) => {
if (index > 0) {
params.sublistMdmModuleDb.push(item)
}
})
const res = await getApiModuleApi({
tl: 'mdmService',
as: 'mdmService',
dj: 'saveMdmModuleDb'
}, params)
if (res.status === '200') {
this.$vmNews('保存成功!', 'success')
this.init()
}
this.saveLoading = false
},
//
mainOnFunc(row, item) {
if (!row.newFlag) {
this.$vmNews('此行不允许删除', 'warning')
return
}
this.$confirm('确定删除?')
.then((_) => {
this.mainTableData.splice(row.index, 1)
})
.catch((_) => {
})
},
//
activedOnFunc(row) {
if (!row.newFlag) {
this.$vmNews('此行不允许删除', 'warning')
return
}
this.$confirm('确定删除?')
.then((_) => {
this.activedTableData.splice(row.index, 1)
})
.catch((_) => {
})
},
//
receiptsOnFunc(row) {
this.receiptsTableData.splice(row.index, 1)
},
//
receiptsConfirm() {
let type = false
let flag = this.receiptsTableData.some((item, index) => {
if (!item.dbType || !item.dbValue) {
this.$vmNews(`请选择${index + 1}行的类型并填写或选择规则`, 'warning')
return true
} else if (item.dbType === '4' && index + 1 !== this.receiptsTableData.length) {
type = true
this.$vmNews(`流水号只允许在最后一行`, 'warning')
return true
} else if (item.dbType === '4') {
type = true
}
})
if (!type) {
this.$vmNews(`请添加流水号`, 'warning')
return
}
if (flag) return
this.receiptsShow = false
this.receiptsShowTableData = deepClone(this.receiptsTableData)
},
//
addMainAddRow() {
this.mainTableData.push({
'dbName': ``,
'dbType': '2',
'remark': '',
sublistMdmModuleDbFileds: [],
newFlag: true
})
},
//
activedAddRow() {
this.activedTableData.push({ newFlag: true, disabled: false, required: false })
},
//
optionFormInputBlur(id, row) {
if (id === 'chName' && !row.title) {
this.$set(row, 'title', row['chName'])
}
}
return {}
},
methods: {},
components: {
baseNewForm,
BaseTable,
baseDialog
},
created() {
this.initSelect()
this.init()
this.$emit('flashActive', 1)
},
watch: {},
computed: {
labelOptionsAuto() {
return this.labelOptions
}
}
computed: {}
}
</script>
@ -1081,129 +280,4 @@ export default {
::v-deep .el-form-item {
display: block !important;
}
.wrap {
background-color: #fbfbfb;
width: 100%;
position: relative;
> .btn {
display: flex;
justify-content: flex-end;
> .chunk {
margin-left: 10px;
}
}
> .main {
margin-top: 10px;
display: flex;
> .left {
flex: 0.75;
height: 85vh;
margin-right: 10px;
background-color: #fff;
border-radius: 8px;
padding: 0 15px;
overflow: auto;
> .title {
color: #000;
font-weight: 600;
margin: 20px 0;
}
> .receipts {
display: flex;
align-items: center;
.receiptsList {
text-align: center;
cursor: pointer;
margin-left: 20px;
padding: 20px;
background-color: #fafafa;
display: flex;
align-items: center;
.receiptsItem {
margin-right: 10px;
}
}
}
.mainTable {
margin-top: 30px;
.mainAddRow {
margin-top: 30px;
border: 1px dotted #ccc;
text-align: center;
height: 50px;
line-height: 50px;
}
}
.activedTable {
margin-top: 30px;
.mainAddRow {
margin-top: 30px;
border: 1px dotted #ccc;
text-align: center;
height: 50px;
line-height: 50px;
}
}
}
> .right {
flex: 0.25;
height: 85vh;
background-color: #fff;
border-radius: 8px;
padding: 0 10px;
overflow-y: auto;
> .btn {
margin-top: 10px;
display: flex;
justify-content: flex-end;
}
> .title {
color: #000;
font-weight: 600;
padding: 20px 0;
border-bottom: 1px solid #EBEBEB;
}
.optionForm {
margin: 30px 0;
height: 50vh;
overflow-y: auto;
}
> .smtitle {
color: #000;
font-weight: 600;
padding: 20px 0;
border-top: 1px solid #EBEBEB;
}
}
}
}
.receiptsAddRow {
margin-top: 30px;
border: 1px dotted #ccc;
text-align: center;
height: 50px;
line-height: 50px;
}
</style>

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -5,7 +5,8 @@
<div class="search">
<div class="chunk">
<el-input placeholder="主数据名称" v-model="searchForm.mdmName"
@change="submitsearchForm">
@change="submitsearchForm"
>
<i slot="suffix" class="el-input__icon el-icon-search" @click="submitsearchForm"></i>
</el-input>
</div>
@ -18,127 +19,189 @@
</div>
</div>
<div class="right">
<el-button type="primary" icon="el-icon-plus" @click="addApp">新增</el-button>
<!-- <el-button type="primary" icon="el-icon-plus" @click="addApp">新增</el-button>-->
<el-button type="primary" icon="el-icon-plus" @click="tableButtonHandle({},{type:'new'})">新增</el-button>
</div>
</header>
<main>
<BaseTable ref="mainTable" :tableData="tableData" :tableColumn="tableColumn" :funData="funData"
:funWidth="funWidth" :showIndex="true" :tabLoading="mainTabLoading" @onFunc="tableButtonHandle"
:tableHeight="'70vh'" :border="false">
<template v-slot:mdmName="{ row }">
<div class="nameCard">
<div class="image" v-loading="row.imgLoading">
<div class="tableData">
<div class="tableChunk" v-for="(row,index) in tableData" :key="index">
<div class="topInfo">
<div class="left">
<div class="icon">
<template v-if="row.imgUrl">
<img :src="row.imgUrl" alt=""/>
<img :src="row.imgUrl" alt="">
</template>
<template v-else>
<img src="./images/icon.png">
<img src="./images/icon.png" alt="">
</template>
</div>
<div class="nameInfo">
<div class="vision"></div>
</div>
<div class="tableInfo">
<div class="tableName">
<div class="name">{{ row.mdmName }}</div>
</div>
<div class="tableType">档案</div>
<div class="tableContent">
{{ row.remark }}
</div>
</template>
<template v-slot:accessMode="{ row }">
<div class="taskClasses">
<span :class="`state${item}`" v-for="(item,index) in JSON.parse(row.accessMode)"
:key="index">{{ methods_dist[item] }}</span>
</div>
</template>
<template v-slot:interfaceStatus="{ row }">
<el-switch active-value="1" inactive-value="2" active-color="#60c958" v-model="row.interfaceStatus"
disabled></el-switch>
</template>
<template v-slot:dbStatus="{ row }">
<el-switch active-value="1" inactive-value="2" active-color="#60c958" v-model="row.dbStatus"
disabled></el-switch>
</template>
<template v-slot:appStatus="{ row }">
<el-switch active-value="1" inactive-value="2" active-color="#60c958" v-model="row.appStatus"
@change="(val)=>appStatusChange(val,row)"></el-switch>
</template>
</BaseTable>
<!-- 遮罩层显示两按钮-->
</div>
<div class="shade">
<div class="btnList">
<div class="setting" @click="tableButtonHandle(row,{type:'setting'})">
<div class="icon">
<img src="./images/设置.png" alt="">
</div>
<div class="name">设置</div>
</div>
<div class="dele" @click="deleteHandle(row)">
<div class="icon">
<img src="./images/删除.png" alt="">
</div>
<div class="name">删除</div>
</div>
</div>
</div>
</div>
</div>
<!-- <BaseTable ref="mainTable" :tableData="tableData" :tableColumn="tableColumn" :funData="funData"-->
<!-- :funWidth="funWidth" :showIndex="true" :tabLoading="mainTabLoading" @onFunc="tableButtonHandle"-->
<!-- :tableHeight="'70vh'" :border="false">-->
<!-- <template v-slot:mdmName="{ row }">-->
<!-- <div class="nameCard">-->
<!-- <div class="image" v-loading="row.imgLoading">-->
<!-- <template v-if="row.imgUrl">-->
<!-- <img :src="row.imgUrl" alt=""/>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <img src="./images/icon.png">-->
<!-- </template>-->
<!-- </div>-->
<!-- <div class="nameInfo">-->
<!-- <div class="name">{{ row.mdmName }}</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:accessMode="{ row }">-->
<!-- <div class="taskClasses">-->
<!-- <span :class="`state${item}`" v-for="(item,index) in JSON.parse(row.accessMode)"-->
<!-- :key="index">{{ methods_dist[item] }}</span>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:interfaceStatus="{ row }">-->
<!-- <el-switch active-value="1" inactive-value="2" active-color="#60c958" v-model="row.interfaceStatus"-->
<!-- disabled></el-switch>-->
<!-- </template>-->
<!-- <template v-slot:dbStatus="{ row }">-->
<!-- <el-switch active-value="1" inactive-value="2" active-color="#60c958" v-model="row.dbStatus"-->
<!-- disabled></el-switch>-->
<!-- </template>-->
<!-- <template v-slot:appStatus="{ row }">-->
<!-- <el-switch active-value="1" inactive-value="2" active-color="#60c958" v-model="row.appStatus"-->
<!-- @change="(val)=>appStatusChange(val,row)"></el-switch>-->
<!-- </template>-->
<!-- </BaseTable>-->
</main>
<footer>
<basePage :pageModel="pageModel" @update:pageModel="currentChangeHandle"></basePage>
<!-- <basePage :pageModel="pageModel" @update:pageModel="currentChangeHandle"></basePage>-->
</footer>
</div>
</template>
<script>
import configData from "./configData.js";
import dayjs from "dayjs";
import BaseTable from "@/views/intergrationTask/compoments/baseTable.vue";
import basePage from "@/views/intergrationTask/compoments/basePage.vue";
import {getApiModuleApi} from "@/api/apiChunks/index.js";
import {downloadLogo} from "@/api/apis/logo.js";
import request from "@/utils/request";
import configData from './configData.js'
import dayjs from 'dayjs'
import BaseTable from '@/views/intergrationTask/compoments/baseTable.vue'
import basePage from '@/views/intergrationTask/compoments/basePage.vue'
import { getApiModuleApi } from '@/api/apiChunks/index.js'
import { downloadLogo } from '@/api/apis/logo.js'
import request from '@/utils/request'
import { authApi } from '@/api/apis/auth'
export default {
name: "listOfApps",
name: 'listOfApps',
data() {
return {
refreshLoading: false,
searchForm: {
task_name: "",
task_name: ''
},
imgLoading: false,
mainTabLoading: false,
funData: [
{
type: "setting",
text: "设置",
color: "#5a9cf8",
},
type: 'setting',
text: '设置',
color: '#5a9cf8'
}
],
tableColumn: configData.tableColumn,
tableData: [],
imgUrl: "",
imgUrl: '',
pageModel: {
pageIndex: 1,
total: 10,
limit: 10,
limit: 10
},
classOptions: [],
stateOptions: [
{
label: "启用",
value: "1",
label: '启用',
value: '1'
},
{
label: "停用",
value: "2",
},
label: '停用',
value: '2'
}
],
methods_dist: {
1: "接口",
2: "H5",
3: "PC网页",
4: "PC应用程序",
},
};
1: '接口',
2: 'H5',
3: 'PC网页',
4: 'PC应用程序'
}
}
},
methods: {
//
deleteHandle(row) {
this.$confirm('是否删除此行?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async() => {
this.openLoading('del')
const res = await authApi('mdmModuleService', '', 'deleteMdm', '', {
id: row.id
})
this.$vmNews('删除成功!', 'success')
this.initMainTableData()
})
},
//
async appStatusChange(val, row) {
const res = await getApiModuleApi({
tl: "sysApplicationService",
as: "application",
dj: "enableOrDisableApp"
tl: 'sysApplicationService',
as: 'application',
dj: 'enableOrDisableApp'
}, { id: row.id, appStatus: val })
this.$vmNews(res.msg, 'success')
},
async initSelectOptions() {
let params = {
tab_name: "mdm",
column_name: "mdm_type",
};
tab_name: 'mdm',
column_name: 'mdm_type'
}
const res = await getApiModuleApi({
tl: "generalServiceImpl",
as: "dictionaryshop",
dj: "selectDictionaryshop"
tl: 'generalServiceImpl',
as: 'dictionaryshop',
dj: 'selectDictionaryshop'
}, params)
this.classOptions = [];
this.classOptions = []
res.attribute.forEach((item) => {
this.classOptions.push({
label: item.column_content,
@ -149,52 +212,51 @@ export default {
//
addApp() {
this.$router.push({
path: "/integrationOption/masterDataAdd",
query: {flag: "add"},
});
path: '/integrationOption/masterDataAdd',
query: { flag: 'add' }
})
},
//
getTimeHandler(time) {
var days = parseInt(time / (1000 * 60 * 60 * 24));
var hours = parseInt((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = parseInt((time % (1000 * 60 * 60)) / (1000 * 60));
var seconds = (time % (1000 * 60)) / 1000;
return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
var days = parseInt(time / (1000 * 60 * 60 * 24))
var hours = parseInt((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
var minutes = parseInt((time % (1000 * 60 * 60)) / (1000 * 60))
var seconds = (time % (1000 * 60)) / 1000
return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒'
},
//
async initMainTableData(obj = {}) {
this.refreshLoading = true;
this.refreshLoading = true
const res = await getApiModuleApi(
{
tl: "mdmService",
as: "mdmService",
dj: "queryMdmPage",
tl: 'mdmModuleService',
as: '',
dj: 'queryMdm'
},
{
pageNum: this.pageModel.pageIndex,
pageSize: this.pageModel.limit,
...obj,
...obj
}
);
this.refreshLoading = false;
)
this.refreshLoading = false
if (res.status == 200) {
this.pageModel.total = res.attribute.total;
// this.pageModel.total = res.attribute.total
this.imgLoading = true
res.attribute.list.map(el => {
res.attribute.map(el => {
this.$set(el, 'imgLoading', true)
return request({
url: "/kangarooDataCenterV3/entranceController/fileDownloadNew?id=" + el.mdmLogo,
method: "get",
url: '/kangarooDataCenterV3/entranceController/fileDownloadNew?id=' + el.mdmLogo,
method: 'get',
responseType: 'arraybuffer'
}).then((res) => {
el.imgLoading = false
if (!res.byteLength) return
let tempImgUrl =
"data:image/png/jpg;base64," + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ""));
'data:image/png/jpg;base64,' + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ''))
this.$set(el, 'imgUrl', tempImgUrl)
})
})
this.tableData = res.attribute.list;
console.log(res,'res')
this.tableData = res.attribute
}
},
//
@ -207,63 +269,69 @@ export default {
},
//
submitsearchForm() {
this.initMainTableData(this.searchForm);
this.initMainTableData(this.searchForm)
},
//
tableButtonHandle(val, item) {
if (item.type === "setting") {
if (item.type === 'setting') {
this.$router.push({
path: "/integrationOption/settingMenu/masterDataEdit",
query: {flag: "setting", id: val.id, name: val.name, appLogo: val.appLogo},
});
} else if (item.type === "copy") {
path: '/integrationOption/settingMenu/masterDataEdit',
query: { flag: 'setting', id: val.id, name: val.name, appLogo: val.appLogo }
})
} else if (item.type === 'copy') {
this.$router.push({
path: "/applicationList/applicationAdd/masterDataEdit",
query: {flag: "copy", id: val.id, appLogo: val.appLogo},
});
path: '/applicationList/applicationAdd/masterDataEdit',
query: { flag: 'copy', id: val.id, appLogo: val.appLogo }
})
} else if (item.type === 'new') {
this.$router.push({
path: '/integrationOption/settingMenu/masterDataEdit',
query: { flag: 'new' }
})
}
},
//
currentChangeHandle(pageModel) {
this.pageModel = pageModel;
this.pageModel = pageModel
this.$nextTick(() => {
this.initMainTableData(this.searchForm);
});
},
this.initMainTableData(this.searchForm)
})
}
},
computed: {
//
funWidth() {
return this.funData.length * 70;
},
return this.funData.length * 70
}
},
components: {
BaseTable,
basePage,
basePage
},
created() {
// this.initMainTableData();
this.initSelectOptions()
},
activated() {
this.initMainTableData(this.searchForm);
this.initMainTableData(this.searchForm)
},
beforeRouteLeave(to, from, next) {
if (!to.path.includes("applicationList")
if (!to.path.includes('applicationList')
) {
next();
this.$destroy("listOfApps");
next()
this.$destroy('listOfApps')
} else {
next();
next()
}
}
}
},
};
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
::v-deep .el-button {
border-radius: 16px;
}
.monitoring {
position: relative;
width: 100%;
@ -295,9 +363,180 @@ export default {
main {
margin-top: 10px;
padding: 20px 20px 5px;
height: 75vh;
height: 80vh;
border-radius: 20px;
background-color: #fff;
overflow: auto;
.tableData {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-start;
.tableChunk {
width: 30%;
margin-bottom: 30px;
margin-left: 2.5%;
border-radius: 24px;
border: 2px solid #E5E5E5;
padding-bottom: 20px;
position: relative;
overflow: hidden;
.topInfo {
display: flex;
margin: 20px 0 0 26px;
.left {
.icon {
width: 88px;
height: 88px;
border-radius: 16px;
border: 1px solid #F0F0F2;
padding: 14px;
> img {
width: 60px;
height: 60px;
}
}
//.vision{
// margin-top: 10px;
// margin-left: 30px;
// width: 29px;
// height: 16px;
// border-radius: 2px;
// border: 1px solid #FF8B0F;
//}
}
.tableInfo {
margin-left: 15px;
.tableName {
display: flex;
align-items: center;
> .name {
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 24px;
color: #333333;
line-height: 33px;
text-align: left;
font-style: normal;
}
}
.tableType {
margin-top: 11px;
width: 38px;
height: 24px;
background: #1478F6;
border-radius: 5px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 12px;
color: #FFFFFF;
text-align: center;
line-height: 24px;
font-style: normal;
}
.tableContent {
margin-top: 5px;
width: 95%;
height: 60px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 14px;
color: #999999;
line-height: 20px;
text-align: left;
font-style: normal;
display: -webkit-box; /*作为弹性伸缩盒子模型显示。*/
-webkit-box-orient: vertical; /*作为弹性伸缩盒子模型显示。*/
-webkit-line-clamp: 3; //**/
overflow: hidden; /*溢出隐藏*/
/* 对于连字情况或者纯字母,可以解决 */
word-break: break-all;
}
}
}
.shade {
display: none;
position: absolute;
z-index: 10;
width: 100%;
height: 100%;
top: 0;
background-color: rgba(0, 0, 0, .7);
.btnList {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
.setting {
cursor: pointer;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.icon {
img {
width: 44px;
height: 44px;
}
}
.name {
margin-top: 10px;
color: #fff;
font-weight: 700;
}
}
.dele {
cursor: pointer;
margin-left: 50px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.icon {
img {
width: 44px;
height: 44px;
}
}
.name {
margin-top: 10px;
color: red;
font-weight: 700;
}
}
}
}
&:hover {
.shade {
display: block !important;
}
}
}
}
}
footer {
@ -309,6 +548,7 @@ export default {
align-items: center;
justify-content: flex-start;
width: 100%;
.image {
width: 29px;
height: 29px;

View File

@ -2,27 +2,51 @@
<template>
<div class="wrap">
<div class="btn">
<div class="title">主数据信息</div>
<div class="chunkList">
<div class="chunk">
<el-button icon="el-icon-back" @click="
$router.replace({ path: '/integrationOption/masterDataOptions' })
">返回
"
>返回
</el-button>
</div>
<div class="chunk">
<el-button icon="el-icon-first-aid-kit" type="primary" @click="saveHandle" :loading="saveLoading">保存
<el-button v-if="showForm" icon="el-icon-first-aid-kit" type="primary" @click="saveHandle"
:loading="saveLoading"
>保存
</el-button>
<el-button v-else icon="el-icon-first-aid-kit" type="primary" @click="showForm=true">编辑
</el-button>
</div>
</div>
</div>
<div class="main">
<!-- 展示页-->
<template v-if="!showForm">
<div class="planInfo">
<div class="img">
<img v-if="imgUrl" :src="imgUrl" class="avatar">
<img v-else src="./images/icon.png" alt="">
</div>
<div class="info">
<div class="name">{{ this.ruleForm.mdmName }}</div>
<div class="remark">{{ this.ruleForm.remark }}</div>
</div>
</div>
</template>
<template v-if="showForm">
<!-- 编辑页-->
<div class="upload">
<div class="title">主数据基本信息</div>
<div class="uploadMain">
<div class="left">
<div class="title">主数据logo</div>
<el-upload class="avatar-uploader" ref="upload" action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview" :on-progress="handleProgress" :before-upload="beforeUpload"
list-type="picture" :limit="1" :disabled="lookFlag" :on-success="handleAvatarSuccess"
:show-file-list="false">
:show-file-list="false"
>
<div class="line">
<div class="left" v-loading="imgLoading">
<img v-if="imgUrl" :src="imgUrl" class="avatar">
@ -44,34 +68,40 @@
</div>
<div class="form">
<baseNewForm ref="mainForm" :spanNumber="24" :isFunBtn="false" :lookFlag="lookFlag" :formRule="!lookFlag"
:formRow="formRow" :ruleForm="ruleForm" @onSubmit="onSubmit"></baseNewForm>
:formRow="formRow" :ruleForm="ruleForm" @onSubmit="onSubmit"
></baseNewForm>
</div>
</template>
</div>
</div>
</template>
<script>
import {getApiModuleApi} from "@/api/apiChunks/index.js";
import configData from "./configData";
import baseNewForm from "@/views/intergrationTask/compoments/baseNewForm";
import request from "@/utils/request";
import { getApiModuleApi } from '@/api/apiChunks/index.js'
import configData from './configData'
import baseNewForm from '@/views/intergrationTask/compoments/baseNewForm'
import request from '@/utils/request'
import { authApi } from '@/api/apis/auth'
export default {
data() {
return {
fileList: [],
iconBase64: "",
imgUrl: "",
iconBase64: '',
imgUrl: '',
loading: false,
appLogo: "",
appLogo: '',
ruleForm: {
accessMode: [],
accessMode: []
},
lookFlag: false,
formRow: configData.addForm,
imgLoading: false,
saveLoading: false,
};
showForm: false,
billid: ''
}
},
methods: {
//
@ -85,21 +115,21 @@ export default {
},
async handleAvatarSuccess(res, file) {
this.loading = true
this.$refs.upload.clearFiles();//
this.imgUrl = URL.createObjectURL(file.raw);
let formData = new FormData();
formData.append("file", file.raw);
formData.append("fileFlag", true);
formData.append("businessType", "application");
this.$refs.upload.clearFiles()//
this.imgUrl = URL.createObjectURL(file.raw)
let formData = new FormData()
formData.append('file', file.raw)
formData.append('fileFlag', true)
formData.append('businessType', 'application')
return request({
url: "/kangarooDataCenterV3/entranceController/fileUpload",
method: "post",
data: formData,
url: '/kangarooDataCenterV3/entranceController/fileUpload',
method: 'post',
data: formData
}).then((res) => {
if (res.status === '200') {
console.log(res)
this.$vmNews("上传成功", "success")
this.$vmNews('上传成功', 'success')
this.appLogo = res.attribute.id
}
})
@ -107,70 +137,65 @@ export default {
},
async beforeUpload(file) {
if (
file.type.split("/")[1] != "jpeg" &&
file.type.split("/")[1] != "png"
file.type.split('/')[1] != 'jpeg' &&
file.type.split('/')[1] != 'png'
) {
this.$message({
type: "warning",
message: "只能上传jpg/png文件",
});
type: 'warning',
message: '只能上传jpg/png文件'
})
return
} else {
if (file.size >= 2000000) {
this.$message({
type: "warning",
message: "文件大小不超过2MB",
});
type: 'warning',
message: '文件大小不超过2MB'
})
return
}
}
},
//
saveHandle() {
this.$refs.mainForm.submitForm();
this.$refs.mainForm.submitForm()
},
//
async onSubmit() {
this.saveLoading = true
if (this.$route.query.flag === "add") {
const res = await getApiModuleApi({
tl: "mdmService",
as: "mdmService",
dj: "doSaveMdmModule"
}, {...this.ruleForm, mdmLogo: this.appLogo})
if (res.status === '200') {
this.$vmNews("保存成功", "success")
if (!this.billid) {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'saveMdm', '', {
updateType: 1, ...this.ruleForm, mdmLogo: this.appLogo, mdmType: 1
})
this.$vmNews('保存成功', 'success')
this.saveLoading = false
this.$router.replace({path: '/integrationOption/masterDataOptions'})
}
} else if (this.$route.query.flag === "setting") {
const res = await getApiModuleApi({
tl: "mdmService",
as: "mdmService",
dj: "doSaveMdmModule"
}, {updateType: 1, ...this.ruleForm, mdmLogo: this.appLogo})
if (res.status === '200') {
this.$vmNews("保存成功", "success")
this.initEditFormData()
this.getLogoUrl()
this.$emit('saveSuccessInit', res, this.initEditFormData)
this.showForm = false
} else {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'updateMdm', '', {
...this.ruleForm,
mdmLogo: this.appLogo,
mdmType: 1
})
this.$vmNews('保存成功', 'success')
this.saveLoading = false
this.$emit("saveSuccess")
}
this.showForm = false
this.$emit('saveSuccess')
}
},
//
// (
async initSelectOptions() {
let params = {
tab_name: "mdm",
column_name: "mdm_type",
};
tab_name: 'mdm',
column_name: 'mdm_type'
}
const res = await getApiModuleApi({
tl: "generalServiceImpl",
as: "dictionaryshop",
dj: "selectDictionaryshop"
tl: 'generalServiceImpl',
as: 'dictionaryshop',
dj: 'selectDictionaryshop'
}, params)
this.formRow[1].elCol[0].options = []
res.attribute.forEach((item) => {
@ -184,19 +209,20 @@ export default {
// -
async initCopyFormData() {
const res = await getApiModuleApi({
tl: "sysApplicationService",
as: "application",
dj: "getCopyApp"
tl: 'sysApplicationService',
as: 'application',
dj: 'getCopyApp'
}, { id: this.$route.query.id })
this.ruleForm = res.attribute
this.ruleForm.accessMode = JSON.parse(res.attribute.accessMode)
},
async initEditFormData() {
this.openLoading('detail')
const res = await getApiModuleApi({
tl: "mdmService",
as: "mdmService",
dj: "queryMdmModule"
}, {id: this.$route.query.id})
tl: 'mdmModuleService',
as: '',
dj: 'getMdm'
}, { id: this.billid })
this.ruleForm = res.attribute
if (res.attribute.mdmLogo) {
this.appLogo = res.attribute.mdmLogo
@ -210,8 +236,8 @@ export default {
this.imgLoading = true
let id = this.appLogo ? this.appLogo : this.$route.query.appLogo
return request({
url: "/kangarooDataCenterV3/entranceController/fileDownloadNew?id=" + id,
method: "get",
url: '/kangarooDataCenterV3/entranceController/fileDownloadNew?id=' + id,
method: 'get',
responseType: 'arraybuffer'
}).then((res) => {
this.imgLoading = false
@ -220,85 +246,24 @@ export default {
return
}
this.imgUrl =
"data:image/png/jpg;base64," + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ""));
'data:image/png/jpg;base64,' + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ''))
})
}
},
components: {
baseNewForm,
baseNewForm
},
created() {
// options
this.initSelectOptions()
// this.initSelectOptions()
//
if (this.$route.query.flag === "setting") {
this.formRow = [
{
elCol: [
{
type: "input",
title: "主数据名称",
id: "mdmName",
row: 24,
disabled: false,
required: true,
fontSize: 16
},
],
},
{
elCol: [
{
type: "select",
title: "主数据类型",
id: "mdmType",
row: 24,
disabled: false,
required: true,
options: [],
fontSize: 16,
},
],
},
{
elCol: [
{
type: "input",
title: "服务名",
id: "mdmCode",
row: 24,
disabled: true,
required: false,
fontSize: 16,
placeholder: "编辑时自动带出"
},
],
},
{
elCol: [
{
type: "textrea",
title: "备注",
id: "remark",
row: 24,
disabled: false,
fontSize: 16
},
],
},
]
} else {
}
if (this.$route.query.flag === "copy") {
this.initCopyFormData()
} else if (this.$route.query.flag === "setting") {
if (this.$route.query.id) {
this.billid = this.$route.query.id
this.initEditFormData()
}
},
};
}
}
</script>
<style scoped lang="scss">
@ -311,22 +276,85 @@ export default {
}
.wrap {
background-color: #fbfbfb;
background-color: #fff;
width: 100%;
overflow: auto;
border-radius: 8px;
margin-left: 10px;
> .btn {
display: flex;
justify-content: flex-end;
justify-content: space-between;
align-items: center;
.title {
margin-left: 32px;
font-family: PingFangSC, PingFang SC;
font-weight: 600;
font-size: 18px;
color: #333333;
line-height: 25px;
text-align: left;
font-style: normal;
}
.chunkList {
display: flex;
> .chunk {
margin-left: 10px;
}
}
}
> .main {
margin-top: 10px;
> .planInfo {
margin-top: 17px;
padding-bottom: 20px;
display: flex;
align-items: center;
> .img {
margin-left: 24px;
width: 64px;
height: 64px;
img {
width: 100%;
height: 100%;
}
}
.info {
margin-left: 11px;
.name {
margin-bottom: 14px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 18px;
color: #333333;
line-height: 25px;
text-align: left;
font-style: normal;
}
.remark {
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 16px;
color: #999999;
line-height: 25px;
text-align: left;
font-style: normal;
}
}
}
> .upload {
background-color: #fff;
border-radius: 16px;
@ -338,7 +366,6 @@ export default {
}
> .uploadMain {
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;

View File

@ -22,17 +22,19 @@
</div>
</div>
<div class="content">
<router-view @saveSuccess="saveSuccess" @flashActive="flashActive"></router-view>
<router-view ref="routerChunk" :build="billid" @saveSuccess="saveSuccess" @saveSuccessInit="saveSuccessInit"
@flashActive="flashActive"
></router-view>
</div>
</div>
</template>
<script>
import {getApiModuleApi} from "@/api/apiChunks/index.js";
import configData from "./configData";
import { getApiModuleApi } from '@/api/apiChunks/index.js'
import configData from './configData'
//
import masterDataAdd from "./masterDataAdd.vue";
import request from "@/utils/request";
import masterDataAdd from './masterDataAdd.vue'
import request from '@/utils/request'
export default {
@ -41,29 +43,38 @@ export default {
menuActived: 0,
settingMunu: configData.settingMenu,
query: this.$route.query,
name: "",
imgUrl: "",
versionNumber: "",
name: '',
imgUrl: '',
versionNumber: '',
imgLoading: false,
};
billid: ''
}
},
methods: {
//
saveSuccessInit(res, fun) {
console.log(res, 'res')
this.billid = res.attribute.id
this.$refs.routerChunk.billid = this.billid
this.initEditFormData()
fun()
},
flashActive(val) {
this.menuActived = val
},
async initEditFormData() {
const res = await getApiModuleApi({
tl: "mdmService",
as: "mdmService",
dj: "queryMdmModule"
}, {id: this.$route.query.id})
tl: 'mdmModuleService',
as: '',
dj: 'getMdm'
}, { id: this.billid })
if (res.status === '200') {
this.name = res.attribute.mdmName
//logo
this.imgLoading = true
return request({
url: "/kangarooDataCenterV3/entranceController/fileDownloadNew?id=" + res.attribute.mdmLogo,
method: "get",
url: '/kangarooDataCenterV3/entranceController/fileDownloadNew?id=' + res.attribute.mdmLogo,
method: 'get',
responseType: 'arraybuffer'
}).then((res) => {
this.imgLoading = false
@ -72,7 +83,7 @@ export default {
return
}
this.imgUrl =
"data:image/png/jpg;base64," + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ""));
'data:image/png/jpg;base64,' + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ''))
})
}
},
@ -81,25 +92,34 @@ export default {
this.initEditFormData()
},
menuClick(index, item) {
console.log(index, item)
if (index !== 0 && !this.billid) {
this.$vmNews('当前为新增请先新增后再跳转该模块')
return
}
if (item.path && !this.$route.path.includes(item.path)) {
this.menuActived = index;
this.menuActived = index
this.$set(this.query, 'id', this.billid)
this.$router.replace({
name: item.path,
query: this.query
});
})
}
}
},
},
components: {
masterDataAdd,
masterDataAdd
},
created() {
mounted() {
if (this.$route.query.flag !== 'new') {
this.billid = this.$route.query.id
this.initEditFormData()
}
};
}
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.settingMenu {
width: 100%;
display: flex;