index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <template>
  2. <el-container>
  3. <el-header height="60px" class="content-header">
  4. <MyHeader :title="'统一接入反馈表'" :formData="headerFormData" @submit="handleHeaderFormSubmit"></MyHeader>
  5. </el-header>
  6. <el-container>
  7. <el-main>
  8. <MyTableHeader
  9. :title="tableHeaderTitle"
  10. :tabs="tabs"
  11. :buttons="buttons"
  12. @tabClick="handleTabClick"
  13. @buttonClick="handleButtonClick"
  14. ></MyTableHeader>
  15. <MyTable
  16. :tableData="tableData"
  17. :formData="formData"
  18. :minWidth="400"
  19. @selection-change="handleSelectionChange"
  20. >
  21. <!-- 自定义操作按钮,传递 row 和 index -->
  22. <template #operation="{ row ,$index}">
  23. <el-button size="mini" @click="handleView(row, $index)" type="primary">查看</el-button>
  24. <el-button size="mini" @click="handleEdit(row, $index)" type="primary">编辑</el-button>
  25. <el-button
  26. size="mini"
  27. @click="handleStop(row, $index)"
  28. type="primary"
  29. v-if="+row.isApply===1"
  30. >停用</el-button>
  31. <el-button
  32. size="mini"
  33. @click="handleStart(row, $index)"
  34. type="primary"
  35. v-if="+row.isApply===0"
  36. >启用</el-button>
  37. <el-button
  38. size="mini"
  39. @click="handleSubmit(row, $index)"
  40. type="primary"
  41. v-if="activeTabLable !== 2&&+row.status===2"
  42. >提交</el-button>
  43. <el-button
  44. size="mini"
  45. @click="handleRevoke(row, $index)"
  46. type="primary"
  47. v-if="activeTabLable !== 2&&+row.status===3"
  48. >撤回</el-button>
  49. <el-button size="mini" @click="handleCatalog(row, $index)" type="primary">编目</el-button>
  50. <el-button
  51. size="mini"
  52. @click="handleUpperChain(row, $index)"
  53. type="primary"
  54. v-if="activeTabLable !== 1"
  55. >上链</el-button>
  56. <el-button size="mini" @click="handleDelete(row)" type="primary">删除</el-button>
  57. </template>
  58. </MyTable>
  59. <MyPagination
  60. :total="tableTotal"
  61. :page-size="pageSize"
  62. :current-page="currentPage"
  63. @pageChange="pagi_changePage"
  64. @sizeChange="pagi_changeSize"
  65. ></MyPagination>
  66. </el-main>
  67. </el-container>
  68. <div v-if="showDialog">
  69. <FeedbackDialog v-model="showDialog" :title="title" :rowObj="rowObj" @confirm="confirmHandle"></FeedbackDialog>
  70. </div>
  71. </el-container>
  72. </template>
  73. <script>
  74. import {
  75. getTabAccessFeedbackList,
  76. delTabAccessFeedbackList,
  77. saveStepTabAccessReadyById,
  78. updateIsApplyById
  79. } from "@/api/unified-access/access-feedback.js";
  80. import FeedbackDialog from "./dialog/FeedbackDialog.vue";
  81. import MyHeader from "@/components/MyHeader";
  82. import MyTable from "@/components/MyTable";
  83. import MyPagination from "@/components/MyPagination";
  84. import MyTableHeader from "@/components/MyTableHeader";
  85. export default {
  86. name: "user-manage",
  87. components: {
  88. MyHeader,
  89. MyTableHeader,
  90. MyTable,
  91. MyPagination,
  92. FeedbackDialog
  93. },
  94. data() {
  95. return {
  96. rowObj: {},
  97. title: "",
  98. uploadUrl: process.env.VUE_APP_BASE_API + "/web/tab-file-info/upload",
  99. showDialog: false,
  100. searchForm: {},
  101. selectedRows: [], // 存储选中的行数据
  102. tableData: [],
  103. formData: [
  104. {
  105. label: "数据源所属单位部门",
  106. fieldName: "offerDept",
  107. type: "input",
  108. showInTable: true,
  109. value: "",
  110. width: ""
  111. },
  112. {
  113. label: "数据源联系人",
  114. fieldName: "persion",
  115. type: "input",
  116. showInTable: true,
  117. value: "",
  118. width: ""
  119. },
  120. {
  121. label: "数据源联系电话",
  122. fieldName: "phone",
  123. type: "input",
  124. showInTable: true,
  125. value: "",
  126. width: ""
  127. },
  128. {
  129. label: "数据源所属信息系统",
  130. fieldName: "offerSystem",
  131. type: "input",
  132. showInTable: true,
  133. value: "",
  134. width: ""
  135. },
  136. {
  137. label: "数据源所属信息系统IP",
  138. fieldName: "readyIp",
  139. type: "input",
  140. showInTable: true,
  141. value: "",
  142. width: ""
  143. },
  144. {
  145. label: "数据源所属信息系统端口",
  146. fieldName: "readyPort",
  147. type: "input",
  148. showInTable: true,
  149. value: "",
  150. width: ""
  151. },
  152. {
  153. label: "接收方所属单位部门",
  154. fieldName: "accessDept",
  155. type: "input",
  156. showInTable: true,
  157. value: "",
  158. width: ""
  159. },
  160. {
  161. label: "接收方所属信息系统",
  162. fieldName: "accessSystem",
  163. type: "input",
  164. showInTable: true,
  165. value: "",
  166. width: ""
  167. },
  168. // {
  169. // label: "数据项目",
  170. // fieldName: "address",
  171. // type: "input",
  172. // showInTable: true,
  173. // value: "",
  174. // width: ""
  175. // },
  176. // {
  177. // label: "拟/正式运行时间",
  178. // fieldName: "address",
  179. // type: "input",
  180. // showInTable: true,
  181. // value: "",
  182. // width: ""
  183. // },
  184. {
  185. label: "接入方式",
  186. fieldName: "dataAccessType",
  187. type: "input",
  188. showInTable: true,
  189. value: "",
  190. width: ""
  191. },
  192. {
  193. label: "状态",
  194. fieldName: "status",
  195. type: "input",
  196. showInTable: true,
  197. value: "",
  198. width: "80"
  199. }
  200. ],
  201. tableTotal: 0,
  202. pageSize: 10,
  203. currentPage: 1,
  204. treeSearchVal: "",
  205. tableHeaderTitle: "项目列表",
  206. activeTabLable: "",
  207. tabs: [
  208. { label: "全部", value: "", active: true },
  209. {
  210. label: "正式运行",
  211. value: 1,
  212. active: false
  213. },
  214. { label: "申请反馈", value: 2, active: false }
  215. ],
  216. buttons: [
  217. {
  218. label: "新建",
  219. type: "primary",
  220. methodName: "action1",
  221. icon: "el-icon-circle-plus"
  222. },
  223. {
  224. label: "删除",
  225. type: "primary",
  226. methodName: "action2",
  227. icon: "el-icon-remove"
  228. },
  229. // {
  230. // label: "启用",
  231. // type: "primary",
  232. // methodName: "action3",
  233. // icon: "el-icon-video-play"
  234. // },
  235. // {
  236. // label: "停用",
  237. // type: "primary",
  238. // methodName: "action4",
  239. // icon: "el-icon-video-pause"
  240. // },
  241. {
  242. label: "导入",
  243. type: "primary",
  244. methodName: "action5",
  245. icon: "el-icon-download"
  246. },
  247. {
  248. label: "导出",
  249. type: "primary",
  250. methodName: "action6",
  251. icon: "el-icon-upload2"
  252. }
  253. ],
  254. headerFormData: [
  255. {
  256. label: "数据资源名称",
  257. fieldName: "dataMane",
  258. type: "input",
  259. value: "",
  260. placeholder: "请输入用户分类"
  261. // isRequired: true,
  262. },
  263. {
  264. label: "状态",
  265. fieldName: "username",
  266. type: "input",
  267. value: "",
  268. placeholder: "请输入用户状态"
  269. // isRequired: true,
  270. }
  271. ]
  272. };
  273. },
  274. methods: {
  275. // 处理选中项变化
  276. handleSelectionChange(selectedRows) {
  277. this.selectedRows = selectedRows; // 获取选中的行
  278. },
  279. // 头部搜索框
  280. handleHeaderFormSubmit(form) {
  281. this.searchForm = form;
  282. this.getList();
  283. },
  284. // 列表头部功能按钮
  285. handleButtonClick(methodName) {
  286. console.log(methodName, "methodName");
  287. switch (methodName) {
  288. case "action1":
  289. // 新增
  290. this.rowObj = {};
  291. this.title = "新增";
  292. this.showDialog = true;
  293. break;
  294. case "action2":
  295. // 删除
  296. if (this.selectedRows.length > 0) {
  297. let ids = [];
  298. ids = this.selectedRows.map(item => item.id);
  299. delTabAccessFeedbackList({ ids: [...ids] }).then(res => {
  300. if (+res.code === 200) {
  301. this.$message({
  302. message: res.msg,
  303. type: "success"
  304. });
  305. this.getList();
  306. } else {
  307. this.$message.error(res.msg);
  308. }
  309. });
  310. } else {
  311. this.$confirm("请选择列表项?", "提示", {
  312. confirmButtonText: "关闭",
  313. cancelButtonText: "取消",
  314. showCancelButton: false,
  315. showConfirmButton: false,
  316. type: "warning",
  317. center: true
  318. })
  319. .then(() => {})
  320. .catch(() => {});
  321. }
  322. break;
  323. default:
  324. break;
  325. }
  326. },
  327. // 树结构点击
  328. handleNodeClick() {},
  329. // 列表头部
  330. handleTabClick(tab) {
  331. this.tabs.forEach(item => {
  332. if (item.label === tab.label) {
  333. item.active = true;
  334. this.activeTabLable = tab.value;
  335. if (item.label === "正式运行") {
  336. this.formData.forEach(item => {
  337. // if (item.label==='正式运行时间') {
  338. // }
  339. });
  340. }
  341. } else {
  342. item.active = false;
  343. }
  344. });
  345. },
  346. getList() {
  347. getTabAccessFeedbackList({
  348. pageNum: this.currentPage,
  349. pageSize: this.pageSize,
  350. status: this.activeTabLable,
  351. ...this.searchForm
  352. }).then(res => {
  353. if (+res.code === 200) {
  354. this.tableData = res.rows;
  355. this.tableTotal = +res.total;
  356. }
  357. });
  358. },
  359. // 列表分页
  360. pagi_changePage(page) {
  361. this.currentPage = page;
  362. this.getList();
  363. },
  364. pagi_changeSize(size) {
  365. this.pageSize = size;
  366. this.getList();
  367. },
  368. handleView(row) {
  369. this.rowObj = row;
  370. this.title = "查看";
  371. this.showDialog = true;
  372. },
  373. handleEdit(row) {
  374. console.log(row, "row===///");
  375. this.rowObj = row;
  376. this.title = "编辑";
  377. this.showDialog = true;
  378. },
  379. handleDelete(row) {
  380. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  381. confirmButtonText: "确定",
  382. cancelButtonText: "取消",
  383. center: true,
  384. type: "warning"
  385. })
  386. .then(() => {
  387. delTabAccessFeedbackList({ ids: [row.id] }).then(res => {
  388. if (+res.code === 200) {
  389. this.$message({
  390. message: res.msg,
  391. type: "success"
  392. });
  393. this.getList();
  394. } else {
  395. this.$message.error(res.msg);
  396. }
  397. });
  398. })
  399. .catch(() => {
  400. this.$message({
  401. type: "info",
  402. message: "已取消删除"
  403. });
  404. });
  405. },
  406. confirmHandle() {
  407. this.showDialog = false;
  408. this.getList();
  409. },
  410. // 提交
  411. handleSubmit(row) {
  412. saveStepTabAccessReadyById({ status: 3, id: row.id }).then(res => {
  413. if (+res.code === 200) {
  414. this.$message({
  415. message: res.msg,
  416. type: "success"
  417. });
  418. this.getList();
  419. }
  420. });
  421. },
  422. // 撤回
  423. handleRevoke(row) {
  424. saveStepTabAccessReadyById({ status: 2, id: row.id }).then(res => {
  425. if (+res.code === 200) {
  426. this.$message({
  427. message: res.msg,
  428. type: "success"
  429. });
  430. this.getList();
  431. }
  432. });
  433. },
  434. // 停用
  435. handleStop(row) {
  436. updateIsApplyById({ isApply: 0, id: row.id }).then(res => {
  437. if (+res.code === 200) {
  438. this.$message({
  439. message: res.msg,
  440. type: "success"
  441. });
  442. this.getList();
  443. }
  444. });
  445. },
  446. // 启用
  447. handleStart(row) {
  448. updateIsApplyById({ isApply: 1, id: row.id }).then(res => {
  449. if (+res.code === 200) {
  450. this.$message({
  451. message: res.msg,
  452. type: "success"
  453. });
  454. this.getList();
  455. }
  456. });
  457. }
  458. },
  459. created() {},
  460. mounted() {
  461. this.getList();
  462. }
  463. };
  464. </script>
  465. <style lang="scss" scoped>
  466. .el-main {
  467. padding: 0 20px;
  468. }
  469. .el-icon-search {
  470. font-size: 16px;
  471. font-weight: 700;
  472. color: #1e80e0;
  473. }
  474. </style>