2023-12-05 17:05:54 +08:00
|
|
|
|
import { get, post } from 'http/index'
|
|
|
|
|
|
|
2023-12-04 17:42:11 +08:00
|
|
|
|
export const useStore = defineStore('myUser', {
|
|
|
|
|
|
state: () => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
currentMenuType: true,
|
|
|
|
|
|
currentMenuItem: 'baseInfo',
|
|
|
|
|
|
menuList: [
|
|
|
|
|
|
{ title: '基础信息', name: 'baseInfo' },
|
|
|
|
|
|
{ title: '订单管理', name: 'orderManagement' },
|
2023-12-09 21:53:41 +08:00
|
|
|
|
{ title: '子账号管理', name: 'subAccount' },
|
|
|
|
|
|
{ title: '业务开通', name: 'business' },
|
2023-12-13 11:21:25 +08:00
|
|
|
|
{ title: '寻源需求', name: 'sourcingNeed' },
|
2023-12-05 17:05:54 +08:00
|
|
|
|
],
|
|
|
|
|
|
provinceList: [], // 省份信息
|
|
|
|
|
|
marketList: [], // 市级信息
|
|
|
|
|
|
areaList: [], // 区级信息
|
|
|
|
|
|
idTypeList: [], // 证件类型
|
|
|
|
|
|
companyTypeList: [],//企业类型
|
2023-12-06 09:38:11 +08:00
|
|
|
|
companyLtdList: [],//企业所属
|
|
|
|
|
|
deviceTypeList: [], // 设备类型大类
|
|
|
|
|
|
deviceTypeSonList: [], // 设备类型子类
|
|
|
|
|
|
deviceTypeSunList: [], // 设备类型小类
|
2023-12-04 17:42:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
getters: {
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
actions: {
|
|
|
|
|
|
updateText() {
|
|
|
|
|
|
console.log('updateText')
|
|
|
|
|
|
},
|
|
|
|
|
|
editCurrentMenuType(val: any) {
|
|
|
|
|
|
this.currentMenuType = val
|
|
|
|
|
|
},
|
|
|
|
|
|
editcurrentMenuItem(val: any) {
|
|
|
|
|
|
this.currentMenuItem = val
|
|
|
|
|
|
},
|
|
|
|
|
|
editcurrentMenuList(val: any) {
|
|
|
|
|
|
this.menuList = val
|
|
|
|
|
|
},
|
2023-12-05 17:05:54 +08:00
|
|
|
|
// 获取省份信息
|
|
|
|
|
|
async getprovinceList() {
|
2023-12-08 20:30:52 +08:00
|
|
|
|
const res: any = await post('/zlpt-system/baseAddress/selectAddress', {})
|
2023-12-05 17:05:54 +08:00
|
|
|
|
this.provinceList = res.data
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取市级信息
|
|
|
|
|
|
async getmarketList(val: any) {
|
2023-12-08 20:30:52 +08:00
|
|
|
|
const res: any = await post('/zlpt-system/baseAddress/selectAddress', { code: val })
|
2023-12-05 17:05:54 +08:00
|
|
|
|
console.log(res, '市区信息');
|
|
|
|
|
|
this.marketList = res.data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取区级信息
|
|
|
|
|
|
async getareaList(val: any) {
|
2023-12-08 20:30:52 +08:00
|
|
|
|
const res: any = await post('/zlpt-system/baseAddress/selectAddress', { code: val })
|
2023-12-05 17:05:54 +08:00
|
|
|
|
this.areaList = res.data
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取证件类型
|
|
|
|
|
|
async getIdTypeList() {
|
2023-12-08 12:09:54 +08:00
|
|
|
|
const res: any = await post('/zlpt-company/company_type/selectIdCard', {})
|
2023-12-05 17:05:54 +08:00
|
|
|
|
console.log(res, '证件类型');
|
|
|
|
|
|
this.idTypeList = res.rows
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取企业类型
|
|
|
|
|
|
async getcompanyTypeList() {
|
2023-12-08 12:09:54 +08:00
|
|
|
|
const res: any = await post('/zlpt-company/company_type/selectCompanyTypeList', {})
|
2023-12-05 17:05:54 +08:00
|
|
|
|
console.log(res, '企业类型');
|
|
|
|
|
|
this.companyTypeList = res.rows
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取企业所属
|
|
|
|
|
|
async getcompanyLtdList() {
|
2023-12-08 12:09:54 +08:00
|
|
|
|
const res: any = await post('/zlpt-company/company_type/selectCompanyLtd', {})
|
2023-12-05 17:05:54 +08:00
|
|
|
|
console.log(res, '企业所属');
|
|
|
|
|
|
this.companyLtdList = res.rows
|
2023-12-06 09:38:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 获取设备类型大类
|
|
|
|
|
|
async getDeviceTypeList() {
|
2023-12-08 12:09:54 +08:00
|
|
|
|
const res: any = await post('/zlpt-equip/type/list', {})
|
2023-12-06 09:38:11 +08:00
|
|
|
|
this.deviceTypeList = res.rows
|
|
|
|
|
|
|
|
|
|
|
|
console.log(res, '设备类型大类**---***');
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取设备类型小类
|
|
|
|
|
|
async getDeviceTypeSonList(val: any) {
|
2023-12-08 12:09:54 +08:00
|
|
|
|
const res: any = await post('/zlpt-equip/type/list', { typeId: val })
|
2023-12-06 09:38:11 +08:00
|
|
|
|
this.deviceTypeSonList = res.rows
|
|
|
|
|
|
console.log(res, '设备类型子类**---***');
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取设备类型大类
|
|
|
|
|
|
async getDeviceTypeSunList(val: any) {
|
2023-12-08 12:09:54 +08:00
|
|
|
|
const res: any = await post('/zlpt-equip/type/list', { typeId: val })
|
2023-12-06 09:38:11 +08:00
|
|
|
|
this.deviceTypeSunList = res.rows
|
|
|
|
|
|
console.log(res, '设备类型小类**---***');
|
|
|
|
|
|
|
|
|
|
|
|
},
|
2023-12-04 17:42:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
persist: {
|
|
|
|
|
|
enabled: true, // 开启数据缓存
|
|
|
|
|
|
strategies: [
|
|
|
|
|
|
{
|
|
|
|
|
|
// 自定义存储的 key,默认是 store.$id
|
|
|
|
|
|
key: 'myUser',
|
|
|
|
|
|
storage: sessionStorage, //缓存模式 可选 localStorage sessionStorage
|
|
|
|
|
|
// state 中的字段名,按组打包储存
|
|
|
|
|
|
paths: ['currentMenuType', 'currentMenuItem', 'menuList'] //需要缓存的字段 与 state中相关联
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|