index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div class="sensitive-words">
  3. <pageSearch ref="searchTableRef" :searchConfig="searchConfig">
  4. <template #messageType="scope">
  5. <el-select
  6. v-model="scope.value"
  7. placeholder="请选择消息类型"
  8. @change="(newVal) => onMessageChange(scope, newVal)"
  9. >
  10. <el-option label="通知" value="notice"></el-option>
  11. <el-option label="警告" value="warning"></el-option>
  12. <el-option label="错误" value="error"></el-option>
  13. </el-select>
  14. </template>
  15. <template #reportType="scope">
  16. <el-select
  17. v-model="scope.value"
  18. placeholder="请选择通报事项类别"
  19. @change="(newVal) => onMessageChange(scope, newVal)"
  20. >
  21. <el-option label="通知" value="notice"></el-option>
  22. <el-option label="警告" value="warning"></el-option>
  23. <el-option label="错误" value="error"></el-option>
  24. </el-select>
  25. </template>
  26. <template #reportEvent="scope">
  27. <el-select
  28. v-model="scope.value"
  29. placeholder="请选择通报事项"
  30. @change="(newVal) => onMessageChange(scope, newVal)"
  31. >
  32. <el-option label="通知" value="notice"></el-option>
  33. <el-option label="警告" value="warning"></el-option>
  34. <el-option label="错误" value="error"></el-option>
  35. </el-select>
  36. </template>
  37. </pageSearch>
  38. <pageContent ref="tableListRef" :total="total" :contentConfig="contentConfig" :pageList="tableData">
  39. <template #button>
  40. <el-button type="primary" @click="handleCheck()">导出</el-button>
  41. </template>
  42. <template #operate="scope">
  43. <el-button type="primary" link @click="handleCheck(scope.row.rentalCompanyId)">
  44. 查看
  45. </el-button>
  46. <el-button type="primary" link @click="handleDelete(scope.row.rentalCompanyId)">
  47. 发布通报
  48. </el-button>
  49. <el-button type="primary" link @click="handleDelete(scope.row.rentalCompanyId)">
  50. 不予通报
  51. </el-button>
  52. </template>
  53. </pageContent>
  54. </div>
  55. </template>
  56. <script setup lang="ts">
  57. import { useRouter } from 'vue-router';
  58. import contentConfig from './config/content.config';
  59. import pageContent from '@/components/components/pageContent.vue';
  60. import searchConfig from './config/search.config';
  61. import pageSearch from '@/components/components/pageSearch.vue';
  62. import useSystemStore from '@/store/main';
  63. const systemStore = useSystemStore();
  64. const total = ref(0);
  65. const pageSize = ref([10, 20, 30]);
  66. const tableData = ref([]);
  67. const tableListRef = ref();
  68. const router = useRouter()
  69. // 操作弹框
  70. import usePageModal from '@/components/components/hooks/usePageDetails';
  71. const { modalRef, handleNewDataClick, handleEditDataClick, handleCheckDataClick, handlePageDetail } =
  72. usePageModal();
  73. const handleCheck = async (id?: string) => {
  74. router.push({
  75. path: 'inquiryDetails',
  76. query: { type: 'detail' }
  77. });
  78. };
  79. const onMessageChange = (scope, newVal) => {
  80. scope.onInput(newVal);
  81. }
  82. // 新增按钮
  83. const handleAdd = () => {
  84. router.push({
  85. name: 'addPublish',
  86. query: { type: 'add' }
  87. });
  88. };
  89. const searchTableRef = ref();
  90. const onClickDeleta = async (row: any) => {
  91. ElMessageBox.confirm('确认删除此条数据吗?', '删除', {
  92. confirmButtonText: '确认',
  93. cancelButtonText: '取消',
  94. type: 'warning',
  95. }).then(() => {
  96. // 删除后的回调
  97. });
  98. };
  99. // 删除按钮
  100. function handleDelete(value: any) {
  101. ElMessageBox.confirm('是否删除这条数据?', '删除提示', {
  102. confirmButtonText: '确定',
  103. cancelButtonText: '取消',
  104. type: 'warning',
  105. })
  106. .then(() => {
  107. systemStore.deletePageDataAction(contentConfig.pageName, value);
  108. })
  109. .catch(() => {
  110. ElMessage({
  111. type: 'info',
  112. message: '取消删除',
  113. });
  114. });
  115. }
  116. // 筛选-状态赋值
  117. async function searchItem() {
  118. searchConfig.formItems.forEach(item => {
  119. if (item.prop === 'status') {
  120. // item.options = searchList.value;
  121. }
  122. });
  123. }
  124. searchItem();
  125. </script>
  126. <style scoped lang="scss">
  127. .sensitive-words {
  128. margin: 20px;
  129. // background-color: #fff;
  130. }
  131. .status {
  132. cursor: pointer;
  133. position: relative;
  134. .status-tip {
  135. position: absolute;
  136. top: 2px;
  137. left: 60px;
  138. }
  139. }
  140. .dialog-tip {
  141. text-align: center;
  142. }
  143. </style>