

<script>
/* eslint-disable */
// sd-skip-auto-import
import PageService from"@/common/services/page-service";import components from"./_import-components/sd-data-list-import";export const metaInfo={caption:"数据列表",component:{props:["designerData"],render(){const t=arguments[0];return t("span",["== 显示列表 ",this.designerData.attrFD.formItemProps.inputProps.dataList?.name," =="])}},icon:"sd-list3",order:2100,hiddenProps:["readonly","required","name","caption","description","mobileVisible"],excludeFormTypes:[3]};export const fieldProps={dataType:"string",attr:{},attrFD:{columns:4,transient:true,hideLabel:true}};var _render=function t(){var e=this,r=e._self._c;return r("div",[r("a-form-model-item",{attrs:{label:"关联列表",prop:"attrFD.formItemProps.inputProps.dataList",rules:[{required:true}]}},[r("sd-tree-picker",{attrs:{single:"","load-tree-data":e.loadListTreeData,"search-tree-data":e.searchTreeData},model:{value:e.formList,callback:function(t){e.formList=t},expression:"formList"}})],1),r("sd-list-variable-config",{attrs:{activated:e.activated,"module-id":e.formModuleId,"form-list-id":e.formListId,"formula-fields":e.componentInstances.filter((t=>t.name!==e.component.name))},model:{value:e.customFields,callback:function(t){e.customFields=t},expression:"customFields"}})],1)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdDataList",components:{...components},data(){return{activated:false}},computed:{formList:{get(){if(this.component.attrFD.formItemProps?.inputProps?.dataList)return[this.component.attrFD.formItemProps.inputProps.dataList];return[]},set(t){if(t[0]){if(this.component.attrFD.formItemProps?.inputProps?.dataList?.id!==t[0].id)this.$set(this.component.attrFD.formItemProps.inputProps,"dataList",t[0])}else this.$delete(this.component.attrFD.formItemProps.inputProps,"dataList")}},formModuleId(){return this.component.attrFD.formItemProps?.inputProps?.dataList?.props?.appModuleId},formListId(){return this.component.attrFD.formItemProps?.inputProps?.dataList?.id},customFields:{get(){return this.component.attrFD.formItemProps?.inputProps?.dataList?.customFields||[]},set(t){this.$set(this.component.attrFD.formItemProps.inputProps.dataList,"customFields",t)}}},methods:{onComponentActivated(){this.activated=true},beforeComponentInactive(){this.activated=false},loadListTreeData(t,e){if(!t)return this.loadFormListData();else return PageService.getList({startPosition:0,maxResults:-1,expressions:[{dataType:"str",name:"appModuleId",op:"eq",stringValue:t}],formId:"weAppFormList",orderBy:"sortNumber asc,id asc",columns:"id,name"}).then((r=>r.data.data.map((r=>({id:r.id,name:r.name,checkable:true,isLeaf:true,props:{appModuleId:t,isFlow:e.props.isFlow}})))))},loadFormListData(t){const e=[{dataType:"str",name:"appId",op:"eq",stringValue:this.formProps.formCategory}];if(t)e.push({dataType:"str",name:"name",op:"like",stringValue:`%${t}%`});const r={startPosition:0,maxResults:-1,expressions:e,formId:"weAppModule",columns:"id,name,isFlow"};return PageService.getList(r).then((t=>t.data.data.map((t=>({id:t.id,name:t.name,checkable:false,isLeaf:false,props:{isFlow:"流程"===t.isFlow}})))))},searchTreeData(t){return this.loadFormListData(t)}},render:_render,staticRenderFns:staticRenderFns};</script>

<style module lang="scss">
@use '@/common/design' as *;
</style>
