FeedbackDialog.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. <template>
  2. <el-dialog :visible.sync="visible" @update:visible="handleUpdateVisible" :title="title + '接入反馈表'" :width="width"
  3. :before-close="beforeClose">
  4. <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
  5. <el-tab-pane label="01/4 数据准备基本表" :name="1">
  6. <el-form :label-position="'top'" :model="formData" label-width="auto" style="width: 100%"
  7. class="form-detail-inline" inline>
  8. <el-form-item label="序号/标识符" prop="code">
  9. <el-input v-model="formData.code" placeholder="请输入序号/标识符" />
  10. </el-form-item>
  11. <el-form-item label="交换需求联系人" prop="persion">
  12. <el-input v-model="formData.persion" placeholder="请输入交换需求联系人">
  13. </el-input>
  14. </el-form-item>
  15. <el-form-item label="联系方式" prop="phone">
  16. <el-input v-model="formData.phone" placeholder="请输入联系方式">
  17. </el-input>
  18. </el-form-item>
  19. </el-form>
  20. <!-- 数据提供方所属单位部门 -->
  21. <el-table :data="firstStep.offers" style="width: 100%" max-height="250">
  22. <el-table-column prop="id" label="数据提供方所属单位部门" width="">
  23. <template slot-scope="scope">
  24. <el-select v-model="scope.row.accessId" placeholder="请选择数据提供方所属单位部门"
  25. @change="deptChange(scope.$index, scope.row.accessId, scope.$index)">
  26. <el-option v-for="item in offersOptions" :key="item.id" :label="item.dept" :value="item.id">
  27. </el-option>
  28. </el-select>
  29. </template>
  30. </el-table-column>
  31. <el-table-column prop="system" label="数据提供方系统名称" width="">
  32. <template slot-scope="scope">
  33. <el-input disabled v-model="scope.row.system" placeholder="请输入数据提供方系统名称"></el-input>
  34. </template>
  35. </el-table-column>
  36. <el-table-column prop="readyIp" label="数据提供方IP" width="">
  37. <template slot-scope="scope">
  38. <el-select v-model="scope.row.readyIp" placeholder="请选择IP"
  39. @change="iPChange(scope.$index, scope.row.readyIp, scope.row)">
  40. <el-option v-for="item in scope.row.ipOptions" :key="item.ip" :label="item.ip" :value="item.ip">
  41. </el-option>
  42. </el-select>
  43. </template>
  44. </el-table-column>
  45. <el-table-column prop="readyPort" label="数据提供方端口" width="">
  46. <template slot-scope="scope">
  47. <el-select v-model="scope.row.readyPort" placeholder="请选择端口">
  48. <el-option v-for="item in scope.row.portOptions" :key="item.port" :label="item.port" :value="item.port">
  49. </el-option>
  50. </el-select>
  51. </template>
  52. </el-table-column>
  53. <el-table-column fixed="right" label="操作">
  54. <template #default="scope">
  55. <el-button type="primary" size="small" @click.prevent="deleteRow(scope.$index, scope.row)">
  56. 删除
  57. </el-button>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <el-button type="primary" plain class="mt-4" style="width: 100%" icon="el-icon-plus"
  62. @click="onAddOffersItem"></el-button>
  63. <!-- 数据接收方所属单位部门 -->
  64. <el-table :data="firstStep.access" style="width: 100%" max-height="250">
  65. <el-table-column prop="name" label="数据接收方所属单位部门" width="">
  66. <template slot-scope="scope">
  67. <el-select v-model="scope.row.accessId" @change="
  68. accessDeptChange(scope.$index, scope.row.accessId, scope.$index)
  69. " placeholder="请选择数据接收方所属单位部门">
  70. <el-option v-for="item in offersOptions" :key="item.id" :label="item.dept" :value="item.id">
  71. </el-option>
  72. </el-select>
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="system" label="数据接收方系统名称" width="">
  76. <template slot-scope="scope">
  77. <el-input v-model="scope.row.system" disabled placeholder="请输入数据接收方系统名称"></el-input>
  78. </template>
  79. </el-table-column>
  80. <el-table-column prop="readyIp" label="数据接收方IP" width="">
  81. <template slot-scope="scope">
  82. <el-select v-model="scope.row.readyIp" placeholder="请选择IP" @change="
  83. accessIPChange(scope.$index, scope.row.readyIp, scope.row)
  84. ">
  85. <el-option v-for="item in scope.row.accessIpOptions" :key="item.ip" :label="item.ip" :value="item.ip">
  86. </el-option>
  87. </el-select>
  88. </template>
  89. </el-table-column>
  90. <el-table-column prop="readyPort" label="数据接收方端口" width="">
  91. <template slot-scope="scope">
  92. <el-select v-model="scope.row.readyPort" placeholder="请选择端口">
  93. <el-option v-for="item in scope.row.accessPortOptions" :key="item.port" :label="item.port"
  94. :value="item.port">
  95. </el-option>
  96. </el-select>
  97. </template>
  98. </el-table-column>
  99. <el-table-column fixed="right" label="操作">
  100. <template #default="scope">
  101. <el-button type="primary" size="small" @click.prevent="deleteAccessRow(scope.$index, scope.row)">
  102. 删除
  103. </el-button>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. <el-button type="primary" plain class="mt-4" style="width: 100%" icon="el-icon-plus"
  108. @click="onAccessAddItem"></el-button>
  109. <div class="titel">统一接入方式</div>
  110. <el-form :label-position="'left'" :model="formData" label-width="auto" style="width: 100%">
  111. <el-form-item label="数据提供方式" class="textarea-row" prop="dataOfferType">
  112. <div style="display: flex; align-items: center">
  113. <el-radio-group v-model="formData.dataOfferType">
  114. <!-- <el-radio :label="1">库表接口工具</el-radio>
  115. <el-radio :label="2">六统一API</el-radio>
  116. <el-radio :label="3">六统一KAFKA</el-radio>
  117. <el-radio :label="4">六统一SFTP</el-radio>
  118. <el-radio :label="5">其它</el-radio> -->
  119. <el-radio v-for="dict in dict.type.access_method" :key="dict.value" :label="dict.value">{{ dict.label
  120. }}</el-radio>
  121. </el-radio-group>
  122. <el-input v-model="formData.offerOther" placeholder="请输入"
  123. style="width: 220px; margin-left: 30px"></el-input>
  124. </div>
  125. </el-form-item>
  126. <el-form-item label="数据接收方式" prop="dataAccessType">
  127. <div style="display: flex; align-items: center">
  128. <el-radio-group v-model="formData.dataAccessType">
  129. <!-- <el-radio :label="1">库表接口工具</el-radio>
  130. <el-radio :label="2">六统一API</el-radio>
  131. <el-radio :label="3">六统一KAFKA</el-radio>
  132. <el-radio :label="4">六统一SFTP</el-radio>
  133. <el-radio :label="5">其它</el-radio> -->
  134. <el-radio v-for="dict in dict.type.access_method" :key="dict.value" :label="dict.value">{{ dict.label
  135. }}</el-radio>
  136. </el-radio-group>
  137. <el-input v-model="formData.accessOther" placeholder="请输入"
  138. style="width: 220px; margin-left: 30px"></el-input>
  139. </div>
  140. </el-form-item>
  141. <el-form-item label="审核意见" prop="auditDetail">
  142. <el-input type="textarea" :rows="4" v-model="formData.auditDetail" placeholder="请输入审核意见">
  143. </el-input>
  144. </el-form-item>
  145. <el-row>
  146. <el-col :span="12">
  147. <el-form-item label="审核人" prop="auditName">
  148. <el-input v-model="formData.auditName" placeholder="请输入审核人">
  149. </el-input>
  150. </el-form-item>
  151. </el-col>
  152. <el-col :span="12">
  153. <el-form-item label="审核时间" prop="auditTime">
  154. <el-date-picker style="width: 100%" v-model="formData.auditTime" type="datetime" placeholder="请选择日期时间"
  155. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss">
  156. </el-date-picker>
  157. </el-form-item>
  158. </el-col>
  159. </el-row>
  160. </el-form>
  161. </el-tab-pane>
  162. <el-tab-pane label="02/4 数据基本表" :name="2">
  163. <el-table :data="secondStep" border style="width: 100%">
  164. <!-- 基本属性 -->
  165. <el-table-column label="基本属性" align="center">
  166. <el-table-column prop="check" label="" align="center">
  167. <template slot-scope="scope">
  168. <el-checkbox v-model="scope.row.check"></el-checkbox>
  169. </template>
  170. </el-table-column>
  171. <el-table-column prop="code" label="序号/标识符" align="center" width="150">
  172. <template slot-scope="scope">
  173. <el-input v-model="scope.row.code" placeholder="请输入内容"></el-input>
  174. </template>
  175. </el-table-column>
  176. <el-table-column prop="dataMane" label="数据资源名称" align="center" width="150">
  177. <template slot-scope="scope">
  178. <el-input v-model="scope.row.dataMane" placeholder="请输入内容"></el-input>
  179. </template>
  180. </el-table-column>
  181. <el-table-column prop="publishDate" label="发布日期" align="center" width="120">
  182. <template slot-scope="scope">
  183. <el-date-picker v-model="scope.row.publishDate" type="date" placeholder="选择日期">
  184. </el-date-picker>
  185. </template>
  186. </el-table-column>
  187. <el-table-column prop="formatType" label="格式类型" align="center" width="120">
  188. <template slot-scope="scope">
  189. <el-input v-model="scope.row.formatType" placeholder="请输入内容"></el-input>
  190. </template>
  191. </el-table-column>
  192. <el-table-column prop="resourceSource" label="资源来源" align="center" width="120">
  193. <template slot-scope="scope">
  194. <el-input v-model="scope.row.resourceSource" placeholder="请输入内容"></el-input>
  195. </template>
  196. </el-table-column>
  197. <el-table-column prop="resourceAbstract" label="数据资源摘要" align="center" width="120">
  198. <template slot-scope="scope">
  199. <el-input v-model="scope.row.resourceAbstract" placeholder="请输入内容"></el-input>
  200. </template>
  201. </el-table-column>
  202. <el-table-column prop="updateMode" label="更新模式数据量" align="center" width="120">
  203. <template slot-scope="scope">
  204. <el-input v-model="scope.row.updateMode" placeholder="请输入内容"></el-input>
  205. </template>
  206. </el-table-column>
  207. <el-table-column prop="batch" label="批次号频率" align="center" width="120">
  208. <template slot-scope="scope">
  209. <el-input v-model="scope.row.batch" placeholder="请输入内容"></el-input>
  210. </template>
  211. </el-table-column>
  212. </el-table-column>
  213. <!-- 数据源 -->
  214. <el-table-column label="数据源(数据提供方) 属性" align="center">
  215. <el-table-column prop="offerDept" label="数据源上传方名称" align="center" width="200">
  216. <template slot-scope="scope">
  217. <el-input v-model="scope.row.offerDept" placeholder="请输入内容"></el-input>
  218. </template>
  219. </el-table-column>
  220. <el-table-column prop="offerDept" label="上传方代码" align="center" width="120">
  221. <template slot-scope="scope">
  222. <el-input v-model="scope.row.offerDept" placeholder="请输入内容"></el-input>
  223. </template>
  224. </el-table-column>
  225. <el-table-column prop="offerDept" label="上传方地址" align="center" width="150">
  226. <template slot-scope="scope">
  227. <el-input v-model="scope.row.offerDept" placeholder="请输入内容"></el-input>
  228. </template>
  229. </el-table-column>
  230. <el-table-column prop="property" label="频率、统一接入时间配置" align="center" width="150">
  231. <template slot-scope="scope">
  232. <el-input v-model="scope.row.property" placeholder="请输入内容"></el-input>
  233. </template>
  234. </el-table-column>
  235. <el-table-column prop="property" label="所属系统编号" align="center" width="150">
  236. <template slot-scope="scope">
  237. <el-input v-model="scope.row.property" placeholder="请输入内容"></el-input>
  238. </template>
  239. </el-table-column>
  240. <el-table-column prop="property" label="所属系统名称" align="center" width="150">
  241. <template slot-scope="scope">
  242. <el-input v-model="scope.row.property" placeholder="请输入内容"></el-input>
  243. </template>
  244. </el-table-column>
  245. </el-table-column>
  246. <!-- 数据接收 -->
  247. <el-table-column label="数据接收(输出) 属性" align="center">
  248. <el-table-column prop="accessDept" label="输出方名称" align="center" width="120">
  249. <template slot-scope="scope">
  250. <el-input v-model="scope.row.accessDept" placeholder="请输入内容"></el-input>
  251. </template>
  252. </el-table-column>
  253. <el-table-column prop="outputFormat" label="输出方代码" align="center" width="120">
  254. <template slot-scope="scope">
  255. <el-input v-model="scope.row.outputFormat" placeholder="请输入内容"></el-input>
  256. </template>
  257. </el-table-column>
  258. <el-table-column prop="outputType" label="输出精度、统一接入时间配置" align="center" width="120">
  259. <template slot-scope="scope">
  260. <el-input v-model="scope.row.outputType" placeholder="请输入内容"></el-input>
  261. </template>
  262. </el-table-column>
  263. <el-table-column prop="receiverName" label="输出方式" align="center" width="200">
  264. <template slot-scope="scope">
  265. <el-input v-model="scope.row.receiverName" placeholder="请输入内容"></el-input>
  266. </template>
  267. </el-table-column>
  268. <el-table-column prop="receiverName" label="其它" align="center" width="200">
  269. <template slot-scope="scope">
  270. <el-input v-model="scope.row.receiverName" placeholder="请输入内容"></el-input>
  271. </template>
  272. </el-table-column>
  273. <el-table-column prop="receiverName" label="所属系统编号" align="center" width="200">
  274. <template slot-scope="scope">
  275. <el-input v-model="scope.row.receiverName" placeholder="请输入内容"></el-input>
  276. </template>
  277. </el-table-column>
  278. <el-table-column prop="receiverName" label="所属系统名称" align="center" width="200">
  279. <template slot-scope="scope">
  280. <el-input v-model="scope.row.receiverName" placeholder="请输入内容"></el-input>
  281. </template>
  282. </el-table-column>
  283. </el-table-column>
  284. <!-- 操作 -->
  285. <el-table-column label="操作" align="center" fixed="right" width="120">
  286. <template slot-scope="scope">
  287. <el-button type="text" size="small" @click="handleDelete(scope.row)">删除</el-button>
  288. </template>
  289. </el-table-column>
  290. </el-table>
  291. </el-tab-pane>
  292. <el-tab-pane label="03/4 数据项信息" :name="3">
  293. <!-- 库表工具 ETL -->
  294. <ETLAndTableTools></ETLAndTableTools>
  295. <!-- API -->
  296. <ApiPage v-if="false"></ApiPage>
  297. <!-- KAFKA -->
  298. <KafkaPage v-if="false"></KafkaPage>
  299. <!-- SFTP -->
  300. <SFTPPage v-if="false"></SFTPPage>
  301. </el-tab-pane>
  302. <el-tab-pane label="04/4 附件" :name="5">
  303. <el-form :model="searchFormData" ref="searchForm" label-width="auto" label-position="left" class="header-form">
  304. <el-form-item label="附件名称" prop="name">
  305. <el-input v-model="searchFormData.name" placeholder="请输入附件名称"></el-input>
  306. </el-form-item>
  307. <div class="btn-box">
  308. <el-button type="primary" size="mini" @click="handleSubmit">查询</el-button>
  309. <el-button size="mini" @click="handleReset">重置</el-button>
  310. </div>
  311. </el-form>
  312. <div style="width: 100%; text-align: end">
  313. <el-button size="mini" @click="handleUpload" type="primary">上传</el-button>
  314. </div>
  315. <MyTable :tableData="fileTableData" :formData="fileFormData" :minWidth="400">
  316. <!-- 自定义操作按钮,传递 row 和 index -->
  317. <template #operation="{ row, index }">
  318. <el-button size="mini" @click="handleDownload(row, index)" type="primary">下载</el-button>
  319. <el-button size="mini" @click="handleDelete(index)" type="primary">删除</el-button>
  320. </template>
  321. </MyTable>
  322. </el-tab-pane>
  323. </el-tabs>
  324. <div slot="footer" class="dialog-footer">
  325. <el-button type="primary" @click="handleBackStep" v-if="activeName > 1">上一步</el-button>
  326. <el-button type="primary" @click="handleNextStep" v-if="activeName < 4">下一步</el-button>
  327. <el-button @click="handleCancel">取 消</el-button>
  328. <el-button type="primary" @click="handleConfirm">暂 存</el-button>
  329. <el-button type="primary" @click="handleConfirm" v-if="activeName === 4">确 定</el-button>
  330. </div>
  331. </el-dialog>
  332. <!-- 数据基本表弹窗 -->
  333. <!-- <el-dialog
  334. :visible.sync="visible"
  335. title="数据基本表"
  336. width="50%"
  337. @close="handleClose"
  338. >
  339. <el-form :label-position="'top'" :model="formData" label-width="auto" style="width: 100%"
  340. class="form-detail-inline" inline>
  341. <el-form-item label="序号/标识符" prop="code">
  342. <el-input v-model="formData.code" placeholder="请输入序号/标识符" />
  343. </el-form-item>
  344. <el-form-item label="交换需求联系人" prop="persion">
  345. <el-input v-model="formData.persion" placeholder="请输入交换需求联系人">
  346. </el-input>
  347. </el-form-item>
  348. <el-form-item label="联系方式" prop="contact">
  349. <el-input v-model="formData.contact" placeholder="请输入联系方式">
  350. </el-input>
  351. </el-form-item>
  352. </el-form>
  353. <div slot="footer" class="dialog-footer">
  354. <el-button @click="handleCancel">取 消</el-button>
  355. <el-button type="primary" @click="handleConfirm">确 定</el-button>
  356. </div>
  357. </el-dialog> -->
  358. </template>
  359. <script>
  360. import {
  361. addFirstStepTabAccessReady,
  362. delFirstStepTabAccessReady,
  363. } from "@/api/unified-access/access-feedback.js";
  364. import { getTabAccessList } from "@/api/unified-access/access-party-maintenance.js";
  365. import MyTable from "@/components/MyTable";
  366. import MyForm from "@/components/MyForm";
  367. import ETLAndTableTools from "./ETLAndTableTools.vue";
  368. import ApiPage from "./ApiPage.vue";
  369. import KafkaPage from "./KafkaPage.vue";
  370. import SFTPPage from "./SFTPPage.vue";
  371. export default {
  372. name: "StandardDialog",
  373. components: {
  374. MyForm,
  375. MyTable,
  376. ETLAndTableTools,
  377. ApiPage,
  378. KafkaPage,
  379. SFTPPage,
  380. },
  381. props: {
  382. value: {
  383. type: Boolean,
  384. default: false,
  385. },
  386. title: {
  387. type: String,
  388. default: "弹窗标题",
  389. },
  390. width: {
  391. type: String,
  392. default: "90%",
  393. },
  394. },
  395. dicts: ["access_method"],
  396. data () {
  397. return {
  398. accessPortOptions: [],
  399. accessIpOptions: [],
  400. firstStep: {
  401. code: "", //标识符
  402. persion: "", //交换需求联系人
  403. phone: "", //联系方式
  404. offers: [], // 数据提供方
  405. access: [], //数据接收方
  406. auditDetail: "", //审核意见
  407. auditName: "", //审核人
  408. auditTime: "", //审核时间
  409. },
  410. secondStep: [],
  411. thirdStep: [],
  412. fourthStep: [],
  413. offersOptions: [],
  414. ipOptions: [],
  415. portOptions: [],
  416. basicDataTable: [], //数据基本表
  417. pagination: {
  418. currentPage: 1,
  419. pageSize: 10,
  420. total: 161,
  421. },
  422. leftTableData: [{}],
  423. rightTableData: [{}],
  424. headerFormData: {},
  425. activeName: 1,
  426. visible: this.value,
  427. // 这是传递给表单组件的数据
  428. formData: {},
  429. searchFormData: {},
  430. isDisabled: false,
  431. fileTableData: [],
  432. fileFormData: [
  433. {
  434. label: "附件名称",
  435. fieldName: "name",
  436. type: "input",
  437. showInTable: true,
  438. value: "",
  439. width: "",
  440. },
  441. {
  442. label: "上传人",
  443. fieldName: "age",
  444. type: "input",
  445. showInTable: true,
  446. value: "",
  447. width: "",
  448. },
  449. {
  450. label: "上传时间",
  451. fieldName: "address",
  452. type: "input",
  453. showInTable: true,
  454. value: "",
  455. width: "",
  456. },
  457. ],
  458. tableData: [
  459. {
  460. identifier: false,
  461. name: "资源1",
  462. publishDate: "2023-01-01",
  463. formatType: "格式A",
  464. dataSource: "来源1",
  465. sourceName: "上传方1",
  466. sourceCode: "代码01",
  467. address: "地址01",
  468. property: true,
  469. outputCode: "输出01",
  470. outputFormat: "格式A",
  471. outputType: "自动",
  472. receiverName: "系统1",
  473. },
  474. ],
  475. };
  476. },
  477. watch: {
  478. value (newVal) {
  479. this.visible = newVal;
  480. },
  481. visible (newVal) {
  482. this.$emit("input", newVal);
  483. },
  484. },
  485. mounted () {
  486. this.getList();
  487. },
  488. methods: {
  489. deleteAccessRow (index, row) {
  490. if (row.accessId) {
  491. this.firstStep.access.splice(index, 1);
  492. delFirstStepTabAccessReady(row.accessId).then((res) => {
  493. if (+res.code === 200) {
  494. this.$message({
  495. message: res.msg,
  496. type: "success",
  497. });
  498. } else {
  499. this.$message.error(res.msg);
  500. }
  501. });
  502. } else {
  503. this.firstStep.access.splice(index, 1);
  504. }
  505. },
  506. deleteRow (index, row) {
  507. if (row.accessId) {
  508. this.firstStep.offers.splice(index, 1);
  509. delFirstStepTabAccessReady(row.accessId).then((res) => {
  510. if (+res.code === 200) {
  511. this.$message({
  512. message: res.msg,
  513. type: "success",
  514. });
  515. } else {
  516. this.$message.error(res.msg);
  517. }
  518. });
  519. } else {
  520. this.firstStep.offers.splice(index, 1);
  521. }
  522. },
  523. onAddOffersItem () {
  524. const newItem = {
  525. accessId: "",
  526. system: "",
  527. readyIp: "",
  528. readyPort: "",
  529. ipOptions: [],
  530. portOptions: []
  531. };
  532. this.firstStep.offers.push(newItem);
  533. // this.firstStep.offers.push({});
  534. },
  535. deptChange (index, id, row) {
  536. this.ipOptions = [];
  537. this.offersOptions.forEach((item) => {
  538. if (item.id === id) {
  539. this.ipOptions = item.ip.map((item, index) => {
  540. return {
  541. id: index,
  542. ip: item.ip,
  543. };
  544. });
  545. this.ipOptions = this.ipOptions.filter(
  546. (value, index, self) =>
  547. index === self.findIndex((t) => t.ip === value.ip)
  548. );
  549. this.firstStep.offers[index].system = item.name;
  550. this.firstStep.offers[index].dept = item.dept;
  551. }
  552. });
  553. this.firstStep.offers[index].ipOptions = [...this.ipOptions];
  554. this.firstStep.offers[index].readyIp = "";
  555. this.firstStep.offers[index].readyPort = "";
  556. },
  557. iPChange (index, ip, row) {
  558. this.portOptions = []
  559. this.offersOptions.forEach((item) => {
  560. if (item.id === row.accessId) {
  561. this.portOptions = item.ip
  562. .filter((item) => item.ip === row.readyIp)
  563. .map((item, index) => {
  564. return {
  565. id: index,
  566. port: item.port,
  567. };
  568. });
  569. }
  570. });
  571. this.firstStep.offers[index].portOptions = this.portOptions;
  572. this.firstStep.offers[index].readyPort = "";
  573. },
  574. onAccessAddItem () {
  575. const newItem = {
  576. accessId: "",
  577. system: "",
  578. readyIp: "",
  579. readyPort: "",
  580. ipOptions: [],
  581. portOptions: []
  582. };
  583. this.firstStep.access.push(newItem);
  584. },
  585. accessDeptChange (index, id, row) {
  586. this.ipOptions = [];
  587. this.offersOptions.forEach((item) => {
  588. if (item.id === id) {
  589. this.ipOptions = item.ip.map((item, index) => {
  590. return {
  591. id: index,
  592. ip: item.ip,
  593. };
  594. });
  595. this.ipOptions = this.ipOptions.filter(
  596. (value, index, self) =>
  597. index === self.findIndex((t) => t.ip === value.ip)
  598. );
  599. this.firstStep.access[index].system = item.name;
  600. this.firstStep.access[index].dept = item.dept;
  601. }
  602. });
  603. this.firstStep.access[index].accessIpOptions = [...this.ipOptions];
  604. this.firstStep.access[index].readyIp = "";
  605. this.firstStep.access[index].readyPort = "";
  606. },
  607. accessIPChange (index, ip, row) {
  608. this.portOptions = []
  609. this.offersOptions.forEach((item) => {
  610. if (item.id === row.accessId) {
  611. this.portOptions = item.ip
  612. .filter((item) => item.ip === row.readyIp)
  613. .map((item, index) => {
  614. return {
  615. id: index,
  616. port: item.port,
  617. };
  618. });
  619. }
  620. });
  621. this.firstStep.access[index].accessPortOptions = this.portOptions;
  622. this.firstStep.access[index].readyPort = "";
  623. },
  624. // 数据接入放管理列表
  625. getList () {
  626. getTabAccessList({}).then((res) => {
  627. if (+res.code === 200) {
  628. res.rows.forEach((item) => {
  629. item.ip = JSON.parse(item.ip);
  630. });
  631. this.offersOptions = res.rows;
  632. }
  633. });
  634. },
  635. onAddItem () { },
  636. handleClick (tab, event) {
  637. console.log(tab, event);
  638. },
  639. handleNextStep () {
  640. if (this.title==='新增') {
  641. if (this.activeName === 1) {
  642. addFirstStepTabAccessReady({ ...this.firstStep }).then((res) => {
  643. if (+res.code === 200) {
  644. this.secondStep = res.data
  645. this.activeName++;
  646. }
  647. });
  648. }
  649. } else if (this.title === '编辑') {
  650. updateTabAccessReadyById({ ...this.firstStep }).then((res) => {
  651. if (+res.code === 200) {
  652. // this.secondStep = res.data
  653. this.activeName++;
  654. }
  655. });
  656. }
  657. },
  658. handleBackStep () {
  659. this.activeName--;
  660. },
  661. handleUpdateVisible (val) {
  662. this.visible = val;
  663. },
  664. beforeClose (done) {
  665. this.visible = false;
  666. this.$emit("before-close", done);
  667. },
  668. // 取消按钮处理方法
  669. handleCancel () {
  670. this.visible = false;
  671. this.$emit("cancel"); // 可以在父组件监听 'cancel' 事件
  672. },
  673. // 确定按钮处理方法
  674. handleConfirm () {
  675. this.$refs.myFormComponent.validateForm();
  676. this.visible = false;
  677. this.$emit("confirm"); // 可以在父组件监听 'confirm' 事件
  678. },
  679. },
  680. };
  681. </script>
  682. <style scoped lang="scss">
  683. /* 你可以根据需要为弹窗添加样式 */
  684. .titel {
  685. font-size: 18px;
  686. margin: 20px 0;
  687. }
  688. .btn-box {
  689. margin-left: 20px;
  690. }
  691. .table-container {
  692. width: 10%;
  693. }
  694. .pagination-container {
  695. margin-top: 20px;
  696. text-align: center;
  697. }
  698. .mt-4 {
  699. margin: 10px 0;
  700. }
  701. </style>