Commit 3e984269 by 闫泽浩

Merge branch 'development-202206' of http://114.115.138.98:8900/fukai/vue-gjjs…

Merge branch 'development-202206' of http://114.115.138.98:8900/fukai/vue-gjjs into development-202206
parents cc87a5e6 c4a6fe70
......@@ -4,8 +4,8 @@ export function queryByPage(data) {
return Api.post("/manager/swm/queryByPage", data)
}
export function queryById(inr) {
return Api.post(`/manager/swm/queryById?inr=${inr}`)
export function queryById(data) {
return Api.post(`/manager/swm/queryById`,data)
}
export function add(data) {
......@@ -16,6 +16,6 @@ export function edit(data) {
return Api.post("/manager/swm/edit", data)
}
export function deleteById(inr) {
return Api.post(`/manager/swm/deleteById?inr=${inr}`)
export function deleteById(data) {
return Api.post(`/manager/swm/deleteById`,data)
}
\ No newline at end of file
export default class Swm {
constructor() {
this.data = {
fmt: "",
mt: "",
frm: "",
tag: "",
subtag: "",
dst: "",
ins: "",
met: "",
cpyflg: "",
ovwflg: "",
dstgrp: "",
altmapflg: "",
num: "",
}
}
}
export const Pattern = {
"fmt": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 1, "message": "最大长度1个字符", "trigger": "blur" }
],
"mt": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 20, "message": "最大长度20个字符", "trigger": "blur" }
],
"frm": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 6, "message": "最大长度6个字符", "trigger": "blur" }
],
"tag": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 20, "message": "最大长度20个字符", "trigger": "blur" }
],
"subtag": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 6, "message": "最大长度6个字符", "trigger": "blur" }
],
"dst": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 60, "message": "最大长度60个字符", "trigger": "blur" }
],
"ins": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 8, "message": "最大长度8个字符", "trigger": "blur" }
],
"met": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 3, "message": "最大长度3个字符", "trigger": "blur" }
],
"cpyflg": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 1, "message": "最大长度1个字符", "trigger": "blur" }
],
"ovwflg": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 1, "message": "最大长度1个字符", "trigger": "blur" }
],
"dstgrp": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
{ "max": 6, "message": "最大长度6个字符", "trigger": "blur" }
],
"swm_idx": [
],
}
<template>
<div class="eibs-tab">
<c-col :span="12" class="col-left">
<c-col :span="24">
<el-form-item label="报文格式" prop="fmt">
<c-select v-model="model1.fmt" placeholder="请选择报文格式" :code="getCodesByKey('fmt')" style="width:100%">
</c-select>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="映射交易" prop="frm">
<c-input v-model="model1.frm" placeholder="请输入映射交易"> </c-input>
</el-form-item>
</c-col>
</c-col>
<c-col :span="12" class="col-right">
<c-col :span="24">
<el-form-item label="报文类型" prop="mt">
<c-select v-model="model1.mt" placeholder="请选择报文类型" :code="getCodesByKey('mt')" style="width:100%"></c-select>
</el-form-item>
</c-col>
</c-col>
<c-col :span="24">
<c-paging-table
:data="swmData"
:columns="swmColumns"
:pageNumber="model1.pageNum"
:pageSize="model1.pageSize"
:total="model1.total"
v-on:queryFunc="queryFunc"
:border="true"
>
</c-paging-table>
</c-col>
</div>
</template>
<script>
import codes from "~/config/CodeTable";
import { queryById, add, edit, deleteById } from "~/service/test/swm.js";
export default {
name: "",
props: {
swmModel:Array,
model1:Object
},
data() {
return {
swmData: [],
swmColumns: [
{ label: "报文元素", prop: "tag", width: "auto" },
{ label: "报文元素id", prop: "subtag", width: "auto" },
{ label: "映射模型组", prop: "dstgrp", width: "auto" },
{ label: "映射字段", prop: "ovwflg", width: "auto" },
{ label: "附加映射方法", prop: "met ", width: "auto" },
{ label: "指示", prop: "ins", width: "auto" }
],
};
},
methods:{
getCodesByKey(key) {
this.swmData=this.swmModel
return codes[key] ?? [];
},
queryFunc(pageNumber, pageSize) {
this.model1.pageNum = pageNumber;
this.model1.pageSize = pageSize;
queryById(this.model1).then((res) => {
const list = res.list;
this.swmModel=list;
console.log(list);
console.log(this.swmModel)
});
},
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="eContainer">
<c-page :title="title">
<el-form
ref="modelForm"
label-width="120px"
size="small"
label-position="right"
:model="model"
:rules="rules"
:validate-on-rule-change="false"
:disabled="isDisabled"
>
<c-tabs v-model="tabVal" ref="elment" type="card">
<el-tab-pane label="报文栏位映射信息详情" name="swm">
<c-content>
<m-swm-info :swmModel="swmModel" :model1="model1" />
</c-content>
</el-tab-pane>
</c-tabs>
</el-form>
<div style="text-align: center">
<c-button
type="primary"
style="margin-right: 10px"
@click="commitAdd"
v-if="type === 'add'"
>提 交</c-button
>
<c-button
type="primary"
style="margin-right: 10px"
@click="commitEdit"
v-if="type === 'edit'"
>提 交</c-button
>
<c-button
type="primary"
style="margin-right: 10px"
@click="commitDelete"
v-if="type === 'delete'"
>提 交</c-button
>
<c-button type="primary" @click="goBack">返 回</c-button>
</div>
</c-page>
</div>
</template>
<script>
import Utils from "~/utils";
import Swm, { Pattern } from "./Swm.js";
import SwmInfo from "./SwmInfo.vue";
import { queryById, add, edit, deleteById } from "~/service/test/swm.js";
export default {
name: "StaticsDbiSwm",
components: {
"m-swm-info": SwmInfo,
},
provide() {
return {
root: this,
};
},
props: {
type: {
type: String,
default: "info"
},
title: {
type: String,
default: "dbiswm"
}
},
data() {
return {
model: new Swm().data,
tabVal: "swm",
rules: Pattern,
model1:{
frm:'',
mt:'',
fmt:'',
pageNum: 1,
pageSize: 5,
total: 0,
},
swmModel:[]
};
},
computed: {
isDisabled() {
return this.type === "info" || this.type === "delete";
},
},
created() {
if (this.type !== "add") {
this.model1 = this.$route.params;
queryById(this.model1).then((res) => {
if (res.list.length!==0) {
this.swmModel = res.list;
this.model1.total=res.total
console.log("--------")
console.log(this.swmModel)
} else {
this.$message.error("信息不存在")
}
});
}
},
methods: {
commitAdd() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
add(this.model)
.then((res) => {
this.$message.success("保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("保存失败!");
});
} else {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
});
},
commitEdit() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
edit(this.model)
.then((res) => {
this.$message.success("保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("保存失败!");
});
} else {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
});
},
commitDelete() {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deleteById(this.model.inr)
.then((res) => {
this.$message.success("删除成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("删除失败!");
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
/**
* update 是否更新infswm的查询列表
*/
goBack(update) {
this.$store.dispatch("TagsView/delView", this.$route);
this.$router.push({ name: "StaticsInfswm", params: { update } });
},
},
};
</script>
<style>
</style>
\ No newline at end of file
......@@ -149,7 +149,6 @@ export default {
* totalPage: 0
*/
const list = res.list;
console.log(list);
this.swmData = list;
this.model.pageNum = res.pageNumber;
this.model.pageSize = res.pageSize;
......@@ -165,7 +164,7 @@ export default {
this.$router.push(`/statics/dbaswm`);
},
swmInfo(index, row) {
this.$router.push(`/statics/dbiswm/${row.inr}`);
this.$router.push({ name: "StaticsDbiswm", params: { mt: row.mt, fmt: row.fmt, frm: row.frm,pageSize: 5,pageNum: 1 } });
},
swmEdit(index, row) {
this.$router.push(`/statics/dbeswm/${row.inr}`);
......
......@@ -25,7 +25,7 @@
import Infsea from "./Infsea";
export default {
name: "StaticsInfswn",
name: "StaticsInfswm",
components: {
"m-infsea": Infsea,
},
......
......@@ -119,6 +119,7 @@ import Dbaety from "./Dbaety";
import Dbeety from "./Dbeety";
import Dbdety from "./Dbdety";
import Infswm from "./Infswm";
import Dbiswm from "./Dbiswm";
import Inftdh from "./Inftdh";
import Dbitdh from "./Dbitdh";
......@@ -272,7 +273,7 @@ const StaticsRouter = [
{ path: 'infswm', component: Infswm, name: 'StaticsInfswm', meta: { title: '报文栏位映射信息查询' } },
// { path: 'dbaswm', component: Dbaswm, name: 'StaticsDbaswm', meta: { title: '报文栏位映射信息新增' } },
// { path: 'dbiswm/:inr', component: Dbiswm, name: 'StaticsDbiswm', meta: { title: (tag) => { return '报文栏位映射信息详情: ' + tag.params.inr } } },
{ path: 'dbiswm', component: Dbiswm, name: 'StaticsDbiswm', meta: { title: '报文栏位映射信息详情: ' } },
// { path: 'dbeswm/:inr', component: Dbeswm, name: 'StaticsDbeswm', meta: { title: (tag) => { return '报文栏位映射信息修改: ' + tag.params.inr } } },
// { path: 'dbdswm/:inr', component: Dbdswm, name: 'StaticsDbdswm', meta: { title: (tag) => { return '报文栏位映射信息删除: ' + tag.params.inr } } },
{ path: 'inftdh', component: Inftdh, name: 'StaticsInftdh', meta: { title: '节假日查询' } },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment