This commit is contained in:
linfso 2024-05-10 15:58:05 +08:00
parent eb40e64ebe
commit df9079dbd0
6 changed files with 42 additions and 39 deletions

View File

@ -35,7 +35,7 @@ const permission = {
},
actions: {
// 生成路由
GenerateRoutes({ commit }) {
GenerateRoutes({ commit,dispatch }) {
return new Promise(resolve => {
// 向后端请求路由数据
getRouters().then(res => {
@ -45,7 +45,14 @@ const permission = {
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
const indexUrl=getFirstUrl(res.data)
const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
if(asyncRoutes.length>0){
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
}else{
// 无路由,则退出登录
dispatch('FedLogOut', { }, { root: true })
rewriteRoutes.push({ path: '*', redirect: '/401', hidden: true })
}
router.addRoutes(asyncRoutes);
commit('SET_ROUTES', rewriteRoutes)
@ -77,10 +84,11 @@ function getFirstUrl(data){
indexUrl=data[0].path
}
}else{
indexUrl="/default"
indexUrl="/"
}
}
console.log(indexUrl)
return indexUrl;
}
@ -128,6 +136,7 @@ function filterChildren(childrenMap, lastRouter = false) {
return
}
}
if (lastRouter) {
el.path = lastRouter.path + '/' + el.path
}

View File

@ -244,10 +244,10 @@ export default {
quoteSequence: null,
useSiteCode: null,
useSite: null,
startWeight: '0.1',
endWeight: '1',
initialWeight: '0.5',
additionalWeight: '1',
startWeight: '0',
endWeight: '20',
initialWeight: '0',
additionalWeight: '0',
conditionExpression: null,
calculateExpression: '1+(w-1)*2',
status: null,
@ -339,7 +339,7 @@ export default {
if (this.form.id == null) {
let newItem = Object.assign({}, this.form);
newItem.id=-1;
console.log("000=>"+JSON.stringify(newItem));
// console.log("000=>"+JSON.stringify(newItem));
this.emisQuoteExpressionList.push(newItem);
}
this.onChage();

View File

@ -384,8 +384,8 @@ export default {
// 初始化寄件区域
initSendAreaList() {
this.loading = true;
this.queryParams = {};
listEmisQuoteSendArea(this.queryParams).then(response => {
let queryParams = {};
listEmisQuoteSendArea(queryParams).then(response => {
this.emisQuoteSendAreaList = response.rows;
// if(this.form.sendAreaId != null){
// this.emisQuoteSendAreaList.forEach(item=>{
@ -400,8 +400,8 @@ export default {
},
initDispAreaList(){
this.loading = true;
this.queryParams = {};
listEmisQuoteDispArea(this.queryParams).then(response => {
let queryParams = {};
listEmisQuoteDispArea(queryParams).then(response => {
this.emisQuoteDispAreaList = response.rows;
// if(this.form.dispAreaId != null){
// this.emisQuoteDispAreaList.forEach(item=>{
@ -533,7 +533,7 @@ export default {
this.$refs["form"].validate(valid => {
// this.form.feeType='1001';
if (valid) {
if (this.form.quoteId != null && !this.isCopy) {
if (this.form.quoteId != null) {
updateEmisQuotePrice(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.$emit("on-changed");

View File

@ -157,7 +157,7 @@
<div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.quoteId}}</div>
</template>
</el-table-column> -->
<el-table-column label="报价名称" align="left" prop="quoteName" :show-overflow-tooltip="true" width="270" >
<el-table-column label="报价名称" align="left" prop="quoteName" :show-overflow-tooltip="true" width="350" >
<template slot-scope="scope">
<div class="link-type" @click="handleUpdate(scope.row)">
<span v-if="scope.row.status==1">{{scope.row.quoteName}}</span>

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<SearchForm id="refQueryForm" :model="queryParams" ref="queryForm" size="small" :maxShow="20" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<SearchForm :model="queryParams" ref="queryForm" size="small" :maxShow="20" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<el-form-item label="网点编号" prop="siteCode">
<el-input
v-model="queryParams.siteCode"
@ -77,8 +77,7 @@
:queryParams="queryParams"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
v-if="tableHeight"
:max-height="tableHeight + 'px'"
v-if="tableHeight" :max-height="tableHeight + 'px'"
>
<div slot="toolbar">
<el-row :gutter="10" class="mb8">
@ -271,6 +270,7 @@ export default {
],
data() {
return {
tableHeight: 200,
leftTree:[],
leftTitle:"",
// 遮罩层
@ -285,7 +285,6 @@ export default {
showSearch: true,
// 创建时间搜索
dateTimeRange:[],
tableHeight: 200,
// 总条数
total: 0,
// 网点表格数据
@ -444,34 +443,18 @@ export default {
}
};
},
mounted() {
//挂载window.onresize事件(动态设置table高度)
let _this = this;
window.onresize = () => {
if (_this.resizeFlag) {
clearTimeout(_this.resizeFlag);
}
_this.resizeFlag = setTimeout(() => {
_this.getTableHeight();
_this.resizeFlag = null;
}, 100);
};
},
created() {
this.getList();
// 调整表格的高度,不允许滚动
this.$nextTick(function() {
this.getTableHeight();
let queryFormEl = this.$refs.queryForm.$el;
let tableH = queryFormEl.offsetHeight+190;
this.tableHeight = window.innerHeight - tableH;
});
},
methods: {
getTableHeight() {
var formHeight=document.getElementById('refQueryForm').offsetHeight;
const divHeight = this.$refs.queryForm.offsetHeight;
console.log(`queryForm元素的高度为:${divHeight}px`);
let tableH = formHeight+190;
this.tableHeight = window.innerHeight - tableH;
},
/** 查询网点列表 */
getList() {
this.loading = true;

View File

@ -68,6 +68,7 @@
:queryParams="queryParams"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
v-if="tableHeight" :max-height="tableHeight + 'px'"
>
<div slot="toolbar">
@ -313,6 +314,7 @@ export default {
components: { DeptmentTreePicker,CountryTreePicker,Treeselect,sysUserForm,EmisSiteSimplePicker,EmisSiteLeftTreePicker,CountryPicker },
data() {
return {
tableHeight: 200,
// 遮罩层
loading: true,
// 选中数组
@ -400,6 +402,15 @@ export default {
this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg;
});
// 调整表格的高度,不允许滚动
// tableHeight: 200,
// v-if="tableHeight" :max-height="tableHeight + 'px'"
this.$nextTick(function() {
let queryFormEl = this.$refs.queryForm.$el;
let tableH = queryFormEl.offsetHeight+190;
this.tableHeight = window.innerHeight - tableH;
});
},
methods: {
/** 查询用户列表 */