index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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="handleAdd()">导出</el-button>
  7. </template>
  8. <template #operate="scope">
  9. <el-button type="primary" link @click="handleDetails(scope.row.rentalCompanyId)"> 查看 </el-button>
  10. <!-- <el-button type="primary" link @click="handleDelete(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 handleAdd = () => {
  49. router.push({
  50. name: 'addPublish',
  51. query: { type: 'add' },
  52. });
  53. };
  54. const searchTableRef = ref();
  55. const onClickDeleta = async (row: any) => {
  56. ElMessageBox.confirm('确认删除此条数据吗?', '删除', {
  57. confirmButtonText: '确认',
  58. cancelButtonText: '取消',
  59. type: 'warning',
  60. }).then(() => {
  61. // 删除后的回调
  62. });
  63. };
  64. // 删除按钮
  65. function handleDelete(value: any) {
  66. ElMessageBox.confirm('是否删除这条数据?', '删除提示', {
  67. confirmButtonText: '确定',
  68. cancelButtonText: '取消',
  69. type: 'warning',
  70. })
  71. .then(() => {
  72. systemStore.deletePageDataAction(contentConfig.pageName, value);
  73. })
  74. .catch(() => {
  75. ElMessage({
  76. type: 'info',
  77. message: '取消删除',
  78. });
  79. });
  80. }
  81. // 筛选-状态赋值
  82. async function searchItem() {
  83. searchConfig.formItems.forEach(item => {
  84. if (item.prop === 'notificationType') {
  85. item.options = bj_notification_type;
  86. }
  87. if (item.prop === 'conm') {
  88. item.options = categoryOnm;
  89. }
  90. if (item.prop === 'publishingUnit') {
  91. item.options = bj_lssuing_unit;
  92. }
  93. if (item.prop === 'notificationStatus') {
  94. item.options = notificationStatus;
  95. }
  96. if (item.prop === 'takeMeasures') {
  97. item.options = takeMeasures;
  98. }
  99. if (item.prop === 'overdueStatus') {
  100. item.options = overdueStatus;
  101. }
  102. if (item.prop === 'wfir') {
  103. item.options = isFeedback;
  104. }
  105. });
  106. }
  107. searchItem();
  108. </script>
  109. <style scoped lang="scss">
  110. .sensitive-words {
  111. margin: 20px;
  112. }
  113. .status {
  114. cursor: pointer;
  115. position: relative;
  116. .status-tip {
  117. position: absolute;
  118. top: 2px;
  119. left: 60px;
  120. }
  121. }
  122. .dialog-tip {
  123. text-align: center;
  124. }
  125. </style>