import{r as o,al as i,W as u}from"./index.CL7yl-Wb.js";import{d as l}from"./marked.esm.CbTws8Ir.js";import"./purify.es.aGzT-_H7.js";import a from"./MarkdownEditor.DHTGolTJ.js";import{s as n}from"./vue.D1BjjNmv.js";import"./_plugin-vue_export-helper.DlAUqK2U.js";const s="/api/platform/agreements/";function d(t){return o({url:s,method:"get",params:t})}function c(t){return o({url:s,method:"post",data:t})}function m(t){return o({url:s+t.id+"/",method:"put",data:t})}function p(t){return o({url:s+t+"/",method:"delete",data:{id:t}})}const{compute:h}=i();l.setOptions({breaks:!0,gfm:!0});function D({crudExpose:t}){return{crudOptions:{request:{pageRequest:async e=>await d(e),addRequest:async({form:e})=>await c(e),editRequest:async({form:e,row:r})=>(e.id=r.id,await m(e)),delRequest:async({row:e})=>await p(e.id)},actionbar:{buttons:{add:{show:!0}}},rowHandle:{fixed:"right",width:200,buttons:{edit:{text:"编辑",type:"text",iconRight:"Edit",show:!0},view:{text:"查看",type:"text",iconRight:"View",show:!0,click({index:e,row:r}){t.openView({index:e,row:r})}},remove:{iconRight:"Delete",type:"text",show:!0}}},columns:{id:{title:"ID",form:{show:!1},column:{width:80}},title:{title:"协议标题",search:{show:!0},type:["text","colspan"],column:{minWidth:200},form:{rules:[{required:!0,message:"请输入协议标题"}],component:{span:24,placeholder:"请输入协议标题"}}},key:{title:"协议标识",search:{show:!0},type:"text",column:{minWidth:150},form:{rules:[{required:!0,message:"请输入协议标识"}],component:{span:24,placeholder:"如：terms_of_service"}}},version:{title:"版本号",search:{show:!0},type:"text",column:{width:120},form:{rules:[{required:!0,message:"请输入版本号"}],component:{span:24,placeholder:"如：1.0"}}},publish_date:{title:"发布日期",type:"datetime",column:{width:180},form:{show:!1,rules:[{required:!1,message:"请选择发布日期"}],component:{span:24,valueFormat:"YYYY-MM-DDTHH:mm:ssZ"}}},is_active:{title:"是否启用",type:"dict-select",column:{width:120},dict:u({data:[{label:"启用",value:!0,color:"success"},{label:"禁用",value:!1,color:"danger"}]}),form:{rules:[{required:!0,message:"请选择是否启用"}],component:{span:24}}},content:{title:"协议内容",column:{width:300,show:!1},type:"colspan",form:{rules:[{required:!0,message:"请输入协议内容"}],component:{name:n(a),vModel:"modelValue",readonly:h(e=>{const{mode:r}=e;return console.log("当前模式:",r,"只读状态:",r==="view"),r==="view"}),span:24}},view:{component:{name:n(a),vModel:"modelValue",readonly:!0,span:24}}}}}}}export{D as default};
