flat: 暂存
This commit is contained in:
@@ -37,7 +37,8 @@ const useDictStore = defineStore("dict", () => {
|
||||
isPublish: [],
|
||||
sex: [],
|
||||
affiliation: [],
|
||||
industry: []
|
||||
industry: [],
|
||||
nature: []
|
||||
})
|
||||
// political_affiliation
|
||||
const getDictData = async (dictType, dictName) => {
|
||||
@@ -48,13 +49,14 @@ const useDictStore = defineStore("dict", () => {
|
||||
return data
|
||||
})
|
||||
}
|
||||
const [education, experience, area, scale, sex, affiliation] = await Promise.all([
|
||||
const [education, experience, area, scale, sex, affiliation, nature] = await Promise.all([
|
||||
getDictSelectOption('education'),
|
||||
getDictSelectOption('experience'),
|
||||
getDictSelectOption('area', true),
|
||||
getDictSelectOption('scale'),
|
||||
getDictSelectOption('app_sex'),
|
||||
getDictSelectOption('political_affiliation'),
|
||||
getDictSelectOption('company_nature'),
|
||||
]);
|
||||
|
||||
state.education = education;
|
||||
@@ -63,6 +65,7 @@ const useDictStore = defineStore("dict", () => {
|
||||
state.scale = scale;
|
||||
state.sex = sex;
|
||||
state.affiliation = affiliation;
|
||||
state.nature = nature
|
||||
complete.value = true
|
||||
getIndustryDict() // 获取行业
|
||||
} catch (error) {
|
||||
|
@@ -9,8 +9,8 @@ import {
|
||||
} from '@/common/globalFunction.js'
|
||||
const useLocationStore = defineStore("location", () => {
|
||||
// 定义状态
|
||||
const longitudeVal = ref('') // 经度
|
||||
const latitudeVal = ref('') //纬度
|
||||
const longitudeVal = ref(null) // 经度
|
||||
const latitudeVal = ref(null) //纬度
|
||||
|
||||
function getLocation() {
|
||||
return new Promise((resole, reject) => {
|
||||
@@ -63,6 +63,9 @@ const useLocationStore = defineStore("location", () => {
|
||||
getLocation,
|
||||
longitude,
|
||||
latitude,
|
||||
longitudeVal,
|
||||
latitudeVal
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
@@ -28,6 +28,15 @@ class JobRecommendation {
|
||||
return Date.now();
|
||||
}
|
||||
|
||||
deleteHostiry(name) {
|
||||
for (const [key, value] of Object.entries(this.conditions)) {
|
||||
if (key === name) {
|
||||
delete this.conditions[key]
|
||||
}
|
||||
}
|
||||
this.askHistory.delete(name)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下一个符合条件的推荐问题
|
||||
* @returns {string|null} 返回推荐的问题,或 null(无可询问的)
|
||||
@@ -71,6 +80,23 @@ export const useRecommedIndexedDBStore = defineStore("indexedDB", () => {
|
||||
if (!baseDB.isDBReady) await baseDB.initDB();
|
||||
return await baseDB.db.add(tableName.value, payload);
|
||||
}
|
||||
// 清除数据 1、清除数据库数据
|
||||
async function deleteRecords(payload) {
|
||||
if (!baseDB.isDBReady) await baseDB.initDB();
|
||||
try {
|
||||
const jobstr = payload.jobCategory
|
||||
const jobsObj = {
|
||||
'地区': 'jobLocationAreaCodeLabel',
|
||||
'岗位': 'jobCategory',
|
||||
'经验': 'experIenceLabel',
|
||||
}
|
||||
const [name, value] = jobstr.split(':')
|
||||
const nameAttr = jobsObj[name]
|
||||
jobRecommender.deleteHostiry(jobstr)
|
||||
return await baseDB.db.deleteByCondition(tableName.value, (record) => record[nameAttr] ===
|
||||
value);
|
||||
} catch {}
|
||||
}
|
||||
|
||||
// 获取所有数据
|
||||
async function getRecord() {
|
||||
@@ -108,6 +134,7 @@ export const useRecommedIndexedDBStore = defineStore("indexedDB", () => {
|
||||
addRecord,
|
||||
getRecord,
|
||||
JobParameter,
|
||||
analyzer
|
||||
analyzer,
|
||||
deleteRecords
|
||||
};
|
||||
});
|
Reference in New Issue
Block a user