index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div class="sensitive-words">
  3. <pageSearch ref="searchTableRef" :searchConfig="searchConfig"></pageSearch>
  4. <pageContent ref="tableListRef" :total="total" :contentConfig="contentConfig" :pageList="tableData">
  5. <template #button>
  6. <el-button type="primary" @click="handleCheck()">批量查看</el-button>
  7. <el-button type="primary" @click="onExport()">导出</el-button>
  8. </template>
  9. <template #operate="scope">
  10. <el-button type="primary" link @click="handleDetails(scope.row.rentalCompanyId)"> 查看 </el-button>
  11. </template>
  12. </pageContent>
  13. </div>
  14. </template>
  15. <script setup lang="ts">
  16. import { useRouter } from 'vue-router';
  17. import contentConfig from './config/content.config';
  18. import pageContent from '@/components/components/pageContent.vue';
  19. import searchConfig from './config/search.config';
  20. import pageSearch from '@/components/components/pageSearch.vue';
  21. import useSystemStore from '@/store/main';
  22. import { outTypeList } from '@/libs/commonMeth';
  23. const allNotificationStatus = outTypeList('bj_notify_os'); // 通报整体状态
  24. const bj_notification_type = outTypeList('bj_notification_type'); //通报类型
  25. const categoryOnm = outTypeList('bj_category_onm'); // 通报事项类别
  26. const notificationStatus = outTypeList('bj_notification_status'); // 通报状态
  27. const isFeedback = outTypeList('bj_is_feedback'); // 是否需要反馈
  28. const overdueStatus = outTypeList('bj_overdue_status'); // 超期状态
  29. const takeMeasures = outTypeList('bj_take_measures'); // 采取措施
  30. const bj_lssuing_unit = outTypeList('bj_lssuing_unit'); //发出单位
  31. const systemStore = useSystemStore();
  32. const total = ref(0);
  33. const pageSize = ref([10, 20, 30]);
  34. const tableData = ref([]);
  35. const tableListRef = ref();
  36. const router = useRouter();
  37. // 操作弹框
  38. import usePageModal from '@/components/components/hooks/usePageDetails';
  39. const { modalRef, handleNewDataClick, handleEditDataClick, handleCheckDataClick, handlePageDetail } =
  40. usePageModal();
  41. const handleDetails = async (id: string) => {
  42. router.push({
  43. name: 'viewHistoricalDataDetail',
  44. query: { type: 'detail' },
  45. });
  46. };
  47. // 导出
  48. const onExport = () => {
  49. ElMessage.success('小编在努力开发中。。。');
  50. return;
  51. };
  52. const handleCheck = () => {
  53. ElMessage.success('小编在努力开发中。。。');
  54. return;
  55. };
  56. const searchTableRef = ref();
  57. const onClickDeleta = async (row: any) => {
  58. ElMessageBox.confirm('确认删除此条数据吗?', '删除', {
  59. confirmButtonText: '确认',
  60. cancelButtonText: '取消',
  61. type: 'warning',
  62. }).then(() => {
  63. // 删除后的回调
  64. });
  65. };
  66. // 删除按钮
  67. function handleDelete(value: any) {
  68. ElMessageBox.confirm('是否删除这条数据?', '删除提示', {
  69. confirmButtonText: '确定',
  70. cancelButtonText: '取消',
  71. type: 'warning',
  72. })
  73. .then(() => {
  74. systemStore.deletePageDataAction(contentConfig.pageName, value);
  75. })
  76. .catch(() => {
  77. ElMessage({
  78. type: 'info',
  79. message: '取消删除',
  80. });
  81. });
  82. }
  83. // 筛选-状态赋值
  84. async function searchItem() {
  85. searchConfig.formItems.forEach(item => {
  86. if (item.prop === 'notificationType') {
  87. item.options = bj_notification_type;
  88. }
  89. if (item.prop === 'conm') {
  90. item.options = categoryOnm;
  91. }
  92. if (item.prop === 'publishingUnit') {
  93. item.options = bj_lssuing_unit;
  94. }
  95. if (item.prop === 'notificationStatus') {
  96. item.options = notificationStatus;
  97. }
  98. if (item.prop === 'takeMeasures') {
  99. item.options = takeMeasures;
  100. }
  101. if (item.prop === 'overdueStatus') {
  102. item.options = overdueStatus;
  103. }
  104. if (item.prop === 'wfir') {
  105. item.options = isFeedback;
  106. }
  107. });
  108. }
  109. searchItem();
  110. </script>
  111. <style scoped lang="scss">
  112. .sensitive-words {
  113. margin: 20px;
  114. }
  115. .status {
  116. cursor: pointer;
  117. position: relative;
  118. .status-tip {
  119. position: absolute;
  120. top: 2px;
  121. left: 60px;
  122. }
  123. }
  124. .dialog-tip {
  125. text-align: center;
  126. }
  127. </style>