zhuoyuan.wang
2024-06-19 15ebe96f28cadec6a726c5324593a40bbf56205f
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<template>
  <app-layout-row>
    <app-layout-col :span="24">
      <app-table-search
        v-bind="searchProps"
      />
    </app-layout-col>
    <app-layout-col :span="24" :top="10">
      <app-table-pro
        v-bind="tableProps"
        v-loading="appStore.getLoading('getEntitySet')"
      />
    </app-layout-col>
  </app-layout-row>
</template>
 
<script setup>
import {useEntityStore, useAppStore} from '@/store/modules';
import {convertFilter} from '@/utils/filter.js';
 
const props = defineProps({
  subCurrent: {
    type: Function,
    default: () => {
    }
  }
});
 
const tableSearchRef = ref();
const tableProRef = ref();
const entityStore = useEntityStore();
const appStore = useAppStore();
 
const formFields = [
  {
    type: 'el-input',
    prop: 'code',
    col: {
      span: 8
    },
    item: {
      label: '文件名称',
      prop: 'code',
    },
    input: {
      placeholder: '请输入'
    }
  }
];
 
const tableProps = {
  ref: tableProRef,
  apiParams: {},
  subRequest: async (page) => {
    const result = await entityStore.getOldEntitySet({
      dataName: "templateFile",
      attachMeta: false,
      filter: convertFilter({
        andEqParams: {
          is_edit: 1
        },
        andLikeParams: tableProps.apiParams
      }),
      ...page
    });
    return result;
  },
  subCurrent(row) {
    props.subCurrent(row);
  },
  title: '操作手册',
  // 编码 账号 是否初始密码 是否启用 备注 创建时间 修改时间 角色
  columns: [
    {
      prop: 'id',
      label: "序号",
      table: {
        sortable: 'id',
        width: 80
      },
      card: {
        span: 8
      }
    },
    {
      prop: 'template_name',
      label: "文件名称",
      table: {
        sortable: 'template_name',
      },
      card: {
        span: 8
      }
    },
    {
      prop: 'create_time',
      label: "上传时间",
      table: {
        sortable: 'template_name',
      },
      card: {
        span: 8
      }
    },
    {
      prop: 'file_id',
      label: "下载",
      table: {
        sortable: 'file_id',
        width: 80
      },
      card: {
        span: 8
      }
    },
    {
      prop: 'file_id',
      label: "预览",
      table: {
        sortable: 'file_id',
        width: 80
      },
      card: {
        span: 8
      }
    },
  ]
};
 
const searchProps = {
  ref: tableSearchRef,
  formFields,
  subSubmit: (params) => {
    tableProps.apiParams = params;
    tableProRef.value.getTableData(true);
  }
}
 
onMounted(() => {
 
  tableProps.apiParams = tableSearchRef.value.formFields.getModel();
 
  tableProRef.value.getTableData(true);
 
});
 
 
</script>