mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 16:30:29 +08:00
0c56a3e599
Made-with: Cursor Former-commit-id: 571c9a99ee26d90505e550c287eb8ad8d743ff8d
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
(window["webpackJsonp_park-unit-web"]=window["webpackJsonp_park-unit-web"]||[]).push([["chunk-6e6a2ecd"],{"2b0f":function(e,t,i){"use strict";var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("qz-drawer",{attrs:{title:"添加人员注册设备",visible:e.show,size:698},on:{"update:visible":function(t){e.show=t}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"device-transfer"},[i("el-form",{attrs:{"label-width":"80px"}},[i("el-form-item",{attrs:{label:"设备区域"}},[i("ChooseDeviceArea",{attrs:{areaIds:e.areaIds},on:{"update:areaIds":function(t){e.areaIds=t},"update:area-ids":function(t){e.areaIds=t},change:e.fetchDeviceList}})],1),i("el-form-item",{attrs:{label:"设备名称"}},[i("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入设备名称",clearable:""},on:{change:e.fetchDeviceList},model:{value:e.deviceName,callback:function(t){e.deviceName=t},expression:"deviceName"}}),i("span",{staticClass:"form-btns"},[i("el-button",{attrs:{type:"primary"},on:{click:e.onSearch}},[e._v("查询")]),i("el-button",{on:{click:e.onReset}},[e._v("重置")])],1)],1)],1),i("div",{staticClass:"panel-box"},[i("div",{staticClass:"panel"},[e.deviceList.length>0?e._l(e.deviceList,(function(t,s){return i("div",{key:s,staticClass:"source-item"},[i("span",{class:{active:t.active},on:{click:function(i){return e.onToggleSelect(s,t.active)}}},[e._v(e._s(t.deviceName))])])})):i("qz-no-data")],2),i("div",{staticClass:"panel"},[e.selectedDeviceList.length>0?e._l(e.selectedDeviceList,(function(t,s){return i("div",{key:s,staticClass:"target-item"},[i("span",[e._v(e._s(t.deviceName))]),i("el-button",{attrs:{type:"text"},on:{click:function(i){return e.onRemove(t.deviceCode)}}},[e._v("删除")])],1)})):i("qz-no-data")],2)])],1),i("div",{attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.show=!1}}},[e._v("取消")]),i("el-button",{attrs:{type:"primary"},on:{click:e.onConfirm}},[e._v("确认")])],1)])},a=[],r=(i("c740"),i("4160"),i("caad"),i("d81d"),i("a434"),i("2532"),i("159b"),i("96cf"),i("1da1")),n=i("d4ec"),o=i("bee2"),c=i("99de"),l=i("7e84"),d=i("262e"),u=i("9ab4"),h=i("60a3"),v=i("ab3c"),f=function(e){function t(){var e;return Object(n["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.show=!1,e.areaIds=[],e.deviceName="",e.deviceList=[],e.tempDeviceList=[],e.selectedDeviceList=[],e.loading=!1,e}return Object(d["a"])(t,e),Object(o["a"])(t,[{key:"fetchDeviceList",value:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(){var t,i,s,a,r=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,t={deviceName:this.deviceName},this.areaIds&&this.areaIds.length>0&&(t.areaIds=this.areaIds.map((function(e){return e[e.length-1]}))),e.next=6,this.service.deviceList(t);case 6:i=e.sent,s=i.data,this.loading=!1,this.deviceList=s,this.tempDeviceList=s,this.selectedDeviceList=this.selected||[],a=this.selected.map((function(e){return e.deviceCode})),this.deviceList.forEach((function(e,t){e.active=a.includes(e.deviceCode),r.$set(r.deviceList,t,e)})),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](0),this.loading=!1;case 19:case"end":return e.stop()}}),e,this,[[0,16]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onShow",value:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:try{this.fetchDeviceList(),this.show=!0}catch(t){this.loading=!1}case 1:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"onToggleSelect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t){var i=this.deviceList[e];i.active=!i.active,this.$set(this.deviceList,e,i),i.active&&this.selectedDeviceList.push(i)}}},{key:"onRemove",value:function(e){var t=this.deviceList.findIndex((function(t){return t.deviceCode===e}));if(-1!==t){this.onToggleSelect(t);var i=this.selectedDeviceList.findIndex((function(t){return t.deviceCode===e}));this.selectedDeviceList.splice(i,1)}}},{key:"onConfirm",value:function(){this.$emit("change",this.selectedDeviceList),this.show=!1}},{key:"onSearch",value:function(){this.fetchDeviceList()}},{key:"onReset",value:function(){this.areaIds=[],this.deviceName="",this.fetchDeviceList()}}]),t}(h["e"]);u["a"]([Object(h["c"])({type:Array,default:function(){return[]}})],f.prototype,"selected",void 0),f=u["a"]([Object(h["a"])({name:"DeviceTransfer",components:{ChooseDeviceArea:v["a"]}})],f);var p=f,m=p,b=(i("9bc5"),i("2877")),g=Object(b["a"])(m,s,a,!1,null,"102b0a68",null);t["a"]=g.exports},"7d79":function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("qz-wrap",{staticClass:"person-setting-wrp",attrs:{loading:e.loading},scopedSlots:e._u([{key:"footer",fn:function(){return[i("el-button",{on:{click:function(t){return e.$router.go(-1)}}},[e._v("取消")]),i("el-button",{attrs:{type:"primary",loading:e.isSaving},on:{click:e.onSave}},[e._v("保存")])]},proxy:!0}])},[i("el-form",{staticClass:"person-setting-form qz-form",attrs:{"label-width":"98"}},[i("CwPanel",[i("el-form-item",{attrs:{label:"开启设备注册",prop:"status"}},[i("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}})],1),i("el-form-item",{attrs:{label:"设备注册审核",prop:"deviceStatus"}},[i("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:e.form.deviceStatus,callback:function(t){e.$set(e.form,"deviceStatus",t)},expression:"form.deviceStatus"}})],1),i("el-form-item",{attrs:{label:"扫码注册审核",prop:"codeStatus"}},[i("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:e.form.codeStatus,callback:function(t){e.$set(e.form,"codeStatus",t)},expression:"form.codeStatus"}})],1)],1),i("CwPanel",{attrs:{title:"注册输入信息"}},[i("el-form-item",[e.form.propertyList&&e.form.propertyList.length>0?i("div",{staticClass:"checkbox-group"},[i("el-checkbox",{attrs:{indeterminate:e.isIndeterminate},on:{change:e.onCheckAllChange},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}},[e._v("全选")]),i("el-checkbox-group",{on:{change:e.onCheckChange},model:{value:e.form.propertyIdList,callback:function(t){e.$set(e.form,"propertyIdList",t)},expression:"form.propertyIdList"}},e._l(e.form.propertyList,(function(t){return i("el-checkbox",{key:t.id,attrs:{label:t.id,disabled:!!t.hasDisabled}},[i("span",{staticClass:"required"},[e._v(e._s(t.hasRequired?"*":""))]),e._v(" "+e._s(t.name)+" ")])})),1)],1):i("router-link",{attrs:{to:{path:"/person/attr"}}},[i("el-button",{attrs:{type:"text"}},[e._v("请先设置人员属性")])],1)],1)],1),i("CwPanel",{attrs:{title:"默认属性设置"}},[i("el-form-item",{attrs:{label:"注册默认机构"}},[i("CwOrgChoose",{attrs:{collapse:""},model:{value:e.form.organizationIds,callback:function(t){e.$set(e.form,"organizationIds",t)},expression:"form.organizationIds"}})],1),i("el-form-item",{attrs:{label:"注册默认标签"}},[i("CwLabelChoose",{attrs:{collapse:""},model:{value:e.form.labelIds,callback:function(t){e.$set(e.form,"labelIds",t)},expression:"form.labelIds"}})],1)],1),i("CwPanel",{attrs:{title:"人员注册设备"}},[i("el-button",{attrs:{type:"text"},on:{click:e.onAdd}},[e._v("添加")]),i("CwDivider"),e.form.deviceList&&e.form.deviceList.length>0?i("div",{staticClass:"device-box"},e._l(e.form.deviceList,(function(t){return i("div",{key:t.deviceCode,staticClass:"device-item"},[i("span",[e._v(e._s(t.deviceName))]),i("span",{staticClass:"delete",on:{click:function(i){return i.stopPropagation(),e.onDeviceDelete(t)}}},[e._v("删除")])])})),0):i("qz-no-data",{attrs:{text:"暂无设备"}})],1)],1),i("device-transfer",{ref:"deviceTransferRef",attrs:{selected:e.form.deviceList},on:{change:e.onDeviceChange}})],1)},a=[],r=(i("4de4"),i("c740"),i("4160"),i("caad"),i("a15b"),i("d81d"),i("a434"),i("d3b7"),i("6062"),i("3ca3"),i("159b"),i("ddb0"),i("96cf"),i("1da1")),n=i("d4ec"),o=i("bee2"),c=i("99de"),l=i("7e84"),d=i("262e"),u=i("9ab4"),h=i("60a3"),v=i("2b0f"),f=function(e){function t(){var e;return Object(n["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.form={status:1,deviceStatus:0,codeStatus:1,organizationIds:[],labelIds:[],propertyIdList:[],deviceCodeList:[],organizationList:[],labelList:[],propertyList:[],deviceList:[]},e.isIndeterminate=!1,e.checkAll=!1,e.isSaving=!1,e.loading=!0,e}return Object(d["a"])(t,e),Object(o["a"])(t,[{key:"created",value:function(){this.fetchSettingDetail()}},{key:"fetchSettingDetail",value:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(){var t,i,s,a,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,e.next=4,this.service.registerSettingDetail({type:0});case 4:t=e.sent,i=t.data,this.form=i,s=[],i.propertyList.forEach((function(e){1===e.hasChecked&&s.push(e.id)})),this.$set(this.form,"propertyIdList",s),i.propertyList&&s.length===i.propertyList.length?(this.checkAll=!0,this.isIndeterminate=!1):(this.checkAll=!1,this.isIndeterminate=!1),a=i.organizationList?i.organizationList.map((function(e){return e.id})):[],this.$set(this.form,"organizationIds",a),r=i.labelList?i.labelList.map((function(e){return e.id})):[],this.$set(this.form,"labelIds",r),this.$set(this.form,"deviceCodeList",[]),this.loading=!1,e.next=22;break;case 19:e.prev=19,e.t0=e["catch"](0),this.loading=!1;case 22:case"end":return e.stop()}}),e,this,[[0,19]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onCheckAllChange",value:function(e){var t=this.form.propertyList.filter((function(e){return e.hasDisabled}));t=t.map((function(e){return e.id})),this.form.propertyIdList=e?this.form.propertyList.map((function(e){return e.id})):t,this.isIndeterminate=!1}},{key:"onCheckChange",value:function(e){var t=e.length;this.checkAll=t===this.form.propertyList.length,this.isIndeterminate=t>0&&t<this.form.propertyList.length}},{key:"onAdd",value:function(){this.deviceTransferRef.onShow(this.form.deviceList)}},{key:"onDeviceChange",value:function(e){this.form.deviceList=e}},{key:"onDeviceDelete",value:function(e){var t=this.form.deviceList.findIndex((function(t){return t.deviceCode===e.deviceCode}));-1!==t&&this.form.deviceList.splice(t,1)}},{key:"onSave",value:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(){var t,i,s,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,this.isSaving=!0,t=new Set(this.form.propertyIdList),0!==this.form.deviceStatus&&0!==this.form.codeStatus){e.next=9;break}if(i=this.requiredFieldIds.filter((function(e){return t.has(e)})),0!==i.length){e.next=9;break}return this.$message.error("未开启注册审核,请勾选工号/手机号码/邮箱/用户名"),this.isSaving=!1,e.abrupt("return");case 9:if(s=this.requiredOrgLabelIds.filter((function(e){return t.has(e)})),0!==s.length){e.next=15;break}if(this.form.organizationIds&&0!==this.form.organizationIds.length||this.form.labelIds&&0!==this.form.labelIds.length){e.next=15;break}return this.$message.error("请勾选机构/标签或者设置默认机构/标签"),this.isSaving=!1,e.abrupt("return");case 15:return a={status:this.form.status,deviceStatus:this.form.deviceStatus,codeStatus:this.form.codeStatus,organizationIds:this.form.organizationIds?this.form.organizationIds.join(","):"",labelIds:this.form.labelIds?this.form.labelIds.join(","):"",propertyIdList:this.form.propertyIdList?this.form.propertyIdList:[],deviceCodeList:this.form.deviceList?this.form.deviceList.map((function(e){return e.deviceCode})):[]},e.next=18,this.service.saveRegisterSetting(a);case 18:this.$message.success("注册设置保存成功"),this.isSaving=!1,e.next=25;break;case 22:e.prev=22,e.t0=e["catch"](0),this.isSaving=!1;case 25:case"end":return e.stop()}}),e,this,[[0,22]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"requiredFieldIds",get:function(){var e=this.form.propertyList.filter((function(e){return["personCode","email","phone","userName"].includes(e.code)}));return e.map((function(e){return e.id}))}},{key:"requiredOrgLabelIds",get:function(){var e=this.form.propertyList.filter((function(e){return["organizationIds","labelIds"].includes(e.code)}));return e.map((function(e){return e.id}))}}]),t}(h["e"]);u["a"]([Object(h["d"])()],f.prototype,"deviceTransferRef",void 0),f=u["a"]([Object(h["a"])({name:"person-setting",components:{DeviceTransfer:v["a"]}})],f);var p=f,m=p,b=(i("da2d"),i("2877")),g=Object(b["a"])(m,s,a,!1,null,null,null);t["default"]=g.exports},"9bc5":function(e,t,i){"use strict";var s=i("d69ab"),a=i.n(s);a.a},d69ab:function(e,t,i){},da2d:function(e,t,i){"use strict";var s=i("e989"),a=i.n(s);a.a},e989:function(e,t,i){e.exports={elInputWidth:"200px",elInputNumberWidth:"200px",elTextareaWidth:"300px",elSelectWidth:"200px",primaryColor:"#0075da",primaryHoverColor:"#3391e1",primaryActiveColor:"#0069c4"}}}]); |