dootask/public/js/build/approve.4f7341d3.js
2023-05-31 15:26:01 +08:00

2 lines
3.3 KiB
JavaScript
Vendored

import{D as n}from"./index.98ccc27e.js";import{n as l,k as p,a as c}from"./app.5e0461e9.js";var d=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"setting-item submit"},[e("Row",{staticClass:"approve-row",attrs:{gutter:8}},[e("Col",{attrs:{xxl:{span:6},xl:{span:8},lg:{span:12},sm:{span:24},xs:{span:24}}},[e("div",{staticClass:"approve-col-box approve-col-add",on:{click:t.add}},[e("Icon",{attrs:{type:"md-add"}})],1)]),t._l(t.list,function(a,o){return e("Col",{key:o,attrs:{xxl:{span:6},xl:{span:8},lg:{span:12},sm:{span:24},xs:{span:24}}},[e("div",{staticClass:"approve-col-box approve-col-for",on:{click:function(r){return t.edit(a)}}},[e("p",[t._v(t._s(t.$L("\u6D41\u7A0B\u540D\u79F0"))+"\uFF1A"),e("span",{staticStyle:{"font-weight":"500",color:"#135de6"}},[t._v(t._s(t.$L(a.name)))])]),e("Divider",{staticStyle:{margin:"12px 0","margin-bottom":"9px"}}),e("div",{staticClass:"approve-button-box",on:{click:function(r){return r.stopPropagation(),t.edit(a)}}},[e("p",[t._v(t._s(t.$L("\u5DF2\u53D1\u5E03")))]),e("p",{staticStyle:{position:"relative"},on:{click:function(r){return r.stopPropagation(),t.change(a)}}},[e("Icon",{staticClass:"delcon",attrs:{type:"md-trash",size:"16"}})],1)])],1)])})],2),e("DrawerOverlay",{attrs:{placement:"right",size:1200},model:{value:t.approvalSettingShow,callback:function(a){t.approvalSettingShow=a},expression:"approvalSettingShow"}},[e("iframe",{attrs:{src:t.iframeSrc}})])],1)},v=[];const u={name:"approve",components:{DrawerOverlay:n},data(){return{value:!1,loadIng:0,approvalSettingShow:!1,iframeSrc:"",name:"",list:[]}},watch:{approvalSettingShow(t){t&&(this.iframeSrc=$A.apiUrl(`../approve/#/?name=${this.name}&token=${p.userToken}&lang=${c}`))}},mounted(){window.addEventListener("message",this.saveSuccess),this.getList()},beforeDestroy(){window.removeEventListener("message",this.saveSuccess)},methods:{getList(){this.$store.dispatch("call",{url:"approve/procdef/all",method:"post"}).then(({data:t})=>{this.list=t.rows,t.rows.forEach((s,e)=>{this.list.forEach((a,o)=>{a.name==s.name&&(a.issue=!0,a.id=s.id,a.version=s.version)})})}).catch(({msg:t})=>{$A.modalError(t)}).finally(t=>{this.loadIng--})},saveSuccess(t){typeof t.data=="string"&&JSON.parse(t.data).method=="saveSuccess"&&(this.getList(),this.list.forEach((e,a)=>{e.name==this.name&&(e.issue=!0,this.$set(this.list,a,e))}),this.approvalSettingShow=!1,$A.messageSuccess("\u53D1\u5E03\u6210\u529F"))},add(){$A.modalInput({title:"\u6DFB\u52A0\u6D41\u7A0B",placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0",type:"textarea",okText:"\u786E\u5B9A",onOk:t=>t?(this.name=t,this.approvalSettingShow=!0,!1):"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0"})},edit(t){this.name=t.name,this.approvalSettingShow=!0},change(t){this.$nextTick(()=>{t.issue=!0,$A.modalConfirm({title:"\u5220\u9664",content:"\u5C06\u4F1A\u6E05\u7A7A\u6D41\u7A0B\u6570\u636E\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D",onOk:()=>{this.del(t)}})})},del(t){if(!t.id)return t.issue=!1,!0;this.$store.dispatch("call",{url:"approve/procdef/del",data:{id:t.id},method:"post"}).then(({data:s})=>{t.issue=!1,this.getList(),$A.messageSuccess("\u6210\u529F")}).catch(({msg:s})=>{$A.modalError(s)}).finally(s=>{this.loadIng--})}}},i={};var h=l(u,d,v,!1,m,"071efe7c",null,null);function m(t){for(let s in i)this[s]=i[s]}var _=function(){return h.exports}();export{_ as default};