jinhui.wang

ver:1.3.0,文本域输入限制高度限制,组件更新,样式修改,文本修正

This diff is collapsed. Click to expand it.
......@@ -8,6 +8,10 @@
width: 100% !important;
}
.wid95 {
width: 95% !important;
}
.wid90 {
width: 90% !important;
}
......@@ -80,9 +84,9 @@
margin-left: 20px;
}
.el-dialog:not(.is-fullscreen) {
margin-top: 6vh !important;
}
// .el-dialog:not(.is-fullscreen) {
// margin-top: 6vh !important;
// }
.el-table {
......@@ -108,13 +112,13 @@
.form-header {
font-size: 15px;
color: #6379bb;
border-bottom: 1px solid #ddd;
// border-bottom: 1px solid #ddd;
margin: 8px 10px 25px 10px;
padding-top: 15px;
padding-bottom: 5px;
.formItem {
width: 90%;
width: 95%;
// max-width: 300px;
}
}
......
......@@ -26,6 +26,10 @@ html {
height: 100%;
}
input {
background-color: #fff !important;
}
*,
*:before,
*:after {
......@@ -193,8 +197,8 @@ aside {
.el-table__body-wrapper {
&::-webkit-scrollbar {
height: 10px;
width: 10px;
height: 7px;
width: 7px;
}
&::-webkit-scrollbar-track {
......@@ -210,6 +214,13 @@ aside {
}
}
.el-scrollbar__wrap {
&::-webkit-scrollbar {
height: 0px;
width: 0px;
}
}
// 解决表格固定列问题
.el-table__fixed,
.el-table__fixed-right {
......
......@@ -133,7 +133,7 @@ export default {
});
},
local(val) {
this.$i18n.locale = val; //此处val为 zh 或者 en
// this.$i18n.locale = val; //此处val为 zh 或者 en
},
},
};
......
......@@ -11,20 +11,18 @@ import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
// 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"
import tableHeaders from '@/assets/languages/tableHeaders'
// 全局方法挂载
//Vue.prototype.getDicts = getDicts
//Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
......@@ -32,11 +30,18 @@ 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.tableHeaders = tableHeaders
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" });
}
......@@ -48,7 +53,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)
/**
......@@ -62,8 +67,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
......@@ -72,5 +76,6 @@ new Vue({
el: '#app',
router,
store,
// i18n,
render: h => h(App)
})
......
......@@ -3,10 +3,10 @@
* Copyright (c) 2019 FedEx
*/
const baseURL = process.env.VUE_APP_BASE_API
const baseURL = process.env.VUE_APP_BASE_API
// 日期格式化
export function parseTime(time, pattern) {
// 日期格式化
export function parseTime(time, pattern) {
//debugger
if (arguments.length === 0 || !time) {
return null
......@@ -45,17 +45,17 @@
return value || 0
})
return time_str
}
}
// 表单重置
export function resetForm(refName) {
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}
}
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
var search = params;
search.params = {};
if (null != dateRange && '' != dateRange) {
......@@ -68,10 +68,10 @@
}
}
return search;
}
}
// 回显数据字典
export function selectDictLabel(datas, value) {
// 回显数据字典
export function selectDictLabel(datas, value) {
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) {
......@@ -80,10 +80,10 @@
}
})
return actions.join('');
}
}
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
......@@ -95,15 +95,15 @@
})
})
return actions.join('').substring(0, actions.join('').length - 1);
}
}
// 通用下载方法
export function download(fileName) {
// 通用下载方法
export function download(fileName) {
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
}
}
// 字符串格式化(%s )
export function sprintf(str) {
// 字符串格式化(%s )
export function sprintf(str) {
var args = arguments, flag = true, i = 1;
str = str.replace(/%s/g, function () {
var arg = args[i++];
......@@ -114,24 +114,24 @@
return arg;
});
return flag ? str : '';
}
}
// 转换字符串,undefined,null等转化为""
export function praseStrEmpty(str) {
// 转换字符串,undefined,null等转化为""
export function praseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return "";
}
return str;
}
}
/**
/**
* 构造树型结构数据
* @param {*} data 数据源
* @param {*} id id字段 默认 'id'
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
*/
export function handleTree(data, id, parentId, children) {
export function handleTree(data, id, parentId, children) {
let config = {
id: id || 'id',
parentId: parentId || 'parentId',
......@@ -173,10 +173,16 @@
}
}
return tree;
}
}
//字符串英文转大写,;转英文;
export function upCase(str){
let newStr = str.replace(/;/g,";").toUpperCase();
//字符串英文转大写,;转英文;
export function upCase(str) {
let newStr = str.replace(/;/g, ";").toUpperCase();
return newStr;
}
\ No newline at end of file
}
//当前日期
export function nowDate() {
let date = new Date()
return `${date.getFullYear()}-${(date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)}-${(date.getDate()) > 9 ? date.getDate() : '0' + (date.getDate())}`
}
\ No newline at end of file
......
......@@ -204,293 +204,7 @@ export default {
customsReceiptStatusId: null,
accsPool: "OSPR"
}, //查询数据
tableHeader: [
{
name: "口岸代码",
value: "portName",
width: "100",
align: "center",
sorTable: true,
},
{
name: "取件日期",
value: "pickUpDate",
width: "120",
align: "center",
sorTable: true,
},
{
name: "取件扫描号",
value: "pickUpScanNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "站点",
value: "siteName",
width: "80",
align: "center",
sorTable: true,
},
{
name: "运单号",
value: "waybillNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "总单号",
value: "totalWaybillNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "服务类型",
value: "serviceTypeName",
width: "100",
align: "center",
sorTable: true,
},
{
name: "服务代码",
value: "serviceCode",
width: "100",
align: "center",
},
{
name: "URSA",
value: "ursa",
width: "100",
align: "center",
sorTable: true,
},
{
name: "申报类型",
value: "typeName",
width: "100",
align: "center",
sorTable: true,
},
{
name: "HandlingCode",
value: "handingCode",
width: "150",
align: "center",
sorTable: true,
},
{
name: "subcategory",
value: "subCategory",
width: "140",
align: "center",
sorTable: true,
},
{
name: "件数",
value: "qty",
width: "80",
align: "center",
sorTable: true,
},
{
name: "实际重量",
value: "actualWeight",
width: "100",
align: "center",
sorTable: true,
},
{
name: "收件人国家代码",
value: "consigneeCountry",
width: "150",
align: "center",
sorTable: true,
},
{
name: "品名描述",
value: "nameDescription",
width: "100",
align: "center",
},
{
name: "海关回执状态",
value: "customsReceiptStatusName",
width: "140",
align: "center",
sorTable: true,
},
{
name: "预审状态",
value: "preQualificationStatus",
width: "100",
align: "center",
sorTable: true,
},
{
name: "航班预审意见",
value: "caPretrialOpinion",
width: "120",
align: "center",
},
{
name: "货物状态",
value: "statusName",
width: "100",
align: "center",
sorTable: true,
},
{
name: "终配航班号",
value: "finalFlightNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "终配航班日期",
value: "finalFlightTime",
width: "140",
align: "center",
sorTable: true,
},
{
name: "二配航班号",
value: "twoMatchFlightNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "二配航班日期",
value: "twoMatchFlightTime",
width: "150",
align: "center",
sorTable: true,
},
{
name: "预配航班号",
value: "preplanFlightNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "预配航班日期",
value: "preplanFlightTime",
width: "150",
align: "center",
sorTable: true,
},
{
name: "ACCS原航班号",
value: "fltNoAccs",
width: "150",
align: "center",
sorTable: true,
},
{
name: "ACCS原航班日期",
value: "fltDateAccs",
width: "150",
align: "center",
sorTable: true,
},
{
name: "ACCS原航线",
value: "accsFlightRoute",
width: "140",
align: "center",
sorTable: true,
},
{
name: "是否RDE手工录入",
value: "manualRde",
width: "170",
align: "center",
sorTable: true,
},
{
name: "是否自动",
value: "cargoRulesStatus",
width: "100",
align: "center",
sorTable: true,
},
{
name: "发件人账号",
value: "shipperAccount",
width: "120",
align: "center",
},
{
name: "发件公司中文名称",
value: "shipperCompany",
width: "150",
align: "center",
},
{
name: "始发地城市名称",
value: "originCity",
width: "130",
align: "center",
},
{
name: "收件地",
value: "destinationSiteName",
width: "90",
align: "center",
},
{
name: "尺寸",
value: "sizeStr",
width: "80",
align: "center",
sorTable: true,
},
{
name: "大货预审意见(是否可以配置航班)",
value: "bigPretrialOpinion",
width: "250",
align: "center",
},
{
name: "大货预审时间",
value: "bigPretrialTime",
width: "120",
align: "center",
},
{
name: "海关回执时间",
value: "customsReceiptTime",
width: "150",
align: "center",
sorTable: true,
},
{
name: "航班预审时间",
value: "caPretrialTime",
width: "150",
align: "center",
sorTable: true,
},
{
name: "创建人",
value: "createUserName",
width: "90",
align: "center",
sorTable: true,
},
{
name: "创建时间",
value: "createTime",
width: "100",
align: "center",
sorTable: true,
},
], //表头数据
tableHeader: this.tableHeaders['cargoAllocation'], //表头数据
tableData: [], //表格数据
tableSelection: [], //选中数据
selectData: {
......
......@@ -50,7 +50,7 @@
<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>
@click="del(scope.row.id, scope.row.status)" style="color:#ff4949">删除</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']"
......
......@@ -51,8 +51,8 @@
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['allocation:rand:update']"
@click="handleUpdate(scope.row)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" v-hasPermi="['allocation:rand:delete']"
@click="handleDeleteorPlayorpause(scope.row, 0, '删除')">
<el-button size="mini" type="text" icon="el-icon-delete" style="color:#ff4949"
v-hasPermi="['allocation:rand:delete']" @click="handleDeleteorPlayorpause(scope.row, 0, '删除')">
删除</el-button>
<el-button size="mini" type="text" icon="el-icon-video-play" v-if="scope.row.status == '3'"
v-hasPermi="['allocation:rand:openClose']" @click="handleDeleteorPlayorpause(scope.row, 1, '启用')">启用
......
......@@ -25,7 +25,7 @@
<el-col :span="6">
<el-form-item label="运单号">
<el-input clearable type="textarea" v-model="queryParams.waybillNo" class="formItem"
placeholder="请输入运单号(回车间隔)" :rows="1"></el-input>
placeholder="请输入运单号(回车间隔)" :rows="1" :maxlength="12000"></el-input>
</el-form-item>
</el-col>
</el-row>
......
......@@ -213,322 +213,7 @@ export default {
limitStart: 1,
limitSize: 100,
}, //表单数据
tableHeader: [
{
name: "口岸代码",
value: "portName",
width: "100",
align: "center",
sorTable: true,
},
{
name: "取件日期",
value: "pickUpDate",
width: "120",
align: "center",
sorTable: true,
},
{
name: "取件扫描号",
value: "pickUpScanNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "站点",
value: "siteName",
width: "80",
align: "center",
sorTable: true,
},
{
name: "运单号",
value: "waybillNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "总单号",
value: "totalWaybillNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "服务类型",
value: "serviceTypeName",
width: "100",
align: "center",
sorTable: true,
},
{
name: "服务代码",
value: "serviceCode",
width: "100",
align: "center",
sorTable: false,
},
{
name: "URSA",
value: "ursa",
width: "100",
align: "center",
sorTable: true,
},
{
name: "推送状态",
value: "cargoAllocationDataStatus",
width: "100",
align: "center",
sorTable: true,
},
{
name: "配舱状态",
value: "flightIdImac",
width: "100",
align: "center",
sorTable: true,
},
{
name: "释放状态",
value: "releasing",
width: "100",
align: "center",
sorTable: true,
},
{
name: "申报类型",
value: "typeName",
width: "100",
align: "center",
sorTable: true,
},
{
name: "ACCSpool",
value: "accsPool",
width: "120",
align: "center",
sorTable: true,
},
{
name: "HandlingCode",
value: "handingCode",
width: "150",
align: "center",
sorTable: true,
},
{
name: "subcategory",
value: "subCategory",
width: "140",
align: "center",
sorTable: true,
},
{
name: "件数",
value: "qty",
width: "80",
align: "center",
sorTable: true,
},
{
name: "实际重量",
value: "actualWeight",
width: "100",
align: "center",
sorTable: true,
},
{
name: "收件人国家代码",
value: "consigneeCountry",
width: "150",
align: "center",
sorTable: true,
},
{
name: "品名描述",
value: "nameDescription",
width: "100",
align: "center",
},
{
name: "海关回执状态",
value: "customsReceiptStatusName",
width: "140",
align: "center",
sorTable: true,
},
{
name: "预审状态",
value: "preQualificationStatus",
width: "100",
align: "center",
sorTable: true,
},
{
name: "航班预审意见",
value: "caPretrialOpinion",
width: "120",
align: "center",
},
{
name: "货物状态",
value: "statusName",
width: "100",
align: "center",
sorTable: true,
},
{
name: "终配航班号",
value: "finalFlightNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "终配航班日期",
value: "finalFlightTime",
width: "140",
align: "center",
sorTable: true,
},
{
name: "二配航班号",
value: "twoMatchFlightNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "二配航班日期",
value: "twoMatchFlightTime",
width: "150",
align: "center",
sorTable: true,
},
{
name: "预配航班号",
value: "preplanFlightNo",
width: "120",
align: "center",
sorTable: true,
},
{
name: "预配航班日期",
value: "preplanFlightTime",
width: "150",
align: "center",
sorTable: true,
},
{
name: "ACCS原航班号",
value: "fltNoAccs",
width: "150",
align: "center",
sorTable: true,
},
{
name: "ACCS原航班日期",
value: "fltDateAccs",
width: "150",
align: "center",
sorTable: true,
},
{
name: "ACCS原航线",
value: "accsFlightRoute",
width: "140",
align: "center",
sorTable: true,
},
{
name: "是否RDE手工录入",
value: "manualRde",
width: "170",
align: "center",
sorTable: true,
},
{
name: "是否自动",
value: "cargoRulesStatus",
width: "100",
align: "center",
sorTable: true,
},
{
name: "发件人账号",
value: "shipperAccount",
width: "120",
align: "center",
},
{
name: "发件公司中文名称",
value: "shipperCompany",
width: "150",
align: "center",
},
{
name: "始发地城市名称",
value: "originCity",
width: "130",
align: "center",
},
{
name: "收件地",
value: "destinationSiteName",
width: "90",
align: "center",
},
{
name: "尺寸",
value: "sizeStr",
width: "80",
align: "center",
sorTable: true,
},
{
name: "大货预审意见(是否可以配置航班)",
value: "bigPretrialOpinion",
width: "250",
align: "center",
},
{
name: "大货预审时间",
value: "bigPretrialTime",
width: "120",
align: "center",
},
{
name: "海关回执时间",
value: "customsReceiptTime",
width: "150",
align: "center",
sorTable: true,
},
{
name: "航班预审时间",
value: "caPretrialTime",
width: "150",
align: "center",
sorTable: true,
},
{
name: "创建人",
value: "createUserName",
width: "90",
align: "center",
sorTable: true,
},
{
name: "创建时间",
value: "createTime",
width: "100",
align: "center",
sorTable: true,
},
], //表头数据
tableHeader: this.tableHeaders['cargo'], //表头数据
releaseHeader: [
{
name: "提示信息",
......
......@@ -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) => {
......
......@@ -30,9 +30,9 @@
<el-button type="primary" icon="el-icon-plus" size="mini" @click="addRole" v-hasPermi="['system:role:add']">新增角色
</el-button>
</div>
<Tables ductName="role" :data="data" :headerData="tableHeader" :infoData="tableHeader" :totalCount="total"
<Tables ref="role" ductName="role" :data="data" :headerData="tableHeader" :totalCount="total"
:limitSize="formData.size" :page="formData.page" :pageSizes="[20, 30, 40, 50]" :loading="tableLoading"
height="600" @sizeChange="sizeChange" @currentChange="currentChange">
:height="tableHeight" @sizeChange="sizeChange" @currentChange="currentChange">
<template slot="optionColumn">
<el-table-column header-align="center" align="center" label="操作">
<template slot-scope="scope">
......@@ -55,7 +55,7 @@
<script>
import Drawer from "./drawer.vue";
import { MessageBox } from "element-ui";
import {
getRoleList,
detailRole,
......@@ -77,44 +77,7 @@ export default {
name: null,
}, //查询条件
data: [], //表格数据
tableHeader: [
{
name: "角色名称",
value: "name",
width: "150px",
align: "center",
},
{
name: "角色状态",
value: "valid",
width: "150px",
align: "center",
},
{
name: "创建人",
value: "createUserName",
width: "150px",
align: "center",
},
{
name: "创建时间",
value: "createTime",
width: "150px",
align: "center",
},
{
name: "修改时间",
value: "updateTime",
width: "150px",
align: "center",
},
{
name: "备注",
value: "remark",
width: "400px",
align: "center",
},
], //表头数据
tableHeader: this.tableHeaders['role'], //表头数据
roleData: {}, //角色详情
createTime: [],
drawer: false,
......@@ -122,6 +85,7 @@ export default {
roleFormDisabled: false,
tableLoading: false,
total: 0,
tableHeight: null
};
},
created() {
......@@ -129,6 +93,9 @@ export default {
this.selectRoleList();
}
},
mounted() {
this.tableHeight = window.innerHeight - this.$refs.selectionRoleForm.$el.offsetHeight - 250
},
activated() {
this.selectRoleList();
},
......@@ -153,10 +120,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 +135,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 +167,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 +175,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 +186,7 @@ export default {
},
//删除角色
removeRole(row) {
MessageBox.confirm(
this.$confirm(
"如删除此角色,角色下所有用户将从中被剔除,可能会对用户操作造成影响!",
"注意",
{
......@@ -247,13 +202,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 +217,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)
}
});
})
......
......@@ -172,8 +172,6 @@ export default {
},
};
},
created() {
},
watch: {
drawer(val, oldVal) {
if (val) {
......@@ -209,10 +207,7 @@ export default {
}
});
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
......@@ -225,17 +220,13 @@ export default {
if (res.code === 200) {
this.portNameList = res.data;
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
console.log(err);
});
},
//关闭
handleClose() {
this.roleid = [];
......@@ -246,7 +237,6 @@ export default {
this.clearValidate('userForm')
this.$emit("handleClose", false);
},
//提交
submit() {
if (this.port.join(",").length > 0) {
......@@ -258,16 +248,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 +259,7 @@ export default {
console.log(err);
});
} else {
this.$message({
message: "口岸不能为空",
type: "warning",
});
this.msgWarning('口岸不能为空')
}
},
},
......
......@@ -29,8 +29,8 @@
</el-button>
</div>
<Tables ductName="user" :data="data" :headerData="tableHeader" :limitSize="formData.size" :totalCount="total"
:loading="loading" :page="formData.page" :pageSizes="[20, 30, 40, 50]" height="600" @sizeChange="sizeChange"
@currentChange="currentChange">
:loading="loading" :page="formData.page" :pageSizes="[20, 30, 40, 50]" :height="tableHeight"
@sizeChange="sizeChange" @currentChange="currentChange">
<template slot="optionColumn">
<el-table-column header-align="center" align="center" width="auto" label="操作">
<template slot-scope="scope">
......@@ -87,7 +87,6 @@
<script>
import Drawer from "./drawer.vue";
import { MessageBox } from "element-ui";
import { listUser, detailUser, updateUserStatus } from "@/api/system/user.js";
export default {
name: "UserConfig",
......@@ -103,56 +102,7 @@ export default {
username: null,
phone: null,
}, //查询条件
tableHeader: [
{
name: "员工号",
value: "loginName",
width: "150px",
align: "center",
},
{
name: "用户姓名",
value: "username",
width: "150px",
align: "center",
},
{
name: "所属口岸",
value: "portName",
width: "150px",
align: "center",
},
{
name: "所属角色",
value: "roleNames",
width: "150px",
align: "center",
},
{
name: "电子邮箱",
value: "email",
width: "150px",
align: "center",
},
{
name: "用户状态",
value: "isValid",
width: "100px",
align: "center",
},
{
name: "修改时间",
value: "updateTime",
width: "150px",
align: "center",
},
{
name: "备注",
value: "remark",
width: "150px",
align: "center",
},
], //表头数据
tableHeader: this.tableHeaders['user'], //表头数据
userData: {}, //用户详情
data: [], //用户列表
drawer: false,
......@@ -161,6 +111,7 @@ export default {
drawerTitle: "",
total: 0,
loading: false,
tableHeight: null
};
},
created() {
......@@ -168,6 +119,9 @@ export default {
this.selectUser();
}
},
mounted() {
this.tableHeight = window.innerHeight - this.$refs.selectionUserForm.$el.offsetHeight - 250
},
activated() {
this.selectUser();
},
......@@ -189,10 +143,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) => {
......@@ -200,7 +151,6 @@ export default {
console.log(err);
});
},
//用户详情
userDetail(id) {
detailUser(id)
......@@ -213,17 +163,13 @@ export default {
? this.userData.portName = this.userData.portName.split(",")
: '';
} else {
this.$message({
message: res.msg,
type: "warning",
});
this.msgWarning(res.msg)
}
})
.catch((err) => {
console.log(err);
});
},
//新增用户
addUser() {
this.userData = {};
......@@ -231,7 +177,6 @@ export default {
this.drawerTitle = "新增用户";
this.userFormDisabled = false;
},
//查询修改用户
buttonClick(row, status) {
this.userDetail(row.row.id);
......@@ -239,7 +184,6 @@ export default {
? (this.userFormDisabled = true)
: (this.userFormDisabled = false);
},
//修改用户状态
userStatus(row) {
let msg = "";
......@@ -247,7 +191,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 +200,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 +211,11 @@ export default {
.catch((err) => {
console.log(err);
})
.catch(() => []);
.catch(() => { });
},
//删除用户
removeUser(row) {
MessageBox.confirm("是否要删除此用户", "提示", {
this.$confirm("是否要删除此用户", "提示", {
confirmButtonText: "确定删除",
cancelButtonText: "取消",
type: "warning",
......@@ -286,36 +223,27 @@ 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)
}
});
})
.catch((err) => {
console.log(err);
})
.catch(() => []);
.catch(() => { });
},
handleClose(val) {
this.drawer = val;
this.userData = {};
this.selectUser();
},
currentChange(val) {
this.formData.page = val.page;
this.selectUser();
},
sizeChange(val) {
this.formData.size = val;
this.selectUser()
......