

<script>
/* eslint-disable */
// sd-skip-auto-import
import{Modal,message}from"ant-design-vue";import crossWindowWatcher from"@/common/services/cross-window-watcher";import TableColumnTypes from"@/common/services/table-column-types";import TableActionTypes from"@/common/services/table-action-types";import axios from"@/common/services/axios-instance";import codeExport from"./code-export";import components from"./_import-components/sd-list-import";var _render=function e(){var t=this,r=t._self._c;return r("a-card",[r("sd-data-table",{ref:"table",attrs:{"data-url":"api/framework/v1/onlineform/list",columns:t.columns,actions:t.actions,"search-fields":["tableTxt"],"show-selection":e=>!e.isDbSynch},on:{rowClick:t.rowClick}})],1)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdList",metaInfo:{title:"表单设计"},components:components,data(){return{columns:[{title:"名称",dataIndex:"tableTxt",sdClickable:true,width:"35%"},{title:"英文名",dataIndex:"tableName",sdClickable:true,width:"25%"},{title:"已建表",dataIndex:"isDbSynch",sdRender:TableColumnTypes.iconCheck,width:"10%"},{title:"创建者",dataIndex:"createBy",width:"10%"},{title:"创建时间",dataIndex:"createTime",sdRender:TableColumnTypes.dateTime,defaultSortOrder:"descend",sorter:true,sortDirections:["ascend","descend"],width:"20%"}],actions:[{label:"删除",id:"delete",type:TableActionTypes.batch,permission:null,callback:this.delete},{label:"新建",id:"new",type:TableActionTypes.primary,permission:null,callback:this.openForm},{label:"新建无流程表单",id:"new2",permission:null,callback:this.newFlowless},{label:"新建手动布局表单",id:"new3",permission:null,callback:this.newLayoutable},{label:"发布",id:"publish",type:TableActionTypes.inline,callback:this.publish,hidden(e){return e.isDbSynch}},{label:"导出",id:"export",type:TableActionTypes.inline,callback:this.export}]}},methods:{export(e){return axios.get(`api/framework/v1/onlineform/getById/${e.id}/true`).then((e=>codeExport(e.data)))},publish(e){return axios.post(`api/framework/v1/onlineform/doDbSynch/${e.id}/normal`).then((()=>{this.$refs.table.refresh()}))},rowClick(e){this.openForm(e.id)},newFlowless(){crossWindowWatcher.waitForChanged("/sd-form-designer?type=0").then((e=>{if(e)this.$refs.table.refresh()}))},newLayoutable(){crossWindowWatcher.waitForChanged("/sd-form-designer?layoutable=1").then((e=>{if(e)this.$refs.table.refresh()}))},openForm(e){let t;if(e)t=`/sd-form-designer/${e}`;else t="/sd-form-designer";crossWindowWatcher.waitForChanged(t).then((e=>{if(e)this.$refs.table.refresh()}))},delete(e){return new Promise((t=>{Modal.confirm({title:"您确定删除这项内容吗？",content:"删除这条数据后，就无法恢复初始的状态。",okText:"删除",okType:"danger",onOk:()=>{axios.delete("api/framework/v1/onlineform/deleteBatch",{params:{ids:e.join(","),flag:"0"}}).catch((e=>{const t="删除失败";message.error(t);return Promise.reject(e)})).then((()=>{this.$refs.table.clearSelection();this.$refs.table.refresh(true)})).finally(t)},onCancel:()=>{t()}})}))}},render:_render,staticRenderFns:staticRenderFns};</script>

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