干燥机配套车间生产管理系统/云平台服务端
bsw215583320
2024-04-16 c2fccb01b972176dc3da5a497b5e904025e9e98d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<#--noinspection JSDuplicatedDeclaration-->
<#list subTables as sub>
#segment#${sub.entityName}SubTable.vue
<template>
  <div>
  <#assign list_need_category=false>
  <#assign list_need_pca=false>
  <#assign bpm_flag=false>
 
  <#-- 开始循环 -->
  <#list columns as po>
  <#if po.fieldDbName=='bpm_status'>
    <#assign bpm_flag=true>
  </#if>
  <#if po.classType=='cat_tree' && po.dictText?default("")?trim?length == 0>
  <#assign list_need_category=true>
  </#if>
  <#if po.classType=='pca'>
  <#assign list_need_pca=true>
  </#if>
  </#list>
  <#-- 结束循环 -->
      <!--引用表格-->
     <BasicTable bordered size="middle" :loading="loading" rowKey="id" :canResize="false" :columns="${sub.entityName?uncap_first}Columns" :dataSource="dataSource" :pagination="false">
        <!--字段回显插槽-->
        <template #htmlSlot="{text}">
           <div v-html="text"></div>
        </template>
        <template #fileSlot="{text}">
           <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
           <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
        </template>
      </BasicTable>
    </div>
</template>
 
<script lang="ts" setup>
  import {ref,watchEffect} from 'vue';
  import {BasicTable} from '/@/components/Table';
  import {${sub.entityName?uncap_first}Columns} from '../${entityName}.data';
  import {${sub.entityName?uncap_first}List} from '../${entityName}.api';
 
  const props = defineProps({
    id: {
       type: String,
       default: '',
     },
  })
 
  const loading = ref(false);
  const dataSource = ref([]);
 
  watchEffect(() => {
      props.id && loadData(props.id);
   });
 
   function loadData(id) {
         dataSource.value = []
         loading.value = true
          ${sub.entityName?uncap_first}List({id}).then((res) => {
           if (res.success) {
              dataSource.value = res.result.records
           }
         }).finally(() => {
           loading.value = false
         })
    }
</script>
</#list>