`,
data() {
return {
key:this.$uniqid(),
data:{"fullname":null,"email":null,"phone":null,"birthday":null,"position":null,"role":null,"password":null,"bio":null},
fields: [{"tag":"input","hint":"Insert Fullname","name":"fullname","label":"Fullname","active":true,"disabled":false,"key":"696bfa824f962","0":{"tag":"input","hint":"Insert Email","name":"email","label":"Email","active":true,"disabled":false,"key":"696bfa824f963"},"1":{"tag":"input","hint":"Insert Phone","name":"phone","label":"Phone","active":true,"disabled":false,"key":"696bfa824f965"}},[{"tag":"date","hint":"Insert Birthday","name":"birthday","label":"Birthday","active":true,"disabled":false,"key":"696bfa824f966"},{"tag":"input","hint":"Insert Position","name":"position","label":"Position","active":true,"disabled":false,"key":"696bfa824f967"},{"tag":"select","hint":"Insert Role","name":"role","items":[{"text":"Admin","value":"admin"},{"text":"User","value":"user"}],"label":"Role","active":true,"disabled":false,"item-text":"text","item-value":"value","key":"696bfa824f968"}],{"tag":"input","hint":"Insert Password","name":"password","type":"password","label":"Password","active":true,"disabled":false,"key":"696bfa824f969"},{"tag":"input","hint":"Insert Bio","name":"bio","label":"Bio","active":true,"disabled":false,"key":"696bfa824f96a"}],
helper:{
loading:false,
error:null
},
valid:{
base_sys_users_new_696bfa824f95b:null
}
};
},
props: {
page: {
type: String,
default: "list"
},
send_to: {
type: String,
default: null
},
extra: {
type: Array,
default: () => []
},
allow: {
type: Array,
default: () => []
},
attrs: {
type: Object,
default: () => {}
},
inline:{
type: Boolean,
default: false
},
admin:{
type: Boolean,
default: true
},
binds: {
type: Object,
default: () => {}
},
received_values: {
type: Object,
default: () => {}
}
},
watch:{
binds: {
handler(newValue, oldValue) {
Object.keys(newValue).forEach((item)=>{
this.data[item] = newValue[item]
})
},
immediate: true, // Ejecutar inmediatamente
deep: true // Usar true si es un objeto/array
},
received_values: {
handler(newValue, oldValue) {
Object.keys(newValue).forEach((item)=>{
this.data[item] = newValue[item]
})
},
immediate: true, // Ejecutar inmediatamente
deep: true // Usar true si es un objeto/array
}
},
computed:{
render_fields(){
let fields = []
if (this.fields.length>0) {
this.fields.forEach((field)=>{
if(Array.isArray(field)){
let s_field = []
field.forEach((f)=>{
if ("parent_field" in f && "child_field" in f) {
f.where[f.child_field] = this.data[f.parent_field]
f.key = this.data[f.parent_field]
}
s_field.push({... f });
})
fields.push([... s_field ]);
} else {
if ("parent_field" in field && "child_field" in field) {
field.where[field.child_field] = this.data[field.parent_field]
field.key = this.data[field.parent_field]
}
fields.push({... field });
}
})
}
return fields
},
},
methods: {
async Save() {
this.helper.loading = true
if(this.valid['base_sys_users_new_696bfa824f95b'] == true){
const formData = new FormData
this.$form_data(formData,this.data)
let destination = '/api/sys_users/save'
if(this.send_to){
destination = this.send_to
}
const promise = await axios.post(destination,formData);
if (promise) {
this.helper.loading = false
if(promise.data.error==false){
this.$toast_success("
New User saved successfully!.")
this.$hash('home')
} else {
this.$toast_validation("Form Validation",promise.data.data)
}
}
} else {
this.helper.loading = false
}
},
validate(id,value){
this.valid[id] = value
},
},
created(){
},
};
window.componentes.BaseSysUsersNew = BaseSysUsersNew;
const BaseSysUsersUpdate = {
template: `
mdi-pencil
Edit User
mdi-content-save-all-outline Save
`,
data() {
return {
key:this.$uniqid(),
data:{"fullname":null,"email":null,"phone":null,"birthday":null,"position":null,"role":null,"bio":null},
fields: [{"tag":"input","hint":"Insert Fullname","name":"fullname","label":"Fullname","active":true,"disabled":false,"key":"696bfa824fa22","0":{"tag":"input","hint":"Insert Email","name":"email","label":"Email","active":true,"disabled":false,"key":"696bfa824fa23"},"1":{"tag":"input","hint":"Insert Phone","name":"phone","label":"Phone","active":true,"disabled":false,"key":"696bfa824fa24"}},[{"tag":"date","hint":"Insert Birthday","name":"birthday","label":"Birthday","active":true,"disabled":false,"key":"696bfa824fa25"},{"tag":"input","hint":"Insert Position","name":"position","label":"Position","active":true,"disabled":false,"key":"696bfa824fa26"},{"tag":"select","hint":"Insert Role","name":"role","items":[{"text":"Admin","value":"admin"},{"text":"User","value":"user"}],"label":"Role","active":true,"disabled":false,"item-text":"text","item-value":"value","key":"696bfa824fa27"}],{"tag":"input","hint":"Insert Bio","name":"bio","label":"Bio","active":true,"disabled":false,"key":"696bfa824fa28"}],
helper:{
loading:false,
error:null
},
valid:{
base_sys_users_update_696bfa824fa1a:null
}
};
},
props: {
page: {
type: String,
default: "list"
},
send_to: {
type: String,
default: null
},
extra: {
type: Array,
default: () => []
},
allow: {
type: Array,
default: () => []
},
attrs: {
type: Object,
default: () => {}
},
inline:{
type: Boolean,
default: false
},
admin:{
type: Boolean,
default: true
},
binds: {
type: Object,
default: () => {}
},
received_values: {
type: Object,
default: () => {}
}
},
watch:{
binds: {
handler(newValue, oldValue) {
Object.keys(newValue).forEach((item)=>{
this.data[item] = newValue[item]
})
},
immediate: true, // Ejecutar inmediatamente
deep: true // Usar true si es un objeto/array
},
received_values: {
handler(newValue, oldValue) {
Object.keys(newValue).forEach((item)=>{
this.data[item] = newValue[item]
})
},
immediate: true, // Ejecutar inmediatamente
deep: true // Usar true si es un objeto/array
}
},
computed:{
render_fields(){
let fields = []
if (this.fields.length>0) {
this.fields.forEach((field)=>{
if(Array.isArray(field)){
let s_field = []
field.forEach((f)=>{
if ("parent_field" in f && "child_field" in f) {
f.where[f.child_field] = this.data[f.parent_field]
f.key = this.data[f.parent_field]
}
s_field.push({... f });
})
fields.push([... s_field ]);
} else {
if ("parent_field" in field && "child_field" in field) {
field.where[field.child_field] = this.data[field.parent_field]
field.key = this.data[field.parent_field]
}
fields.push({... field });
}
})
}
return fields
},
},
methods: {
async Save() {
this.helper.loading = true
if(this.valid['base_sys_users_update_696bfa824fa1a'] == true){
const formData = new FormData
this.$form_data(formData,this.data)
let destination = '/api/sys_users/'+this.$root.url.param+'/update'
if(this.send_to){
destination = this.send_to
}
const promise = await axios.post(destination,formData);
if (promise) {
this.helper.loading = false
if(promise.data.error==false){
this.$toast_success("
Edit User updated successfully!.")
this.$hash('home')
} else {
this.$toast_validation("Form Validation",promise.data.data)
}
}
} else {
this.helper.loading = false
}
},
validate(id,value){
this.valid[id] = value
},
async Get() {
this.helper.loading = true
const promise = await axios.get('/api/sys_users/data?ID='+this.$root.url.param);
this.fields.forEach((item)=>{
if(Array.isArray(item)){
item.forEach((field)=>{
if(field.active==1){
this.data[field.name] = promise.data.data[field.name]
}
})
} else {
if(item.active==1){
this.data[item.name] = promise.data.data[item.name]
}
}
})
this.helper.loading = false
},
},
created(){
this.Get()
},
};
window.componentes.BaseSysUsersUpdate = BaseSysUsersUpdate;
const HeroSectionNew = {
template: `
mdi-plus
New Hero Section
mdi-content-save-all-outline Save
`,
data() {
return {
key:this.$uniqid(),
data:{"id":null,"name":null,"content":null,"background_file":null,"button_text":null,"button_link":null},
fields: [[{"tag":"input","hint":"Insert Id","name":"id","label":"Id","active":true,"disabled":false,"key":"696bfa824fac9"},{"tag":"input","hint":"Insert Name","name":"name","label":"Name","active":true,"disabled":false,"key":"696bfa824faca"}],{"tag":"editor","hint":"Insert Content","name":"content","label":"Content","active":true,"disabled":false,"key":"696bfa824facb"},{"tag":"input","hint":"Insert Background File","name":"background_file","label":"Background File","active":true,"disabled":false,"key":"696bfa824facc"},{"tag":"input","hint":"Insert Button Text","name":"button_text","label":"Button Text","active":true,"disabled":false,"key":"696bfa824facd"},{"tag":"input","hint":"Insert Button Link","name":"button_link","label":"Button Link","active":true,"disabled":false,"key":"696bfa824face"}],
helper:{
loading:false,
error:null
},
valid:{
hero_section_new_696bfa824fac3:null
}
};
},
props: {
page: {
type: String,
default: "list"
},
send_to: {
type: String,
default: null
},
extra: {
type: Array,
default: () => []
},
allow: {
type: Array,
default: () => []
},
attrs: {
type: Object,
default: () => {}
},
inline:{
type: Boolean,
default: false
},
admin:{
type: Boolean,
default: true
},
binds: {
type: Object,
default: () => {}
},
received_values: {
type: Object,
default: () => {}
}
},
watch:{
binds: {
handler(newValue, oldValue) {
Object.keys(newValue).forEach((item)=>{
this.data[item] = newValue[item]
})
},
immediate: true, // Ejecutar inmediatamente
deep: true // Usar true si es un objeto/array
},
received_values: {
handler(newValue, oldValue) {
Object.keys(newValue).forEach((item)=>{
this.data[item] = newValue[item]
})
},
immediate: true, // Ejecutar inmediatamente
deep: true // Usar true si es un objeto/array
}
},
computed:{
render_fields(){
let fields = []
if (this.fields.length>0) {
this.fields.forEach((field)=>{
if(Array.isArray(field)){
let s_field = []
field.forEach((f)=>{
if ("parent_field" in f && "child_field" in f) {
f.where[f.child_field] = this.data[f.parent_field]
f.key = this.data[f.parent_field]
}
s_field.push({... f });
})
fields.push([... s_field ]);
} else {
if ("parent_field" in field && "child_field" in field) {
field.where[field.child_field] = this.data[field.parent_field]
field.key = this.data[field.parent_field]
}
fields.push({... field });
}
})
}
return fields
},
},
methods: {
async Save() {
this.helper.loading = true
if(this.valid['hero_section_new_696bfa824fac3'] == true){
const formData = new FormData
this.$form_data(formData,this.data)
let destination = '/api/hero_sections/save'
if(this.send_to){
destination = this.send_to
}
const promise = await axios.post(destination,formData);
if (promise) {
this.helper.loading = false
if(promise.data.error==false){
this.$toast_success("
New Hero Section saved successfully!.")
this.$hash('home')
} else {
this.$toast_validation("Form Validation",promise.data.data)
}
}
} else {
this.helper.loading = false
}
},
validate(id,value){
this.valid[id] = value
},
},
created(){
},
};
window.componentes.HeroSectionNew = HeroSectionNew;
const HeroSectionUpdate = {
template: `
mdi-pencil
Update Hero Section