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: { actions: {
// 生成路由 // 生成路由
GenerateRoutes({ commit }) { GenerateRoutes({ commit,dispatch }) {
return new Promise(resolve => { return new Promise(resolve => {
// 向后端请求路由数据 // 向后端请求路由数据
getRouters().then(res => { getRouters().then(res => {
@ -45,7 +45,14 @@ const permission = {
const rewriteRoutes = filterAsyncRouter(rdata, false, true) const rewriteRoutes = filterAsyncRouter(rdata, false, true)
const indexUrl=getFirstUrl(res.data) const indexUrl=getFirstUrl(res.data)
const asyncRoutes = filterDynamicRoutes(dynamicRoutes); 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); router.addRoutes(asyncRoutes);
commit('SET_ROUTES', rewriteRoutes) commit('SET_ROUTES', rewriteRoutes)
@ -77,10 +84,11 @@ function getFirstUrl(data){
indexUrl=data[0].path indexUrl=data[0].path
} }
}else{ }else{
indexUrl="/default" indexUrl="/"
} }
} }
console.log(indexUrl)
return indexUrl; return indexUrl;
} }
@ -128,6 +136,7 @@ function filterChildren(childrenMap, lastRouter = false) {
return return
} }
} }
if (lastRouter) { if (lastRouter) {
el.path = lastRouter.path + '/' + el.path el.path = lastRouter.path + '/' + el.path
} }

View File

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

View File

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

View File

@ -157,7 +157,7 @@
<div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.quoteId}}</div> <div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.quoteId}}</div>
</template> </template>
</el-table-column> --> </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"> <template slot-scope="scope">
<div class="link-type" @click="handleUpdate(scope.row)"> <div class="link-type" @click="handleUpdate(scope.row)">
<span v-if="scope.row.status==1">{{scope.row.quoteName}}</span> <span v-if="scope.row.status==1">{{scope.row.quoteName}}</span>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <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-form-item label="网点编号" prop="siteCode">
<el-input <el-input
v-model="queryParams.siteCode" v-model="queryParams.siteCode"
@ -77,8 +77,7 @@
:queryParams="queryParams" :queryParams="queryParams"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@sort-change="handleSortChange" @sort-change="handleSortChange"
v-if="tableHeight" v-if="tableHeight" :max-height="tableHeight + 'px'"
:max-height="tableHeight + 'px'"
> >
<div slot="toolbar"> <div slot="toolbar">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
@ -271,6 +270,7 @@ export default {
], ],
data() { data() {
return { return {
tableHeight: 200,
leftTree:[], leftTree:[],
leftTitle:"", leftTitle:"",
// 遮罩层 // 遮罩层
@ -285,7 +285,6 @@ export default {
showSearch: true, showSearch: true,
// 创建时间搜索 // 创建时间搜索
dateTimeRange:[], dateTimeRange:[],
tableHeight: 200,
// 总条数 // 总条数
total: 0, 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() { created() {
this.getList(); this.getList();
// 调整表格的高度,不允许滚动
this.$nextTick(function() { this.$nextTick(function() {
this.getTableHeight(); let queryFormEl = this.$refs.queryForm.$el;
let tableH = queryFormEl.offsetHeight+190;
this.tableHeight = window.innerHeight - tableH;
}); });
}, },
methods: { 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() { getList() {
this.loading = true; this.loading = true;

View File

@ -68,6 +68,7 @@
:queryParams="queryParams" :queryParams="queryParams"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@sort-change="handleSortChange" @sort-change="handleSortChange"
v-if="tableHeight" :max-height="tableHeight + 'px'"
> >
<div slot="toolbar"> <div slot="toolbar">
@ -313,6 +314,7 @@ export default {
components: { DeptmentTreePicker,CountryTreePicker,Treeselect,sysUserForm,EmisSiteSimplePicker,EmisSiteLeftTreePicker,CountryPicker }, components: { DeptmentTreePicker,CountryTreePicker,Treeselect,sysUserForm,EmisSiteSimplePicker,EmisSiteLeftTreePicker,CountryPicker },
data() { data() {
return { return {
tableHeight: 200,
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
@ -400,6 +402,15 @@ export default {
this.getConfigKey("sys.user.initPassword").then(response => { this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg; 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: { methods: {
/** 查询用户列表 */ /** 查询用户列表 */