合并代码

This commit is contained in:
曹瑞 2024-06-28 19:33:47 +08:00
commit 07b75be748
163 changed files with 20142 additions and 9001 deletions

View File

@ -74,7 +74,7 @@
"vue-meta": "2.4.0", "vue-meta": "2.4.0",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "3.4.9", "vue-router": "3.4.9",
"vuedraggable": "2.24.3", "vuedraggable": "^2.24.3",
"vuex": "3.6.0", "vuex": "3.6.0",
"xlsx": "^0.17.0" "xlsx": "^0.17.0"
}, },

View File

@ -106,26 +106,16 @@ export default {
</style> </style>
<style lang="scss"> <style lang="scss">
.el-table__header-wrapper { .el-table__header-wrapper {
border-radius: 10px !important;
background: #f7f7f7 !important; background: #f7f7f7 !important;
} }
.el-table__body-wrapper { .el-button--primary{
// border-radius: 15px !important; background-color: #3877f5 !important;
// margin-top: 5px;
}
.el-table__body {
padding-top: 5px;
} }
.el-table { .el-table {
width: 100%; width: 100%;
margin-bottom: 20px;
&::before { &::before {
display: none; display: none;
} }
.el-table__body {
//-webkit-border-horizontal-spacing: 13px; //
-webkit-border-vertical-spacing: 7px; //
}
// //
thead th { thead th {
font-size: 14px; font-size: 14px;
@ -141,21 +131,20 @@ export default {
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
padding: 10px 0; padding: 10px 0;
border-top: 1px solid rgba(0, 0, 0, 0.1) !important; border-top: 0px solid rgba(0, 0, 0, 0.1) !important;
border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important; border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
background: #fff;
&:first-child { &:first-child {
border-left: 1px solid rgba(0, 0, 0, 0.1) !important; border-left: 0px solid rgba(0, 0, 0, 0.1) !important;
// border-radius: 5px 0 0 5px; // border-radius: 5px 0 0 5px;
border-radius: 10px 0 0 10px;
} }
} }
.el-table__row > td { .el-table__row > td {
font-size: 12px; font-size: 12px;
color: #333333; color: #333333;
&:last-child { &:last-child {
border-right: 1px solid rgba(0, 0, 0, 0.1) !important; border-right: 0px solid rgba(0, 0, 0, 0.1) !important;
// border-radius: 0 5px 5px 0; // border-radius: 0 5px 5px 0;
border-radius: 0 10px 10px 0;
right: 1px; right: 1px;
} }
} }

View File

@ -9,8 +9,6 @@ export function login(login_name, password) {
const data = { const data = {
loginCode:login_name, loginCode:login_name,
password, password,
} }
return request({ return request({
url: 'kangarooDataCenterV3/entranceController/option', url: 'kangarooDataCenterV3/entranceController/option',

View File

@ -0,0 +1 @@
<svg t="1719277109538" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4273" width="200" height="200"><path d="M919.113143 325.485714H104.813714v-67.803428h814.299429v-133.12a36.571429 36.571429 0 0 0-36.571429-36.571429H141.385143a36.571429 36.571429 0 0 0-36.571429 36.571429L103.862857 865.645714a36.425143 36.425143 0 0 0 36.571429 36.571429h673.865143a33.938286 33.938286 0 1 1 0 67.876571h-705.097143-0.146286a73.142857 73.142857 0 0 1-73.069714-73.142857L36.937143 93.184a73.142857 73.142857 0 0 1 73.142857-73.142857h803.693714a73.142857 73.142857 0 0 1 73.142857 73.142857v703.268571a33.938286 33.938286 0 0 1-67.803428 0V325.485714zM206.628571 215.844571a33.938286 33.938286 0 1 1 0-67.803428 33.938286 33.938286 0 0 1 0 67.803428z m203.556572 0a33.938286 33.938286 0 1 1 0-67.803428 33.938286 33.938286 0 0 1 0 67.803428z m-101.814857 0a33.938286 33.938286 0 1 1 0-67.803428 33.938286 33.938286 0 0 1 0 67.803428z m34.889143 250.148572c7.168-7.094857 26.112-7.094857 33.28 0 7.168 7.094857 7.168 29.476571 0 37.156571L265.874286 610.742857 373.76 712.923429c7.168 7.094857 8.118857 27.355429 0 35.328-9.801143 9.728-29.842286 8.192-36.571429 1.609142l-126.025142-125.805714a18.432 18.432 0 0 1 0-25.965714l132.096-132.096z m343.478857 0l132.096 132.096a18.432 18.432 0 0 1 0 26.038857l-126.098286 125.732571c-6.656 6.582857-25.6 10.752-36.571429 0-10.313143-10.24-7.094857-31.305143 0-38.4l108.397715-100.717714-111.908572-108.690286c-7.168-7.68-9.508571-26.624 0-36.059428 9.289143-9.142857 26.916571-7.094857 34.084572 0z m-135.68-26.331429c3.657143-9.508571 21.430857-15.506286 32.768-11.264 10.825143 4.022857 17.188571 19.017143 14.189714 28.525715l-119.808 329.947428c-3.657143 9.508571-20.699429 13.238857-30.281143 9.728-10.166857-3.584-21.211429-17.554286-17.554286-27.062857l120.685715-329.874286z" p-id="4274"></path></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View File

@ -0,0 +1,242 @@
<!-- 柱状图折线图 -->
<template>
<div style="width: 100%">
<span class="Breadcrumbs" v-if="Breadcrumbs">
<div v-for="(item, index) in breadcrumbsList" :key="index">
<span class="title">{{ item.title }}</span>
<span class="Separator" v-show="index + 1 != breadcrumbsList.length"
>/</span
>
</div>
</span>
<div :style="proportion" ref="echarts" id="echarts"></div>
</div>
</template>
<script>
import echarts from 'echarts'
export default {
data() {
return {
myEcharts: null,
option: {},
sidebarRetract: null,
breadcrumbsList: [
{
title: "首页",
},
{
title: "活动管理",
},
],
};
},
components: {},
computed: {},
mounted() {
this.myEcharts = echarts.init(this.$refs.echarts);
this.getEcharts();
window.addEventListener("resize", this.change);
},
watch: {
"$store.getters.sidebarRetract": {
deep: true,
handler(val) {
this.change();
},
},
DataCollection: {
deep: true,
handler(newVal, oldVal) {
this.getEcharts();
},
},
},
props: {
//
Breadcrumbs: {
type: Boolean,
default: false,
},
//
proportion: {
type: Object,
default: () => {
return {
width: "700px",
height: "700px",
};
},
},
//
title: {
type: String,
default: "",
},
//
DataCollection: {
type: Object,
require: true,
default: () => {
return {};
},
},
// // ['', '']
// columnHeader: {
// type: Array,
// required: true,
// default: () => {
// return []
// }
// },
// // ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
// Dimension: {
// type: Array,
// required: true,
// default: () => {
// return []
// }
// },
// series: {
// type: Array,
// required: true,
// default: () => {
// return []
// }
// }
},
methods: {
change() {
this.myEcharts.resize();
},
getEcharts() {
let _this = this;
const colors = [
"#224ef5",
"#e33722",
"#ffcc2c",
"#C1232B",
"#B5C334",
"#FCCE10",
"#E87C25",
"#27727B",
"#FE8463",
"#9BCA63",
"#FAD860",
"#F3A43B",
"#60C0DD",
"#D7504B",
"#C6E579",
"#F4E001",
"#F0805A",
"#26C0C0",
"#FAD860",
"#F3A43B",
"#60C0DD",
"#D7504B",
"#C6E579",
"#F4E001",
"#F0805A",
"#26C0C0",
];
this.option = {
color: colors,
title: {
text: "", //
subtext: "",
},
tooltip: {
trigger: "axis",
},
grid: {
left: "2%",
right: "2%",
bottom: "10%",
top: "2%",
containLabel: true,
},
legend: {
data: this.DataCollection.title,
align: "right",
right: 5,
textStyle: {
color: "#000",
},
itemWidth: 10,
itemHeight: 10,
itemGap: 35,
x: "center",
y: "bottom",
padding: [20, 0, 0, 0],
},
toolbox: {
show: false,
feature: {
mark: { show: true }, //
dataView: { show: true, readOnly: false }, //线
magicType: { show: true, type: ["line", "bar"] }, //
restore: { show: true }, //
saveAsImage: { show: true }, //
},
},
calculable: true,
xAxis: [
{
type: "category",
axisLabel: { interval: 0, rotate: 60 },
data: this.DataCollection.parameter,
},
],
yAxis: [
{
type: "value",
axisLine: {
show: true,
lineStyle: {
color: "#000",
},
},
"splitLine": {
"lineStyle": {
"type": "dashed", // 线
"color": "#ccc", // 线
"length": 10, // 线
"interval": 5 // 线
}
}
},
],
series: this.DataCollection.series,
};
this.myEcharts.setOption(this.option);
this.myEcharts.on("click", function (params) {
_this.echartsClick(params);
});
},
echartsClick(e) {
console.log("点击", e);
},
},
};
</script>
<style scoped lang="scss">
.Breadcrumbs {
margin: 10px 0 10px 10px;
display: flex;
font-size: 13px;
.title {
cursor: pointer;
}
.Separator {
display: inline-block;
margin: 0 9px;
color: #c0c4cc;
font-weight: 700;
}
}
</style>

View File

@ -0,0 +1,252 @@
<!-- 柱状图折线图 -->
<template>
<div style="width: 100%">
<span class="Breadcrumbs" v-if="Breadcrumbs">
<div v-for="(item, index) in breadcrumbsList" :key="index">
<span class="title">{{ item.title }}</span>
<span class="Separator" v-show="index + 1 != breadcrumbsList.length"
>/</span
>
</div>
</span>
<div :style="proportion" ref="echarts" id="echarts"></div>
</div>
</template>
<script>
import echarts from 'echarts'
export default {
data() {
return {
myEcharts: null,
option: {},
sidebarRetract: null,
breadcrumbsList: [
{
title: "首页",
},
{
title: "活动管理",
},
],
};
},
components: {},
computed: {},
mounted() {
this.myEcharts = echarts.init(this.$refs.echarts);
this.getEcharts();
window.addEventListener("resize", this.change);
},
watch: {
"$store.getters.sidebarRetract": {
deep: true,
handler(val) {
this.change();
},
},
DataCollection: {
deep: true,
handler(newVal, oldVal) {
this.getEcharts();
},
},
},
props: {
//
Breadcrumbs: {
type: Boolean,
default: false,
},
//
proportion: {
type: Object,
default: () => {
return {
width: "700px",
height: "700px",
};
},
},
//
title: {
type: String,
default: "",
},
//
DataCollection: {
type: Object,
require: true,
default: () => {
return {};
},
},
// // ['', '']
// columnHeader: {
// type: Array,
// required: true,
// default: () => {
// return []
// }
// },
// // ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
// Dimension: {
// type: Array,
// required: true,
// default: () => {
// return []
// }
// },
// series: {
// type: Array,
// required: true,
// default: () => {
// return []
// }
// }
},
methods: {
change() {
this.myEcharts.resize();
},
getEcharts() {
let _this = this;
const colors = [
"#224ef5",
"#e33722",
"#ffcc2c",
"#C1232B",
"#B5C334",
"#FCCE10",
"#E87C25",
"#27727B",
"#FE8463",
"#9BCA63",
"#FAD860",
"#F3A43B",
"#60C0DD",
"#D7504B",
"#C6E579",
"#F4E001",
"#F0805A",
"#26C0C0",
"#FAD860",
"#F3A43B",
"#60C0DD",
"#D7504B",
"#C6E579",
"#F4E001",
"#F0805A",
"#26C0C0",
];
this.option = {
color: colors,
title: {
text: "", //
subtext: "",
},
tooltip: {
trigger: "axis",
},
grid: {
left: "2%",
right: "2%",
bottom: "10%",
top: "2%",
containLabel: true,
},
legend: {
data: this.DataCollection.title,
align: "right",
right: 5,
textStyle: {
color: "#fff",
},
itemWidth: 10,
itemHeight: 10,
itemGap: 35,
x: "center",
y: "bottom",
padding: [20, 0, 0, 0],
},
toolbox: {
show: false,
feature: {
mark: { show: true }, //
dataView: { show: true, readOnly: false }, //线
magicType: { show: true, type: ["line", "bar"] }, //
restore: { show: true }, //
saveAsImage: { show: true }, //
},
},
calculable: true,
xAxis: [
{
type: "category",
axisLabel: { interval: 0, rotate: 60,color:'#01E5EB' },
axisLine: {
show: true,
lineStyle: {
color: "#01E5EB",
},
},
data: this.DataCollection.parameter,
},
],
yAxis: [
{
type: "value",
axisLine: {
show: true,
lineStyle: {
color: "#01E5EB",
},
},
axisLabel:{
color:'#01E5EB'
},
"splitLine": {
"lineStyle": {
"type": "dashed", // 线
"color": "#5679ac", // 线
"length": 10, // 线
"interval": 5 // 线
}
}
},
],
series: this.DataCollection.series,
};
this.myEcharts.setOption(this.option);
this.myEcharts.on("click", function (params) {
_this.echartsClick(params);
});
},
echartsClick(e) {
console.log("点击", e);
},
},
};
</script>
<style scoped lang="scss">
.Breadcrumbs {
margin: 10px 0 10px 10px;
display: flex;
font-size: 13px;
.title {
cursor: pointer;
}
.Separator {
display: inline-block;
margin: 0 9px;
color: #c0c4cc;
font-weight: 700;
}
}
</style>

View File

@ -6,7 +6,7 @@
> >
<template v-for="(item, index) in topMenus"> <template v-for="(item, index) in topMenus">
<el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber" <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber"
><svg-icon :icon-class="item.meta.menuIcon" /> ><svg-icon :icon-class="item.meta.icon" />
{{ item.meta.title }}</el-menu-item {{ item.meta.title }}</el-menu-item
> >
</template> </template>
@ -19,7 +19,7 @@
:index="item.path" :index="item.path"
:key="index" :key="index"
v-if="index >= visibleNumber" v-if="index >= visibleNumber"
><svg-icon :icon-class="item.meta.menuIcon" /> ><svg-icon :icon-class="item.meta.icon" />
{{ item.meta.title }}</el-menu-item> {{ item.meta.title }}</el-menu-item>
</template> </template>
</el-submenu> </el-submenu>

View File

@ -324,7 +324,7 @@ export default {
pageModel: { pageModel: {
total: 0, total: 0,
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 100,
}, },
// //
clearState: 0, clearState: 0,
@ -545,7 +545,7 @@ export default {
}, },
refresh() { refresh() {
this.ruleForm = Object.assign({}, ""); this.ruleForm = Object.assign({}, "");
this.$emit("onQuery", this.mergeParam(true)); this.$emit("onQuery", this.mergeParam(true),this.ruleForm);
}, },
testEnter() { testEnter() {
if (this.enterClickType) { if (this.enterClickType) {

View File

@ -5,91 +5,118 @@
--> -->
<template> <template>
<el-form validate-on-rule-change :model="ruleForm" :rules="rules" label-position="top" ref="ruleForm" <el-form validate-on-rule-change :model="ruleForm" :rules="rules" label-position="top" ref="ruleForm"
label-width="100px"> label-width="100px"
>
<el-row :gutter="24" v-for="(item, index) in formRow" :key="index" style="margin-bottom: 17px;"> <el-row :gutter="24" v-for="(item, index) in formRow" :key="index" style="margin-bottom: 17px;">
<el-col v-for="(row, indexRow) in item.elCol" :span="row.span ? row.span : spanNumber" :key="indexRow"> <el-col v-for="(row, indexRow) in item.elCol" :span="row.span ? row.span : spanNumber" :key="indexRow">
<el-form-item :prop="row.prop" :style="`display: flex;margin-bottom: ${marginBottom}px;`" <el-form-item :prop="row.prop" :style="`display: flex;margin-bottom: ${marginBottom}px;`"
v-if="row.show != false" :class="(rules[row.prop] ? 'ruleFormClass ' : '')"> v-if="row.show != false" :class="(rules[row.prop] ? 'ruleFormClass ' : '')"
>
<!-- <span class="label" slot="label" style="width: 25%;">{{row.label}}</span> --> <!-- <span class="label" slot="label" style="width: 25%;">{{row.label}}</span> -->
<div class="single label" v-if="row.label" slot="label" <div class="single label" v-if="row.label" slot="label"
:style="`width: ${spanWidth};` + `justify-content: ${justifyContent};`" flex> :style="`width: ${spanWidth};` + `justify-content: ${justifyContent};`" flex
>
<span class="label">{{ row.label }}</span> <span class="label">{{ row.label }}</span>
</div> </div>
<el-input v-model="ruleForm[row.prop]" v-if="row.tag === 'password'" type="password" show-password clearable auto-complete="off" placeholder="密码" @keyup.enter.native="handleLogin" :disabled="row.disabled ? row.disabled : false"> <el-input v-model="ruleForm[row.prop]" v-if="row.tag === 'password'" type="password" show-password clearable
auto-complete="off" placeholder="密码" @keyup.enter.native="handleLogin"
:disabled="row.disabled ? row.disabled : false"
>
<svg-icon <svg-icon
slot="prefix" slot="prefix"
icon-class="password" icon-class="password"
class="el-input__icon input-icon" class="el-input__icon input-icon"
/> />
</el-input> </el-input>
<el-input v-model="ruleForm[row.prop]" clearable :disabled="row.disabled ? row.disabled : false" <el-input v-model="ruleForm[row.prop]" clearable :disabled="row.disabled || disabled"
:rows="row.rows ? row.rows : 2" :type="row.type ? row.type : 'text'" :maxlength="row.maxlength ? row.maxlength : ''" :rows="row.rows ? row.rows : 2" :type="row.type ? row.type : 'text'"
:maxlength="row.maxlength ? row.maxlength : ''"
:placeholder="!row.placeholder ? '请输入' : row.placeholder" v-if="row.tag === 'elInput'" :placeholder="!row.placeholder ? '请输入' : row.placeholder" v-if="row.tag === 'elInput'"
@blur="searchByStationName(row.prop)" min="1" @input="row.rules ? integerNumber(row) : ''"> @blur="searchByStationName(row.prop)" min="1" @input="row.rules ? integerNumber(row) : ''"
@change="row.changeRemind?changeRemind(row):''"
>
</el-input> </el-input>
<el-input-number v-if="row.tag === 'elInputNumber'" v-model="ruleForm[row.prop]" style="width: 100%;" <el-input-number v-if="row.tag === 'elInputNumber'" v-model="ruleForm[row.prop]" style="width: 100%;"
:disabled="row.disabled ? row.disabled : false" :precision="row.precisionNum ? row.precisionNum : 0" :disabled="row.disabled ? row.disabled : false"
:precision="row.precisionNum ? row.precisionNum : 0"
:step="row.stepNum ? row.stepNum : 1" @change="handleChange" :min="0" :step="row.stepNum ? row.stepNum : 1" @change="handleChange" :min="0"
:max="row.maxNum ? row.maxNum : 99999" :max="row.maxNum ? row.maxNum : 99999"
:label="!row.placeholder ? '描述文字' : row.placeholder"></el-input-number> :label="!row.placeholder ? '描述文字' : row.placeholder"
></el-input-number>
<!-- <div v-if="row.prop=='address'" id="container" <!-- <div v-if="row.prop=='address'" id="container"
style="display:none;margin-top:30px;width: 730px;margin:0 auto;height: 590px;border: 1px solid gray;overflow:hidden;"> style="display:none;margin-top:30px;width: 730px;margin:0 auto;height: 590px;border: 1px solid gray;overflow:hidden;">
</div> --> </div> -->
<el-switch v-if="row.tag === 'elSwitch'" v-model="ruleForm[row.prop]" :active-text="row.activeText" <el-switch v-if="row.tag === 'elSwitch'" v-model="ruleForm[row.prop]" :active-text="row.activeText"
@change="switchChange($event, index, indexRow, row)" :inactive-text="row.inactiveText" @change="switchChange($event, index, indexRow, row)" :inactive-text="row.inactiveText"
:active-value="row.activeValue ? row.activeValue : true" :active-value="row.activeValue ? row.activeValue : true"
:inactive-value="row.inactiveValue || row.inactiveValue == 0 ? row.inactiveValue : false"> :inactive-value="row.inactiveValue || row.inactiveValue == 0 ? row.inactiveValue : false"
>
</el-switch> </el-switch>
<el-date-picker v-model="ruleForm[row.prop]" v-if="row.tag === 'elDatePicker'" class="w-100" <el-date-picker v-model="ruleForm[row.prop]" v-if="row.tag === 'elDatePicker'" class="w-100"
:class="{ one: row.type ? 'date' : row.type }" :disabled="row.disabled ? row.disabled : false" :class="{ one: row.type ? 'date' : row.type }" :disabled="row.disabled ? row.disabled : false"
:value-format="!row.valueFormat ? 'yyyy-MM-dd' : row.valueFormat" range-separator="至" :value-format="!row.valueFormat ? 'yyyy-MM-dd' : row.valueFormat" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" :type="!row.type ? 'date' : row.type" start-placeholder="开始日期" end-placeholder="结束日期" :type="!row.type ? 'date' : row.type"
:placeholder="!row.placeholder ? '请选择' : row.placeholder"> :placeholder="!row.placeholder ? '请选择' : row.placeholder"
>
</el-date-picker> </el-date-picker>
<el-radio-group v-model="ruleForm[row.prop]" v-if="row.tag === 'elRadio'" @input="changeRadio($event,index,indexRow,row)" <el-radio-group v-model="ruleForm[row.prop]" v-if="row.tag === 'elRadio'"
:disabled="row.disabled ? row.disabled : false"> @input="changeRadio($event,index,indexRow,row)"
:disabled="row.disabled ? row.disabled : false"
>
<el-radio v-for="el in row.options" :label="el.value" :key="el.value">{{ el.label }}</el-radio> <el-radio v-for="el in row.options" :label="el.value" :key="el.value">{{ el.label }}</el-radio>
</el-radio-group> </el-radio-group>
<div @click="elDialogClick(row, index, indexRow)" @mouseover="elDialogHover(row)" <div @click="elDialogClick(row, index, indexRow)" @mouseover="elDialogHover(row)"
@mouseleave="elDialogLeave(row)" v-if="row.tag === 'elDialog'" class="elDialog" @mouseleave="elDialogLeave(row)" v-if="row.tag === 'elDialog'" class="elDialog"
:style="{ 'background-color': row.disabled ? '#F5FAF7' : '#fff', 'curpur': row.disabled ? 'pointer' : 'default' }"> :style="{ 'background-color': row.disabled ? '#F5FAF7' : '#fff', 'curpur': row.disabled ? 'pointer' : 'default' }"
>
<!-- ,background-color:row.disabled?'#c0c4cc':'#fff' --> <!-- ,background-color:row.disabled?'#c0c4cc':'#fff' -->
<p :style="{ color: ruleForm[row.prop] ? '#000' : '#c0c4cc' }" class="showText" <p :style="{ color: ruleForm[row.prop] ? '#000' : '#c0c4cc' }" class="showText"
@click="elDialogClick(row, index, indexRow)">{{ ruleForm[row.prop] ? ruleForm[row.prop] : @click="elDialogClick(row, index, indexRow)"
'请点击选择' }} >{{
ruleForm[row.prop] ? ruleForm[row.prop] :
'请点击选择'
}}
<!-- <el-input v-model="ruleForm[row.prop]"></el-input> --> <!-- <el-input v-model="ruleForm[row.prop]"></el-input> -->
</p> </p>
<!-- <i class="el-icon-more " v-if="row.elDialogHoverType"></i> --> <!-- <i class="el-icon-more " v-if="row.elDialogHoverType"></i> -->
<i class="el-icon-more " @click="elDialogClick(row, index, indexRow)" <i class="el-icon-more " @click="elDialogClick(row, index, indexRow)"
v-if="!row.disabled && !ruleForm[row.prop]"></i> v-if="!row.disabled && !ruleForm[row.prop]"
></i>
<i class="el-icon-circle-close " v-if="!row.disabled && ruleForm[row.prop] && row.elDialogHoverType" <i class="el-icon-circle-close " v-if="!row.disabled && ruleForm[row.prop] && row.elDialogHoverType"
@click.stop="resetField(row.prop)" style="margin-left: 10px;"></i> @click.stop="resetField(row.prop)" style="margin-left: 10px;"
></i>
</div> </div>
<div v-if="row.tag === 'elLook'"> <div v-if="row.tag === 'elLook'">
{{ ruleForm[row.prop] }} {{ ruleForm[row.prop] }}
</div> </div>
<el-select class="w-100" v-model="ruleForm[row.prop]" filterable <el-select class="w-100" v-model="ruleForm[row.prop]" filterable
@change="selectChange($event, index, indexRow, row.options)" :disabled="row.disabled?row.disabled:false" @change="selectChange($event, index, indexRow, row.options,row)"
:disabled="row.disabled?row.disabled:false"
:clearable="row.clearable ? row.clearable : true" :clearable="row.clearable ? row.clearable : true"
:placeholder="!row.placeholder ? '请选择' : row.placeholder" v-if="row.tag === 'elSelect'"> :placeholder="!row.placeholder ? '请选择' : row.placeholder" v-if="row.tag === 'elSelect'"
>
<el-option v-for="(el, index) in row.options" <el-option v-for="(el, index) in row.options"
:key="!row.optionValue ? el['value'] : el[row.optionValue]" :key="!row.optionValue ? el['value'] : el[row.optionValue]"
:label="!row.optionLabel ? el['label'] : el[row.optionLabel]" :label="!row.optionLabel ? el['label'] : el[row.optionLabel]"
:value="!row.optionValue ? el['value'] : el[row.optionValue]"> :value="!row.optionValue ? el['value'] : el[row.optionValue]"
>
</el-option> </el-option>
</el-select> </el-select>
<el-select class="w-100" v-model="ruleForm[row.prop]" multiple :disabled="row.disabled?row.disabled:false" <el-select class="w-100" v-model="ruleForm[row.prop]" multiple :disabled="row.disabled?row.disabled:false"
:clearable="row.clearable" :placeholder="!row.placeholder ? '请选择' : row.placeholder" :clearable="row.clearable" :placeholder="!row.placeholder ? '请选择' : row.placeholder"
v-if="row.tag === 'elMultiple'"> v-if="row.tag === 'elMultiple'"
>
<el-option v-for="el in row.options" :key="!row.optionValue ? el['value'] : el[row.optionValue]" <el-option v-for="el in row.options" :key="!row.optionValue ? el['value'] : el[row.optionValue]"
:label="!row.optionLabel ? el['label'] : el[row.optionLabel]" :label="!row.optionLabel ? el['label'] : el[row.optionLabel]"
:value="!row.optionValue ? el['value'] : el[row.optionValue]"> :value="!row.optionValue ? el['value'] : el[row.optionValue]"
>
</el-option> </el-option>
</el-select> </el-select>
<treeselect v-if="row.tag === 'elTreeSelect'" v-model="ruleForm[row.prop]" :normalizer="normalizer" <treeselect v-if="row.tag === 'elTreeSelect'" v-model="ruleForm[row.prop]" :normalizer="normalizer"
:options="delTreeChildren(row.options)" :multiple="row.multiple?row.multiple:false" :options="delTreeChildren(row.options)" :multiple="row.multiple?row.multiple:false"
:disabled="row.disabled?row.disabled:false" @clear="treeSelectClear" ref="selectTree" :disabled="row.disabled?row.disabled:false" @clear="treeSelectClear" ref="selectTree"
:placeholder="!row.placeholder?'请选择':row.placeholder" @select="selectTree" /> :placeholder="!row.placeholder?'请选择':row.placeholder" @select="selectTree"
/>
<slot :name="row.slotName" v-if="row.tag === 'elSlot'" :row="ruleForm"></slot> <slot :name="row.slotName" v-if="row.tag === 'elSlot'" :row="ruleForm"></slot>
<!-- <upload-file v-if="row.tag === 'uploadFile'" :showImgPath="ruleForm[row.prop]" ref="imgFile" <!-- <upload-file v-if="row.tag === 'uploadFile'" :showImgPath="ruleForm[row.prop]" ref="imgFile"
@onImage="row.prop == 'beforeImgList'? getbeforeImgList:row.prop == 'materialsList'? getmaterialsList:row.prop == 'getmaterialsListAfter'?getmaterialsListAfter:getImage "></upload-file> --> @onImage="row.prop == 'beforeImgList'? getbeforeImgList:row.prop == 'materialsList'? getmaterialsList:row.prop == 'getmaterialsListAfter'?getmaterialsListAfter:getImage "></upload-file> -->
@ -115,6 +142,7 @@
import { import {
checkMobile checkMobile
} from '@/utils/util' } from '@/utils/util'
export default { export default {
components: { components: {
// uploadFile, // uploadFile,
@ -155,7 +183,7 @@ export default {
default: true default: true
}, },
formdata: { formdata: {
type: Object, type: Object
}, },
justifyContent: { justifyContent: {
type: String, type: String,
@ -164,12 +192,12 @@ export default {
marginBottom: { marginBottom: {
type: String, type: String,
default: '0' default: '0'
}, }
}, },
data() { data() {
return { return {
// //
ruleForm: {}, ruleForm: {}
} }
}, },
watch: { watch: {
@ -177,16 +205,20 @@ export default {
immediate: true, // immediate: true, //
deep: true, // deep: true, //
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.$emit('dataChanges') this.$emit('dataChanges', newVal, oldVal)
} }
} }
}, },
created() { }, created() {
},
mounted() { mounted() {
// this.ruleForm = this.formdata // this.ruleForm = this.formdata
}, },
computed: {}, computed: {},
methods: { methods: {
changeRemind() {
this.$emit('changeRemind', this.ruleForm)
},
integerNumber(row) { integerNumber(row) {
// row.rules?(v)=>()):'' // row.rules?(v)=>()):''
// @input="(v)=>(row.row.number=v.replace(/[^\d]/g,''))" // @input="(v)=>(row.row.number=v.replace(/[^\d]/g,''))"
@ -230,36 +262,36 @@ export default {
if (type == 'address') { if (type == 'address') {
let address = this.ruleForm[type] let address = this.ruleForm[type]
let that = this let that = this
var map = new BMap.Map("container"); var map = new BMap.Map('container')
map.centerAndZoom(address, 18); map.centerAndZoom(address, 18)
map.enableScrollWheelZoom(); // map.enableScrollWheelZoom() //
map.enableContinuousZoom(); // map.enableContinuousZoom() //
map.addControl(new BMap.NavigationControl()); // map.addControl(new BMap.NavigationControl()) //
map.addControl(new BMap.OverviewMapControl()); // map.addControl(new BMap.OverviewMapControl()) //
map.addControl(new BMap.OverviewMapControl({ map.addControl(new BMap.OverviewMapControl({
isOpen: true, isOpen: true,
anchor: BMAP_ANCHOR_BOTTOM_RIGHT anchor: BMAP_ANCHOR_BOTTOM_RIGHT
})); // })) //
var localSearch = new BMap.LocalSearch(map); var localSearch = new BMap.LocalSearch(map)
localSearch.enableAutoViewport(); // localSearch.enableAutoViewport() //
map.clearOverlays(); // map.clearOverlays() //
var keyword = address var keyword = address
localSearch.setSearchCompleteCallback(function(searchResult) { localSearch.setSearchCompleteCallback(function(searchResult) {
var poi = searchResult.getPoi(0); var poi = searchResult.getPoi(0)
map.centerAndZoom(poi.point, 13); map.centerAndZoom(poi.point, 13)
var marker = new BMap.Marker(new BMap.Point(poi.point.lng, poi.point var marker = new BMap.Marker(new BMap.Point(poi.point.lng, poi.point
.lat)); // .lat)) //
map.addOverlay(marker); map.addOverlay(marker)
var content = keyword + "<br/><br/>经度:" + poi.point.lng + "<br/>纬度:" + poi.point.lat; var content = keyword + '<br/><br/>经度:' + poi.point.lng + '<br/>纬度:' + poi.point.lat
that.ruleForm['lng'] = poi.point.lng that.ruleForm['lng'] = poi.point.lng
that.ruleForm['lat'] = poi.point.lat that.ruleForm['lat'] = poi.point.lat
var infoWindow = new BMap.InfoWindow("<p style='font-size:14px;'>" + content + "</p>"); var infoWindow = new BMap.InfoWindow('<p style=\'font-size:14px;\'>' + content + '</p>')
marker.addEventListener("click", function () { marker.addEventListener('click', function() {
this.openInfoWindow(infoWindow); this.openInfoWindow(infoWindow)
}); })
// marker.setAnimation(BMAP_ANIMATION_BOUNCE); // // marker.setAnimation(BMAP_ANIMATION_BOUNCE); //
}); })
localSearch.search(keyword); localSearch.search(keyword)
} }
}, },
@ -269,21 +301,21 @@ export default {
}, },
// //
getImage(imagePath) { getImage(imagePath) {
let licenseImg = imagePath.join(",") let licenseImg = imagePath.join(',')
}, },
// //
getbeforeImgList(imagePath) { getbeforeImgList(imagePath) {
let licenseImg = imagePath.join(",") let licenseImg = imagePath.join(',')
this.$set(this.ruleForm, 'beforeImgList', licenseImg) this.$set(this.ruleForm, 'beforeImgList', licenseImg)
}, },
// //
getmaterialsList(imagePath) { getmaterialsList(imagePath) {
let licenseImg = imagePath.join(",") let licenseImg = imagePath.join(',')
this.$set(this.ruleForm, 'materialsList', licenseImg) this.$set(this.ruleForm, 'materialsList', licenseImg)
}, },
// //
getmaterialsListAfter(imagePath) { getmaterialsListAfter(imagePath) {
let licenseImg = imagePath.join(",") let licenseImg = imagePath.join(',')
this.$set(this.ruleForm, 'materialsListAfter', licenseImg) this.$set(this.ruleForm, 'materialsListAfter', licenseImg)
}, },
revealPhoto(licenseImg) { revealPhoto(licenseImg) {
@ -298,10 +330,12 @@ export default {
let newJson = [].concat.apply([], jsonData) let newJson = [].concat.apply([], jsonData)
newJson.forEach(item => { newJson.forEach(item => {
if (this.ruleForm.factoryInFlag == 1) { if (this.ruleForm.factoryInFlag == 1) {
for (let i = 0; i < this.formRow[8].elCol.length; i++) { } for (let i = 0; i < this.formRow[8].elCol.length; i++) {
}
} }
if (this.ruleForm.factoryInFlag == 0) { if (this.ruleForm.factoryInFlag == 0) {
for (let i = 0; i < this.formRow[8].elCol.length; i++) { } for (let i = 0; i < this.formRow[8].elCol.length; i++) {
}
} }
this.$set(this.ruleForm, item.prop, echoData[item.prop]) this.$set(this.ruleForm, item.prop, echoData[item.prop])
}) })
@ -349,15 +383,15 @@ export default {
resetField(field) { resetField(field) {
if (this.ruleForm[field]) { if (this.ruleForm[field]) {
this.$set(this.ruleForm, field, '') this.$set(this.ruleForm, field, '')
this.$refs['ruleForm'].clearValidate(field); // this.$refs['ruleForm'].clearValidate(field) //
} }
}, },
resetFields() { resetFields() {
this.choiceAssignment({}) this.choiceAssignment({})
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields()
}, },
// , index indexRow // , index indexRow
selectChange(val, index, indexRow, options) { selectChange(val, index, indexRow, options, row) {
let obj = {} let obj = {}
options.forEach((item) => { options.forEach((item) => {
if (item.value == val) { if (item.value == val) {
@ -365,7 +399,10 @@ export default {
} }
}) })
this.$emit('onSelect', val, index, indexRow, obj) this.$emit('onSelect', val, index, indexRow, obj)
this.$forceUpdate(); if (row.changeRemind) {
this.$emit('changeRemind', this.ruleForm)
}
this.$forceUpdate()
}, },
switchChange(val, index, indexRow, row) { switchChange(val, index, indexRow, row) {
this.$emit('switchChange', val, index, indexRow, row) this.$emit('switchChange', val, index, indexRow, row)
@ -380,10 +417,10 @@ export default {
if (valid) { if (valid) {
this.$emit('onSubmit', this.ruleForm) this.$emit('onSubmit', this.ruleForm)
} else { } else {
console.log('error submit!!'); console.log('error submit!!')
return false; return false
} }
}); })
}, },
// //
resetForm(formName) { resetForm(formName) {
@ -427,7 +464,7 @@ export default {
treeSelectClear() { treeSelectClear() {
this.$refs.selectTree.clear() this.$refs.selectTree.clear()
} }
}, }
} }
</script> </script>
<style> <style>
@ -447,10 +484,11 @@ export default {
content: '' content: ''
} }
</style> </style>
<style scoped lang='scss'> <style scoped lang="scss">
::v-deep textarea.el-textarea__inner { ::v-deep textarea.el-textarea__inner {
min-height: 100px !important; min-height: 100px !important;
} }
.label { .label {
/* @include fontBase(16px, #333333) ; */ /* @include fontBase(16px, #333333) ; */
color: #333; color: #333;

View File

@ -410,7 +410,7 @@ export default {
pageModel: { pageModel: {
total: 0, total: 0,
page: 1, page: 1,
limit: 20, pageSize: 100,
}, },
// //
clearState: 0, clearState: 0,
@ -600,7 +600,7 @@ export default {
} }
let page = { let page = {
page: this.pageModel.page, page: this.pageModel.page,
limit: this.pageModel.limit, limit: this.pageModel.pageSize,
}; };
for (let i in this.model) { for (let i in this.model) {
if (!this.model[i]) { if (!this.model[i]) {

View File

@ -36,7 +36,7 @@
<script> <script>
import baseDialog from "@/components/base/BaseNewDialog/index.vue" import baseDialog from "@/components/base/BaseNewDialog/index.vue"
import baseTree from "@/components/base/BaseMenuTree/index.vue" import baseTree from "@/components/base/BaseMenuTree/index.vue"
import baseLayout from "@/components/base/baseLayout" import baseLayout from "@/components/base/baseNewLayout"
export default { export default {
components: { components: {
baseLayout, baseLayout,

View File

@ -5,8 +5,12 @@
--> -->
<template> <template>
<div class="pageTion" flex="main:right"> <div class="pageTion" flex="main:right">
<el-pagination ref="pagination" :page-sizes="[10,20, 30, 40,100]" :total="pageModel.total" :current-page="pageModel.pageIndex" :page-size="10" <el-pagination ref="pagination" :page-sizes="[10,20, 30, 40,100]" :total="pageModel.total"
@current-change="currentChange" @size-change="sizeChange" background layout="prev, pager, next,jumper,total,sizes"> :current-page="pageModel.pageIndex"
:page-size="pageModel.pageSize"
@current-change="currentChange" @size-change="sizeChange" background
layout="prev, pager, next,jumper,total,sizes"
>
</el-pagination> </el-pagination>
</div> </div>
</template> </template>
@ -20,7 +24,8 @@
data() { data() {
return {} return {}
}, },
created() {}, created() {
},
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
}) })
@ -28,25 +33,26 @@
computed: {}, computed: {},
methods: { methods: {
sizeChange(val) { sizeChange(val) {
let pageModel = this.pageModel; let pageModel = this.pageModel
pageModel.pageSize = val; pageModel.pageSize = val
this.$emit('update:pageModel', pageModel) this.$emit('update:pageModel', pageModel)
this.$emit('onPageChange') this.$emit('onPageChange')
}, },
currentChange(val) { currentChange(val) {
let pageModel = this.pageModel; let pageModel = this.pageModel
pageModel.pageIndex = val; pageModel.pageIndex = val
this.$emit('update:pageModel', pageModel) this.$emit('update:pageModel', pageModel)
this.$emit('onPageChange') this.$emit('onPageChange')
}, }
}, }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.pageTion { .pageTion {
width: 100%; width: 100%;
margin: 10px 0; margin: 10px 0;
} }
::v-deep .el-pager li { ::v-deep .el-pager li {
background-color: #f9f9f9 !important; background-color: #f9f9f9 !important;
width: 36px !important; width: 36px !important;
@ -54,9 +60,11 @@
line-height: 36px !important; line-height: 36px !important;
border-radius: 50% !important; border-radius: 50% !important;
} }
::v-deep .el-pager .active { ::v-deep .el-pager .active {
background-color: #409EFF !important; background-color: #409EFF !important;
} }
::v-deep .el-pagination button { ::v-deep .el-pagination button {
background-color: #f9f9f9 !important; background-color: #f9f9f9 !important;
color: #333333 !important; color: #333333 !important;
@ -65,13 +73,16 @@
width: 98px !important; width: 98px !important;
height: 36px !important; height: 36px !important;
} }
::v-deep .el-pagination__total { ::v-deep .el-pagination__total {
line-height: 36px !important; line-height: 36px !important;
} }
::v-deep .el-pagination__jump { ::v-deep .el-pagination__jump {
height: 36px !important; height: 36px !important;
line-height: 36px !important; line-height: 36px !important;
} }
::v-deep .el-input__inner { ::v-deep .el-input__inner {
height: 36px !important; height: 36px !important;
line-height: 36px !important; line-height: 36px !important;

View File

@ -5,7 +5,7 @@
--> -->
<template> <template>
<base-dialog :closeEscape="true" :showClose="true" :closeModal="false" @handleConfirmClick="personConfirmClick" <base-dialog :closeEscape="true" :showClose="true" :closeModal="false" @handleConfirmClick="personConfirmClick"
:dialogVisible.sync="personDialog" class="userDialog" title="选择人员" width="1000px" top="10vh" :footerShow="true"> :dialogVisible.sync="personDialog" class="userDialog" title="选择人员" width="1200px" top="10vh" :footerShow="true">
<div class="organizationBody"> <div class="organizationBody">
<base-layout title="组织机构" style="width: 20%;border-radius: 5px;height: 350px;overflow: auto; " <base-layout title="组织机构" style="width: 20%;border-radius: 5px;height: 350px;overflow: auto; "
:operateButtonSwitch="false" :bottonShow="false" :isPage="false" :mainColor="mainColor" :operateButtonSwitch="false" :bottonShow="false" :isPage="false" :mainColor="mainColor"
@ -21,6 +21,9 @@
<base-table ref="personCustomtable" :border="true" :showIndex="false" :slotrow="true" <base-table ref="personCustomtable" :border="true" :showIndex="false" :slotrow="true"
@radioChange="radioChange" :tabLoading.sync="personLoading" :tableHeight="personTableHeight" @radioChange="radioChange" :tabLoading.sync="personLoading" :tableHeight="personTableHeight"
:tableData="personTableData" :tableColumn="tableColumn"> :tableData="personTableData" :tableColumn="tableColumn">
<template #state="{row}">
<div>{{ row.row.state == 1 ? '停用' : '启用'}}</div>
</template>
</base-table> </base-table>
</div> </div>
</base-layout> </base-layout>
@ -32,7 +35,7 @@
import { authApi } from "@/api/apis/auth"; import { authApi } from "@/api/apis/auth";
import baseDialog from "@/components/base/BaseNewDialog/index.vue" import baseDialog from "@/components/base/BaseNewDialog/index.vue"
import baseTree from "@/components/base/BaseMenuTree/index.vue" import baseTree from "@/components/base/BaseMenuTree/index.vue"
import baseLayout from "@/components/base/baseLayout" import baseLayout from "@/components/base/baseNewLayout"
import baseTable from "@/components/base/baseTable" import baseTable from "@/components/base/baseTable"
import { import {
PersonList PersonList

View File

@ -17,12 +17,12 @@
<div flex="cross:center main:justify" class="rightConcat"> <div flex="cross:center main:justify" class="rightConcat">
<span style="font-size: 16px">{{ title }}</span> <span style="font-size: 16px">{{ title }}</span>
<span v-if="footerShow" flex="main:right"> <span v-if="footerShow" flex="main:right">
<el-button @click="handleClose" v-if="closeShow"></el-button> <el-button @click="handleClose" v-if="closeShow"></el-button>
<el-button <el-button
type="primary" type="primary"
@click="handleConfirmClick" @click="handleConfirmClick"
v-if="submitShow" v-if="submitShow"
></el-button ></el-button
> >
</span> </span>
<slot name="buttonPlus"></slot> <slot name="buttonPlus"></slot>
@ -110,7 +110,7 @@ export default {
/* padding-bottom:16px; */ /* padding-bottom:16px; */
padding: 16px 0; padding: 16px 0;
overflow-y: auto; overflow-y: auto;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #eee;
margin-bottom: 20px; margin-bottom: 20px;
} }
</style> </style>

View File

@ -4,7 +4,7 @@ import dialogDrag from './dialog/drag'
import dialogDragWidth from './dialog/dragWidth' import dialogDragWidth from './dialog/dragWidth'
import dialogDragHeight from './dialog/dragHeight' import dialogDragHeight from './dialog/dragHeight'
import clipboard from './module/clipboard' import clipboard from './module/clipboard'
import btnPermission from "@/directive/permission/btnPermission";
const install = function(Vue) { const install = function(Vue) {
Vue.directive('hasRole', hasRole) Vue.directive('hasRole', hasRole)
Vue.directive('hasPermi', hasPermi) Vue.directive('hasPermi', hasPermi)
@ -12,6 +12,7 @@ const install = function(Vue) {
Vue.directive('dialogDrag', dialogDrag) Vue.directive('dialogDrag', dialogDrag)
Vue.directive('dialogDragWidth', dialogDragWidth) Vue.directive('dialogDragWidth', dialogDragWidth)
Vue.directive('dialogDragHeight', dialogDragHeight) Vue.directive('dialogDragHeight', dialogDragHeight)
Vue.directive("btnPermission", btnPermission);
} }
if (window.Vue) { if (window.Vue) {

View File

@ -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);
}
}
}
},
};

View File

@ -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]);
});
},
};

View File

@ -15,7 +15,7 @@
<!-- color: activePage == index ? '#1478f6' : ''}" v-for="(item,index) in lagerScreenMenuData" :key="index"--> <!-- color: activePage == index ? '#1478f6' : ''}" v-for="(item,index) in lagerScreenMenuData" :key="index"-->
<!-- >--> <!-- >-->
<!-- <div @click="handlerClick(item,index)" flex>--> <!-- <div @click="handlerClick(item,index)" flex>-->
<!-- <i :class="item.meta.menuIcon"></i>--> <!-- <i :class="item.meta.icon"></i>-->
<!-- <p>{{ item.meta.title }}</p>--> <!-- <p>{{ item.meta.title }}</p>-->
<!-- </div>--> <!-- </div>-->
<!-- </router-link>--> <!-- </router-link>-->
@ -273,6 +273,8 @@ export default {
.then(() => { .then(() => {
this.$store.dispatch("LogOut").then(() => { this.$store.dispatch("LogOut").then(() => {
Cookies.remove("automaticLogin"); Cookies.remove("automaticLogin");
this.$store.commit("REMOVE_ROUTER");
this.$store.dispatch("tagsView/delAllViews");
// location.href = '/login'; // location.href = '/login';
this.$router.replace({ path: "/login" }); this.$router.replace({ path: "/login" });
// this.$router.push("/login"); // this.$router.push("/login");

View File

@ -5,25 +5,25 @@
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"> <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"> <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<!-- <template slot="title"> --> <!-- <template slot="title"> -->
<!-- <i class="iconfont" :class="item.meta.menuIcon" > </i> --> <!-- <i class="iconfont" :class="item.meta.icon" > </i> -->
<!-- <span v-show="sidebarOpened && !isNest">{{onlyOneChild.meta.title}}</span> --> <!-- <span v-show="sidebarOpened && !isNest">{{onlyOneChild.meta.title}}</span> -->
<!-- <span v-show="isNest">{{onlyOneChild.meta.title}}</span> --> <!-- <span v-show="isNest">{{onlyOneChild.meta.title}}</span> -->
<!-- <div v-if="sidebarOpened"> <!-- <div v-if="sidebarOpened">
<i class="iconfont" :class="item.meta.menuIcon" > </i> <i class="iconfont" :class="item.meta.icon" > </i>
<span>{{isNest}}</span> <span>{{isNest}}</span>
</div> --> </div> -->
<div v-if="isNest === false" :style="{'text-align':sidebarOpened?'left':'center'}"> <div v-if="isNest === false" :style="{'text-align':sidebarOpened?'left':'center'}">
<i class="iconfont" :class="item.meta.menuIcon"> </i> <i class="iconfont" :class="item.meta.icon"> </i>
<span v-show="sidebarOpened" style="margin-left: 16px;">{{onlyOneChild.meta.title}}</span> <span v-show="sidebarOpened" style="margin-left: 16px;">{{onlyOneChild.meta.title}}</span>
</div> </div>
<div v-else> <div v-else>
<i class="iconfont" :class="item.meta.menuIcon"> </i> <i class="iconfont" :class="item.meta.icon"> </i>
<span>{{onlyOneChild.meta.title}}</span> <span>{{onlyOneChild.meta.title}}</span>
</div> </div>
<template slot="title"> <template slot="title">
<div v-if="isNest === false"> <div v-if="isNest === false">
<i class="iconfont" :class="item.meta.menuIcon"> </i> <i class="iconfont" :class="item.meta.icon"> </i>
<span style="margin-left: 16px;">{{item.meta.title}}</span> <span style="margin-left: 16px;">{{item.meta.title}}</span>
</div> </div>
</template> </template>
@ -32,7 +32,7 @@
</template> </template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body> <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<template slot="title"> <template slot="title">
<i class="iconfont" :class="item.meta.menuIcon" v-if="item.meta.menuIcon"> </i> <i class="iconfont" :class="item.meta.icon" v-if="item.meta.icon"> </i>
<span v-show="sidebarOpened" :style="{'margin-left':(sidebarOpened && isNest == false) ?'16px':''}" <span v-show="sidebarOpened" :style="{'margin-left':(sidebarOpened && isNest == false) ?'16px':''}"
class="itemSidebar">{{item.meta.title}}</span> class="itemSidebar">{{item.meta.title}}</span>
</template> </template>

View File

@ -3,7 +3,7 @@
<div class="newsSider bitTitle lastList" v-if="!isNest && hasOneShowingChild(item.children, item)" <div class="newsSider bitTitle lastList" v-if="!isNest && hasOneShowingChild(item.children, item)"
style="width:100px;" @click="goRoute(item)"> style="width:100px;" @click="goRoute(item)">
<div class="concise"> <div class="concise">
<i class=" concise-icon-item iconfont" :class="item.meta.menuIcon"></i> <i class=" concise-icon-item iconfont" :class="item.meta.icon"></i>
<i :class="item.collect == true ? 'el-icon-star-on' : 'el-icon-star-off'" class="star concise-icon" <i :class="item.collect == true ? 'el-icon-star-on' : 'el-icon-star-off'" class="star concise-icon"
@click.stop="handleClickWithDelay(item)"></i> @click.stop="handleClickWithDelay(item)"></i>
</div> </div>
@ -20,7 +20,7 @@
<div v-for="(route, index) in getPriceList(item.children)" class="lastList" :key="index" <div v-for="(route, index) in getPriceList(item.children)" class="lastList" :key="index"
@click="goRoute(item, route)" style="width:100px"> @click="goRoute(item, route)" style="width:100px">
<div class="concise"> <div class="concise">
<i class=" concise-icon-item iconfont" :class="route.meta.menuIcon"> <i class=" concise-icon-item iconfont" :class="route.meta.icon">
</i> </i>
<i :class="route.collect == true ? 'el-icon-star-on' : 'el-icon-star-off'" class="star concise-icon" <i :class="route.collect == true ? 'el-icon-star-on' : 'el-icon-star-off'" class="star concise-icon"
@click.stop="handleClickWithDelay(route)"></i> @click.stop="handleClickWithDelay(route)"></i>
@ -93,7 +93,7 @@ export default {
this.$emit("openChildren", item); this.$emit("openChildren", item);
}, },
async collectClick(val) { async collectClick(val) {
// console.log(val.meta.menuIcon); // console.log(val.meta.icon);
let params = { let params = {
mcId: val.id, mcId: val.id,
type: "", type: "",

View File

@ -5,7 +5,8 @@
settings.sideTheme === 'theme-dark' settings.sideTheme === 'theme-dark'
? variables.menuBackground ? variables.menuBackground
: variables.menuLightBackground, : variables.menuLightBackground,
}"> }"
>
<!-- <news-sider <!-- <news-sider
v-if="!isConciseMode" v-if="!isConciseMode"
:collectionsData="collectionsData" :collectionsData="collectionsData"
@ -16,17 +17,21 @@
ref="newsSiderRef" ref="newsSiderRef"
/> --> /> -->
<news-sider-app :collectionsData="collectionsData" :sidebarRouters="sidebarRouters" @openChildren="openChildren" <news-sider-app :collectionsData="collectionsData" :sidebarRouters="sidebarRouters" @openChildren="openChildren"
@closeWin="closeOpenWin" :routePath="routePath" ref="newsSiderRef" /> @closeWin="closeOpenWin" :routePath="routePath" ref="newsSiderRef"
/>
<!-- @mouseleave="closeOpenWin" --> <!-- @mouseleave="closeOpenWin" -->
</div> </div>
<!-- v-if="childrenList.length > 0 && sidebar.childrenHide" --> <!-- v-if="childrenList.length > 0 && sidebar.childrenHide" -->
<div @mouseleave="closeOpenWin" class="sidebar_box" <div @mouseleave="closeOpenWin" class="sidebar_box"
:style="'width:' + childrenWidth + 'px;' + 'padding:' + childrenPadding"> :style="'width:' + childrenWidth + 'px;' + 'padding:' + childrenPadding"
>
<div flex="cross:center main:justify;" style="margin: 15px 0; justify-content: space-between; over-flow: auto"> <div flex="cross:center main:justify;" style="margin: 15px 0; justify-content: space-between; over-flow: auto">
<div flex="cross:center"> <div flex="cross:center">
<p>{{ childrenList }}</p> <p>{{ childrenList }}</p>
<el-autocomplete v-model="state" placeholder="请输入内容" :fetch-suggestions="querySearch" <el-autocomplete v-model="state" placeholder="请输入内容" :fetch-suggestions="querySearch"
:trigger-on-focus="false" @select="handleSelect" class="navbarSearch" suffix-icon="el-icon-search"> :trigger-on-focus="false" @select="handleSelect" class="navbarSearch"
suffix-icon="el-icon-search"
>
</el-autocomplete> </el-autocomplete>
<i class="el-icon-close" style="font-size: 24px; cursor: pointer; margin-left: 15px" @click="closeOpenWin"/> <i class="el-icon-close" style="font-size: 24px; cursor: pointer; margin-left: 15px" @click="closeOpenWin"/>
</div> </div>
@ -34,7 +39,8 @@
<div flex="dir:top" flex-wrap style="height: calc(100% - 70px)"> <div flex="dir:top" flex-wrap style="height: calc(100% - 70px)">
<children-sider ref="childrenSider" v-for="(route, index) in menuList" :key="route.path + index" :item="route" <children-sider ref="childrenSider" v-for="(route, index) in menuList" :key="route.path + index" :item="route"
@refreshSider="refreshSider" @openChildren="openChildren" @clearActive="clearActive" @refreshSider="refreshSider" @openChildren="openChildren" @clearActive="clearActive"
@closeOpenWin="closeOpenWin" :fatherPath="fatherPath" :lastPath="lastPath" style="width: 200px" /> @closeOpenWin="closeOpenWin" :fatherPath="fatherPath" :lastPath="lastPath" style="width: 200px"
/>
<!-- <children-app-sider <!-- <children-app-sider
v-if="isConciseMode" v-if="isConciseMode"
v-for="(route, index) in childrenList" v-for="(route, index) in childrenList"
@ -55,18 +61,18 @@
import { import {
mapGetters, mapGetters,
mapState mapState
} from "vuex"; } from 'vuex'
import Logo from "./Logo"; import Logo from './Logo'
import newsSider from "./newsSider"; import newsSider from './newsSider'
import childrenSider from "./childrenSider"; import childrenSider from './childrenSider'
import newsSiderApp from "./newsSiderApp"; import newsSiderApp from './newsSiderApp'
import childrenAppSider from "./childrenAppSider"; import childrenAppSider from './childrenAppSider'
import variables from "@/assets/styles/variables.scss"; import variables from '@/assets/styles/variables.scss'
import { import {
GetMyCollectionData GetMyCollectionData
} from "@/api/apis/menuManage"; } from '@/api/apis/menuManage'
import router from "@/router"; import router from '@/router'
import loginVue from "../../../views/login.vue"; import loginVue from '../../../views/login.vue'
export default { export default {
components: { components: {
@ -74,80 +80,81 @@
newsSider, newsSider,
childrenSider, childrenSider,
newsSiderApp, newsSiderApp,
childrenAppSider, childrenAppSider
}, },
computed: { computed: {
...mapState(["settings", "sidebar"]), ...mapState(['settings', 'sidebar']),
...mapGetters(["sidebarRouters", "sidebar"]), ...mapGetters(['sidebarRouters', 'sidebar']),
activeMenu() { activeMenu() {
const route = this.$route; const route = this.$route
const { const {
meta, meta,
path path
} = route; } = route
// if set path, the sidebar will highlight the path you set // if set path, the sidebar will highlight the path you set
if (meta.activeMenu) { if (meta.activeMenu) {
return meta.activeMenu; return meta.activeMenu
} }
let pathUrl = path + "?id=" + meta.id; let pathUrl = path + '?id=' + meta.id
return path; return path
}, },
showLogo() { showLogo() {
return this.$store.state.settings.sidebarLogo; return this.$store.state.settings.sidebarLogo
}, },
conciseMenu() { conciseMenu() {
return true; return true
}, },
variables() { variables() {
return variables; return variables
}, },
isCollapse() { isCollapse() {
return !this.sidebar.opened; return !this.sidebar.opened
}, },
defaultTheme() { defaultTheme() {
return this.$store.state.settings.theme; return this.$store.state.settings.theme
}, }
}, },
watch: { watch: {
defaultTheme: { defaultTheme: {
handler: function(val, oldVal) { handler: function(val, oldVal) {
this.theme = val; this.theme = val
this.changeBgColor(val); this.changeBgColor(val)
}, },
immediate: true, immediate: true
}, },
conciseMenu: { conciseMenu: {
handler: function(val, oldVal) { handler: function(val, oldVal) {
this.isConciseMode = val; this.isConciseMode = val
// this.changeBgColor(val); // this.changeBgColor(val);
}, },
immediate: true, immediate: true
}, },
sidebar: { sidebar: {
handler: function(val, oldVal) { handler: function(val, oldVal) {
if (val.opened) { if (val.opened) {
this.state = ""; this.state = ''
} }
}, },
deep: true, deep: true
}, },
siderBoxHeight: { siderBoxHeight: {
immediate: true, immediate: true,
handler() { handler() {
this.handleResize(); this.handleResize()
}
}
}, },
created() {
}, },
},
created() {},
data() { data() {
return { return {
childrenPadding: 0, childrenPadding: 0,
childrenWidth: 0, childrenWidth: 0,
childrenList: [], childrenList: [],
state: "", state: '',
fatherPath: "", fatherPath: '',
routePath: "", routePath: '',
lastPath: "", lastPath: '',
hoverType: false, hoverType: false,
firstNum: true, firstNum: true,
windowHeight: 0, windowHeight: 0,
@ -157,105 +164,105 @@
valForm: {}, valForm: {},
isConciseMode: false, isConciseMode: false,
siderSHowType: false, siderSHowType: false,
menuList: [], menuList: []
// clientHeight: document.body.clientHeight // clientHeight: document.body.clientHeight
}; }
}, },
mounted() { mounted() {
// this.GetMyCollectionData(); // this.GetMyCollectionData();
this.siderBoxHeight = this.$refs.siderBox.offsetHeight; this.siderBoxHeight = this.$refs.siderBox.offsetHeight
}, },
methods: { methods: {
handleResize() { handleResize() {
// const siderBoxHeight = this.$refs.siderBox.offsetHeight; // const siderBoxHeight = this.$refs.siderBox.offsetHeight;
this.windowHeight = this.siderBoxHeight - 110; this.windowHeight = this.siderBoxHeight - 110
}, },
clearActive() { clearActive() {
this.$refs.newsSiderRef.activeIndex = null; this.$refs.newsSiderRef.activeIndex = null
}, },
getRoute() { getRoute() {
this.$store.dispatch("app/changeChildrenHide"); this.$store.dispatch('app/changeChildrenHide')
let path = this.$route.path; let path = this.$route.path
this.routePath = "/" + path.split("/")[1]; this.routePath = '/' + path.split('/')[1]
this.fatherPath = this.routePath; this.fatherPath = this.routePath
this.lastPath = path.split("/")[path.split("/").length - 1]; this.lastPath = path.split('/')[path.split('/').length - 1]
this.sidebarRouters.forEach((el) => { this.sidebarRouters.forEach((el) => {
if (el.path.split("/")[1] == path.split("/")[1] && el.children) { if (el.path.split('/')[1] == path.split('/')[1] && el.children) {
this.childrenList = el.children; this.childrenList = el.children
this.$emit( this.$emit(
"openChildren", 'openChildren',
this.childrenList.length > 0 ? true : false this.childrenList.length > 0 ? true : false
); )
} }
}); })
}, },
refreshSider() { refreshSider() {
this.GetMyCollectionData(true); this.GetMyCollectionData(true)
}, },
changeBgColor(val) { changeBgColor(val) {
document document
.getElementsByTagName("body")[0] .getElementsByTagName('body')[0]
.style.setProperty("--bg-color", val); .style.setProperty('--bg-color', val)
}, },
hoverChilden() { hoverChilden() {
this.hoverType = true; this.hoverType = true
this.firstNum = false; this.firstNum = false
}, },
openChildren(val) { openChildren(val) {
this.valForm = val; this.valForm = val
this.getRoute(); this.getRoute()
this.isSearch = false; this.isSearch = false
this.state = ""; this.state = ''
if (val.id != "129") { if (val.id != '129') {
if (!val.children) { if (!val.children) {
this.childrenWidth = 0; this.childrenWidth = 0
this.childrenPadding = 0; this.childrenPadding = 0
this.childrenList = []; this.childrenList = []
} else { } else {
const setCollect = (arr) => { const setCollect = (arr) => {
arr.forEach((el) => { arr.forEach((el) => {
el.collect = false; el.collect = false
this.matchMyCollection(el); this.matchMyCollection(el)
if (el.children != null && el.children && el.children.length) { if (el.children != null && el.children && el.children.length) {
setCollect(el.children); setCollect(el.children)
} }
}); })
}; }
setCollect(val.children); setCollect(val.children)
this.childrenList = val.children; this.childrenList = val.children
this.fatherPath = val.path; this.fatherPath = val.path
} }
} else { } else {
this.childrenList = val.children; this.childrenList = val.children
} }
let menuList = []; let menuList = []
function changeMenuData(data, path) { function changeMenuData(data, path) {
data.forEach((el) => { data.forEach((el) => {
let menuPath = path + "/" + el.path; let menuPath = path + '/' + el.path
let level = el.children ? 2 : 3; let level = el.children ? 2 : 3
let arr = { let arr = {
collect: el.collect, collect: el.collect,
meta: el.meta, meta: el.meta,
name: el.name, name: el.name,
path: menuPath, path: menuPath,
hidden: el.hidden == "true" ? true : false || false, hidden: el.hidden == 'true' ? true : false || false,
level: level, level: level
}; }
// if(!arr.hidden){ // if(!arr.hidden){
// } // }
menuList.push(arr); menuList.push(arr)
if (el.children && el.children.length > 0) { if (el.children && el.children.length > 0) {
changeMenuData(el.children, menuPath); changeMenuData(el.children, menuPath)
} }
}); })
} }
changeMenuData(this.childrenList, this.fatherPath); changeMenuData(this.childrenList, this.fatherPath)
this.menuList = menuList; this.menuList = menuList
this.changeWidth(); this.changeWidth()
// let chilrenSum = 0 // let chilrenSum = 0
// let notChildrenSum = 0 // let notChildrenSum = 0
@ -282,58 +289,58 @@
// this.childrenWidth = 0 // this.childrenWidth = 0
// this.childrenPadding = 0 // this.childrenPadding = 0
// } // }
this.$store.dispatch("app/changeChildrenHide", true); this.$store.dispatch('app/changeChildrenHide', true)
this.$emit("openChildren", this.childrenList.length > 0 ? true : false); this.$emit('openChildren', this.childrenList.length > 0 ? true : false)
}, },
changeWidth() { changeWidth() {
let secondNumber = 0; let secondNumber = 0
let thirdNumber = 0; let thirdNumber = 0
this.menuList.forEach((el) => { this.menuList.forEach((el) => {
if (el.level == 2 && !el.hidden) { if (el.level == 2 && !el.hidden) {
secondNumber = secondNumber + 1; secondNumber = secondNumber + 1
} else if (el.level == 3 && !el.hidden) { } else if (el.level == 3 && !el.hidden) {
thirdNumber = thirdNumber + 1; thirdNumber = thirdNumber + 1
} }
}); })
this.$nextTick(() => { this.$nextTick(() => {
let childrenHight = thirdNumber * 50 + secondNumber * 35; let childrenHight = thirdNumber * 50 + secondNumber * 35
let windowHight = this.$refs.siderBox.offsetHeight - 51; let windowHight = this.$refs.siderBox.offsetHeight - 51
if (this.childrenList.length > 0) { if (this.childrenList.length > 0) {
this.childrenPadding = "20px "; this.childrenPadding = '20px '
windowHight = windowHight - 40; windowHight = windowHight - 40
this.childrenWidth = this.childrenWidth =
(Math.floor(childrenHight / windowHight) + 1) * 320; (Math.floor(childrenHight / windowHight) + 1) * 320
} else { } else {
this.childrenWidth = 0; this.childrenWidth = 0
this.childrenPadding = 0; this.childrenPadding = 0
} }
this.$emit("changeWidth", this.childrenWidth); this.$emit('changeWidth', this.childrenWidth)
}); })
}, },
// //
async GetMyCollectionData(collectType) { async GetMyCollectionData(collectType) {
let res = await GetMyCollectionData({}); let res = await GetMyCollectionData({})
if (res.code == 1) { if (res.code == 1) {
const putCollectData = (res) => { const putCollectData = (res) => {
res.forEach((el) => { res.forEach((el) => {
el.collect = true; el.collect = true
if (el.children != null && el.children && el.children.length) { if (el.children != null && el.children && el.children.length) {
putCollectData(el.children); putCollectData(el.children)
} }
}); })
}; }
putCollectData(res.data); putCollectData(res.data)
this.collectionsData = res.data; this.collectionsData = res.data
this.childrenList = []; this.childrenList = []
if (collectType) { if (collectType) {
setTimeout(() => { setTimeout(() => {
if (this.valForm.id != "129") { if (this.valForm.id != '129') {
this.openChildren(this.valForm); this.openChildren(this.valForm)
} else { } else {
this.openChildren(this.collectionsData[0]); this.openChildren(this.collectionsData[0])
} }
}, 1); }, 1)
} }
} }
}, },
@ -342,99 +349,102 @@
const isCollectData = (res) => { const isCollectData = (res) => {
res.forEach((el) => { res.forEach((el) => {
if (el.id === item.id) { if (el.id === item.id) {
item.collect = true; item.collect = true
} }
if (el.children != null && el.children && el.children.length) { if (el.children != null && el.children && el.children.length) {
isCollectData(el.children); isCollectData(el.children)
} }
}); })
}; }
isCollectData(this.collectionsData); isCollectData(this.collectionsData)
}, },
// //
closeOpenWin() { closeOpenWin() {
if (this.isSearch != true) { if (this.isSearch != true) {
this.$refs.newsSiderRef.activeIndex = null; this.$refs.newsSiderRef.activeIndex = null
this.childrenWidth = 0; this.childrenWidth = 0
this.childrenPadding = 0; this.childrenPadding = 0
this.$store.dispatch("app/changeChildrenHide", false); this.$store.dispatch('app/changeChildrenHide', false)
} }
}, },
routerClick() { routerClick() {
this.isSearch = false; this.isSearch = false
this.closeOpenWin(); this.closeOpenWin()
}, },
createList(row) { createList(row) {
let children = []; let children = []
const parseList = (arr, centerPath) => { const parseList = (arr, centerPath) => {
arr.forEach((el) => { arr.forEach((el) => {
let path; let path
if (!centerPath) { if (!centerPath) {
path = this.fatherPath + "/" + el.path; path = this.fatherPath + '/' + el.path
} else { } else {
path = this.fatherPath + "/" + centerPath + "/" + el.path; path = this.fatherPath + '/' + centerPath + '/' + el.path
} }
let arr = { let arr = {
value: el.meta.title, value: el.meta.title,
path: path, path: path
};
children.push(arr);
if (el.children != null && el.children && el.children.length) {
parseList(el.children, el.path);
} }
}); children.push(arr)
}; if (el.children != null && el.children && el.children.length) {
parseList(row); parseList(el.children, el.path)
return children; }
})
}
parseList(row)
return children
}, },
getRestaurants(row) { getRestaurants(row) {
let children = []; let children = []
const restaurants = (arr, fatherPath) => { const restaurants = (arr, fatherPath) => {
console.log(arr, 'arr')
arr.forEach((el) => { arr.forEach((el) => {
let path = ""; let path = ''
el.fullpath = fatherPath ? fatherPath + "/" + el.path : el.path; el.fullpath = fatherPath ? fatherPath + '/' + el.path : el.path
console.log(el, 'el')
let arr = { let arr = {
value: el.meta.title, value: el.meta ? el.meta.title : '',
path: el.fullpath, path: el.fullpath
};
children.push(arr);
if (el.children != null && el.children && el.children.length) {
restaurants(el.children, el.fullpath);
} }
}); children.push(arr)
}; if (el.children != null && el.children && el.children.length) {
restaurants(row); restaurants(el.children, el.fullpath)
return children; }
})
}
restaurants(row)
return children
}, },
querySearch(queryString, cb) { querySearch(queryString, cb) {
this.isSearch = true; this.isSearch = true
var restaurants = this.getRestaurants(this.sidebarRouters); var restaurants = this.getRestaurants(this.sidebarRouters)
var results = queryString ? var results = queryString ?
restaurants.filter(this.createFilter(queryString)) : restaurants.filter(this.createFilter(queryString)) :
restaurants; restaurants
cb(results); console.log(results, 'results')
cb(results)
}, },
createFilter(queryString) { createFilter(queryString) {
return (restaurant) => { return (restaurant) => {
return restaurant.value.toLowerCase().indexOf(queryString) !== -1; return restaurant.value.toLowerCase().indexOf(queryString) !== -1
}; }
}, },
handleSelect(item) { handleSelect(item) {
let routeData = this.$router.resolve({ let routeData = this.$router.resolve({
path: item.path, path: item.path
}); })
window.open(routeData.href, "_self"); window.open(routeData.href, '_self')
this.routerClick(); this.routerClick()
this.$refs.newsSiderRef.activeIndex = null; this.$refs.newsSiderRef.activeIndex = null
this.childrenPadding = 0; this.childrenPadding = 0
this.$store.dispatch("app/changeChildrenHide", false); this.$store.dispatch('app/changeChildrenHide', false)
}, },
collectClick(item) {}, collectClick(item) {
}, }
}; }
}
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -30,7 +30,7 @@
@mouseenter="openChildren(item, index)" @mouseenter="openChildren(item, index)"
@click="goRouter(item, index)" @click="goRouter(item, index)"
> >
<i class="newsSider-icon iconfont" :class="item.meta.menuIcon"> </i> <i class="newsSider-icon iconfont" :class="item.meta.icon"> </i>
<p class="newsSider-title" :class="{ active: index === activeIndex }"> <p class="newsSider-title" :class="{ active: index === activeIndex }">
{{ item.meta.title }} {{ item.meta.title }}
</p> </p>

View File

@ -29,8 +29,8 @@
class="newsSider" class="newsSider"
@mouseenter="openChildren(item, index)" @mouseenter="openChildren(item, index)"
> >
<i class="newsSider-icon iconfont" :class="item.meta.menuIcon ? item.meta.menuIcon :'el-icon-office-building'"> </i> <i class="newsSider-icon iconfont" :class="item.meta.icon ? item.meta.icon :'el-icon-office-building'"> </i>
<!-- <i class="newsSider-icon iconfont" :class="item.meta.menuIcon"> </i> --> <!-- <i class="newsSider-icon iconfont" :class="item.meta.icon"> </i> -->
<p class="newsSider-title" :class="{ active: index === activeIndex }"> <p class="newsSider-title" :class="{ active: index === activeIndex }">
{{ item.meta.title }} {{ item.meta.title }}
</p> </p>

View File

@ -370,7 +370,7 @@ export default {
//width: 16px; //width: 16px;
//height: 16px; //height: 16px;
left: -14px; left: -14px;
top: -3px; top: 0px;
position: absolute; position: absolute;
vertical-align: 2px; vertical-align: 2px;
border-radius: 50%; border-radius: 50%;

View File

@ -5,25 +5,25 @@
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"> <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"> <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<!-- <template slot="title"> --> <!-- <template slot="title"> -->
<!-- <i class="iconfont" :class="item.meta.menuIcon" > </i> --> <!-- <i class="iconfont" :class="item.meta.icon" > </i> -->
<!-- <span v-show="sidebarOpened && !isNest">{{onlyOneChild.meta.title}}</span> --> <!-- <span v-show="sidebarOpened && !isNest">{{onlyOneChild.meta.title}}</span> -->
<!-- <span v-show="isNest">{{onlyOneChild.meta.title}}</span> --> <!-- <span v-show="isNest">{{onlyOneChild.meta.title}}</span> -->
<!-- <div v-if="sidebarOpened"> <!-- <div v-if="sidebarOpened">
<i class="iconfont" :class="item.meta.menuIcon" > </i> <i class="iconfont" :class="item.meta.icon" > </i>
<span>{{isNest}}</span> <span>{{isNest}}</span>
</div> --> </div> -->
<div v-if="isNest === false" :style="{'text-align':sidebarOpened?'left':'center'}"> <div v-if="isNest === false" :style="{'text-align':sidebarOpened?'left':'center'}">
<i class="iconfont" :class="item.meta.menuIcon"> </i> <i class="iconfont" :class="item.meta.icon"> </i>
<span v-show="sidebarOpened" style="margin-left: 16px;">{{onlyOneChild.meta.title}}</span> <span v-show="sidebarOpened" style="margin-left: 16px;">{{onlyOneChild.meta.title}}</span>
</div> </div>
<div v-else> <div v-else>
<i class="iconfont" :class="item.meta.menuIcon"> </i> <i class="iconfont" :class="item.meta.icon"> </i>
<span>{{onlyOneChild.meta.title}}</span> <span>{{onlyOneChild.meta.title}}</span>
</div> </div>
<template slot="title"> <template slot="title">
<div v-if="isNest === false"> <div v-if="isNest === false">
<i class="iconfont" :class="item.meta.menuIcon"> </i> <i class="iconfont" :class="item.meta.icon"> </i>
<span style="margin-left: 16px;">{{item.meta.title}}</span> <span style="margin-left: 16px;">{{item.meta.title}}</span>
</div> </div>
</template> </template>
@ -32,7 +32,7 @@
</template> </template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body> <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<template slot="title"> <template slot="title">
<i class="iconfont" :class="item.meta.menuIcon" v-if="item.meta.menuIcon"> </i> <i class="iconfont" :class="item.meta.icon" v-if="item.meta.icon"> </i>
<span v-show="sidebarOpened" :style="{'margin-left':(sidebarOpened && isNest == false) ?'16px':''}" <span v-show="sidebarOpened" :style="{'margin-left':(sidebarOpened && isNest == false) ?'16px':''}"
class="itemSidebar">{{item.meta.title}}</span> class="itemSidebar">{{item.meta.title}}</span>
</template> </template>

View File

@ -3,7 +3,7 @@
<div class="newsSider bitTitle lastList" v-if="!isNest && hasOneShowingChild(item.children, item)" <div class="newsSider bitTitle lastList" v-if="!isNest && hasOneShowingChild(item.children, item)"
style="width:100px;" @click="goRoute(item)"> style="width:100px;" @click="goRoute(item)">
<div class="concise"> <div class="concise">
<i class=" concise-icon-item iconfont" :class="item.meta.menuIcon"></i> <i class=" concise-icon-item iconfont" :class="item.meta.icon"></i>
<i :class="item.collect == true ? 'el-icon-star-on' : 'el-icon-star-off'" class="star concise-icon" <i :class="item.collect == true ? 'el-icon-star-on' : 'el-icon-star-off'" class="star concise-icon"
@click.stop="handleClickWithDelay(item)"></i> @click.stop="handleClickWithDelay(item)"></i>
</div> </div>
@ -20,7 +20,7 @@
<div v-for="(route, index) in getPriceList(item.children)" class="lastList" :key="index" <div v-for="(route, index) in getPriceList(item.children)" class="lastList" :key="index"
@click="goRoute(item, route)" style="width:100px"> @click="goRoute(item, route)" style="width:100px">
<div class="concise"> <div class="concise">
<i class=" concise-icon-item iconfont" :class="route.meta.menuIcon"> <i class=" concise-icon-item iconfont" :class="route.meta.icon">
</i> </i>
<i :class="route.collect == true ? 'el-icon-star-on' : 'el-icon-star-off'" class="star concise-icon" <i :class="route.collect == true ? 'el-icon-star-on' : 'el-icon-star-off'" class="star concise-icon"
@click.stop="handleClickWithDelay(route)"></i> @click.stop="handleClickWithDelay(route)"></i>
@ -93,7 +93,7 @@ export default {
this.$emit("openChildren", item); this.$emit("openChildren", item);
}, },
async collectClick(val) { async collectClick(val) {
// console.log(val.meta.menuIcon); // console.log(val.meta.icon);
let params = { let params = {
mcId: val.id, mcId: val.id,
type: "", type: "",

View File

@ -14,7 +14,7 @@
<div v-if="!item.hidden && item.meta" flex="cross:center" :class="{ active: index === activeIndex }" :style="{ <div v-if="!item.hidden && item.meta" flex="cross:center" :class="{ active: index === activeIndex }" :style="{
color: settings.sideTheme === 'theme-dark' ? '#fff' : '#4c4c4c', color: settings.sideTheme === 'theme-dark' ? '#fff' : '#4c4c4c',
}" class="newsSider" @mouseenter="openChildren(item, index)"> }" class="newsSider" @mouseenter="openChildren(item, index)">
<i class="newsSider-icon iconfont" :class="item.meta.menuIcon"> </i> <i class="newsSider-icon iconfont" :class="item.meta.icon"> </i>
<p class="newsSider-title" :class="{ active: index === activeIndex }"> <p class="newsSider-title" :class="{ active: index === activeIndex }">
{{ item.meta.title }} {{ item.meta.title }}
</p> </p>

View File

@ -14,7 +14,7 @@
<div v-if="!item.hidden && item.meta" flex="cross:center" :class="{ active: index === activeIndex }" :style="{ <div v-if="!item.hidden && item.meta" flex="cross:center" :class="{ active: index === activeIndex }" :style="{
color: settings.sideTheme === 'theme-dark' ? '#fff' : '#4c4c4c', color: settings.sideTheme === 'theme-dark' ? '#fff' : '#4c4c4c',
}" class="newsSider" @mouseenter="openChildren(item, index)"> }" class="newsSider" @mouseenter="openChildren(item, index)">
<i class="newsSider-icon iconfont" :class="item.meta.menuIcon"> </i> <i class="newsSider-icon iconfont" :class="item.meta.icon"> </i>
<p class="newsSider-title" :class="{ active: index === activeIndex }"> <p class="newsSider-title" :class="{ active: index === activeIndex }">
{{ item.meta.title }} {{ item.meta.title }}
</p> </p>

View File

@ -38,7 +38,11 @@ import nodeWrap from '@/components/nodeWrap'
import { delTreeChildren } from '@/utils/util' import { delTreeChildren } from '@/utils/util'
Vue.use(nodeWrap) Vue.use(nodeWrap)
Vue.component('NodeWrap', nodeWrap) // 初始化组件 Vue.component('NodeWrap', nodeWrap) // 初始化组件
// 柱状图、折线图组件
import BarChart from "@/components/Echarts/BarChart";
import BarChartBlack from "@/components/Echarts/BarChartBlack.vue";
Vue.component("BarChart", BarChart);
Vue.component("BarChartBlack", BarChartBlack);
import followWorkShow from '@/components/nodeWrapShow' import followWorkShow from '@/components/nodeWrapShow'
Vue.use(followWorkShow) Vue.use(followWorkShow)
Vue.component('FollowWorkShow', followWorkShow) // 初始化组件 Vue.component('FollowWorkShow', followWorkShow) // 初始化组件
@ -62,6 +66,8 @@ Vue.directive('enterNumber', {
}) })
} }
}) })
import Directives from "@/directive/permission/index";
Vue.use(Directives);
import { download } from '@/utils/request' import { download } from '@/utils/request'
import { openLoading, closeLoading } from '@/utils/loading' import { openLoading, closeLoading } from '@/utils/loading'

View File

@ -1,76 +1,130 @@
import router from "./router"; import router from './router'
import store from "./store"; import store from './store'
import { Message } from "element-ui"; import { Message } from 'element-ui'
import NProgress from "nprogress"; import NProgress from 'nprogress'
import "nprogress/nprogress.css"; import 'nprogress/nprogress.css'
import { getToken, getCompanyId } from "@/utils/auth"; import { getToken, getCompanyId } from '@/utils/auth'
import { isRelogin, getButtonLish } from "@/utils/request"; import { isRelogin, getButtonLish } from '@/utils/request'
import { authApi } from '@/api/apis/auth'
import { getInfo } from '@/utils/auth'
NProgress.configure({ NProgress.configure({
showSpinner: false, showSpinner: false
}); })
const whiteList = [ const whiteList = [
"/login", '/login',
"/test", '/test',
"/auth-redirect", '/auth-redirect',
"/bind", '/bind',
"/contractAssistant", '/contractAssistant',
"/register", '/register',
"/systemInit", '/systemInit',
"/databaseLogin", '/databaseLogin',
]; '/apiLogs'
]
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start(); NProgress.start()
if (getToken()) { if (getToken()) {
to.meta.title && store.dispatch("settings/setTitle", to.meta.title); to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/ /* has token*/
if (to.path === "/login") { if (to.path === '/login') {
next({ next({
path: "/", path: '/'
}); })
NProgress.done(); NProgress.done()
} else { } else {
let routeList = localStorage.getItem("routeList") let routeList = localStorage.getItem('routeList')
? localStorage.getItem("routeList") ? localStorage.getItem('routeList')
: null; : null
// store.dispatch("GenerateRoutes").then((accessRoutes) => { // store.dispatch("GenerateRoutes").then((accessRoutes) => {
// next() // next()
// }) // })
if (store.getters.permission_routes.length == 0) { if (store.getters.permission_routes.length == 0) {
store.dispatch("GenerateRoutes").then((accessRoutes) => { store.dispatch('GenerateRoutes').then((accessRoutes) => {
// 根据roles权限生成可访问的路由表 // 根据roles权限生成可访问的路由表
// for (let i = 0, length = accessRoutes.length; i < length; i += 1) { // for (let i = 0, length = accessRoutes.length; i < length; i += 1) {
// const element = accessRoutes[i]; // const element = accessRoutes[i];
// // router.addRoutes(accessRoutes); // 动态添加可访问路由表 // // router.addRoutes(accessRoutes); // 动态添加可访问路由表
// } // }
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({ next({
...to, ...to,
replace: true, replace: true
}); // hack方法 确保addRoutes已完成 })
}); })
} else { } 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 { } else {
// 没有token // 没有token
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入 // 在免登录白名单,直接进入
next(); next()
} else { } else {
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页 next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
NProgress.done(); NProgress.done()
} }
} }
}); })
router.afterEach(() => { router.afterEach(() => {
NProgress.done(); NProgress.done()
}); })

View File

@ -1,12 +1,12 @@
import Vue from "vue"; import Vue from 'vue'
import Router from "vue-router"; import Router from 'vue-router'
Vue.use(Router); Vue.use(Router)
/* Layout */ /* Layout */
import Layout from "@/layout/index.vue"; import Layout from '@/layout/index.vue'
import ParentView from "@/components/ParentView"; import ParentView from '@/components/ParentView'
import ApiAdmin from "@/views/integrationApi/apiAdmin" import ApiAdmin from '@/views/integrationApi/apiAdmin'
/** /**
* Note: 路由配置项 * Note: 路由配置项
@ -32,39 +32,49 @@ import ApiAdmin from "@/views/integrationApi/apiAdmin"
// 公共路由 // 公共路由
export const constantRoutes = [{ export const constantRoutes = [{
path: "/redirect", path: '/redirect',
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [{ children: [{
path: "/redirect/:path(.*)", path: '/redirect/:path(.*)',
component: () => import("@/views/redirect"), component: () => import('@/views/redirect')
},], }]
}, },
{ {
path: "/login", path: '/apiLogs',
component: () => import("@/views/login"), component: () => import('@/views/apiLogs/index.vue'),
hidden: true, hidden: true
}, },
{ {
path: "/register", path: '/login',
component: () => import("@/views/register/index"), component: () => import('@/views/login'),
hidden: true, hidden: true
}, },
{ {
path: "/systemInit", path: '/test',
component: () => import('@/views/test'),
hidden: true
},
{
path: '/register',
component: () => import('@/views/register/index'),
hidden: true
},
{
path: '/systemInit',
// name: "databaseIndex", // name: "databaseIndex",
component: () => import("@/views/systemInit/index"), component: () => import('@/views/systemInit/index'),
hidden: true, hidden: true
}, },
{ {
path: "/404", path: '/404',
component: () => import("@/views/error/404"), component: () => import('@/views/error/404'),
hidden: true, hidden: true
}, },
{ {
path: "/401", path: '/401',
component: () => import("@/views/error/401"), component: () => import('@/views/error/401'),
hidden: true, hidden: true
}, },
// { // {
// path: "/contractAssistant", // path: "/contractAssistant",
@ -72,51 +82,51 @@ export const constantRoutes = [{
// hidden: true, // hidden: true,
// }, // },
{ {
path: "", path: '',
component: Layout, component: Layout,
redirect: "index", redirect: 'index',
children: [{ children: [{
path: "index", path: 'index',
component: () => import("@/views/index_v2"), component: () => import('@/views/index_v2'),
name: "Index", name: 'Index',
meta: { meta: {
title: "首页", title: '首页',
icon: "dashboard", icon: 'dashboard',
affix: true, affix: true
}, }
}, },
{ {
path: "notFound", path: 'notFound',
component: () => import("@/views/notFound"), component: () => import('@/views/notFound'),
name: "notFound", name: 'notFound',
meta: { meta: {
title: "404", title: '404',
icon: "dashboard", icon: 'dashboard'
// affix: true, // affix: true,
}, }
}, }
], ]
}, },
{ {
path: "/user", path: '/user',
component: Layout, component: Layout,
hidden: true, hidden: true,
redirect: "Profile", redirect: 'Profile',
children: [{ children: [{
path: "Profile", path: 'Profile',
// component: () => import('@/views/system/user/personalCenter/index'), // component: () => import('@/views/system/user/personalCenter/index'),
component: () => component: () =>
import( import(
"@/views/systemSettings/userSettings/PersonnelSettings/personalCenter/index" '@/views/systemSettings/userSettings/PersonnelSettings/personalCenter/index'
), ),
name: "Profile", name: 'Profile',
meta: { meta: {
title: "个人中心", title: '个人中心',
icon: "user", icon: 'user'
}, }
},], }]
}, }
// { // {
// path: "/integrationOption", // path: "/integrationOption",
// component: Layout, // component: Layout,
@ -973,36 +983,36 @@ export const constantRoutes = [{
// } // }
// }] // }]
// }, // },
]; ]
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [{ export const dynamicRoutes = [{
path: "/tool/gen-edit", path: '/tool/gen-edit',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ["tool:gen:edit"], permissions: ['tool:gen:edit'],
children: [{ children: [{
path: "index/:tableId(\\d+)", path: 'index/:tableId(\\d+)',
// component: () => import('@/views/tool/gen/editTable'), // component: () => import('@/views/tool/gen/editTable'),
// component: () => import('@/views/tool/gen/index'), // component: () => import('@/views/tool/gen/index'),
name: "GenEdit", name: 'GenEdit',
meta: { meta: {
title: "修改生成配置", title: '修改生成配置',
activeMenu: "/tool/gen", activeMenu: '/tool/gen'
}, }
},], }]
},]; }]
// 防止连续点击多次路由报错 // 防止连续点击多次路由报错
let routerPush = Router.prototype.push; let routerPush = Router.prototype.push
Router.prototype.push = function push(location) { Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch((err) => err); return routerPush.call(this, location).catch((err) => err)
}; }
export default new Router({ export default new Router({
mode: "hash", // 去掉url中的# mode: 'hash', // 去掉url中的#
scrollBehavior: () => ({ scrollBehavior: () => ({
y: 0, y: 0
}), }),
routes: constantRoutes, routes: constantRoutes
}); })

View File

@ -36,5 +36,6 @@ const getters = {
copyerConfig: state => state.flowPath.copyerConfig, copyerConfig: state => state.flowPath.copyerConfig,
conditionDrawer: state => state.flowPath.conditionDrawer, conditionDrawer: state => state.flowPath.conditionDrawer,
conditionsConfig: state => state.flowPath.conditionsConfig, conditionsConfig: state => state.flowPath.conditionsConfig,
getButtonPre: (state) => state.perButton.buttonObj,
} }
export default getters export default getters

View File

@ -9,6 +9,7 @@ import settings from './modules/settings'
import getters from './getters' import getters from './getters'
import approval from './modules/approval' import approval from './modules/approval'
import flowPath from "./modules/flowPath" import flowPath from "./modules/flowPath"
import perButton from "@/store/modules/perButton";
Vue.use(Vuex) Vue.use(Vuex)
@ -21,7 +22,8 @@ const store = new Vuex.Store({
permission, permission,
settings, settings,
approval, approval,
flowPath flowPath,
perButton
}, },
getters getters
}) })

View File

@ -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,
};

View File

@ -29,7 +29,6 @@ const permission = {
name: 'applicationEdit', name: 'applicationEdit',
hidden: true, hidden: true,
meta: { meta: {
title: '应用编辑',
hidden: true hidden: true
} }
}, },
@ -39,7 +38,6 @@ const permission = {
name: 'exploit', name: 'exploit',
hidden: true, hidden: true,
meta: { meta: {
title: '开发管理',
hidden: true hidden: true
} }
}, },
@ -49,7 +47,6 @@ const permission = {
name: 'authority', name: 'authority',
hidden: true, hidden: true,
meta: { meta: {
title: '权限管理',
hidden: true hidden: true
} }
@ -59,7 +56,6 @@ const permission = {
name: 'appApiAdmin', name: 'appApiAdmin',
component: () => import('@/views/applicationList/apiList/apiAdmin'), component: () => import('@/views/applicationList/apiList/apiAdmin'),
meta: { meta: {
title: 'API管理',
hidden: true hidden: true
} }
}, },
@ -68,7 +64,14 @@ const permission = {
name: 'inserterAdmin', name: 'inserterAdmin',
component: () => import('@/views/applicationList/inserterAdmin'), component: () => import('@/views/applicationList/inserterAdmin'),
meta: { meta: {
title: '插件管理', hidden: true
}
},
{
path: 'scriptAdmin',
name: 'scriptAdmin',
component: () => import('@/views/applicationList/scriptAdmin'),
meta: {
hidden: true hidden: true
} }
}, },
@ -79,7 +82,6 @@ const permission = {
hidden: 'true', hidden: 'true',
component: () => import('@/views/applicationList/apiList/apiAdd'), component: () => import('@/views/applicationList/apiList/apiAdd'),
meta: { meta: {
title: 'API新增'
} }
}, },
@ -89,7 +91,6 @@ const permission = {
hidden: 'true', hidden: 'true',
component: () => import('@/views/applicationList/apiList/apiView'), component: () => import('@/views/applicationList/apiList/apiView'),
meta: { meta: {
title: 'API查看'
} }
} }
] ]
@ -106,17 +107,17 @@ const permission = {
name: 'masterDataEdit', name: 'masterDataEdit',
hidden: true, hidden: true,
meta: { meta: {
title: '基本信息', title: '',
hidden: true hidden: true
} }
}, },
{ {
path: 'dataOrigin', path: 'dataOrigin',
component: () => import('@/views/masterDataOptions/dataOrigin'), component: () => import('@/views/masterDataOptions/dataOrigin'),
name: 'dataOrigin', name: 'masterDataEdit',
hidden: true, hidden: true,
meta: { meta: {
title: '数据源', title: '',
hidden: true hidden: true
} }
}, },
@ -126,7 +127,7 @@ const permission = {
name: 'displayInfo', name: 'displayInfo',
hidden: true, hidden: true,
meta: { meta: {
title: '显示信息', title: '',
hidden: true hidden: true
} }
@ -136,7 +137,7 @@ const permission = {
name: 'authorily', name: 'authorily',
component: () => import('@/views/masterDataOptions/authority'), component: () => import('@/views/masterDataOptions/authority'),
meta: { meta: {
title: '配置权限', title: '',
hidden: true hidden: true
} }
}, },
@ -145,10 +146,19 @@ const permission = {
name: 'distribute', name: 'distribute',
component: () => import('@/views/masterDataOptions/distribute'), component: () => import('@/views/masterDataOptions/distribute'),
meta: { meta: {
title: '分发设置', title: '',
hidden: true hidden: true
} }
},
{
path: 'logsDeatil',
name: 'logsDeatil',
component: () => import('@/views/masterDataOptions/logsDeatil'),
meta: {
title: '',
hidden: true
} }
},
] ]
} }
}) })

View File

@ -64,7 +64,11 @@ const user = {
resolve(); resolve();
}) })
.catch((error) => { .catch((error) => {
console.log(123)
//
commit("LogOut")
reject(error); reject(error);
}); });
}); });
}, },
@ -98,6 +102,7 @@ const user = {
// 退出系统 // 退出系统
LogOut({ commit, state }) { LogOut({ commit, state }) {
console.log("触发推出")
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
commit("SET_TOKEN", ""); commit("SET_TOKEN", "");
commit("SET_ROLES", []); commit("SET_ROLES", []);

View File

@ -21,6 +21,9 @@ export function openLoading(loadingName) {
case 'del': case 'del':
loadingText = '删除' loadingText = '删除'
break; break;
case 'test':
loadingText = '校验数据'
break;
} }
appLoading = Loading.service({ appLoading = Loading.service({
text: "正在" + loadingText + ",请稍候", text: "正在" + loadingText + ",请稍候",

View File

@ -1,44 +1,46 @@
import axios from "axios"; import axios from 'axios'
import { import {
Notification, Notification,
MessageBox, MessageBox,
Message, Message,
Loading Loading
} from "element-ui"; } from 'element-ui'
import store from "@/store"; import store from '@/store'
import { import {
getToken, getToken,
setToken, setToken,
removeCompanyId, removeCompanyId,
removeToken, removeToken,
removeInfo, removeInfo
} from "@/utils/auth"; } from '@/utils/auth'
import errorCode from "@/utils/errorCode"; import errorCode from '@/utils/errorCode'
import { import {
tansParams, tansParams,
blobValidate blobValidate
} from "@/utils/ruoyi"; } from '@/utils/ruoyi'
import { closeLoading, openLoading } from '@/utils/loading' import { closeLoading, openLoading } from '@/utils/loading'
import cache from "@/plugins/cache"; import cache from '@/plugins/cache'
import { import {
saveAs saveAs
} from "file-saver"; } from 'file-saver'
import route from "../router/index"; import route from '../router/index'
// import configKey from '@/assets/js/configKey.js' // import configKey from '@/assets/js/configKey.js'
let downloadLoadingInstance; let downloadLoadingInstance
let downloadLoadingAxios; let downloadLoadingAxios
// 是否显示重新登录 // 是否显示重新登录
export let isRelogin = { export let isRelogin = {
show: false, show: false
}; }
let timer = null; let timer = null
// 是否正在刷新的标记 // 是否正在刷新的标记
let isRefreshing = false; let isRefreshing = false
//重试队列 //重试队列
let requests = []; let requests = []
// 在模块作用域定义一个全局标志变量
let isHandlingTokenInvalid = false
axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8"; axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分 // axios中请求配置有baseURL选项表示请求URL公共部分
@ -46,8 +48,8 @@ const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
// baseURL: "http://192.168.2.240:8066/", // baseURL: "http://192.168.2.240:8066/",
// 超时 // 超时
timeout: 2 * 60 * 1000, timeout: 2 * 60 * 1000
}); })
// request拦截器 // request拦截器
service.interceptors.request.use( service.interceptors.request.use(
@ -56,13 +58,13 @@ service.interceptors.request.use(
// config.headers['secretkey'] = 'aQ+b2wGj1LuhR8N2O0aOmKlkjgnOyHSlZ0QUtZMP3dHkVkAGhJe37KOdmpexsE6W' //本机密钥 // config.headers['secretkey'] = 'aQ+b2wGj1LuhR8N2O0aOmKlkjgnOyHSlZ0QUtZMP3dHkVkAGhJe37KOdmpexsE6W' //本机密钥
// config.headers['secretkey'] = 'm/Ah8KQ6IfWEv85KEoaHKf4SfwtemYtGkiuBabkQCnOuJ/+nyvqBLOVheirHN1TO' //本机密钥 // config.headers['secretkey'] = 'm/Ah8KQ6IfWEv85KEoaHKf4SfwtemYtGkiuBabkQCnOuJ/+nyvqBLOVheirHN1TO' //本机密钥
config.headers["secretkey"] = configKey.secretkey; config.headers['secretkey'] = configKey.secretkey
// if (store.getters.token) { // if (store.getters.token) {
// if (window.localStorage.userToken) { // if (window.localStorage.userToken) {
let token = getToken(); let token = getToken()
if (token) { if (token) {
config.headers["token"] = token; config.headers['token'] = token
} }
if (config.url.indexOf('updateDto') != -1 || config.url.indexOf('saveDto') != -1) { if (config.url.indexOf('updateDto') != -1 || config.url.indexOf('saveDto') != -1) {
@ -76,120 +78,141 @@ service.interceptors.request.use(
} }
// 生成请求的唯一标识符 // 生成请求的唯一标识符
const requestIdentifier = `${config.url}-${config.method}`; const requestIdentifier = `${config.url}-${config.method}`
// 判断是否已存在相同的请求 // 判断是否已存在相同的请求
const isDuplicateRequest = requests.includes(requestIdentifier); const isDuplicateRequest = requests.includes(requestIdentifier)
// 如果存在相同请求,取消当前请求 // 如果存在相同请求,取消当前请求
if (isDuplicateRequest) { if (isDuplicateRequest) {
// return Promise.reject(new Error("Duplicate request")); // return Promise.reject(new Error("Duplicate request"));
} }
// 将请求的唯一标识符添加到请求队列中 // 将请求的唯一标识符添加到请求队列中
requests.push(requestIdentifier); requests.push(requestIdentifier)
// 设置计时器,在秒后移除请求的唯一标识符 // 设置计时器,在秒后移除请求的唯一标识符
clearTimeout(timer); clearTimeout(timer)
timer = setTimeout(() => { timer = setTimeout(() => {
const index = requests.indexOf(requestIdentifier); const index = requests.indexOf(requestIdentifier)
if (index !== -1) { if (index !== -1) {
requests.splice(index, 1); // 移除请求的唯一标识符 requests.splice(index, 1) // 移除请求的唯一标识符
} }
}, 2000); }, 2000)
return config; return config
}, },
(error) => { (error) => {
// do something with request error // do something with request error
// 请求发生错误时清除唯一标识符 // 请求发生错误时清除唯一标识符
const requestIdentifier = `${error.config.url}-${error.config.method}`; const requestIdentifier = `${error.config.url}-${error.config.method}`
const index = requests.indexOf(requestIdentifier); const index = requests.indexOf(requestIdentifier)
if (index !== -1) { if (index !== -1) {
requests.splice(index, 1); // 清除唯一标识符 requests.splice(index, 1) // 清除唯一标识符
} }
return Promise.reject(error); return Promise.reject(error)
} }
); )
// 响应拦截器 // 响应拦截器
service.interceptors.response.use( service.interceptors.response.use(
(res) => { (res) => {
// 请求完成时清除唯一标识符 // 请求完成时清除唯一标识符
const requestIdentifier = `${res.config.url}-${res.config.method}`; const requestIdentifier = `${res.config.url}-${res.config.method}`
const index = requests.indexOf(requestIdentifier); const index = requests.indexOf(requestIdentifier)
if (index !== -1) { if (index !== -1) {
requests.splice(index, 1); // 清除唯一标识符 requests.splice(index, 1) // 清除唯一标识符
} }
// downloadLoadingAxios.close() // downloadLoadingAxios.close()
// 未设置状态码则默认成功状态 // 未设置状态码则默认成功状态
const code = res.data.status || '200'; const code = res.data.status || '200'
// 获取错误信息 // 获取错误信息
const msg = res.data.msg; const msg = res.data.msg
closeLoading(); closeLoading()
// 二进制数据则直接返回 // 二进制数据则直接返回
if ( if (
res.request.responseType === "blob" || res.request.responseType === 'blob' ||
res.request.responseType === "arraybuffer" res.request.responseType === 'arraybuffer'
) { ) {
return res.data; return res.data
} }
if (code === '500') { if (code === '500') {
MessageBox.confirm(msg, "系统提示", { // 判断是否在处理 token 无效情况
confirmButtonText: "确定", if (msg === 'token无效' && isHandlingTokenInvalid) return
if (msg === 'token无效' && !isHandlingTokenInvalid) {
isHandlingTokenInvalid = true;
MessageBox.confirm('登录失效!请重新登录。', '系统提示', {
confirmButtonText: '确定',
showCancelButton: false, showCancelButton: false,
showClose: false, showClose: false,
closeOnClickModal: false, closeOnClickModal: false,
closeOnPressEscape: false, closeOnPressEscape: false,
type: "error", type: 'error'
}) })
.then(() => { .then(() => {
if (msg === 'token无效') {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
route.replace({ route.replace({
path: "/login" path: '/login'
});; });
// 重置标志变量
isHandlingTokenInvalid = false;
});
}) })
.catch(() => {
// 处理取消逻辑
isHandlingTokenInvalid = false;
});
} else {
// 其他错误处理
MessageBox.confirm(msg, '系统提示', {
confirmButtonText: '确定',
showCancelButton: false,
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
type: 'error'
});
} }
})
.catch(() => { });
return Promise.reject(new Error(msg)); return Promise.reject(new Error(msg));
} else if (code == '1002') { } else if (code == '1002') {
MessageBox.confirm(msg, "系统提示", { MessageBox.confirm(msg, '系统提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
showCancelButton: false, showCancelButton: false,
showClose: false, showClose: false,
closeOnClickModal: false, closeOnClickModal: false,
closeOnPressEscape: false, closeOnPressEscape: false,
type: "error", type: 'error'
}) })
.then(() => { .then(() => {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
route.replace({ route.replace({
path: "/login" path: '/login'
});; })
}) })
}) })
.catch(() => { }); .catch(() => {
})
} else if (code !== '200') { } else if (code !== '200') {
MessageBox.confirm(msg, "系统提示", { MessageBox.confirm(msg, '系统提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
showCancelButton: false, showCancelButton: false,
showClose: false, showClose: false,
closeOnClickModal: false, closeOnClickModal: false,
closeOnPressEscape: false, closeOnPressEscape: false,
type: "error", type: 'error'
}) })
.then(() => { }) .then(() => {
.catch(() => { }); })
return Promise.reject("error"); .catch(() => {
})
return Promise.reject('error')
} else { } else {
return res.data; return res.data
} }
}, },
(error) => { (error) => {
let response = error.response; let response = error.response
closeLoading(); closeLoading()
// downloadLoadingAxios.close() // downloadLoadingAxios.close()
// if (response.status == 401) { // if (response.status == 401) {
// if (response.data.code == 1002) { // if (response.data.code == 1002) {
@ -251,48 +274,48 @@ service.interceptors.response.use(
// .catch(() => {}); // .catch(() => {});
// } // }
return Promise.reject(error); return Promise.reject(error)
} }
); )
// 通用下载方法 // 通用下载方法
export function download(url, params, filename, config) { export function download(url, params, filename, config) {
downloadLoadingInstance = Loading.service({ downloadLoadingInstance = Loading.service({
text: "正在下载数据,请稍候", text: '正在下载数据,请稍候',
spinner: "el-icon-loading", spinner: 'el-icon-loading',
background: "rgba(0, 0, 0, 0.7)", background: 'rgba(0, 0, 0, 0.7)'
}); })
return service return service
.post(url, params, { .post(url, params, {
transformRequest: [ transformRequest: [
(params) => { (params) => {
return tansParams(params); return tansParams(params)
}, }
], ],
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded", 'Content-Type': 'application/x-www-form-urlencoded'
}, },
responseType: "blob", responseType: 'blob',
...config, ...config
}) })
.then(async(data) => { .then(async(data) => {
const isLogin = await blobValidate(data); const isLogin = await blobValidate(data)
if (isLogin) { if (isLogin) {
const blob = new Blob([data]); const blob = new Blob([data])
saveAs(blob, filename); saveAs(blob, filename)
} else { } else {
const resText = await data.text(); const resText = await data.text()
const rspObj = JSON.parse(resText); const rspObj = JSON.parse(resText)
const errMsg = const errMsg =
errorCode[rspObj.code] || rspObj.msg || errorCode["default"]; errorCode[rspObj.code] || rspObj.msg || errorCode['default']
Message.error(errMsg); Message.error(errMsg)
} }
downloadLoadingInstance.close(); downloadLoadingInstance.close()
}) })
.catch((r) => { .catch((r) => {
Message.error("下载文件出现错误,请联系管理员!"); Message.error('下载文件出现错误,请联系管理员!')
downloadLoadingInstance.close(); downloadLoadingInstance.close()
}); })
} }
export default service; export default service

View File

@ -5,7 +5,7 @@
ref="baseRightDialog" ref="baseRightDialog"
:footerShow="true" :footerShow="true"
:dialogVisible.sync="dialogVisible" :dialogVisible.sync="dialogVisible"
:title="dialogTitle + ' 集成前台任务'" :title="dialogTitle + ' 接口管理'"
@handleClose="handleDialogClose" @handleClose="handleDialogClose"
:type="dialogType" :type="dialogType"
:submitShow="submitShow" :submitShow="submitShow"
@ -220,7 +220,7 @@ export default {
return return
} else { } else {
let params = { let params = {
...this.$refs.basicsForm.ruleForm, ...this.$refs.basicsForm.ruleForm
} }
if (this.dialogType == 'add') { if (this.dialogType == 'add') {
this.openLoading('submit') this.openLoading('submit')

View File

@ -0,0 +1,272 @@
/**
* @desc 消息管理日志
* @date 2023-08-31
*/
// 表头
const tableColumnData = [
{
label: '发送者应用',
prop: 'sendAppName',
tooltip: true,
},
{
label: '源数据',
prop: 'sourceData',
tooltip: true,
},
{
label: '目标数据',
prop: 'targetData',
tooltip: true,
},
{
label: '状态',
prop: 'status',
tooltip: true,
},
{
label: '错误状态',
prop: 'errorStatus',
tooltip: true,
},
{
label: '返回信息',
prop: 'returnData',
tooltip: true,
}, {
label: '创建时间',
prop: 'createTime',
tooltip: true,
},
{
label: '备注',
prop: 'remark',
tooltip: true,
},
]
const tableVersionColumn = [
{
label: '接收者名称',
prop: 'receiveName',
},
{
label: '接收者编码',
prop: 'receiveCode',
},
{
label: '接收者应用',
prop: 'receiveApp',
},
{
label: '接收者',
prop: 'receiveApi',
},
{
label: '数据类型',
prop: 'dataType',
},
{
label: '备注',
prop: 'remark',
},
]
// 基本信息内容
const formRow = [
{
elCol: [{
label: '消息管理名称',
prop: 'theme',
tag: 'elInput',
disabled: true,
span: 24
}]
},
{
elCol: [{
label: '发送者应用',
prop: 'sendApp',
tag: 'elSelect',
disabled: true,
options: [],
optionValue: 'id',
optionLabel: 'name',
}, {
label: '发送者',
prop: 'sendApi',
tag: 'elSelect',
disabled: true,
options: [],
optionValue: 'id',
optionLabel: 'apiName',
}]
},
{
elCol: [{
label: '接收者应用',
prop: 'receiveApp',
tag: 'elSelect',
disabled: true,
options: [],
optionValue: 'id',
optionLabel: 'name',
}, {
label: '接收者',
prop: 'receiveApi',
tag: 'elSelect',
disabled: true,
options: [],
optionValue: 'id',
optionLabel: 'apiName',
}]
},
{
elCol: [{
label: '源数据',
prop: 'sourceData',
tag: 'elSlot',
slotName: "sourceData",
span: 24,
}]
},
{
elCol: [{
label: '目标数据',
prop: 'targetData',
tag: 'elSlot',
slotName: "targetData",
span: 24,
}]
},
{
elCol: [{
label: '状态',
prop: 'status',
tag: 'elRadio',
disabled: true,
span: 24,
options: [
{value: "1", label: "待发送"},
{value: "2", label: "发送中"},
{value: "3", label: "发送成功"},
{value: "4", label: "发送失败"},
],
},]
},
{
elCol: [{
label: '错误状态',
prop: 'error_status',
tag: 'elRadio',
disabled: true,
span: 24,
options: [
{value: "1", label: "需要重新发送"},
{value: "2", label: "不需要重新发送"},
],
},]
},
{
elCol: [{
label: '返回信息',
prop: 'returnData',
tag: 'elInput',
type: 'textarea',
disabled: true,
span: 24,
}]
},
]
const basicsRules = {
sourceData: [{
required: true,
message: '请输入源数据',
trigger: 'blur'
}],
targetData: [{
required: true,
message: '请输入目标数据',
trigger: 'blur'
}],
}
// 查看
const formRowShow = [
{
elCol: [{
label: '发送者应用',
prop: 'sendApp',
tag: 'elSelect',
disabled: true,
options: [],
optionValue: 'id',
optionLabel: 'name',
},]
},
{
elCol: [{
label: '源数据',
prop: 'sourceData',
tag: 'elInput',
disabled: true,
type: 'textarea',
span: 24,
}]
},
{
elCol: [{
label: '目标数据',
prop: 'targetData',
tag: 'elInput',
disabled: true,
type: 'textarea',
span: 24,
}]
},
{
elCol: [{
label: '状态',
prop: 'status',
tag: 'elRadio',
disabled: true,
span: 24,
options: [
{value: "1", label: "待发送"},
{value: "2", label: "发送中"},
{value: "3", label: "发送成功"},
{value: "4", label: "发送失败"},
],
},]
},
{
elCol: [{
label: '错误状态',
prop: 'errorStatus',
tag: 'elRadio',
disabled: true,
span: 24,
options: [
{value: "1", label: "需要重新发送"},
{value: "2", label: "不需要重新发送"},
],
},]
},
{
elCol: [{
label: '返回信息',
prop: 'returnData',
tag: 'elInput',
type: 'textarea',
disabled: true,
span: 24,
}]
},
]
export default {
tableColumnData,
formRow,
basicsRules,
formRowShow,
tableVersionColumn
}

339
src/views/apiLogs/index.vue Normal file
View File

@ -0,0 +1,339 @@
<template>
<div>
<base-layout
ref="baseLayout"
@onFuncBtn="onFuncBtn"
:querySwitch="true"
:searchList="requirementList"
@search="handleSearchEvent"
:isPage="true"
@pageChange="handlePageChange"
@onElSelect="onElSelect"
:bodyHight="''"
>
<div slot="main" slot-scope="{ tableHeight }">
<base-table
ref="baseTable"
:showIndex="true"
:funWidth="215"
:funData="funData"
@onFunc="onFunc"
:tabLoading.sync="tabLoading"
:tableHeight="'80vh'"
:tableData="tableData"
:tableColumn="tableColumnData"
>
<template v-slot:status="{ row }">
<div style="width: 100%">
<span v-if="row.status == '1'">待发送</span>
<span v-else-if="row.status == '2'">发送中</span>
<span v-else-if="row.status == '3'">发送成功</span>
<span v-else-if="row.status == '4'">发送失败</span>
<span v-else></span>
</div>
</template>
<template v-slot:errorStatus="{ row }">
<div style="width: 100%">
<span>{{
row.errorStatus === "1" ? "需要重新发送" : "不需要重新发送"
}}</span>
</div>
</template>
</base-table>
</div>
</base-layout>
<right-dialog ref="rightDialog" @resetTable="resetTable"></right-dialog>
</div>
</template>
<script>
import baseLayout from "@/components/base/baseLayout";
import baseTable from "@/components/base/baseTable";
import rightDialog from "./rightDialog";
import configData from "./configData";
import {authApi} from "@/api/apis/auth";
import {getApiModuleApi} from "@/api/apiChunks/index.js";
export default {
components: {
baseLayout,
baseTable,
rightDialog,
},
props: {
receiveApi: {
type: String,
default: ""
}
},
data() {
return {
buttonList: [
{
menuName: "刷新",
icon: "el-icon-refresh",
btnFunction: "resetLoad",
},
], //
requirementList: [
{
placeholder: "发送者应用",
prop: "sendApp",
tag: "elSelect",
options: [],
optionValue: "id",
optionLabel: "name",
},
{
placeholder: "接受者应用",
prop: "receiveApp",
tag: "elSelect",
options: [],
optionValue: "id",
optionLabel: "name",
},
{
placeholder: "接受者api",
prop: "receiveApi",
tag: "elSelect",
options: [],
optionValue: "id",
optionLabel: "apiName",
},
{
placeholder: "开始日期",
prop: "createTimeStart",
tag: "elDatePicker",
},
{
placeholder: "结束日期",
prop: "createTimeEnd",
tag: "elDatePicker",
},
{
placeholder: "状态",
prop: "status",
tag: "elSelect",
options: [
{id: "3", label: "发送成功"},
{id: "4", label: "发送失败"},
],
error_status_dist: {
1: "需要重新发送",
2: "不需要重新发送",
},
optionValue: "id",
optionLabel: "label",
},
{
placeholder: "源数据",
prop: "sourceData",
tag: "elInput",
},
{
placeholder: "目标数据",
prop: "targetData",
tag: "elInput",
},
{
placeholder: "返回信息",
prop: "returnData",
tag: "elInput",
},
], //list
tabLoading: false,
tableColumnData: configData.tableColumnData, //
funData: [
{
color: "#6a9af1",
text: "查看",
},
],
tableData: [], //
pageModel: {
pageNum: 1,
pageSize: 100,
},
queryModel: {
theme: "",
sendApp: "",
sendApi: "",
receiveApp: "",
receiveApi: "",
status: "",
targetData: '',
sourceData: '',
returnData: ''
},
};
},
created() {
// this.GetMessageLogTableData();
this.initSelect()
},
methods: {
async onElSelect(event, index, indexItem, model, row) {
console.log(event, index, indexItem, model, row)
if (row.placeholder === '接受者应用') {
this.$set(this.queryModel, 'receiveApi', '')
this.$set(this.$refs.baseLayout.ruleForm, 'receiveApi', "")
if (event) {
const res = await authApi('sysApplicationService', 'application', 'thirdInterfacequeryAppApi', '', {
appId: event
})
if(res.status ==200){
this.requirementList[2].options = res.attribute
}
} else {
this.requirementList[2].options = []
}
}
},
//
async GetMessageLogTableData() {
this.tabLoading = true;
let param = {
...this.pageModel,
...this.queryModel,
};
let res = await authApi(
"sysApplicationService",
"application",
"thirdInterfacequeryAppApiLog",
"",
param
);
this.tabLoading = false;
console.log(res, 112312312)
if (res.status == "200") {
this.tableData = res.attribute.list;
this.$refs.baseLayout.setPageTotal(res.attribute.total);
}
},
//
handlePageChange(val) {
this.pageModel.pageNum = val.pageIndex;
this.pageModel.pageSize = val.pageSize;
this.GetMessageLogTableData();
},
//
onFuncBtn(btn) {
this[btn.btnFunction]();
},
//
onFunc(index, row) {
//
if (index == 0) {
this.openLoading("detail");
this.$refs.rightDialog.openDialog("show", row);
}
//
if (index == 1) {
this.openLoading("detail");
this.$refs.rightDialog.openDialog("edit", row);
}
//
if (index == 2) {
this.$confirm("确认重新发送吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.openLoading("detail");
this.messageResendData(row.id);
})
.catch(() => {
this.$message({
type: "info",
message: "取消重新发送",
});
});
}
},
async messageResendData(id) {
let param = {
id: id,
};
let res = await authApi(
"sysMessageManageLogService",
"messageManage",
"resendData",
"",
param
);
if (res.status == "200") {
this.$vmNews("重新发送成功!", "success");
this.resetTable();
}
},
//
resetTable() {
this.pageModel.pageNum = 1;
this.$refs.baseLayout.pageClear();
this.GetMessageLogTableData();
},
//
handleSearchEvent(form) {
let data = this.$refs.baseLayout.ruleForm;
this.queryModel = {...data}
if (!data.sendApp) {
this.$vmNews("请选择发送者应用")
return
}
if (!data.receiveApp) {
this.$vmNews("请选择接受者应用")
return
}
if (!data.receiveApi) {
this.$vmNews("请选择接受者api")
return
}
if (!data.status) {
this.$vmNews("请选择状态")
return
}
this.resetTable();
},
async initSelect() {
const res = await getApiModuleApi({
tl: "sysApplicationService",
as: "application",
dj: "thirdInterfacequeryApp"
}, {
"pageNum": 1,
"pageSize": 999
})
console.log(res, 'res')
this.requirementList[0].options = res.attribute.list
this.requirementList[1].options = res.attribute.list
},
// async onElSelect(val, b, c, d, row) {
// if (row.prop === 'sendApp') {
// this.requirementList[1].options = []
// this.$set(this.$refs.baseLayout.ruleForm, 'sendApi', "")
// const res = await getApiModuleApi({
// tl: "sysApplicationService",
// as: "application",
// dj: "queryAppApi",
// }, {
// "pageNum": 1,
// "pageSize": 999,
// appId: val
// })
// this.requirementList[1].options = res.attribute.list
// console.log(res)
// }
// }
},
};
</script>
<style scoped>
.clickTitle {
color: #409eff;
cursor: pointer;
}
</style>

View File

@ -0,0 +1,282 @@
<template>
<div>
<base-right-dialog
ref="baseRightDialog"
:footerShow="true"
:dialogVisible.sync="dialogVisible"
:title="dialogTitle + ' 消息管理日志'"
@handleClose="handleDialogClose"
:type="dialogType"
:submitShow="submitShow"
:size="'65%'"
@handleConfirmClick="handleConfirmClick"
>
<base-form
ref="basicsForm"
:formRow="formRow"
:isFunBtn="false"
:rules="basicsRules"
class="dialog_form"
:spanWidth="`120px`"
:loading="vLoading"
style="padding-bottom:20px;"
>
<div slot="sourceData" class="code-json-editor">
<vue-json-editor
class="editor"
v-model="sourceData"
:showBtns="false"
:mode="'code'"
@json-change="onSourceDataJsonChange"
@json-save="onSourceDataSave"
@has-error="onSourceDataError"
/>
</div>
<div slot="targetData" class="code-json-editor">
<vue-json-editor
class="editor"
v-model="targetData"
:showBtns="false"
:mode="'code'"
@json-change="onTargetDataChange"
@json-save="onTargetDataSave"
@has-error="onTargetDataError"
/>
</div>
</base-form>
</base-right-dialog>
</div>
</template>
<script>
import vueJsonEditor from "vue-json-editor";
import baseRightDialog from "@/components/base/baseRightDialog";
import baseForm from "@/components/base/baseNewForm";
import baseTable from "@/components/base/baseTable";
import configData from "./configData";
import { authApi } from "@/api/apis/auth";
import {getApiModuleApi} from "@/api/apiChunks/index.js";
export default {
components: {
baseRightDialog,
baseForm,
baseTable,
vueJsonEditor,
},
data() {
return {
dialogVisible: false,
dialogTitle: "",
dialogType: "",
formRow: configData.formRow,
basicsRules: configData.basicsRules,
vLoading: false,
submitShow: true,
sourceData: {},
sourceDataFlag: true,
targetData: {},
targetDataFlag: true,
};
},
methods: {
openDialog(type, row) {
this.querysysAppService();
// this.querysysAppApiService();
this.formRow = configData.formRow;
this.submitShow = true;
//
if (type == "edit") {
this.dialogTitle = "编辑";
this.dialogType = "edit";
this.messageLogGetById(row.id);
}
//
if (type == "show") {
this.submitShow = false;
this.formRow = configData.formRowShow;
this.dialogTitle = "查看";
this.dialogType = "show";
this.messageLogGetById(row.id);
}
this.dialogVisible = true;
},
//
async messageLogGetById(id) {
let params = {
id: id,
};
let res = await authApi(
"sysMessageManageLogService",
"messageManage",
"thirdInterfacequeryEntity",
"",
params
);
if (res.status == "200") {
this.$nextTick(() => {
this.$refs.basicsForm.incomingParameters(res.attribute);
});
}
},
//
onSourceDataJsonChange(value) {
this.onSourceDataSave(value);
},
onSourceDataSave(value) {
this.sourceData = value;
this.sourceDataFlag = true;
},
onSourceDataError(value) {
this.sourceDataFlag = false;
},
checkSourceDataJson() {
if (this.sourceDataFlag === false) {
return false;
} else {
return true;
}
},
//
onTargetDataChange(value) {
this.onTargetDataSave(value);
},
onTargetDataSave(value) {
this.targetData = value;
this.targetDataFlag = true;
},
onTargetDataError(value) {
this.targetDataFlag = false;
},
checkTargetDataJson() {
if (this.targetDataFlag === false) {
return false;
} else {
return true;
}
},
//
handleDialogClose() {
this.$refs.basicsForm.resetFields();
this.dialogVisible = false;
},
//
handleConfirmClick() {
let checkSource = this.checkSourceDataJson();
if (!checkSource) {
this.$vmNews("源数据格式应为JSON格式", "warning");
return;
}
let checkTarget = this.checkTargetDataJson();
if (!checkTarget) {
this.$vmNews("目标数据格式应为JSON格式", "warning");
return;
}
let params = {
...this.$refs.basicsForm.ruleForm,
sourceData: this.sourceData,
targetData: this.targetData,
};
if (this.dialogType == "edit") {
this.openLoading("submit");
this.messageLogUpdateDto(params);
}
},
//
async messageLogUpdateDto(params) {
let res = await authApi(
"sysMessageManageLogService",
"messageManage",
"updateEntity",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("更新成功", "success");
this.$emit("resetTable");
}
},
//
async querysysAppService() {
const res = await getApiModuleApi({
tl: "sysApplicationService",
as: "application",
dj: "thirdInterfacequeryApp"
}, {
"pageNum": 1,
"pageSize": 999
})
this.formRow[0].elCol[0].options = res.attribute.list
// if (res.status == "200") {
// this.formRow[1].elCol[0].options = res.attribute.list;
// this.formRow[2].elCol[0].options = res.attribute.list;
// }
},
//
async querysysAppApiService() {
let params = {
pageSize: 9999,
pageNum: 1,
};
let res = await authApi(
"appApiService",
"appApi",
"queryPage",
"",
params
);
if (res.status == "200") {
// this.formRow[1].elCol[1].options = res.attribute.list;
// this.formRow[2].elCol[1].options = res.attribute.list;
}
},
},
};
</script>
<style lang="less" scoped>
.code-json-editor {
/* jsoneditor右上角默认有一个链接,加css去掉 */
/deep/ .jsoneditor-poweredBy {
display: none !important;
}
/deep/ .ace-jsoneditor {
height: 150px !important;
}
}
</style>
<style scoped lang="scss">
::v-deep textarea.el-textarea__inner {
min-height: 150px !important;
}
.dialogList {
padding: 16px 0;
border-top: 1px solid #dcdfe6;
display: flex;
flex-direction: column;
}
.updateBtn {
border: 1px solid #ebedf1;
padding: 5px 0;
border-radius: 3px;
text-align: center;
font-size: 14px;
cursor: pointer;
width: 100px;
}
.updateBtn:hover {
color: #1890ff;
border-color: #badeff;
background-color: #e8f4ff;
}
::v-deep .el-table__body-wrapper.is-scrolling-none {
height: auto !important;
}
::v-deep .app-container {
height: auto !important;
}
</style>

View File

@ -99,7 +99,7 @@ export default {
tableData: [], // tableData: [], //
pageModel: { pageModel: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 100,
}, },
queryModel: { queryModel: {
code: "", code: "",

View File

@ -107,7 +107,7 @@ export default {
tableData: [], // tableData: [], //
pageModel: { pageModel: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 100,
}, },
queryModel: { queryModel: {
code: "", code: "",

File diff suppressed because it is too large Load Diff

View File

@ -239,6 +239,7 @@
v-model="logDialog" v-model="logDialog"
@confirm="logConfirm" @confirm="logConfirm"
:width="'80%'" :width="'80%'"
:footerShow="false"
> >
<div> <div>
<logTableChunk v-if="logDialog" :receiveApi="receiveApi"></logTableChunk> <logTableChunk v-if="logDialog" :receiveApi="receiveApi"></logTableChunk>
@ -686,7 +687,8 @@ export default {
} }
// json // json
let bodyIn = JSON.parse(res.attribute.api.bodyIn) let bodyIn = JSON.parse(res.attribute.api.bodyIn)
let bodyFlag = bodyIn[0].parameterType !== "complex" console.log(bodyIn, 'bodyIn')
let bodyFlag = bodyIn[0] && bodyIn[0].parameterType !== "complex"
let queryObj = {}; let queryObj = {};
let headerObj = {}; let headerObj = {};
let bodyObj let bodyObj
@ -704,6 +706,7 @@ export default {
bodyObj[item.interfaceKey] = item.interfaceValue === null ? "" : item.interfaceValue; bodyObj[item.interfaceKey] = item.interfaceValue === null ? "" : item.interfaceValue;
} }
}) })
console.log(1,res.attribute.api)
// //
if (res.attribute.api.needLogin == 1) { if (res.attribute.api.needLogin == 1) {
this.getDebugInfoHandle( this.getDebugInfoHandle(
@ -731,7 +734,7 @@ export default {
this.$set(json, "query", {}); this.$set(json, "query", {});
} }
if ( if (
JSON.parse(res.attribute.api.bodyIn) JSON.parse(res.attribute.api.bodyIn).length
) { ) {
if (!bodyFlag) { if (!bodyFlag) {
this.DebugDataHandle(bodyObj, bodyIn[0].children) this.DebugDataHandle(bodyObj, bodyIn[0].children)
@ -986,7 +989,7 @@ export default {
computed: { computed: {
// //
funWidth() { funWidth() {
return this.mainFunData.length * 70; return this.mainFunData.length * 90;
}, },
}, },
components: { components: {
@ -1023,7 +1026,7 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
::v-deep .el-button { ::v-deep .el-button {
border-radius: 16px; border-radius: 4px;
} }
.apiWrap { .apiWrap {

View File

@ -250,6 +250,7 @@ export default {
}, },
authDataHandle(obj, arr) { authDataHandle(obj, arr) {
arr.forEach((item) => { arr.forEach((item) => {
console.log(item, 'item')
if (item.parameterType === "authport") { if (item.parameterType === "authport") {
obj[item.parameterName] = this.authDataReturn(item.example); obj[item.parameterName] = this.authDataReturn(item.example);
} }
@ -297,12 +298,16 @@ export default {
// //
async init() { async init() {
//url //url
console.log(1)
this.getApiModuleApiHanlde(0, false, this.stepOneForm.destinationAddress) this.getApiModuleApiHanlde(0, false, this.stepOneForm.destinationAddress)
console.log(222)
if (this.stepZeroForm.needLogin === '1') { if (this.stepZeroForm.needLogin === '1') {
this.getApiModuleApiHanlde(this.stepZeroForm.authenticationPort, true) this.getApiModuleApiHanlde(this.stepZeroForm.authenticationPort, true)
console.log(333)
} }
}, },
async getApiModuleApiHanlde(id, flag, address = {}) { async getApiModuleApiHanlde(id, flag, address = {}) {
console.log(11123)
const res = await getApiModuleApi( const res = await getApiModuleApi(
{ {
tl: "sysApplicationService", tl: "sysApplicationService",
@ -311,12 +316,15 @@ export default {
}, },
{id: id, appId: this.$route.query.id} {id: id, appId: this.$route.query.id}
); );
console.log(77)
let tempUrl = res.attribute.app.interfaceAddress ? res.attribute.app.interfaceAddress : "" let tempUrl = res.attribute.app.interfaceAddress ? res.attribute.app.interfaceAddress : ""
if (flag) { if (flag) {
console.log(tempUrl, 'tempUrl')
this.authMethod = res.attribute.api.requestMethod == 1 ? 'post' : 'get'; this.authMethod = res.attribute.api.requestMethod == 1 ? 'post' : 'get';
this.authInterfaceAddress = tempUrl + res.attribute.api.destinationAddress; this.authInterfaceAddress = tempUrl + res.attribute.api.destinationAddress;
let bodyIn = JSON.parse(res.attribute.api.bodyIn) let bodyIn = JSON.parse(res.attribute.api.bodyIn)
let bodyFlag = bodyIn[0].parameterType !== "complex" console.log(bodyIn, '1')
let bodyFlag = bodyIn[0] && bodyIn[0].parameterType !== "complex"
let headerObj = {} let headerObj = {}
let bodyObj let bodyObj
let queryObj = {} let queryObj = {}
@ -343,7 +351,8 @@ export default {
this.$set(this.authInfo, 'query', deepClone(queryObj)) this.$set(this.authInfo, 'query', deepClone(queryObj))
this.$set(this.authInfo, 'body', deepClone(bodyObj)) this.$set(this.authInfo, 'body', deepClone(bodyObj))
} else { } else {
let bodyFlag = this.bodyEntTableInfo[0].parameterType !== "complex" console.log(88, this.bodyEntTableInfo)
let bodyFlag = this.bodyEntTableInfo.length && this.bodyEntTableInfo[0].parameterType !== "complex"
let headerObj = {} let headerObj = {}
let bodyObj let bodyObj
let queryObj = {} let queryObj = {}
@ -362,19 +371,26 @@ export default {
this.interfaceAddress = tempUrl + address; this.interfaceAddress = tempUrl + address;
this.headerDisposeHandle(headerObj, this.headersTableInfo) this.headerDisposeHandle(headerObj, this.headersTableInfo)
this.queryDisposeHandle(queryObj, this.queryTableInfo) this.queryDisposeHandle(queryObj, this.queryTableInfo)
if (this.bodyEntTableInfo.length) {
if (!bodyFlag) { if (!bodyFlag) {
this.bodyDisposeHandle(bodyObj, this.bodyEntTableInfo[0].children) this.bodyDisposeHandle(bodyObj, this.bodyEntTableInfo[0].children)
} else { } else {
this.bodyDisposeHandle(bodyObj[0], this.bodyEntTableInfo[0].children) this.bodyDisposeHandle(bodyObj[0], this.bodyEntTableInfo[0].children)
} }
} else {
bodyObj = {}
}
this.$set(this.resultInfo, 'headers', deepClone(headerObj)) this.$set(this.resultInfo, 'headers', deepClone(headerObj))
this.$set(this.resultInfo, 'query', deepClone(queryObj)) this.$set(this.resultInfo, 'query', deepClone(queryObj))
this.$set(this.resultInfo, 'body', deepClone(bodyObj)) this.$set(this.resultInfo, 'body', deepClone(bodyObj))
console.log(33)
} }
}, },
headerDisposeHandle(header, arr) { headerDisposeHandle(header, arr) {
arr.forEach(item => { arr.forEach(item => {
console.log(item, 'item3')
if (item.parameterType === "authport") { if (item.parameterType === "authport") {
header[item.parameterName] = ""; header[item.parameterName] = "";
} else { } else {
@ -441,6 +457,8 @@ export default {
// }); // });
// }, // },
jsonParseHandle(parameterType, example, concreteType = false) { jsonParseHandle(parameterType, example, concreteType = false) {
console.log(parameterType, 'parameterType1')
let parameterTypeDist = { let parameterTypeDist = {
authport: "", authport: "",
fundamentallist: [example], fundamentallist: [example],
@ -458,6 +476,7 @@ export default {
}, },
bodyDisposeHandle(obj, arr) { bodyDisposeHandle(obj, arr) {
arr.forEach((item) => { arr.forEach((item) => {
console.log(item, 'item2')
const {parameterName, concreteType, parameterType, example, children} = item; const {parameterName, concreteType, parameterType, example, children} = item;
if (parameterName && concreteType) { if (parameterName && concreteType) {
if (!["Object", "ObjectCom", "Map"].includes(concreteType)) { if (!["Object", "ObjectCom", "Map"].includes(concreteType)) {

View File

@ -7,63 +7,70 @@ const tableColumnData = [
{ {
label: '发送者应用', label: '发送者应用',
prop: 'sendAppName', prop: 'sendAppName',
tooltip: true, tooltip: true
}, },
{ {
label: '源数据', label: '源数据',
prop: 'sourceData', prop: 'sourceData',
tooltip: true, tooltip: true
}, },
{ {
label: '目标数据', label: '目标数据',
prop: 'targetData', prop: 'targetData',
tooltip: true, tooltip: true
}, },
{ {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
tooltip: true, tooltip: true
}, },
{ {
label: '错误状态', label: '错误状态',
prop: 'errorStatus', prop: 'errorStatus',
tooltip: true, tooltip: true
}, },
{ {
label: '返回信息', label: '返回信息',
prop: 'returnData', prop: 'returnData',
tooltip: true, tooltip: true
}, {
label: '创建时间',
prop: 'createTime',
tooltip: true,
},
]
const tableVersionColumn = [
{
label: '接收者名称',
prop: 'receiveName',
},
{
label: '接收者编码',
prop: 'receiveCode',
},
{
label: '接收者应用',
prop: 'receiveApp',
},
{
label: '接收者',
prop: 'receiveApi',
},
{
label: '数据类型',
prop: 'dataType',
}, },
{ {
label: '备注', label: '备注',
prop: 'remark', prop: 'remark',
tooltip: true
}, },
{
label: '创建时间',
prop: 'createTime',
tooltip: true
},
]
const tableVersionColumn = [
{
label: '接收者名称',
prop: 'receiveName'
},
{
label: '接收者编码',
prop: 'receiveCode'
},
{
label: '接收者应用',
prop: 'receiveApp'
},
{
label: '接收者',
prop: 'receiveApi'
},
{
label: '数据类型',
prop: 'dataType'
},
{
label: '备注',
prop: 'remark'
}
] ]
// 基本信息内容 // 基本信息内容
@ -85,7 +92,7 @@ const formRow = [
disabled: true, disabled: true,
options: [], options: [],
optionValue: 'id', optionValue: 'id',
optionLabel: 'name', optionLabel: 'name'
}, { }, {
label: '发送者', label: '发送者',
prop: 'sendApi', prop: 'sendApi',
@ -93,7 +100,7 @@ const formRow = [
disabled: true, disabled: true,
options: [], options: [],
optionValue: 'id', optionValue: 'id',
optionLabel: 'apiName', optionLabel: 'apiName'
}] }]
}, },
{ {
@ -104,7 +111,7 @@ const formRow = [
disabled: true, disabled: true,
options: [], options: [],
optionValue: 'id', optionValue: 'id',
optionLabel: 'name', optionLabel: 'name'
}, { }, {
label: '接收者', label: '接收者',
prop: 'receiveApi', prop: 'receiveApi',
@ -112,7 +119,7 @@ const formRow = [
disabled: true, disabled: true,
options: [], options: [],
optionValue: 'id', optionValue: 'id',
optionLabel: 'apiName', optionLabel: 'apiName'
}] }]
}, },
{ {
@ -120,8 +127,8 @@ const formRow = [
label: '源数据', label: '源数据',
prop: 'sourceData', prop: 'sourceData',
tag: 'elSlot', tag: 'elSlot',
slotName: "sourceData", slotName: 'sourceData',
span: 24, span: 24
}] }]
}, },
{ {
@ -129,8 +136,8 @@ const formRow = [
label: '目标数据', label: '目标数据',
prop: 'targetData', prop: 'targetData',
tag: 'elSlot', tag: 'elSlot',
slotName: "targetData", slotName: 'targetData',
span: 24, span: 24
}] }]
}, },
{ {
@ -141,12 +148,12 @@ const formRow = [
disabled: true, disabled: true,
span: 24, span: 24,
options: [ options: [
{value: "1", label: "待发送"}, { value: '1', label: '待发送' },
{value: "2", label: "发送中"}, { value: '2', label: '发送中' },
{value: "3", label: "发送成功"}, { value: '3', label: '发送成功' },
{value: "4", label: "发送失败"}, { value: '4', label: '发送失败' }
], ]
},] }]
}, },
{ {
elCol: [{ elCol: [{
@ -156,10 +163,10 @@ const formRow = [
disabled: true, disabled: true,
span: 24, span: 24,
options: [ options: [
{value: "1", label: "需要重新发送"}, { value: '1', label: '需要重新发送' },
{value: "2", label: "不需要重新发送"}, { value: '2', label: '不需要重新发送' }
], ]
},] }]
}, },
{ {
elCol: [{ elCol: [{
@ -168,9 +175,9 @@ const formRow = [
tag: 'elInput', tag: 'elInput',
type: 'textarea', type: 'textarea',
disabled: true, disabled: true,
span: 24, span: 24
}] }]
}, }
] ]
const basicsRules = { const basicsRules = {
@ -183,7 +190,7 @@ const basicsRules = {
required: true, required: true,
message: '请输入目标数据', message: '请输入目标数据',
trigger: 'blur' trigger: 'blur'
}], }]
} }
// 查看 // 查看
@ -196,8 +203,8 @@ const formRowShow = [
disabled: true, disabled: true,
options: [], options: [],
optionValue: 'id', optionValue: 'id',
optionLabel: 'name', optionLabel: 'name'
},] }]
}, },
{ {
elCol: [{ elCol: [{
@ -206,7 +213,7 @@ const formRowShow = [
tag: 'elInput', tag: 'elInput',
disabled: true, disabled: true,
type: 'textarea', type: 'textarea',
span: 24, span: 24
}] }]
}, },
{ {
@ -216,7 +223,7 @@ const formRowShow = [
tag: 'elInput', tag: 'elInput',
disabled: true, disabled: true,
type: 'textarea', type: 'textarea',
span: 24, span: 24
}] }]
}, },
{ {
@ -227,12 +234,12 @@ const formRowShow = [
disabled: true, disabled: true,
span: 24, span: 24,
options: [ options: [
{value: "1", label: "待发送"}, { value: '1', label: '待发送' },
{value: "2", label: "发送中"}, { value: '2', label: '发送中' },
{value: "3", label: "发送成功"}, { value: '3', label: '发送成功' },
{value: "4", label: "发送失败"}, { value: '4', label: '发送失败' }
], ]
},] }]
}, },
{ {
elCol: [{ elCol: [{
@ -242,10 +249,10 @@ const formRowShow = [
disabled: true, disabled: true,
span: 24, span: 24,
options: [ options: [
{value: "1", label: "需要重新发送"}, { value: '1', label: '需要重新发送' },
{value: "2", label: "不需要重新发送"}, { value: '2', label: '不需要重新发送' }
], ]
},] }]
}, },
{ {
elCol: [{ elCol: [{
@ -254,9 +261,9 @@ const formRowShow = [
tag: 'elInput', tag: 'elInput',
type: 'textarea', type: 'textarea',
disabled: true, disabled: true,
span: 24, span: 24
}] }]
}, }
] ]
export default { export default {
tableColumnData, tableColumnData,

View File

@ -2,12 +2,15 @@
<div> <div>
<base-layout <base-layout
ref="baseLayout" ref="baseLayout"
:showTitle="false"
:searchShow="false"
@onFuncBtn="onFuncBtn" @onFuncBtn="onFuncBtn"
:querySwitch="true" :querySwitch="true"
:searchList="requirementList" :searchList="requirementList"
@search="handleSearchEvent" @search="handleSearchEvent"
:isPage="true" :isPage="true"
@pageChange="handlePageChange" @pageChange="handlePageChange"
@onElSelect="onElSelect"
:bodyHight="''" :bodyHight="''"
> >
<div slot="main" slot-scope="{ tableHeight }"> <div slot="main" slot-scope="{ tableHeight }">
@ -18,7 +21,7 @@
:funData="funData" :funData="funData"
@onFunc="onFunc" @onFunc="onFunc"
:tabLoading.sync="tabLoading" :tabLoading.sync="tabLoading"
:tableHeight="'50vh'" :tableHeight="'40vh'"
:tableData="tableData" :tableData="tableData"
:tableColumn="tableColumnData" :tableColumn="tableColumnData"
> >
@ -83,13 +86,21 @@ export default {
optionValue: "id", optionValue: "id",
optionLabel: "name", optionLabel: "name",
}, },
{
placeholder: "开始日期",
prop: "createTimeStart",
tag: "elDatePicker",
},
{
placeholder: "结束日期",
prop: "createTimeEnd",
tag: "elDatePicker",
},
{ {
placeholder: "状态", placeholder: "状态",
prop: "status", prop: "status",
tag: "elSelect", tag: "elSelect",
options: [ options: [
{id: "1", label: "待发送"},
{id: "2", label: "发送中"},
{id: "3", label: "发送成功"}, {id: "3", label: "发送成功"},
{id: "4", label: "发送失败"}, {id: "4", label: "发送失败"},
], ],
@ -100,6 +111,21 @@ export default {
optionValue: "id", optionValue: "id",
optionLabel: "label", optionLabel: "label",
}, },
{
placeholder: "源数据",
prop: "sourceData",
tag: "elInput",
},
{
placeholder: "目标数据",
prop: "targetData",
tag: "elInput",
},
{
placeholder: "返回信息",
prop: "returnData",
tag: "elInput",
},
], //list ], //list
tabLoading: false, tabLoading: false,
tableColumnData: configData.tableColumnData, // tableColumnData: configData.tableColumnData, //
@ -112,7 +138,7 @@ export default {
tableData: [], // tableData: [], //
pageModel: { pageModel: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 100,
}, },
queryModel: { queryModel: {
theme: "", theme: "",
@ -121,27 +147,46 @@ export default {
receiveApp: "", receiveApp: "",
receiveApi: "", receiveApi: "",
status: "", status: "",
targetData: '',
sourceData: '',
returnData: ''
}, },
}; };
}, },
created() { created() {
this.GetMessageLogTableData(); // this.GetMessageLogTableData();
this.initSelect() this.initSelect()
}, },
methods: { methods: {
async onElSelect(event, index, indexItem, model, row) {
console.log(event, index, indexItem, model, row)
if (row.placeholder === '接受者应用') {
this.$set(this.queryModel, 'receiveApi', '')
this.$set(this.$refs.baseLayout.ruleForm, 'receiveApi', "")
if (event) {
const res = await authApi('sysApplicationService', 'application', 'thirdInterfacequeryAppApi', '', {
appId: event
})
if (res.status == 200) {
this.requirementList[2].options = res.attribute
}
} else {
this.requirementList[2].options = []
}
}
},
// //
async GetMessageLogTableData() { async GetMessageLogTableData() {
this.tabLoading = true; this.tabLoading = true;
let param = { let param = {
...this.pageModel, ...this.pageModel,
...this.queryModel, ...this.queryModel,
receiveApp: this.$route.query.id,
receiveApi: this.receiveApi
}; };
let res = await authApi( let res = await authApi(
"sysApplicationService", "sysApplicationService",
"application", "application",
"queryAppApiLog", "thirdInterfacequeryAppApiLog",
"", "",
param param
); );
@ -218,24 +263,40 @@ export default {
// //
handleSearchEvent(form) { handleSearchEvent(form) {
let data = this.$refs.baseLayout.ruleForm; let data = this.$refs.baseLayout.ruleForm;
this.queryModel.theme = data.theme; data.receiveApp = this.$route.query.id;
this.queryModel.sendApp = data.sendApp; data.receiveApi = this.receiveApi;
this.queryModel.sendApi = data.sendApi; this.queryModel = {...data}
this.queryModel.receiveApp = data.receiveApp; // if (!data.sendApp) {
this.queryModel.receiveApi = data.receiveApi; // this.$vmNews("")
this.queryModel.status = data.status; // return
// }
// if (!data.receiveApp) {
// this.$vmNews("")
// return
// }
// if (!data.receiveApi) {
// this.$vmNews("api")
// return
// }
if (!data.status) {
this.$vmNews("请选择状态")
return
}
this.resetTable(); this.resetTable();
}, },
async initSelect() { async initSelect() {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "sysApplicationService", tl: "sysApplicationService",
as: "application", as: "application",
dj: "queryApp" dj: "thirdInterfacequeryApp"
}, { }, {
"pageNum": 1, "pageNum": 1,
"pageSize": 999 "pageSize": 999
}) })
console.log(res, 'res')
this.requirementList[0].options = res.attribute.list this.requirementList[0].options = res.attribute.list
this.requirementList[1].options = res.attribute.list
}, },
// async onElSelect(val, b, c, d, row) { // async onElSelect(val, b, c, d, row) {
// if (row.prop === 'sendApp') { // if (row.prop === 'sendApp') {
@ -258,9 +319,12 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped lang="scss">
.clickTitle { .clickTitle {
color: #409eff; color: #409eff;
cursor: pointer; cursor: pointer;
} }
::v-deep .el-dialog__body{
padding: 0px !important;
}
</style> </style>

View File

@ -81,7 +81,7 @@ export default {
methods: { methods: {
openDialog(type, row) { openDialog(type, row) {
this.querysysAppService(); this.querysysAppService();
this.querysysAppApiService(); // this.querysysAppApiService();
this.formRow = configData.formRow; this.formRow = configData.formRow;
this.submitShow = true; this.submitShow = true;
// //
@ -108,7 +108,7 @@ export default {
let res = await authApi( let res = await authApi(
"sysMessageManageLogService", "sysMessageManageLogService",
"messageManage", "messageManage",
"queryEntity", "thirdInterfacequeryEntity",
"", "",
params params
); );
@ -201,7 +201,7 @@ export default {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "sysApplicationService", tl: "sysApplicationService",
as: "application", as: "application",
dj: "queryApp" dj: "thirdInterfacequeryApp"
}, { }, {
"pageNum": 1, "pageNum": 1,
"pageSize": 999 "pageSize": 999

View File

@ -5,7 +5,9 @@
<div class="chunk"> <div class="chunk">
<el-button icon="el-icon-back" @click=" <el-button icon="el-icon-back" @click="
$router.replace({ path: '/applicationList/applicationListAdmin' }) $router.replace({ path: '/applicationList/applicationListAdmin' })
">返回</el-button> "
>返回
</el-button>
</div> </div>
<div class="chunk"> <div class="chunk">
<el-button icon="el-icon-first-aid-kit" type="primary" @click="saveHandle">保存</el-button> <el-button icon="el-icon-first-aid-kit" type="primary" @click="saveHandle">保存</el-button>
@ -17,7 +19,11 @@
<div class="uploadMain"> <div class="uploadMain">
<div class="left"> <div class="left">
<div class="title">应用logo</div> <div class="title">应用logo</div>
<el-upload class="avatar-uploader" ref="upload" action="https://jsonplaceholder.typicode.com/posts/" :on-preview="handlePreview" :on-progress="handleProgress" :before-upload="beforeUpload" list-type="picture" :limit="1" :disabled="lookFlag" :on-success="handleAvatarSuccess" :show-file-list="false"> <el-upload class="avatar-uploader" ref="upload" action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview" :on-progress="handleProgress" :before-upload="beforeUpload"
list-type="picture" :limit="1" :disabled="lookFlag" :on-success="handleAvatarSuccess"
:show-file-list="false"
>
<div class="line"> <div class="line">
<div class="left"> <div class="left">
<img v-if="imgUrl" :src="imgUrl" class="avatar" @error="handleImageError"> <img v-if="imgUrl" :src="imgUrl" class="avatar" @error="handleImageError">
@ -40,40 +46,44 @@
</el-upload> </el-upload>
</div> </div>
<div class="right"> <div class="right">
<el-switch active-value="1" inactive-value="2" v-model="appStatus" active-text="启用" active-color="#60c958" :disabled="lookFlag"> <el-switch active-value="1" inactive-value="2" v-model="appStatus" active-text="启用" active-color="#60c958"
:disabled="lookFlag"
>
</el-switch> </el-switch>
</div> </div>
</div> </div>
</div> </div>
<div class="form"> <div class="form">
<baseNewForm ref="mainForm" :spanNumber="24" :isFunBtn="false" :lookFlag="lookFlag" :formRule="!lookFlag" :formRow="formRow" :ruleForm="ruleForm" @onSubmit="onSubmit"></baseNewForm> <baseNewForm ref="mainForm" :spanNumber="24" :isFunBtn="false" :lookFlag="lookFlag" :formRule="!lookFlag"
:formRow="formRow" :ruleForm="ruleForm" @onSubmit="onSubmit"
></baseNewForm>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getApiModuleApi } from "@/api/apiChunks/index.js"; import { getApiModuleApi } from '@/api/apiChunks/index.js'
import { uploadLogo } from "@/api/apis/logo.js"; import { uploadLogo } from '@/api/apis/logo.js'
import configData from "./configData"; import configData from './configData'
import baseNewForm from "@/views/intergrationTask/compoments/baseNewForm"; import baseNewForm from '@/views/intergrationTask/compoments/baseNewForm'
import request from "@/utils/request"; import request from '@/utils/request'
export default { export default {
data() { data() {
return { return {
fileList: [], fileList: [],
iconBase64: "", iconBase64: '',
imgUrl: "", imgUrl: '',
loading: false, loading: false,
appLogo: "", appLogo: '',
appStatus: 1, appStatus: 1,
ruleForm: { ruleForm: {
accessMode: [], accessMode: []
}, },
lookFlag: false, lookFlag: false,
formRow: configData.addForm, formRow: configData.addForm
}; }
}, },
methods: { methods: {
handleImageError(row) { handleImageError(row) {
@ -89,13 +99,23 @@ export default {
handlePreview(file) { handlePreview(file) {
}, },
async handleAvatarSuccess(res, file) { async handleAvatarSuccess(res, file) {
this.$refs.upload.clearFiles();// console.log(res, file, '123')
file.raw.type
if (
file.raw.type.split('/')[1] != 'jpeg' &&
file.raw.type.split('/')[1] != 'png'
) {
return false
} else if (file.size >= 2000000) {
return false
}
this.$refs.upload.clearFiles()//
this.imgUrl = URL.createObjectURL(file.raw); this.imgUrl = URL.createObjectURL(file.raw)
let formData = new FormData(); let formData = new FormData()
formData.append("file", file.raw); formData.append('file', file.raw)
formData.append("fileFlag", true); formData.append('fileFlag', true)
formData.append("businessType", "application"); formData.append('businessType', 'application')
// console.log(formData); // console.log(formData);
// const el = await uploadLogo(formData) // const el = await uploadLogo(formData)
// if (el.status === '200') { // if (el.status === '200') {
@ -103,36 +123,37 @@ export default {
// this.appLogo = el.id // this.appLogo = el.id
// } // }
return request({ return request({
url: "/kangarooDataCenterV3/entranceController/fileUpload", url: '/kangarooDataCenterV3/entranceController/fileUpload',
method: "post", method: 'post',
data: formData, data: formData
}).then((res) => { }).then((res) => {
if (res.status === '200') { if (res.status === '200') {
this.$vmNews("上传成功", "success") this.$vmNews('上传成功', 'success')
this.appLogo = res.attribute.id this.appLogo = res.attribute.id
} }
return true return true
// this.loading = false // this.loading = false
}) })
}, }
,
async beforeUpload(file) { async beforeUpload(file) {
if ( if (
file.type.split("/")[1] != "jpeg" && file.type.split('/')[1] != 'jpeg' &&
file.type.split("/")[1] != "png" file.type.split('/')[1] != 'png'
) { ) {
this.$message({ this.$message({
type: "warning", type: 'warning',
message: "只能上传jpg/png文件", message: '只能上传jpg/png文件'
}); })
return return false
} else { } else {
if (file.size >= 2000000) { if (file.size >= 2000000) {
this.$message({ this.$message({
type: "warning", type: 'warning',
message: "文件大小不超过2MB", message: '文件大小不超过2MB'
}); })
return return false
} }
// let reader = new FileReader(); // let reader = new FileReader();
// let that = this; // let that = this;
@ -144,58 +165,61 @@ export default {
// reader.readAsDataURL(file); // reader.readAsDataURL(file);
// return false; // return false;
} }
}, }
,
// //
saveHandle() { saveHandle() {
this.$refs.mainForm.submitForm(); this.$refs.mainForm.submitForm()
}, }
,
// //
async onSubmit() { async onSubmit() {
if (this.$route.query.flag === "add") { if (this.$route.query.flag === 'add') {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "sysApplicationService", tl: 'sysApplicationService',
as: "application", as: 'application',
dj: "saveApp" dj: 'saveApp'
}, { ...this.ruleForm, appStatus: this.appStatus, appLogo: this.appLogo }) }, { ...this.ruleForm, appStatus: this.appStatus, appLogo: this.appLogo })
if (res.status === '200') { if (res.status === '200') {
this.$vmNews("保存成功", "success") this.$vmNews('保存成功', 'success')
this.$router.replace({ path: '/applicationList/applicationListAdmin' }) this.$router.replace({ path: '/applicationList/applicationListAdmin' })
} }
} else if (this.$route.query.flag === "copy") { } else if (this.$route.query.flag === 'copy') {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "sysApplicationService", tl: 'sysApplicationService',
as: "application", as: 'application',
dj: "copyApp" dj: 'copyApp'
}, { ...this.ruleForm, appStatus: this.appStatus, appLogo: this.appLogo }) }, { ...this.ruleForm, appStatus: this.appStatus, appLogo: this.appLogo })
if (res.status === '200') { if (res.status === '200') {
this.$vmNews("复制成功", "success") this.$vmNews('复制成功', 'success')
this.$router.replace({ path: '/applicationList/applicationListAdmin' }) this.$router.replace({ path: '/applicationList/applicationListAdmin' })
} }
} else if (this.$route.query.flag === "setting") { } else if (this.$route.query.flag === 'setting') {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "sysApplicationService", tl: 'sysApplicationService',
as: "application", as: 'application',
dj: "updateApp" dj: 'updateApp'
}, { updateType: 1, ...this.ruleForm, appStatus: this.appStatus, appLogo: this.appLogo }) }, { updateType: 1, ...this.ruleForm, appStatus: this.appStatus, appLogo: this.appLogo })
if (res.status === '200') { if (res.status === '200') {
this.$vmNews("保存成功", "success") this.$vmNews('保存成功', 'success')
this.initEditFormData() this.initEditFormData()
this.getLogoUrl() this.getLogoUrl()
this.$emit("saveSuccess") this.$emit('saveSuccess')
} }
} }
}, }
,
// //
async initSelectOptions() { async initSelectOptions() {
let params = { let params = {
tab_name: "sys_product", tab_name: 'sys_product',
column_name: "classify", column_name: 'classify'
}; }
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "generalServiceImpl", tl: 'generalServiceImpl',
as: "dictionaryshop", as: 'dictionaryshop',
dj: "selectDictionaryshop" dj: 'selectDictionaryshop'
}, params) }, params)
this.formRow[3].elCol[0].options = [] this.formRow[3].elCol[0].options = []
res.attribute.forEach((item) => { res.attribute.forEach((item) => {
@ -204,107 +228,121 @@ export default {
id: item.column_value id: item.column_value
}) })
}) })
}, }
,
// - // -
async initCopyFormData() { async initCopyFormData() {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "sysApplicationService", tl: 'sysApplicationService',
as: "application", as: 'application',
dj: "getCopyApp" dj: 'getCopyApp'
}, { id: this.$route.query.id }) }, { id: this.$route.query.id })
this.ruleForm = res.attribute this.ruleForm = res.attribute
this.ruleForm.accessMode = JSON.parse(res.attribute.accessMode) this.ruleForm.accessMode = JSON.parse(res.attribute.accessMode)
this.appStatus = res.attribute.appStatus this.appStatus = res.attribute.appStatus
}, }
,
async initEditFormData() { async initEditFormData() {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "sysApplicationService", tl: 'sysApplicationService',
as: "application", as: 'application',
dj: "getApp" dj: 'getApp'
}, { id: this.$route.query.id }) }, { id: this.$route.query.id })
this.ruleForm = res.attribute this.ruleForm = res.attribute
this.ruleForm.accessMode = JSON.parse(res.attribute.accessMode) this.ruleForm.accessMode = JSON.parse(res.attribute.accessMode)
this.appStatus = res.attribute.appStatus this.appStatus = res.attribute.appStatus
}, }
,
//logo //logo
getLogoUrl() { getLogoUrl() {
let id = this.appLogo ? this.appLogo : this.$route.query.appLogo let id = this.appLogo ? this.appLogo : this.$route.query.appLogo
return request({ return request({
url: "/kangarooDataCenterV3/entranceController/fileDownloadNew?id=" + id, url: '/kangarooDataCenterV3/entranceController/fileDownloadNew?id=' + id,
method: "get", method: 'get',
responseType: 'arraybuffer' responseType: 'arraybuffer'
}).then((res) => { }).then((res) => {
this.imgUrl = this.imgUrl =
"data:image/png/jpg;base64," + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), "")); 'data:image/png/jpg;base64,' + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ''))
}) })
} }
}, },
components: { components: {
baseNewForm, baseNewForm
}, },
created() { created() {
// options // options
this.initSelectOptions() this.initSelectOptions()
// //
if (this.$route.query.flag === "setting") { if (this.$route.query.flag === 'setting') {
this.formRow[0].elCol[0].disabled = false; this.formRow[0].elCol[0].disabled = false
} else { } else {
this.formRow[0].elCol[0].disabled = false; this.formRow[0].elCol[0].disabled = false
} }
if (this.$route.query.flag === "copy") { if (this.$route.query.flag === 'copy') {
this.initCopyFormData() this.initCopyFormData()
this.getLogoUrl() this.getLogoUrl()
} else if (this.$route.query.flag === "setting") { } else if (this.$route.query.flag === 'setting') {
this.initEditFormData() this.initEditFormData()
this.getLogoUrl() this.getLogoUrl()
} }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .el-button { ::v-deep .el-button {
border-radius: 16px; border-radius: 4px;
} }
::v-deep .el-form-item { ::v-deep .el-form-item {
display: block !important; display: block !important;
} }
.wrap { .wrap {
background-color: #fbfbfb; background-color: #fbfbfb;
width: 100%; width: 100%;
overflow: auto; overflow: auto;
> .btn { > .btn {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
> .chunk { > .chunk {
margin-left: 10px; margin-left: 10px;
} }
} }
> .main { > .main {
margin-top: 10px; margin-top: 10px;
> .upload { > .upload {
background-color: #fff; background-color: #fff;
border-radius: 16px; border-radius: 16px;
padding: 24px 30px; padding: 24px 30px;
> .title { > .title {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
} }
> .uploadMain { > .uploadMain {
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
> .left { > .left {
> .title { > .title {
font-size: 18px; font-size: 18px;
color: #999999; color: #999999;
margin-bottom: 10px; margin-bottom: 10px;
} }
.line { .line {
display: flex; display: flex;
align-items: center; align-items: center;
.left { .left {
border: 1px dashed #999999; border: 1px dashed #999999;
width: 64px; width: 64px;
@ -312,11 +350,13 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
> img { > img {
width: 100%; width: 100%;
// height: 100%; // height: 100%;
} }
} }
.right { .right {
margin-left: 15px; margin-left: 15px;
} }
@ -324,6 +364,7 @@ export default {
} }
} }
} }
> .form { > .form {
overflow: auto; overflow: auto;
margin-top: 10px; margin-top: 10px;

View File

@ -387,7 +387,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .el-button { ::v-deep .el-button {
border-radius: 16px; border-radius: 4px;
} }
::v-deep .el-form-item { ::v-deep .el-form-item {

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: [ elCol: [
{ {
@ -178,6 +205,11 @@ const settingMenu = [
icon: "appMenu06", icon: "appMenu06",
path: 'inserterAdmin' path: 'inserterAdmin'
}, },
{
title: "脚本管理",
icon: "appMenu07",
path: 'scriptAdmin'
},
] ]
const configData = { const configData = {
addForm, addForm,

View File

@ -2,230 +2,270 @@ const exploitSettingFormRow = [
{ {
elCol: [ elCol: [
{ {
type: "select", type: 'select',
title: "接入方式", title: '接入方式',
id: "accessMode", id: 'accessMode',
row: 24, row: 24,
disabled: false, disabled: false,
required: true, required: true,
fontSize: 16, fontSize: 16,
options: [ options: [
{ {
id: "1", id: '1',
label: "接口", label: '接口'
}, },
{ {
id: "2", id: '2',
label: "H5", label: 'H5'
}, },
{ {
id: "3", id: '3',
label: "PC网页", label: 'PC网页'
}, },
{ {
id: "4", id: '4',
label: "PC应用程序", label: 'PC应用程序'
}, }
],
multiple: true,
},
], ],
multiple: true
}
]
}, },
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "应用客户端地址pc)", title: '应用客户端地址pc)',
id: "clientPath", id: 'clientPath',
row: 24, row: 24,
disabled: false, disabled: false,
required: false, required: false,
fontSize: 16 fontSize: 16
}, }
], ]
}, },
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "应用网页端地址pc)", title: '应用网页端地址pc)',
id: "webPath", id: 'webPath',
row: 24, row: 24,
disabled: false, disabled: false,
required: false, required: false,
fontSize: 16 fontSize: 16
}, }
], ]
}, },
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "应用程序地址(移动端)", title: '应用程序地址(移动端)',
id: "programPath", id: 'programPath',
row: 24, row: 24,
disabled: false, disabled: false,
required: false, required: false,
fontSize: 16 fontSize: 16
}, }
], ]
}, },
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "ip白名单", title: 'ip白名单',
id: "systemAddress", id: 'systemAddress',
row: 24, row: 24,
disabled: false, disabled: false,
fontSize: 16, fontSize: 16,
placeholder:"请输入ip白名单并以,分割" placeholder: '请输入ip白名单并以,分割'
}, }
], ]
}, },
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "应用Key", title: '应用Key',
id: "publicKey", id: 'publicKey',
row: 24, row: 24,
disabled: true, disabled: true,
required: false, required: false,
fontSize: 16, fontSize: 16,
double: true double: true
}, }
], ]
}, },
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "应用密钥", title: '应用密钥',
id: "secretKey", id: 'secretKey',
row: 24, row: 24,
disabled: true, disabled: true,
fontSize: 16, fontSize: 16,
double: true double: true
}, }
], ]
}, },
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "appId ", title: 'appId ',
id: "appId", id: 'appId',
row: 24, row: 24,
disabled: true, disabled: true,
fontSize: 16, fontSize: 16,
double: true, double: true,
required: false, required: false
}, }
], ]
}, }
] ]
const apiEnvFormRow = [ const apiEnvFormRow = [
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "接口地址", title: '接口地址',
id: "interfaceAddress", id: 'interfaceAddress',
row: 24, row: 24,
disabled: false, disabled: false,
required: false, required: false,
fontSize: 16 fontSize: 16
}, }
], ]
}, }
] ]
const tableColumn = [ const tableColumn = [
{ {
id: 'interfaceKey', id: 'interfaceKey',
title: "Key" title: 'Key'
}, },
{ {
id: 'interfaceValue', id: 'interfaceValue',
title: "Value" title: 'Value'
}, },
{ {
id: 'interfaceType', id: 'interfaceType',
title: "位置" title: '位置'
}, }
] ]
const dataSettingFormRow = [ const dataSettingFormRow = [
{ {
elCol: [ elCol: [{
{ title: '数据源编码',
type: "select", id: 'sourceCode',
title: "数据源类型", type: 'input',
id: "sourceType",
row: 24, row: 24,
disabled: false, disabled: false,
required: true, required: true,
fontSize: 16
}]
},
{
elCol: [{
title: '数据源名称',
id: 'sourceName',
type: 'input',
row: 24,
disabled: false,
required: true,
fontSize: 16
}]
},
{
elCol: [{
title: 'ip',
id: 'sourceIp',
type: 'input',
changeRemind: true,
row: 12,
required: true,
fontSize: 16
}, {
title: '端口',
id: 'sourcePort',
type: 'input',
changeRemind: true,
row: 12,
required: true,
fontSize: 16
}]
},
{
elCol: [{
title: '数据库名称',
id: 'dbName',
type: 'input',
changeRemind: true,
row: 12,
required: true,
fontSize: 16
}, {
title: '数据源类型',
id: 'sourceType',
type: 'select',
changeRemind: true,
row: 12,
required: true,
fontSize: 16, fontSize: 16,
options: [ options: [
{ {
id: "1", id: '1',
label: "oracle " label: 'oracle'
}, },
{ {
id: "2", id: '2',
label: "sqlServer" label: 'sqlsever'
}, },
{ {
id: "3", id: '3',
label: "mysql" label: 'mysql'
},
],
},
],
}, },
{ {
elCol: [ id: '4',
label: 'dm'
}
]
}]
},
{ {
type: "input", elCol: [{
title: "实例地址", title: '登录名',
id: "sourceUrl", id: 'loginName',
row: 24, type: 'input',
disabled: false, changeRemind: true,
row: 12,
required: true, required: true,
fontSize: 16 fontSize: 16
}, }, {
], title: '密码',
}, id: 'password',
{ type: 'password',
elCol: [ tag:"elInput",
{ changeRemind: true,
type: "input", row: 12,
title: "账户",
id: "loginName",
row: 8,
disabled: false,
required: true, required: true,
fontSize: 16 fontSize: 16
}]
}, },
{ {
type: "input", elCol: [{
title: "密码", title: '服务名称',
id: "password", id: 'serviceName',
row: 8, type: 'input',
disabled: false, show: false,
changeRemind: true,
row: 12,
required: true, required: true,
fontSize: 16 fontSize: 16
}, },]
{ }
type: "input",
title: "库名",
id: "dbName",
row: 8,
disabled: false,
required: true,
fontSize: 16
},
],
},
] ]
const config = { const config = {
exploitSettingFormRow, exploitSettingFormRow,

View File

@ -111,7 +111,7 @@
@click="testHandle" @click="testHandle"
:type="testResult ? 'success' : 'primary'" :type="testResult ? 'success' : 'primary'"
style="margin-right: 10px" style="margin-right: 10px"
>{{ testResult ? "测试通过" : "点击测试" }} >{{ testResult ? '测试通过' : '点击测试' }}
<i v-if="testResult" class="el-icon-check el-icon--right"></i> <i v-if="testResult" class="el-icon-check el-icon--right"></i>
</el-button> </el-button>
<el-switch <el-switch
@ -128,7 +128,7 @@
<div class="form"> <div class="form">
<baseNewForm <baseNewForm
ref="dataSettingForm" ref="dataSettingForm"
:spanNumber="24" :spanNumber="12"
:isFunBtn="false" :isFunBtn="false"
:lookFlag="lookFlag" :lookFlag="lookFlag"
:formRule="!lookFlag" :formRule="!lookFlag"
@ -137,6 +137,7 @@
@onSubmit="dataSettingOnSubmit" @onSubmit="dataSettingOnSubmit"
@onSelect="dataSettingFormChange" @onSelect="dataSettingFormChange"
@onInput="dataSettingFormChange" @onInput="dataSettingFormChange"
@changeRemind="dataSettingFormChange"
></baseNewForm> ></baseNewForm>
</div> </div>
</div> </div>
@ -145,10 +146,10 @@
</template> </template>
<script> <script>
import BaseTable from "@/views/intergrationTask/compoments/baseTable.vue"; import BaseTable from '@/views/intergrationTask/compoments/baseTable.vue'
import configData from "./configData"; import configData from './configData'
import {getApiModuleApi} from "@/api/apiChunks/index.js"; import { getApiModuleApi } from '@/api/apiChunks/index.js'
import baseNewForm from "@/views/intergrationTask/compoments/baseNewForm"; import baseNewForm from '@/views/intergrationTask/compoments/baseNewForm'
export default { export default {
data() { data() {
@ -158,7 +159,7 @@ export default {
// list // list
fileList: [], fileList: [],
// base // base
iconBase64: "", iconBase64: '',
// //
lookFlag: false, lookFlag: false,
// //
@ -168,14 +169,14 @@ export default {
}, },
// //
apiEnvFormRow: configData.apiEnvFormRow, apiEnvFormRow: configData.apiEnvFormRow,
apiEnvRuleForm: {interfaceAddress: ""}, apiEnvRuleForm: { interfaceAddress: '' },
tableData: [], tableData: [],
tableColumn: configData.tableColumn, tableColumn: configData.tableColumn,
funData: [ funData: [
{ {
text: "删除", text: '删除',
color: "#e47470", color: '#e47470'
}, }
], ],
apiEnvOpen: 2, apiEnvOpen: 2,
// //
@ -183,13 +184,13 @@ export default {
dataSettingRuleForm: {}, dataSettingRuleForm: {},
locationOptions: [ locationOptions: [
{ {
value: "1", value: '1',
label: "Header", label: 'Header'
}, },
{ {
value: "2", value: '2',
label: "Body", label: 'Body'
}, }
], ],
testResult: false, testResult: false,
// loading // loading
@ -197,58 +198,66 @@ export default {
// //
interfaceStatus: 2, interfaceStatus: 2,
// //
dbStatus: 2, dbStatus: 2
}; }
}, },
methods: { methods: {
// //
dblclick(val) { dblclick(val) {
navigator.clipboard.writeText(val) navigator.clipboard.writeText(val)
this.$vmNews("内容已复制到剪贴板", 'success') this.$vmNews('内容已复制到剪贴板', 'success')
}, },
// //
dataSettingFormChange() { dataSettingFormChange(val, index, indexRow, row = {}) {
this.testResult = false; this.testResult = false
this.dbStatus = 2; this.dbStatus = 2
if (row.id === 'sourceType') {
if (val == 1) {
this.dataSettingFormRow[5].elCol[0].show = true
} else {
this.dataSettingFormRow[5].elCol[0].show = false
}
}
}, },
// //
switchCLick() { switchCLick() {
if (!this.testResult) { if (!this.testResult) {
this.$vmNews("请测试通过后再开启", "warning"); this.$vmNews('请测试通过后再开启', 'warning')
} }
}, },
// //
tableButtonHandle(index, row) { tableButtonHandle(index, row) {
this.tableData.splice(index.index, 1); this.tableData.splice(index.index, 1)
}, },
// //
newRow() { newRow() {
this.tableData.push({interfaceType: "1"}); this.tableData.push({ interfaceType: '1' })
}, },
// //
testHandle() { testHandle() {
this.$refs.dataSettingForm.submitForm(); this.$refs.dataSettingForm.submitForm()
}, },
// //
saveHandle() { saveHandle() {
let pattern = /^http(s)?:\/\/?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/ let pattern = /^http(s)?:\/\/?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/
if (this.apiEnvRuleForm.interfaceAddress && !pattern.test(this.apiEnvRuleForm.interfaceAddress)) { if (this.apiEnvRuleForm.interfaceAddress && !pattern.test(this.apiEnvRuleForm.interfaceAddress)) {
this.$vmNews("接口地址不合法,请重新输入!", "warning") this.$vmNews('接口地址不合法,请重新输入!', 'warning')
return return
} }
if (this.interfaceStatus != 2) { if (this.interfaceStatus != 2) {
if (!this.apiEnvRuleForm.interfaceAddress) { if (!this.apiEnvRuleForm.interfaceAddress) {
this.$vmNews("接口环境开启时,接口地址不能为空!", "warning"); this.$vmNews('接口环境开启时,接口地址不能为空!', 'warning')
return; return
} }
let flag = this.tableData.some((item, index) => { let flag = this.tableData.some((item, index) => {
if (item.interfaceKey == "" || !item.interfaceKey) { if (item.interfaceKey == '' || !item.interfaceKey) {
this.$vmNews(`接口环境开启时,接口环境第${index + 1}行Key不能为空!`) this.$vmNews(`接口环境开启时,接口环境第${index + 1}行Key不能为空!`)
return true return true
} else if (item.interfaceValue == "" || !item.interfaceValue) { } else if (item.interfaceValue == '' || !item.interfaceValue) {
this.$vmNews(`接口环境开启时,接口环境第${index + 1}行Value不能为空!`) this.$vmNews(`接口环境开启时,接口环境第${index + 1}行Value不能为空!`)
return true return true
} else if (item.interfaceType == "" || !item.interfaceType) { } else if (item.interfaceType == '' || !item.interfaceType) {
this.$vmNews(`接口环境开启时,接口环境第${index + 1}行位置不能为空!`) this.$vmNews(`接口环境开启时,接口环境第${index + 1}行位置不能为空!`)
return true return true
} else { } else {
@ -259,26 +268,28 @@ export default {
return return
} }
} }
this.$refs.exploitSettingForm.submitForm(); this.$refs.exploitSettingForm.submitForm()
}, },
async dataSettingOnSubmit() { async dataSettingOnSubmit() {
this.testLoading = true; this.testLoading = true
// //
// this.testResult = true; // this.testResult = true;
try { try {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "sysApplicationService", tl: 'sysApplicationService',
as: "application", as: 'application',
dj: "testDatabase" dj: 'testDatabase'
}, { ...this.dataSettingRuleForm }) }, { ...this.dataSettingRuleForm })
if (res.status === '200' && res.flag) { if (res.status === '200' && res.attribute) {
this.testResult = true; this.testResult = true
this.$vmNews("测试通过开关已开启", "success") this.$vmNews('测试通过开关已开启', 'success')
} else {
this.$vmNews(res.msg)
} }
} catch (err) { } catch (err) {
this.testResult = false this.testResult = false
} }
this.testLoading = false; this.testLoading = false
}, },
// //
async exploitSettingOnSubmit() { async exploitSettingOnSubmit() {
@ -305,31 +316,32 @@ export default {
...this.apiEnvRuleForm, ...this.apiEnvRuleForm,
apiParas: this.tableData, apiParas: this.tableData,
databaseEntity: { databaseEntity: {
...this.dataSettingRuleForm, ...this.dataSettingRuleForm
} }
} }
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: "sysApplicationService", tl: 'sysApplicationService',
as: "application", as: 'application',
dj: "updateApp" dj: 'updateApp'
}, { ...obj }) }, { ...obj })
if (res.status === '200') { if (res.status === '200') {
this.$vmNews("保存成功", "success") this.$vmNews('保存成功', 'success')
this.initDataInfo() this.initDataInfo()
} }
}, },
async initDataInfo() { async initDataInfo() {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
tl: 'sysApplicationService', tl: 'sysApplicationService',
as: "application", as: 'application',
dj: "queryAppAll" dj: 'queryAppAll'
}, { id: this.$route.query.id }) }, { id: this.$route.query.id })
if (res.status === '200') { if (res.status === '200') {
if (res.attribute.databaseEntity) { if (res.attribute.databaseEntity) {
this.dataSettingRuleForm = res.attribute.databaseEntity; this.dataSettingRuleForm = res.attribute.databaseEntity
console.log(this.dataSettingRuleForm, 'this.dataSettingRuleForm')
console.log('数据源设置id:' + res.attribute.databaseEntity.id) console.log('数据源设置id:' + res.attribute.databaseEntity.id)
} }
this.tableData = res.attribute.apiParas; this.tableData = res.attribute.apiParas
this.apiEnvRuleForm.interfaceAddress = res.attribute.app.interfaceAddress this.apiEnvRuleForm.interfaceAddress = res.attribute.app.interfaceAddress
this.dbStatus = res.attribute.app.dbStatus this.dbStatus = res.attribute.app.dbStatus
if (this.dbStatus == 1) { if (this.dbStatus == 1) {
@ -344,18 +356,18 @@ export default {
publicKey: res.attribute.app.publicKey, publicKey: res.attribute.app.publicKey,
secretKey: res.attribute.app.secretKey, secretKey: res.attribute.app.secretKey,
appId: res.attribute.app.appId, appId: res.attribute.app.appId,
systemAddress: res.attribute.app.systemAddress, systemAddress: res.attribute.app.systemAddress
} }
} }
} }
}, },
components: { components: {
baseNewForm, baseNewForm,
BaseTable, BaseTable
}, },
created() { created() {
this.initDataInfo() this.initDataInfo()
this.$emit("flashActive", 1) this.$emit('flashActive', 1)
// if (this.$route.query.id) { // if (this.$route.query.id) {
// this.lookFlag = true; // this.lookFlag = true;
// } else { // } else {
@ -370,13 +382,13 @@ export default {
// this.dbStatus = 2; // this.dbStatus = 2;
// }, // },
// }, // },
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .el-button { ::v-deep .el-button {
border-radius: 16px; border-radius: 4px;
} }
::v-deep .el-form-item { ::v-deep .el-form-item {

View File

@ -16,7 +16,7 @@
</el-select> </el-select>
</div> </div>
<div class="chunk"> <div class="chunk">
<el-input placeholder="应用名称、厂商" v-model="searchForm.nameOrManufacturer" @keyup.enter.native="submitsearchForm"> <el-input placeholder="应用名称、厂商" v-model="searchForm.nameOrManufacturer" @input="submitsearchForm">
<i slot="suffix" class="el-input__icon el-icon-search" @click="submitsearchForm"></i> <i slot="suffix" class="el-input__icon el-icon-search" @click="submitsearchForm"></i>
</el-input> </el-input>
</div> </div>
@ -32,21 +32,6 @@
<template v-slot:name="{ row }"> <template v-slot:name="{ row }">
<div class="nameCard"> <div class="nameCard">
<div class="image"> <div class="image">
<!-- <template v-if="row.name==='中台'">
<img src="./images/1.png" alt="" />
</template>
<template v-else-if="row.name==='U8C'">
<img src="./images/2.png" alt="" />
</template>
<template v-else-if="row.name==='U8'">
<img src="./images/3.png" alt="" />
</template>
<template v-else-if="row.name==='BIP'">
<img src="./images/4.png" alt="" />
</template>
<template v-else-if="row.name==='ERP'">
<img src="./images/5.png" alt="" />
</template> -->
<template> <template>
<img :src="row.imgUrl" alt="" @error="handleImageError(row)"/> <img :src="row.imgUrl" alt="" @error="handleImageError(row)"/>
</template> </template>
@ -251,7 +236,7 @@ export default {
computed: { computed: {
// //
funWidth() { funWidth() {
return this.funData.length * 70; return this.funData.length * 100;
}, },
}, },
components: { components: {
@ -322,12 +307,14 @@ export default {
align-items: center; align-items: center;
.image { .image {
flex: 0.25; flex: 0.35;
width: 29px; width: 40px;
height: 29px; height: 50px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
border-radius: 8px;
overflow: hidden;
img { img {
width: 100%; width: 100%;
@ -345,17 +332,18 @@ export default {
> .name { > .name {
text-align: left; text-align: left;
font-size: 14px; font-size: 16px;
font-weight: 600; font-weight: 600;
} }
> .version { > .version {
margin-top: 1px;
color: #ff8b0f; color: #ff8b0f;
font-size: 12px; font-size: 14px;
height: 20px; height: 20px;
line-height: 20px;
padding: 0 5px ;
border: 0.5px solid #ff8b0f; border: 0.5px solid #ff8b0f;
padding: 0 1px; border-radius: 8px;
} }
} }
} }
@ -365,7 +353,8 @@ export default {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: center; justify-content: flex-start;
span { span {
margin-top: 5px; margin-top: 5px;
@ -373,6 +362,8 @@ export default {
padding: 2px 10px; padding: 2px 10px;
margin-left: 8px; margin-left: 8px;
color: #fff; color: #fff;
border-radius: 8px;
font-size: 16px;
} }
.state1 { .state1 {

View File

@ -147,6 +147,7 @@ export default {
}, },
// //
inserterAdd() { inserterAdd() {
this.ruleForm = {}
this.plugInDialog = true; this.plugInDialog = true;
// this.$router.push({ path: "/inserterAdmin/inserterAdd" }); // this.$router.push({ path: "/inserterAdmin/inserterAdd" });
}, },

View File

@ -139,7 +139,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .el-button { ::v-deep .el-button {
border-radius: 16px; border-radius: 4px;
} }
::v-deep .el-form-item { ::v-deep .el-form-item {
display: block !important; display: block !important;

View File

@ -0,0 +1,140 @@
const formRow = [
{
elCol: [
{
type: 'input',
title: '脚本名称',
id: 'scriptName',
row: 24,
disabled: false,
required: true,
fontSize: 16
}
]
},
{
elCol: [
{
type: 'input',
title: '脚本编号',
id: 'scriptCode',
row: 24,
disabled: false,
required: true,
fontSize: 16
}
]
},
{
elCol: [
{
type: 'input',
title: '脚本版本',
id: 'scriptVersion',
row: 24,
disabled: false,
required: true,
fontSize: 16
}
]
},
{
elCol: [
{
type: 'datepick',
title: '发布日期',
id: 'releaseDate',
row: 24,
disabled: false,
required: true,
fontSize: 16
}
]
},
{
elCol: [
{
type: 'textrea',
title: '脚本内容',
id: 'scriptData',
row: 24,
disabled: false,
required: true,
fontSize: 16
}
]
},
{
elCol: [
{
type: 'textrea',
title: '描述',
id: 'scriptRemark',
row: 24,
disabled: false,
required: false,
fontSize: 16
}
]
},
{
elCol: [
{
type: 'radio',
title: '是否启用',
id: 'scriptStatus',
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: [
{
label: '启用',
id: '1'
},
{
label: '停用',
id: '2'
}
]
}
]
}
]
const tableColumn = [
{
id: 'pluginName',
title: '插件名称'
},
{
id: 'pluginCode',
title: '插件编号'
},
{
id: 'pluginVersion',
title: '插件版本'
},
{
id: 'pluginRemark',
title: '描述',
tooltip: true,
width: 150
},
{
id: 'releaseDate',
title: '发布日期',
tooltip: true,
width: 150
},
{
id: 'modify_time',
title: '更新日期',
tooltip: true
}
]
const configData = {
formRow,
tableColumn
}
export default configData

View File

@ -0,0 +1,337 @@
<template>
<div class="monitoring">
<header>
<div class="left">
<el-input
placeholder="脚本"
v-model="searchForm.scriptName"
@change="searchBtnHandle"
>
<i slot="suffix" class="el-input__icon el-icon-search" @click="searchBtnHandle"></i>
</el-input>
</div>
<div class="right">
<el-button
icon="el-icon-back"
@click="
$router.replace({ path: '/applicationList/applicationListAdmin' })
"
>返回
</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="inserterAdd"
>添加脚本
</el-button
>
</div>
</header>
<main>
<BaseTable
ref="mainTable"
:tableData="tableData"
:tableColumn="tableColumn"
:funData="funData"
:funWidth="funWidth"
:showIndex="true"
:tabLoading="mainTabLoading"
@onFunc="tableButtonHandle"
:tableHeight="'70vh'"
:border="false"
>
<template #scriptStatus="{row}">
{{ row.scriptStatus == 1 ? '启用' : '停用' }}
</template>
<!-- 启用/停用-->
<template #scriptStatus="{row}">
<el-switch
v-model="row.scriptStatus"
active-value="1"
inactive-value="0"
@change="(val)=>{swithChangeHandle(val,row)}"
>
</el-switch>
</template>
</BaseTable>
<div class="page">
<basePage
:pageModel="pageModel"
@update:pageModel="currentChangeHandle"
></basePage>
</div>
</main>
<footer></footer>
<baseDialog
:title="'脚本配置'"
v-model="plugInDialog"
@confirm="plugInConfirm"
:width="'50%'"
>
<div v-if="plugInDialog">
<baseNewForm
ref="dataSettingForm"
:spanNumber="24"
:isFunBtn="false"
:lookFlag="lookFlag"
:formRule="!lookFlag"
:formRow="formRow"
:ruleForm="ruleForm"
@onSubmit="onSubmit"
></baseNewForm>
</div>
</baseDialog>
</div>
</template>
<script>
import { deepClone } from '@/utils/index.js'
import baseNewForm from '@/views/intergrationTask/compoments/baseNewForm'
import baseDialog from '@/views/integrationOption/compoments/baseDialog'
import configData from './configData.js'
import dayjs from 'dayjs'
import BaseTable from '@/views/intergrationTask/compoments/baseTable.vue'
import basePage from '@/views/intergrationTask/compoments/basePage.vue'
import { getApiModuleApi } from '@/api/apiChunks/index.js'
import { authApi } from '@/api/apis/auth'
export default {
data() {
return {
ruleForm: { pluginStatus: '1' },
formRow: configData.formRow,
lookFlag: false,
plugInDialog: false,
refreshLoading: false,
searchForm: {
name: ''
},
mainTabLoading: false,
funData: [
{
type: 'view',
text: '更新',
color: '#5a9cf8'
},
{
type: 'dele',
text: '删除',
color: '#e47470'
}
],
tableColumn: [
{
id: 'scriptName',
title: '脚本名称',
tooltip: true
},
{
id: 'scriptCode',
title: '脚本编号',
tooltip: true
},
{
id: 'scriptVersion',
title: '脚本版本',
tooltip: true
},
{
id: 'scriptRemark',
title: '描述',
tooltip: true
},
{
id: 'releaseDate',
title: '发布日期',
tooltip: true
},
{
id: 'scriptStatus',
title: '启用状态',
tooltip: true
}
],
tableData: [],
pageModel: {
pageIndex: 1,
total: 10,
limit: 10
},
editFlag: false
}
},
methods: {
//
async swithChangeHandle(val, row) {
const res = await authApi('sysApplicationService', '', 'enableOrDisableAppScript', '', {
id: row.id,
scriptStatus: row.scriptStatus
})
this.$vmNews(res.msg, 'success')
console.log(res, 'res')
this.initMainTableData(this.searchForm)
},
searchBtnHandle() {
this.initMainTableData(this.searchForm)
},
async onSubmit() {
if (!this.ruleForm.id) {
const res = await getApiModuleApi({
tl: 'sysApplicationService',
as: '',
dj: 'saveAppScript'
}, { appId: this.$route.query.id, ...this.ruleForm })
if (res.status === '200') {
this.$vmNews('提交成功', 'success')
this.plugInDialog = false
this.ruleForm = {}
this.initMainTableData()
}
} else {
const res = await getApiModuleApi({
tl: 'sysApplicationService',
as: '',
dj: 'updateAppScript'
}, { appId: this.$route.query.id, ...this.ruleForm })
if (res.status === '200') {
this.$vmNews('提交成功', 'success')
this.plugInDialog = false
this.ruleForm = {}
this.initMainTableData()
}
}
},
plugInConfirm() {
this.$refs.dataSettingForm.submitForm()
},
//
inserterAdd() {
this.plugInDialog = true
this.ruleForm = {}
// this.$router.push({ path: "/inserterAdmin/inserterAdd" });
},
//
getTimeHandler(time) {
var days = parseInt(time / (1000 * 60 * 60 * 24))
var hours = parseInt((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
var minutes = parseInt((time % (1000 * 60 * 60)) / (1000 * 60))
var seconds = (time % (1000 * 60)) / 1000
return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒'
},
//
async initMainTableData(obj = {}) {
this.refreshLoading = true
this.openLoading('detail')
const res = await getApiModuleApi(
{
tl: 'sysApplicationService',
as: '',
dj: 'queryAppScriptPage'
},
{
pageNum: this.pageModel.pageIndex,
pageSize: this.pageModel.limit,
...obj,
appId: this.$route.query.id
}
)
this.refreshLoading = false
if (res.status == 200) {
this.tableData = res.attribute.list
this.pageModel.total = res.attribute.total
}
},
//
submitsearchForm() {
this.initMainTableData(this.searchForm)
},
//
tableButtonHandle(val, item) {
if (item.type === 'view') {
this.ruleForm = deepClone(val)
this.plugInDialog = true
} else if (item.type === 'dele') {
this.$confirm('确认删除?')
.then(async() => {
this.openLoading('submit')
const res = await getApiModuleApi({
tl: 'sysApplicationService',
as: '',
dj: 'deleteAppScript'
}, { id: val.id })
if (res.status === '200') {
this.$vmNews('删除脚本成功', 'success')
this.initMainTableData(this.searchForm)
}
})
.catch(() => {
})
}
},
//
currentChangeHandle(pageModel) {
this.pageModel = pageModel
this.$nextTick(() => {
this.initMainTableData(this.searchForm)
})
}
},
computed: {
//
funWidth() {
return this.funData.length * 70
}
},
components: {
BaseTable,
basePage,
baseDialog,
baseNewForm
},
created() {
this.initMainTableData()
this.$emit('flashActive', 6)
}
}
</script>
<style scoped lang="scss">
.monitoring {
position: relative;
width: 100%;
background-color: #fafafa;
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
background-color: #fff;
border-radius: 20px;
.left {
width: 20vw;
align-items: center;
display: flex;
.search {
margin-left: 30px;
display: flex;
> .chunk {
margin-left: 10px;
}
}
}
}
main {
margin-top: 10px;
padding: 20px 20px 5px;
border-radius: 20px;
background-color: #fff;
}
footer {
margin-top: 20px;
}
}
</style>

View File

@ -0,0 +1,206 @@
<template>
<div class="wrap">
<div class="btn">
<div class="chunk">
<el-button icon="el-icon-close" @click="$router.back()">取消</el-button>
</div>
<div class="chunk">
<el-button
icon="el-icon-first-aid-kit
"
type="primary"
>保存</el-button
>
</div>
</div>
<div class="main">
<div class="upload">
<div class="title">插件信息</div>
<div class="uploadMain">
<div class="left">
<div class="title">插件上传</div>
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-upload="beforeUpload"
:file-list="fileList"
list-type="picture"
:limit="1"
:disabled="lookFlag"
>
<div class="line">
<div class="left">
<el-image
style="width: 64px; height: 64px"
:src="iconBase64"
fit="cover"
alt="点击上传"
>
<template v-slot:error>
<div style="line-height: 64px; font-size: 12px">
logo上传
</div>
</template>
</el-image>
</div>
<div class="right" v-if="!lookFlag">
<el-button size="small" type="primary">点击上传</el-button>
</div>
</div>
<div slot="tip" class="el-upload__tip" v-if="!lookFlag">
只能上传jpg/png文件且不超过2MB
</div>
</el-upload>
</div>
</div>
</div>
<div class="form">
<baseNewForm
ref="mainForm"
:spanNumber="24"
:isFunBtn="false"
:lookFlag="lookFlag"
:formRule="!lookFlag"
:formRow="formRow"
></baseNewForm>
</div>
</div>
</div>
</template>
<script>
import configData from "./configData";
import baseNewForm from "@/views/intergrationTask/compoments/baseNewForm";
export default {
data() {
return {
fileList: [],
iconBase64: "",
value1: true,
ruleForm: {},
lookFlag: false,
formRow: configData.addForm,
};
},
methods: {
handleRemove(file, fileList) {
console.log(file, fileList, "123");
},
handlePreview(file) {
console.log(file, this.fileList, "12333");
},
beforeUpload(file) {
console.log(file);
if (
file.type.split("/")[1] != "jpeg" &&
file.type.split("/")[1] != "png"
) {
this.$message({
type: "warning",
message: "只能上传jpg/png文件",
});
return false;
} else {
if (file.size >= 2000000) {
this.$message({
type: "warning",
message: "文件大小不超过2MB",
});
return false;
}
let reader = new FileReader();
let that = this;
console.log(this, 111);
reader.onloadend = function () {
// base64
var base64String = reader.result;
that.iconBase64 = base64String;
console.log(that.iconBase64);
};
reader.readAsDataURL(file);
return false;
}
},
},
components: {
baseNewForm,
},
created() {
if (this.$route.query.id) {
this.lookFlag = true;
} else {
this.lookFlag = false;
}
},
};
</script>
<style scoped lang="scss">
::v-deep .el-button {
border-radius: 4px;
}
::v-deep .el-form-item {
display: block !important;
}
.wrap {
background-color: #fbfbfb;
width: 100%;
padding: 10px;
overflow: auto;
> .btn {
display: flex;
justify-content: flex-end;
> .chunk {
margin-left: 10px;
}
}
> .main {
margin-top: 10px;
> .upload {
background-color: #fff;
border-radius: 16px;
padding: 15px;
> .title {
font-size: 18px;
font-weight: 600;
}
> .uploadMain {
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
> .left {
> .title {
font-size: 18px;
color: #999999;
margin-bottom: 10px;
}
.line {
display: flex;
align-items: center;
.left {
border: 1px dashed #999999;
width: 64px;
height: 64px;
> img {
width: 100%;
height: 100%;
}
}
.right {
margin-left: 15px;
}
}
}
}
}
> .form {
margin-top: 10px;
background-color: #fff;
border-radius: 16px;
}
}
}
</style>

View File

@ -3,21 +3,6 @@
<div class="menu"> <div class="menu">
<div class="appInfo"> <div class="appInfo">
<div class="img"> <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> <template>
<img :src="imgUrl" alt="" @error="handleImageError" style="width: 64px;"/> <img :src="imgUrl" alt="" @error="handleImageError" style="width: 64px;"/>
</template> </template>

View File

@ -7,6 +7,7 @@
<el-button type="primary" @click="openFullScreen1" v-loading.fullscreen.lock="fullscreenLoading" <el-button type="primary" @click="openFullScreen1" v-loading.fullscreen.lock="fullscreenLoading"
style="position: absolute; top: -100px"> style="position: absolute; top: -100px">
</el-button> </el-button>
<div style=" <div style="
position: fixed; position: fixed;
background-color: #fafafa; background-color: #fafafa;

View File

@ -85,10 +85,12 @@ const formRow = [
label: 'ip', label: 'ip',
prop: 'sourceIp', prop: 'sourceIp',
tag: 'elInput', tag: 'elInput',
changeRemind:true,
}, { }, {
label: '端口', label: '端口',
prop: 'sourcePort', prop: 'sourcePort',
tag: 'elInput', tag: 'elInput',
changeRemind:true,
}] }]
}, },
{ {
@ -96,10 +98,12 @@ const formRow = [
label: '数据库名称', label: '数据库名称',
prop: 'dbName', prop: 'dbName',
tag: 'elInput', tag: 'elInput',
changeRemind:true,
}, { }, {
label: '数据源类型', label: '数据源类型',
prop: 'sourceType', prop: 'sourceType',
tag: 'elSelect', tag: 'elSelect',
changeRemind:true,
options: [ options: [
{ {
value: "1", value: "1",
@ -121,10 +125,12 @@ const formRow = [
label: '登录名', label: '登录名',
prop: 'loginName', prop: 'loginName',
tag: 'elInput', tag: 'elInput',
changeRemind:true,
}, { }, {
label: '密码', label: '密码',
prop: 'password', prop: 'password',
tag: 'elInput', tag: 'elInput',
changeRemind:true,
}] }]
}, },
{ {
@ -132,7 +138,8 @@ const formRow = [
label: '服务名称', label: '服务名称',
prop: 'serviceName', prop: 'serviceName',
tag: 'elInput', tag: 'elInput',
show:false show:false,
changeRemind:true,
}, { }, {
label: '使用状态', label: '使用状态',
prop: 'useState', prop: 'useState',

View File

@ -103,7 +103,7 @@ export default {
tableData: [], // tableData: [], //
pageModel: { pageModel: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 100,
}, },
queryModel: { queryModel: {
sourceCode: "", // sourceCode: "", //

View File

@ -20,160 +20,229 @@
:spanWidth="`120px`" :spanWidth="`120px`"
:loading="vLoading" :loading="vLoading"
@onSelect="onSelect" @onSelect="onSelect"
@changeRemind="dataChanges"
></base-form> ></base-form>
<div class="btnList">
<div class="btn">
<el-button type="primary" @click="testDataHandle">校验数据源</el-button>
</div>
<div class="text">
<div v-if="dataState==0" style="color: red">请校验数据源</div>
<div v-else style="color: green">校验成功</div>
</div>
</div>
</base-right-dialog> </base-right-dialog>
</div> </div>
</template> </template>
<script> <script>
import baseRightDialog from "@/components/base/baseRightDialog"; import baseRightDialog from '@/components/base/baseRightDialog'
import baseForm from "@/components/base/baseNewForm"; import baseForm from '@/components/base/baseNewForm'
import baseTable from "@/components/base/baseTable"; import baseTable from '@/components/base/baseTable'
import configData from "./configData"; import configData from './configData'
import { authApi } from "@/api/apis/auth"; import { authApi } from '@/api/apis/auth'
export default { export default {
components: { components: {
baseRightDialog, baseRightDialog,
baseForm, baseForm,
baseTable, baseTable
}, },
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
dialogTitle: "", dialogTitle: '',
dialogType: "", dialogType: '',
formRow: configData.formRow, formRow: configData.formRow,
basicsRules: configData.basicsRules, basicsRules: configData.basicsRules,
vLoading: false, vLoading: false,
newMarryOptions: [], newMarryOptions: [],
submitShow: true, submitShow: true,
}; dataState: 0// 10
}
},
mounted() {
}, },
mounted() {},
methods: { methods: {
//
dataChanges(row) {
console.log(row, '修改')
this.$set(row, 'dataState', 0)
this.dataState = 0
},
//
async testDataHandle() {
this.$refs.basicsForm.$refs['ruleForm'].validate(async(valid) => {
if (!valid) {
return
} else {
this.openLoading('test')
const res = await authApi('sysDataSourceService', '', 'testDatabase', '', {
...this.$refs.basicsForm.ruleForm
})
console.log(res, '测试结果')
if (res.attribute) {
this.dataState = 1
this.$set(this.$refs.basicsForm.ruleForm, 'dataState', 1)
} else {
this.dataState = 0
this.$set(this.$refs.basicsForm.ruleForm, 'dataState', 0)
}
this.$vmNews(res.msg)
}
})
},
openDialog(type, row) { openDialog(type, row) {
this.formRow = configData.formRow; this.formRow = configData.formRow
this.submitShow = true; this.submitShow = true
this.formRow[5].elCol[0].show = false; this.formRow[5].elCol[0].show = false
// //
if (type == "add") { if (type == 'add') {
this.dialogTitle = "新增"; this.dialogTitle = '新增'
this.dialogType = "add"; this.dialogType = 'add'
this.formRow[0].elCol[0].disabled = false; this.formRow[0].elCol[0].disabled = false
this.formRow[1].elCol[0].disabled = false; this.formRow[1].elCol[0].disabled = false
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.basicsForm.getField("useState", 1); this.$refs.basicsForm.getField('useState', 1)
}); this.dataState = 0
this.$set(this.$refs.basicsForm.ruleForm, 'dataState', 0)
})
} }
// //
if (type == "edit") { if (type == 'edit') {
this.formRow[0].elCol[0].disabled = true; this.formRow[0].elCol[0].disabled = true
this.formRow[1].elCol[0].disabled = true; this.formRow[1].elCol[0].disabled = true
this.dialogTitle = "编辑"; this.dialogTitle = '编辑'
this.dialogType = "edit"; this.dialogType = 'edit'
this.messageGetById(row.id); this.messageGetById(row.id)
} }
// //
if (type == "show") { if (type == 'show') {
this.formRow[0].elCol[0].disabled = true; this.formRow[0].elCol[0].disabled = true
this.formRow[1].elCol[0].disabled = true; this.formRow[1].elCol[0].disabled = true
this.submitShow = false; this.submitShow = false
this.formRow = configData.formRowShow; this.formRow = configData.formRowShow
this.dialogTitle = "查看"; this.dialogTitle = '查看'
this.dialogType = "show"; this.dialogType = 'show'
this.messageGetById(row.id); this.messageGetById(row.id)
} }
this.dialogVisible = true; this.dialogVisible = true
}, },
// //
onSelect(val, index, indexRow, obj) { onSelect(val, index, indexRow, obj) {
// oracle // oracle
if (index == 3 && indexRow == 1 && val == 1) { if (index == 3 && indexRow == 1 && val == 1) {
this.formRow[5].elCol[0].show = true; this.formRow[5].elCol[0].show = true
} else { } else {
this.formRow[5].elCol[0].show = false; this.formRow[5].elCol[0].show = false
} }
}, },
// //
async messageGetById(id) { async messageGetById(id) {
let params = { let params = {
id: id, id: id
};
let res = await authApi(
"sysDataSourceService",
"dataSource",
"queryEntity",
"",
params
);
if (res.status == "200") {
this.$nextTick(() => {
if(res.attribute.sourceType == "1"){
this.formRow[5].elCol[0].show = true;
}else{
this.formRow[5].elCol[0].show = false;
} }
this.$refs.basicsForm.incomingParameters(res.attribute); let res = await authApi(
}); 'sysDataSourceService',
'dataSource',
'queryEntity',
'',
params
)
if (res.status == '200') {
this.$nextTick(() => {
if (res.attribute.sourceType == '1') {
this.formRow[5].elCol[0].show = true
} else {
this.formRow[5].elCol[0].show = false
}
this.$refs.basicsForm.incomingParameters(res.attribute)
this.dataState = res.attribute.dataState
})
} }
}, },
// //
handleDialogClose() { handleDialogClose() {
this.$refs.basicsForm.resetFields(); this.$refs.basicsForm.resetFields()
this.dialogVisible = false; this.dialogVisible = false
}, },
// //
handleConfirmClick() { handleConfirmClick() {
this.$refs.basicsForm.$refs["ruleForm"].validate((valid) => { this.$refs.basicsForm.$refs['ruleForm'].validate((valid) => {
if (!valid) { if (!valid) {
return; return
} else {
if (this.dataState == 0) {
this.$confirm('当前校验未通过是否继续保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
type: 'warning'
}).then(() => {
let params = {
...this.$refs.basicsForm.ruleForm
}
if (this.dialogType == 'add') {
this.openLoading('submit')
this.messageSaveDto(params)
}
if (this.dialogType == 'edit') {
this.openLoading('submit')
this.messageUpdateDto(params)
}
})
} else { } else {
let params = { let params = {
...this.$refs.basicsForm.ruleForm, ...this.$refs.basicsForm.ruleForm
};
if (this.dialogType == "add") {
this.openLoading("submit");
this.messageSaveDto(params);
} }
if (this.dialogType == "edit") { if (this.dialogType == 'add') {
this.openLoading("submit"); this.openLoading('submit')
this.messageUpdateDto(params); this.messageSaveDto(params)
}
if (this.dialogType == 'edit') {
this.openLoading('submit')
this.messageUpdateDto(params)
} }
} }
});
}
})
}, },
// //
async messageSaveDto(params) { async messageSaveDto(params) {
let res = await authApi( let res = await authApi(
"sysDataSourceService", 'sysDataSourceService',
"dataSource", 'dataSource',
"addEntity", 'addEntity',
"", '',
params params
); )
if (res.status == "200") { if (res.status == '200') {
this.handleDialogClose(); this.handleDialogClose()
this.$vmNews("新增成功", "success"); this.$vmNews('新增成功', 'success')
this.$emit("resetTable"); this.$emit('resetTable')
} }
}, },
// //
async messageUpdateDto(params) { async messageUpdateDto(params) {
let res = await authApi( let res = await authApi(
"sysDataSourceService", 'sysDataSourceService',
"dataSource", 'dataSource',
"editEntity", 'editEntity',
"", '',
params params
); )
if (res.status == "200") { if (res.status == '200') {
this.handleDialogClose(); this.handleDialogClose()
this.$vmNews("更新成功", "success"); this.$vmNews('更新成功', 'success')
this.$emit("resetTable"); this.$emit('resetTable')
}
}
}
} }
},
},
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -207,4 +276,13 @@ export default {
::v-deep .app-container { ::v-deep .app-container {
height: auto !important; height: auto !important;
} }
.btnList {
display: flex;
align-items: center;
.btn {
margin-right: 40px;
}
}
</style> </style>

View File

@ -102,7 +102,7 @@ export default {
tableData: [], // tableData: [], //
pageModel: { pageModel: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 100,
}, },
queryModel: { queryModel: {
theme: "", // theme: "", //

View File

@ -130,7 +130,7 @@ export default {
tableData: [], // tableData: [], //
pageModel: { pageModel: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 100,
}, },
queryModel: { queryModel: {
theme: "", theme: "",

View File

@ -0,0 +1,22 @@
<template>
<div>
</div>
</template>
<script>
export default {
created() {
window.open('http://192.168.2.79:9999/kangarooDataCenterV3/jmreport/list')
this.$router.go(-1)
}
}
</script>
<style scoped lang="scss">
.box {
display: flex;
//justify-content: center;
//align-items: center;
height: 80vh;
}
</style>

View File

@ -1,100 +1,496 @@
<template> <template>
<div class="app-container home"> <div class="home">
<div class="dashboard-editor-container"> <!--上面块运行情况-->
<panel-group @handleSetLineChartData="handleSetLineChartData" /> <div class="operationInfo">
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> <!-- 异常日志-->
<line-chart :chart-data="lineChartData" /> <div class="errLogs">
</el-row> <div class="title">异常日志</div>
<div class="errorInfo">
<div class="img">
<img src="@/assets/images/index_v2_error.png"/>
</div>
<div class="num">{{ errorNum }}</div>
</div>
<!-- 轮播图-->
<div class="swiper">
<el-carousel height="150px" arrow="never" :loop="true" indicator-position="outside">
<el-carousel-item v-for="(item,index) in errList" :key="index">
<div class="errList">
<div class="errItem" v-for="row in errList[index]">
<div class="img">
<img :src="row.imgUrl" alt="" @error="handleImageError(row)"/>
</div>
<div class="num">
{{ row.num }}
</div>
</div>
</div>
</el-carousel-item>
</el-carousel>
</div>
</div>
<!-- 接口运行情况-->
<div class="apiInfo">
<div class="title">接口运行情况</div>
<div class="table">
<div class="tableTitle">
<div class="app">应用</div>
<div class="total">总数</div>
<div class="start">启动</div>
<div class="stop">停用</div>
</div>
<div class="content" @mouseenter="mouseenterHandle" @mouseleave="mouseleaveHandle">
<div class="tableContent" ref="refcontent">
<div class="line" v-for="(row,index) in this.apiInfoTableData" :key="index">
<div class="app">
<img :src="row.imgUrl" alt="" @error="handleImageError(row)"/>
</div>
<div class="total">{{ row.num ? row.num : 0 }}</div>
<div class="start">{{ row.normalNum ? row.normalNum : 0 }}</div>
<div class="stop">{{ row.abnormalNum ? row.abnormalNum : 0 }}</div>
</div>
</div>
</div>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<raddar-chart />
</div> </div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-chart />
</div> </div>
</el-col> <!-- 任务运行情况-->
<el-col :xs="24" :sm="24" :lg="8"> <div class="taskInfo">
<div class="chart-wrapper"> <div class="title">任务运行情况</div>
<bar-chart /> <div class="taskInfoList">
<div class="total">
<div class="text">总任务</div>
<div class="num">{{ taskTotal }}</div>
</div>
<div class="start">
<div class="text">运行中</div>
<div class="num">{{ taskStart }}</div>
</div>
<div class="stop">
<div class="text">停止</div>
<div class="num">{{ taskStop }}</div>
</div>
</div>
</div>
</div>
<!-- 柱状图-->
<div class="echarts">
<div class="title">数据接入</div>
<div class="form">
<BarChart :proportion="proportion" :DataCollection="echartsData"></BarChart>
</div> </div>
</el-col>
</el-row>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import BarChart from './dashboard/BarChart'
const lineChartData = { import request from "@/utils/request";
newVisitis: { import {authApi} from "@/api/apis/auth";
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145]
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130]
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130]
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
}
export default { export default {
name: 'Index', name: 'Index',
components: { components: {},
PanelGroup,
LineChart,
RaddarChart,
PieChart,
BarChart
},
data() { data() {
return { return {
lineChartData: lineChartData.newVisitis //echats
proportion: {
width: "100%",
height: "40vh",
},
//echarts
echartsData: {
"title": [
"正常",
"异常",
],
"parameter": [],
"series": [
{
"name": "正常",
"type": "bar",
"data": [],
"barWidth": "10%",
"barGap": "0"
},
{
"name": "异常",
"type": "bar",
"data": [],
"barWidth": "10%",
"barGap": "0"
},
]
},
errorNum: 4,//
errList: [],//
apiInfoTableData: [],//
taskTotal: 19,//
taskStart: 20,//
taskStop: 21,//
} }
}, },
mounted() { mounted() {
this.init()
}, },
methods: { methods: {
handleSetLineChartData(type) { //
this.lineChartData = lineChartData[type] async init() {
this.getErrorLogs()
this.getApiInfo()
this.getTaskInfo()
this.getTableData()
},
//
imgHandle(arr = []) {
arr.map(el => {
return request({
url: "/kangarooDataCenterV3/entranceController/fileDownloadNew?id=" + el.path,
method: "get",
responseType: 'arraybuffer'
}).then((res) => {
let tempImgUrl =
"data:image/png/jpg;base64," + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ""));
this.$set(el, 'imgUrl', tempImgUrl)
})
})
},
// 使
handleImageError(row = {}) {
row.imgUrl = require('@/assets/images/defaultIcon.png')
},
//
mouseenterHandle() {
this.$refs.refcontent.style.animationPlayState = 'paused'
},
mouseleaveHandle() {
this.$refs.refcontent.style.animationPlayState = ''
},
//
async getErrorLogs() {
const res = await authApi('homeService', 'app', 'appErrorNum', '', {})
if (res.status === '200') {
this.errList = []
//
this.imgHandle(res.attribute)
let tempIndex = 0 //
let tempArr = [] //
console.log(res.attribute, '异常日志')
this.errorNum = 0
res.attribute.some((item, index) => {
this.errorNum += item.num * 1
tempArr.push(item)
tempIndex++
if (tempIndex === 3) {
this.errList.push(tempArr)
tempIndex = 0
tempArr = []
}
if (index === res.attribute.length - 1 && tempIndex !== 0) {
this.errList.push(tempArr)
return true
}
})
console.log(this.errList, 'errList')
}
},
//
async getApiInfo() {
const res = await authApi('homeService', 'app', 'appApiNum', '', {})
if (res.status === '200') {
this.apiInfoTableData = []
this.imgHandle(res.attribute)
this.apiInfoTableData = res.attribute
if (this.apiInfoTableData.length >= 4) {
this.apiInfoTableData = [...this.apiInfoTableData, ...this.apiInfoTableData]
//
this.$refs.refcontent.classList.add('movego')
this.$refs.refcontent.style.animationDuration = `${this.apiInfoTableData.length}s`
}
console.log(this.apiInfoTableData, 'this.apiInfoTableData')
}
},
//
async getTaskInfo() {
const res = await authApi('homeService', 'app', 'taskNum', '', {})
console.log(res, '任务运行情况')
this.taskTotal = res.attribute.num ? res.attribute.num : 0
this.taskStart = res.attribute.normalNum ? res.attribute.normalNum : 0
this.taskStop = res.attribute.abnormalNum ? res.attribute.abnormalNum : 0
},
//
async getTableData() {
let tempDate = []
let normalNumData = []
let abnormalNumData = []
const res = await authApi('homeService', 'app', 'sevenNum', '', {})
res.attribute.forEach(item => {
tempDate.push(item.name)
normalNumData.push(item.normalNum ? item.normalNum : 0)
abnormalNumData.push(item.abnormalNum ? item.abnormalNum : 0)
})
//echarts
//
this.echartsData.parameter = tempDate
//
this.echartsData.series[0].data = normalNumData
//
this.echartsData.series[1].data = abnormalNumData
console.log(res, '数据接入')
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dashboard-editor-container { .home {
padding: 32px; //background: url(~@/assets/images/index_v2_bgc.png) no-repeat;
background-color: #FBFBFB; padding: 1vh .5vw 1vh;
position: relative; background-color: #fcfcfc;
height: 100%; display: flex;
overflow: auto; flex-direction: column;
//
.operationInfo {
.chart-wrapper { flex: 1;
background: #fff; display: flex;
padding: 16px 16px 0; //
margin-bottom: 32px; .errLogs {
} box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); /* 轻盈的阴影效果 */
} background-color: #fff;
@media (max-width:1024px) {
.chart-wrapper {
padding: 8px; padding: 8px;
//background: url(~@/assets/images/index_v2_border.png) no-repeat;
//background-size: 100% 100%;
flex: 1;
height: 100%;
> .errorInfo {
display: flex;
justify-content: center;
align-items: center;
height: 7vh;
> .img {
margin-right: 20px;
width: 5vw;
height: 100%;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
img {
width: 5vw;
height: 7vh;
} }
} }
> .num {
width: 5vw;
font-size: 3vw;
color: #000;
font-weight: 700;
text-align: center;
}
}
> .swiper {
margin-top: 3vh;
.errList {
margin-top: 20px;
display: flex;
justify-content: space-around;
> .errItem {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-right: .5px #ccc solid;
> .img {
width: 3vw;
height: 3vw;
border-radius: 8px;
overflow: hidden;
display: flex;
align-items: center;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
img {
width: 100%;
}
}
> .num {
margin-top: 10px;
width: 4vw;
text-align: center;
color: #000;
font-weight: 700;
font-size: 1.5vw;
}
&:nth-last-child(1) {
border-right: 0px;
}
}
}
}
}
//
.apiInfo {
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); /* 轻盈的阴影效果 */
background-color: #fff;
padding: 8px;
//background: url(~@/assets/images/index_v2_border.png) no-repeat;
//background-size: 100% 100%;
flex: 1;
margin: 0 10px;
height: 100%;
display: flex;
flex-direction: column;
> .table {
padding: 0 15px;
> .tableTitle {
display: flex;
justify-content: space-around;
padding-bottom: 10px;
border-bottom: #ccc 1px solid;
> div {
display: flex;
color: #000;
font-size: 20px;
}
}
.content {
height: 22vh;
overflow: hidden;
> .tableContent {
> .line {
padding: 15px 0;
display: flex;
justify-content: space-around;
align-items: center;
border-bottom: 1px #ccc dashed;
> div {
color: #000;
font-size: 32px;
flex: 1;
text-align: center;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
img {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
width: 3vw;
}
}
}
}
}
}
}
.taskInfo {
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); /* 轻盈的阴影效果 */
background-color: #fff;
padding: 8px;
//background: url(~@/assets/images/index_v2_border.png) no-repeat;
//background-size: 100% 100%;
flex: 1;
height: 100%;
> .taskInfoList {
display: flex;
justify-content: space-around;
> div {
border-radius: 16px;
width: 28%;
height: 23vh;
display: flex;
font-weight: 700;
flex-direction: column;
align-items: center;
font-size: 30px;
color: #fff;
.text{
margin-top: 5vh;
}
.num{
margin-top: 5vh;
}
}
> .total {
background-color: #1d46ee;
}
> .start {
background-color: #7ad756;
}
> .stop {
background-color: #e76e3e;
}
}
}
}
//
.title {
//background: url(~@/assets/images/index_v2_title.png) no-repeat;
//background-size: 100% 100%;
width: 20vw;
height: 6vh;
color: #000;
line-height: 6vh;
padding-left: 1vw;
font-size: 24px;
font-weight: 700;
}
.echarts {
flex: 2;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); /* 轻盈的阴影效果 */
margin-top: 10px;
background-color: #fff;
.form{
margin-top: 5vh;
}
}
}
//
@keyframes move {
0% {
transform: translateY(0);
}
100% {
transform: translateY(-51%);
}
}
.movego {
animation: move 80s linear infinite;
}
</style> </style>

View File

@ -134,7 +134,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .el-button { ::v-deep .el-button {
border-radius: 16px; border-radius: 4px;
} }
::v-deep .el-form-item { ::v-deep .el-form-item {
display: block !important; display: block !important;

View File

@ -242,7 +242,7 @@ export default {
journalingType: this.journalingType, journalingType: this.journalingType,
names: val, names: val,
pageNum: this.pageModel.pageIndex, pageNum: this.pageModel.pageIndex,
pageSize: 10, pageSize: 100,
...obj, ...obj,
...this.tempObj, ...this.tempObj,
}); });

View File

@ -80,8 +80,8 @@
> >
</el-input> </el-input>
<el-input-number <el-input-number
v-if="row.type === 'num'" v-if="row.tag === 'num' || (row.type === 'num' && !lookFlag)"
v-model="ruleForm[row.prop]" v-model="ruleForm[row.id]"
style="width: 100%" style="width: 100%"
:disabled="row.disabled && !newFlag ? row.disabled : false" :disabled="row.disabled && !newFlag ? row.disabled : false"
:precision="row.precisionNum ? row.precisionNum : 0" :precision="row.precisionNum ? row.precisionNum : 0"
@ -195,7 +195,7 @@
class="showText" class="showText"
@click="elDialogClick(row, index, indexRow)" @click="elDialogClick(row, index, indexRow)"
> >
{{ ruleForm[row.prop] ? ruleForm[row.prop] : "请点击选择" }} {{ ruleForm[row.prop] ? ruleForm[row.prop] : '请点击选择' }}
<!-- <el-input v-model="ruleForm[row.prop]"></el-input> --> <!-- <el-input v-model="ruleForm[row.prop]"></el-input> -->
</p> </p>
<!-- <i class="el-icon-more " v-if="row.elDialogHoverType"></i> --> <!-- <i class="el-icon-more " v-if="row.elDialogHoverType"></i> -->
@ -321,11 +321,11 @@
</template> </template>
<script> <script>
import baseCascader from "./baseCascader/index.vue"; import baseCascader from './baseCascader/index.vue'
import {deepClone} from "@/utils/index.js"; import { deepClone } from '@/utils/index.js'
import baseDatePicker from "./baseDatePicker.vue"; import baseDatePicker from './baseDatePicker.vue'
import baseNewSelect from "./baseNewSelect"; import baseNewSelect from './baseNewSelect'
import {checkMobile} from "@/utils/util"; import { checkMobile } from '@/utils/util'
export default { export default {
components: { components: {
@ -333,88 +333,88 @@ export default {
// customCascader // customCascader
baseNewSelect, baseNewSelect,
baseDatePicker, baseDatePicker,
baseCascader, baseCascader
}, },
props: { props: {
// loading // loading
loading: { loading: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
formRule: { formRule: {
type: Boolean, type: Boolean,
default: true, default: true
}, },
refName: { refName: {
type: String, type: String,
default: "ruleForm", default: 'ruleForm'
}, },
// //
newFlag: { newFlag: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
lookFlag: { lookFlag: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
spanNumber: { spanNumber: {
type: Number, type: Number,
default: 12, default: 12
}, },
spanWidth: { spanWidth: {
type: String, type: String,
default: "90px", default: '120px'
}, },
// //
rules: { rules: {
type: Object, type: Object,
default: () => { default: () => {
return {}; return {}
}, }
}, },
// //
formRow: { formRow: {
type: Array, type: Array,
default: () => { default: () => {
return []; return []
}, }
}, },
// //
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
isFunBtn: { isFunBtn: {
type: Boolean, type: Boolean,
default: true, default: true
}, },
formdata: { formdata: {
type: Object, type: Object
}, },
justifyContent: { justifyContent: {
type: String, type: String,
default: "flex-end", default: 'flex-end'
}, },
marginBottom: { marginBottom: {
type: String, type: String,
default: "0", default: '0'
}, },
ruleForm: { ruleForm: {
type: Object, type: Object,
default: () => { default: () => {
return {}; return {}
}, }
}, },
tableColumn: { tableColumn: {
type: Array, type: Array,
default: () => { default: () => {
return []; return []
}, }
}, },
treeSelectInfo: { treeSelectInfo: {
type: Object, type: Object,
@ -428,76 +428,76 @@ export default {
pickerOptionsSearch: { pickerOptionsSearch: {
shortcuts: [ shortcuts: [
{ {
text: "本月", text: '本月',
onClick(picker) { onClick(picker) {
picker.$emit("pick", [new Date(), new Date()]); picker.$emit('pick', [new Date(), new Date()])
}, }
}, },
{ {
text: "今年至今", text: '今年至今',
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date()
const start = new Date(new Date().getFullYear(), 0); const start = new Date(new Date().getFullYear(), 0)
picker.$emit("pick", [start, end]); picker.$emit('pick', [start, end])
}, }
}, },
{ {
text: "最近六个月", text: '最近六个月',
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date()
const start = new Date(); const start = new Date()
start.setMonth(start.getMonth() - 6); start.setMonth(start.getMonth() - 6)
picker.$emit("pick", [start, end]); picker.$emit('pick', [start, end])
}, }
}, }
], ]
}, },
// //
// ruleForm: {}, // ruleForm: {},
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() > Date.now(); return time.getTime() > Date.now()
}, },
shortcuts: [ shortcuts: [
{ {
text: "今天", text: '今天',
onClick(picker) { onClick(picker) {
picker.$emit("pick", new Date()); picker.$emit('pick', new Date())
}, }
}, },
{ {
text: "昨天", text: '昨天',
onClick(picker) { onClick(picker) {
const date = new Date(); const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24); date.setTime(date.getTime() - 3600 * 1000 * 24)
picker.$emit("pick", date); picker.$emit('pick', date)
}, }
}, },
{ {
text: "一周前", text: '一周前',
onClick(picker) { onClick(picker) {
const date = new Date(); const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7); date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit("pick", date); picker.$emit('pick', date)
}
}
]
}, },
}, tempFormData: {}
], }
},
tempFormData: {},
};
}, },
watch: { watch: {
ruleForm: { ruleForm: {
immediate: true, // immediate: true, //
deep: true, // deep: true, //
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.$emit("dataChanges"); this.$emit('dataChanges')
}, }
}, }
}, },
created() { created() {
this.tempFormData = deepClone(this.ruleForm); this.tempFormData = deepClone(this.ruleForm)
}, },
mounted() { mounted() {
// this.ruleForm = this.formdata // this.ruleForm = this.formdata
@ -506,13 +506,13 @@ export default {
methods: { methods: {
selectShow(row) { selectShow(row) {
try { try {
this.$emit("selectFormSearch", row); this.$emit('selectFormSearch', row)
} catch (error) { } catch (error) {
console.log(this.ruleForm, row, "23232出错了"); console.log(this.ruleForm, row, '23232出错了')
} }
}, },
close() { close() {
this.$emit("closeDialog"); this.$emit('closeDialog')
}, },
integerNumber(row) { integerNumber(row) {
// row.rules?(v)=>()):'' // row.rules?(v)=>()):''
@ -521,127 +521,127 @@ export default {
// return this.ruleForm[row.prop].replace(/[^\d]/g,'') // return this.ruleForm[row.prop].replace(/[^\d]/g,'')
// //
// integer // integer
if (row.rulesName == "integer") { if (row.rulesName == 'integer') {
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/[^\d]/g, ""); this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/[^\d]/g, '')
} }
// decimal // decimal
if (row.rulesName == "decimal") { if (row.rulesName == 'decimal') {
this.ruleForm[row.prop] = this.ruleForm[row.prop] this.ruleForm[row.prop] = this.ruleForm[row.prop]
.replace(/[^\d.]/g, "") .replace(/[^\d.]/g, '')
.replace(/\.{2,}/g, ".") .replace(/\.{2,}/g, '.')
.replace(".", "$#$") .replace('.', '$#$')
.replace(/\./g, "") .replace(/\./g, '')
.replace("$#$", ".") .replace('$#$', '.')
.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3") .replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
.replace(/^\./g, ""); .replace(/^\./g, '')
} }
// //
if (row.rulesName == "identity") { if (row.rulesName == 'identity') {
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace( this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
"" ''
); )
} }
// //
if (row.rulesName == "phone") { if (row.rulesName == 'phone') {
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace( this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(
/^1(3|4|5|7|8|9)\\d{9}$/, /^1(3|4|5|7|8|9)\\d{9}$/,
"" ''
); )
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/^1[3,4,5,6,7,8,9][0-9]{9}$/, '') // this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/^1[3,4,5,6,7,8,9][0-9]{9}$/, '')
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/1(\d{2})\d{4}(\d{4})/g,'').replace(/[^\d]/g, '') // this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/1(\d{2})\d{4}(\d{4})/g,'').replace(/[^\d]/g, '')
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/\.{11,}/g, '') // this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/\.{11,}/g, '')
// /^1[3|4|5|6|7|8|9][0-9]\d{8}$/ // /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
} }
// //
if (row.rulesName == "eMail") { if (row.rulesName == 'eMail') {
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace( this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(
/^([0-9a-zA-Z_\.\-\])+\@([0-9a-zA-Z_\.\-\])+\.([a-zA-Z]+)$/, /^([0-9a-zA-Z_\.\-\])+\@([0-9a-zA-Z_\.\-\])+\.([a-zA-Z]+)$/,
"" ''
); )
} }
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/[^\d]/g,'') // this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/[^\d]/g,'')
}, },
// //
searchByStationName(type) { searchByStationName(type) {
if (type == "address") { if (type == 'address') {
let address = this.ruleForm[type]; let address = this.ruleForm[type]
let that = this; let that = this
var map = new BMap.Map("container"); var map = new BMap.Map('container')
map.centerAndZoom(address, 18); map.centerAndZoom(address, 18)
map.enableScrollWheelZoom(); // map.enableScrollWheelZoom() //
map.enableContinuousZoom(); // map.enableContinuousZoom() //
map.addControl(new BMap.NavigationControl()); // map.addControl(new BMap.NavigationControl()) //
map.addControl(new BMap.OverviewMapControl()); // map.addControl(new BMap.OverviewMapControl()) //
map.addControl( map.addControl(
new BMap.OverviewMapControl({ new BMap.OverviewMapControl({
isOpen: true, isOpen: true,
anchor: BMAP_ANCHOR_BOTTOM_RIGHT, anchor: BMAP_ANCHOR_BOTTOM_RIGHT
}) })
); // ) //
var localSearch = new BMap.LocalSearch(map); var localSearch = new BMap.LocalSearch(map)
localSearch.enableAutoViewport(); // localSearch.enableAutoViewport() //
map.clearOverlays(); // map.clearOverlays() //
var keyword = address; var keyword = address
localSearch.setSearchCompleteCallback(function(searchResult) { localSearch.setSearchCompleteCallback(function(searchResult) {
var poi = searchResult.getPoi(0); var poi = searchResult.getPoi(0)
map.centerAndZoom(poi.point, 13); map.centerAndZoom(poi.point, 13)
var marker = new BMap.Marker( var marker = new BMap.Marker(
new BMap.Point(poi.point.lng, poi.point.lat) new BMap.Point(poi.point.lng, poi.point.lat)
); // ) //
map.addOverlay(marker); map.addOverlay(marker)
var content = var content =
keyword + keyword +
"<br/><br/>经度:" + '<br/><br/>经度:' +
poi.point.lng + poi.point.lng +
"<br/>纬度:" + '<br/>纬度:' +
poi.point.lat; poi.point.lat
that.ruleForm["lng"] = poi.point.lng; that.ruleForm['lng'] = poi.point.lng
that.ruleForm["lat"] = poi.point.lat; that.ruleForm['lat'] = poi.point.lat
var infoWindow = new BMap.InfoWindow( var infoWindow = new BMap.InfoWindow(
"<p style='font-size:14px;'>" + content + "</p>" '<p style=\'font-size:14px;\'>' + content + '</p>'
); )
marker.addEventListener("click", function () { marker.addEventListener('click', function() {
this.openInfoWindow(infoWindow); this.openInfoWindow(infoWindow)
}); })
// marker.setAnimation(BMAP_ANIMATION_BOUNCE); // // marker.setAnimation(BMAP_ANIMATION_BOUNCE); //
}); })
localSearch.search(keyword); localSearch.search(keyword)
} }
}, },
// //
handleChange(val) { handleChange(val) {
this.$emit("handleChange", val); this.$emit('handleChange', val)
}, },
// //
getImage(imagePath) { getImage(imagePath) {
let licenseImg = imagePath.join(","); let licenseImg = imagePath.join(',')
}, },
// //
getbeforeImgList(imagePath) { getbeforeImgList(imagePath) {
let licenseImg = imagePath.join(","); let licenseImg = imagePath.join(',')
this.$set(this.ruleForm, "beforeImgList", licenseImg); this.$set(this.ruleForm, 'beforeImgList', licenseImg)
}, },
// //
getmaterialsList(imagePath) { getmaterialsList(imagePath) {
let licenseImg = imagePath.join(","); let licenseImg = imagePath.join(',')
this.$set(this.ruleForm, "materialsList", licenseImg); this.$set(this.ruleForm, 'materialsList', licenseImg)
}, },
// //
getmaterialsListAfter(imagePath) { getmaterialsListAfter(imagePath) {
let licenseImg = imagePath.join(","); let licenseImg = imagePath.join(',')
this.$set(this.ruleForm, "materialsListAfter", licenseImg); this.$set(this.ruleForm, 'materialsListAfter', licenseImg)
}, },
revealPhoto(licenseImg) { revealPhoto(licenseImg) {
this.$refs.imgFile.revealImg(licenseImg); this.$refs.imgFile.revealImg(licenseImg)
}, },
// //
echoFromData(echoData, otherField) { echoFromData(echoData, otherField) {
let jsonData = []; let jsonData = []
this.formRow.forEach((item) => { this.formRow.forEach((item) => {
jsonData.push(item.elCol); jsonData.push(item.elCol)
}); })
let newJson = [].concat.apply([], jsonData); let newJson = [].concat.apply([], jsonData)
newJson.forEach((item) => { newJson.forEach((item) => {
if (this.ruleForm.factoryInFlag == 1) { if (this.ruleForm.factoryInFlag == 1) {
for (let i = 0; i < this.formRow[8].elCol.length; i++) { for (let i = 0; i < this.formRow[8].elCol.length; i++) {
@ -651,31 +651,31 @@ export default {
for (let i = 0; i < this.formRow[8].elCol.length; i++) { for (let i = 0; i < this.formRow[8].elCol.length; i++) {
} }
} }
this.$set(this.ruleForm, item.prop, echoData[item.prop]); this.$set(this.ruleForm, item.prop, echoData[item.prop])
}); })
// //
if (typeof otherField == "object") { if (typeof otherField == 'object') {
this.$refs[otherField.props][0].setEchoData(echoData[otherField.field]); this.$refs[otherField.props][0].setEchoData(echoData[otherField.field])
} }
}, },
// //
//propLabel value //propLabel value
getField(propLabel, value) { getField(propLabel, value) {
this.$set(this.ruleForm, propLabel, value); this.$set(this.ruleForm, propLabel, value)
}, },
// //
choiceAssignment(value) { choiceAssignment(value) {
this.ruleForm = Object.assign({}, value); this.ruleForm = Object.assign({}, value)
// this.$forceUpdate() // this.$forceUpdate()
}, },
incomingParameters(vale) { incomingParameters(vale) {
let ruleLength = 0; let ruleLength = 0
let valeLength = 0; let valeLength = 0
for (let i in vale) { for (let i in vale) {
valeLength = valeLength + 1; valeLength = valeLength + 1
} }
for (let i in this.ruleForm) { for (let i in this.ruleForm) {
ruleLength = ruleLength + 1; ruleLength = ruleLength + 1
} }
// if(ruleLength == valeLength){ // if(ruleLength == valeLength){
// this.choiceAssignment(vale) // this.choiceAssignment(vale)
@ -685,107 +685,107 @@ export default {
// } // }
// } // }
for (let i in vale) { for (let i in vale) {
this.getField(i, vale[i]); this.getField(i, vale[i])
} }
}, },
resetFormPlus(formName) { resetFormPlus(formName) {
for (let i in this.$refs[formName]) { for (let i in this.$refs[formName]) {
this.getField(i, ""); this.getField(i, '')
} }
}, },
// //
resetField(field) { resetField(field) {
if (this.ruleForm[field]) { if (this.ruleForm[field]) {
this.$set(this.ruleForm, field, ""); this.$set(this.ruleForm, field, '')
this.$refs["ruleForm"].clearValidate(field); // this.$refs['ruleForm'].clearValidate(field) //
} }
}, },
resetFields() { resetFields() {
// this.choiceAssignment({}); // this.choiceAssignment({});
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields()
}, },
// , index indexRow // , index indexRow
selectChange(val, index, indexRow, options) { selectChange(val, index, indexRow, options) {
let obj = {}; let obj = {}
options.forEach((item) => { options.forEach((item) => {
if (item.value == val) { if (item.value == val) {
obj = item; obj = item
} }
}); })
this.$emit("onSelect", val, index, indexRow, obj); this.$emit('onSelect', val, index, indexRow, obj)
this.$forceUpdate(); this.$forceUpdate()
}, },
switchChange(val, index, indexRow, row) { switchChange(val, index, indexRow, row) {
this.$emit("switchChange", val, index, indexRow, row); this.$emit('switchChange', val, index, indexRow, row)
}, },
// //
getCascader(value, field) { getCascader(value, field) {
this.$set(this.ruleForm, field, value); this.$set(this.ruleForm, field, value)
}, },
// //
submitForm() { submitForm() {
let formName = "ruleForm"; let formName = 'ruleForm'
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
// //
let flag = let flag =
JSON.stringify(this.tempFormData) === JSON.stringify(this.ruleForm); JSON.stringify(this.tempFormData) === JSON.stringify(this.ruleForm)
this.$emit("onSubmit", this.ruleForm, flag); this.$emit('onSubmit', this.ruleForm, flag)
} else { } else {
console.log("error submit!!"); console.log('error submit!!')
return false; return false
} }
}); })
}, },
// //
resetForm(formName) { resetForm(formName) {
let tempObj = deepClone(this.tempFormData); let tempObj = deepClone(this.tempFormData)
// // this.tableColumn // // this.tableColumn
// // .filter((item) => item.disabled) // // .filter((item) => item.disabled)
// // .forEach((item) => { // // .forEach((item) => {
// // tempObj[item.id] = this.ruleForm[item.id]; // // tempObj[item.id] = this.ruleForm[item.id];
// // }); // // });
// // this.choiceAssignment({}); // // this.choiceAssignment({});
this.$confirm("确认要重置表单吗?", "提示", { this.$confirm('确认要重置表单吗?', '提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning'
}) })
.then(() => { .then(() => {
this.$emit("resetForm", tempObj); this.$emit('resetForm', tempObj)
this.$refs[formName].resetFields(); this.$refs[formName].resetFields()
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: 'info',
message: "已取消重置", message: '已取消重置'
}); })
}); })
}, },
clearCheck(propName) { clearCheck(propName) {
this.ruleForm[propName] = ""; this.ruleForm[propName] = ''
}, },
elDialogClick(row, index, indexRow) { elDialogClick(row, index, indexRow) {
if (row.disabled) { if (row.disabled) {
return; return
} }
// row.prop // row.prop
this.$emit("elDialogClick", row, index); this.$emit('elDialogClick', row, index)
}, },
elDialogHover(row) { elDialogHover(row) {
row.elDialogHoverType = true; row.elDialogHoverType = true
}, },
elDialogLeave(row) { elDialogLeave(row) {
// row.elDialogHoverType = false // row.elDialogHoverType = false
}, },
// input // input
changeRadio(val, index, indexRow, row) { changeRadio(val, index, indexRow, row) {
this.$emit("onChangeRadio", val, index, indexRow, row); this.$emit('onChangeRadio', val, index, indexRow, row)
}, },
normalizer(node, row) { normalizer(node, row) {
//children=null //children=null
if (node.children == null || node.children == "null") { if (node.children == null || node.children == 'null') {
delete node.children; delete node.children
} }
// return{ // return{
// ...node, // ...node,
@ -793,22 +793,22 @@ export default {
// } // }
}, },
selectTree(row) { selectTree(row) {
console.log(row); console.log(row)
this.$emit("selectTree"); this.$emit('selectTree')
if (this.$refs.ruleForm) { if (this.$refs.ruleForm) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ruleForm.validateField(row.id); this.$refs.ruleForm.validateField(row.id)
}); })
} }
}, },
treeSelectClear() { treeSelectClear() {
this.$refs.selectTree.clear(); this.$refs.selectTree.clear()
}, }
}, },
mounted() { mounted() {
// this.$refs.ruleForm.resetFields(); // this.$refs.ruleForm.resetFields();
}, }
}; }
</script> </script>
<style> <style>
.el-form-item__label { .el-form-item__label {
@ -817,8 +817,9 @@ export default {
} }
.el-form-item--medium .el-form-item__content { .el-form-item--medium .el-form-item__content {
/* line-height: 36px; */
flex: 1; flex: 1;
display: flex;
align-items: center;
} }
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before { .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before {
@ -826,12 +827,12 @@ export default {
content: ""; content: "";
} }
</style> </style>
<style scoped lang='scss'> <style scoped lang="scss">
.label { .label {
/* @include fontBase(16px, #333333) ; */ /* @include fontBase(16px, #333333) ; */
color: #333; color: #333;
font-size: 13px; font-size: 13px;
/* width: 90px; */ ///* width: 90px; */
text-align: right; text-align: right;
padding-right: 5px; padding-right: 5px;
} }
@ -922,4 +923,7 @@ export default {
resize: none; resize: none;
} }
} }
::v-deep .el-form-item__label{
padding: 0 !important;
}
</style> </style>

View File

@ -46,20 +46,23 @@
</el-select> </el-select>
</template> </template>
<template v-else <template v-else
><div v-loading="selLoading">{{ showValue }}</div></template >
<div v-loading="selLoading">{{ showValue }}</div>
</template
> >
</div> </div>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .el-input--mini .el-input__inner { ::v-deep .el-input--mini .el-input__inner {
height: 38px; height: 38px;
} }
.w-100 { .w-100 {
width: 100% !important; width: 100% !important;
} }
.drop > > > .el-input__inner { .drop > > > .el-input__inner {
background: #5183ff !important; background: #5183ff !important;
color: white; color: white;
@ -68,92 +71,52 @@
padding: 10px 22px 10px 10px; padding: 10px 22px 10px 10px;
text-align: center; text-align: center;
} }
.drop { .drop {
width: 250px; width: 250px;
} }
.drop > > > .el-select .el-input .el-select__caret { .drop > > > .el-select .el-input .el-select__caret {
display: none; display: none;
} }
</style> </style>
<el-select
v-loading="selLoading"
class="w-100"
v-model="selectValue"
:placeholder="placeholder"
:clearable="false"
style="width: 240px"
size="mini"
refs="mySelect"
:reserve-keyword="true"
:disabled="disabled"
filterable
popper-class="sele"
:filter-method="filter"
@change="fun"
@focus="funx"
@blur="funb"
@visible-change="hidden"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.label"
remote
:value="item.id"
placeholder="请输入"
>
</el-option>
<div style="bottom: -10px">
<el-pagination
v-if="pageTotal > pageSize"
small
@current-change="handleCurrentChange"
:current-page="currentpage"
:page-size="pageSize"
layout="prev, pager,next,total"
:total="pageTotal"
>
</el-pagination>
</div>
</el-select>
</template>
<script> <script>
import debounce from "lodash/debounce"; import debounce from 'lodash/debounce'
import { getUserModuleApi } from "@/api/integrationOption/integrationOption.js"; import { getUserModuleApi } from '@/api/integrationOption/integrationOption.js'
export default { export default {
props: { props: {
ruleForm: { ruleForm: {
type: Object, type: Object,
default: {}, default: {}
}, },
selectInfo: { selectInfo: {
type: Object, type: Object,
default: () => { default: () => {
return {}; return {}
}, }
}, },
// //
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
placeholder: String, placeholder: String,
value: { value: {
type: String, type: String
}, },
itemObj: { itemObj: {
type: Object, type: Object,
default: () => { default: () => {
return {}; return {}
}, }
}, },
lookflag: { lookflag: {
type: Boolean, type: Boolean,
default: false, default: false
}, }
}, },
data() { data() {
return { return {
@ -161,26 +124,26 @@ export default {
pageModel: { pageModel: {
total: 0, total: 0,
pageIndex: 1, pageIndex: 1,
limit: 10, limit: 10
}, },
selLoading: false, selLoading: false,
showValue: "", showValue: '',
lookLoading: false, lookLoading: false
}; }
}, },
computed: { computed: {
selectValue: { selectValue: {
get() { get() {
return this.value; return this.value
}, },
set(val) { set(val) {
this.$emit("input", val); this.$emit('input', val)
}, }
}, }
}, },
created() { created() {
if (Object.keys(this.ruleForm).length && this.ruleForm[this.itemObj.id]) { if (Object.keys(this.ruleForm).length && this.ruleForm[this.itemObj.id]) {
// this.getSelectdata(this.ruleForm[this.itemObj.id]); this.getSelectdata(this.ruleForm[this.itemObj.id]);
} }
}, },
mounted() { mounted() {
@ -188,12 +151,12 @@ export default {
methods: { methods: {
// select // select
async getUserModuleApi(obj = {}) { async getUserModuleApi(obj = {}) {
this.selLoading = true; this.selLoading = true
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryTemplateData", dj: 'queryTemplateData'
}, },
{ {
tableName: this.itemObj.service, tableName: this.itemObj.service,
@ -201,48 +164,48 @@ export default {
label: this.itemObj.label, label: this.itemObj.label,
pageNum: this.pageModel.pageIndex, pageNum: this.pageModel.pageIndex,
pageSize: this.pageModel.limit, pageSize: this.pageModel.limit,
...obj, ...obj
} }
); )
if (res.status === '200') { if (res.status === '200') {
console.log(res) console.log(res)
this.pageModel.total = res.attribute.total; this.pageModel.total = res.attribute.total
this.options = res.attribute.list; this.options = res.attribute.list
} }
this.selLoading = false; this.selLoading = false
}, },
// selectidvalue // selectidvalue
async getSelectdata(id) { async getSelectdata(id) {
this.selLoading = true; this.selLoading = true
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryTemplateData", dj: 'queryTemplateData'
}, },
{ {
tableName: this.itemObj.service, tableName: this.itemObj.service,
id: id, id: id,
label: this.itemObj.label, label: this.itemObj.label,
value: this.itemObj.value, value: this.itemObj.value
} }
); )
if (res.status == 200 && res.attribute.length) { if (res.status == 200 && res.attribute.length) {
this.selLoading = false; this.selLoading = false
this.options = res.attribute; this.options = res.attribute
this.showValue = res.attribute[0][this.itemObj.label]; this.showValue = res.attribute[0][this.itemObj.label]
} else { } else {
this.selLoading = false; this.selLoading = false
this.options.push({ this.options.push({
[this.itemObj.label]: "请选择", [this.itemObj.label]: '请选择',
[this.itemObj.value]: id, [this.itemObj.value]: id
}); })
} }
}, },
// //
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageModel.pageIndex = val; this.pageModel.pageIndex = val
this.getUserModuleApi(); this.getUserModuleApi()
}, },
// select // select
fun(val) { fun(val) {
@ -250,18 +213,20 @@ export default {
}, },
// //
funx() { funx() {
this.getUserModuleApi(); this.getUserModuleApi()
}, },
// //
funb() {}, funb() {
hidden() {}, },
hidden() {
},
//,options //,options
filter: debounce(function(val) { filter: debounce(function(val) {
// this.pageModel.pageIndex = 1; // this.pageModel.pageIndex = 1;
// this.getUserModuleApi({ lableValue: val }); // this.getUserModuleApi({ lableValue: val });
}, 300), }, 300)
}, },
// //
watch: {}, watch: {}
}; }
</script> </script>

View File

@ -176,8 +176,10 @@
class="btnText" class="btnText"
:style="{ background: item.color ? item.color : '#5a9cf8' }" :style="{ background: item.color ? item.color : '#5a9cf8' }"
style="padding: 3px 10px; border-radius: 20px" style="padding: 3px 10px; border-radius: 20px"
v-btnPermission="{ btnID: item.type, routeId: $route.meta.id }"
> >
<span <span
style="color: #fff; font-weight: 700" style="color: #fff; font-weight: 700"
v-if="!item.ifField && !item.hiddenField" v-if="!item.ifField && !item.hiddenField"
>{{ item.text }}</span >{{ item.text }}</span

View File

@ -98,6 +98,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 定义插槽父组件可以使用 v-slot:prop="{row}" 搭配template标签自定义每一列单元格的样式与操作 --> <!-- 定义插槽父组件可以使用 v-slot:prop="{row}" 搭配template标签自定义每一列单元格的样式与操作 -->
<slot :name="item.id" :row="slotrow ? scope : scope.row"> <slot :name="item.id" :row="slotrow ? scope : scope.row">
<template v-if="scope.$index + 1 != tableInfo.tableData.length || lookflag">
<template v-if="!lookflag"> <template v-if="!lookflag">
<el-input <el-input
v-if="item.type === 'input' || item.type === 'textrea'" v-if="item.type === 'input' || item.type === 'textrea'"
@ -302,6 +303,7 @@
v-model="tableInfo.tableData[scope.row.index][item.id]" v-model="tableInfo.tableData[scope.row.index][item.id]"
></el-checkbox> ></el-checkbox>
</template> </template>
</template>
</slot> </slot>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -242,7 +242,7 @@ export default {
journalingType: this.journalingType, journalingType: this.journalingType,
names: val, names: val,
pageNum: this.pageModel.pageIndex, pageNum: this.pageModel.pageIndex,
pageSize: 10, pageSize: 100,
...obj, ...obj,
...this.tempObj, ...this.tempObj,
}); });

View File

@ -33,6 +33,7 @@
type="primary" type="primary"
size="mini" size="mini"
@click="buttonHandle(item)" @click="buttonHandle(item)"
v-btnPermission="{ btnID: item.buttonType, routeId: $route.meta.id }"
>{{ item.buttonName }} >{{ item.buttonName }}
</el-button> </el-button>
</div> </div>
@ -53,6 +54,9 @@
:tableHeight="'67vh'" :tableHeight="'67vh'"
:border="false" :border="false"
> >
<template #data_status="{row}">
{{ data_status_dist[row.data_status] }}
</template>
</BaseTable> </BaseTable>
<div class="nextPage"> <div class="nextPage">
<BasePage <BasePage
@ -62,7 +66,7 @@
</div> </div>
</div> </div>
</div v-> </div v->
<baseDialog v-model="dialogShow" @confirm="dialogConfirm" :lookFlag="lookFlag"> <baseDialog title="数据设置" v-model="dialogShow" @confirm="dialogConfirm" :lookFlag="lookFlag">
<h1 style="margin: 20px 0; font-size: 20px; font-weight: 700"> <h1 style="margin: 20px 0; font-size: 20px; font-weight: 700">
基本信息 基本信息
</h1> </h1>
@ -101,63 +105,104 @@
</template> </template>
</baseDialog> </baseDialog>
<!-- 分发任务dialog--> <!-- 分发任务dialog-->
<baseDialog v-model="sendShow" :footerShow="false"> <baseDialog width="30%" v-model="sendShow" :footerShow="false" title="分发任务">
<baseTable <div class="sendBox">
:tableData="sendTableData" <div class="chunk" style="display: flex;align-items: center;margin: 20px 0;font-size: 16px">
:tableColumn="sendTableColumn"> <div class="title">分发</div>
<template v-slot:status="{row}"> <div class="value" style="margin-left: 20px">
{{ sendDist[row.status] }} <el-select
</template> v-model="sendCheckboxList"
<template v-slot:fun="{row}"> placeholder="请选择"
<el-button v-if="row.status === '1'||row.status === '2'" type="danger" @click="sendRowHandle(row)">删除 >
<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>
<el-button v-if="row.status === '3'||row.status === '4'" type="primary" @click="sendRowHandle(row)">下发 </div>
</el-button> </div>
</template> <!-- <baseTable-->
</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> </baseDialog>
</div> </div>
</template> </template>
<script> <script>
import {deepClone} from "@/utils/index.js"; import { deepClone } from '@/utils/index.js'
import {getUserModuleApi} from "@/api/integrationOption/integrationOption.js"; import { getUserModuleApi } from '@/api/integrationOption/integrationOption.js'
import BaseNewForm from "./compoments/baseNewForm"; import BaseNewForm from './compoments/baseNewForm'
import BaseTable from "./compoments/baseTable"; import BaseTable from './compoments/baseTable'
import BasePage from "./compoments/basePage.vue"; import BasePage from './compoments/basePage.vue'
import baseDialog from "@/views/integrationOption/compoments/baseDialog"; import baseDialog from '@/views/integrationOption/compoments/baseDialog'
import BaseTableForm from "./compoments/baseTableForm_v2.vue"; import BaseTableForm from './compoments/baseTableForm_v2.vue'
import BaseMenuTree from "@/views/intergrationTask/compoments/baseMenuTree.vue"; import BaseMenuTree from '@/views/intergrationTask/compoments/baseMenuTree.vue'
export default { export default {
data() { data() {
return { return {
treeObj: { treeObj: {
label: "", label: '',
upId: "" upId: ''
}, },
sendDist: { sendDist: {
"1": "发送成功", '1': '发送成功',
"2": "发送中", '2': '发送中',
"3": "发送失败", '3': '发送失败',
"4": "未发送" '4': '未发送'
}, },
sendShow: false,//dialog sendShow: false,//dialog
sendTableColumn: [ sendTableColumn: [
{ {
id: 'name', id: 'name',
title: "应用" title: '应用'
}, },
{ {
id: 'status', id: 'status',
title: "状态" title: '状态'
}, },
{ {
id: 'msg', id: 'msg',
title: "信息" title: '信息'
}, },
{ {
id: "fun", id: 'fun',
title: "操作" title: '操作'
} }
], ],
@ -167,11 +212,41 @@ export default {
searchForm: {}, searchForm: {},
searchLoading: false, searchLoading: false,
// //
searchButton: [], searchButton: [
mainTableName: "", {
'buttonType': 'new',
'buttonName': '新建'
},
{
'buttonType': 'resize',
'buttonName': '重置'
},
{
'buttonType': 'search',
'buttonName': '查询'
}
],
mainTableName: '',
// //
mainLoading: false, mainLoading: false,
mainFunData: [], mainFunData: [
{
'text': '修改',
'type': 'edit'
},
{
'text': '删除',
'type': 'dele'
},
{
'text': '查看',
'type': 'view'
},
{
'text': '下发',
'type': 'send'
}
],
mainActiveRow: {}, mainActiveRow: {},
mainTabLoading: false, mainTabLoading: false,
tableData: [], tableData: [],
@ -180,7 +255,7 @@ export default {
pageModel: { pageModel: {
total: 0, total: 0,
pageIndex: 1, pageIndex: 1,
limit: 10, limit: 10
}, },
//dialog //dialog
dialogShow: false, dialogShow: false,
@ -190,26 +265,48 @@ export default {
lookFlag: false, lookFlag: false,
newFlag: false, newFlag: false,
dialogTabaleInfo: [], dialogTabaleInfo: [],
dialogfunData: [{text: "删除", type: "dele", color: 'red'}], dialogfunData: [{ text: '删除', type: 'dele', color: 'red' }],
dialogTableLoading: false, dialogTableLoading: false,
dialogFormName: "", dialogFormName: '',
// //
treeProps: { treeProps: {
children: "children", children: 'children',
label: "label", label: 'label'
}, },
treeData: [], treeData: [],
treeActiveRow: {}, treeActiveRow: {},
treeSelectInfo: {}, treeSelectInfo: {},
data_status_dist: {
'Y': '正常',
'F': '修改',
'N': '删除'
},
sendCheckboxList: '',//
sendCheckboxType: '',
sendTableTypeOptions: [
{
id: 1,
name: '新增'
},
{
id: 2,
name: '修改'
},
{
id: 3,
name: '删除'
}
],
rowId: ''
} }
}, },
methods: { methods: {
async init() { async init() {
this.mainLoading = true this.mainLoading = true
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryMdmShow", dj: 'queryMdmShow'
}, { mdmCode: this.$route.meta.mdmCode }) }, { mdmCode: this.$route.meta.mdmCode })
// //
if (this.$route.query.viewType === '1') { if (this.$route.query.viewType === '1') {
@ -225,27 +322,36 @@ export default {
}) })
}) })
this.searchFormRow = [] this.searchFormRow = []
res.attribute.queryList.forEach((item) => {
item.id = item.dbName + '.' + item.id
})
this.baseFormRowDispose(res.attribute.queryList, this.searchFormRow) this.baseFormRowDispose(res.attribute.queryList, this.searchFormRow)
console.log(res.attribute.queryList, 'this.searchFormRow')
// //
let funDataBtn = { let funDataBtn = {
edit: true, edit: true,
view: true, view: true,
dele: true, dele: true,
send: true, send: true
} }
this.searchButton = [] // v3
this.mainFunData = [] // this.searchButton = []
res.attribute.buttonList.forEach(item => { // this.mainFunData = []
if (funDataBtn[item.buttonType]) { // res.attribute.buttonList.forEach(item => {
this.mainFunData.push({ // if (funDataBtn[item.buttonType]) {
text: item.buttonName, // this.mainFunData.push({
type: item.buttonType // text: item.buttonName,
}) // type: item.buttonType
} else { // })
this.searchButton.push(item) // console.log(this.mainFunData, 'this.mainFunData')
} // } else {
}) // this.searchButton.push(item)
// console.log(this.searchButton, 'this.searchButton')
// }
// })
// //
console.log(res, 'res')
//tableColumn
res.attribute.listList.forEach(item => { res.attribute.listList.forEach(item => {
this.mainTableName = item.dbName this.mainTableName = item.dbName
item.ruleList.forEach(ele => { item.ruleList.forEach(ele => {
@ -260,9 +366,9 @@ export default {
async initTree(label, upId, obj = {}) { async initTree(label, upId, obj = {}) {
if (this.$route.query.viewType !== '1') return if (this.$route.query.viewType !== '1') return
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryMdmShowTreeData", dj: 'queryMdmShowTreeData'
}, { }, {
mdmCode: this.$route.meta.mdmCode, mdmCode: this.$route.meta.mdmCode,
label, label,
@ -276,9 +382,9 @@ export default {
async initTableData(name, obj = {}) { async initTableData(name, obj = {}) {
this.mainTabLoading = true this.mainTabLoading = true
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryMdmShowData", dj: 'queryMdmShowData'
}, { }, {
pageNum: this.pageModel.pageIndex, pageNum: this.pageModel.pageIndex,
pageSize: this.pageModel.limit, pageSize: this.pageModel.limit,
@ -292,21 +398,21 @@ export default {
// row // row
baseFormRowDispose(arr, resultArr) { baseFormRowDispose(arr, resultArr) {
let searchSpan = 0 let searchSpan = 0
let tempArr = []; let tempArr = []
arr.forEach(item => { arr.forEach(item => {
let spanNum = item.row * 1 || 12; let spanNum = item.row * 1 || 12
searchSpan += spanNum; searchSpan += spanNum
if (searchSpan > 24) { if (searchSpan > 24) {
resultArr.push({elCol: tempArr}); resultArr.push({ elCol: tempArr })
searchSpan = spanNum; searchSpan = spanNum
tempArr = []; tempArr = []
tempArr.push(item); tempArr.push(item)
} else { } else {
tempArr.push(item); tempArr.push(item)
} }
}) })
if (tempArr.length) { if (tempArr.length) {
resultArr.push({elCol: tempArr}); resultArr.push({ elCol: tempArr })
} }
}, },
// //
@ -324,8 +430,8 @@ export default {
// //
// //
selectValueGeTHandle(item, row, data) { selectValueGeTHandle(item, row, data) {
this.$set(this.tableData[row.index], item.id, data); this.$set(this.tableData[row.index], item.id, data)
this.$set(this.tableData[row.index], "selectflag", true); this.$set(this.tableData[row.index], 'selectflag', true)
}, },
// //
async tableButtonHandle(row, item) { async tableButtonHandle(row, item) {
@ -334,27 +440,27 @@ export default {
} else if (item.type === 'view') { } else if (item.type === 'view') {
this.viewDIalogHandle(row.id) this.viewDIalogHandle(row.id)
} else if (item.type === 'dele') { } else if (item.type === 'dele') {
this.$confirm("是否删除此行?", "提示", { this.$confirm('是否删除此行?', '提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning'
}) })
.then(() => { .then(() => {
this.deleRowHanlde(row.id) this.deleRowHanlde(row.id)
}) })
.catch((error) => { .catch((error) => {
}); })
} else if (item.type === 'send') { } else if (item.type === 'send') {
this.sendHandle(row.id) this.sendHandle(row.id)
} }
}, },
// //
currentChangeHandle(pageModel) { currentChangeHandle(pageModel) {
this.pageModel = pageModel; this.pageModel = pageModel
this.$nextTick(() => { this.$nextTick(() => {
this.searchHandle() this.searchHandle()
}); })
}, },
//dialog //dialog
async onSubmitHandele() { async onSubmitHandele() {
@ -369,13 +475,13 @@ export default {
params.data[item.name] = item.tableData.slice(0, -1) params.data[item.name] = item.tableData.slice(0, -1)
}) })
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "saveMdmShowDetailsData", dj: 'saveMdmShowDetailsData'
}, params) }, params)
if (res.status === '200') { if (res.status === '200') {
this.initTree(this.treeObj.label, this.treeObj.upId) this.initTree(this.treeObj.label, this.treeObj.upId)
this.$vmNews("新建成功", "success") this.$vmNews('新建成功', 'success')
this.searchHandle() this.searchHandle()
this.dialogShow = false this.dialogShow = false
} }
@ -390,13 +496,13 @@ export default {
params.data[item.name] = item.tableData.slice(0, -1) params.data[item.name] = item.tableData.slice(0, -1)
}) })
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "updateMdmShowDetailsData", dj: 'updateMdmShowDetailsData'
}, params) }, params)
if (res.status === '200') { if (res.status === '200') {
this.initTree(this.treeObj.label, this.treeObj.upId) this.initTree(this.treeObj.label, this.treeObj.upId)
this.$vmNews("修改成功", "success") this.$vmNews('修改成功', 'success')
this.searchHandle() this.searchHandle()
this.dialogShow = false this.dialogShow = false
} }
@ -404,24 +510,24 @@ export default {
}, },
dialogTableAddHandle(info, index) { dialogTableAddHandle(info, index) {
this.dialogTabaleInfo[index].tableData.push({}); this.dialogTabaleInfo[index].tableData.push({})
}, },
dialogTableDeleHandle(row, item, tableInfo, index) { dialogTableDeleHandle(row, item, tableInfo, index) {
if (item.type === "dele") { if (item.type === 'dele') {
this.$confirm("是否删除此行?", "提示", { this.$confirm('是否删除此行?', '提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning'
}) })
.then(() => { .then(() => {
this.dialogTabaleInfo[index].tableData.splice(row.index, 1); this.dialogTabaleInfo[index].tableData.splice(row.index, 1)
this.$message({ this.$message({
type: "success", type: 'success',
message: "删除成功!", message: '删除成功!'
}); })
}) })
.catch((error) => { .catch((error) => {
}); })
} }
}, },
//dialog //dialog
@ -434,17 +540,17 @@ export default {
this.newFlag = true this.newFlag = true
this.lookFlag = false this.lookFlag = false
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryMdmShowDetails" dj: 'queryMdmShowDetails'
}, { }, {
mdmCode: this.$route.meta.mdmCode, mdmCode: this.$route.meta.mdmCode,
showType: "3" showType: '3'
}) })
// //
res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds.forEach(item => { res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds.forEach(item => {
item.mdmModuleDbFiledsRules.forEach(ele => { item.mdmModuleDbFiledsRules.forEach(ele => {
if (ele.ruleCode === "required" || ele.ruleCode === "disabled") { if (ele.ruleCode === 'required' || ele.ruleCode === 'disabled') {
if (!ele.ruleValue) { if (!ele.ruleValue) {
item[ele.ruleCode] = false item[ele.ruleCode] = false
} else { } else {
@ -459,12 +565,13 @@ export default {
this.dialogFormName = res.attribute.mainMdmModuleDb.dbName this.dialogFormName = res.attribute.mainMdmModuleDb.dbName
this.formRow = [] this.formRow = []
this.baseFormRowDispose(res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds, this.formRow) this.baseFormRowDispose(res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds, this.formRow)
console.log(this.formRow, 'this.formRow')
// //
this.dialogTabaleInfo = [] this.dialogTabaleInfo = []
res.attribute.sublistMdmModuleDb.forEach(table => { res.attribute.sublistMdmModuleDb.forEach(table => {
table.sublistMdmModuleDbFileds.forEach(item => { table.sublistMdmModuleDbFileds.forEach(item => {
item.mdmModuleDbFiledsRules.forEach(ele => { item.mdmModuleDbFiledsRules.forEach(ele => {
if (ele.ruleCode === "required" || ele.ruleCode === "disabled") { if (ele.ruleCode === 'required' || ele.ruleCode === 'disabled') {
if (!ele.ruleValue) { if (!ele.ruleValue) {
item[ele.ruleCode] = false item[ele.ruleCode] = false
} else { } else {
@ -483,28 +590,33 @@ export default {
tableData: [{}], tableData: [{}],
detailFields: deepClone(table.sublistMdmModuleDbFileds), detailFields: deepClone(table.sublistMdmModuleDbFileds),
title: table.remark, title: table.remark,
name: table.dbName, name: table.dbName
} }
this.dialogTabaleInfo.push({ ...tempObj }) this.dialogTabaleInfo.push({ ...tempObj })
}) })
this.dialogShow = true this.dialogShow = true
}, },
searchHandle() { 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 = {} let obj = {}
this.searchFormRow.forEach(item => { this.searchFormRow.forEach(item => {
item.elCol.forEach(ele => { item.elCol.forEach(ele => {
if (this.searchForm[ele.enName]) { if (this.searchForm[ele.id]) {
if (obj[ele.dbName]) { if (obj[ele.dbName]) {
obj[ele.dbName].push({ obj[ele.dbName].push({
fields: ele.enName, fields: ele.enName,
fieldsType: ele.filedType, fieldsType: ele.filedType,
values: this.searchForm[ele.enName] values: this.searchForm[ele.id]
}) })
} else { } else {
obj[ele.dbName] = [{ obj[ele.dbName] = [{
fields: ele.enName, fields: ele.enName,
fieldsType: ele.filedType, fieldsType: ele.filedType,
values: this.searchForm[ele.enName] values: this.searchForm[ele.id]
}] }]
} }
} }
@ -512,7 +624,7 @@ export default {
}) })
let params = { let params = {
queryCondition: [], queryCondition: [],
detailQueryCondition: [], detailQueryCondition: []
} }
Object.keys(obj).forEach(key => { Object.keys(obj).forEach(key => {
if (key === this.mainTableName) { if (key === this.mainTableName) {
@ -527,7 +639,7 @@ export default {
}) })
if (this.treeActiveRow.id) { if (this.treeActiveRow.id) {
let obj = { let obj = {
fields: "id", fields: 'id',
values: this.treeActiveRow.arrId, values: this.treeActiveRow.arrId,
fieldsType: '5' fieldsType: '5'
} }
@ -541,16 +653,16 @@ export default {
this.lookFlag = false this.lookFlag = false
// //
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryMdmShowDetails" dj: 'queryMdmShowDetails'
}, { }, {
mdmCode: this.$route.meta.mdmCode, mdmCode: this.$route.meta.mdmCode,
showType: "4" showType: '4'
}) })
res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds.forEach(item => { res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds.forEach(item => {
item.mdmModuleDbFiledsRules.forEach(ele => { item.mdmModuleDbFiledsRules.forEach(ele => {
if (ele.ruleCode === "required" || ele.ruleCode === "disabled") { if (ele.ruleCode === 'required' || ele.ruleCode === 'disabled') {
if (!ele.ruleValue) { if (!ele.ruleValue) {
item[ele.ruleCode] = false item[ele.ruleCode] = false
} else { } else {
@ -560,7 +672,6 @@ export default {
item[ele.ruleCode] = ele.ruleValue item[ele.ruleCode] = ele.ruleValue
} }
item['id'] = item.enName item['id'] = item.enName
}) })
} }
@ -568,6 +679,7 @@ export default {
this.dialogFormName = res.attribute.mainMdmModuleDb.dbName this.dialogFormName = res.attribute.mainMdmModuleDb.dbName
this.formRow = [] this.formRow = []
this.baseFormRowDispose(res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds, this.formRow) this.baseFormRowDispose(res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds, this.formRow)
console.log(this.formRow, 'formRow')
// //
this.dialogTabaleInfo = [] this.dialogTabaleInfo = []
res.attribute.sublistMdmModuleDb.forEach(table => { res.attribute.sublistMdmModuleDb.forEach(table => {
@ -583,21 +695,25 @@ export default {
tableData: [{}], tableData: [{}],
detailFields: deepClone(table.sublistMdmModuleDbFileds), detailFields: deepClone(table.sublistMdmModuleDbFileds),
title: table.remark, title: table.remark,
name: table.dbName, name: table.dbName
} }
this.dialogTabaleInfo.push({ ...tempObj }) this.dialogTabaleInfo.push({ ...tempObj })
}) })
// //
const data = await getUserModuleApi({ const data = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryMdmShowDetailsData", dj: 'queryMdmShowDetailsData'
}, { }, {
mdmCode: this.$route.meta.mdmCode, mdmCode: this.$route.meta.mdmCode,
id: id id: id
}) })
if (data.status === '200') { if (data.status === '200') {
this.ruleForm = data.attribute[this.mainTableName] this.ruleForm = data.attribute[this.mainTableName]
console.log(this.ruleForm,
'123'
)
console.log(this.ruleForm, this.mainTableName, data.attribute, '123')
this.dialogTabaleInfo.forEach(table => { this.dialogTabaleInfo.forEach(table => {
table.tableData = [] table.tableData = []
table.tableData = data.attribute[table.name] table.tableData = data.attribute[table.name]
@ -612,16 +728,16 @@ export default {
this.lookFlag = true this.lookFlag = true
// //
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryMdmShowDetails" dj: 'queryMdmShowDetails'
}, { }, {
mdmCode: this.$route.meta.mdmCode, mdmCode: this.$route.meta.mdmCode,
showType: "5" showType: '5'
}) })
res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds.forEach(item => { res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds.forEach(item => {
item.mdmModuleDbFiledsRules.forEach(ele => { item.mdmModuleDbFiledsRules.forEach(ele => {
if (ele.ruleCode === "required" || ele.ruleCode === "disabled") { if (ele.ruleCode === 'required' || ele.ruleCode === 'disabled') {
if (!ele.ruleValue) { if (!ele.ruleValue) {
item[ele.ruleCode] = false item[ele.ruleCode] = false
} else { } else {
@ -651,15 +767,16 @@ export default {
tableData: [{}], tableData: [{}],
detailFields: deepClone(table.sublistMdmModuleDbFileds), detailFields: deepClone(table.sublistMdmModuleDbFileds),
title: table.remark, title: table.remark,
name: table.dbName, name: table.dbName
} }
this.dialogTabaleInfo.push({ ...tempObj }) this.dialogTabaleInfo.push({ ...tempObj })
}) })
console.log(this.dialogTabaleInfo, 'dialogTabaleInfo')
// //
const data = await getUserModuleApi({ const data = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "queryMdmShowDetailsData", dj: 'queryMdmShowDetailsData'
}, { }, {
mdmCode: this.$route.meta.mdmCode, mdmCode: this.$route.meta.mdmCode,
id: id id: id
@ -670,6 +787,7 @@ export default {
table.tableData = [] table.tableData = []
table.tableData = data.attribute[table.name] || [] table.tableData = data.attribute[table.name] || []
}) })
console.log(this.dialogTabaleInfo, 'dialogTabaleInfo')
} }
this.dialogShow = true this.dialogShow = true
} }
@ -677,15 +795,15 @@ export default {
// //
async deleRowHanlde(id) { async deleRowHanlde(id) {
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: 'mdmService',
dj: "deleteMdmShowDetailsData", dj: 'deleteMdmShowDetailsData'
}, { }, {
mdmCode: this.$route.meta.mdmCode, mdmCode: this.$route.meta.mdmCode,
id: id id: id
}) })
if (res.status === '200') { if (res.status === '200') {
this.$vmNews("删除成功!", "success") this.$vmNews('删除成功!', 'success')
this.searchHandle() this.searchHandle()
this.initTree(this.treeObj.label, this.treeObj.upId) this.initTree(this.treeObj.label, this.treeObj.upId)
} }
@ -697,13 +815,13 @@ export default {
if (data.children) { if (data.children) {
this.treeIdHandle(data.children, arrId) this.treeIdHandle(data.children, arrId)
} }
this.pageModel.pageIndex = 1; this.pageModel.pageIndex = 1
this.pageModel.total = 0; this.pageModel.total = 0
this.pageModel.limit = 10; this.pageModel.limit = 10
this.searchForm = {}; this.searchForm = {}
this.tableData = []; this.tableData = []
this.lookFlag = false; this.lookFlag = false
this.newFlag = false; this.newFlag = false
this.treeActiveRow = { ...data, arrId: arrId } this.treeActiveRow = { ...data, arrId: arrId }
this.searchHandle() this.searchHandle()
} }
@ -719,26 +837,32 @@ export default {
}, },
// //
async sendHandle(id) { async sendHandle(id) {
console.log(id)
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmModuleService',
as: "mdmService", as: '',
dj: "queryMdmShowDistribute" dj: 'queryMdmDistributeByMdmCode'
}, { }, {
mdmCode: this.$route.meta.mdmCode, mdmCode: this.$route.meta.mdmCode,
id: id 'enabledState': '1',//
'enabledType': '0'//
}) })
this.sendTableData = res.attribute this.sendTableData = res.attribute
console.log(this.sendTableData, 'this.sendTableData')
this.sendTableData.forEach(item => { this.sendTableData.forEach(item => {
this.$set(item, 'rowId', id) this.$set(item, 'rowId', id)
this.appSearch(item.appId, item) this.appSearch(item.appId, item)
}) })
this.rowId = id
this.sendCheckboxType = ''
this.sendCheckboxList = ''
this.sendShow = true this.sendShow = true
}, },
// //
async appSearch(id, row) { async appSearch(id, row) {
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "sysApplicationService", tl: 'sysApplicationService',
as: "application", as: 'application',
dj: 'getApp' dj: 'getApp'
}, { }, {
id: id id: id
@ -747,25 +871,29 @@ export default {
}, },
//dialog //dialog
async sendRowHandle(row) { async sendRowHandle(row) {
let status = row.status === '1' ? 1 : 2 // let status = row.status === '1' ? 1 : 2
if (row.status === '2') { // if (row.status === '2') {
this.$vmNews("发送中,请等待发送完成,再删除", 'warning') // this.$vmNews('', 'warning')
return // return
} // }
console.log(row) // console.log(row)
const res = await getUserModuleApi({ const res = await getUserModuleApi({
tl: "mdmService", tl: 'mdmService',
as: "mdmService", as: '',
dj: "doMdmDistribute", dj: 'doMdmDistribute'
}, { }, {
mdmCode: this.$route.meta.mdmCode, mdmCode: this.$route.meta.mdmCode,
appID: row.appId, id: this.rowId,
id: row.rowId, distributeId: this.sendCheckboxList,
dataType: status type: this.sendCheckboxType
}) })
this.$vmNews(`${res.msg}`, 'success') this.$vmNews(`${res.msg}`, 'success')
this.sendHandle(row.rowId) this.sendCheckboxList = ''
}, this.sendCheckboxType = ''
this.sendShow = false
this.rowId = ''
// this.sendHandle(row.rowId)
}
}, },
created() { created() {
this.init() this.init()
@ -782,9 +910,9 @@ export default {
, ,
computed: { computed: {
funWidth() { funWidth() {
return this.mainFunData.length * 70; return this.mainFunData.length * 70
} }
,
} }
, ,
watch: { watch: {

View File

@ -252,7 +252,7 @@ export default {
journalingType: this.journalingType, journalingType: this.journalingType,
apiName: val, apiName: val,
pageNum: this.pageModel.pageIndex, pageNum: this.pageModel.pageIndex,
pageSize: 10, pageSize: 100,
...obj, ...obj,
...this.tempObj, ...this.tempObj,
...this.apiBody, ...this.apiBody,

View File

@ -245,7 +245,7 @@ export default {
}, },
{ {
pageNum: index, pageNum: index,
pageSize: 10, pageSize: 100,
...obj, ...obj,
} }
); );

View File

@ -230,6 +230,7 @@ export default {
}, },
}, },
methods: { methods: {
//
clickFirst() { clickFirst() {
document.querySelectorAll(".is-focusable")[0].click(); document.querySelectorAll(".is-focusable")[0].click();
}, },
@ -374,7 +375,6 @@ export default {
}, },
// //
handleNodeClick(data,b,c) { handleNodeClick(data,b,c) {
console.log(data,b,c)
this.$emit("handleNodeClick", data); this.$emit("handleNodeClick", data);
}, },
}, },

View File

@ -824,7 +824,8 @@ export default {
color: #999; color: #999;
font-size: 13px; font-size: 13px;
display: block; display: block;
width: 180px; min-width: 80px;
max-width: 180px;
// text-align: left; // text-align: left;
} }

View File

@ -253,7 +253,7 @@ export default {
journalingType: this.journalingType, journalingType: this.journalingType,
names: val, names: val,
pageNum: this.pageModel.pageIndex, pageNum: this.pageModel.pageIndex,
pageSize: 10, pageSize: 100,
...obj, ...obj,
...this.tempObj, ...this.tempObj,
...this.apiBody, ...this.apiBody,

View File

@ -1,18 +1,30 @@
<template> <template>
<div> <div>
<base-layout ref="baseLayout" :buttonList="buttonList" @onFuncBtn="onFuncBtn" :querySwitch="true" <base-layout
:searchBtnList="searchBtnList" :searchList="requirementList" @search="handleSearchEvent" :isPage="true" ref="baseLayout"
@pageChange="handlePageChange" @onFuncSearchBtn="onFuncSearchBtn"> :buttonList="buttonList"
@onFuncBtn="onFuncBtn"
:querySwitch="true"
:searchList="requirementList"
@search="handleSearchEvent"
:isPage="true"
@pageChange="handlePageChange"
>
<div slot="main" slot-scope="{ tableHeight }"> <div slot="main" slot-scope="{ tableHeight }">
<base-table ref="baseTable" :showIndex="true" :funWidth="300" :funData="funData" @onFunc="onFunc" <base-table
:tabLoading.sync="tabLoading" :tableHeight="tableHeight" :tableData="tableData" ref="baseTable"
:fixedTable="'right'" :tableColumn="tableColumnData" :showSelect="true"> :showIndex="true"
<template v-slot:new_state="{ row }"> :funWidth="180"
<div style="width: 100%"> :funData="funData"
<span v-if="row.new_state == 'Y'" style="color: #67c23a">成功</span> @onFunc="onFunc"
<span v-else-if="row.new_state == 'H'" style="color: #67c23a">已处理</span> :tabLoading.sync="tabLoading"
<span v-else style="color: #f56c6c">失败</span> :tableHeight="tableHeight"
</div> :tableData="tableData"
:tableColumn="tableColumnData"
>
<template #taskStatus="{row}">
{{ taskStatusDist[row.taskStatus] }}
</template> </template>
</base-table> </base-table>
</div> </div>
@ -22,341 +34,197 @@
</template> </template>
<script> <script>
import baseLayout from "@/components/base/baseLayout"; import baseLayout from '@/components/base/baseLayout'
import baseTable from "@/components/base/baseTable"; import baseTable from '@/components/base/baseTable'
import rightDialog from "./rightDialog"; import rightDialog from './rightDialog.vue'
import configData from "./configData"; import { authApi } from '@/api/apis/auth'
import {
authApi
} from "@/api/apis/auth";
import { option } from "@/api/apis/detailData"
export default
{ export default {
components: { components: {
baseLayout, baseLayout,
baseTable, baseTable,
rightDialog, rightDialog
}, },
data() { data() {
return { return {
buttonList: [ buttonList: [
{ {
menuName: "刷新", menuName: '刷新',
icon: "el-icon-refresh", icon: 'el-icon-refresh',
btnFunction: "resetLoad", btnFunction: 'resetLoad'
}, }
], // ], //
searchBtnList: [
{
name: "批量推送",
btnFunction: "batchPush",
},
], //
requirementList: [ requirementList: [
{ {
placeholder: "任务名称", placeholder: '任务名称',
prop: "plugin_id", prop: 'taskName',
tag: "elSelect", tag: 'elInput'
options: [], }
optionValue: "pluginId",
optionLabel: "pluginName",
},
{
placeholder: "源系统编码",
prop: "root_app_bill",
tag: "elInput",
},
{
placeholder: "推送时间",
prop: "new_push_date",
tag: "elDatePicker",
valueFormat: "yyyy-MM-dd",
},
{
placeholder: "业务⽇期",
prop: "business_date",
tag: "elDatePicker",
valueFormat: "yyyy-MM-dd",
},
{
placeholder: "下游系统单号",
prop: "new_system_number",
tag: "elInput",
},
{
placeholder: "推送状态",
prop: "new_state",
tag: "elRadio",
options: [
{ label: "全部", value: "" },
{ label: "成功", value: "Y" },
{ label: "已处理", value: "H" },
{ label: "失败", value: "N" },
],
},
], //list ], //list
tabLoading: false, tabLoading: false,
tableColumnData: configData.tableColumnData, // tableColumnData: [
{
prop: 'taskName',
label: '任务名称'
},
{
prop: 'taskCode',
label: '任务编码'
},
{
prop: 'taskStatus',
label: '任务状态'
},
{
prop: 'startTime',
label: '当前任务开始时间'
},
{
prop: 'endTime',
label: '结束时间'
},
{
prop: 'diffTime',
label: '耗时'
}
], //
funData: [ funData: [
{ {
color: "#6a9af1", color: '#6a9af1',
text: "查看", text: '查看'
}, }
{
color: "#6a9af1",
text: "重新推送",
},
{
color: "#6a9af1",
text: "手工处理",
},
{
color: "#d67a74",
text: "删除",
},
], ],
tableData: [], // tableData: [], //
pageModel: { pageModel: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 100
}, },
queryModel: { queryModel: {
plugin_id: '', code: '',
root_app_bill: '', name: '',
new_push_date: '', classify: '',
business_date: '', productionCompany: ''
new_system_number: '',
new_state: 'N'
}, },
}; taskStatusDist: {
1: '执行中',
2: '执行成功',
3: '执行失败'
}
}
}, },
mounted() { mounted() {
this.$refs.baseLayout.getField("new_state", "N"); // this.queryProductClassfy();
this.queryProductClassfy(); this.GetProductionTableData()
this.GetProductionTableData();
}, },
methods: { methods: {
onCellClick(row) {
this.openLoading('detail')
this.$refs.rightDialog.openDialog('show', row)
},
// //
async GetProductionTableData() { async GetProductionTableData() {
this.tabLoading = true; this.tabLoading = true
const res = await option({ let param = {
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "queryPage",
}, {
...this.pageModel, ...this.pageModel,
...this.queryModel ...this.queryModel
})
this.tabLoading = false;
if (res.status == "200") {
this.tableData = res.attribute.list;
this.$refs.baseTable.setTableKey()
this.$refs.baseLayout.setPageTotal(res.attribute.total);
} }
}, let res = await authApi(
async queryProductClassfy() { 'integrationTaskLogService',
const res = await option({ '',
tl: "pluginService", 'queryEntityPage',
as: "plugins", '',
dj: "queryPlugins", param
}, {}) )
this.tabLoading = false
if (res.status == "200") { if (res.status == '200') {
this.requirementList[0].options = res.attribute; this.tableData = res.attribute.list
} this.$refs.baseLayout.setPageTotal(res.attribute.total)
},
//
handleSearchEvent() {
let data = this.$refs.baseLayout.ruleForm;
this.queryModel.plugin_id = data.plugin_id;
this.queryModel.root_app_bill = data.root_app_bill;
this.queryModel.new_push_date = data.new_push_date;
this.queryModel.business_date = data.business_date;
this.queryModel.new_system_number = data.new_system_number;
this.queryModel.new_state = data.new_state;
this.resetTable();
},
//
async batchPush() {
let data = ''
this.$refs.baseTable.$refs.elTable.selection.forEach(el => {
if (data == '') {
data = el.id
} else {
data += `,${el.id}`
}
});
if (data.length > 0) {
this.$confirm("确认重新推送吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.openLoading("submit");
this.rePushBatch(data)
})
.catch(() => {
this.$vmNews("取消操作", "info");
});
} else {
this.$vmNews("请选择需要推送的单据", "warning");
}
},
async rePushBatch(data) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "batchPush",
}, {
id: data
})
if (res.status == "200") {
this.$vmNews("批量推送成功", "success");
this.resetTable();
} }
}, },
// //
handlePageChange(val) { handlePageChange(val) {
this.pageModel.pageNum = val.pageIndex; this.pageModel.pageNum = val.pageIndex
this.pageModel.pageSize = val.pageSize; this.pageModel.pageSize = val.pageSize
this.GetProductionTableData(); this.GetProductionTableData()
}, },
// //
onFuncBtn(btn) { onFuncBtn(btn) {
this[btn.btnFunction](); this.onCellClick()
}, // this[btn.btnFunction]()
//
onFuncSearchBtn(btn) {
this[btn.btnFunction]();
}, },
// //
add() { add() {
this.$refs.rightDialog.openDialog("add"); this.$refs.rightDialog.openDialog('add')
}, },
// //
async onFunc(index, row) { onFunc(index, row, item) {
// //
if (index == 0) { if (item.text === '查看') {
this.openLoading("detail"); this.openLoading('detail')
this.$refs.rightDialog.openDialog("show", row); this.$refs.rightDialog.openDialog('show', row)
} }
// //
if (index == 1) { if (item.text === '编辑') {
this.$confirm("确认重新推送吗?", "提示", { this.openLoading('detail')
confirmButtonText: "确定", this.$refs.rightDialog.openDialog('edit', row)
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.openLoading("submit");
this.handleRePush(row);
})
.catch(() => {
this.$vmNews("取消操作", "info");
});
}
//
if (index == 2) {
this.$prompt("请填写旺店通或者NC的单据号方便以后排查", "提示", {
confirmButtonText: "提交",
cancelButtonText: "取消",
inputType: "textarea",
inputValidator: (value) => {
if (!value) {
return "请输入处理内容";
}
},
})
.then(({ value }) => {
this.openLoading("submit");
let params =
{
id: row.id,
processing_remarks: value,
}
;
this.updateManualProcess(params);
})
.catch(() => {
this.$message({
type: "info",
message: "取消操作",
});
});
} }
// //
if (index == 3) { if (item.text === '删除') {
this.$confirm("确认删除该内容吗?", "提示", { this.$delConfirm().then(() => {
confirmButtonText: "确定", this.openLoading('del')
cancelButtonText: "取消", this.productionDeleteById(row.id)
type: "warning",
}) })
.then(() => {
this.openLoading("del");
this.productionDeleteById(row.id);
})
.catch(() => {
this.$vmNews("取消操作", "info");
});
}
},
async handleRePush(row) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "repush",
}, {
id: row.id
})
if (res.status == "200") {
this.$vmNews("补推成功", "success");
this.resetTable();
} else if (res.status == "500") {
this.$message({
title: "补推失败",
showClose: true,
message: res.msg,
duration: 0,
type: "error",
});
this.resetTable();
}
},
async updateManualProcess(val) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "manualProcessing",
}, val)
if (res.status == "200") {
this.$vmNews("手工处理成功", "success");
this.resetTable();
} }
}, },
async productionDeleteById(id) { async productionDeleteById(id) {
const res = await option({ let param = {
tl: "integration_task_living_detailsService", id: id
as: "integrationTaskLog", }
dj: "deleteEntity", let res = await authApi(
}, { 'sysPlugArgService',
id 'integrationTaskService',
}) 'deletePlugArg',
if (res.status == "200") { '',
this.$vmNews("删除成功", "success"); param
this.resetTable(); )
if (res.status == '200') {
this.$vmNews('删除成功', 'success')
this.resetTable()
} }
}, },
// //
resetTable() { resetTable() {
this.pageModel.pageNum = 1; this.pageModel.pageNum = 1
this.$refs.baseLayout.pageClear(); this.$refs.baseLayout.pageClear()
this.GetProductionTableData(); this.GetProductionTableData()
}, },
//
handleSearchEvent() {
let data = this.$refs.baseLayout.ruleForm
this.queryModel = data
this.resetTable()
}, },
}; //
async queryProductClassfy() {
let params = {
tab_name: 'sys_product',
column_name: 'classify'
}
let res = await authApi(
'generalServiceImpl',
'dictionaryshop',
'selectDictionaryshop',
'',
params
)
if (res.status == '200') {
this.requirementList[2].options = res.attribute
}
}
}
}
</script> </script>
<style scoped> <style scoped>
@ -364,8 +232,4 @@ export default
color: #409eff; color: #409eff;
cursor: pointer; cursor: pointer;
} }
::v-deep .searchBox:nth-child(6) {
width: 250px !important;
}
</style> </style>

View File

@ -1,133 +1,317 @@
<template> <template>
<div> <div>
<base-right-dialog ref="baseRightDialog" :footerShow="true" :dialogVisible.sync="dialogVisible" <base-right-dialog
:title="dialogTitle + ' 集成产品清单'" @handleClose="handleDialogClose" :type="dialogType" :submitShow="submitShow" ref="baseRightDialog"
@handleConfirmClick="handleConfirmClick"> :footerShow="true"
<base-form ref="basicsForm" :formRow="formRow" :isFunBtn="false" :rules="basicsRules" class="dialog_form" :dialogVisible.sync="dialogVisible"
:spanWidth="`120px`" :loading="vLoading"></base-form> :title="dialogTitle + ' 集成任务日志'"
@handleClose="handleDialogClose"
:type="dialogType"
:submitShow="submitShow"
@handleConfirmClick="handleConfirmClick"
>
<base-form
ref="basicsForm"
:formRow="formRow"
:isFunBtn="false"
class="dialog_form"
:spanWidth="`120px`"
:loading="vLoading"
@onSelect="onSelect"
></base-form>
<!-- <el-button-->
<!-- style="width: 125px; margin: 20px 0"-->
<!-- @click="addVersionDialog"-->
<!-- icon="el-icon-plus"-->
<!-- :disabled="submitShow ? false : true"-->
<!-- v-if="submitShow"-->
<!-- >添加</el-button-->
<!-- >-->
<!-- <base-table-->
<!-- :border="true"-->
<!-- :showIndex="true"-->
<!-- :tableColumn="tableVersionColumn"-->
<!-- :tableData="tableVersionData"-->
<!-- :funWidth="80"-->
<!-- :funData="funData"-->
<!-- @onFunc="onFunc"-->
<!-- >-->
<!-- <template v-slot:argName="{ row }" >-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.argName}}</template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argName"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow || row.disabled"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argCode="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">-->
<!-- {{ row.argCode }}-->
<!-- </template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argCode"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argType="{ row }">-->
<!-- <div style="width: 100%">-->
<!--&lt;!&ndash; <el-radio-group v-model="row.argType" :disabled="!submitShow">&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="1">字符串</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="2">日期</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; </el-radio-group>&ndash;&gt;-->
<!-- <el-select v-model="row.argType" placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:remark="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.remark}}</template>-->
<!-- <el-input-->
<!-- v-model="row.remark"-->
<!-- clearable-->
<!-- type="text"-->
<!-- v-else-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- </base-table>-->
</base-right-dialog> </base-right-dialog>
</div> </div>
</template> </template>
<script> <script>
import baseRightDialog from "@/components/base/baseRightDialog"; import baseRightDialog from '@/components/base/baseRightDialog'
import baseForm from "@/components/base/baseNewForm"; import baseForm from '@/components/base/baseNewForm'
import baseTable from "@/components/base/baseTable"; import baseTable from '@/components/base/baseTable'
import configData from "./configData"; import { authApi } from '@/api/apis/auth'
import { authApi } from "@/api/apis/auth";
import { option } from "@/api/apis/detailData"
export default { export default {
components: { components: {
baseRightDialog, baseRightDialog,
baseForm, baseForm,
baseTable, baseTable
}, },
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
dialogTitle: "", dialogTitle: '',
dialogType: "", dialogType: '',
formRow: configData.formRow, formRow: [],
basicsRules: configData.basicsRules, basicsRules: [],
vLoading: false, vLoading: false,
newMarryOptions: [], newMarryOptions: [],
submitShow: true, submitShow: true,
loadingType: true, loadingType: true,
tableVersionData: [], tableVersionData: [],
tableVersionColumn: configData.tableVersionColumn, tableVersionColumn: [],
funData: [], funData: [],
isEdit: false isEdit: false,
}; select_dist: {},
options: [
{
label: '字符串',
value: '1'
},
{
label: '日期范围选择',
value: '2'
},
{
label: '年月',
value: '3'
},
{
label: '年月日',
value: '4'
},
{
label: '年月日时间',
value: '5'
}
]
}
},
mounted() {
this.initSelect()
}, },
mounted() { },
methods: { methods: {
//
async initSelect() {
let res = await authApi(
'pluginService',
'plugins',
'queryPluginsByType',
'',
{
'pluginType': '1'
}
)
if (res.status == 200) {
console.log(res.attribute)
res.attribute.forEach(item => {
this.$set(this.select_dist, item.pluginId, item)
})
this.formRow[0].elCol[0].options = res.attribute
}
},
//
onSelect(val, index, indexRow, obj) {
this.$set(this.$refs.basicsForm.ruleForm, 'plugName', this.select_dist[val]['pluginName'])
},
openDialog(type, row) { openDialog(type, row) {
// this.queryProductClassfy(); // this.queryProductClassfy();
this.formRow = configData.formRow; this.formRow = []
this.submitShow = true; this.submitShow = true
this.isEdit = false this.isEdit = false
this.funData = [ this.funData = [
{ {
color: "#ff0000", color: '#ff0000',
text: "删除", text: '删除'
} }
] ]
// //
if (type == "add") { if (type == 'add') {
this.dialogTitle = "新增"; this.dialogTitle = '新增'
this.dialogType = "add"; this.dialogType = 'add'
} }
// //
if (type == "edit") { if (type == 'edit') {
this.isEdit = true this.isEdit = true
this.dialogTitle = "编辑"; this.dialogTitle = '编辑'
this.dialogType = "edit"; this.dialogType = 'edit'
this.productGetById(row.id); this.productGetById(row.id)
} }
// //
if (type == "show") { if (type == 'show') {
this.funData = Object.assign([], []) this.funData = Object.assign([], [])
this.submitShow = false; this.submitShow = false
this.formRow = configData.formRowShow; this.formRow = [
this.dialogTitle = "查看"; {
this.dialogType = "show"; elCol: [
this.productGetById(row.id); {
} label: '任务编码',
this.dialogVisible = true; prop: 'taskCode',
tag: 'elInput',
disabled: true
}, },
async productGetById(id) { {
this.openLoading("detail"); label: '任务名称',
const res = await option({ prop: 'taskName',
tl: "integration_task_living_detailsService", tag: 'elInput',
as: "integrationTaskLog", disabled: true
dj: "queryEntity",
}, {
id
})
if (res.status == '200') {
this.$refs.basicsForm.incomingParameters(res.attribute);
} }
]
}, },
{
elCol: [
{
label: '任务状态',
prop: 'taskStatus',
tag: 'elRadio',
disabled: true,
options: [
{
label: '执行中',
value: '1'
},
{
label: '执行成功',
value: '2'
},
{
label: '执行失败',
value: '3'
}
],
span: 24
}
]
},
{
elCol: [
{
label: '当前任务开始时间',
prop: 'startTime',
tag: 'elInput',
disabled: true
},
{
label: '结束时间',
prop: 'endTime',
tag: 'elInput',
disabled: true
}
]
},
{
elCol: [
{
label: '耗时',
prop: 'diffTime',
tag: 'elInput',
disabled: true
},
{
label: '备注',
prop: 'remark',
tag: 'elInput',
disabled: true
}
]
}
]
this.dialogTitle = '查看'
this.dialogType = 'show'
this.productGetById(row.id)
}
this.dialogVisible = true
},
// //
// async productGetById(id) { async productGetById(id) {
// let params = { let params = {
// id: id, id: id
// }; }
// let res = await authApi( let res = await authApi(
// "sysProductService", 'integrationTaskLogService',
// "product", '',
// "queryProduct", 'getEntity',
// "", '',
// params params
// ); )
// if (res.status == "200") { if (res.status == '200') {
// this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.basicsForm.incomingParameters(res.attribute); this.$refs.basicsForm.incomingParameters(res.attribute)
// this.tableVersionData = res.attribute.sysPlugArgDetailEntityList
// let result = []; // let result = [];
// if (res.attribute.sysProductVersionList.length > 0) {
// res.attribute.sysProductVersionList.forEach((item) => {
// let obj = {
// id: item.id,
// versionNumber: item.versionNumber,
// versionDescription: item.versionDescription,
// disabled: true
// };
// result.push(obj);
// });
// }
// this.tableVersionData = Object.assign([], result); // this.tableVersionData = Object.assign([], result);
// }); })
// } }
// }, },
addVersionDialog() { addVersionDialog() {
let obj = { let obj = {
id: new Date().getTime().toString(), argName: '',
versionNumber: "", argCode: '',
versionDescription: "", argType: '1',
disabled: false remark: ''
}; }
this.tableVersionData.push(obj); this.tableVersionData.push(obj)
}, },
// //
onFunc(index, row) { onFunc(index, row) {
@ -135,99 +319,103 @@ export default {
this.$delConfirm().then(() => { this.$delConfirm().then(() => {
this.tableVersionData.forEach((item, itemIndex) => { this.tableVersionData.forEach((item, itemIndex) => {
if (item.id === row.id) { if (item.id === row.id) {
this.tableVersionData.splice(itemIndex, 1); this.tableVersionData.splice(itemIndex, 1)
} }
}); })
}); })
} }
}, },
// //
handleDialogClose() { handleDialogClose() {
this.tableVersionData = Object.assign([], []); this.tableVersionData = Object.assign([], [])
this.$refs.basicsForm.resetFields(); this.$refs.basicsForm.resetFields()
this.dialogVisible = false; this.dialogVisible = false
}, },
// //
handleConfirmClick() { handleConfirmClick() {
this.$refs.basicsForm.$refs["ruleForm"].validate((valid) => { this.$refs.basicsForm.$refs['ruleForm'].validate((valid) => {
if (!valid) { if (!valid) {
return; return
} else { } else {
if (!this.tableVersionData.length) {
this.$vmNews('请添加列表')
return
}
let flag = this.tableVersionData.some(item => {
if (!item.argName) {
this.$vmNews('请输入参数名称')
return true
}
if (!item.argCode) {
this.$vmNews('参数编码')
return true
}
})
if (flag) return
let params = { let params = {
...this.$refs.basicsForm.ruleForm, ...this.$refs.basicsForm.ruleForm,
sysProductVersionList: [], sysPlugArgDetailEntityList: this.tableVersionData
};
let result = [];
if (this.tableVersionData.length > 0) {
this.tableVersionData.forEach((item) => {
let obj = {
versionNumber: item.versionNumber,
versionDescription: item.versionDescription,
};
result.push(obj);
});
} }
params.sysProductVersionList = Object.assign([], result); if (this.dialogType == 'add') {
if (this.dialogType == "add") { this.openLoading('submit')
this.openLoading("submit"); this.productSaveDto(params)
this.productSaveDto(params);
} }
if (this.dialogType == "edit") { if (this.dialogType == 'edit') {
this.openLoading("submit"); this.openLoading('submit')
this.productUpdateDto(params); this.productUpdateDto(params)
} }
} }
}); })
}, },
// //
async productSaveDto(params) { async productSaveDto(params) {
let res = await authApi( let res = await authApi(
"sysProductService", 'sysPlugArgService',
"product", 'integrationTaskService',
"addProduct", 'savePlugArg',
"", '',
params params
); )
if (res.status == "200") { if (res.status == '200') {
this.handleDialogClose(); this.handleDialogClose()
this.$vmNews("新增成功", "success"); this.$vmNews('新增成功', 'success')
this.$emit("resetTable"); this.$emit('resetTable')
} }
}, },
// //
async productUpdateDto(params) { async productUpdateDto(params) {
let res = await authApi( let res = await authApi(
"sysProductService", 'sysPlugArgService',
"product", 'integrationTaskService',
"updateProduct", 'updatePlugArg',
"", '',
params params
); )
if (res.status == "200") { if (res.status == '200') {
this.handleDialogClose(); this.handleDialogClose()
this.$vmNews("更新成功", "success"); this.$vmNews('更新成功', 'success')
this.$emit("resetTable"); this.$emit('resetTable')
} }
}, },
// //
async queryProductClassfy() { async queryProductClassfy() {
let params = { let params = {
tab_name: "sys_product", tab_name: 'sys_product',
column_name: "classify", column_name: 'classify'
}; }
let res = await authApi( let res = await authApi(
"generalServiceImpl", 'generalServiceImpl',
"dictionaryshop", 'dictionaryshop',
"selectDictionaryshop", 'selectDictionaryshop',
"", '',
params params
); )
if (res.status == "200") { if (res.status == '200') {
this.formRow[1].elCol[0].options = res.attribute; this.formRow[1].elCol[0].options = res.attribute
}
}
}
} }
},
},
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -5,8 +5,8 @@
:menuData="treeData" :menuData="treeData"
:filterShow="true" :filterShow="true"
:Allshow="false" :Allshow="false"
:treeButton="true" :treeButton="false"
:filterButtonShow="true" :filterButtonShow="false"
style="height: 100%" style="height: 100%"
:treeProps="treeProps" :treeProps="treeProps"
@handleNodeClick="homeHandleNodeClick" @handleNodeClick="homeHandleNodeClick"
@ -49,9 +49,16 @@
:showIndex="true" :showIndex="true"
:tabLoading="mainTabLoading" :tabLoading="mainTabLoading"
@onFunc="tableButtonHandle" @onFunc="tableButtonHandle"
:tableHeight="'60vh'" :tableHeight="'53vh'"
:border="false" :border="false"
></BaseTable> >
<template #taskStatus="{row}">
{{ row.taskStatus == 1 ? '启用' : '停用' }}
</template>
<template #taskPlugin="{row}">
{{ pluginDist[row.taskPlugin] }}
</template>
</BaseTable>
</div> </div>
</main> </main>
<footer> <footer>
@ -91,12 +98,14 @@
</template> </template>
<script> <script>
import basePage from "./compoments/basePage.vue"; import basePage from './compoments/basePage.vue'
import BaseMenuTree from "./compoments/baseMenuTree"; import BaseMenuTree from './compoments/baseMenuTree'
import BaseNewForm from "./compoments/baseNewForm"; import BaseNewForm from './compoments/baseNewForm'
import BaseTable from "./compoments/baseTable"; import BaseTable from './compoments/baseTable'
import { getUserModuleApi } from "@/api/integrationOption/integrationOption.js"; import { getUserModuleApi } from '@/api/integrationOption/integrationOption.js'
import baseRightDialog from "@/components/base/baseRightDialog"; import baseRightDialog from '@/components/base/baseRightDialog'
import { authApi } from '@/api/apis/auth'
export default { export default {
data() { data() {
return { return {
@ -107,141 +116,177 @@ export default {
// //
pageIndex: 1, pageIndex: 1,
total: 10, total: 10,
limit: 10, limit: 10
}, },
mainTabLoading: false, //loding mainTabLoading: false, //loding
treeData: [ treeData: [
// //
{ {
label: "测试", label: '测试',
id: 1, id: 1,
children: [ children: [
{ {
id: 3, id: 3,
label: "哈哈", label: '哈哈'
}, }
]
}
], ],
}, treeForm: { class_name: '', class_superiors: '', class_code: '' },
],
treeForm: { class_name: "", class_superiors: "", class_code: "" },
searchForm: {}, // searchForm: {}, //
SearchformRow: [ SearchformRow: [
// //
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "任务编码", title: '任务编码',
id: "task_code", id: 'taskCode',
row: 8, row: 8
}, },
{ {
type: "input", type: 'input',
title: "任务名称", title: '任务名称',
id: "task_name", id: 'taskName',
row: 8
},
{
type: 'radio',
title: '任务状态',
id: 'taskStatus',
row: 8, row: 8,
options: [
{
label: '启用',
id: '1'
}, },
], {
}, label: '停用',
id: '2'
}
]
}
]
}
,
{
elCol: [
{
type: 'select',
title: '插件',
id: 'taskPlugin',
row: 8,
options: []
}
]
}
], ],
funData: [ funData: [
//table //table
{ {
type: "edit", type: 'edit',
text: "编辑", text: '编辑',
color: "#5a9cf8", color: '#5a9cf8'
}, },
{ {
type: "view", type: 'view',
text: "查看", text: '查看',
color: "#5a9cf8", color: '#5a9cf8'
}, },
{ {
type: "dele", type: 'start',
text: "删除", text: '启用',
color: "#e47470", color: '#5a9cf8'
}, },
{
type: 'stop',
text: '停用',
color: '#e47470'
},
{
type: 'dele',
text: '删除',
color: '#e47470'
}
], ],
tableData: [{ taskCode: "测试", taskName: "123" }], //table tableData: [], //table
tableColumn: [ tableColumn: [
// //
{ {
id: "task_code", id: 'taskName',
title: "任务编码", title: '任务名称'
}, },
{ {
id: "task_name", id: 'taskCode',
title: "任务名称", title: '任务编码'
}, },
{ {
id: "task_classes", id: 'taskStatus',
title: "任务分类", title: '任务状态'
}, },
{ {
id: "task_cron", id: 'taskPlugin',
title: "任务策略", title: '插件'
}, },
{ {
id: "fun_info", id: 'taskCron',
title: "功能介绍", title: '任务策略'
}, }
{
id: "remark",
title: "备注",
},
], ],
treeProps: { treeProps: {
children: "childClassifications", children: 'childClassifications',
label: "class_name", label: 'name'
}, },
treeTitle: "", treeTitle: '',
treeRuleForm: {}, treeRuleForm: {},
treeAddFlag: false, treeAddFlag: false,
}; appId: '',//id
pluginDist: {}//
}
}, },
methods: { methods: {
// dialog // dialog
async handleConfirmClick() { async handleConfirmClick() {
if (!this.treeRuleForm.class_name) { if (!this.treeRuleForm.class_name) {
this.$message({ this.$message({
type: "error", type: 'error',
message: "请输入树名称", message: '请输入树名称'
}); })
return; return
} }
if (this.treeAddFlag) { if (this.treeAddFlag) {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskClassificationService", tl: 'integrationTaskClassificationService',
as: "integrationTaskClassification", as: 'integrationTaskClassification',
dj: "saveTaskClassification", dj: 'saveTaskClassification'
}, },
this.treeRuleForm this.treeRuleForm
); )
if (res.status == 200) { if (res.status == 200) {
this.$message({ this.$message({
type: "success", type: 'success',
message: "保存成功", message: '保存成功'
}); })
this.rightDialogSwitch = false; this.rightDialogSwitch = false
this.initTreeData(); this.initTreeData()
} }
} else { } else {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskClassificationService", tl: 'integrationTaskClassificationService',
as: "integrationTaskClassification", as: 'integrationTaskClassification',
dj: "updateTaskClassification", dj: 'updateTaskClassification'
}, },
this.treeRuleForm this.treeRuleForm
); )
if (res.status == 200) { if (res.status == 200) {
this.$message({ this.$message({
type: "success", type: 'success',
message: "保存成功", message: '保存成功'
}); })
this.rightDialogSwitch = false; this.rightDialogSwitch = false
this.initTreeData(); this.initTreeData()
} }
} }
}, },
@ -249,184 +294,216 @@ export default {
async initTreeData() { async initTreeData() {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskClassificationService", tl: 'sysApplicationService',
as: "integrationTaskClassification", as: '',
dj: "queryTaskClassification", dj: 'queryEntity'
}, },
{} {}
); )
if (res.status == 200) { if (res.status == 200) {
this.treeData = res.attribute; this.treeData = res.attribute
this.$nextTick(() => {
this.$refs.menuTree.clickFirst()
})
} }
console.log(res, "🌲");
}, },
// //
treeAppendHandle(data) { treeAppendHandle(data) {
this.treeRuleForm = {}; this.treeRuleForm = {}
this.treeTitle = "子节点增加"; this.treeTitle = '子节点增加'
this.treeAddFlag = true; this.treeAddFlag = true
this.$set(this.treeRuleForm, "class_superiors_name", data.class_name); this.$set(this.treeRuleForm, 'class_superiors_name', data.class_name)
this.$set(this.treeRuleForm, "class_superiors", data.id); this.$set(this.treeRuleForm, 'class_superiors', data.id)
this.$set(this.treeRuleForm, "class_code", data.class_code); this.$set(this.treeRuleForm, 'class_code', data.class_code)
this.$set(this.treeRuleForm, "lvl", String(data.lvl * 1 + 1)); this.$set(this.treeRuleForm, 'lvl', String(data.lvl * 1 + 1))
this.rightDialogSwitch = true; this.rightDialogSwitch = true
}, },
treeReviseHandle(data) { treeReviseHandle(data) {
this.treeRuleForm = {}; this.treeRuleForm = {}
this.treeAddFlag = false; this.treeAddFlag = false
this.rightDialogSwitch = true; this.rightDialogSwitch = true
this.$set(this.treeRuleForm, "id", data.id); this.$set(this.treeRuleForm, 'id', data.id)
this.$set(this.treeRuleForm, "class_code", data.class_code); this.$set(this.treeRuleForm, 'class_code', data.class_code)
this.$set(this.treeRuleForm, "class_name", data.class_name); this.$set(this.treeRuleForm, 'class_name', data.class_name)
this.$set(this.treeRuleForm, "lvl", String(data.lvl)); this.$set(this.treeRuleForm, 'lvl', String(data.lvl))
this.treeTitle = "子节点编辑"; this.treeTitle = '子节点编辑'
}, },
treeRemoveHandle(data) { treeRemoveHandle(data) {
this.$confirm("确认删除?") this.$confirm('确认删除?')
.then(async() => { .then(async() => {
console.log(1);
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskClassificationService", tl: 'integrationTaskClassificationService',
as: "integrationTaskClassification", as: 'integrationTaskClassification',
dj: "updateTaskClassificationSts", dj: 'updateTaskClassificationSts'
}, },
{ {
id: data.id, //id id: data.id //id
} }
); )
console.log(res);
if (res.status == 200) { if (res.status == 200) {
this.$nextTick(() => { this.$nextTick(() => {
this.initTreeData(); this.initTreeData()
}); })
} }
}) })
.catch(() => {}); .catch(() => {
})
}, },
// //
treeAddHandle() { treeAddHandle() {
this.treeRuleForm = {}; this.treeRuleForm = {}
this.treeAddFlag = true; this.treeAddFlag = true
this.rightDialogSwitch = true; this.rightDialogSwitch = true
this.treeTitle = "根节点增加"; this.treeTitle = '根节点增加'
this.$set(this.treeRuleForm, "class_code", new Date().getTime()); this.$set(this.treeRuleForm, 'class_code', new Date().getTime())
this.$set(this.treeRuleForm, "lvl", "0"); this.$set(this.treeRuleForm, 'lvl', '0')
}, },
// //
async initTableData(obj = {}) { async initTableData(obj = {}) {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskService", tl: 'integrationTaskService',
as: "integrationTask", as: '',
dj: "queryListJson", dj: 'queryEntityPage'
}, },
{ {
pageNum: this.pageModel.pageIndex, pageNum: this.pageModel.pageIndex,
pageSize: this.pageModel.limit, pageSize: this.pageModel.limit,
query_condition: { ...obj }, task_app: this.appId,
...obj
} }
); )
console.log(res);
if (res.status == 200) { if (res.status == 200) {
this.tableData = res.attribute; this.tableData = res.attribute.list
this.pageModel.total = res.attribute.total
} }
}, },
// //
searchHandle() { searchHandle() {
this.initTableData({ ...this.searchForm }); this.initTableData({ ...this.searchForm })
}, },
// //
resizeSearchHandle() { resizeSearchHandle() {
this.searchForm = {}; this.searchForm = {}
}, },
// //
newPage() { newPage() {
this.$router.push({ name: "taskAdd" }); this.$router.push({ name: 'taskAdd' })
}, },
// //
homeHandleNodeClick(data) { homeHandleNodeClick(data) {
this.pageModel.pageIndex = 1; this.pageModel.pageIndex = 1
this.pageModel.total = 0; this.pageModel.total = 0
this.pageModel.limit = 10; this.pageModel.limit = 10
this.searchForm = {}; this.appId = data.id
this.tableData = []; this.searchForm = {}
this.lookFlag = false; this.tableData = []
this.newFlag = false; this.lookFlag = false
this.newFlag = false
//
this.plugSelectInit()
//
this.initTableData()
},
//
async plugSelectInit() {
const res = await authApi('sysApplicationPluginService', '', 'queryEntity', '', {
appId: this.appId
})
if (res.status === '200') {
this.pluginDist = {}
res.attribute.forEach(item => {
item.label = item.pluginName
this.$set(this.pluginDist, item.id, item.label)
})
this.SearchformRow[1].elCol[0].options = res.attribute
}
}, },
// //
currentChangeHandle(pageModel) { currentChangeHandle(pageModel) {
this.pageModel = pageModel; this.pageModel = pageModel
this.$nextTick(() => { this.$nextTick(() => {
this.initTableData({ ...this.searchForm }); this.initTableData({ ...this.searchForm })
}); })
}, },
// //
tableButtonHandle(val, item) { async tableButtonHandle(val, item) {
if (item.type === "view") { if (item.type === 'view') {
this.$router.push({ this.$router.push({
name: "taskAdd", name: 'taskAdd',
query: { id: val.id, lookFlag: true }, query: { id: val.id, lookFlag: true }
}); })
} else if (item.type === "dele") { } else if (item.type === 'dele') {
console.log(111); this.$confirm('确认删除?')
this.$confirm("确认删除?")
.then(async() => { .then(async() => {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskService", tl: 'integrationTaskService',
as: "integrationTask", as: '',
dj: "updateIntegrationTaskSts", dj: 'deleteEntity'
}, },
{ {
id: val.id, //id id: val.id //id
} }
); )
if (res.status == 200) { if (res.status == 200) {
if ( if (
this.pageModel.total - 1 + this.pageModel.limit <= this.pageModel.total - 1 + this.pageModel.limit <=
this.pageModel.pageIndex * this.pageModel.limit this.pageModel.pageIndex * this.pageModel.limit
) { ) {
this.pageModel.pageIndex--; this.pageModel.pageIndex--
} }
this.$nextTick(() => { this.$nextTick(() => {
this.initTableData({ ...this.searchForm }); this.$vmNews('删除成功', 'success')
}); this.initTableData({ ...this.searchForm })
})
} }
}) })
.catch((err) => { .catch((err) => {
console.log(err); })
}); } else if (item.type === 'edit') {
} else if (item.type === "edit") { this.$router.push({ name: 'taskAdd', query: { id: val.id } })
this.$router.push({ name: "taskAdd", query: { id: val.id } }); } else if (item.type === 'start') {
const res = await authApi('integrationTaskService', '', 'enableDisableEntity', '', {
'id': val.id,
'taskStatus': '1' //12
})
if (res.status === '200') {
this.$vmNews(res.msg, 'success')
this.initTableData()
}
} else if (item.type === 'stop') {
const res = await authApi('integrationTaskService', '', 'enableDisableEntity', '', {
'id': val.id,
'taskStatus': '2' //12
})
if (res.status === '200') {
this.$vmNews(res.msg, 'success')
this.initTableData()
}
}
} }
},
}, },
components: { components: {
BaseMenuTree, BaseMenuTree,
BaseNewForm, BaseNewForm,
BaseTable, BaseTable,
basePage, basePage,
baseRightDialog, baseRightDialog
},
computed: {
//
funWidth() {
return this.funData.length * 70;
},
}, },
mounted() { mounted() {
// this.$refs.menuTree.clickFirst(); // this.$refs.menuTree.clickFirst();
this.initTableData(); // this.initTableData()
this.initTreeData(); this.initTreeData()
}, },
computed: { computed: {
// //
funWidth() { funWidth() {
return this.funData.length * 70; return this.funData.length * 70
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -434,36 +511,45 @@ export default {
padding: 20px; padding: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
> .text { > .text {
flex: 1; flex: 1;
} }
> .input { > .input {
flex: 5; flex: 5;
} }
} }
.wraaap { .wraaap {
display: flex; display: flex;
.right { .right {
width: 85%; width: 85%;
margin-left: 20px; margin-left: 20px;
border-radius: 20px !important; border-radius: 20px !important;
} }
.left { .left {
border-radius: 20px; border-radius: 20px;
width: 15%; width: 15%;
background-color: #fff; background-color: #fff;
} }
.btn { .btn {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
main { main {
margin-top: 20px; margin-top: 20px;
border-radius: 20px; border-radius: 20px;
} }
footer { footer {
margin-top: 15px; margin-top: 15px;
} }
header { header {
border-radius: 20px; border-radius: 20px;
} }

View File

@ -0,0 +1,464 @@
<template>
<div>
<base-right-dialog
ref="baseRightDialog"
:footerShow="true"
:dialogVisible.sync="dialogVisible"
:title="dialogTitle + ' 集成任务监控'"
@handleClose="handleDialogClose"
:type="dialogType"
:submitShow="submitShow"
@handleConfirmClick="handleConfirmClick"
>
<base-form
ref="basicsForm"
:formRow="formRow"
:isFunBtn="false"
class="dialog_form"
:spanWidth="`120px`"
:loading="vLoading"
@onSelect="onSelect"
></base-form>
<!-- <el-button-->
<!-- style="width: 125px; margin: 20px 0"-->
<!-- @click="addVersionDialog"-->
<!-- icon="el-icon-plus"-->
<!-- :disabled="submitShow ? false : true"-->
<!-- v-if="submitShow"-->
<!-- >添加</el-button-->
<!-- >-->
<!-- <base-table-->
<!-- :border="true"-->
<!-- :showIndex="true"-->
<!-- :tableColumn="tableVersionColumn"-->
<!-- :tableData="tableVersionData"-->
<!-- :funWidth="80"-->
<!-- :funData="funData"-->
<!-- @onFunc="onFunc"-->
<!-- >-->
<!-- <template v-slot:argName="{ row }" >-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.argName}}</template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argName"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow || row.disabled"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argCode="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">-->
<!-- {{ row.argCode }}-->
<!-- </template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argCode"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argType="{ row }">-->
<!-- <div style="width: 100%">-->
<!--&lt;!&ndash; <el-radio-group v-model="row.argType" :disabled="!submitShow">&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="1">字符串</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="2">日期</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; </el-radio-group>&ndash;&gt;-->
<!-- <el-select v-model="row.argType" placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:remark="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.remark}}</template>-->
<!-- <el-input-->
<!-- v-model="row.remark"-->
<!-- clearable-->
<!-- type="text"-->
<!-- v-else-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- </base-table>-->
</base-right-dialog>
</div>
</template>
<script>
import baseRightDialog from "@/components/base/baseRightDialog";
import baseForm from "@/components/base/baseNewForm";
import baseTable from "@/components/base/baseTable";
import { authApi } from "@/api/apis/auth";
export default {
components: {
baseRightDialog,
baseForm,
baseTable,
},
data() {
return {
dialogVisible: false,
dialogTitle: "",
dialogType: "",
formRow: [],
basicsRules: [],
vLoading: false,
newMarryOptions: [],
submitShow: true,
loadingType: true,
tableVersionData: [],
tableVersionColumn: [],
funData: [],
isEdit: false,
select_dist:{},
options:[
{
label:"字符串",
value:"1"
},
{
label:"日期范围选择",
value:"2"
},
{
label:"年月",
value:"3"
},
{
label:"年月日",
value:"4"
},
{
label:"年月日时间",
value:"5"
},
]
};
},
mounted() {
this.initSelect()
},
methods: {
//
async initSelect(){
let res = await authApi(
"pluginService",
"plugins",
"queryPluginsByType",
"",
{
"pluginType": "1"
}
);
if(res.status == 200){
console.log(res.attribute)
res.attribute.forEach(item=>{
this.$set(this.select_dist,item.pluginId,item)
})
this.formRow[0].elCol[0].options = res.attribute
}
},
//
onSelect(val, index, indexRow, obj){
this.$set(this.$refs.basicsForm.ruleForm,'plugName',this.select_dist[val]['pluginName'])
},
openDialog(type, row) {
// this.queryProductClassfy();
this.formRow = [];
this.submitShow = true;
this.isEdit = false
this.funData = [
{
color: "#ff0000",
text: "删除",
}
]
//
if (type == "add") {
this.dialogTitle = "新增";
this.dialogType = "add";
}
//
if (type == "edit") {
this.isEdit = true
this.dialogTitle = "编辑";
this.dialogType = "edit";
this.productGetById(row.id);
}
//
if (type == "show") {
this.funData = Object.assign([],[])
this.submitShow = false;
this.formRow = [
{
elCol: [
{
label: "任务编码",
prop: "taskCode",
tag: "elInput",
disabled:true,
},
{
label: "任务名称",
prop: "taskName",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "任务状态",
prop: "taskStatus",
tag: "elRadio",
disabled:true,
options:[
{
label:"执行中",
value:'1'
},
{
label:"待执行",
value:'2'
},
{
label:"错误",
value:'3'
},
],
span:24,
},
],
},
{
elCol: [
{
label: "上次开始时间",
prop: "oldStartTime",
tag: "elInput",
disabled:true,
},
{
label: "当前任务开始时间",
prop: "startTime",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "结束时间",
prop: "endTime",
tag: "elInput",
disabled:true,
},
{
label: "耗时",
prop: "diffTime",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "运行次数",
prop: "`runNum",
tag: "elInput",
disabled:true,
},
],
},
];
this.dialogTitle = "查看";
this.dialogType = "show";
this.productGetById(row.id);
}
this.dialogVisible = true;
},
//
async productGetById(id) {
let params = {
id: id,
};
let res = await authApi(
"integrationTaskLivingService",
"",
"getEntity",
"",
params
);
if (res.status == "200") {
this.$nextTick(() => {
this.$refs.basicsForm.incomingParameters(res.attribute);
// this.tableVersionData = res.attribute.sysPlugArgDetailEntityList
// let result = [];
// this.tableVersionData = Object.assign([], result);
});
}
},
addVersionDialog() {
let obj = {
argName:"",
argCode:"",
argType:"1",
remark:"",
};
this.tableVersionData.push(obj);
},
//
onFunc(index, row) {
if (index == 0) {
this.$delConfirm().then(() => {
this.tableVersionData.forEach((item, itemIndex) => {
if (item.id === row.id) {
this.tableVersionData.splice(itemIndex, 1);
}
});
});
}
},
//
handleDialogClose() {
this.tableVersionData = Object.assign([], []);
this.$refs.basicsForm.resetFields();
this.dialogVisible = false;
},
//
handleConfirmClick() {
this.$refs.basicsForm.$refs["ruleForm"].validate((valid) => {
if (!valid) {
return;
} else {
if(!this.tableVersionData.length){
this.$vmNews("请添加列表")
return
}
let flag = this.tableVersionData.some(item=>{
if(!item.argName){
this.$vmNews("请输入参数名称")
return true
}
if(!item.argCode){
this.$vmNews("参数编码")
return true
}
})
if(flag) return
let params = {
...this.$refs.basicsForm.ruleForm,
sysPlugArgDetailEntityList: this.tableVersionData,
};
if (this.dialogType == "add") {
this.openLoading("submit");
this.productSaveDto(params);
}
if (this.dialogType == "edit") {
this.openLoading("submit");
this.productUpdateDto(params);
}
}
});
},
//
async productSaveDto(params) {
let res = await authApi(
"sysPlugArgService",
"integrationTaskService",
"savePlugArg",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("新增成功", "success");
this.$emit("resetTable");
}
},
//
async productUpdateDto(params) {
let res = await authApi(
"sysPlugArgService",
"integrationTaskService",
"updatePlugArg",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("更新成功", "success");
this.$emit("resetTable");
}
},
//
async queryProductClassfy() {
let params = {
tab_name: "sys_product",
column_name: "classify",
};
let res = await authApi(
"generalServiceImpl",
"dictionaryshop",
"selectDictionaryshop",
"",
params
);
if (res.status == "200") {
this.formRow[1].elCol[0].options = res.attribute;
}
},
},
};
</script>
<style scoped lang="scss">
.dialogList {
padding: 16px 0;
border-top: 1px solid #dcdfe6;
display: flex;
flex-direction: column;
}
.updateBtn {
border: 1px solid #ebedf1;
padding: 5px 0;
border-radius: 3px;
text-align: center;
font-size: 14px;
cursor: pointer;
width: 100px;
}
.updateBtn:hover {
color: #1890ff;
border-color: #badeff;
background-color: #e8f4ff;
}
::v-deep .el-table__body-wrapper.is-scrolling-none {
height: auto !important;
}
::v-deep .app-container {
height: auto !important;
}
</style>

View File

@ -0,0 +1,464 @@
<template>
<div>
<base-right-dialog
ref="baseRightDialog"
:footerShow="true"
:dialogVisible.sync="dialogVisible"
:title="dialogTitle + ' 集成任务监控'"
@handleClose="handleDialogClose"
:type="dialogType"
:submitShow="submitShow"
@handleConfirmClick="handleConfirmClick"
>
<base-form
ref="basicsForm"
:formRow="formRow"
:isFunBtn="false"
class="dialog_form"
:spanWidth="`120px`"
:loading="vLoading"
@onSelect="onSelect"
></base-form>
<!-- <el-button-->
<!-- style="width: 125px; margin: 20px 0"-->
<!-- @click="addVersionDialog"-->
<!-- icon="el-icon-plus"-->
<!-- :disabled="submitShow ? false : true"-->
<!-- v-if="submitShow"-->
<!-- >添加</el-button-->
<!-- >-->
<!-- <base-table-->
<!-- :border="true"-->
<!-- :showIndex="true"-->
<!-- :tableColumn="tableVersionColumn"-->
<!-- :tableData="tableVersionData"-->
<!-- :funWidth="80"-->
<!-- :funData="funData"-->
<!-- @onFunc="onFunc"-->
<!-- >-->
<!-- <template v-slot:argName="{ row }" >-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.argName}}</template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argName"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow || row.disabled"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argCode="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">-->
<!-- {{ row.argCode }}-->
<!-- </template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argCode"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argType="{ row }">-->
<!-- <div style="width: 100%">-->
<!--&lt;!&ndash; <el-radio-group v-model="row.argType" :disabled="!submitShow">&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="1">字符串</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="2">日期</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; </el-radio-group>&ndash;&gt;-->
<!-- <el-select v-model="row.argType" placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:remark="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.remark}}</template>-->
<!-- <el-input-->
<!-- v-model="row.remark"-->
<!-- clearable-->
<!-- type="text"-->
<!-- v-else-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- </base-table>-->
</base-right-dialog>
</div>
</template>
<script>
import baseRightDialog from "@/components/base/baseRightDialog";
import baseForm from "@/components/base/baseNewForm";
import baseTable from "@/components/base/baseTable";
import { authApi } from "@/api/apis/auth";
export default {
components: {
baseRightDialog,
baseForm,
baseTable,
},
data() {
return {
dialogVisible: false,
dialogTitle: "",
dialogType: "",
formRow: [],
basicsRules: [],
vLoading: false,
newMarryOptions: [],
submitShow: true,
loadingType: true,
tableVersionData: [],
tableVersionColumn: [],
funData: [],
isEdit: false,
select_dist:{},
options:[
{
label:"字符串",
value:"1"
},
{
label:"日期范围选择",
value:"2"
},
{
label:"年月",
value:"3"
},
{
label:"年月日",
value:"4"
},
{
label:"年月日时间",
value:"5"
},
]
};
},
mounted() {
this.initSelect()
},
methods: {
//
async initSelect(){
let res = await authApi(
"pluginService",
"plugins",
"queryPluginsByType",
"",
{
"pluginType": "1"
}
);
if(res.status == 200){
console.log(res.attribute)
res.attribute.forEach(item=>{
this.$set(this.select_dist,item.pluginId,item)
})
this.formRow[0].elCol[0].options = res.attribute
}
},
//
onSelect(val, index, indexRow, obj){
this.$set(this.$refs.basicsForm.ruleForm,'plugName',this.select_dist[val]['pluginName'])
},
openDialog(type, row) {
// this.queryProductClassfy();
this.formRow = [];
this.submitShow = true;
this.isEdit = false
this.funData = [
{
color: "#ff0000",
text: "删除",
}
]
//
if (type == "add") {
this.dialogTitle = "新增";
this.dialogType = "add";
}
//
if (type == "edit") {
this.isEdit = true
this.dialogTitle = "编辑";
this.dialogType = "edit";
this.productGetById(row.id);
}
//
if (type == "show") {
this.funData = Object.assign([],[])
this.submitShow = false;
this.formRow = [
{
elCol: [
{
label: "任务编码",
prop: "taskCode",
tag: "elInput",
disabled:true,
},
{
label: "任务名称",
prop: "taskName",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "任务状态",
prop: "taskStatus",
tag: "elRadio",
disabled:true,
options:[
{
label:"执行中",
value:'1'
},
{
label:"待执行",
value:'2'
},
{
label:"错误",
value:'3'
},
],
span:24,
},
],
},
{
elCol: [
{
label: "上次开始时间",
prop: "oldStartTime",
tag: "elInput",
disabled:true,
},
{
label: "当前任务开始时间",
prop: "startTime",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "结束时间",
prop: "endTime",
tag: "elInput",
disabled:true,
},
{
label: "耗时",
prop: "diffTime",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "运行次数",
prop: "runNum",
tag: "elInput",
disabled:true,
},
],
},
];
this.dialogTitle = "查看";
this.dialogType = "show";
this.productGetById(row.id);
}
this.dialogVisible = true;
},
//
async productGetById(id) {
let params = {
id: id,
};
let res = await authApi(
"integrationTaskLivingService",
"",
"getEntity",
"",
params
);
if (res.status == "200") {
this.$nextTick(() => {
this.$refs.basicsForm.incomingParameters(res.attribute);
// this.tableVersionData = res.attribute.sysPlugArgDetailEntityList
// let result = [];
// this.tableVersionData = Object.assign([], result);
});
}
},
addVersionDialog() {
let obj = {
argName:"",
argCode:"",
argType:"1",
remark:"",
};
this.tableVersionData.push(obj);
},
//
onFunc(index, row) {
if (index == 0) {
this.$delConfirm().then(() => {
this.tableVersionData.forEach((item, itemIndex) => {
if (item.id === row.id) {
this.tableVersionData.splice(itemIndex, 1);
}
});
});
}
},
//
handleDialogClose() {
this.tableVersionData = Object.assign([], []);
this.$refs.basicsForm.resetFields();
this.dialogVisible = false;
},
//
handleConfirmClick() {
this.$refs.basicsForm.$refs["ruleForm"].validate((valid) => {
if (!valid) {
return;
} else {
if(!this.tableVersionData.length){
this.$vmNews("请添加列表")
return
}
let flag = this.tableVersionData.some(item=>{
if(!item.argName){
this.$vmNews("请输入参数名称")
return true
}
if(!item.argCode){
this.$vmNews("参数编码")
return true
}
})
if(flag) return
let params = {
...this.$refs.basicsForm.ruleForm,
sysPlugArgDetailEntityList: this.tableVersionData,
};
if (this.dialogType == "add") {
this.openLoading("submit");
this.productSaveDto(params);
}
if (this.dialogType == "edit") {
this.openLoading("submit");
this.productUpdateDto(params);
}
}
});
},
//
async productSaveDto(params) {
let res = await authApi(
"sysPlugArgService",
"integrationTaskService",
"savePlugArg",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("新增成功", "success");
this.$emit("resetTable");
}
},
//
async productUpdateDto(params) {
let res = await authApi(
"sysPlugArgService",
"integrationTaskService",
"updatePlugArg",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("更新成功", "success");
this.$emit("resetTable");
}
},
//
async queryProductClassfy() {
let params = {
tab_name: "sys_product",
column_name: "classify",
};
let res = await authApi(
"generalServiceImpl",
"dictionaryshop",
"selectDictionaryshop",
"",
params
);
if (res.status == "200") {
this.formRow[1].elCol[0].options = res.attribute;
}
},
},
};
</script>
<style scoped lang="scss">
.dialogList {
padding: 16px 0;
border-top: 1px solid #dcdfe6;
display: flex;
flex-direction: column;
}
.updateBtn {
border: 1px solid #ebedf1;
padding: 5px 0;
border-radius: 3px;
text-align: center;
font-size: 14px;
cursor: pointer;
width: 100px;
}
.updateBtn:hover {
color: #1890ff;
border-color: #badeff;
background-color: #e8f4ff;
}
::v-deep .el-table__body-wrapper.is-scrolling-none {
height: auto !important;
}
::v-deep .app-container {
height: auto !important;
}
</style>

View File

@ -1,365 +1,234 @@
<template> <template>
<div class="monitoring"> <div>
<header> <base-layout
<div class="left"> ref="baseLayout"
<div class="title"> :buttonList="buttonList"
<h1>后台任务监控</h1> @onFuncBtn="onFuncBtn"
</div> :querySwitch="true"
<div class="search"> :searchList="requirementList"
<el-input @search="handleSearchEvent"
placeholder="任务名称" :isPage="true"
v-model="searchForm.task_name" @pageChange="handlePageChange"
@keyup.enter.native="submitsearchForm"
> >
<i slot="prefix" class="el-input__icon el-icon-search"></i> <div slot="main" slot-scope="{ tableHeight }">
</el-input> <base-table
</div> ref="baseTable"
</div>
<div class="right">
<el-button type="primary" @click="monPush" :loading="pushLoading"
>输出</el-button
>
<el-button
icon="el-icon-refresh"
:loading="refreshLoading"
@click="initMainTableData(searchForm)"
circle
></el-button>
</div>
</header>
<main>
<BaseTable
ref="mainTable"
:tableData="tableData"
:tableColumn="tableColumn"
:funData="funData"
:funWidth="funWidth"
:showIndex="true" :showIndex="true"
:tabLoading="mainTabLoading" :funWidth="180"
@onFunc="tableButtonHandle" :funData="funData"
:tableHeight="'70vh'" @onFunc="onFunc"
:border="false" :tabLoading.sync="tabLoading"
:tableHeight="tableHeight"
:tableData="tableData"
:tableColumn="tableColumnData"
> >
<template v-slot:sts="{ row }"> <template #taskStatus="{row}">
<div>{{ stsDict[row.sts] }}</div> {{ taskStatusDist[row.taskStatus] }}
</template> </template>
<template v-slot:task_tag="{ row }"> </base-table>
<baseNewSelect </div>
v-model="row.task_tag" </base-layout>
:searchApiInfo="task_tag_apiInfo.searchApiInfo" <right-dialog ref="rightDialog" @resetTable="resetTable"></right-dialog>
:searchKey="task_tag_apiInfo.searchKey"
:prop="task_tag_apiInfo.prop"
:lookflag="true"
></baseNewSelect>
</template>
<template v-slot:diff_time="{ row }">
<div>{{ getTimeHandler(row.diff_time) }}</div>
</template>
</BaseTable>
</main>
<footer>
<basePage
:pageModel="pageModel"
@update:pageModel="currentChangeHandle"
></basePage>
</footer>
</div> </div>
</template> </template>
<script> <script>
import basePage from "./compoments/basePage.vue"; import baseLayout from '@/components/base/baseLayout'
import BaseTable from "./compoments/baseTable.vue"; import baseTable from '@/components/base/baseTable'
import { getApiModuleApi, getExcelApi } from "@/api/apiChunks/index.js"; import rightDialog from './monRightDialog.vue'
import baseNewSelect from "./compoments/baseNewSelect.vue"; import { authApi } from '@/api/apis/auth'
export default { export default {
components: {
baseLayout,
baseTable,
rightDialog
},
data() { data() {
return { return {
refreshLoading: false, buttonList: [
pushLoading: false, {
task_tag_apiInfo: { menuName: '刷新',
searchApiInfo: { icon: 'el-icon-refresh',
tl: "apiReflectionService", btnFunction: 'resetLoad'
as: "sys_api_reflectionService", }
dj: "queryOneById", ], //
requirementList: [
{
placeholder: '任务名称',
prop: 'taskName',
tag: 'elInput'
}, },
searchKey: "id", ], //list
prop: { tabLoading: false,
id: "id", tableColumnData: [
label: "ref_name", {
prop: 'taskName',
label: '任务名称'
}, },
{
prop: 'taskCode',
label: '任务编码'
}, },
stsDict: { {
Y: "正常", prop: 'taskStatus',
N: "不正常", label: '任务状态'
}, },
searchForm: { {
task_name: "", prop: 'oldStartTime',
label: '上次开始时间'
}, },
mainTabLoading: false, {
prop: 'startTime',
label: '当前任务开始时间'
},
{
prop: 'runNum',
label: '运行次数'
}
], //
funData: [ funData: [
{ {
type: "execute", color: '#6a9af1',
text: "执行", text: '查看'
color: "#5a9cf8",
},
{
type: "hang_up",
text: "挂起",
color: "#5a9cf8",
},
{
type: "dele",
text: "删除",
color: "#e47470",
}, },
], ],
tableColumn: [ tableData: [], //
{
id: "task_name",
title: "任务名称",
},
{
id: "task_tag",
title: "任务场景",
tooltip: true,
},
{
id: "task_classes",
title: "类型",
},
{
id: "org_id",
title: "部署公司",
},
{
id: "sts",
title: "状态",
tooltip: true,
},
{
id: "plan_time",
title: "计划时间",
tooltip: true,
},
{
id: "diff_time",
title: "上次耗时",
},
{
id: "run_num",
title: "运行次数",
},
{
id: "server_name",
title: "服务器",
tooltip: true,
},
],
tableData: [],
pageModel: { pageModel: {
pageIndex: 1, pageNum: 1,
total: 10, pageSize: 100
limit: 10,
}, },
}; queryModel: {
code: '',
name: '',
classify: '',
productionCompany: ''
},
taskStatusDist: {
1: '执行中',
2: '待执行',
3: '错误'
}
}
},
mounted() {
// this.queryProductClassfy();
this.GetProductionTableData()
}, },
methods: { methods: {
// onCellClick(row) {
getTimeHandler(time) { this.openLoading('detail')
var days = parseInt(time / (1000 * 60 * 60 * 24)); this.$refs.rightDialog.openDialog('show', row)
var hours = parseInt((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = parseInt((time % (1000 * 60 * 60)) / (1000 * 60));
var seconds = (time % (1000 * 60)) / 1000;
return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
}, },
// //
async executeHandle(obj) { async GetProductionTableData() {
const res = await getApiModuleApi( this.tabLoading = true
{ let param = {
tl: "integrationTaskMonitoringService", ...this.pageModel,
as: "integrationTaskMonitoring", ...this.queryModel
dj: "updateTaskMonitoringCarryAndHang", }
}, let res = await authApi(
obj 'integrationTaskLivingService',
); '',
if (res.status == 200) { 'queryEntityPage',
this.$nextTick(() => { '',
this.initMainTableData(this.searchForm); param
}); )
return true; this.tabLoading = false
if (res.status == '200') {
this.tableData = res.attribute.list
this.$refs.baseLayout.setPageTotal(res.attribute.total)
} }
}, },
// excel //
async monPush() { handlePageChange(val) {
this.pushLoading = true; this.pageModel.pageNum = val.pageIndex
const res = await getExcelApi( this.pageModel.pageSize = val.pageSize
{ this.GetProductionTableData()
tl: "integrationTaskMonitoringService",
as: "integrationTaskMonitoring",
dj: "queryMonitoringExportation",
}, },
{ //
task_name: this.searchForm.task_name, onFuncBtn(btn) {
} this.onCellClick()
); // this[btn.btnFunction]()
this.pushLoading = false;
if (!res) {
this.$message({
type: "error",
message: "下载失败!",
});
} else {
let url = window.URL.createObjectURL(
new Blob([res], { type: "application/vnd.ms-excel" })
);
let fileName = "后台任务监控";
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", fileName + ".xlsx");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
}
}, },
// //
async initMainTableData(obj = {}) { add() {
this.refreshLoading = true; this.$refs.rightDialog.openDialog('add')
const res = await getApiModuleApi(
{
tl: "integrationTaskMonitoringService",
as: "integrationTaskMonitoring",
dj: "queryListJson",
}, },
{ //
pageNum: this.pageModel.pageIndex, onFunc(index, row, item) {
pageSize: this.pageModel.limit, //
...obj, if (item.text === '查看') {
this.openLoading('detail')
this.$refs.rightDialog.openDialog('show', row)
} }
); //
this.refreshLoading = false; if (item.text === '编辑') {
if (res.status == 200) { this.openLoading('detail')
this.tableData = res.attribute; this.$refs.rightDialog.openDialog('edit', row)
}
},
//
submitsearchForm() {
this.initMainTableData(this.searchForm);
},
//
tableButtonHandle(val, item) {
if (item.type === "execute") {
let obj = {
type: "1",
};
obj["task_id"] = val.task_id;
obj["task_code"] = val.task_code;
obj["task_name"] = val.task_name;
this.executeHandle(obj).then(() => {
this.$message({
type: "success",
message: "执行成功!",
});
});
} else if (item.type == "dele") {
this.$confirm("确认删除?")
.then(async () => {
console.log(111);
const res = await getApiModuleApi(
{
tl: "integrationTaskMonitoringService",
as: "integrationTaskMonitoring",
dj: "updateTaskMonitoringSts",
},
{ task_id: val.task_id }
);
console.log(res);
if (res.status == 200) {
if (
this.pageModel.total + this.pageModel.limit - 1 <=
this.pageModel.pageIndex * this.pageModel.limit
) {
this.pageModel.pageIndex--;
}
console.log("删除");
this.$nextTick(() => {
this.initMainTableData(this.searchForm);
});
} }
//
if (item.text === '删除') {
this.$delConfirm().then(() => {
this.openLoading('del')
this.productionDeleteById(row.id)
}) })
.catch(() => {});
} else if (item.type === "hang_up") {
let obj = {
type: "2",
};
obj["task_id"] = val.task_id;
obj["task_code"] = val.task_code;
obj["task_name"] = val.task_name;
this.executeHandle(obj).then(() => {
this.$message({
type: "success",
message: "挂起成功!",
});
});
} else if (item.type === "view") {
this.$router.push({
name: "sceneAdd",
query: { id: val.id, lookFlag: true },
});
} }
}, },
currentChangeHandle(pageModel) { async productionDeleteById(id) {
this.pageModel = pageModel; let param = {
this.$nextTick(() => { id: id
this.initMainTableData(this.searchForm); }
}); let res = await authApi(
'sysPlugArgService',
'integrationTaskService',
'deletePlugArg',
'',
param
)
if (res.status == '200') {
this.$vmNews('删除成功', 'success')
this.resetTable()
}
}, },
//
resetTable() {
this.pageModel.pageNum = 1
this.$refs.baseLayout.pageClear()
this.GetProductionTableData()
}, },
computed: { //
// handleSearchEvent() {
funWidth() { let data = this.$refs.baseLayout.ruleForm
return this.funData.length * 70; this.queryModel = data
this.resetTable()
}, },
}, //
components: { async queryProductClassfy() {
BaseTable, let params = {
basePage, tab_name: 'sys_product',
baseNewSelect, column_name: 'classify'
}, }
created() { let res = await authApi(
this.initMainTableData(); 'generalServiceImpl',
}, 'dictionaryshop',
}; 'selectDictionaryshop',
'',
params
)
if (res.status == '200') {
this.requirementList[2].options = res.attribute
}
}
}
}
</script> </script>
<style scoped lang='scss'> <style scoped>
.monitoring { .clickTitle {
width: 100%; color: #409eff;
header { cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
background-color: #fff;
border-radius: 20px;
.left {
align-items: center;
display: flex;
.search {
margin-left: 30px;
}
}
}
main {
padding: 20px;
height: 75vh;
border-radius: 20px;
background-color: #fff;
}
footer {
margin-top: 20px;
}
} }
</style> </style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,267 @@
/**
* @desc 集成任务日志明细
* @date 2024-01-11
*/
// 表头
const tableColumnData = [
{
label: '任务名称',
prop: 'plugin_name',
tooltip: true,
width: 300
},
{
label: '源系统编码',
prop: 'root_app_bill',
tooltip: true,
width: 200
},
{
label: '最新推送状态',
prop: 'new_state',
tooltip: true,
width: 200
},
{
label: '最新传输结果',
prop: 'new_transmit_info',
tooltip: true,
width: 600
},
{
label: '最新推送时间',
prop: 'new_push_date',
tooltip: true,
width: 300
},
{
label: '业务⽇期',
prop: 'business_date',
tooltip: true,
width: 200
},
{
label: '下游系统单号',
prop: 'new_system_number',
tooltip: true,
width: 200
},
{
label: '处理⼈',
prop: 'processor_name',
tooltip: true,
width: 300
},
{
label: '处理备注',
prop: 'processing_remarks',
tooltip: true,
width: 300
},
{
label: '处理时间',
prop: 'processing_time',
tooltip: true,
width: 200
},
]
const tableVersionColumn = [
{
label: '版本号',
prop: 'versionNumber',
},
{
label: '版本说明',
prop: 'versionDescription',
},
]
// 基本信息内容
const formRow = [
{
elCol: [{
label: '产品编码',
prop: 'code',
tag: 'elInput',
},{
label: '产品名称',
prop: 'name',
tag: 'elInput',
}]
},
{
elCol: [{
label: '产品分类',
prop: 'classify',
tag: 'elSelect',
options:[],
optionValue:'column_value',
optionLabel:'column_content',
span: 24
}]
},
{
elCol: [{
label: '产品简述',
prop: 'description',
tag: 'elInput',
type: 'textarea',
span: 24,
}]
},
{
elCol: [{
label: '出品公司',
prop: 'productionCompany',
tag: 'elInput',
span: 24,
}]
},
]
const basicsRules ={
code:[{
required: true,
message: '请输入产品编码',
trigger: 'blur'
}],
name:[{
required: true,
message: '请输入产品名称',
trigger: 'blur'
}],
classify:[{
required: true,
message: '请选择产品分类',
trigger: 'blur'
}],
productionCompany:[{
required: true,
message: '请输入出品公司',
trigger: 'blur'
}],
}
// 查看
const formRowShow = [
{
elCol: [{
label: '源系统主键',
prop: 'rootAppPk',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '源系统编码',
prop: 'rootAppBill',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '创建时间',
prop: 'createTime',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '最新推送状态',
prop: 'newState',
tag: 'elRadio',
options: [
{ label: '成功', value: 'Y' },
{ label: '已处理', value: 'H' },
{ label: '失败', value: 'N' },
],
disabled:true
}
]
},
{
elCol: [{
label: '最新传输结果',
prop: 'newTransmitInfo',
tag: 'elInput',
type: 'textarea',
disabled:true,
span: 24,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '最新元数据',
prop: 'rootAppNewData',
tag: 'elInput',
type: 'textarea',
disabled:true,
span: 24,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '最新推送时间',
prop: 'newPushDate',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '业务日期',
prop: 'businessDate',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '下游系统主键',
prop: 'newSystemNumber',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '下游系统单号',
prop: 'newSystemPrimary',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '处理人名称',
prop: 'processorName',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '处理时间',
prop: 'processingTime',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '处理备注 ',
prop: 'processingRemarks',
tag: 'elInput',
type: 'textarea',
span: 24,
disabled:true,
placeholder:"暂无数据"
}]
}
]
export default {
tableColumnData,
formRow,
basicsRules,
formRowShow,
tableVersionColumn
}

View File

@ -0,0 +1,376 @@
<template>
<div>
<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"
:tabLoading.sync="tabLoading" :tableHeight="tableHeight" :tableData="tableData"
:fixedTable="'right'" :tableColumn="tableColumnData" :showSelect="true"
>
<template v-slot:new_state="{ row }">
<div style="width: 100%">
<span v-if="row.new_state == 'Y'" style="color: #67c23a">成功</span>
<span v-else-if="row.new_state == 'H'" style="color: #67c23a">已处理</span>
<span v-else style="color: #f56c6c">失败</span>
</div>
</template>
</base-table>
</div>
</base-layout>
<right-dialog ref="rightDialog" @resetTable="resetTable"></right-dialog>
</div>
</template>
<script>
import baseLayout from '@/components/base/baseLayout'
import baseTable from '@/components/base/baseTable'
import rightDialog from './rightDialog'
import configData from './configData'
import {
authApi
} from '@/api/apis/auth'
import { option } from '@/api/apis/detailData'
export default {
components: {
baseLayout,
baseTable,
rightDialog
},
data() {
return {
buttonList: [
{
menuName: '刷新',
icon: 'el-icon-refresh',
btnFunction: 'resetLoad'
}
], //
searchBtnList: [
{
name: '批量推送',
btnFunction: 'batchPush'
}
], //
requirementList: [
{
placeholder: '任务名称',
prop: 'plugin_id',
tag: 'elSelect',
options: [],
optionValue: 'pluginId',
optionLabel: 'pluginName'
},
{
placeholder: '源系统编码',
prop: 'root_app_bill',
tag: 'elInput'
},
{
placeholder: '推送时间',
prop: 'new_push_date',
tag: 'elDatePicker',
valueFormat: 'yyyy-MM-dd'
},
{
placeholder: '业务⽇期',
prop: 'business_date',
tag: 'elDatePicker',
valueFormat: 'yyyy-MM-dd'
},
{
placeholder: '下游系统单号',
prop: 'new_system_number',
tag: 'elInput'
},
{
placeholder: '推送状态',
prop: 'new_state',
tag: 'elRadio',
options: [
{ label: '成功', value: 'Y' },
{ label: '已处理', value: 'H' },
{ label: '失败', value: 'N' }
]
}
], //list
tabLoading: false,
tableColumnData: configData.tableColumnData, //
funData: [
{
color: '#6a9af1',
text: '查看'
},
{
color: '#6a9af1',
text: '重新推送'
},
{
color: '#6a9af1',
text: '线下处理'
},
{
color: '#d67a74',
text: '删除'
}
],
tableData: [], //
pageModel: {
pageNum: 1,
pageSize: 10
},
queryModel: {
plugin_id: '',
root_app_bill: '',
new_push_date: '',
business_date: '',
new_system_number: '',
new_state: 'N'
}
}
},
mounted() {
this.$refs.baseLayout.getField('new_state', 'N')
this.queryProductClassfy()
this.GetProductionTableData()
},
methods: {
//
refresh(fun, form) {
console.log(form)
this.$set(form, 'new_state', 'Y')
},
//
async GetProductionTableData() {
this.tabLoading = true
const res = await option({
tl: 'integrationTaskLivingDetailsService',
as: 'integrationTaskLog',
dj: 'queryPage'
}, {
...this.pageModel,
...this.queryModel
})
this.tabLoading = false
if (res.status == '200') {
this.tableData = res.attribute.list
this.$refs.baseTable.setTableKey()
this.$refs.baseLayout.setPageTotal(res.attribute.total)
}
},
async queryProductClassfy() {
const res = await option({
tl: 'pluginService',
as: 'plugins',
dj: 'queryPlugins'
}, {})
if (res.status == '200') {
this.requirementList[0].options = res.attribute
}
},
//
handleSearchEvent() {
let data = this.$refs.baseLayout.ruleForm
this.queryModel.plugin_id = data.plugin_id
this.queryModel.root_app_bill = data.root_app_bill
this.queryModel.new_push_date = data.new_push_date
this.queryModel.business_date = data.business_date
this.queryModel.new_system_number = data.new_system_number
this.queryModel.new_state = data.new_state
this.resetTable()
},
//
async batchPush() {
let data = []
this.$refs.baseTable.$refs.elTable.selection.forEach(el => {
data.push(el)
})
if (data.length > 0) {
this.$confirm('确认重新推送吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.openLoading('submit')
this.rePushBatch(data)
})
.catch(() => {
this.$vmNews('取消操作', 'info')
})
} else {
this.$vmNews('请选择需要推送的单据', 'warning')
}
},
async rePushBatch(data) {
const res = await option({
tl: 'integrationTaskLivingDetailsService',
as: 'integrationTaskLog',
dj: 'batchPush'
},
data
)
if (res.status == '200') {
this.$vmNews('批量推送成功', 'success')
this.resetTable()
}
},
//
handlePageChange(val) {
this.pageModel.pageNum = val.pageIndex
this.pageModel.pageSize = val.pageSize
this.GetProductionTableData()
},
//
onFuncBtn(btn) {
this[btn.btnFunction]()
},
//
onFuncSearchBtn(btn) {
this[btn.btnFunction]()
},
//
add() {
this.$refs.rightDialog.openDialog('add')
},
//
async onFunc(index, row) {
//
if (index == 0) {
this.openLoading('detail')
this.$refs.rightDialog.openDialog('show', row)
}
//
if (index == 1) {
this.$confirm('确认重新推送吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.openLoading('submit')
this.handleRePush(row)
})
.catch(() => {
this.$vmNews('取消操作', 'info')
})
}
//
if (index == 2) {
this.$prompt('请填写线下单据号,方便以后排查', '提示', {
confirmButtonText: '提交',
cancelButtonText: '取消',
inputType: 'textarea',
inputValidator: (value) => {
if (!value) {
return '请输入处理内容'
}
}
})
.then(({ value }) => {
this.openLoading('submit')
let params =
{
id: row.id,
newState: row.new_state,
processing_remarks: value
}
this.updateManualProcess(params)
})
.catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
}
//
if (index == 3) {
this.$confirm('确认删除该内容吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.openLoading('del')
this.productionDeleteById(row)
})
.catch(() => {
this.$vmNews('取消操作', 'info')
})
}
},
async handleRePush(row) {
const res = await option({
tl: 'integrationTaskLivingDetailsService',
as: 'integrationTaskLog',
dj: 'repush'
}, {
id: row.id,
new_state: row.new_state
})
if (res.status == '200') {
this.$vmNews('补推成功', 'success')
this.resetTable()
} else if (res.status == '500') {
this.$message({
title: '补推失败',
showClose: true,
message: res.msg,
duration: 0,
type: 'error'
})
this.resetTable()
}
},
async updateManualProcess(val) {
const res = await option({
tl: 'integrationTaskLivingDetailsService',
as: 'integrationTaskLog',
dj: 'manualProcessing'
}, val)
if (res.status == '200') {
this.$vmNews('线下处理成功', 'success')
this.resetTable()
}
},
async productionDeleteById(row) {
const res = await option({
tl: 'integrationTaskLivingDetailsService',
as: 'integrationTaskLog',
dj: 'deleteEntity'
}, {
id: row.id,
newState: row.new_state
})
if (res.status == '200') {
this.$vmNews('删除成功', 'success')
this.resetTable()
}
},
//
resetTable() {
this.pageModel.pageNum = 1
this.$refs.baseLayout.pageClear()
this.GetProductionTableData()
}
}
}
</script>
<style scoped>
.clickTitle {
color: #409eff;
cursor: pointer;
}
::v-deep .searchBox:nth-child(6) {
width: 250px !important;
}
</style>

View File

@ -0,0 +1,270 @@
<template>
<div>
<base-right-dialog ref="baseRightDialog" :footerShow="true" :dialogVisible.sync="dialogVisible"
:title="dialogTitle + ' 集成产品清单'" @handleClose="handleDialogClose" :type="dialogType"
:submitShow="submitShow"
@handleConfirmClick="handleConfirmClick"
>
<base-form ref="basicsForm" :formRow="formRow" :isFunBtn="false" :rules="basicsRules" class="dialog_form"
:spanWidth="`120px`" :loading="vLoading"
></base-form>
</base-right-dialog>
</div>
</template>
<script>
import baseRightDialog from '@/components/base/baseRightDialog'
import baseForm from '@/components/base/baseNewForm'
import baseTable from '@/components/base/baseTable'
import configData from './configData'
import { authApi } from '@/api/apis/auth'
import { option } from '@/api/apis/detailData'
export default {
components: {
baseRightDialog,
baseForm,
baseTable
},
data() {
return {
dialogVisible: false,
dialogTitle: '',
dialogType: '',
formRow: configData.formRow,
basicsRules: configData.basicsRules,
vLoading: false,
newMarryOptions: [],
submitShow: true,
loadingType: true,
tableVersionData: [],
tableVersionColumn: configData.tableVersionColumn,
funData: [],
isEdit: false
}
},
mounted() {
},
methods: {
openDialog(type, row) {
// this.queryProductClassfy();
this.formRow = configData.formRow
this.submitShow = true
this.isEdit = false
this.funData = [
{
color: '#ff0000',
text: '删除'
}
]
//
if (type == 'add') {
this.dialogTitle = '新增'
this.dialogType = 'add'
}
//
if (type == 'edit') {
this.isEdit = true
this.dialogTitle = '编辑'
this.dialogType = 'edit'
this.productGetById(row)
}
//
if (type == 'show') {
this.funData = Object.assign([], [])
this.submitShow = false
this.formRow = configData.formRowShow
this.dialogTitle = '查看'
this.dialogType = 'show'
this.productGetById(row)
}
this.dialogVisible = true
},
async productGetById(row) {
this.openLoading('detail')
const res = await option({
tl: 'integrationTaskLivingDetailsService',
as: 'integrationTaskLog',
dj: 'queryEntity'
}, {
id: row.id,
new_state: row.new_state
})
if (res.status == '200') {
this.$refs.basicsForm.incomingParameters(res.attribute)
}
},
//
// async productGetById(id) {
// let params = {
// id: id,
// };
// let res = await authApi(
// "sysProductService",
// "product",
// "queryProduct",
// "",
// params
// );
// if (res.status == "200") {
// this.$nextTick(() => {
// this.$refs.basicsForm.incomingParameters(res.attribute);
// let result = [];
// if (res.attribute.sysProductVersionList.length > 0) {
// res.attribute.sysProductVersionList.forEach((item) => {
// let obj = {
// id: item.id,
// versionNumber: item.versionNumber,
// versionDescription: item.versionDescription,
// disabled: true
// };
// result.push(obj);
// });
// }
// this.tableVersionData = Object.assign([], result);
// });
// }
// },
addVersionDialog() {
let obj = {
id: new Date().getTime().toString(),
versionNumber: '',
versionDescription: '',
disabled: false
}
this.tableVersionData.push(obj)
},
//
onFunc(index, row) {
if (index == 0) {
this.$delConfirm().then(() => {
this.tableVersionData.forEach((item, itemIndex) => {
if (item.id === row.id) {
this.tableVersionData.splice(itemIndex, 1)
}
})
})
}
},
//
handleDialogClose() {
this.tableVersionData = Object.assign([], [])
this.$refs.basicsForm.resetFields()
this.dialogVisible = false
},
//
handleConfirmClick() {
this.$refs.basicsForm.$refs['ruleForm'].validate((valid) => {
if (!valid) {
return
} else {
let params = {
...this.$refs.basicsForm.ruleForm,
sysProductVersionList: []
}
let result = []
if (this.tableVersionData.length > 0) {
this.tableVersionData.forEach((item) => {
let obj = {
versionNumber: item.versionNumber,
versionDescription: item.versionDescription
}
result.push(obj)
})
}
params.sysProductVersionList = Object.assign([], result)
if (this.dialogType == 'add') {
this.openLoading('submit')
this.productSaveDto(params)
}
if (this.dialogType == 'edit') {
this.openLoading('submit')
this.productUpdateDto(params)
}
}
})
},
//
async productSaveDto(params) {
let res = await authApi(
'sysProductService',
'product',
'addProduct',
'',
params
)
if (res.status == '200') {
this.handleDialogClose()
this.$vmNews('新增成功', 'success')
this.$emit('resetTable')
}
},
//
async productUpdateDto(params) {
let res = await authApi(
'sysProductService',
'product',
'updateProduct',
'',
params
)
if (res.status == '200') {
this.handleDialogClose()
this.$vmNews('更新成功', 'success')
this.$emit('resetTable')
}
},
//
async queryProductClassfy() {
let params = {
tab_name: 'sys_product',
column_name: 'classify'
}
let res = await authApi(
'generalServiceImpl',
'dictionaryshop',
'selectDictionaryshop',
'',
params
)
if (res.status == '200') {
this.formRow[1].elCol[0].options = res.attribute
}
}
}
}
</script>
<style scoped lang="scss">
.dialogList {
padding: 16px 0;
border-top: 1px solid #dcdfe6;
display: flex;
flex-direction: column;
}
.updateBtn {
border: 1px solid #ebedf1;
padding: 5px 0;
border-radius: 3px;
text-align: center;
font-size: 14px;
cursor: pointer;
width: 100px;
}
.updateBtn:hover {
color: #1890ff;
border-color: #badeff;
background-color: #e8f4ff;
}
::v-deep .el-table__body-wrapper.is-scrolling-none {
height: auto !important;
}
::v-deep .app-container {
height: auto !important;
}
</style>

Some files were not shown because too many files have changed in this diff Show More