"use strict";require("../../common/libraries/request.js"),require("../../common/store/useWatermarkStore.js");const o=require("../../common/store/useWeAppAuthStore.js"),e=require("../../common/store/useWorkStore.js"),l=require("../../common/libraries/apiLoading.js"),u=require("../../common/libraries/naviHelper.js"),a=require("../../gen/Apis.js"),s=require("./model.js");o.useWeAppAuthStore();const i=e.useWorkStore(),r={unInit(){s.useModel.formData.value={is_anonymous:!1,is_self:"0"},i.selectWorkHouse={}},init(){var o,e,l,u,a,r,n,t,d,v,m,c;console.log("init",null==i?void 0:i.selectWorkProject),s.useModel.formData.value={...null==(e=null==(o=s.useModel)?void 0:o.formData)?void 0:e.value},(null==(l=null==i?void 0:i.selectWorkHouse)?void 0:l.id)&&(s.useModel.formData.value={...null==(a=null==(u=s.useModel)?void 0:u.formData)?void 0:a.value,asset_houses_id:null==(r=null==i?void 0:i.selectWorkHouse)?void 0:r.id,full_name:null==(n=null==i?void 0:i.selectWorkHouse)?void 0:n.full_name}),(null==(t=null==i?void 0:i.selectWorkProject)?void 0:t.id)&&(s.useModel.formData.value={...null==(v=null==(d=s.useModel)?void 0:d.formData)?void 0:v.value,project_name:null==(m=null==i?void 0:i.selectWorkProject)?void 0:m.name,asset_projects_id:null==(c=null==i?void 0:i.selectWorkProject)?void 0:c.id})},handleSelectProject(o){var e,l;let u=o[3];s.useModel.formData.value={...null==(l=null==(e=s.useModel)?void 0:e.formData)?void 0:l.value,asset_houses_id:null==u?void 0:u.id,full_name:null==u?void 0:u.full_name},console.log(o,"data")},handleSubmit(){var o,e,i,r,n,t,d,v,m,c,f,M,h,D,_,j,p;return console.log("handleSubmit",s.useModel.formData.value),(null==(i=null==(e=null==(o=s.useModel)?void 0:o.formData)?void 0:e.value)?void 0:i.type)?"MyHome"===(null==(t=null==(n=null==(r=s.useModel)?void 0:r.formData)?void 0:n.value)?void 0:t.location)||s.useModel.formData.value.asset_projects_id?"MyHome"!==(null==(m=null==(v=null==(d=s.useModel)?void 0:d.formData)?void 0:v.value)?void 0:m.location)||s.useModel.formData.value.asset_houses_id?"MyHome"!==(null==(M=null==(f=null==(c=s.useModel)?void 0:c.formData)?void 0:f.value)?void 0:M.location)||(null==(D=null==(h=s.useModel)?void 0:h.formData.value)?void 0:D.reporter_phone)?(null==(p=null==(j=null==(_=s.useModel)?void 0:_.formData)?void 0:j.value)?void 0:p.content)?void l.getApiLoading(a.Apis.WorkOrder.HouseWorkOrders.Store,s.useModel.formData.value).then(o=>{u.showToastBack("提交成功！",1,!0),console.log(o)}):u.showToast("请输入问题描述！"):u.showToast("请输入联系人电话！"):u.showToast("请选择房屋！"):u.showToast("请选择项目！"):u.showToast("请选择工单类型！")},handleSwitchChange(o){var e;s.useModel.formData.value.is_anonymous=null==(e=null==o?void 0:o.detail)?void 0:e.value,console.log(o,"e")}};exports.method=r;
