var LIST= { mixins:[COMP.base], props: { show_heading: { default:true }, _onSelect:{} }, data() { return { search:"", fields:{}, rows:{} } }, created() { // console.log("list"); if( UTIL.Empty(this.fields)) alert("No list fields set") }, methods: { load() { console.log("please add a load method"); }, onSelect() { console.log("please add a onSelect method"); }, select(row) { this.$emit("onSelect",row); }, requestFetch() { if(this.$refs.list) this.$refs.list.requestFetch(); else console.log("NO LIST REF ON PARENT",this); }, }, } var TREE = { props:["entity","isRoot","isLast","tree_root"], watch: { entity: { deep:true, handler(val) { this.load(); } } }, created() { this.load(); }, mounted() { // this.setRootSub(); }, data() { return { subs: { }, isExpanded:false } }, methods: { async load() { console.log("ADD LOAD METHOD"); }, option() { console.log("ADD OPTION METHOD"); }, } } var FORM= { mixins:[COMP.base], data() { return { } }, methods: { load() { console.log("please add a load method"); }, buildField(label,type,options,onEvent) { return{ label:label, type:type, options:options, onEvent:onEvent } }, buildOption(label,options,onSelect,default_) { return{ label:label, type:"option", options:options, onSelect:onSelect, default:default_ } } }, } var FILE = { loaded :{}, async save(image_data,name) { var res = {}; if(image_data) { name = name?name:UTIL.genHash(6); var path_file = "./db/file.php"; var res_file = { action:"save", input: { name:name+".png", data:image_data } } res = await UTIL.apiCall(path_file,res_file); console.log(res); // FILE.loaded[image_id+""]=res; } return res; }, async get(image) { var image_id = image?.id; var res = FILE.loaded[image_id+""]; if(!res) { var path = "./db/file.php"; var res_file = { action:"get", input: { id:image_id, } } res = await UTIL.apiCall(path,res_file); FILE.loaded[image_id+""]=res; } return res; } }