index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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="handleExport()">导出</el-button>
  41. </template>
  42. <template #operate="scope">
  43. <el-button type="primary" plain @click="handleCheck(scope.row.releasedId)"> 查看 </el-button>
  44. <el-button type="primary" plain @click="handlePublish(scope.row.releasedId)"> 发布通报 </el-button>
  45. <el-button type="primary" @click="handleStatus(scope.row.releasedId, '2', '不予通报')">
  46. 不予通报
  47. </el-button>
  48. </template>
  49. </pageContent>
  50. </div>
  51. </template>
  52. <script setup lang="ts">
  53. import { useRouter } from 'vue-router';
  54. import contentConfig from './config/content.config';
  55. import pageContent from '@/components/components/pageContent.vue';
  56. import searchConfig from './config/search.config';
  57. import pageSearch from '@/components/components/pageSearch.vue';
  58. import useSystemStore from '@/store/main';
  59. import { outTypeList } from '@/libs/commonMeth';
  60. const systemStore = useSystemStore();
  61. import {
  62. categoryOnm,
  63. notificationStatus,
  64. isFeedback,
  65. overdueStatus,
  66. takeMeasures,
  67. bj_notification_type,
  68. bj_ship_delayed,
  69. bj_hand_opinion,
  70. bj_lssuing_unit,
  71. bj_initial_review_mark,
  72. } from '@/plugins/dictData';
  73. const bj_ship_port_registration = outTypeList('bj_ship_port_registration'); // 船港籍
  74. const bj_ship_type = outTypeList('bj_ship_type'); // 船舶种类
  75. const total = ref(0);
  76. const pageSize = ref([10, 20, 30]);
  77. const tableData = ref([]);
  78. const tableListRef = ref();
  79. const router = useRouter();
  80. // 操作弹框
  81. import usePageModal from '@/components/components/hooks/usePageDetails';
  82. const { modalRef, handleNewDataClick, handleEditDataClick, handleCheckDataClick, handlePageDetail } =
  83. usePageModal();
  84. const handleCheck = async (id?: string) => {
  85. router.push({
  86. path: '/notificationInfoInquiry/shipRegistrationDetail',
  87. query: { type: 'detail' },
  88. });
  89. };
  90. const handleExport = () => {
  91. ElMessage.success('小编在努力开发中。。。');
  92. return;
  93. };
  94. const onMessageChange = (scope, newVal) => {
  95. scope.onInput(newVal);
  96. };
  97. // 通报发布
  98. const handlePublish = releasedId => {
  99. ElMessage.success('小编在努力开发中。。。');
  100. return;
  101. router.push({
  102. path: '/notificationInfoInquiry/publish',
  103. query: { type: 'edit', releasedId: releasedId },
  104. });
  105. };
  106. const searchTableRef = ref();
  107. // 状态按钮
  108. function handleStatus(value: string, status: string, str: string) {
  109. ElMessage.success('小编在努力开发中。。。');
  110. return;
  111. // ElMessageBox.confirm(`是否${str}这条数据?`, '状态提示', {
  112. // confirmButtonText: '确定',
  113. // cancelButtonText: '取消',
  114. // type: 'warning',
  115. // })
  116. // .then(async () => {
  117. // const postData: any = await changeInventoryStatus(value, status);
  118. // if (postData.code === 200) {
  119. // tableListRef.value[0].fetchPageListData();
  120. // ElMessage.success('操作成功!');
  121. // } else {
  122. // ElMessage.error('操作失败!');
  123. // }
  124. // })
  125. // .catch(() => {
  126. // ElMessage({
  127. // type: 'info',
  128. // message: '取消操作',
  129. // });
  130. // });
  131. }
  132. // 删除按钮
  133. function handleDelete(value: any) {
  134. ElMessageBox.confirm('是否删除这条数据?', '删除提示', {
  135. confirmButtonText: '确定',
  136. cancelButtonText: '取消',
  137. type: 'warning',
  138. })
  139. .then(() => {
  140. systemStore.deletePageDataAction(contentConfig.pageName, value);
  141. })
  142. .catch(() => {
  143. ElMessage({
  144. type: 'info',
  145. message: '取消删除',
  146. });
  147. });
  148. }
  149. // 筛选-状态赋值
  150. async function searchItem() {
  151. searchConfig.formItems.forEach(item => {
  152. if (item.prop === 'status') {
  153. // item.options = searchList.value;
  154. }
  155. });
  156. }
  157. searchItem();
  158. </script>
  159. <style scoped lang="scss">
  160. .sensitive-words {
  161. margin: 20px;
  162. // background-color: #fff;
  163. }
  164. .status {
  165. cursor: pointer;
  166. position: relative;
  167. .status-tip {
  168. position: absolute;
  169. top: 2px;
  170. left: 60px;
  171. }
  172. }
  173. .dialog-tip {
  174. text-align: center;
  175. }
  176. </style>