|
|
@@ -1,34 +1,19 @@
|
|
|
+import { queryTableList as query } from '@/common/setup/table/list';
|
|
|
import { QueryCustomInfo } from '@/services/go/ermcp/customInfo';
|
|
|
import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
|
|
|
import { QueryCustomInfoEnum } from '@/services/go/ermcp/customInfo/type';
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
|
/**
|
|
|
* 获取表格列表数据
|
|
|
- * @param type
|
|
|
- * @returns
|
|
|
+ * @param type
|
|
|
+ * @returns
|
|
|
*/
|
|
|
export function queryTableList(type: QueryCustomInfoEnum) {
|
|
|
- // 加载状态
|
|
|
- const loading = ref<boolean>(false);
|
|
|
- // 表格数据
|
|
|
- const tableList = ref<QueryCustomInfoType[]>([]);
|
|
|
- function queryTable() {
|
|
|
- QueryCustomInfo(type)
|
|
|
- .then((res) => {
|
|
|
- tableList.value = res.map((e, i) => {
|
|
|
- return { ...e, key: String(i) };
|
|
|
- });
|
|
|
- loading.value = false;
|
|
|
- console.log('查询列表', tableList);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- message.error(err);
|
|
|
- loading.value = false;
|
|
|
- });
|
|
|
+ const { loading, tableList, queryTable: temp } = query<QueryCustomInfoType>()
|
|
|
+ const fn = () => {
|
|
|
+ temp(QueryCustomInfo, type)
|
|
|
}
|
|
|
- return { loading, tableList, queryTable }
|
|
|
+ return { loading, tableList, queryTable: fn }
|
|
|
}
|
|
|
|
|
|
|