AITools prime cose

This commit is contained in:
Surya Paolo
2024-01-30 14:00:48 +01:00
parent 8a5a2bd79a
commit 74d1bf356f
97 changed files with 3832 additions and 223 deletions

View File

@@ -36,6 +36,7 @@ import { useNotifStore } from '@store/NotifStore'
import { useCircuitStore } from '@store/CircuitStore'
import { routesAdmin } from '@src/router/routesAdmin'
import { routesECommerce } from '@src/router/routesECommerce'
import { routesAI } from '@src/router/routesAI'
import LandingFooter from '@src/components/LandingFooter/LandingFooter'
import { useProducts } from '@store/Products'
@@ -144,6 +145,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
sectors: [],
sectorgoods: [],
catgrps: [],
catAI: [],
queryAIList: [],
site: {
confsite: {
options: 0
@@ -170,6 +173,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
showConnected: false,
bookingEvents: false,
enableEcommerce: false,
enableAI: false,
enableGroups: false,
enableCircuits: false,
enableProj: false,
@@ -328,6 +332,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'categorys') ris = state.categories
else if (table === 'catprods') ris = Products.catprods
else if (table === 'catprods_gas') ris = Products.catprods_gas
else if (table === 'catais') ris = state.catAI
else if (table === 'queryais') ris = state.queryAIList
else if (table === 'sharewithus') ris = state.sharewithus
else if (table === 'paymenttypes') ris = state.paymenttypes
else if (table === 'circuits') ris = circuitStore.listcircuits
@@ -527,6 +533,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
const adminRoutes = routesAdmin.routesAd(this.site);
const ecommRoutes = routesECommerce.routesEcomm(this.site);
const AIRoutes = routesAI.routesAI(this.site);
const last = {
active: true,
@@ -555,7 +562,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
if (!toolsext.sito_online(false)) {
static_data.routes = [sito_offline, last]
} else {
static_data.routes = [...baseroutes, ...ecommRoutes, ...adminRoutes, ...arrpagesroute, last]
static_data.routes = [...baseroutes, ...ecommRoutes, ...adminRoutes, ...arrpagesroute, ...AIRoutes, last]
}
/*for (const menu of static_data.routes) {
@@ -1572,6 +1579,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.sectorgoods = (res.data.sectorgoods) ? [...res.data.sectorgoods] : []
this.provinces = (res.data.provinces) ? [...res.data.provinces] : []
this.catgrps = (res.data.catgrps) ? [...res.data.catgrps] : []
this.catAI = (res.data.catAI) ? [...res.data.catAI] : []
if (res.data.queryAIList)
this.queryAIList = res.data.queryAIList
this.site = (res.data.site) ? res.data.site : {}
this.mygroups = (res.data.mygroups) ? [...res.data.mygroups] : []
this.adtypes = (res.data.adtypes) ? [...res.data.adtypes] : []
@@ -1785,6 +1795,26 @@ export const useGlobalStore = defineStore('GlobalStore', {
},
async getQueryAI() {
const userStore = useUserStore()
const paramquery = {
locale: tools.getLocale(),
username: userStore.my.username
}
return Api.SendReq('/aitools/getlist', 'POST', paramquery)
.then((res) => {
// console.log('queryAIList', res)
this.queryAIList = res.data.queryAIList
return this.queryAIList
}).catch((error) => {
return {}
})
},
getItemDate(num: number, day: number, numdays: number, mystr: string) {
let mydate = tools.addDays(tools.getDateNow(), day)
let mydateend = tools.addDays(mydate, numdays)