åºäºVueåQuasarçå端SPA项ç®å®æä¹å æ°æ®å¯¼åºå¯¼å ¥ï¼åäºï¼
å顾
éè¿åä¸ç¯æç« åºäºVueåQuasarçå端SPA项ç®å®æä¹æ¨¡å管çï¼ååï¼çä»ç»ï¼éè¿æ¨¡å管çå°å ·æç¸åç±»åæå±äºåä¸ä¸å¡ç表åè¿è¡åç±»ï¼æ¹ä¾¿å¿«éæ¥æ¾ãæ¬æ主è¦ä»ç»å æ°æ®è¡¨åç导åºåå¯¼å ¥åè½ã
ç®ä»
é对å æ°æ®è¡¨ï¼ææ¶éè¦å¯¼åºå æ°æ®å°æ¬å°æ件ï¼ç¨æ¥å¤ä»½æ°æ®ï¼è¿ééç¨çæä»¶æ ¼å¼ä¸ºjsonãåç»å¯ä»¥éè¿å¯¼å ¥åè½è¿è¡å¯¼å ¥ï¼æ¢å¯ä»¥ç¨æ¥æ¢å¤å æ°æ®ï¼ä¹å¯ä»¥ç¨äºå享å æ°æ®ç»å ¶ä»ç³»ç»ã
UIçé¢
éä¸éè¦å¯¼åºç表åï¼ç¶åç¹å»âæ¹é导åºâæé®
éæ©ä¹å导åºçå
æ°æ®jsonæ件ï¼ç¶åç¹å»âæ交âæé®
代ç
说æ
导åºçæ¶åéè¦æ表åå¼ç¨çåºåå·sequenceåè¡¨å ³ç³»relationä¸å¹¶å¯¼åº
æ°æ®æ ¼å¼
å æ¬sequences, tables, tableRelationsä¸ä¸ªå段ï¼ç±»åé½æ¯æ°ç»
{
"sequences": [],
"tables": [],
"tableRelations": []
}
æ ¸å¿ä»£ç
导åºå æ°æ®
async onExportClickAction(id) {
let ids = [];
this.selected.forEach(function(val){
ids.push(val.id);
});
console.info("list->onExportClickAction");
this.$q.loading.show({
message: "导åºä¸"
});
try {
const fileName = await metadataTableService.export(ids);
this.$q.notify("å
æ°æ®è¡¨çææåï¼è¯·çå¾
ä¸è½½å®æåæ¥çï¼");
window.open("/api/file/" + fileName, "_blank");
this.$q.loading.hide();
} catch (error) {
this.$q.loading.hide();
console.error(error);
}
}
å¯¼å ¥å æ°æ®
async onSubmitClick() {
console.info("import->onSubmitClick");
this.$q.loading.show({
message: "ä¸ä¼ ä¸"
});
try {
let form = new FormData()
form.append('file', this.localFile);
this.fileInfo = await metadataTableService.import(form, (e)=> {
console.info(e);
});
this.$q.notify("导å
¥æå");
this.$router.go(-1);
this.$q.loading.hide();
} catch (error) {
this.$q.loading.hide();
console.error(error);
}
}
ä¾å
以å¦ç表ãæ绩表为ä¾ï¼å ¶ä¸å¦ç表å¦å·å段å¼ç¨äºåºåå·studenNoï¼å¦ç表åæ绩表ä¹é´æ¯ä¸å¯¹å¤å ³ç³»ï¼
å æ°æ®å®ä¹
å¦å·studenNoæµæ°´å·
å¦ç表student
ä¸å¯¹å¤relation
导åºå¯¼å ¥
导åºçjsonæ件
éªè¯
导åºjsonæ件ä¹åå é¤å·²æ表åï¼ç¶åéæ°å¯¼å
¥ï¼å¾å°çå
æ°æ®åä¹åçä¸æ ·ï¼æµè¯å½å
¥å¦çæ绩ä¸å¡æ°æ®ï¼ç»æåææçä¸è´ã
å°ç»
æ¬æ主è¦ä»ç»äºå æ°æ®è¡¨åç导åºå¯¼å ¥åè½ï¼å¯ä»¥ç¨äºæ¥å¸¸å æ°æ®è¡¨åå¤ä»½ï¼ä¹å¯ä»¥å享ç»å ¶ä»ç³»ç»è¿è¡å¯¼å ¥ï¼ä»¥è¾¾å°å¤ç¨çç®æ ãåç»å¯ä»¥å©ç¨å æ°æ®å¯¼åºå¯¼å ¥åè½é ç½®ä¸äºå¸¸è§çä¸å¡è¡¨åï¼æ¯å¦çµåãCRMãæè²çé¢åï¼ç¶åå°è¿äºä¸å¡è¡¨å导åºä¾ç¨æ·ä¸è½½å使ç¨ã
crudapiç®ä»
crudapiæ¯crud+apiç»åï¼è¡¨ç¤ºå¢å æ¹æ¥æ¥å£ï¼æ¯ä¸æ¬¾é¶ä»£ç å¯é ç½®ç产åã使ç¨crudapiå¯ä»¥åå«æ¯ç¥æ å³çå¢å æ¹æ¥ä»£ç ï¼è®©æ¨æ´å ä¸æ³¨ä¸å¡ï¼è约大éææ¬ï¼ä»èæé«å·¥ä½æçãcrudapiçç®æ æ¯è®©å¤çæ°æ®åå¾æ´ç®åï¼ææ人é½å¯ä»¥å 费使ç¨ï¼æ éç¼ç¨ï¼éè¿é ç½®èªå¨çæcrudå¢å æ¹æ¥RESTful APIï¼æä¾åå°UI管çä¸å¡æ°æ®ãåºäºä¸»æµçå¼æºæ¡æ¶ï¼æ¥æèªä¸»ç¥è¯äº§æï¼æ¯æäºæ¬¡å¼åã
demoæ¼ç¤º
crudapiå±äºäº§å级çé¶ä»£ç å¹³å°ï¼ä¸åäºèªå¨ä»£ç çæå¨ï¼ä¸éè¦çæControllerãServiceãRepositoryãEntityçä¸å¡ä»£ç ï¼ç¨åºè¿è¡èµ·æ¥å°±å¯ä»¥ä½¿ç¨ï¼çæ£0代ç ï¼å¯ä»¥è¦çåºæ¬çåä¸å¡æ å ³çCRUD RESTful APIã
å®ç½å°åï¼crudapi.cn
æµè¯å°åï¼demo.crudapi.cn/crudapi/logâ¦
éæºç å°å
GitHubå°å
Giteeå°å
ç±äºç½ç»åå ï¼GitHubå¯è½éåº¦æ ¢ï¼æ¹æ访é®Giteeå³å¯ï¼ä»£ç åæ¥æ´æ°ã