jinhui.wang

通用方法合并,样式修正

......@@ -193,8 +193,8 @@ aside {
.el-table__body-wrapper {
&::-webkit-scrollbar {
height: 10px;
width: 10px;
height: 7px;
width: 7px;
}
&::-webkit-scrollbar-track {
......@@ -210,6 +210,13 @@ aside {
}
}
.el-scrollbar__wrap {
&::-webkit-scrollbar {
height: 0px;
width: 0px;
}
}
// 解决表格固定列问题
.el-table__fixed,
.el-table__fixed-right {
......
......@@ -9,7 +9,7 @@
<!-- 多选框 -->
<el-table-column v-if="selection" type="selection" width="50" align="center" :fixed="true"></el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="50" align="center" :index="indexAdd"></el-table-column>
<el-table-column v-if="order" type="index" width="50" align="center" :index="indexAdd"></el-table-column>
<template v-for="(item, index) in headerData">
<!-- 自定义插槽 -->
<el-table-column v-if="item.slot" :prop="item.value" :label="item.name" :width="item.width" :align="item.align"
......@@ -21,6 +21,17 @@
<slot :name="item.value" :row="scope.row"></slot>
</template>
</el-table-column>
<!-- 隐藏行 -->
<el-table-column v-else-if="item.expand" type="expand" :prop="item.value" :label="item.name" :index="item.index"
:width="item.width" :align="item.align" :fixed="item.fixed ? item.fixed : false"
:sortable="item.sorTable ? true : false" :column-key="index.toString()"
:show-overflow-tooltip="showOverflowTooltip" header-align="center"
:sort-orders="['descending', 'ascending', null]" :slotHeader="slotHeader" :render-header="renderHeader"
:formatter="formatter" :key="index">
<template slot-scope="scope">
<slot :name="item.value" :row="scope.row"></slot>
</template>
</el-table-column>
<!-- 默认数据 -->
<el-table-column v-else :prop="item.value" :label="item.name" :index="item.index" :width="item.width"
:align="item.align" :fixed="item.fixed ? item.fixed : false" :sortable="item.sorTable ? true : false"
......@@ -169,7 +180,19 @@ export default {
},
layout: {
type: String,
default: 'prev, pager, next, jumper, ->, sizes, total'
default: 'total,prev, pager, next, jumper, ->, sizes'
},
// treeProps: {
// type: Object,
// default: { children: 'children', hasChildren: 'hasChildren' }
// },
order: {
type: Boolean,
default: true
},
expand: {
type: Boolean,
default: false
}
},
inheritAttrs: false,
......@@ -192,7 +215,6 @@ export default {
// width: "",
// align: "center",
// sorTable: false,
// fixed:false,
// },
};
},
......@@ -353,6 +375,10 @@ export default {
cellClassName({ column, columnIndex }) {
return columnIndex - 1 === this.dragState.start ? `darg_start` : "";
},
//无限滚动
infiniteScroll() {
},
//数据格式化
formatter(row, column, cellValue, index) {
if (dictLabels[this.ductName]) {
......
......@@ -15,17 +15,13 @@ import i18n from './i18n/index'
import './assets/icons' // icon
import './permission' // permission control
//import { getDicts } from "@/api/system/dict/data";
//import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/FedEx";
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree, upCase, nowDate } from "@/utils/FedEx";
import Pagination from "@/components/Pagination";
// 自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar"
import Table from "@/components/Table"
// 全局方法挂载
//Vue.prototype.getDicts = getDicts
//Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
......@@ -33,11 +29,17 @@ Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.upCase = upCase
Vue.prototype.nowDate = nowDate
Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: "success" });
}
Vue.prototype.msgWarning = function (msg) {
this.$message({ showClose: true, message: msg, type: "warning" });
}
Vue.prototype.msgError = function (msg) {
this.$message({ showClose: true, message: msg, type: "error" });
}
......@@ -49,7 +51,7 @@ Vue.prototype.msgInfo = function (msg) {
// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('Tables',Table)
Vue.component('Tables', Table)
Vue.use(permission)
/**
......@@ -63,8 +65,7 @@ Vue.use(permission)
Vue.use(Element, {
//size: Cookies.get('size') || 'medium' // set element-ui default size
size: localStorage.getItem('size') || 'medium' // set element-ui default size
// size: localStorage.getItem('size') || 'medium' // set element-ui default size
})
Vue.config.productionTip = false
......
......@@ -11,8 +11,6 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
//baseURL: process.env.VUE_APP_BASE_API,
baseURL: settings.baseURL, //阿里云服务器
// baseURL: 'https://imacuat.zmd.apac.fedex.com/iMAC', //uat服务器
// baseURL: 'http://192.168.1.133:7001/iMAC', //测试服务器
// 超时
timeout: 30000
......
......@@ -561,10 +561,7 @@ export default {
this.selectData.HandlingCode = res.data.handlingCode;
this.selectData.SubCategory = res.data.subCategory;
} else {
this.$message({
message: "查询条件不存在",
type: "warning",
});
this.msgWarning('查询条件不存在')
}
})
.catch(() => { });
......@@ -574,10 +571,7 @@ export default {
if (res.code == 200) {
this.selectData.findConditionData = res.data;
} else {
this.$message({
message: "查询条件不存在",
type: "warning",
});
this.msgWarning('查询条件不存在')
}
})
.catch(() => { });
......@@ -601,16 +595,10 @@ export default {
// item.index = index;
// });
} else {
this.$message({
message: "未查询到数据",
type: "warning",
});
this.msgWarning('未查询到数据')
}
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch(() => {
......
......@@ -32,7 +32,7 @@
<script>
import { allocationFlight } from "@/api/cargoSelect";
import { MessageBox } from "element-ui";
export default {
props: {
dialogVisible: {
......@@ -109,14 +109,11 @@ export default {
this.loading = false;
//code 200 配舱成功 202 重量已满需要确认 其余code直接输出msg
if (res.code === 200) {
this.$message({
message: "货物配舱成功",
type: "success",
});
this.msgSuccess('货物配舱成功')
this.cleaerForm();
this.$emit("dialogBeforeClose", { close: false, reload: true });
} else if (res.code === 202) {
MessageBox.confirm(res.msg, "提示", {
this.$confirm(res.msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -125,15 +122,9 @@ export default {
this.formData.overweight = true; //确定继续overweight变为true再次请求接口
allocationFlight(this.formData).then((res) => {
if (res.code === 200) {
this.$message({
message: "货物配舱成功",
type: "success",
});
this.msgSuccess('货物配舱成功')
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
});
this.cleaerForm();
......@@ -141,10 +132,7 @@ export default {
})
.catch(() => {
//取消 取消当前配舱
this.$message({
message: "配舱已取消",
type: "success",
});
this.msgSuccess('配舱已取消')
this.cleaerForm();
this.$emit("dialogBeforeClose", {
close: false,
......@@ -153,20 +141,14 @@ export default {
});
} else {
this.loading = false;
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
}).catch(() => {
this.loading = false;
});
} else {
this.loading = false;
this.$message({
message: "航班号或航班日期不能为空",
type: "warning",
});
this.msgWarning("航班号或航班日期不能为空")
}
},
dialogBeforeClose() {
......@@ -191,7 +173,7 @@ export default {
return this.formData.fltNo;
},
set: function (val) {
this.formData.fltNo = val.toUpperCase();
this.formData.fltNo = this.upCase(val);
},
},
},
......
<template>
<div>
<el-form
:inline="true"
:model="queryParams"
class="form-header"
size="medium"
label-position="right"
label-width="auto"
>
<el-form :inline="true" :model="queryParams" class="form-header" size="medium" label-position="right"
label-width="auto">
<el-form-item label="航班号">
<el-input
v-model.trim="purposeOfFlightNo"
placeholder="航班号"
@keyup.enter.native="getList"
></el-input>
<el-input v-model.trim="purposeOfFlightNo" placeholder="航班号" @keyup.enter.native="getList"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="queryParams.status" placeholder="状态">
......@@ -22,32 +12,16 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="getList"
size="mini"
>查询</el-button
>
<el-button type="primary" icon="el-icon-search" @click="getList" size="mini">查询</el-button>
</el-form-item>
<div>
<el-button
style="margin-bottom: 20px"
type="primary"
icon="el-icon-plus"
size="mini"
<el-button style="margin-bottom: 20px" type="primary" icon="el-icon-plus" size="mini"
v-hasPermi="['allocation:alloc:add']"
@click="$router.push({ name: 'FlightAllocConfigAdd', params: { handle: 'add' } })"
>添加</el-button
>
@click="$router.push({ name: 'FlightAllocConfigAdd', params: { handle: 'add' } })">添加</el-button>
</div>
</el-form>
<el-table :data="flyList" v-loading="loading" size="small" highlight-current-row border stripe>
<el-table-column
prop="purposeOfFlightNo"
label="航班号"
align="center"
></el-table-column>
<el-table-column prop="purposeOfFlightNo" label="航班号" align="center"></el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
......@@ -66,62 +40,22 @@
<el-table-column label="操作" prop="id" align="center">
<template slot-scope="scope">
<el-button
type="text"
size="mini"
icon="el-icon-view"
@click="handleClick(scope.row.id, 'detail')"
>查看</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
v-hasPermi="['allocation:alloc:update']"
@click="handleClick(scope.row.id, 'update')"
>修改</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
v-hasPermi="['allocation:alloc:delete']"
@click="del(scope.row.id, scope.row.status)"
>删除</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-video-pause"
v-hasPermi="['allocation:alloc:openClose']"
@click="changeStatus(scope.row.id, 3)"
v-if="scope.row.status == '1'"
>停用</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-video-play"
v-hasPermi="['allocation:alloc:openClose']"
@click="changeStatus(scope.row.id, 1)"
v-else
>启用</el-button
>
<el-button type="text" size="mini" icon="el-icon-view" @click="handleClick(scope.row.id, 'detail')">查看
</el-button>
<el-button type="text" size="mini" icon="el-icon-edit" v-hasPermi="['allocation:alloc:update']"
@click="handleClick(scope.row.id, 'update')">修改</el-button>
<el-button type="text" size="mini" icon="el-icon-delete" v-hasPermi="['allocation:alloc:delete']"
@click="del(scope.row.id, scope.row.status)">删除</el-button>
<el-button type="text" size="mini" icon="el-icon-video-pause" v-hasPermi="['allocation:alloc:openClose']"
@click="changeStatus(scope.row.id, 3)" v-if="scope.row.status == '1'">停用</el-button>
<el-button type="text" size="mini" icon="el-icon-video-play" v-hasPermi="['allocation:alloc:openClose']"
@click="changeStatus(scope.row.id, 1)" v-else>启用</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="getList"
@current-change="getList"
:current-page.sync="curPage"
:page-sizes="[10, 20, 30, 40]"
:page-size.sync="limit"
layout="prev, pager, next, jumper, sizes, total"
:total="total"
background
:hide-on-single-page="true"
style="margin-top: 40px; text-align: right"
>
<el-pagination @size-change="getList" @current-change="getList" :current-page.sync="curPage"
:page-sizes="[10, 20, 30, 40]" :page-size.sync="limit" layout="prev, pager, next, jumper, sizes, total"
:total="total" background :hide-on-single-page="true" style="margin-top: 40px; text-align: right">
</el-pagination>
</div>
</template>
......@@ -133,12 +67,12 @@ import {
enableOrDisable,
} from "@/api/destinationFlight";
export default {
name:"FlightAllocConfig",
name: "FlightAllocConfig",
data() {
return {
queryParams: {
purposeOfFlightNo: "",
status:"1",
status: "1",
start: 0,
limit: 10,
},
......@@ -150,14 +84,14 @@ export default {
};
},
created() {
if(this.$store.state.tagsView.cachedViews.length == 0){
if (this.$store.state.tagsView.cachedViews.length == 0) {
this.getList();
}
},
activated(){
activated() {
this.getList()
},
deactivated(){
deactivated() {
this.flyList = []
},
methods: {
......@@ -171,11 +105,7 @@ export default {
this.loading = true;
findFlightNo(this.queryParams).then((response) => {
if (response.code != 200) {
this.$message({
showClose: true,
message: response.msg,
type: "error",
});
this.msgError(response.msg)
return;
}
this.flyList = response.data.list;
......@@ -205,16 +135,13 @@ export default {
showCancelButton: true,
type: "warning",
})
.then(()=> {
.then(() => {
delFlightId(id)
.then((res) => {
this.$message({
message: res.msg,
type: res.code === 200 ? "success" : "warning",
});
this.getList()
})
.catch(() => {});
.then((res) => {
res.code === 200 ? this.msgSuccess(res.msg) : this.msgWarning(res.msg)
this.getList()
})
.catch(() => { });
})
}
},
......@@ -226,8 +153,8 @@ export default {
cancelButtonText: "取消",
type: "warning",
})
.then(()=> {
enableOrDisable(id, status).then((res) => {
.then(() => {
enableOrDisable(id, status).then((res) => {
if (res.code != 200) {
this.msgError(res.msg);
} else {
......@@ -235,17 +162,17 @@ export default {
this.msgSuccess(tip + "成功");
}
})
.catch(()=> {});
.catch(() => { });
})
},
},
computed:{
computed: {
purposeOfFlightNo: {
get: function () {
return this.queryParams.purposeOfFlightNo;
},
set: function (val) {
this.queryParams.purposeOfFlightNo = val.toUpperCase()
this.queryParams.purposeOfFlightNo = this.upCase(val)
},
},
}
......
......@@ -48,12 +48,12 @@
<el-row :gutter="20">
<el-col :span="10">
<el-form-item label="URSA包含">
<el-input type="textarea" v-model.trim="form.includeUrsa" :rows="6" resize="none"></el-input>
<el-input type="textarea" v-model.trim="includeUrsa" :rows="6" resize="none"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="URSA不包含">
<el-input type="textarea" v-model.trim="form.notIncludeUrsa" :rows="6" resize="none"></el-input>
<el-input type="textarea" v-model.trim="notIncludeUrsa" :rows="6" resize="none"></el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -282,7 +282,7 @@ export default {
this.formSubCategory = this.form.subCategory;
this.form.isNeedRequired = this.isNeedRequired;
if (this.form.purposeOfFlightNo) {
this.form.purposeOfFlightNo = this.form.purposeOfFlightNo.toUpperCase();
this.form.purposeOfFlightNo = this.upCase(this.form.purposeOfFlightNo);
}
if (this.isLocation == 1) {
this.form.notLocation = "";
......@@ -319,32 +319,17 @@ export default {
}
});
if (errorList.length != 0) {
this.$message({
showClose: true,
message:
"URSA不包含中[" +
errorList +
"]错误,URSA不包含必须属于URSA包含中的类型",
type: "error",
});
this.msgError("URSA不包含中[" + errorList + "]错误,URSA不包含必须属于URSA包含中的类型")
this.btnLoading = false;
return;
}
}
updateOrAddFlight(this.form).then((response) => {
if (response.code === 200) {
this.$message({
showClose: true,
message: "成功",
type: "success",
});
this.msgSuccess('成功')
this.close();
} else {
this.$message({
showClose: true,
message: response.msg,
type: "error",
});
this.msgError(response.msg)
this.btnLoading = false;
}
});
......@@ -381,11 +366,7 @@ export default {
async dictData() {
allDictData().then((response) => {
if (response.code != 200) {
this.$message({
showClose: true,
message: response.msg,
type: "error",
});
this.msgError(response.msg)
return;
}
let dict = response.data;
......@@ -447,11 +428,7 @@ export default {
if (isNaN(Number(id))) {
findDestinationFltRuleByActualFlight(id).then((response) => {
if (response.code != 200) {
this.$message({
showClose: true,
message: response.msg,
type: "error",
});
this.msgError(response.msg)
this.isEmpty = true;
} else if (response.data == null) {
this.isEmpty = true;
......@@ -488,11 +465,7 @@ export default {
//货物信息
findByFlightId(id).then((response) => {
if (response.code != 200) {
this.$message({
showClose: true,
message: response.msg,
type: "error",
});
this.msgError(response.msg)
this.isEmpty = true;
} else {
let info = response.data.list;
......@@ -543,6 +516,22 @@ export default {
}
},
computed: {
includeUrsa: {
get: function () {
return this.form.includeUrsa;
},
set: function (val) {
this.form.includeUrsa = this.upCase(val);
},
},
notIncludeUrsa: {
get: function () {
return this.form.notIncludeUrsa;
},
set: function (val) {
this.form.notIncludeUrsa = this.upCase(val);
},
},
minNumOfPieces: {
get: function () {
return this.form.minNumOfPieces;
......
......@@ -325,10 +325,7 @@ export default {
handleDeleteorPlayorpause(row, status, statusText) {
//删除前需要停用
if (status === 0 && row.status != "3") {
this.$message({
message: "请停用后删除",
type: "warning",
});
this.msgWarning('请停用后删除')
return;
}
......@@ -361,10 +358,9 @@ export default {
if (valid) {
this.form.dayOfWeek = this.dayOfWeek.sort();
let formdata = JSON.parse(JSON.stringify(this.form));
formdata.sourceFlightNo = formdata.sourceFlightNo
.trim()
.toUpperCase();
formdata.flightRank = formdata.flightRank.trim().toUpperCase();
formdata.sourceFlightNo = this.upCase(formdata.sourceFlightNo
.trim());
formdata.flightRank = this.upCase(formdata.flightRank.trim());
if (formdata.startDate === undefined || formdata.startDate == null) {
formdata.startDate = "";
}
......@@ -463,7 +459,7 @@ export default {
return this.queryParams.sourceFlightNo;
},
set: function (val) {
this.queryParams.sourceFlightNo = val.toUpperCase();
this.queryParams.sourceFlightNo = this.upCase(val);
},
},
},
......
......@@ -159,10 +159,7 @@ export default {
this.total = response.data.totalCount;
this.loading = false;
if (response.data.list.length == 0) {
this.$message({
message: "未查询到数据",
type: "warning",
});
this.msgWarning('未查询到数据')
}
} else {
this.msgError(response.msg);
......@@ -176,7 +173,7 @@ export default {
return this.queryParams.fltNo;
},
set: function (val) {
this.queryParams.fltNo = val.toUpperCase();
this.queryParams.fltNo = this.upCase(val);
},
},
siteName: {
......@@ -184,7 +181,7 @@ export default {
return this.queryParams.siteName;
},
set: function (val) {
this.queryParams.siteName = val.toUpperCase();
this.queryParams.siteName = this.upCase(val);
},
},
ursa: {
......@@ -192,7 +189,7 @@ export default {
return this.queryParams.ursa;
},
set: function (val) {
this.queryParams.ursa = val.toUpperCase();
this.queryParams.ursa = this.upCase(val);
},
},
},
......
......@@ -135,10 +135,7 @@ export default {
created() {
filghtKindData().then((response) => {
if (response.code != 200) {
this.$message({
message: response.msg,
type: "error",
});
this.msgError(response.msg)
}
this.flightType = response.data;
this.form.type = response.data[0].code;
......
......@@ -249,7 +249,7 @@ import {
updateStatusBatch,
updateAutoPushBatch,
} from "@/api/findAllFltData";
import { nowDate } from "@/utils/FedEx.js"
export default {
name: "FlightInformationMaintenance",
data() {
......@@ -565,7 +565,7 @@ export default {
},
created() {
//查询条件数据源
this.queryParams.fltDateStart = nowDate()
this.queryParams.fltDateStart = this.nowDate()
this.findFltConditionData();
if (this.$store.state.tagsView.cachedViews.length == 0) {
this.findAllFltData();
......@@ -599,7 +599,7 @@ export default {
this.form.fltNo != undefined &&
this.form.fltNo != ""
) {
this.form.fltNo = this.form.fltNo.toUpperCase();
this.form.fltNo = this.upCase(this.form.fltNo);
findFltCommonConf(this.form).then((response) => {
if (response.code == 200) {
//额外增重百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置为0,不可编辑
......@@ -697,7 +697,7 @@ export default {
this.queryParams.fltNo != undefined &&
this.queryParams.fltNo != ""
) {
this.queryParams.fltNo = this.queryParams.fltNo.toUpperCase();
this.queryParams.fltNo = this.upCase(this.queryParams.fltNo);
}
findAllFltDataApi(this.queryParams).then((response) => {
this.loading = false;
......
......@@ -611,10 +611,7 @@ export default {
if (res.code == 200) {
this.findConditionData = res.data;
} else {
this.$message({
message: "查询条件不存在",
type: "warning",
});
this.msgWarning('查询条件不存在')
}
});
},
......@@ -677,16 +674,10 @@ export default {
this.tableData[i].index = i;
}
} else {
this.$message({
message: "未查询到数据",
type: "warning",
});
this.msgWarning('未查询到数据')
}
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
this.tableLoading = false;
})
......@@ -705,10 +696,7 @@ export default {
})
releaseCargo(idList).then(res => {
if (res.code === 200) {
this.$message({
message: res.msg,
type: "success",
});
this.msgSuccess(res.msg)
} else if (res.code === 201) {
this.selectTable.map(item => {
res.data['success'].map(val => {
......@@ -730,10 +718,7 @@ export default {
})
this.dialogVisible = true
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
......@@ -884,10 +869,7 @@ export default {
});
} else {
this.downLoadingTip.downloading = false;
this.$message({
message: "导出数据量过大,请不要超过8万条",
type: "warning",
});
this.msgWarning('导出数据量过大,请不要超过8万条')
}
}
},
......
......@@ -8,26 +8,16 @@
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
@keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> -->
<el-form-item style="width:100%;marginTop:44px">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
@click.native.prevent="handleLogin"
>
<el-button :loading="loading" size="medium" type="primary" style="width:100%;"
@click.native.prevent="handleLogin">
<span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span>
</el-button>
......@@ -70,7 +60,7 @@ export default {
},
watch: {
$route: {
handler: function(route) {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
......@@ -107,20 +97,13 @@ export default {
}
this.$store.dispatch("Login", this.loginForm).then(res => {
this.loading = false;
if(res.code != 200){
this.$message({
message: res.msg,
type: "warning",
});
}
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
if (res.code != 200) {
this.msgWarning(res.msg)
}
this.$router.push({ path: this.redirect || "/" }).catch(() => { });
}).catch(err => {
this.loading = false;
this.$message({
message: err,
type: "warning",
});
//this.getCode();
console.log(err)
});
}
});
......@@ -138,6 +121,7 @@ export default {
background-image: url("../assets/images/login-background.jpg");
background-size: cover;
}
.title {
margin: 0px auto 30px auto;
text-align: center;
......@@ -149,32 +133,39 @@ export default {
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
.el-input {
height: 38px;
input {
height: 38px;
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
......@@ -187,6 +178,7 @@ export default {
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
}
......
......@@ -12,7 +12,7 @@
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<template v-for="(item, index) in tableHeader">
<el-table-column v-if="item.value === 'menuType'" :prop="item.value" :label="item.name" :key="index"
:align="item.align" header-align="center" :width="item.width" :formatter="formatter">
:align="item.align" header-align="center" :width="item.width" :formatter="formatter">
<template slot-scope="scope">
<el-tag :type="scope.row.menuType === 'B' ? '' : 'success'" disable-transitions>{{ scope.row.menuType ===
"B" ? "按钮" : "菜单"
......@@ -20,7 +20,7 @@
</template>
</el-table-column>
<el-table-column v-else :prop="item.value" :label="item.name" :key="index" :align="item.align"
header-align="center" :width="item.width" :formatter="formatter">
header-align="center" :width="item.width" :formatter="formatter">
</el-table-column>
</template>
......@@ -82,7 +82,7 @@
import { getAllAuth, updateStatus } from "@/api/system/user.js";
import dictLabels from "@/assets/languages/dictLabels.js";
import Drawer from "./drawer.vue";
import { MessageBox } from "element-ui";
export default {
name: "MenuConfig",
components: {
......@@ -175,15 +175,9 @@ export default {
if (res.code === 200) {
res.data.length > 0
? (this.data = res.data)
: this.$message({
message: "数据为空",
type: "warning",
});
: this.msgWarning('数据为空')
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch(() => {
......@@ -197,16 +191,10 @@ export default {
.then((res) => {
if (res.code === 200) {
this.menuAll();
this.$message({
message: "操作成功",
type: "success",
});
this.msgSuccess('操作成功')
location.reload();
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -216,7 +204,7 @@ export default {
//菜单开启关闭
menuStatus(row) {
MessageBox.confirm(
this.$confirm(
row.row.status == 1 ? "是否要关闭此菜单" : "是否要启用此菜单",
"提示",
{
......@@ -236,7 +224,7 @@ export default {
//菜单删除
removeMenu(row) {
MessageBox.confirm("是否要删除此菜单", "提示", {
this.$confirm("是否要删除此菜单", "提示", {
confirmButtonText: "确定删除",
cancelButtonText: "取消",
type: "warning",
......
......@@ -98,10 +98,7 @@ export default {
if (res.code === 200) {
this.treeData = this.treeDataInfo(res.data);
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -144,16 +141,10 @@ export default {
.then((res) => {
this.loading = false;
if (res.code === 200) {
this.$message({
message: "操作成功,新增权限需重新登陆后刷新。",
type: "success",
});
this.msgSuccess('操作成功,新增权限需重新登陆后刷新。')
this.$emit("handleClose", false);
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......
......@@ -55,7 +55,7 @@
<script>
import Drawer from "./drawer.vue";
import { MessageBox } from "element-ui";
import {
getRoleList,
detailRole,
......@@ -153,10 +153,7 @@ export default {
this.data = res.data.list;
this.total = res.data.total;
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -171,10 +168,7 @@ export default {
if (res.code === 200) {
this.roleData = res.data;
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -206,7 +200,7 @@ export default {
row.row.valid == 1
? ((msg = "是否关闭此角色"), (status.valid = 2))
: ((msg = "是否启用此角色"), (status.valid = 1));
MessageBox.confirm(msg, "注意", {
this.$confirm(msg, "注意", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -214,16 +208,10 @@ export default {
.then(() => {
updateRoleStatus(status).then((res) => {
if (res.code === 200) {
this.$message({
message: "操作成功",
type: "success",
});
this.msgSuccess('操作成功')
this.selectRoleList();
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
});
})
......@@ -231,7 +219,7 @@ export default {
},
//删除角色
removeRole(row) {
MessageBox.confirm(
this.$confirm(
"如删除此角色,角色下所有用户将从中被剔除,可能会对用户操作造成影响!",
"注意",
{
......@@ -247,13 +235,10 @@ export default {
confirmDel: false,
}).then((res) => {
if (res.code === 200) {
this.$message({
message: "删除成功",
type: "success",
});
this.msgSuccess('删除成功')
this.selectRoleList();
} else if (res.code === 202) {
MessageBox.confirm(res.msg, "注意", {
this.$confirm(res.msg, "注意", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -265,20 +250,14 @@ export default {
confirmDel: true,
}).then((res) => {
if (res.code === 200) {
this.$message({
message: "操作成功",
type: "success",
});
this.msgSuccess('操作成功')
this.selectRoleList();
}
});
})
.catch(() => { });
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
});
})
......
......@@ -209,10 +209,7 @@ export default {
}
});
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -225,10 +222,7 @@ export default {
if (res.code === 200) {
this.portNameList = res.data;
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -258,16 +252,10 @@ export default {
.then((res) => {
this.loading = false;
if (res.code === 200) {
this.$message({
message: "操作成功",
type: "success",
});
this.msgSuccess('操作成功')
this.$emit("handleClose", false);
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -275,10 +263,7 @@ export default {
console.log(err);
});
} else {
this.$message({
message: "口岸不能为空",
type: "warning",
});
this.msgWarning('口岸不能为空')
}
},
},
......
......@@ -87,8 +87,8 @@
<script>
import Drawer from "./drawer.vue";
import { MessageBox } from "element-ui";
import { listUser, detailUser, updateUserStatus } from "@/api/system/user.js";
export default {
name: "UserConfig",
components: {
......@@ -189,10 +189,7 @@ export default {
this.total = res.data.total;
this.formData.page = res.data.page;
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -213,10 +210,7 @@ export default {
? this.userData.portName = this.userData.portName.split(",")
: '';
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -247,7 +241,7 @@ export default {
row.row.isValid == 1
? ((msg = "是否要停用此用户"), (nowValid = 2))
: ((msg = "是否要启用此用户"), (nowValid = 1));
MessageBox.confirm(msg, "提示", {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -256,16 +250,10 @@ export default {
updateUserStatus({ id: row.row.id, isValid: nowValid }).then(
(res) => {
if (res.code === 200) {
this.$message({
message: "操作成功",
type: "success",
});
this.msgSuccess('操作成功')
this.selectUser();
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
}
);
......@@ -273,12 +261,12 @@ export default {
.catch((err) => {
console.log(err);
})
.catch(() => []);
.catch(() => { });
},
//删除用户
removeUser(row) {
MessageBox.confirm("是否要删除此用户", "提示", {
this.$confirm("是否要删除此用户", "提示", {
confirmButtonText: "确定删除",
cancelButtonText: "取消",
type: "warning",
......@@ -286,16 +274,10 @@ export default {
.then(() => {
updateUserStatus({ id: row.row.id, isValid: 0 }).then((res) => {
if (res.code === 200) {
this.$message({
message: "操作成功",
type: "success",
});
this.msgSuccess('操作成功')
this.selectUser();
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
});
})
......
......@@ -506,10 +506,7 @@ export default {
if (res.code === 200) {
this.portList = res.data;
} else {
this.$message({
message: "查询条件" + res.msg,
type: "warning",
});
this.msgWarning("查询条件" + res.msg)
}
});
if (this.$store.state.tagsView.cachedViews.length == 0) {
......@@ -548,27 +545,18 @@ export default {
this.loading = false;
if (res.code === 200) {
if (res.data.total === 0) {
this.$message({
message: "未查询到数据",
type: "warning",
});
this.msgWarning('未查询到数据')
} else {
this.data = res.data.list;
this.total = res.data.total;
}
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
});
} else {
this.loading = false;
this.$message({
message: "创建日期不能为空",
type: "warning",
});
this.msgWarning('创建日期不能为空')
}
},
//分页
......
......@@ -35,9 +35,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `https://imacuat.zmd.apac.fedex.com/iMAC`, //uat服务器
target: defaultSettings.baseURL, //阿里云服务器
// target: `http://192.168.1.133:7001/iMAC`, //测试服务器
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
......