主数据v3本地化更新,动态按钮权限更新,集成任务日志明细字段更新。
This commit is contained in:
parent
9c6e772276
commit
1eb2f79229
|
@ -545,7 +545,7 @@ export default {
|
|||
},
|
||||
refresh() {
|
||||
this.ruleForm = Object.assign({}, "");
|
||||
this.$emit("onQuery", this.mergeParam(true));
|
||||
this.$emit("onQuery", this.mergeParam(true),this.ruleForm);
|
||||
},
|
||||
testEnter() {
|
||||
if (this.enterClickType) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import dialogDrag from './dialog/drag'
|
|||
import dialogDragWidth from './dialog/dragWidth'
|
||||
import dialogDragHeight from './dialog/dragHeight'
|
||||
import clipboard from './module/clipboard'
|
||||
|
||||
import btnPermission from "@/directive/permission/btnPermission";
|
||||
const install = function(Vue) {
|
||||
Vue.directive('hasRole', hasRole)
|
||||
Vue.directive('hasPermi', hasPermi)
|
||||
|
@ -12,6 +12,7 @@ const install = function(Vue) {
|
|||
Vue.directive('dialogDrag', dialogDrag)
|
||||
Vue.directive('dialogDragWidth', dialogDragWidth)
|
||||
Vue.directive('dialogDragHeight', dialogDragHeight)
|
||||
Vue.directive("btnPermission", btnPermission);
|
||||
}
|
||||
|
||||
if (window.Vue) {
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import store from "@/store";
|
||||
|
||||
export default {
|
||||
inserted(el, bindling) {
|
||||
let perVal = bindling.value.btnID;
|
||||
let routeId = bindling.value.routeId;
|
||||
if (perVal && routeId) {
|
||||
let perObj = store.getters.getButtonPre;
|
||||
if (Object.keys(perObj).length) {
|
||||
let hasPer = perObj[routeId] && perObj[routeId].includes(perVal);
|
||||
if (!hasPer) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
import btnPermission from "@/directive/permission/btnPermission";
|
||||
const directives = {
|
||||
btnPermission,
|
||||
};
|
||||
export default {
|
||||
install(Vue) {
|
||||
Object.keys(directives).forEach((key) => {
|
||||
Vue.directive(key, directives[key]);
|
||||
});
|
||||
},
|
||||
};
|
|
@ -66,6 +66,8 @@ Vue.directive('enterNumber', {
|
|||
})
|
||||
}
|
||||
})
|
||||
import Directives from "@/directive/permission/index";
|
||||
Vue.use(Directives);
|
||||
|
||||
import { download } from '@/utils/request'
|
||||
import { openLoading, closeLoading } from '@/utils/loading'
|
||||
|
|
|
@ -1,77 +1,129 @@
|
|||
import router from "./router";
|
||||
import store from "./store";
|
||||
import { Message } from "element-ui";
|
||||
import NProgress from "nprogress";
|
||||
import "nprogress/nprogress.css";
|
||||
import { getToken, getCompanyId } from "@/utils/auth";
|
||||
import { isRelogin, getButtonLish } from "@/utils/request";
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import { Message } from 'element-ui'
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import { getToken, getCompanyId } from '@/utils/auth'
|
||||
import { isRelogin, getButtonLish } from '@/utils/request'
|
||||
import { authApi } from '@/api/apis/auth'
|
||||
import { getInfo } from '@/utils/auth'
|
||||
|
||||
NProgress.configure({
|
||||
showSpinner: false,
|
||||
});
|
||||
showSpinner: false
|
||||
})
|
||||
|
||||
const whiteList = [
|
||||
"/login",
|
||||
"/test",
|
||||
"/auth-redirect",
|
||||
"/bind",
|
||||
"/contractAssistant",
|
||||
"/register",
|
||||
"/systemInit",
|
||||
"/databaseLogin",
|
||||
"/apiLogs",
|
||||
];
|
||||
'/login',
|
||||
'/test',
|
||||
'/auth-redirect',
|
||||
'/bind',
|
||||
'/contractAssistant',
|
||||
'/register',
|
||||
'/systemInit',
|
||||
'/databaseLogin',
|
||||
'/apiLogs'
|
||||
]
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start();
|
||||
NProgress.start()
|
||||
if (getToken()) {
|
||||
to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
/* has token*/
|
||||
if (to.path === "/login") {
|
||||
if (to.path === '/login') {
|
||||
next({
|
||||
path: "/",
|
||||
});
|
||||
NProgress.done();
|
||||
path: '/'
|
||||
})
|
||||
NProgress.done()
|
||||
} else {
|
||||
let routeList = localStorage.getItem("routeList")
|
||||
? localStorage.getItem("routeList")
|
||||
: null;
|
||||
let routeList = localStorage.getItem('routeList')
|
||||
? localStorage.getItem('routeList')
|
||||
: null
|
||||
// store.dispatch("GenerateRoutes").then((accessRoutes) => {
|
||||
// next()
|
||||
// })
|
||||
if (store.getters.permission_routes.length == 0) {
|
||||
|
||||
store.dispatch("GenerateRoutes").then((accessRoutes) => {
|
||||
store.dispatch('GenerateRoutes').then((accessRoutes) => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
// for (let i = 0, length = accessRoutes.length; i < length; i += 1) {
|
||||
// const element = accessRoutes[i];
|
||||
// // router.addRoutes(accessRoutes); // 动态添加可访问路由表
|
||||
// }
|
||||
router.addRoutes(accessRoutes); // 动态添加可访问路由表
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
|
||||
// router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
localStorage.setItem("routeList", JSON.stringify(accessRoutes));
|
||||
localStorage.setItem('routeList', JSON.stringify(accessRoutes))
|
||||
//获取当前已获取的权限按钮
|
||||
let perObj = store.getters.getButtonPre
|
||||
//获取当前权限按钮
|
||||
if (to.meta.id && !perObj[to.meta.id]) {
|
||||
let userId = JSON.parse(getInfo()).id
|
||||
authApi('sysButtonConfigService', '', 'getUserButton', '', {
|
||||
menuId: to.meta.id,
|
||||
userId: userId
|
||||
}).then((res) => {
|
||||
// 处理接口 格式为:{路由id:[按钮id,按钮id],....}
|
||||
let tempObj = {}
|
||||
let tempArr = []
|
||||
res.attribute.forEach((item) => {
|
||||
tempArr.push(item.nameEn)
|
||||
})
|
||||
tempObj.id = to.meta.id
|
||||
tempObj.value = tempArr
|
||||
store.commit('perButton/SET_BUTTONOBJ', tempObj)
|
||||
next({
|
||||
...to,
|
||||
replace: true,
|
||||
}); // hack方法 确保addRoutes已完成
|
||||
});
|
||||
replace: true
|
||||
})
|
||||
})
|
||||
} else {
|
||||
next();
|
||||
next({
|
||||
...to,
|
||||
replace: true
|
||||
})
|
||||
}
|
||||
// next({
|
||||
// ...to,
|
||||
// replace: true
|
||||
// }) // hack方法 确保addRoutes已完成
|
||||
})
|
||||
} else {
|
||||
//获取当前已获取的权限按钮
|
||||
let perObj = store.getters.getButtonPre
|
||||
if (to.meta.id && !perObj[to.meta.id]) {
|
||||
let userId = JSON.parse(getInfo()).id
|
||||
authApi('sysButtonConfigService', '', 'getUserButton', '', {
|
||||
menuId: to.meta.id,
|
||||
userId: userId
|
||||
}).then((res) => {
|
||||
// 处理接口 格式为:{路由id:[按钮id,按钮id],....}
|
||||
let tempObj = {}
|
||||
let tempArr = []
|
||||
res.attribute.forEach((item) => {
|
||||
tempArr.push(item.nameEn)
|
||||
})
|
||||
tempObj.id = to.meta.id
|
||||
tempObj.value = tempArr
|
||||
store.commit('perButton/SET_BUTTONOBJ', tempObj)
|
||||
next()
|
||||
})
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 没有token
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
// 在免登录白名单,直接进入
|
||||
next();
|
||||
next()
|
||||
} else {
|
||||
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
|
||||
NProgress.done();
|
||||
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
NProgress.done()
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
router.afterEach(() => {
|
||||
NProgress.done();
|
||||
});
|
||||
NProgress.done()
|
||||
})
|
||||
|
|
|
@ -36,5 +36,6 @@ const getters = {
|
|||
copyerConfig: state => state.flowPath.copyerConfig,
|
||||
conditionDrawer: state => state.flowPath.conditionDrawer,
|
||||
conditionsConfig: state => state.flowPath.conditionsConfig,
|
||||
getButtonPre: (state) => state.perButton.buttonObj,
|
||||
}
|
||||
export default getters
|
||||
|
|
|
@ -9,6 +9,7 @@ import settings from './modules/settings'
|
|||
import getters from './getters'
|
||||
import approval from './modules/approval'
|
||||
import flowPath from "./modules/flowPath"
|
||||
import perButton from "@/store/modules/perButton";
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
|
@ -21,7 +22,8 @@ const store = new Vuex.Store({
|
|||
permission,
|
||||
settings,
|
||||
approval,
|
||||
flowPath
|
||||
flowPath,
|
||||
perButton
|
||||
},
|
||||
getters
|
||||
})
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
const state = {
|
||||
buttonObj: {},
|
||||
};
|
||||
const mutations = {
|
||||
//保存按钮
|
||||
SET_BUTTONOBJ(state, data) {
|
||||
if (!data.id) return;
|
||||
state.buttonObj[data.id] = data.value;
|
||||
},
|
||||
//清空按钮
|
||||
CLEAN_BUTTONOBJ(state, data) {
|
||||
state.buttonObj = {};
|
||||
},
|
||||
};
|
||||
|
||||
const actions = {};
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions,
|
||||
};
|
|
@ -176,8 +176,10 @@
|
|||
class="btnText"
|
||||
:style="{ background: item.color ? item.color : '#5a9cf8' }"
|
||||
style="padding: 3px 10px; border-radius: 20px"
|
||||
v-btnPermission="{ btnID: item.type, routeId: $route.meta.id }"
|
||||
>
|
||||
<span
|
||||
|
||||
style="color: #fff; font-weight: 700"
|
||||
v-if="!item.ifField && !item.hiddenField"
|
||||
>{{ item.text }}</span
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
type="primary"
|
||||
size="mini"
|
||||
@click="buttonHandle(item)"
|
||||
v-btnPermission="{ btnID: item.buttonType, routeId: $route.meta.id }"
|
||||
>{{ item.buttonName }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
@ -104,7 +105,8 @@
|
|||
<baseDialog v-model="sendShow" :footerShow="false">
|
||||
<baseTable
|
||||
:tableData="sendTableData"
|
||||
:tableColumn="sendTableColumn">
|
||||
:tableColumn="sendTableColumn"
|
||||
>
|
||||
<template v-slot:status="{row}">
|
||||
{{ sendDist[row.status] }}
|
||||
</template>
|
||||
|
@ -119,45 +121,45 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {deepClone} from "@/utils/index.js";
|
||||
import {getUserModuleApi} from "@/api/integrationOption/integrationOption.js";
|
||||
import BaseNewForm from "./compoments/baseNewForm";
|
||||
import BaseTable from "./compoments/baseTable";
|
||||
import BasePage from "./compoments/basePage.vue";
|
||||
import baseDialog from "@/views/integrationOption/compoments/baseDialog";
|
||||
import BaseTableForm from "./compoments/baseTableForm_v2.vue";
|
||||
import BaseMenuTree from "@/views/intergrationTask/compoments/baseMenuTree.vue";
|
||||
import { deepClone } from '@/utils/index.js'
|
||||
import { getUserModuleApi } from '@/api/integrationOption/integrationOption.js'
|
||||
import BaseNewForm from './compoments/baseNewForm'
|
||||
import BaseTable from './compoments/baseTable'
|
||||
import BasePage from './compoments/basePage.vue'
|
||||
import baseDialog from '@/views/integrationOption/compoments/baseDialog'
|
||||
import BaseTableForm from './compoments/baseTableForm_v2.vue'
|
||||
import BaseMenuTree from '@/views/intergrationTask/compoments/baseMenuTree.vue'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
treeObj: {
|
||||
label: "",
|
||||
upId: ""
|
||||
label: '',
|
||||
upId: ''
|
||||
},
|
||||
sendDist: {
|
||||
"1": "发送成功",
|
||||
"2": "发送中",
|
||||
"3": "发送失败",
|
||||
"4": "未发送"
|
||||
'1': '发送成功',
|
||||
'2': '发送中',
|
||||
'3': '发送失败',
|
||||
'4': '未发送'
|
||||
},
|
||||
sendShow: false,//分发任务dialog
|
||||
sendTableColumn: [
|
||||
{
|
||||
id: 'name',
|
||||
title: "应用"
|
||||
title: '应用'
|
||||
},
|
||||
{
|
||||
id: 'status',
|
||||
title: "状态"
|
||||
title: '状态'
|
||||
},
|
||||
{
|
||||
id: 'msg',
|
||||
title: "信息"
|
||||
title: '信息'
|
||||
},
|
||||
{
|
||||
id: "fun",
|
||||
title: "操作"
|
||||
id: 'fun',
|
||||
title: '操作'
|
||||
}
|
||||
|
||||
],
|
||||
|
@ -167,11 +169,41 @@ export default {
|
|||
searchForm: {},
|
||||
searchLoading: false,
|
||||
//按钮相关
|
||||
searchButton: [],
|
||||
mainTableName: "",
|
||||
searchButton: [
|
||||
{
|
||||
'buttonType': 'new',
|
||||
'buttonName': '新建'
|
||||
},
|
||||
{
|
||||
'buttonType': 'resize',
|
||||
'buttonName': '重置'
|
||||
},
|
||||
{
|
||||
'buttonType': 'search',
|
||||
'buttonName': '查询'
|
||||
}
|
||||
],
|
||||
mainTableName: '',
|
||||
// 主表按钮
|
||||
mainLoading: false,
|
||||
mainFunData: [],
|
||||
mainFunData: [
|
||||
{
|
||||
'text': '修改',
|
||||
'type': 'edit'
|
||||
},
|
||||
{
|
||||
'text': '删除',
|
||||
'type': 'dele'
|
||||
},
|
||||
{
|
||||
'text': '查看',
|
||||
'type': 'view'
|
||||
},
|
||||
{
|
||||
'text': '下发',
|
||||
'type': 'send'
|
||||
}
|
||||
],
|
||||
mainActiveRow: {},
|
||||
mainTabLoading: false,
|
||||
tableData: [],
|
||||
|
@ -180,7 +212,7 @@ export default {
|
|||
pageModel: {
|
||||
total: 0,
|
||||
pageIndex: 1,
|
||||
limit: 10,
|
||||
limit: 10
|
||||
},
|
||||
//dialog相关
|
||||
dialogShow: false,
|
||||
|
@ -190,27 +222,27 @@ export default {
|
|||
lookFlag: false,
|
||||
newFlag: false,
|
||||
dialogTabaleInfo: [],
|
||||
dialogfunData: [{text: "删除", type: "dele", color: 'red'}],
|
||||
dialogfunData: [{ text: '删除', type: 'dele', color: 'red' }],
|
||||
dialogTableLoading: false,
|
||||
dialogFormName: "",
|
||||
dialogFormName: '',
|
||||
//树相关
|
||||
treeProps: {
|
||||
children: "children",
|
||||
label: "label",
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
treeData: [],
|
||||
treeActiveRow: {},
|
||||
treeSelectInfo: {},
|
||||
treeSelectInfo: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
this.mainLoading = true
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShow",
|
||||
}, {mdmCode: this.$route.meta.mdmCode})
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShow'
|
||||
}, { mdmCode: this.$route.meta.mdmCode })
|
||||
// 树处理
|
||||
if (this.$route.query.viewType === '1') {
|
||||
this.treeObj.label = res.attribute.mdmModuleViewEntity.viewFiled
|
||||
|
@ -225,26 +257,33 @@ export default {
|
|||
})
|
||||
})
|
||||
this.searchFormRow = []
|
||||
res.attribute.queryList.forEach((item) => {
|
||||
item.id = item.dbName + '.' + item.id
|
||||
})
|
||||
this.baseFormRowDispose(res.attribute.queryList, this.searchFormRow)
|
||||
console.log(res.attribute.queryList, 'this.searchFormRow')
|
||||
//按钮框处理
|
||||
let funDataBtn = {
|
||||
edit: true,
|
||||
view: true,
|
||||
dele: true,
|
||||
send: true,
|
||||
send: true
|
||||
}
|
||||
this.searchButton = []
|
||||
this.mainFunData = []
|
||||
res.attribute.buttonList.forEach(item => {
|
||||
if (funDataBtn[item.buttonType]) {
|
||||
this.mainFunData.push({
|
||||
text: item.buttonName,
|
||||
type: item.buttonType
|
||||
})
|
||||
} else {
|
||||
this.searchButton.push(item)
|
||||
}
|
||||
})
|
||||
//动态按钮相关 (v3版本不再走这套逻辑)
|
||||
// this.searchButton = []
|
||||
// this.mainFunData = []
|
||||
// res.attribute.buttonList.forEach(item => {
|
||||
// if (funDataBtn[item.buttonType]) {
|
||||
// this.mainFunData.push({
|
||||
// text: item.buttonName,
|
||||
// type: item.buttonType
|
||||
// })
|
||||
// console.log(this.mainFunData, 'this.mainFunData')
|
||||
// } else {
|
||||
// this.searchButton.push(item)
|
||||
// console.log(this.searchButton, 'this.searchButton')
|
||||
// }
|
||||
// })
|
||||
//主表处理
|
||||
res.attribute.listList.forEach(item => {
|
||||
this.mainTableName = item.dbName
|
||||
|
@ -260,9 +299,9 @@ export default {
|
|||
async initTree(label, upId, obj = {}) {
|
||||
if (this.$route.query.viewType !== '1') return
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShowTreeData",
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShowTreeData'
|
||||
}, {
|
||||
mdmCode: this.$route.meta.mdmCode,
|
||||
label,
|
||||
|
@ -276,9 +315,9 @@ export default {
|
|||
async initTableData(name, obj = {}) {
|
||||
this.mainTabLoading = true
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShowData",
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShowData'
|
||||
}, {
|
||||
pageNum: this.pageModel.pageIndex,
|
||||
pageSize: this.pageModel.limit,
|
||||
|
@ -292,21 +331,21 @@ export default {
|
|||
// 列表处理(算row)
|
||||
baseFormRowDispose(arr, resultArr) {
|
||||
let searchSpan = 0
|
||||
let tempArr = [];
|
||||
let tempArr = []
|
||||
arr.forEach(item => {
|
||||
let spanNum = item.row * 1 || 12;
|
||||
searchSpan += spanNum;
|
||||
let spanNum = item.row * 1 || 12
|
||||
searchSpan += spanNum
|
||||
if (searchSpan > 24) {
|
||||
resultArr.push({elCol: tempArr});
|
||||
searchSpan = spanNum;
|
||||
tempArr = [];
|
||||
tempArr.push(item);
|
||||
resultArr.push({ elCol: tempArr })
|
||||
searchSpan = spanNum
|
||||
tempArr = []
|
||||
tempArr.push(item)
|
||||
} else {
|
||||
tempArr.push(item);
|
||||
tempArr.push(item)
|
||||
}
|
||||
})
|
||||
if (tempArr.length) {
|
||||
resultArr.push({elCol: tempArr});
|
||||
resultArr.push({ elCol: tempArr })
|
||||
}
|
||||
},
|
||||
//按钮事件
|
||||
|
@ -324,8 +363,8 @@ export default {
|
|||
//主表相关事件
|
||||
//主表下拉找值
|
||||
selectValueGeTHandle(item, row, data) {
|
||||
this.$set(this.tableData[row.index], item.id, data);
|
||||
this.$set(this.tableData[row.index], "selectflag", true);
|
||||
this.$set(this.tableData[row.index], item.id, data)
|
||||
this.$set(this.tableData[row.index], 'selectflag', true)
|
||||
},
|
||||
//主表按钮
|
||||
async tableButtonHandle(row, item) {
|
||||
|
@ -334,27 +373,27 @@ export default {
|
|||
} else if (item.type === 'view') {
|
||||
this.viewDIalogHandle(row.id)
|
||||
} else if (item.type === 'dele') {
|
||||
this.$confirm("是否删除此行?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
this.$confirm('是否删除此行?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
this.deleRowHanlde(row.id)
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
});
|
||||
})
|
||||
} else if (item.type === 'send') {
|
||||
this.sendHandle(row.id)
|
||||
}
|
||||
},
|
||||
// 分页器更新数据
|
||||
currentChangeHandle(pageModel) {
|
||||
this.pageModel = pageModel;
|
||||
this.pageModel = pageModel
|
||||
this.$nextTick(() => {
|
||||
this.searchHandle()
|
||||
});
|
||||
})
|
||||
},
|
||||
//dialog表单通过验证准备提交
|
||||
async onSubmitHandele() {
|
||||
|
@ -369,13 +408,13 @@ export default {
|
|||
params.data[item.name] = item.tableData.slice(0, -1)
|
||||
})
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "saveMdmShowDetailsData",
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'saveMdmShowDetailsData'
|
||||
}, params)
|
||||
if (res.status === '200') {
|
||||
this.initTree(this.treeObj.label, this.treeObj.upId)
|
||||
this.$vmNews("新建成功", "success")
|
||||
this.$vmNews('新建成功', 'success')
|
||||
this.searchHandle()
|
||||
this.dialogShow = false
|
||||
}
|
||||
|
@ -390,13 +429,13 @@ export default {
|
|||
params.data[item.name] = item.tableData.slice(0, -1)
|
||||
})
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "updateMdmShowDetailsData",
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'updateMdmShowDetailsData'
|
||||
}, params)
|
||||
if (res.status === '200') {
|
||||
this.initTree(this.treeObj.label, this.treeObj.upId)
|
||||
this.$vmNews("修改成功", "success")
|
||||
this.$vmNews('修改成功', 'success')
|
||||
this.searchHandle()
|
||||
this.dialogShow = false
|
||||
}
|
||||
|
@ -404,24 +443,24 @@ export default {
|
|||
|
||||
},
|
||||
dialogTableAddHandle(info, index) {
|
||||
this.dialogTabaleInfo[index].tableData.push({});
|
||||
this.dialogTabaleInfo[index].tableData.push({})
|
||||
},
|
||||
dialogTableDeleHandle(row, item, tableInfo, index) {
|
||||
if (item.type === "dele") {
|
||||
this.$confirm("是否删除此行?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
if (item.type === 'dele') {
|
||||
this.$confirm('是否删除此行?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
this.dialogTabaleInfo[index].tableData.splice(row.index, 1);
|
||||
this.dialogTabaleInfo[index].tableData.splice(row.index, 1)
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功!",
|
||||
});
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
})
|
||||
.catch((error) => {
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
//dialog表格提交
|
||||
|
@ -434,17 +473,17 @@ export default {
|
|||
this.newFlag = true
|
||||
this.lookFlag = false
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShowDetails"
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShowDetails'
|
||||
}, {
|
||||
mdmCode: this.$route.meta.mdmCode,
|
||||
showType: "3"
|
||||
showType: '3'
|
||||
})
|
||||
// 主表数据处理
|
||||
res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds.forEach(item => {
|
||||
item.mdmModuleDbFiledsRules.forEach(ele => {
|
||||
if (ele.ruleCode === "required" || ele.ruleCode === "disabled") {
|
||||
if (ele.ruleCode === 'required' || ele.ruleCode === 'disabled') {
|
||||
if (!ele.ruleValue) {
|
||||
item[ele.ruleCode] = false
|
||||
} else {
|
||||
|
@ -464,7 +503,7 @@ export default {
|
|||
res.attribute.sublistMdmModuleDb.forEach(table => {
|
||||
table.sublistMdmModuleDbFileds.forEach(item => {
|
||||
item.mdmModuleDbFiledsRules.forEach(ele => {
|
||||
if (ele.ruleCode === "required" || ele.ruleCode === "disabled") {
|
||||
if (ele.ruleCode === 'required' || ele.ruleCode === 'disabled') {
|
||||
if (!ele.ruleValue) {
|
||||
item[ele.ruleCode] = false
|
||||
} else {
|
||||
|
@ -483,28 +522,33 @@ export default {
|
|||
tableData: [{}],
|
||||
detailFields: deepClone(table.sublistMdmModuleDbFileds),
|
||||
title: table.remark,
|
||||
name: table.dbName,
|
||||
name: table.dbName
|
||||
}
|
||||
this.dialogTabaleInfo.push({...tempObj})
|
||||
this.dialogTabaleInfo.push({ ...tempObj })
|
||||
})
|
||||
this.dialogShow = true
|
||||
},
|
||||
searchHandle() {
|
||||
let tempSearch = JSON.parse(JSON.stringify(this.searchForm))
|
||||
Object.keys(tempSearch).forEach((key) => {
|
||||
tempSearch[key.split(".")[1]] = tempSearch[key]
|
||||
})
|
||||
console.log(tempSearch, 'tempSearch')
|
||||
let obj = {}
|
||||
this.searchFormRow.forEach(item => {
|
||||
item.elCol.forEach(ele => {
|
||||
if (this.searchForm[ele.enName]) {
|
||||
if (this.searchForm[ele.id]) {
|
||||
if (obj[ele.dbName]) {
|
||||
obj[ele.dbName].push({
|
||||
fields: ele.enName,
|
||||
fieldsType: ele.filedType,
|
||||
values: this.searchForm[ele.enName]
|
||||
values: this.searchForm[ele.id]
|
||||
})
|
||||
} else {
|
||||
obj[ele.dbName] = [{
|
||||
fields: ele.enName,
|
||||
fieldsType: ele.filedType,
|
||||
values: this.searchForm[ele.enName]
|
||||
values: this.searchForm[ele.id]
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
@ -512,7 +556,7 @@ export default {
|
|||
})
|
||||
let params = {
|
||||
queryCondition: [],
|
||||
detailQueryCondition: [],
|
||||
detailQueryCondition: []
|
||||
}
|
||||
Object.keys(obj).forEach(key => {
|
||||
if (key === this.mainTableName) {
|
||||
|
@ -527,7 +571,7 @@ export default {
|
|||
})
|
||||
if (this.treeActiveRow.id) {
|
||||
let obj = {
|
||||
fields: "id",
|
||||
fields: 'id',
|
||||
values: this.treeActiveRow.arrId,
|
||||
fieldsType: '5'
|
||||
}
|
||||
|
@ -541,16 +585,16 @@ export default {
|
|||
this.lookFlag = false
|
||||
//初始化模版
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShowDetails"
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShowDetails'
|
||||
}, {
|
||||
mdmCode: this.$route.meta.mdmCode,
|
||||
showType: "4"
|
||||
showType: '4'
|
||||
})
|
||||
res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds.forEach(item => {
|
||||
item.mdmModuleDbFiledsRules.forEach(ele => {
|
||||
if (ele.ruleCode === "required" || ele.ruleCode === "disabled") {
|
||||
if (ele.ruleCode === 'required' || ele.ruleCode === 'disabled') {
|
||||
if (!ele.ruleValue) {
|
||||
item[ele.ruleCode] = false
|
||||
} else {
|
||||
|
@ -560,7 +604,6 @@ export default {
|
|||
item[ele.ruleCode] = ele.ruleValue
|
||||
}
|
||||
|
||||
|
||||
item['id'] = item.enName
|
||||
})
|
||||
}
|
||||
|
@ -583,15 +626,15 @@ export default {
|
|||
tableData: [{}],
|
||||
detailFields: deepClone(table.sublistMdmModuleDbFileds),
|
||||
title: table.remark,
|
||||
name: table.dbName,
|
||||
name: table.dbName
|
||||
}
|
||||
this.dialogTabaleInfo.push({...tempObj})
|
||||
this.dialogTabaleInfo.push({ ...tempObj })
|
||||
})
|
||||
//初始化数据
|
||||
const data = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShowDetailsData",
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShowDetailsData'
|
||||
}, {
|
||||
mdmCode: this.$route.meta.mdmCode,
|
||||
id: id
|
||||
|
@ -612,16 +655,16 @@ export default {
|
|||
this.lookFlag = true
|
||||
//初始化模版
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShowDetails"
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShowDetails'
|
||||
}, {
|
||||
mdmCode: this.$route.meta.mdmCode,
|
||||
showType: "5"
|
||||
showType: '5'
|
||||
})
|
||||
res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds.forEach(item => {
|
||||
item.mdmModuleDbFiledsRules.forEach(ele => {
|
||||
if (ele.ruleCode === "required" || ele.ruleCode === "disabled") {
|
||||
if (ele.ruleCode === 'required' || ele.ruleCode === 'disabled') {
|
||||
if (!ele.ruleValue) {
|
||||
item[ele.ruleCode] = false
|
||||
} else {
|
||||
|
@ -651,15 +694,15 @@ export default {
|
|||
tableData: [{}],
|
||||
detailFields: deepClone(table.sublistMdmModuleDbFileds),
|
||||
title: table.remark,
|
||||
name: table.dbName,
|
||||
name: table.dbName
|
||||
}
|
||||
this.dialogTabaleInfo.push({...tempObj})
|
||||
this.dialogTabaleInfo.push({ ...tempObj })
|
||||
})
|
||||
//初始化数据
|
||||
const data = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShowDetailsData",
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShowDetailsData'
|
||||
}, {
|
||||
mdmCode: this.$route.meta.mdmCode,
|
||||
id: id
|
||||
|
@ -677,15 +720,15 @@ export default {
|
|||
//删除此行
|
||||
async deleRowHanlde(id) {
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "deleteMdmShowDetailsData",
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'deleteMdmShowDetailsData'
|
||||
}, {
|
||||
mdmCode: this.$route.meta.mdmCode,
|
||||
id: id
|
||||
})
|
||||
if (res.status === '200') {
|
||||
this.$vmNews("删除成功!", "success")
|
||||
this.$vmNews('删除成功!', 'success')
|
||||
this.searchHandle()
|
||||
this.initTree(this.treeObj.label, this.treeObj.upId)
|
||||
}
|
||||
|
@ -697,14 +740,14 @@ export default {
|
|||
if (data.children) {
|
||||
this.treeIdHandle(data.children, arrId)
|
||||
}
|
||||
this.pageModel.pageIndex = 1;
|
||||
this.pageModel.total = 0;
|
||||
this.pageModel.limit = 10;
|
||||
this.searchForm = {};
|
||||
this.tableData = [];
|
||||
this.lookFlag = false;
|
||||
this.newFlag = false;
|
||||
this.treeActiveRow = {...data, arrId: arrId}
|
||||
this.pageModel.pageIndex = 1
|
||||
this.pageModel.total = 0
|
||||
this.pageModel.limit = 10
|
||||
this.searchForm = {}
|
||||
this.tableData = []
|
||||
this.lookFlag = false
|
||||
this.newFlag = false
|
||||
this.treeActiveRow = { ...data, arrId: arrId }
|
||||
this.searchHandle()
|
||||
}
|
||||
,
|
||||
|
@ -720,9 +763,9 @@ export default {
|
|||
//下发方法
|
||||
async sendHandle(id) {
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShowDistribute"
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShowDistribute'
|
||||
}, {
|
||||
mdmCode: this.$route.meta.mdmCode,
|
||||
id: id
|
||||
|
@ -737,8 +780,8 @@ export default {
|
|||
//应用名查找
|
||||
async appSearch(id, row) {
|
||||
const res = await getUserModuleApi({
|
||||
tl: "sysApplicationService",
|
||||
as: "application",
|
||||
tl: 'sysApplicationService',
|
||||
as: 'application',
|
||||
dj: 'getApp'
|
||||
}, {
|
||||
id: id
|
||||
|
@ -749,14 +792,14 @@ export default {
|
|||
async sendRowHandle(row) {
|
||||
let status = row.status === '1' ? 1 : 2
|
||||
if (row.status === '2') {
|
||||
this.$vmNews("发送中,请等待发送完成,再删除", 'warning')
|
||||
this.$vmNews('发送中,请等待发送完成,再删除', 'warning')
|
||||
return
|
||||
}
|
||||
console.log(row)
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "doMdmDistribute",
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'doMdmDistribute'
|
||||
}, {
|
||||
mdmCode: this.$route.meta.mdmCode,
|
||||
appID: row.appId,
|
||||
|
@ -765,7 +808,7 @@ export default {
|
|||
})
|
||||
this.$vmNews(`${res.msg}`, 'success')
|
||||
this.sendHandle(row.rowId)
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
|
@ -782,9 +825,9 @@ export default {
|
|||
,
|
||||
computed: {
|
||||
funWidth() {
|
||||
return this.mainFunData.length * 70;
|
||||
return this.mainFunData.length * 70
|
||||
}
|
||||
,
|
||||
|
||||
}
|
||||
,
|
||||
watch: {
|
||||
|
|
|
@ -147,13 +147,13 @@ const formRowShow = [
|
|||
{
|
||||
elCol: [{
|
||||
label: '源系统主键',
|
||||
prop: 'root_app_pk',
|
||||
prop: 'rootAppPk',
|
||||
tag: 'elInput',
|
||||
disabled:true,
|
||||
placeholder:"暂无数据"
|
||||
},{
|
||||
label: '源系统编码',
|
||||
prop: 'root_app_bill',
|
||||
prop: 'rootAppBill',
|
||||
tag: 'elInput',
|
||||
disabled:true,
|
||||
placeholder:"暂无数据"
|
||||
|
@ -162,13 +162,13 @@ const formRowShow = [
|
|||
{
|
||||
elCol: [{
|
||||
label: '创建时间',
|
||||
prop: 'create_time',
|
||||
prop: 'createTime',
|
||||
tag: 'elInput',
|
||||
disabled:true,
|
||||
placeholder:"暂无数据"
|
||||
},{
|
||||
label: '最新推送状态',
|
||||
prop: 'new_state',
|
||||
prop: 'newState',
|
||||
tag: 'elRadio',
|
||||
options: [
|
||||
{ label: '成功', value: 'Y' },
|
||||
|
@ -182,7 +182,7 @@ const formRowShow = [
|
|||
{
|
||||
elCol: [{
|
||||
label: '最新传输结果',
|
||||
prop: 'new_transmit_info',
|
||||
prop: 'newTransmitInfo',
|
||||
tag: 'elInput',
|
||||
type: 'textarea',
|
||||
disabled:true,
|
||||
|
@ -193,7 +193,7 @@ const formRowShow = [
|
|||
{
|
||||
elCol: [{
|
||||
label: '最新元数据',
|
||||
prop: 'root_app_new_data',
|
||||
prop: 'rootAppNewData',
|
||||
tag: 'elInput',
|
||||
type: 'textarea',
|
||||
disabled:true,
|
||||
|
@ -204,13 +204,13 @@ const formRowShow = [
|
|||
{
|
||||
elCol: [{
|
||||
label: '最新推送时间',
|
||||
prop: 'new_push_date',
|
||||
prop: 'newPushDate',
|
||||
tag: 'elInput',
|
||||
disabled:true,
|
||||
placeholder:"暂无数据"
|
||||
},{
|
||||
label: '业务日期',
|
||||
prop: 'business_date',
|
||||
prop: 'businessDate',
|
||||
tag: 'elInput',
|
||||
disabled:true,
|
||||
placeholder:"暂无数据"
|
||||
|
@ -219,13 +219,13 @@ const formRowShow = [
|
|||
{
|
||||
elCol: [{
|
||||
label: '下游系统主键',
|
||||
prop: 'new_system_number',
|
||||
prop: 'newSystemNumber',
|
||||
tag: 'elInput',
|
||||
disabled:true,
|
||||
placeholder:"暂无数据"
|
||||
},{
|
||||
label: '下游系统单号',
|
||||
prop: 'new_system_primary',
|
||||
prop: 'newSystemPrimary',
|
||||
tag: 'elInput',
|
||||
disabled:true,
|
||||
placeholder:"暂无数据"
|
||||
|
@ -234,13 +234,13 @@ const formRowShow = [
|
|||
{
|
||||
elCol: [{
|
||||
label: '处理人名称',
|
||||
prop: 'processor_name',
|
||||
prop: 'processorName',
|
||||
tag: 'elInput',
|
||||
disabled:true,
|
||||
placeholder:"暂无数据"
|
||||
},{
|
||||
label: '处理时间',
|
||||
prop: 'processing_time',
|
||||
prop: 'processingTime',
|
||||
tag: 'elInput',
|
||||
disabled:true,
|
||||
placeholder:"暂无数据"
|
||||
|
@ -249,7 +249,7 @@ const formRowShow = [
|
|||
{
|
||||
elCol: [{
|
||||
label: '处理备注 ',
|
||||
prop: 'processing_remarks',
|
||||
prop: 'processingRemarks',
|
||||
tag: 'elInput',
|
||||
type: 'textarea',
|
||||
span: 24,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<base-layout ref="baseLayout" :buttonList="buttonList" @onFuncBtn="onFuncBtn" :querySwitch="true"
|
||||
:searchBtnList="searchBtnList" :searchList="requirementList" @search="handleSearchEvent" :isPage="true"
|
||||
@pageChange="handlePageChange" @onFuncSearchBtn="onFuncSearchBtn"
|
||||
@onQuery="refresh"
|
||||
>
|
||||
<div slot="main" slot-scope="{ tableHeight }">
|
||||
<base-table ref="baseTable" :showIndex="true" :funWidth="350" :funData="funData" @onFunc="onFunc"
|
||||
|
@ -137,6 +138,11 @@ export default {
|
|||
this.GetProductionTableData()
|
||||
},
|
||||
methods: {
|
||||
//当点击重置后 设置默认状态值
|
||||
refresh(fun, form) {
|
||||
console.log(form)
|
||||
this.$set(form, 'new_state', 'Y')
|
||||
},
|
||||
// 表格数据
|
||||
async GetProductionTableData() {
|
||||
this.tabLoading = true
|
||||
|
@ -255,7 +261,7 @@ export default {
|
|||
}
|
||||
// 手工推送
|
||||
if (index == 2) {
|
||||
this.$prompt('请填写旺店通或者NC的线下单据号,方便以后排查', '提示', {
|
||||
this.$prompt('请填写线下单据号,方便以后排查', '提示', {
|
||||
confirmButtonText: '提交',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'textarea',
|
||||
|
@ -270,6 +276,7 @@ export default {
|
|||
let params =
|
||||
{
|
||||
id: row.id,
|
||||
newState: row.new_state,
|
||||
processing_remarks: value
|
||||
}
|
||||
|
||||
|
@ -332,14 +339,14 @@ export default {
|
|||
this.resetTable()
|
||||
}
|
||||
},
|
||||
async productionDeleteById(id) {
|
||||
async productionDeleteById(row) {
|
||||
const res = await option({
|
||||
tl: 'integrationTaskLivingDetailsService',
|
||||
as: 'integrationTaskLog',
|
||||
dj: 'deleteEntity'
|
||||
}, {
|
||||
id: row.id,
|
||||
new_state: row.new_state
|
||||
newState: row.new_state
|
||||
})
|
||||
if (res.status == '200') {
|
||||
this.$vmNews('删除成功', 'success')
|
||||
|
|
|
@ -26,10 +26,12 @@
|
|||
<!-- <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">
|
||||
:tableColumn="tableColumn" :funData="funData" :border="false"
|
||||
>
|
||||
<template #appId="{row}">
|
||||
<baseNewSelect v-model="row['appId']" :itemObj="{label:'name',value:'id'}"
|
||||
@seleChange="(val)=>seleChangeHanlde(val,row,'main')"></baseNewSelect>
|
||||
@seleChange="(val)=>seleChangeHanlde(val,row,'main')"
|
||||
></baseNewSelect>
|
||||
</template>
|
||||
<template #addApi="{row}">
|
||||
<div class="line" flex>
|
||||
|
@ -50,7 +52,8 @@
|
|||
@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>
|
||||
icon="el-icon-edit" type="primary"
|
||||
></el-button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
@ -87,9 +90,10 @@
|
|||
<el-select v-model="plugIn" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.pluginId"
|
||||
:label="item.pluginLabel"
|
||||
:value="item.pluginId">
|
||||
:key="item.id"
|
||||
:label="item.pluginName"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
@ -141,15 +145,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
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 baseLink from "./baseLink/index.vue"
|
||||
import baseNewSelect from "./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 baseLink from './baseLink/index.vue'
|
||||
import baseNewSelect from './baseNewSelect.vue'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
@ -158,64 +162,64 @@ export default {
|
|||
addApiOptions: [],
|
||||
deleApiOptopns: [],
|
||||
options: [],//插件op
|
||||
plugIn: "",//插件
|
||||
plugIn: '',//插件
|
||||
addSwitch: false, //dialog
|
||||
tabLoading: false, // tableloading
|
||||
tableColumn: [ //table
|
||||
{
|
||||
title: "应用列表",
|
||||
id: "appId",
|
||||
title: '应用列表',
|
||||
id: 'appId'
|
||||
},
|
||||
{
|
||||
title: "新增接口",
|
||||
id: "addApi",
|
||||
title: '新增接口',
|
||||
id: 'addApi'
|
||||
},
|
||||
{
|
||||
title: "删除接口",
|
||||
id: "deleteApi",
|
||||
},
|
||||
title: '删除接口',
|
||||
id: 'deleteApi'
|
||||
}
|
||||
],
|
||||
tableData: [], //table
|
||||
pageModel: { //page
|
||||
pageIndex: 1,
|
||||
total: 10,
|
||||
limit: 10,
|
||||
limit: 10
|
||||
},
|
||||
funData: [ //table
|
||||
{text: "删除", color: "#e44b2d"}
|
||||
{ text: '删除', color: '#e44b2d' }
|
||||
],
|
||||
addType: "1", //使用类型
|
||||
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},
|
||||
{ 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: [],
|
||||
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: "",
|
||||
};
|
||||
activedType: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onFunc(row) {
|
||||
|
@ -224,11 +228,11 @@ export default {
|
|||
confirmHandle() {
|
||||
//addType、deleteType、addList、deleteList、addPlug、deletePlug
|
||||
if (this.addType === '1' && !this.plugIn) {
|
||||
this.$vmNews("请选择使用插件", "warning")
|
||||
this.$vmNews('请选择使用插件', 'warning')
|
||||
return
|
||||
}
|
||||
if (this.addType === '2' && !this.linkData.lineData.length) {
|
||||
this.$vmNews("请配置链接对照表", "warning")
|
||||
this.$vmNews('请配置链接对照表', 'warning')
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -240,17 +244,17 @@ export default {
|
|||
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);
|
||||
});
|
||||
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 {
|
||||
|
@ -261,17 +265,17 @@ export default {
|
|||
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);
|
||||
});
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
@ -281,29 +285,29 @@ export default {
|
|||
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;
|
||||
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;
|
||||
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;
|
||||
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);
|
||||
obj['children'] = []
|
||||
this.selectDataHanlde(obj['children'], item.children)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
// 点击按钮配置事件 回显
|
||||
async configurationHanlde(row, val, key) {
|
||||
|
@ -313,66 +317,68 @@ export default {
|
|||
addApi: ['addType', 'addList', 'addPlug'],
|
||||
deleteApi: ['deleteType', 'deleteList', 'deletePlug']
|
||||
}
|
||||
this.addType = row[dist[key][0]] || "1"
|
||||
this.addType = row[dist[key][0]] || '1'
|
||||
if (this.addType === '1') {
|
||||
this.plugIn = row[dist[key][2]]
|
||||
} else {
|
||||
this.dialogWidth = "90%"
|
||||
this.dialogWidth = '90%'
|
||||
}
|
||||
const res = await getUserModuleApi({
|
||||
tl: "sysApplicationService",
|
||||
as: "application",
|
||||
dj: "debugAppApi"
|
||||
tl: 'sysApplicationService',
|
||||
as: '',
|
||||
dj: 'queryPlugAndApi'
|
||||
}, {
|
||||
id: val,
|
||||
appId: row['appId']
|
||||
})
|
||||
const res1 = await getApiModuleApi(
|
||||
{
|
||||
tl: "sysApplicationService",
|
||||
as: "application",
|
||||
dj: "debugAppApi",
|
||||
tl: 'sysApplicationService',
|
||||
as: '',
|
||||
dj: 'queryPlugAndApi'
|
||||
},
|
||||
{id: val, appId: row['appId']}
|
||||
);
|
||||
{ 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.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
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
//不知道是干啥用的
|
||||
// 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];
|
||||
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",
|
||||
'leftid',
|
||||
saveId
|
||||
);
|
||||
)
|
||||
this.lineDataHandle(
|
||||
saveId,
|
||||
this.linkData.leftData,
|
||||
"rightid",
|
||||
'rightid',
|
||||
targetid
|
||||
);
|
||||
console.log(item)
|
||||
)
|
||||
if (item.coordinate) {
|
||||
this.linkData.lineData.push(JSON.parse(item.coordinate));
|
||||
this.linkData.lineData.push(JSON.parse(item.coordinate))
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -380,8 +386,8 @@ export default {
|
|||
this.addSwitch = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.link.line = deepClone(this.linkData.lineData)
|
||||
this.$refs.link.resizeHeight();
|
||||
});
|
||||
this.$refs.link.resizeHeight()
|
||||
})
|
||||
},
|
||||
seleChangeHanlde(val, row, key) {
|
||||
let dist = {
|
||||
|
@ -390,13 +396,13 @@ export default {
|
|||
}
|
||||
|
||||
if (key === 'main') {
|
||||
this.$set(row, "addApi", "")
|
||||
this.$set(row, "deleteApi", "")
|
||||
this.$set(row, 'addApi', '')
|
||||
this.$set(row, 'deleteApi', '')
|
||||
} else {
|
||||
console.log(key)
|
||||
this.$set(row, dist[key][0], "")
|
||||
this.$set(row, dist[key][0], '')
|
||||
this.$set(row, dist[key][1], [])
|
||||
this.$set(row, dist[key][2], "")
|
||||
this.$set(row, dist[key][2], '')
|
||||
console.log(row)
|
||||
}
|
||||
|
||||
|
@ -406,19 +412,20 @@ export default {
|
|||
},
|
||||
async initSelect() {
|
||||
const plugRes = await getUserModuleApi({
|
||||
tl: "pluginService",
|
||||
as: "plugins",
|
||||
dj: "queryPluginsByType"
|
||||
tl: 'pluginService',
|
||||
as: 'plugins',
|
||||
dj: 'queryPluginsByType'
|
||||
}, {
|
||||
"pluginType": "1"
|
||||
'pluginType': '1'
|
||||
})
|
||||
this.options = plugRes.attribute
|
||||
// console.log(plugRes.attribute, 'plugRes.attribute')
|
||||
// this.options = plugRes.attribute
|
||||
},
|
||||
async init() {
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmModuleDistribute"
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmModuleDistribute'
|
||||
}, {
|
||||
id: this.$route.query.id
|
||||
})
|
||||
|
@ -429,10 +436,10 @@ export default {
|
|||
},
|
||||
async initLeftLink() {
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryMdmShowAll"
|
||||
}, {id: this.$route.query.id})
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'queryMdmShowAll'
|
||||
}, { id: this.$route.query.id })
|
||||
if (res.status === '200') {
|
||||
let arr = []
|
||||
res.attribute.forEach(item => {
|
||||
|
@ -450,8 +457,8 @@ export default {
|
|||
if (val == 2) {
|
||||
this.dialogWidth = '95%'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.link.resizeHeight();
|
||||
});
|
||||
this.$refs.link.resizeHeight()
|
||||
})
|
||||
} else {
|
||||
this.dialogWidth = '40%'
|
||||
}
|
||||
|
@ -459,68 +466,68 @@ export default {
|
|||
// dialog关闭事件
|
||||
dialogCloseHandle() {
|
||||
//重置连线组件数据
|
||||
this.linkData.lineData = [];
|
||||
this.linkData.leftData = deepClone(this.linkData.leftDataCopy);
|
||||
this.linkData.lineData = []
|
||||
this.linkData.leftData = deepClone(this.linkData.leftDataCopy)
|
||||
this.linkData.rightData = []
|
||||
//重置radio选择
|
||||
this.addType = "1";
|
||||
this.addType = '1'
|
||||
//重置select选择
|
||||
this.plugIn = "";
|
||||
this.plugIn = ''
|
||||
//宽度默认
|
||||
this.dialogWidth = '40%'
|
||||
},
|
||||
// 获取连线数据 x y坐标等等
|
||||
getLineData(data) {
|
||||
this.linkData.lineData = deepClone(data);
|
||||
this.linkData.lineData = deepClone(data)
|
||||
},
|
||||
// 页码
|
||||
currentChangeHandle(pageModel) {
|
||||
this.pageModel = pageModel;
|
||||
this.pageModel = pageModel
|
||||
this.$nextTick(() => {
|
||||
});
|
||||
})
|
||||
},
|
||||
// save
|
||||
async saveHandle() {
|
||||
let arr = []
|
||||
let flag = this.tableData.some((item, index) => {
|
||||
if (!item.appId) {
|
||||
this.$vmNews("请选择应用", "warning")
|
||||
this.$vmNews('请选择应用', 'warning')
|
||||
return true
|
||||
}
|
||||
if (arr.includes(item.appId)) {
|
||||
this.$vmNews("不允许重复选择应用", "warning")
|
||||
this.$vmNews('不允许重复选择应用', 'warning')
|
||||
return true
|
||||
}
|
||||
arr.push(item.appId)
|
||||
if (!item.addApi || !item.deleteApi) {
|
||||
this.$vmNews("请选择接口", "warning")
|
||||
this.$vmNews('请选择接口', 'warning')
|
||||
return true
|
||||
}
|
||||
if (item.addApi === item.deleteApi) {
|
||||
this.$vmNews("新增接口和删除接口不能选同一个", "warning")
|
||||
this.$vmNews('新增接口和删除接口不能选同一个', 'warning')
|
||||
return true
|
||||
}
|
||||
if (!item.addType) {
|
||||
this.$vmNews(`请配置${index + 1}行新增接口`, "warning")
|
||||
this.$vmNews(`请配置${index + 1}行新增接口`, 'warning')
|
||||
return true
|
||||
}
|
||||
if (!item.deleteType) {
|
||||
this.$vmNews(`请配置${index + 1}行删除接口`, "warning")
|
||||
this.$vmNews(`请配置${index + 1}行删除接口`, 'warning')
|
||||
return true
|
||||
}
|
||||
})
|
||||
if (flag) return
|
||||
let params = {
|
||||
id: this.$route.query.id,
|
||||
mdmModuleDistributeEntities: this.tableData,
|
||||
mdmModuleDistributeEntities: this.tableData
|
||||
}
|
||||
const res = await getUserModuleApi({
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "doSaveMdmModuleDistribute",
|
||||
tl: 'mdmService',
|
||||
as: 'mdmService',
|
||||
dj: 'doSaveMdmModuleDistribute'
|
||||
}, params)
|
||||
if (res.status === '200') {
|
||||
this.$vmNews("保存成功", "success")
|
||||
this.$vmNews('保存成功', 'success')
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
|
@ -541,9 +548,9 @@ export default {
|
|||
this.init()
|
||||
this.initSelect()
|
||||
this.initLeftLink()
|
||||
this.$emit("flashActive", 4)
|
||||
},
|
||||
};
|
||||
this.$emit('flashActive', 4)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
Loading…
Reference in New Issue