var h=Object.defineProperty;var b=(i,e,r)=>e in i?h(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r;var l=(i,e,r)=>b(i,typeof e!="symbol"?e+"":e,r);import{b as y,d as g,T as _,a as x}from"./index-CgMrKa77.js";import{c as D,y as d,aq as k,x as R,a7 as v}from"./index-fNs72j9w.js";import L from"./popupForm-CV_0pj01.js";import{B as w,a8 as c,o as F,I as E,C as m,D as C,u as n,O as I,W as z,H as f,au as S}from"./vue-DweYBrEc.js";import"./index-DMA3A9_B.js";import"./index-BlEwok4a.js";import"./validate-CEOscgyN.js";const p="/admin/security.SensitiveData/";function T(){return D({url:p+"add",method:"get"})}class q extends y{constructor(r,t,a={},o={},s={}){super(r,t,a,o,s);l(this,"getEditData",r=>(this.form.loading=!0,this.form.items={},this.api.edit({id:r}).then(t=>{const a=[],o=[];for(const s in t.data.row.data_fields)a.push(s),o.push({name:s,value:t.data.row.data_fields[s]??""});this.form.items.connection=t.data.row.connection?t.data.row.connection:"",this.form.extend.controllerList=t.data.controllers,t.data.row.data_table&&(this.onTableChange(t.data.row.data_table),this.form.extend.parentRef&&this.form.extend.parentRef.setDataFields(o)),t.data.row.data_fields=a,this.form.loading=!1,this.form.items=t.data.row})));l(this,"onConnectionChange",()=>{this.form.extend.fieldList={},this.form.extend.fieldSelect={},this.form.extend.fieldSelectKey=d(),this.form.items.data_table="",this.form.items.data_fields=[],this.form.extend.parentRef&&this.form.extend.parentRef.setDataFields([])});l(this,"onTableChange",r=>{this.form.extend=Object.assign(this.form.extend,{fieldLoading:!0,fieldList:{},fieldSelect:{},fieldSelectKey:d()}),this.form.items.data_fields=[],this.form.extend.parentRef&&this.form.extend.parentRef.setDataFields([]),k(r,!0,this.form.items.connection).then(t=>{this.form.items.primary_key=t.data.pk,this.form.defaultItems.primary_key=t.data.pk;const a={};for(const o in t.data.fieldList)a[o]=(o?o+" - ":"")+t.data.fieldList[o];this.form.extend=Object.assign(this.form.extend,{fieldLoading:!1,fieldList:t.data.fieldList,fieldSelect:a,fieldSelectKey:d()})})});l(this,"toggleForm",(r="",t=[])=>{if(this.form.ref&&this.form.ref.resetFields(),this.form.extend.parentRef&&this.form.extend.parentRef.setDataFields([]),r=="Edit"){if(!t.length)return!1;this.getEditData(t[0])}else r=="Add"&&(this.form.loading=!0,T().then(a=>{this.form.extend.controllerList=a.data.controllers,this.form.items=Object.assign({},this.form.defaultItems),this.form.loading=!1}));this.form.operate=r,this.form.operateIds=t})}}const K={class:"default-main ba-table-box"},H=w({name:"security/dataRecycle",__name:"index",setup(i){const{t:e}=R.useI18n(),r=c("formRef"),t=c("tableRef"),a=new q(new v(p),{column:[{type:"selection",align:"center",operator:!1},{label:"ID",prop:"id",align:"center",operator:"=",operatorPlaceholder:e("Id"),width:70},{label:e("security.sensitiveData.Rule name"),prop:"name",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query")},{label:e("security.sensitiveData.controller"),prop:"controller",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query")},{label:e("Connection"),prop:"connection",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query")},{label:e("security.sensitiveData.data sheet"),prop:"data_table",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query")},{label:e("security.sensitiveData.Data table primary key"),prop:"primary_key",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query"),width:100},{label:e("security.sensitiveData.Sensitive fields"),prop:"data_fields",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query"),render:"tags"},{label:e("State"),prop:"status",align:"center",render:"tag",custom:{0:"danger",1:"success"},replaceValue:{0:e("Disable"),1:e("security.sensitiveData.Modifying monitoring")}},{label:e("Update time"),prop:"update_time",align:"center",render:"datetime",sortable:"custom",operator:"RANGE",width:160},{label:e("Create time"),prop:"create_time",align:"center",render:"datetime",sortable:"custom",operator:"RANGE",width:160},{label:e("Operate"),align:"center",width:"130",render:"buttons",buttons:g(["edit","delete"]),operator:!1}],dblClickNotEditColumn:[void 0]},{defaultItems:{status:1}});return a.before.onSubmit=()=>{var o;a.form.items.fields=(o=r.value)==null?void 0:o.getDataFields()},S("baTable",a),F(()=>{a.form.extend.parentRef=r.value,a.table.ref=t.value,a.mount(),a.getData()}),(o,s)=>{const u=E("el-alert");return m(),C("div",K,[n(a).table.remark?(m(),I(u,{key:0,class:"ba-table-alert",title:n(a).table.remark,type:"info","show-icon":""},null,8,["title"])):z("",!0),f(_,{buttons:["refresh","add","edit","delete","comSearch","quickSearch","columnDisplay"],"quick-search-placeholder":n(e)("Quick search placeholder",{fields:n(e)("security.sensitiveData.controller")})},null,8,["quick-search-placeholder"]),f(x,{ref_key:"tableRef",ref:t},null,512),f(L,{ref_key:"formRef",ref:r},null,512)])}}});export{H as default};
