index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="device-manager-box">
  4. <BasicTable @register="register">
  5. <template #filterCell="{ column, record }">
  6. <template v-if="column.key === 'moduleData.main'">
  7. <div v-for="(val, key) in record.moduleData.main" :key="key">
  8. <span>点位:{{ key }};</span>
  9. <span>名称:{{ val }};</span>
  10. </div>
  11. </template>
  12. <template v-if="column.key === 'moduleData.header'">
  13. <div v-for="(val, key) in record.moduleData.header" :key="key">
  14. <span>点位:{{ key }};</span>
  15. <span>名称:{{ val }};</span>
  16. </div>
  17. </template>
  18. <template v-if="column.key === 'moduleData.chart'">
  19. <div v-for="(val, key) in record.moduleData.chart" :key="key">
  20. <span>点位:{{ key }};</span>
  21. <span>名称:{{ val }};</span>
  22. </div>
  23. </template>
  24. <template v-if="column.key === 'showStyle.size'">
  25. {{ get(ModuleSizeMap, record.showStyle?.size) }}
  26. </template>
  27. <template v-if="column.key === 'showStyle.version'">
  28. {{ get(ModuleVersionMap, record.showStyle?.version) }}
  29. </template>
  30. <template v-if="column.key === 'showStyle.position'">
  31. {{ get(ModulePositionMap, record.showStyle?.position) }}
  32. </template>
  33. <template v-if="column.key === 'showStyle.charttype'">
  34. {{ get(ModuleChartTypeMap, record.showStyle?.charttype) }}
  35. </template>
  36. </template>
  37. </BasicTable>
  38. </div>
  39. </template>
  40. <script lang="ts" name="system-user" setup>
  41. // 相关文档请参阅 vent/home/configurable/README.md
  42. // import NormalTable from '../comment/NormalTable.vue';
  43. import { list, deleteById, saveOrUpdate } from './configuration.api';
  44. import { ModuleVersionMap, ModuleChartTypeMap, ModulePositionMap, ModuleSizeMap } from './options';
  45. import { searchFormSchema, columns, formSchema } from './configuration.data';
  46. import { get } from '../../home/billboard/utils';
  47. import BasicTable from '/@/components/Table/src/BasicTable.vue';
  48. import { useListPage } from '/@/hooks/system/useListPage';
  49. const { tableContext } = useListPage({
  50. tableProps: {
  51. api: list,
  52. columns: columns, //表格列
  53. useSearchForm: true,
  54. formConfig: {
  55. schemas: searchFormSchema,
  56. },
  57. },
  58. });
  59. //BasicTable绑定注册,methods包含的方法参考下方Methods的api
  60. const [register, methods] = tableContext;
  61. </script>
  62. <style scoped></style>