1 |
- var h=Object.defineProperty;var b=(o,e,a)=>e in o?h(o,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[e]=a;var l=(o,e,a)=>(b(o,typeof e!="symbol"?e+"":e,a),a);import{b as g,d as y,T as _}from"./baTable-MdxYOkAk.js";import{c as x,b as f,aj as k,a1 as v}from"./index-EwE51S_X.js";import D from"./popupForm-KPsZelp2.js";import{T as L}from"./index-K8IR974I.js";import{d as F,a2 as R,a as c,av as w,o as E,K as q,e as m,f as T,u as n,y as z,C,j as d}from"./vue-A59npLRR.js";import"./echarts-cxb9vJr1.js";import"./index-r6iTpmP6.js";import"./validate-_EUdkMt3.js";import"./index-XALue448.js";const u="/admin/security.SensitiveData/";function S(){return x({url:u+"add",method:"get"})}class I extends g{constructor(a,t,r={},i={},s={}){super(a,t,r,i,s);l(this,"requestEdit",a=>(this.runBefore("requestEdit",{id:a}),this.form.loading=!0,this.form.items={},this.api.edit({id:a}).then(t=>{const r=[],i=[];for(const s in t.data.row.data_fields)r.push(s),i.push({name:s,value:t.data.row.data_fields[s]??""});this.form.extend=Object.assign(this.form.extend,{tableList:t.data.tables,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(i)),t.data.row.data_fields=r,this.form.loading=!1,this.form.items=t.data.row,this.runAfter("requestEdit",{res:t})})));l(this,"onTableChange",a=>{this.form.extend=Object.assign(this.form.extend,{fieldLoading:!0,fieldList:{},fieldSelect:{},fieldSelectKey:f()}),this.form.items.data_fields=[],this.form.extend.parentRef&&this.form.extend.parentRef.setDataFields([]),k(a).then(t=>{this.form.items.primary_key=t.data.pk,this.form.defaultItems.primary_key=t.data.pk;const r={};for(const i in t.data.fieldList)r[i]=(i?i+" - ":"")+t.data.fieldList[i];this.form.extend=Object.assign(this.form.extend,{fieldLoading:!1,fieldList:t.data.fieldList,fieldSelect:r,fieldSelectKey:f()})})});l(this,"toggleForm",(a="",t=[])=>{if(this.runBefore("toggleForm",{operate:a,operateIds:t}),this.form.ref&&this.form.ref.resetFields(),this.form.extend.parentRef&&this.form.extend.parentRef.setDataFields([]),a=="Edit"){if(!t.length)return!1;this.requestEdit(t[0])}else a=="Add"&&(this.form.loading=!0,S().then(r=>{this.form.extend=Object.assign(this.form.extend,{tableList:r.data.tables,controllerList:r.data.controllers}),this.form.items=Object.assign({},this.form.defaultItems),this.form.loading=!1}));this.form.operate=a,this.form.operateIds=t,this.runAfter("toggleForm",{operate:a,operateIds:t})})}}const j={class:"default-main ba-table-box"},Q=F({name:"security/dataRecycle",__name:"index",setup(o){const{t:e}=R(),a=c(),t=c(),r=new I(new v(u),{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("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:y(["edit","delete"]),operator:!1}],dblClickNotEditColumn:[void 0]},{defaultItems:{status:"1"}},{onSubmit:()=>{r.form.items.fields=t.value.getDataFields()}});return w("baTable",r),E(()=>{r.form.extend=Object.assign({},r.form.extend,{parentRef:t.value}),r.table.ref=a.value,r.mount(),r.getIndex()}),(i,s)=>{const p=q("el-alert");return m(),T("div",j,[n(r).table.remark?(m(),z(p,{key:0,class:"ba-table-alert",title:n(r).table.remark,type:"info","show-icon":""},null,8,["title"])):C("",!0),d(L,{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"]),d(_,{ref_key:"tableRef",ref:a},null,512),d(D,{ref_key:"formRef",ref:t},null,512)])}}});export{Q as default};
|