mergeOptions | mergeOptions | ||||
} from '@/utils/utils'; | } from '@/utils/utils'; | ||||
const debugging = true; //是否开启调试 | |||||
const service = axios.create({ | const service = axios.create({ | ||||
// `method` 是创建请求时使用的方法 | // `method` 是创建请求时使用的方法 | ||||
method: "get", // 默认是 get | method: "get", // 默认是 get | ||||
params: data | params: data | ||||
} | } | ||||
//合并用户配置参数信息 | //合并用户配置参数信息 | ||||
options = Object.assign(defaultOptions, options) | |||||
if (debugging) { | |||||
options = Object.assign(defaultOptions, options); | |||||
} | |||||
return common(options) | return common(options) | ||||
} | } | ||||
data: data, | data: data, | ||||
} | } | ||||
//合并用户配置参数信息 | //合并用户配置参数信息 | ||||
options = Object.assign(defaultOptions, options); | |||||
if (debugging) { | |||||
options = Object.assign(defaultOptions, options); | |||||
} | |||||
return common(options) | return common(options) | ||||
} | } | ||||
<el-table-column v-for="(item, index) in tableFrom.field" :key="index" :prop="item.prop" :label="item.label" | <el-table-column v-for="(item, index) in tableFrom.field" :key="index" :prop="item.prop" :label="item.label" | ||||
:width="item.width" :show-overflow-tooltip="!item.overflow" /> | :width="item.width" :show-overflow-tooltip="!item.overflow" /> | ||||
<el-table-column :fixed="tableFrom.operateFixed ? 'right' : 'false'" :label="tableFrom.operateTitle" | |||||
<el-table-column :v-if="tableFrom.operateShow" :fixed="tableFrom.operateFixed ? 'right' : 'false'" :label="tableFrom.operateTitle" | |||||
:width="tableFrom.operateWidth ? tableFrom.operateWidth : ''"> | :width="tableFrom.operateWidth ? tableFrom.operateWidth : ''"> | ||||
<!-- 默认插槽值 --> | <!-- 默认插槽值 --> | ||||
<template #default="scope"> | <template #default="scope"> | ||||
<slot name="operation" :scope="scope" :tableFrom="dialogFormVisible" /> | <slot name="operation" :scope="scope" :tableFrom="dialogFormVisible" /> | ||||
</template> | </template> | ||||
</el-table-column> | </el-table-column> | ||||
</el-table> | </el-table> | ||||
<!-- 分页组件 --> | <!-- 分页组件 --> | ||||
<el-pagination v-if="false" :page-size="20" :pager-count="11" layout="prev, pager, next" :total="1000" /> | <el-pagination v-if="false" :page-size="20" :pager-count="11" layout="prev, pager, next" :total="1000" /> | ||||
<!-- 对话框 --> | <!-- 对话框 --> | ||||
<el-dialog v-model="dialogFormVisible" :title="tableFrom.titleDialog ? tableFrom.titleDialog : `${title}`"> | <el-dialog v-model="dialogFormVisible" :title="tableFrom.titleDialog ? tableFrom.titleDialog : `${title}`"> | ||||
<!-- 是否自定义Dialog --> | <!-- 是否自定义Dialog --> | ||||
<div v-if="tableFrom.customDialog"> | |||||
<div v-if="tableFrom.dialogCustom"> | |||||
<slot name="dialog" :form="form" /> | <slot name="dialog" :form="form" /> | ||||
</div> | </div> | ||||
<div v-else> | <div v-else> | ||||
</div> | </div> | ||||
<template #footer> | <template #footer> | ||||
<span v-if="!tableFrom.footerDialog"> | |||||
<span v-if="!tableFrom.dialogFooter"> | |||||
<el-button @click="cancel">取消</el-button> | <el-button @click="cancel">取消</el-button> | ||||
<el-button type="primary" @click="affirm(ruleFormRef)">提交</el-button> | <el-button type="primary" @click="affirm(ruleFormRef)">提交</el-button> | ||||
</span> | </span> |
frameUrl?:string; 嵌套外链。 | frameUrl?:string; 嵌套外链。 | ||||
*/ | */ | ||||
export const list = [ | export const list = [ | ||||
// { | |||||
// title: '售后服务', | |||||
// path: 'home', //对应name名称 | |||||
// icon: 'one', | |||||
// auth: true, | |||||
// order: 1, | |||||
// children: [ | |||||
{ | { | ||||
title: '基础信息查询服务', | title: '基础信息查询服务', | ||||
path: 'home', | path: 'home', | ||||
children: [{ | children: [{ | ||||
title: '用户信息查询及变更服务', | title: '用户信息查询及变更服务', | ||||
path: 'userQueryChange', | path: 'userQueryChange', | ||||
icon:'User', | |||||
icon: 'User', | |||||
children: [] | children: [] | ||||
}, { | }, { | ||||
title: '车辆信息查询及变更服务', | title: '车辆信息查询及变更服务', | ||||
path: 'vehicleEnquirChange', | path: 'vehicleEnquirChange', | ||||
icon:'Van', | |||||
icon: 'Van', | |||||
children: [] | children: [] | ||||
}, { | }, { | ||||
title: '签约信息查询服务', | title: '签约信息查询服务', | ||||
path: 'signingQuery', | path: 'signingQuery', | ||||
icon:'Tickets', | |||||
icon: 'Tickets', | |||||
children: [] | children: [] | ||||
}, { | }, { | ||||
title: '卡片信息查询服务', | title: '卡片信息查询服务', | ||||
path: 'cardQueries', | path: 'cardQueries', | ||||
icon:'Postcard', | |||||
icon: 'Postcard', | |||||
children: [] | children: [] | ||||
}, { | }, { | ||||
title: 'OBU信息查询服务', | title: 'OBU信息查询服务', | ||||
path: 'OBUQuery', | path: 'OBUQuery', | ||||
icon:'Link', | |||||
icon: 'Link', | |||||
children: [] | children: [] | ||||
}] | }] | ||||
}, | }, | ||||
icon: 'Postcard', | icon: 'Postcard', | ||||
path: 'cardRenewal', | path: 'cardRenewal', | ||||
children: [] | children: [] | ||||
}, { | |||||
icon: 'Postcard', | |||||
title: '标签重新激活服务', | |||||
path: 'TABActivate', | |||||
children: [] | |||||
}, { | }, { | ||||
icon: 'Postcard', | icon: 'Postcard', | ||||
title: '主动挂起(解除)服务', | title: '主动挂起(解除)服务', | ||||
children: [{ | children: [{ | ||||
title: '储值卡充值服务(修复)[圈存]', | title: '储值卡充值服务(修复)[圈存]', | ||||
path: 'cardrechargefix', | path: 'cardrechargefix', | ||||
icon:'Notebook', | |||||
icon: 'Notebook', | |||||
children: [] | children: [] | ||||
}, { | }, { | ||||
title: '对公账户打款充值服务', | title: '对公账户打款充值服务', | ||||
icon:'Plus', | |||||
icon: 'Plus', | |||||
path: 'advancepaymentaccount', | path: 'advancepaymentaccount', | ||||
children: [] | children: [] | ||||
}] | }] | ||||
}, { | }, { | ||||
title: '注销退费服务', | title: '注销退费服务', | ||||
icon:'Scissor', | |||||
icon: 'Scissor', | |||||
path: 'cardrefundcostManage', | path: 'cardrefundcostManage', | ||||
children: [] | children: [] | ||||
}, { | }, { | ||||
title: '补卡额及补交服务', | title: '补卡额及补交服务', | ||||
path: 'home', | path: 'home', | ||||
icon:'Connection', | |||||
icon: 'Connection', | |||||
children: [{ | children: [{ | ||||
title: '储值卡-补卡额服务', | title: '储值卡-补卡额服务', | ||||
icon:'Tickets', | |||||
icon: 'Tickets', | |||||
path: 'supplyCardBalance', | path: 'supplyCardBalance', | ||||
children: [] | children: [] | ||||
}, { | }, { | ||||
title: '储值卡-补交服务', | title: '储值卡-补交服务', | ||||
icon:'Box', | |||||
icon: 'Box', | |||||
path: 'addsupplyCardBalance', | path: 'addsupplyCardBalance', | ||||
children: [] | children: [] | ||||
}] | }] | ||||
}] | }] | ||||
} | } | ||||
// ] | |||||
// } | |||||
]; | ]; |
}, | }, | ||||
table: { //table 样式配置 | table: { //table 样式配置 | ||||
style: '', //默认表格样式 | |||||
border: false, //是否添加边框(默认false) | border: false, //是否添加边框(默认false) | ||||
customDialog: false, //自定义Dialog (默认false) | |||||
footerDialog: false, //隐藏弹窗页脚显示 (默认false) | |||||
dialogCustom: false, //自定义Dialog (默认false) | |||||
dialogFooter: false, //隐藏弹窗页脚显示 (默认false) | |||||
extend: [{ //表头拓展 | extend: [{ //表头拓展 | ||||
type: '', //类型:selection,index,expand | type: '', //类型:selection,index,expand | ||||
width: '', //表头宽度 | width: '', //表头宽度 | ||||
prop: '', //字段名称 | prop: '', //字段名称 | ||||
label: '', //字段标识 | label: '', //字段标识 | ||||
width: '', //字段表头宽度 | width: '', //字段表头宽度 | ||||
overflow: true, //文本超出是否显示省略号(默认false) | |||||
overflow: false, //文本超出是否显示省略号(默认false) | |||||
form: { //表单内容 | form: { //表单内容 | ||||
required: true, //表单是否不能为空 | |||||
type: '', //表单类型 | |||||
required: false, //表单是否不能为空(默认false) | |||||
type: '', //表单类型(input,select[含选择框],date) | |||||
placeholder: '', //表单提示 | placeholder: '', //表单提示 | ||||
itemType: '', //表单type | itemType: '', //表单type | ||||
listData: [{ //列表数据 | listData: [{ //列表数据 | ||||
} | } | ||||
} | } | ||||
], | ], | ||||
isOperate: true, //是否为表格添加操作处(默认true) | |||||
operateShow: true, //是否为表格添加操作栏(默认true) | |||||
operateTitle: '', //操作栏标题 | operateTitle: '', //操作栏标题 | ||||
operateFixed: false, //操作栏是否固定(默认false) | operateFixed: false, //操作栏是否固定(默认false) | ||||
operateWidth: '', //操作栏宽度 | operateWidth: '', //操作栏宽度 |
<!-- 子项也负责跳转 --> | <!-- 子项也负责跳转 --> | ||||
<router-link style="text-decoration: none" v-else :to="{ name: `${item.path}` }"> | <router-link style="text-decoration: none" v-else :to="{ name: `${item.path}` }"> | ||||
<el-menu-item class="el-menu-item" :index="item.title + ',' + item.path"> | <el-menu-item class="el-menu-item" :index="item.title + ',' + item.path"> | ||||
<item-ioc v-if="item.icon" :icon="item.icon" /> | <item-ioc v-if="item.icon" :icon="item.icon" /> | ||||
<template #title> | <template #title> | ||||
<span style="font-size: 14px">{{ item.title }}</span> | <span style="font-size: 14px">{{ item.title }}</span> |
//判断是否存在tab | //判断是否存在tab | ||||
contains(state) { | contains(state) { | ||||
let tabIndex = -1; | let tabIndex = -1; | ||||
return function (value) { | |||||
return function (value: any) { | |||||
if (value && JSON.stringify(value) !== "{}") { | if (value && JSON.stringify(value) !== "{}") { | ||||
const tabData = value.split(','); | const tabData = value.split(','); | ||||
state.tabArray.forEach((tab, tagI) => { | |||||
state.tabArray.forEach((tab: any, tagI: any) => { | |||||
if (tab.title === tabData[0] && tab.path === tabData[1]) { | if (tab.title === tabData[0] && tab.path === tabData[1]) { | ||||
tabIndex = tagI; | tabIndex = tagI; | ||||
} | } | ||||
}, | }, | ||||
//关闭其他 | //关闭其他 | ||||
closeTheOther: function (context, value) { | closeTheOther: function (context, value) { | ||||
const arr = context.state.tabArray.filter((item, index) => { | |||||
const arr = context.state.tabArray.filter((item: any, index: number) => { | |||||
if (value === -1) { //关闭全部 | if (value === -1) { //关闭全部 | ||||
return item.start !== true; | return item.start !== true; | ||||
} else { | } else { | ||||
}, | }, | ||||
//排序后重新赋值 | //排序后重新赋值 | ||||
sort(state, data) { | sort(state, data) { | ||||
data.arr.forEach((item, index) => { | |||||
data.arr.forEach((item: any, index: number) => { | |||||
item.name = index + ''; | item.name = index + ''; | ||||
}); | }); | ||||
state.tabArray.splice(0, state.tabArray.length, ...data.arr); | state.tabArray.splice(0, state.tabArray.length, ...data.arr); |
<template> | |||||
<div> | |||||
Hello, world | |||||
</div> | |||||
</template> | |||||
<script setup lang="ts"> | |||||
</script> | |||||
<style lang="scss" scoped> | |||||
</style> |