主数据配置

This commit is contained in:
hyt 2024-06-20 11:40:09 +08:00
parent 1bff1e9b6e
commit 1f1e28ff6f
19 changed files with 2163 additions and 1142 deletions

View File

@ -0,0 +1 @@
<svg t="1718845590777" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4246" width="200" height="200"><path d="M819.9 472.9L675 723.9l1.7 99.4 86.9-48.3 144.9-251-88.6-51.1zM871.1 384.3L837 443.4l88.6 51.1 34.1-59.1-88.6-51.1zM544.3 703h-288c-17.7 0-32 14.3-32 32s14.3 32 32 32h288c17.7 0 32-14.3 32-32s-14.3-32-32-32zM256.3 511c-17.7 0-32 14.3-32 32s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32h-384zM256.3 319c-17.7 0-32 14.3-32 32s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32h-384zM288 64h64v160h-64zM384 128h128v64H384zM544 64h64v160h-64z" p-id="4247" ></path><path d="M768 864c0 17.7-14.3 32-32 32H160c-17.7 0-32-14.3-32-32V224c0-17.7 14.3-32 32-32h96v-64h-96c-53 0-96 43-96 96v640c0 53 43 96 96 96h576c53 0 96-43 96-96V686.7L768 798v66zM832 224c0-53-43-96-96-96h-96v64h96c17.7 0 32 14.3 32 32v311l64-111.3V224z" p-id="4248"></path></svg>

After

Width:  |  Height:  |  Size: 907 B

View File

@ -106,7 +106,7 @@ const permission = {
{
path: 'dataOrigin',
component: () => import('@/views/masterDataOptions/dataOrigin'),
name: 'dataOrigin',
name: 'masterDataEdit',
hidden: true,
meta: {
title: '',
@ -141,7 +141,16 @@ const permission = {
title: '',
hidden: true
}
}
},
{
path: 'logsDeatil',
name: 'logsDeatil',
component: () => import('@/views/masterDataOptions/logsDeatil'),
meta: {
title: '',
hidden: true
}
},
]
}
})

View File

@ -74,6 +74,33 @@ const addForm = [
},
],
},
{
elCol: [
{
type: "select",
title: "系统类型",
id: "appType",
row: 24,
disabled: false,
required: true,
options: [
{
id: "1",
label: "致远OA",
},
{
id: "2",
label: "用友U8C",
},
{
id: "3",
label: "用友BIP",
},
],
fontSize: 16,
},
],
},
{
elCol: [
{

View File

@ -3,21 +3,6 @@
<div class="menu">
<div class="appInfo">
<div class="img">
<!-- <template v-if="name==='中台'">
<img src="./images/1.png" alt="" style="width: 64px; height: 64px"/>
</template>
<template v-else-if="name==='U8C'">
<img src="./images/2.png" alt="" style="width: 64px; height: 64px"/>
</template>
<template v-else-if="name==='U8'">
<img src="./images/3.png" alt="" style="width: 64px; height: 64px"/>
</template>
<template v-else-if="name==='BIP'">
<img src="./images/4.png" alt="" style="width: 64px; height: 64px"/>
</template>
<template v-else-if="name==='ERP'">
<img src="./images/5.png" alt="" />
</template> -->
<template>
<img :src="imgUrl" alt="" @error="handleImageError" style="width: 64px;"/>
</template>

View File

@ -54,6 +54,9 @@
:tableHeight="'67vh'"
:border="false"
>
<template #data_status="{row}">
{{ data_status_dist[row.data_status] }}
</template>
</BaseTable>
<div class="nextPage">
<BasePage
@ -102,21 +105,61 @@
</template>
</baseDialog>
<!-- 分发任务dialog-->
<baseDialog v-model="sendShow" :footerShow="false">
<baseTable
:tableData="sendTableData"
:tableColumn="sendTableColumn"
>
<template v-slot:status="{row}">
{{ sendDist[row.status] }}
</template>
<template v-slot:fun="{row}">
<el-button v-if="row.status === '1'||row.status === '2'" type="danger" @click="sendRowHandle(row)">删除
<baseDialog width="30%" v-model="sendShow" :footerShow="false" title="分发任务">
<div class="sendBox">
<div class="chunk" style="display: flex;align-items: center;margin: 20px 0;font-size: 16px">
<div class="title">分发</div>
<div class="value" style="margin-left: 20px">
<el-select
v-model="sendCheckboxList"
placeholder="请选择"
>
<el-option
v-for="item in sendTableData"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</div>
</div>
<div class="chunk" style="display: flex;align-items: center;font-size: 16px">
<div class="title">类型</div>
<div class="value" style="margin-left: 20px">
<el-select
v-model="sendCheckboxType"
placeholder="请选择"
>
<el-option
v-for="item in sendTableTypeOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</div>
</div>
<div class="btn" style="display: flex;justify-content: flex-end">
<el-button type="primary" @click="sendRowHandle()">下发
</el-button>
<el-button v-if="row.status === '3'||row.status === '4'" type="primary" @click="sendRowHandle(row)">下发
</el-button>
</template>
</baseTable>
</div>
</div>
<!-- <baseTable-->
<!-- :tableData="sendTableData"-->
<!-- :tableColumn="sendTableColumn"-->
<!-- >-->
<!-- <template v-slot:status="{row}">-->
<!-- {{ sendDist[row.status] }}-->
<!-- </template>-->
<!-- <template v-slot:fun="{row}">-->
<!-- <el-button v-if="row.status === '1'||row.status === '2'" type="danger" @click="sendRowHandle(row)">删除-->
<!-- </el-button>-->
<!-- <el-button v-if="row.status === '3'||row.status === '4'" type="primary" @click="sendRowHandle(row)">下发-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </baseTable>-->
</baseDialog>
</div>
</template>
@ -232,7 +275,29 @@ export default {
},
treeData: [],
treeActiveRow: {},
treeSelectInfo: {}
treeSelectInfo: {},
data_status_dist: {
'Y': '正常',
'F': '修改',
'N': '删除'
},
sendCheckboxList: '',//
sendCheckboxType: '',
sendTableTypeOptions: [
{
id: 1,
name: '新增'
},
{
id: 2,
name: '修改'
},
{
id: 3,
name: '删除'
}
],
rowId: ''
}
},
methods: {
@ -704,7 +769,7 @@ export default {
}
this.dialogTabaleInfo.push({ ...tempObj })
})
console.log(this.dialogTabaleInfo,'dialogTabaleInfo')
console.log(this.dialogTabaleInfo, 'dialogTabaleInfo')
//
const data = await getUserModuleApi({
tl: 'mdmService',
@ -720,7 +785,7 @@ export default {
table.tableData = []
table.tableData = data.attribute[table.name] || []
})
console.log(this.dialogTabaleInfo,'dialogTabaleInfo')
console.log(this.dialogTabaleInfo, 'dialogTabaleInfo')
}
this.dialogShow = true
}
@ -770,19 +835,25 @@ export default {
},
//
async sendHandle(id) {
console.log(id)
const res = await getUserModuleApi({
tl: 'mdmService',
as: 'mdmService',
dj: 'queryMdmShowDistribute'
tl: 'mdmModuleService',
as: '',
dj: 'queryMdmDistributeByMdmCode'
}, {
mdmCode: this.$route.meta.mdmCode,
id: id
'enabledState': '1',//
'enabledType': '0'//
})
this.sendTableData = res.attribute
console.log(this.sendTableData, 'this.sendTableData')
this.sendTableData.forEach(item => {
this.$set(item, 'rowId', id)
this.appSearch(item.appId, item)
})
this.rowId = id
this.sendCheckboxType=''
this.sendCheckboxList=''
this.sendShow = true
},
//
@ -798,24 +869,28 @@ export default {
},
//dialog
async sendRowHandle(row) {
let status = row.status === '1' ? 1 : 2
if (row.status === '2') {
this.$vmNews('发送中,请等待发送完成,再删除', 'warning')
return
}
console.log(row)
// let status = row.status === '1' ? 1 : 2
// if (row.status === '2') {
// this.$vmNews('', 'warning')
// return
// }
// console.log(row)
const res = await getUserModuleApi({
tl: 'mdmService',
as: 'mdmService',
as: '',
dj: 'doMdmDistribute'
}, {
mdmCode: this.$route.meta.mdmCode,
appID: row.appId,
id: row.rowId,
dataType: status
id: this.rowId,
distributeId: this.sendCheckboxList,
type: this.sendCheckboxType
})
this.$vmNews(`${res.msg}`, 'success')
this.sendHandle(row.rowId)
this.sendCheckboxList = ''
this.sendCheckboxType = ''
this.sendShow = false
this.rowId = ''
// this.sendHandle(row.rowId)
}
},
created() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -1,46 +1,38 @@
<template>
<div class="wrap">
<div class="btn">
<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
>
</div>
</div>
<div class="main" v-loading="mainLoading">
<baseTable :tableData="tableData" :tabLoading="tabLoading"
:funData="funData"
@onFunc="onFunc"
:tableColumn="tableColumn" :border="false">
<template #roleId="{row}">
<el-select v-model="row['roleId']" placeholder="请选择" style="width: 80%">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
:tableColumn="tableColumn" :border="false"
>
<!-- 来源类型-->
<template #sourceType="{row}">
{{ row.sourceType == 1 ? '插件' : 'api' }}
</template>
<template #checkBox="{row}">
<el-checkbox v-model="row[item.buttonType]" v-for="item in checkArr"
:label="item.buttonType" :key="item.buttonType">{{ item.buttonName }}
</el-checkbox>
<!-- 触发类型-->
<template #triggerType="{row}">
{{ row.triggerType == 0 ? '手动' : '自动' }}
</template>
<!-- 启用/停用-->
<template #enabledState="{row}">
<el-switch
:disabled="true"
v-model="row.enabledState"
active-value="1"
inactive-value="0"
>
</el-switch>
</template>
<!-- 操作-->
<template #operation="{row}">
<div class="btnList">
<div class="settingBtn" @click="sonTableEditHandle(row)">
<img src="./images/设置.png" alt="">
</div>
<div class="deleBtn" @click="activedOnFunc(row)">
<img src="./images/删除.png" alt="">
</div>
</div>
</template>
</baseTable>
<div class="receiptsAddRow">
@ -53,30 +45,39 @@
>
</div>
</div>
<baseRightDialog ref="settingForm"
:footerShow="true"
:dialogVisible.sync="settingFormShow"
title="数据来源"
@handleClose="settingFormShow=false"
:submitShow="true"
:size="'50%'"
@handleConfirmClick="sonTableSaveHandle"
>
<settingForm ref="settingForm" v-if="settingFormShow" @saveSuccessHandle="saveSuccessHandle"></settingForm>
</baseRightDialog>
</div>
</template>
<script>
import baseNewSelect from "@/views/applicationList/com/baseNewSelect.vue";
import baseDialog from "@/views/integrationOption/compoments/baseDialog";
import BaseTable from "@/views/intergrationTask/compoments/baseTable.vue";
import baseNewForm from "@/views/intergrationTask/compoments/baseNewForm";
import {getApiModuleApi} from "@/api/apiChunks";
import {deepClone} from "@/utils/index.js";
import {getUserModuleApi} from "@/api/integrationOption/integrationOption";
import basePage from "@/views/intergrationTask/compoments/basePage.vue";
import settingForm from './settingForm.vue'
import baseRightDialog from '@/components/base/baseRightDialog/index.vue'
import baseNewSelect from '@/views/applicationList/com/baseNewSelect.vue'
import baseDialog from '@/views/integrationOption/compoments/baseDialog'
import BaseTable from '@/views/intergrationTask/compoments/baseTable.vue'
import baseNewForm from '@/views/intergrationTask/compoments/baseNewForm'
import { getApiModuleApi } from '@/api/apiChunks'
import { deepClone } from '@/utils/index.js'
import { getUserModuleApi } from '@/api/integrationOption/integrationOption'
import basePage from '@/views/intergrationTask/compoments/basePage.vue'
import { authApi } from '@/api/apis/auth'
export default {
data() {
return {
mainLoading: false,
saveLoading: false,
funData: [
{
text: "删除",
color: "red"
}
],
options: [],
//
roleDist: {},
@ -84,115 +85,154 @@ export default {
tabLoading: false,
tableColumn: [
{
title: "角色名称",
id: "roleId",
width: 300,
title: '来源类型',
id: 'sourceType'
},
{
title: "按钮权限配置",
id: "checkBox",
}
title: '来源应用',
id: 'appName'
},
{
title: '触发类型',
id: 'triggerType'
},
{
title: '来源编码',
id: 'sourceCodeName'
},
{
title: '新增接口',
id: 'addName'
},
{
title: '修改接口',
id: 'updateName'
},
{
title: '删除接口',
id: 'deleteName'
},
{
title: '启用/停用',
id: 'enabledState'
},
{ title: '操作', id: 'operation' }
],
tableData: [],
pageModel: {
pageIndex: 1,
total: 10,
limit: 10,
limit: 10
},
addRole: "",
checkArrDist: {
new: {
buttonName: "新建",
buttonType: "new"
},
contrast: {
buttonName: "档案对照",
buttonType: "contrast"
},
resize: {
buttonName: "重置",
buttonType: "resize"
},
search: {
buttonName: "查询",
buttonType: "search"
},
edit: {
buttonName: "修改",
buttonType: "edit"
},
dele: {
buttonName: "删除",
buttonType: "dele"
},
view: {
buttonName: "查看",
buttonType: "view"
},
send: {
buttonName: "下发",
buttonType: "send"
},
},
checkArr: [
{
buttonName: "新建",
buttonType: "new"
}, {
buttonName: "重置",
buttonType: "resize"
}, {
buttonName: "查询",
buttonType: "search"
}, {
buttonName: "修改",
buttonType: "edit"
}, {
buttonName: "删除",
buttonType: "dele"
}, {
buttonName: "查看",
buttonType: "view"
}, {
buttonName: "下发",
buttonType: "send"
},
]
};
addRole: '',
settingFormShow: false,
serviceOptions: []
}
},
methods: {
onFunc(row) {
this.tableData.splice(row.index, 1)
},
addRowHandle() {
this.tableData.push({})
///
saveSuccessHandle() {
this.settingFormShow = false
this.getTableData()
},
//
async initSelect() {
const res = await getApiModuleApi({
tl: "roleService",
as: "role",
dj: "queryAll",
})
console.log(res, '角色')
if (res.status === '200') {
this.options = []
res.attribute.forEach(item => {
this.$set(this.roleDist, item.id, item.roleName)
this.options.push({
label: item.roleName,
value: item.id
})
const res = await authApi('sysApplicationService', '', 'queryEntity', '', {})
console.log(res)
this.serviceOptions.options = []
res.attribute.forEach(item => {
this.serviceOptions.push({
id: item.id,
label: item.name
})
console.log(this.options)
}
})
return true
},
//tableData
async getTableData() {
const res = await authApi('mdmModuleService', '', 'queryMdmSource', '', {
mdmId: this.$route.query.id
})
this.tableData = res.attribute
console.log(this.tableData, 'table')
//
this.tableData.forEach(async(item) => {
console.log('???', this.serviceOptions)
let obj = this.serviceOptions.find(ele => {
return ele.id === item.sourceName
})
this.$set(item, 'appName', obj.label)
let labelDist = {}
let plugInDist = {}
const res2 = await authApi('sysApplicationApiService', '', 'queryEntity', '', {
appId: item.appId
})
res2.attribute.forEach((item) => {
labelDist[item.id] = item.apiName
})
if (item.deleteApi) {
this.$set(item, 'deleteName', labelDist[item.deleteApi])
}
if (item.updateApi) {
this.$set(item, 'updateName', labelDist[item.updateApi])
}
if (item.addApi) {
this.$set(item, 'addName', labelDist[item.addApi])
}
if (item.sourceType == 2 && item.sourceCode) {
this.$set(item, 'sourceCodeName', labelDist[item.sourceCode])
}
//
if (item.sourceType == 1 && item.sourceCode) {
this.openLoading('detail')
const res = await authApi('sysApplicationPluginService', '', 'queryEntity', '', {
appId: item.sourceName
})
res.attribute.forEach((item) => {
plugInDist[item.id] = item.pluginName
})
this.$set(item, 'sourceCodeName', plugInDist[item.sourceCode])
}
})
},
//
sonTableSaveHandle() {
this.$refs.settingForm.$refs.typeOptionForm.submitForm()
},
//
sonTableEditHandle(row) {
this.settingFormShow = true
this.$nextTick(() => {
this.$refs.settingForm.getrowDetails(row.id)
})
},
//
activedOnFunc(row) {
this.$confirm('确定删除?')
.then(async(_) => {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'deleteMdmSource', '', {
id: row.id
})
this.$vmNews('删除成功', 'success')
this.getTableData()
})
.catch((_) => {
})
},
//
addRowHandle() {
this.settingFormShow = true
},
async init() {
this.mainLoading = true
const res = await getApiModuleApi({
tl: "mdmService",
as: "mdmService",
dj: "queryMdmModuleRule",
}, {id: this.$route.query.id})
tl: 'mdmService',
as: 'mdmService',
dj: 'queryMdmModuleRule'
}, { id: this.$route.query.id })
res.attribute.forEach(item => {
item.mdmModuleRoleButtonEntities.forEach(ele => {
item[ele.buttonType] = true
@ -203,7 +243,7 @@ export default {
},
//close
dialogCloseHandle() {
this.addRole = ""
this.addRole = ''
},
//add
addHandle() {
@ -211,49 +251,9 @@ export default {
},
//
currentChangeHandle(pageModel) {
this.pageModel = pageModel;
this.pageModel = pageModel
this.$nextTick(() => {
});
},
async saveHandle() {
let params = {
id: this.$route.query.id,
mdmModuleRoleEntities: []
}
let temp = []
let flag = this.tableData.some(item => {
console.log(item)
if (temp.includes(item.roleId)) {
this.$vmNews("禁止选择相同角色", 'warning')
return true
}
temp.push(item.roleId)
if (item.roleId) {
let tempObj = {
roleId: item.roleId,
mdmModuleRoleButtonEntities: [],
}
Object.keys(item).forEach(ele => {
if (this.checkArrDist[ele] && item[ele]) {
tempObj.mdmModuleRoleButtonEntities.push(this.checkArrDist[ele])
}
})
params.mdmModuleRoleEntities.push(tempObj)
}
})
if (flag) return
this.saveLoading = true
const res = await getUserModuleApi({
tl: "mdmService",
as: "mdmService",
dj: "doSaveMdmModuleRule",
}, params)
if (res.status === '200') {
this.$vmNews("保存成功", 'success')
this.init()
this.$store.dispatch("GenerateRoutes")
}
this.saveLoading = false
}
},
@ -262,14 +262,18 @@ export default {
BaseTable,
baseDialog,
baseNewSelect,
basePage
basePage,
baseRightDialog,
settingForm
},
created() {
this.initSelect()
this.init()
this.$emit("flashActive", 3)
},
};
this.initSelect().then(() => {
this.getTableData()
})
this.$emit('flashActive', 3)
}
}
</script>
<style scoped lang="scss">
@ -333,4 +337,43 @@ footer {
align-items: center;
}
}
.btnList {
display: flex;
align-items: center;
justify-content: center;
.settingBtn {
cursor: pointer;
width: 24px;
height: 24px;
background: #EBEBED;
border-radius: 6px;
display: flex;
justify-content: center;
align-items: center;
> img {
width: 10px;
height: 10px;
}
}
.deleBtn {
cursor: pointer;
margin-left: 10px;
width: 24px;
height: 24px;
background: #EBEBED;
border-radius: 6px;
display: flex;
justify-content: center;
align-items: center;
> img {
width: 10px;
height: 10px;
}
}
}
</style>

View File

@ -0,0 +1,370 @@
<template>
<div class="settingForm">
<baseNewForm
ref="typeOptionForm"
:spanNumber="18"
:isFunBtn="false"
:formRow="formRow"
:ruleForm="ruleForm"
:labelPosition="'top'"
@onSelect="typeSelectChangeHanlde"
@onSubmit="typeOptionOnSubmit"
>
</baseNewForm>
</div>
</template>
<script>
import baseNewForm from '../compoments/baseNewForm'
import BaseTable from '@/views/intergrationTask/compoments/baseTable.vue'
import { authApi } from '@/api/apis/auth'
import { getApiModuleApi } from '@/api/apiChunks'
import { retrieveRawAttr } from 'echarts/lib/data/helper/dataProvider'
export default {
name: 'settingForm',
data() {
return {
formRow: [
{
elCol: [
{
type: 'select',
title: '来源类型',
id: 'sourceType',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: [
{
label: '插件',
id: '1'
},
{
label: 'api',
id: '2'
}
]
}
]
},
{
elCol: [
{
type: 'select',
title: '来源应用',
id: 'sourceName',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '来源编码',
id: 'sourceCode',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '触发类型',
id: 'triggerType',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: [
{
label: '手动',
id: '0'
},
{
label: '自动',
id: '1'
}
]
}
]
},
{
elCol: [
{
type: 'select',
title: '新增接口',
id: 'addApi',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '修改接口',
id: 'updateApi',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '删除接口',
id: 'deleteApi',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
{
elCol: [
{
type: 'switch',
title: '启用/停用',
id: 'enabledState',
row: 24,
disabled: false,
required: true,
fontSize: 16,
activeValue: '1',
inactiveValue: '0'
}
]
}
],
ruleForm: {},
tableId: '',//
mainLoading: false,
tabLoading: false,
serviceOptions: [],//
labelOptions: [],//
labelDist: {}//
}
},
methods: {
// filedName
filedIdChangHandle(val, row) {
row.filedName = this.labelDist[val]
},
//
async initSelect() {
//
this.serviceOptions = []
this.openLoading('detail')
const service = await getApiModuleApi({
tl: 'mdmModuleService',
as: '',
dj: 'queryMdmService'
}, { remark: '' })
service.attribute.forEach(item => {
console.log(item.dbName, 'item')
this.serviceOptions.push({
id: item.id,
label: item.remark,
dbId: item.id,
mdmId: item.mdmId
})
})
console.log(this.serviceOptions, 'this.serviceOptions')
},
async typeSelectChangeHanlde(val, index, indexRow, row, flag = true) {
if (flag && (row.id === 'sourceName' || row.id === 'sourceType')) {
if (row.id === 'sourceType') {
this.formRow[2].elCol[0].options = []
this.$set(this.ruleForm, 'sourceCode', '')
} else {
this.formRow[2].elCol[0].options = []
this.formRow[4].elCol[0].options = []
this.formRow[5].elCol[0].options = []
this.formRow[6].elCol[0].options = []
this.$set(this.ruleForm, 'addApi', '')
this.$set(this.ruleForm, 'updateApi', '')
this.$set(this.ruleForm, 'deleteApi', '')
this.$set(this.ruleForm, 'sourceCode', '')
}
}
//appidapp
if ((row.id === 'sourceName' || row.id === 'sourceType') && this.ruleForm.sourceName) {
this.openLoading('detail')
const res = await authApi('sysApplicationApiService', '', 'queryEntity', '', {
appId: this.ruleForm.sourceName
})
res.attribute.forEach((item) => {
this.formRow[4].elCol[0].options.push({
id: item.id,
label: item.apiName
})
this.formRow[5].elCol[0].options.push({
id: item.id,
label: item.apiName
})
this.formRow[6].elCol[0].options.push({
id: item.id,
label: item.apiName
})
if (this.ruleForm.sourceType == 2) {
this.formRow[2].elCol[0].options.push({
id: item.id,
label: item.apiName
})
}
})
//
if (this.ruleForm.sourceType == 1) {
this.openLoading('detail')
const res = await authApi('sysApplicationPluginService', '', 'queryEntity', '', {
appId: this.ruleForm.sourceName
})
res.attribute.forEach((item) => {
this.formRow[2].elCol[0].options.push({
id: item.id,
label: item.pluginName
})
})
}
}
},
//
async typeOptionOnSubmit() {
let params = {
...this.ruleForm,
dbId: this.tableId,
mdmId: this.$route.query.id
}
if (params.id) {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'updateMdmSource', '', params)
this.$vmNews('保存成功', 'success')
this.$emit('saveSuccessHandle')
} else {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'saveMdmSource', '', params)
this.$vmNews('保存成功', 'success')
this.$emit('saveSuccessHandle')
}
},
//
async getAppList() {
this.openLoading('detail')
const res = await authApi('sysApplicationService', '', 'queryEntity', '', {})
this.formRow[1].elCol[0].options = []
res.attribute.forEach(item => {
this.formRow[1].elCol[0].options.push({
id: item.id,
label: item.name
})
})
},
//
async getrowDetails(id) {
this.openLoading('detail')
const res = await authApi('mdmModuleService', '', 'getMdmSource', '', {
id
})
this.ruleForm = res.attribute
this.typeSelectChangeHanlde(this.ruleForm.appId, 0, 0, { id: 'sourceName' }, false)
}
},
created() {
this.getAppList()
this.initSelect()
},
components: {
BaseTable,
baseNewForm
}
}
</script>
<style scoped lang="scss">
.bigTitle {
border-top: 1px solid #EBEBEB;
padding-top: 20px;
font-family: PingFangSC, PingFang SC;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 22px;
text-align: left;
font-style: normal;
}
.tableName {
display: flex;
align-items: center;
margin: 30px 0;
.title {
margin-right: 20px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 20px;
text-align: left;
font-style: normal;
}
}
.receiptsAddRow {
margin-top: 30px;
border: 1px dotted #ccc;
text-align: center;
height: 50px;
line-height: 50px;
}
.btnList {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
.deleBtn {
cursor: pointer;
margin-left: 10px;
width: 24px;
height: 24px;
background: #EBEBED;
border-radius: 6px;
display: flex;
justify-content: center;
align-items: center;
> img {
width: 10px;
height: 10px;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@ const tableColumn = [
id: 'mdmName',
title: '主数据名称',
align: 'left',
width:130,
width: 130
},
{
id: 'mdmTypeName',
@ -78,16 +78,21 @@ const settingMenu = [
icon: 'masterDataMenu03',
path: 'displayInfo'
},
// {
// title: "配置权限",
// icon: "masterDataMenu04",
// path: "authorily"
// },
{
title: '分发权限',
title: '数据来源',
icon: 'masterDataMenu04',
path: 'authorily'
},
{
title: '分发设置',
icon: 'masterDataMenu05',
path: 'distribute'
}
},
{
title: '日志',
icon: 'masterDataMenu06',
path: 'logsDeatil'
},
]
const configData = {
addForm,

View File

@ -466,7 +466,6 @@ export default {
},
//
async sonSaveHandle(params) {
console.log('进来了')
if (params.id) {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'updateMdmDbField', '', params)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -1,61 +1,34 @@
<template>
<div class="wrap">
<div class="btn">
<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"
>保存
</el-button
>
</div>
</div>
<div class="main">
<!-- <div class="btn">-->
<!-- <el-button icon="el-icon-plus" type="primary" @click="addHandle">新增</el-button>-->
<!-- </div>-->
<baseTable @onFunc="onFunc" :tableData="tableData" :tabLoading="tabLoading"
:tableColumn="tableColumn" :funData="funData" :border="false"
<div class="main" v-loading="mainLoading">
<baseTable :tableData="tableData" :tabLoading="tabLoading"
:tableColumn="tableColumn" :border="false"
>
<template #appId="{row}">
<baseNewSelect v-model="row['appId']" :itemObj="{label:'name',value:'id'}"
@seleChange="(val)=>seleChangeHanlde(val,row,'main')"
></baseNewSelect>
<!-- 触发类型-->
<template #enabledType="{row}">
{{ row.enabledType == 0 ? '手动' : '自动' }}
</template>
<template #addApi="{row}">
<div class="line" flex>
<baseNewSelect v-model="row['addApi']" :itemObj="{label:'apiName',value:'id'}"
:appId="row['appId']" :flag="true"
@seleChange="(val)=>seleChangeHanlde(val,row,'addApi')"
></baseNewSelect>
<el-button :disabled="!row['addApi']" @click="configurationHanlde(row,row['addApi'],'addApi')"
icon="el-icon-edit" type="primary"
></el-button>
</div>
<!-- 启用/停用-->
<template #enabledState="{row}">
<el-switch
:disabled="true"
v-model="row.enabledState"
active-value="1"
inactive-value="0"
>
</el-switch>
</template>
<template #deleteApi="{row}">
<div class="line" flex>
<baseNewSelect v-model="row['deleteApi']" :itemObj="{label:'apiName',value:'id'}"
:appId="row['appId']" :flag="true"
@seleChange="(val)=>seleChangeHanlde(val,row,'deleteApi')"
></baseNewSelect>
<el-button :disabled="!row['deleteApi']" @click="configurationHanlde(row,row['deleteApi'],'deleteApi')"
icon="el-icon-edit" type="primary"
></el-button>
<!-- 操作-->
<template #operation="{row}">
<div class="btnList">
<div class="settingBtn" @click="sonTableEditHandle(row)">
<img src="./images/设置.png" alt="">
</div>
<div class="deleBtn" @click="activedOnFunc(row)">
<img src="./images/删除.png" alt="">
</div>
</div>
</template>
</baseTable>
<div class="receiptsAddRow">
@ -68,83 +41,25 @@
>
</div>
</div>
<footer>
</footer>
<baseDialog v-model="addSwitch" @close="dialogCloseHandle" :width="dialogWidth" @confirm="confirmHandle">
<div class="addBox" v-if="addSwitch">
<div class="title">
使用类型
</div>
<div class="radioList">
<el-radio-group v-model="addType" @change="typeChangHandle">
<el-radio label="1">使用插件</el-radio>
<el-radio label="2">连线</el-radio>
</el-radio-group>
</div>
<div class="content">
<template v-show="addType==='1'">
<div class="wrapContent" v-show="addType==='1'">
<div class="chunk">
<div class="label">使用插件</div>
<div class="select">
<el-select v-model="plugIn" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.id"
:label="item.pluginName"
:value="item.id"
>
</el-option>
</el-select>
</div>
</div>
</div>
</template>
<template v-show="addType==='2'">
<div class="wrapContent" v-show="addType==='2'">
<div class="title">链接对照表</div>
<div class="link">
<div class="left">
<baseLink
v-loading="linkloading"
ref="link"
:lookFlag="lookFlag"
:leftData="linkData.leftData"
:rightData="linkData.rightData"
@linechange="getLineData"
:lineData="linkData.lineData"
></baseLink>
</div>
<div class="right">
<div class="title">
<h1 style="font-size: 16px">连接结果</h1>
</div>
<div>
<div
v-for="item in linkData.lineData"
:key="item.leftid"
class="result"
>
<div class="left" :style="{ color: item.stroke }">
{{ item.leftTitle }}
</div>
<div class="middle">-</div>
<div class="right" :style="{ color: item.stroke }">
{{ item.rightTitle }}
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</div>
</div>
</baseDialog>
<baseRightDialog ref="settingForm"
:footerShow="true"
:dialogVisible.sync="settingFormShow"
title="分发设置"
@handleClose="settingFormShow=false"
:submitShow="true"
:size="'50%'"
@handleConfirmClick="sonTableSaveHandle"
>
<settingForm ref="settingForm" v-if="settingFormShow" @saveSuccessHandle="saveSuccessHandle"></settingForm>
</baseRightDialog>
</div>
</template>
<script>
import settingForm from './settingForm.vue'
import baseRightDialog from '@/components/base/baseRightDialog/index.vue'
import baseNewSelect from '@/views/applicationList/com/baseNewSelect.vue'
import baseDialog from '@/views/integrationOption/compoments/baseDialog'
import BaseTable from '@/views/intergrationTask/compoments/baseTable.vue'
import baseNewForm from '@/views/intergrationTask/compoments/baseNewForm'
@ -152,385 +67,194 @@ import { getApiModuleApi } from '@/api/apiChunks'
import { deepClone } from '@/utils/index.js'
import { getUserModuleApi } from '@/api/integrationOption/integrationOption'
import basePage from '@/views/intergrationTask/compoments/basePage.vue'
import baseLink from './baseLink/index.vue'
import baseNewSelect from './baseNewSelect.vue'
import { authApi } from '@/api/apis/auth'
export default {
data() {
return {
appOptions: [],
addApiOptions: [],
deleApiOptopns: [],
options: [],//op
plugIn: '',//
addSwitch: false, //dialog
tabLoading: false, // tableloading
tableColumn: [ //table
mainLoading: false,
saveLoading: false,
options: [],
//
roleDist: {},
addSwitch: false,
tabLoading: false,
tableColumn: [
{
title: '应用列表',
id: 'appId'
id: 'appName'
},
{
title: '触发类型',
id: 'enabledType'
},
{
title: '新增接口',
id: 'addApi'
id: 'addName'
},
{
title: '修改接口',
id: 'updateName'
},
{
title: '删除接口',
id: 'deleteApi'
}
id: 'deleteName'
},
{
title: '数据权限',
id: 'permission',
tooltip: true
},
{
title: '启用/停用',
id: 'enabledState'
},
{ title: '操作', id: 'operation' }
],
tableData: [], //table
pageModel: { //page
tableData: [],
pageModel: {
pageIndex: 1,
total: 10,
limit: 10
},
funData: [ //table
{ text: '删除', color: '#e44b2d' }
],
addType: '1', //使
linkloading: false, //linkloading
lookFlag: false, //
linkData: { //线
leftData: [
{ label: 1, id: 1 },
{ label: 1, id: 2 },
{ label: 1, id: 3 },
{ label: 1, id: 4 },
{ label: 1, id: 5 }
],
leftDataCopy: [{ label: 1, id: 1 },
{ label: 1, id: 2 },
{ label: 1, id: 3 },
{ label: 1, id: 4 },
{ label: 1, id: 5 }],
rightData: [{ label: 1, id: 6 },
{ label: 1, id: 7 },
{ label: 1, id: 8 },
{ label: 1, id: 9 },
{ label: 1, id: 10 }],
rightDataCopy: [{ label: 1, id: 6 },
{ label: 1, id: 7 },
{ label: 1, id: 8 },
{ label: 1, id: 9 },
{ label: 1, id: 10 }],
lineData: []
},
dialogWidth: '40%',
activedRow: {},
activedType: ''
addRole: '',
settingFormShow: false,
serviceOptions: []
}
},
methods: {
onFunc(row) {
this.tableData.splice(row.index, 1)
},
confirmHandle() {
//addTypedeleteTypeaddListdeleteListaddPlugdeletePlug
if (this.addType === '1' && !this.plugIn) {
this.$vmNews('请选择使用插件', 'warning')
return
}
if (this.addType === '2' && !this.linkData.lineData.length) {
this.$vmNews('请配置链接对照表', 'warning')
return
}
if (this.activedType === 'addApi') {
this.$set(this.activedRow, 'addType', this.addType)
if (this.addType === '1') {
this.$set(this.activedRow, 'addPlug', this.plugIn)
} else {
let arr = []
this.linkData.lineData.forEach((item) => {
//2 线
let tempObj = {}
tempObj['sourceFeld'] = item['leftTitle'].split('.').slice(-1)
tempObj['sourceName'] = item['leftTitle']
tempObj['sourcePath'] = item['leftTitle']
tempObj['targetField'] = item['rightTitle'].split('.').slice(-1)
tempObj['targetPath'] = item['rightTitle']
tempObj['sourceFieldPath'] = JSON.stringify(item['leftidarr'])
tempObj['targetFieldPath'] = JSON.stringify(item['rightidarr'])
tempObj['coordinate'] = JSON.stringify(item)
arr.push(tempObj)
})
this.$set(this.activedRow, 'addList', arr)
}
} else {
this.$set(this.activedRow, 'deleteType', this.addType)
if (this.addType === '1') {
this.$set(this.activedRow, 'deletePlug', this.plugIn)
} else {
let arr = []
this.linkData.lineData.forEach((item) => {
//2 线
let tempObj = {}
tempObj['sourceField'] = item['leftTitle'].split('.').slice(-1)
tempObj['sourceName'] = item['leftTitle']
tempObj['sourcePath'] = item['leftTitle']
tempObj['targetField'] = item['rightTitle'].split('.').slice(-1)
tempObj['targetPath'] = item['rightTitle']
tempObj['sourceFieldPath'] = JSON.stringify(item['leftidarr'])
tempObj['targetFieldPath'] = JSON.stringify(item['rightidarr'])
tempObj['coordinate'] = JSON.stringify(item)
arr.push(tempObj)
})
this.$set(this.activedRow, 'deleteList', arr)
}
}
this.addSwitch = false
},
lineDataHandle(targetid, arr, saveName, saveId) {
arr.some((item) => {
if (item.id === targetid) {
this.$set(item, 'value', true)
this.$set(item, 'isline', true)
this.$set(item, saveName, saveId)
return true
} else if (item.children && item.children.length) {
this.lineDataHandle(targetid, item.children, saveName, saveId)
return false
}
})
},
//
selectDataHanlde(resultArr, arr) {
arr.forEach((item) => {
let obj = {}
resultArr.push(obj)
obj['label'] = item.parameterName
obj['id'] = item.id
obj['type'] = item.concreteType
if (item.children) {
obj['children'] = []
this.selectDataHanlde(obj['children'], item.children)
}
})
},
//
async configurationHanlde(row, val, key) {
this.activedRow = row
this.activedType = key
let dist = {
addApi: ['addType', 'addList', 'addPlug'],
deleteApi: ['deleteType', 'deleteList', 'deletePlug']
}
this.addType = row[dist[key][0]] || '1'
if (this.addType === '1') {
this.plugIn = row[dist[key][2]]
} else {
this.dialogWidth = '90%'
}
const res = await getUserModuleApi({
tl: 'sysApplicationService',
as: '',
dj: 'queryPlugAndApi'
}, {
id: val,
appId: row['appId']
})
const res1 = await getApiModuleApi(
{
tl: 'sysApplicationService',
as: '',
dj: 'queryPlugAndApi'
},
{ id: val, appId: row['appId'] }
)
let tempArr = []
//
this.options = res.attribute.app
let bodyIn = JSON.parse(res.attribute.api.bodyIn)
if (bodyIn[0] && bodyIn[0].children) {
this.selectDataHanlde(tempArr, bodyIn[0].children)
}
this.linkData.rightData = tempArr
//
// res1.attribute.para.forEach(item => {
// if (item.interfaceType === '2') {
// this.linkData.rightData.push({
// label: item.interfaceKey,
// id: item.id
// })
// }
//
// })
if (row[dist[key][1]] && row[dist[key][1]].length) {
this.linkData.lineData = []
row[dist[key][1]].forEach(item => {
//
let leftArr = JSON.parse(item.sourceFieldPath)
let saveId = leftArr[leftArr.length - 1]
let rightArr = JSON.parse(item.targetFieldPath)
let targetid = rightArr[rightArr.length - 1]
this.lineDataHandle(
targetid,
this.linkData.rightData,
'leftid',
saveId
)
this.lineDataHandle(
saveId,
this.linkData.leftData,
'rightid',
targetid
)
if (item.coordinate) {
this.linkData.lineData.push(JSON.parse(item.coordinate))
}
})
}
this.addSwitch = true
this.$nextTick(() => {
this.$refs.link.line = deepClone(this.linkData.lineData)
this.$refs.link.resizeHeight()
})
},
seleChangeHanlde(val, row, key) {
let dist = {
addApi: ['addType', 'addList', 'addPlug'],
deleteApi: ['deleteType', 'deleteList', 'deletePlug']
}
if (key === 'main') {
this.$set(row, 'addApi', '')
this.$set(row, 'deleteApi', '')
} else {
this.$set(row, dist[key][0], '')
this.$set(row, dist[key][1], [])
this.$set(row, dist[key][2], '')
}
},
addRowHandle() {
this.tableData.push({})
///
saveSuccessHandle() {
this.settingFormShow = false
this.getTableData()
},
//
async initSelect() {
const plugRes = await getUserModuleApi({
tl: 'pluginService',
as: 'plugins',
dj: 'queryPluginsByType'
}, {
'pluginType': '1'
const res = await authApi('sysApplicationService', '', 'queryEntity', '', {})
console.log(res)
this.serviceOptions.options = []
res.attribute.forEach(item => {
this.serviceOptions.push({
id: item.id,
label: item.name
})
})
// console.log(plugRes.attribute, 'plugRes.attribute')
// this.options = plugRes.attribute
return true
},
//tableData
async getTableData() {
const res = await authApi('mdmModuleService', '', 'queryMdmDistribute', '', {
mdmId: this.$route.query.id
})
this.tableData = res.attribute
console.log(this.tableData, 'table')
//
//
let compareTypeDist = {
'1': '=',
'2': '!=',
'3': '>',
'4': '<'
}
let connectionSymbolDist = {
'1': 'and',
'2': 'or'
}
this.tableData.forEach(async(item) => {
this.$set(item, 'permission', '')
//
let obj = this.serviceOptions.find(ele => {
console.log(ele.id, item.appId, '13')
return ele.id === item.appId
})
this.$set(item, 'appName', obj.label)
let labelDist = {}
const res2 = await authApi('sysApplicationApiService', '', 'queryEntity', '', {
appId: item.appId
})
res2.attribute.forEach((item) => {
labelDist[item.id] = item.apiName
})
if (item.deleteApi) {
this.$set(item, 'deleteName', labelDist[item.deleteApi])
}
if (item.updateApi) {
this.$set(item, 'updateName', labelDist[item.updateApi])
}
if (item.addApi) {
this.$set(item, 'addName', labelDist[item.addApi])
}
//
item.mdmModuleDistributeDetailEntities.forEach(ele => {
console.log(ele, 'ele')
let leftBracket = ele.leftBracket ? ele.leftBracket : ''
let rightParenthesis = ele.rightParenthesis ? ele.rightParenthesis : ''
let compareType = compareTypeDist[ele.compareType]
let connectionSymbol = connectionSymbolDist[ele.connectionSymbol] ? connectionSymbolDist[ele.connectionSymbol] : ''
item.permission += leftBracket + ele.filedId + ' ' + compareType + ' ' + ele.filedVaule + rightParenthesis + ' ' + connectionSymbol + ' '
})
})
},
//
sonTableSaveHandle() {
this.$refs.settingForm.$refs.typeOptionForm.submitForm()
},
//
sonTableEditHandle(row) {
this.settingFormShow = true
this.$nextTick(() => {
this.$refs.settingForm.getrowDetails(row.id)
})
},
//
activedOnFunc(row) {
this.$confirm('确定删除?')
.then(async(_) => {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'deleteMdmDistribute', '', {
id: row.id
})
this.$vmNews('删除成功', 'success')
this.getTableData()
})
.catch((_) => {
})
},
//
addRowHandle() {
this.settingFormShow = true
},
async init() {
const res = await getUserModuleApi({
this.mainLoading = true
const res = await getApiModuleApi({
tl: 'mdmService',
as: 'mdmService',
dj: 'queryMdmModuleDistribute'
}, {
id: this.$route.query.id
})
if (res.status === '200') {
this.tableData = res.attribute
}
},
async initLeftLink() {
const res = await getUserModuleApi({
tl: 'mdmService',
as: 'mdmService',
dj: 'queryMdmShowAll'
dj: 'queryMdmModuleRule'
}, { id: this.$route.query.id })
if (res.status === '200') {
let arr = []
res.attribute.forEach(item => {
arr.push({
label: item.name,
id: item.id
})
res.attribute.forEach(item => {
item.mdmModuleRoleButtonEntities.forEach(ele => {
item[ele.buttonType] = true
})
this.linkData.leftData = deepClone(arr)
this.linkData.leftDataCopy = deepClone(arr)
}
})
this.mainLoading = false
this.tableData = res.attribute
},
//使
typeChangHandle(val) {
if (val == 2) {
this.dialogWidth = '95%'
this.$nextTick(() => {
this.$refs.link.resizeHeight()
})
} else {
this.dialogWidth = '40%'
}
},
// dialog
//close
dialogCloseHandle() {
//线
this.linkData.lineData = []
this.linkData.leftData = deepClone(this.linkData.leftDataCopy)
this.linkData.rightData = []
//radio
this.addType = '1'
//select
this.plugIn = ''
//
this.dialogWidth = '40%'
this.addRole = ''
},
// 线 x y
getLineData(data) {
this.linkData.lineData = deepClone(data)
//add
addHandle() {
this.addSwitch = true
},
//
currentChangeHandle(pageModel) {
this.pageModel = pageModel
this.$nextTick(() => {
})
},
// save
async saveHandle() {
let arr = []
let flag = this.tableData.some((item, index) => {
if (!item.appId) {
this.$vmNews('请选择应用', 'warning')
return true
}
if (arr.includes(item.appId)) {
this.$vmNews('不允许重复选择应用', 'warning')
return true
}
arr.push(item.appId)
if (!item.addApi || !item.deleteApi) {
this.$vmNews('请选择接口', 'warning')
return true
}
if (item.addApi === item.deleteApi) {
this.$vmNews('新增接口和删除接口不能选同一个', 'warning')
return true
}
if (!item.addType) {
this.$vmNews(`请配置${index + 1}行新增接口`, 'warning')
return true
}
if (!item.deleteType) {
this.$vmNews(`请配置${index + 1}行删除接口`, 'warning')
return true
}
})
if (flag) return
let params = {
id: this.$route.query.id,
mdmModuleDistributeEntities: this.tableData
}
const res = await getUserModuleApi({
tl: 'mdmService',
as: 'mdmService',
dj: 'doSaveMdmModuleDistribute'
}, params)
if (res.status === '200') {
this.$vmNews('保存成功', 'success')
this.init()
}
},
//add
addHandle() {
this.addSwitch = true
}
},
components: {
baseNewForm,
@ -538,18 +262,28 @@ export default {
baseDialog,
baseNewSelect,
basePage,
baseLink
baseRightDialog,
settingForm
},
created() {
this.init()
this.initSelect()
this.initLeftLink()
this.$emit('flashActive', 3)
this.initSelect().then(() => {
this.getTableData()
})
this.$emit('flashActive', 4)
}
}
</script>
<style scoped lang="scss">
.receiptsAddRow {
margin-top: 30px;
border: 1px dotted #ccc;
text-align: center;
height: 50px;
line-height: 50px;
}
::v-deep .el-button {
border-radius: 16px;
}
@ -597,71 +331,48 @@ footer {
}
.addBox {
.title {
font-weight: 600;
margin: 10px 0;
}
.radioList {
margin-top: 20px;
}
.content {
margin-top: 30px;
.chunk {
display: flex;
align-items: center;
.label {
font-weight: 800;
margin-right: 10px;
}
}
}
.link {
padding: 30px;
> .chunk {
display: flex;
width: 100%;
> .left {
width: 1000px;
min-height: 300px;
}
> .right {
margin-left: 50px;
width: 30vw;
overflow: hidden;
.result {
margin-top: 30px;
display: flex;
justify-content: space-between;
> .left {
padding: 0 10px;
}
> .right {
padding: 0 10px;
}
}
}
align-items: center;
}
}
.receiptsAddRow {
margin-top: 30px;
border: 1px dotted #ccc;
text-align: center;
height: 50px;
line-height: 50px;
}
.line {
.btnList {
display: flex;
align-items: center;
justify-content: center;
.settingBtn {
cursor: pointer;
width: 24px;
height: 24px;
background: #EBEBED;
border-radius: 6px;
display: flex;
justify-content: center;
align-items: center;
> img {
width: 10px;
height: 10px;
}
}
.deleBtn {
cursor: pointer;
margin-left: 10px;
width: 24px;
height: 24px;
background: #EBEBED;
border-radius: 6px;
display: flex;
justify-content: center;
align-items: center;
> img {
width: 10px;
height: 10px;
}
}
}
</style>

View File

@ -0,0 +1,587 @@
<template>
<div class="settingForm">
<baseNewForm
ref="typeOptionForm"
:spanNumber="18"
:isFunBtn="false"
:formRow="formRow"
:ruleForm="ruleForm"
:labelPosition="'top'"
@onSelect="typeSelectChangeHanlde"
@onSubmit="typeOptionOnSubmit"
>
</baseNewForm>
<div class="bigTitle">数据权限设置</div>
<div class="tableName">
<div class="title">数据主表名称</div>
<div class="input">
<el-select clearable v-model="tableId" @change="serviceSeleChangHadle">
<el-option v-for="(item,index) of serviceOptions" :key="index" :label="item.label"
:value="item.id"
>
</el-option>
</el-select>
</div>
</div>
<div class="main" v-loading="mainLoading">
<!-- 此处逻辑当拥有左括号或者右括号时 连接符清除并禁用-->
<baseTable :tableData="tableData" :tabLoading="tabLoading"
:tableColumn="tableColumn" :border="false"
>
<!-- 左括号-->
<template #leftBracket="{row}">
<el-select clearable v-model="row.leftBracket"
>
<el-option v-for="(item,index) of leftBracketOptions" :key="index" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
<!-- 字段名称-->
<template #filedName="{row}">
<el-select clearable v-model="row.filedId" @change="(val)=>{filedIdChangHandle(val,row)}">
<el-option v-for="(item,index) of labelOptions" :key="index" :label="item.label" :value="item.id">
</el-option>
</el-select>
</template>
<!-- 对比类型-->
<template #compareType="{row}">
<el-select clearable v-model="row.compareType">
<el-option v-for="(item,index) of compareTypeOptions" :key="index" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
<!-- 运算值-->
<template #filedVaule="{row}">
<el-input v-model="row.filedVaule"></el-input>
</template>
<!-- 连接符-->
<template #connectionSymbol="{row}">
<el-select clearable v-model="row.connectionSymbol"
>
<el-option v-for="(item,index) of connectionSymbolOptions" :key="index" :label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</template>
<!-- 右括号-->
<template #rightParenthesis="{row}">
<el-select clearable v-model="row.rightParenthesis">
<el-option v-for="(item,index) of rightParenthesisOptions" :key="index" :label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</template>
<!-- 操作-->
<template #operation="{row}">
<div class="btnList">
<div class="deleBtn" @click="activedOnFunc(row)">
<img src="./images/删除.png" alt="">
</div>
</div>
</template>
</baseTable>
<div class="receiptsAddRow">
<el-link
type="primary"
@click="addRowHandle"
:underline="false"
>+ 添加
</el-link
>
</div>
</div>
</div>
</template>
<script>
import baseNewForm from '../compoments/baseNewForm'
import BaseTable from '@/views/intergrationTask/compoments/baseTable.vue'
import { authApi } from '@/api/apis/auth'
import { getApiModuleApi } from '@/api/apiChunks'
import { retrieveRawAttr } from 'echarts/lib/data/helper/dataProvider'
export default {
name: 'settingForm',
data() {
return {
formRow: [
{
elCol: [
{
type: 'select',
title: '应用列表',
id: 'appId',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '触发类型',
id: 'enabledType',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: [
{
label: '手动',
id: '0'
},
{
label: '自动',
id: '1'
}
]
}
]
},
{
elCol: [
{
type: 'select',
title: '新增接口',
id: 'addApi',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '修改接口',
id: 'updateApi',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '删除接口',
id: 'deleteApi',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: []
}
]
},
{
elCol: [
{
type: 'switch',
title: '启用/停用',
id: 'enabledState',
row: 24,
disabled: false,
required: true,
fontSize: 16,
activeValue: '1',
inactiveValue: '0'
}
]
}
],
ruleForm: {},
tableId: '',//
mainLoading: false,
tabLoading: false,
tableData: [],
tableColumn: [
{
title: '括号',
id: 'leftBracket'
},
{
title: '字段名称',
id: 'filedName'
},
{
title: '字段编码',
id: 'filedId'
},
{
title: '运算符',
id: 'compareType'
},
{
title: '运算值',
id: 'filedVaule'
},
{
title: '连接符',
id: 'connectionSymbol'
},
{
title: '括号',
id: 'rightParenthesis'
},
{ title: '操作', id: 'operation' }
],
compareTypeOptions: [
{
label: '=',
value: '1'
},
{
label: '!=',
value: '2'
},
{
label: '>',
value: '3'
},
{
label: '<',
value: '4'
}
],//options
connectionSymbolOptions: [
{
label: 'and',
value: '1'
},
{
label: 'or',
value: '2'
}
],//options
leftBracketOptions: [
{
label: '(',
value: '('
}
],//
rightParenthesisOptions: [
{
label: ')',
value: ')'
}
],//
serviceOptions: [],//
labelOptions: [],//
labelDist: {}//
}
},
methods: {
// filedName
filedIdChangHandle(val, row) {
row.filedName = this.labelDist[val]
},
// 1. 2.
async serviceSeleChangHadle(val, flag = true) {
if (flag) {
this.labelOptions = []
this.labelDist = {}
this.tableData.forEach(item => {
item.filedName = ''
item.filedId = ''
})
}
if (val) {
let obj = this.serviceOptions.find(item => {
return val === item.id
})
const res = await getApiModuleApi({
tl: 'mdmModuleService',
as: '',
dj: 'queryMdmServiceField'
}, { mdmId: obj.mdmId, dbId: obj.dbId })
res.attribute.forEach(item => {
this.$set(this.labelDist, item.enName, item.chName)
this.labelOptions.push({
id: item.enName,
label: item.chName
})
})
}
},
//
async initSelect() {
//
this.serviceOptions = []
const service = await getApiModuleApi({
tl: 'mdmModuleService',
as: '',
dj: 'queryMdmService'
}, { remark: '' })
service.attribute.forEach(item => {
console.log(item.dbName, 'item')
this.serviceOptions.push({
id: item.id,
label: item.remark,
dbId: item.id,
mdmId: item.mdmId
})
})
console.log(this.serviceOptions, 'this.serviceOptions')
},
async typeSelectChangeHanlde(val, index, indexRow, row, flag = true) {
if (flag && row.id === 'appId') {
this.formRow[2].elCol[0].options = []
this.formRow[3].elCol[0].options = []
this.formRow[4].elCol[0].options = []
this.$set(this.ruleForm, 'addApi', '')
this.$set(this.ruleForm, 'updateApi', '')
this.$set(this.ruleForm, 'deleteApi', '')
}
//appidapp
if (row.id === 'appId' && val) {
const res = await authApi('sysApplicationApiService', '', 'queryEntity', '', {
appId: val
})
res.attribute.forEach((item) => {
this.formRow[2].elCol[0].options.push({
id: item.id,
label: item.apiName
})
this.formRow[3].elCol[0].options.push({
id: item.id,
label: item.apiName
})
this.formRow[4].elCol[0].options.push({
id: item.id,
label: item.apiName
})
})
}
},
//
async typeOptionOnSubmit() {
let flag
//1.0 2.1 3.>1
if (this.tableData.length === 1) {
flag = this.tableData.some(item => {
if (item.leftBracket || item.rightParenthesis || item.connectionSymbol) {
this.$vmNews(`当仅有一行时不允许填写左右括号及连接符`)
return true
}
if (!item.filedName) {
this.$vmNews('请选择字段名称')
return true
}
if (!item.compareType) {
this.$vmNews('请选择运算符')
return true
}
if (!item.filedVaule) {
this.$vmNews('请填写运算值')
return true
}
})
} else if (this.tableData.length > 1) {
// -=1-=0
let leftBracketNum = 0
let rightParenthesisNum = 0
flag = this.tableData.some((item, index) => {
//
if (index + 1 === this.tableData.length && !item.rightParenthesis) {
this.$vmNews(`最后一行请填写右括号`)
return true
}
//
if (index + 1 === 1 && !item.leftBracket) {
this.$vmNews(`首行请填写左括号`)
return true
}
//
if (index + 1 != this.tableData.length && !item.connectionSymbol) {
this.$vmNews(`${index + 1}请填写连接符`)
return true
}
//
if (index + 1 == this.tableData.length && item.connectionSymbol) {
this.$vmNews(`最后一行不允许填写连接符`)
return true
}
if (!item.filedName) {
this.$vmNews(`${index + 1}行请填写字段名称`)
return true
}
if (!item.compareType) {
this.$vmNews(`${index + 1}行请填写运算符`)
return true
}
if (!item.filedVaule) {
this.$vmNews(`${index + 1}行请填写运算值`)
return true
}
if (item.leftBracket && item.rightParenthesis) {
this.$vmNews(`${index + 1}行中不允许同时存在左括号和右括号`)
return true
}
//
if (item.leftBracket) {
leftBracketNum++
let num = leftBracketNum - rightParenthesisNum
if (num !== 0 && num !== 1) {
this.$vmNews(`${index + 1}行中左括号填写不符合规则请重新填写`)
return true
}
}
if (item.rightParenthesis) {
rightParenthesisNum++
let num = leftBracketNum - rightParenthesisNum
if (num !== 0 && num !== 1) {
this.$vmNews(`${index + 1}行中右括号填写不符合规则请重新填写`)
return true
}
}
})
}
if (flag) return
let params = {
...this.ruleForm,
dbId: this.tableId,
mdmId: this.$route.query.id,
mdmModuleDistributeDetailEntities: this.tableData
}
if (params.id) {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'updateMdmDistribute', '', params)
this.$vmNews('保存成功', 'success')
this.$emit('saveSuccessHandle')
} else {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'saveMdmDistribute', '', params)
this.$vmNews('保存成功', 'success')
this.$emit('saveSuccessHandle')
}
},
addRowHandle() {
this.tableData.push({
'leftBracket': '',//
'filedName': '',//
'compareType': '',// 1 2 3 4
'filedVaule': '',//
'connectionSymbol': '',// 1\and 2\or
'rightParenthesis': ''//
})
},
//
activedOnFunc(row) {
this.tableData.splice(row.index, 1)
},
//
async getAppList() {
const res = await authApi('sysApplicationService', '', 'queryEntity', '', {})
console.log(res)
this.formRow[0].elCol[0].options = []
res.attribute.forEach(item => {
this.formRow[0].elCol[0].options.push({
id: item.id,
label: item.name
})
})
},
//
async getrowDetails(id) {
this.openLoading('detail')
const res = await authApi('mdmModuleService', '', 'getMdmDistribute', '', {
id
})
this.ruleForm = res.attribute
this.tableId = this.ruleForm.dbId
this.tableData = res.attribute.mdmModuleDistributeDetailEntities
console.log(this.tableData, '?')
this.typeSelectChangeHanlde(this.ruleForm.appId, 0, 0, { id: 'appId' }, false)
this.serviceSeleChangHadle(this.ruleForm.dbId, false)
}
},
created() {
this.getAppList()
this.initSelect()
},
components: {
BaseTable,
baseNewForm
}
}
</script>
<style scoped lang="scss">
.bigTitle {
border-top: 1px solid #EBEBEB;
padding-top: 20px;
font-family: PingFangSC, PingFang SC;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 22px;
text-align: left;
font-style: normal;
}
.tableName {
display: flex;
align-items: center;
margin: 30px 0;
.title {
margin-right: 20px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 20px;
text-align: left;
font-style: normal;
}
}
.receiptsAddRow {
margin-top: 30px;
border: 1px dotted #ccc;
text-align: center;
height: 50px;
line-height: 50px;
}
.btnList {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
.deleBtn {
cursor: pointer;
margin-left: 10px;
width: 24px;
height: 24px;
background: #EBEBED;
border-radius: 6px;
display: flex;
justify-content: center;
align-items: center;
> img {
width: 10px;
height: 10px;
}
}
}
</style>

View File

@ -228,14 +228,14 @@ export default {
async initMainTableData(obj = {}) {
this.refreshLoading = true
const res = await getApiModuleApi(
{
tl: 'mdmModuleService',
as: '',
dj: 'queryMdm'
},
{
...obj
}
{
tl: 'mdmModuleService',
as: '',
dj: 'queryMdm'
},
{
...obj
}
)
this.refreshLoading = false
if (res.status == 200) {
@ -251,11 +251,11 @@ export default {
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)
})
})
console.log(res,'res')
console.log(res, 'res')
this.tableData = res.attribute
}
},
@ -276,7 +276,7 @@ export default {
if (item.type === 'setting') {
this.$router.push({
path: '/integrationOption/settingMenu/masterDataEdit',
query: { flag: 'setting', id: val.id, name: val.name, appLogo: val.appLogo }
query: { flag: 'setting', id: val.id, name: val.name, appLogo: val.appLogo, mdmCode: val.mdmCode }
})
} else if (item.type === 'copy') {
this.$router.push({

View File

@ -0,0 +1,202 @@
<template>
<div class="logsDeatil">
<div class="tabs">
<div class="chunk" :class="{acivted:activeName==='1'}" @click="tabsHandleClick('1')">下发日志</div>
<div class="chunk" :class="{acivted:activeName==='2'}" @click="tabsHandleClick('2')">写入日志</div>
</div>
<div class="table">
<baseTable :tableData="tableData" :tabLoading="tabLoading"
:tableColumn="tableColumn" :border="false" tableHeight="70vh"
>
<!-- 状态-->
<template #dataType="{row}">
{{ row.dataType == 1 ? '成功' : '失败'}}
</template>
<!-- 操作类型-->
<template #optionType="{row}">
{{ optionTypeDist[row.optionType]}}
</template>
</baseTable>
</div>
<footer>
<basePage :pageModel="pageModel" @update:pageModel="currentChangeHandle"></basePage>
</footer>
</div>
</template>
<script>
import BaseTable from '@/views/intergrationTask/compoments/baseTable.vue'
import basePage from '@/views/intergrationTask/compoments/basePage.vue'
import { authApi } from '@/api/apis/auth'
export default {
name: 'index',
components: { basePage, BaseTable },
data() {
return {
activeName: '1',
tableData: [],
tableColumn: [],
tabLoading: false,
tableColumnTypeOne: [
{
title: "目标应用",
id: "targetApp",
},
{
title: "目标api",
id: "targetApi",
},
{
title: "源数据",
id: "sourceData",
tooltip: true,
},
{
title: "状态",
id: "dataType",
},
{
title: "返回信息",
id: "remark",
tooltip: true,
},
{
title: "操作类型",
id: "optionType",
},
],//
tableColumnTypeTwo: [
{
title: "来源名称",
id: "sourceName",
},
{
title: "编码",
id: "code",
},
{
title: "源数据",
id: "sourceData",
tooltip: true,
},
{
title: "状态",
id: "dataType",
},
{
title: "返回信息",
id: "remark",
tooltip: true,
},
{
title: "创建时间",
id: "create_time",
},
{
title: "操作类型",
id: "optionType",
},
{
title: "操作人",
id: "optionName",
},
],//
pageModel: {
pageIndex: 1,
total: 10,
limit: 10
},
optionTypeDist:{
1:"新增",
2:"修改",
3:"删除",
}
}
},
methods: {
//
tabsHandleClick(num) {
if (this.activeName === num) return
this.activeName = num
this.pageModel.pageIndex = 1
this.initMainTableData()
},
//
currentChangeHandle(pageModel) {
this.pageModel = pageModel
this.$nextTick(() => {
this.initMainTableData(this.searchForm)
})
},
async initMainTableData() {
if (this.activeName === '2') {
const res = await authApi('mdmModuleService', '', 'queryMdmOptionLogPage', '', {
pageNum: this.pageModel.pageIndex,
pageSize: this.pageModel.limit,
mdmCode: this.$route.query.mdmCode
})
this.tableColumn = this.tableColumnTypeTwo
this.tableData = res.attribute.list
this.pageModel.total = res.attribute.total
} else {
const res = await authApi('mdmModuleService', '', 'queryMdmDistributeLogPage', '', {
pageNum: this.pageModel.pageIndex,
pageSize: this.pageModel.limit,
mdmCode: this.$route.query.mdmCode
})
this.tableColumn = this.tableColumnTypeOne
this.tableData = res.attribute.list
this.pageModel.total = res.attribute.total
}
}
},
mounted() {
this.initMainTableData()
this.$emit('flashActive', 5)
}
}
</script>
<style scoped lang="scss">
.logsDeatil {
margin-left: 10px;
background-color: #fff;
.tabs {
display: flex;
border-bottom: 1px solid #EBEBEB;
padding-left: 118px;
.chunk {
cursor: pointer;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 16px;
color: #333333;
line-height: 22px;
text-align: left;
font-style: normal;
padding: 20px 12px;
margin-left: 80px;
}
.acivted {
border-bottom: 2px #1478F6 solid !important;
color: #1478F6 !important;
font-weight: 700;
}
}
.table {
margin-top: 10px;
}
footer {
padding-bottom: 20px;
}
}
</style>

View File

@ -55,6 +55,7 @@ export default {
saveSuccessInit(res, fun) {
console.log(res, 'res')
this.billid = res.attribute.id
this.mdmCode = res.attribute.mdmCode
this.$refs.routerChunk.billid = this.billid
this.initEditFormData()
fun()
@ -83,7 +84,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), ''))
})
}
},
@ -100,8 +101,9 @@ export default {
if (item.path && !this.$route.path.includes(item.path)) {
this.menuActived = index
this.$set(this.query, 'id', this.billid)
this.$set(this.query, 'mdmCode', this.mdmCode)
this.$router.replace({
name: item.path,
path: item.path,
query: this.query
})
}
@ -113,6 +115,7 @@ export default {
mounted() {
if (this.$route.query.flag !== 'new') {
this.billid = this.$route.query.id
this.mdmCode = this.$route.query.mdmCode
this.initEditFormData()
}
}