channelGroup.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. <template>
  2. <div class="app-container">
  3. <!-- 搜索向 -->
  4. <div class="flex">
  5. <div class="w_input">
  6. <span class="textSpan">通道组名称:</span>
  7. <el-input v-model="body.groupName" style="width:200px" placeholder="通道名称" size="small" clearable />
  8. <el-button class="filter-item" icon="el-icon-search" type="primary" plain @click="Search">搜索</el-button>
  9. <el-button class="classitem" style="marginRight:50px" type="primary" plain icon="el-icon-plus" @click="dataFormAdd">新增</el-button>
  10. </div>
  11. </div>
  12. <!-- 表格数据 -->
  13. <el-table v-loading="loading" :data="tableData" border style="width: 100%">
  14. <el-table-column label="序号" width="60" align="center">
  15. <template slot-scope="scope">
  16. <span>{{ scope.$index + 1 }}</span>
  17. </template>
  18. </el-table-column>
  19. <el-table-column label="通道组名称" align="center" show-overflow-tooltip>
  20. <template slot-scope="scope">
  21. <span>{{ scope.row.groupName }}</span>
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="创建者" align="center" show-overflow-tooltip>
  25. <template slot-scope="scope">
  26. <span type="text" >{{ scope.row.creator }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="创建时间" align="center" show-overflow-tooltip>
  30. <template slot-scope="scope">
  31. <span>{{ scope.row.createTime }}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="操作" fixed="right" width="200" align="center">
  35. <template slot-scope="scope">
  36. <!-- <el-button v-if="scope.row.isValid==0" size="small" icon="el-icon-circle-check" type="success" @click="ModifyState(scope.row)">有效</el-button>
  37. <el-button v-if="scope.row.isValid==1" size="small" icon="el-icon-circle-close" type="info" @click="ModifyState(scope.row)">无效</el-button> -->
  38. <el-button size="small" icon="el-icon-edit" type="warning" plain @click="handleEdit(scope.row)">编辑</el-button>
  39. <el-button size="small" icon="el-icon-delete" type="danger" plain @click="ModifyDelete(scope.row,$event)">删除</el-button>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. <!-- 分页 -->
  44. <div class="pagination">
  45. <el-pagination
  46. current-page.sync="body.current"
  47. :current-page="body.current"
  48. :page-sizes="[10, 20, 30, 50]"
  49. :page-size="body.size"
  50. layout="total, sizes, prev, pager, next, jumper"
  51. background
  52. :total="total"
  53. @size-change="handleSizeChange"
  54. @current-change="handleCurrentChange"
  55. />
  56. </div>
  57. <!-- 新增与修改 -->
  58. <el-dialog :title="operation?'通道组新增':'通道组编辑'" :visible.sync="dialogFormVisible" width="85%" center>
  59. <el-form ref="dataForm" :model="dataForm" :rules="rules2" label-width="80px" size="small" label-position="right">
  60. <el-form-item label="通道组名称" :label-width="formLabelWidth" style="width:420px;margin:15px auto;paddingBottom:30px">
  61. <el-input v-model="dataForm.groupName" :disabled="!operation" placeholder="请输入通道组名称" />
  62. </el-form-item>
  63. <!-- 添加产品 -->
  64. <el-card shadow="hover" v-if="!operation">
  65. <div slot="header" class="clearfix">
  66. <span class="topClass">分发组信息</span>
  67. </div>
  68. <div>
  69. <!-- 添加 -->
  70. <el-table ref="multipleTable" :data="dataForm.distributeGroups">
  71. <!-- <el-table ref="multipleTable" :data="dataForm.distributeGroups" @selection-change="handleSelectionChange"> -->
  72. <!-- <el-table-column
  73. type="selection"
  74. width="55">
  75. </el-table-column> -->
  76. <el-table-column label="分发组名称" width="200" align="center" show-overflow-tooltip>
  77. <template slot-scope="scope" >
  78. <!-- <span >{{ scope.row.name }}</span> -->
  79. <el-input v-model="scope.row.name" :disabled="scope.row.distributeGroupId != null" @keyup.enter.native="addGroup"></el-input>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="策略" width="130" align="center">
  83. <template slot-scope="scope" >
  84. <!-- <el-input v-model="scope.row.policy" @keyup.enter.native="addGroup"></el-input> -->
  85. <div class="code" v-if="selectref && scope.row.distributeGroupId != null" @click="onpolicy(scope.row)"></div>
  86. <el-select size="small" v-model="scope.row.policy" @click.native="inpolicy(scope.row)" @change="clicktrue" @keyup.enter.native="addGroup" placeholder="请选择" style="width: 100%" >
  87. <el-option
  88. v-for="item in distribute"
  89. :key="item.policy"
  90. :label="item.desc"
  91. :value="item.policy"
  92. />
  93. </el-select>
  94. <!-- <el-select size="small" v-model="scope.row.policy" v-else @click.native="inpolicy(scope.row)" @keyup.enter.native="addGroup" placeholder="请选择运营商" style="width: 100%" >
  95. <el-option
  96. v-for="item in distribute"
  97. :key="item.policy"
  98. :label="item.desc"
  99. :value="item.policy"
  100. />
  101. </el-select> -->
  102. <!-- <span >{{ scope.row.policy }}</span> -->
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="运营商" align="center" show-overflow-tooltip>
  106. <template slot-scope="scope" >
  107. <el-select size="small" v-model="scope.row.operator" @change="operatorClick(scope.row)" :disabled="scope.row.distributeGroupId != null" @keyup.enter.native="addGroup" placeholder="请选择运营商" style="width: 90%" >
  108. <el-option
  109. v-for="item in dataOperator"
  110. :key="item.id"
  111. :label="item.name"
  112. :value="item.id"
  113. />
  114. </el-select>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="通道" align="center" show-overflow-tooltip>
  118. <template slot-scope="scope" >
  119. <!-- <span >{{ scope.row.channel }}</span> -->
  120. <el-tooltip class="item" effect="dark" content="配置通道" placement="top" v-if="scope.row.channels == undefined || scope.row.channels.length <= 0 ">
  121. <el-button type="primary" plain icon="el-icon-plus" @click ="onwarning(scope.row)" circle > </el-button>
  122. </el-tooltip>
  123. <el-tooltip class="item" effect="dark" content="查看通道" placement="top" v-else>
  124. <el-button type="primary" plain icon="el-icon-view" @click ="onwarning(scope.row)" circle > </el-button>
  125. </el-tooltip>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="排序" align="center" show-overflow-tooltip>
  129. <template slot-scope="scope" >
  130. <el-input v-model="scope.row.weight" @keyup.enter.native="addGroup"></el-input>
  131. <!-- <span>{{scope.row.weight}}</span> -->
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="是否有效" align="center" show-overflow-tooltip >
  135. <template slot-scope="scope">
  136. <!-- <span v-if="scope.row.isValid == 1">有效</span>
  137. <span v-if="scope.row.isValid == 0">无效</span> -->
  138. <el-select size="small" v-model="scope.row.isValid" @keyup.enter.native="addGroup" placeholder="请选择是否有效" style="width: 90%" >
  139. <el-option
  140. v-for="item in status"
  141. :key="item.id"
  142. :label="item.name"
  143. :value="item.id"
  144. />
  145. </el-select>
  146. </template>
  147. </el-table-column>
  148. <el-table-column label="操作" width="165" min-width="150" align="center">
  149. <template slot-scope="scope">
  150. <!-- <el-tooltip class="item" effect="dark" content="编辑分发组" placement="top">
  151. <el-button type="primary" plain icon="el-icon-edit" circle @click="priceEdie(scope.row,scope.$index,$event)"></el-button>
  152. </el-tooltip> -->
  153. <el-tooltip class="item" effect="dark" content="删除分发组" placement="top">
  154. <el-button type="danger" plain icon="el-icon-delete" circle @click="priceDelete(scope.row,scope.$index,$event)"></el-button>
  155. </el-tooltip>
  156. <el-tooltip placement="top" effect="light" style="padding: 10px; 0 0 0">
  157. <div slot="content">
  158. <p>分发组信息:</p>
  159. <p>其中不能有为空的操作!!!</p>
  160. </div>
  161. <i class="el-icon-warning" />
  162. </el-tooltip>
  163. </template>
  164. </el-table-column>
  165. </el-table>
  166. <el-button class="addGroupButton" type="primary" round plain @click="addGroup(dataForm)">添加分发组</el-button>
  167. </div>
  168. </el-card>
  169. </el-form>
  170. <div slot="footer" class="dialog-footer">
  171. <el-button @click="dialogFormVisible = false">取 消</el-button>
  172. <el-button type="primary" @click="submitForm" :loading="buttonLoading">确 定</el-button>
  173. </div>
  174. </el-dialog>
  175. <!-- 添加分发组 -->
  176. <!-- <el-dialog :title="group?'分发组新增':'分发组编辑'" :visible.sync="groupVisible" :close-on-click-modal="false" width="45%" center>
  177. <el-form ref="infoForm" :model="infoForm" :rules="rules2" label-width="80px" size="small" label-position="right">
  178. <el-form-item label="分发组名称" prop="name" :label-width="formLabelWidth" >
  179. <el-input v-model="infoForm.name" placeholder="请输入分发组名称" />
  180. </el-form-item>
  181. <el-form-item label="策略" prop="policy" :label-width="formLabelWidth" >
  182. <el-col :span="12">
  183. <el-input v-model="infoForm.policy" placeholder="请输入策略" />
  184. </el-col>
  185. <el-col :span="2" style="marginLeft:10px">
  186. <el-tooltip class="item" effect="dark" content="配置通道" placement="top">
  187. <el-button type="primary" plain icon="el-icon-plus" @click ="onwarning" circle > </el-button>
  188. </el-tooltip>
  189. </el-col>
  190. </el-form-item>
  191. <el-form-item label="运营商" prop="channel" :label-width="formLabelWidth" >
  192. <el-select size="small" v-model="infoForm.operator" placeholder="请选择是否有效" style="width: 100%" >
  193. <el-option
  194. v-for="item in dataOperator"
  195. :key="item.id"
  196. :label="item.name"
  197. :value="item.id"
  198. />
  199. </el-select>
  200. </el-form-item>
  201. <el-form-item label="排序" prop="name" :label-width="formLabelWidth" >
  202. <el-input v-model="infoForm.weight" placeholder="请输入排序" />
  203. </el-form-item>
  204. <el-form-item label="是否有效" prop="channel" :label-width="formLabelWidth" >
  205. <el-select size="small" v-model="infoForm.isValid" placeholder="请选择是否有效" style="width: 100%" >
  206. <el-option
  207. v-for="item in status"
  208. :key="item.id"
  209. :label="item.name"
  210. :value="item.id"
  211. />
  212. </el-select>
  213. </el-form-item>
  214. </el-form>
  215. <div slot="footer" class="dialogFooter">
  216. <el-button @click="groupVisible = false">取 消</el-button>
  217. <el-button type="primary" @click="GroupSubmitForm">确 定</el-button>
  218. </div>
  219. </el-dialog> -->
  220. <!-- 给分发组添加通道 -->
  221. <el-drawer
  222. title="通道"
  223. style="width:150%"
  224. :before-close="handleClose"
  225. :visible.sync="GroupDialog"
  226. direction="ltr"
  227. >
  228. <div class="demo-drawer__content">
  229. <el-table :data="infoForm.channels" >
  230. <el-table-column label="通道名称" align="center" show-overflow-tooltip>
  231. <template slot-scope="scope" >
  232. <!-- <el-input v-model="scope.row.channelName" @keyup.enter.native="onAddChannel"></el-input> channelInfosList -->
  233. <el-select size="small" v-model="scope.row.channelId" filterable @keyup.enter.native="onAddChannel" style="width: 90%" >
  234. <el-option
  235. v-for="item in channelInfosList"
  236. :key="item.channelId"
  237. :label="item.channelName"
  238. :value="item.channelId"
  239. />
  240. </el-select>
  241. </template>
  242. </el-table-column>
  243. <el-table-column label="权重" width="120" align="center" show-overflow-tooltip>
  244. <template slot-scope="scope">
  245. <el-input v-model="scope.row.weight" @keyup.enter.native="onAddChannel"></el-input>
  246. </template>
  247. </el-table-column>
  248. <el-table-column label="操作" width="120" align="center">
  249. <template slot-scope="scope">
  250. <el-button type="danger" icon="el-icon-delete" plain @click="CardsDelete(scope.row,scope.$index,$event)" circle></el-button>
  251. </template>
  252. </el-table-column>
  253. </el-table>
  254. <el-button style="width:90%;margin:15px" type="primary" round plain @click="onAddChannel">添加通道</el-button>
  255. <!-- <div class="dialogFooterl">
  256. <el-button @click="GroupDialog = false">取 消</el-button>
  257. <el-button type="primary" @click="handleClose">确定</el-button>
  258. </div> -->
  259. </div>
  260. </el-drawer>
  261. </div>
  262. </template>
  263. <script>
  264. import api from '@/api/channelGroup.js'
  265. // import { delete } from 'vuedraggable'
  266. export default {
  267. data(){
  268. return{
  269. loading:false, //表格数据加载
  270. tableData:[], //表格数据
  271. buttonLoading:false,
  272. body:{
  273. size:10,
  274. current:1,
  275. groupName:"" //名称搜索
  276. },
  277. total:0,
  278. dataForm:{
  279. distributeGroups:[
  280. {}
  281. ]
  282. },
  283. infoForm:{
  284. },
  285. rules2:{},
  286. operation:false,
  287. group:false,
  288. dialogFormVisible:false,
  289. groupVisible:false,
  290. GroupDialog:false,
  291. formLabelWidth:"120px",
  292. dataOperator:[
  293. {id:1,name:"移动"},
  294. {id:2,name:"联通"},
  295. {id:3,name:"电信"},
  296. ],
  297. dataPolicy:[
  298. {
  299. id:1,name:"成本优先",
  300. },
  301. {
  302. id:2,name:"成功率"
  303. }
  304. ],
  305. status:[{
  306. id:1,
  307. name:"有效"
  308. },{
  309. id:0,
  310. name:"无效"
  311. }],
  312. distribute:[], //策略
  313. channelInfosList:[], //通道
  314. selectref:true
  315. }
  316. },
  317. created(){
  318. this.reLoad()
  319. this.distributeGroup()
  320. },
  321. methods:{
  322. // 重载数据
  323. reLoad(){
  324. this.loading = true
  325. api.channelGroupList(this.body).then((res) => {
  326. this.loading = false
  327. let list = res.data.data.records
  328. this.tableData = list
  329. this.total = res.data.data.total
  330. })
  331. },
  332. //获取策略
  333. distributeGroup(){
  334. api.distributeGroup().then((res)=>{
  335. this.distribute = res.data.data
  336. })
  337. },
  338. //选择策略
  339. onpolicy(row){
  340. this.selectref = true
  341. console.log(row.distributeGroupId)
  342. if(row.distributeGroupId){
  343. this.$confirm('此操作将修改策略, 是否继续?', '提示', {
  344. confirmButtonText: '确定',
  345. cancelButtonText: '取消',
  346. showClose:false,
  347. closeOnClickModal:false,
  348. type: 'warning'
  349. }).then(() => {
  350. this.selectref = false
  351. console.log("确定")
  352. }).catch(() => {
  353. this.selectref = true
  354. });
  355. console.log(11)
  356. }else{
  357. this.selectref = false
  358. console.log(22)
  359. }
  360. },
  361. clicktrue(){
  362. this.selectref = true
  363. },
  364. inpolicy(row){
  365. this.selectref = true
  366. if(row.distributeGroupId){
  367. this.selectref = true
  368. console.log(1)
  369. }else{
  370. this.selectref = false
  371. console.log(2)
  372. }
  373. },
  374. //添加分发组
  375. addGroup(row){
  376. this.selectref = true
  377. this.group =true
  378. this.groupVisible = true
  379. if(this.dataForm.distributeGroups == null){
  380. this.dataForm.distributeGroups = []
  381. }
  382. let object = {
  383. channelGroupId:row.channelGroupId,
  384. channels:[],
  385. isValid:1,
  386. name:"",
  387. operator:"",
  388. policy:"",
  389. weight:""
  390. }
  391. this.dataForm.distributeGroups.push(object)
  392. // this.infoForm = {}
  393. },
  394. //编辑分发组
  395. priceEdie(row){
  396. this.group = false
  397. this.groupVisible = true
  398. this.infoForm = row
  399. },
  400. //添加分发组
  401. // GroupSubmitForm(){
  402. // if(this.group){
  403. // this.dataForm.distributeGroups.push(this.infoForm)
  404. // this.groupVisible = false
  405. // }else{
  406. // this.groupVisible = false
  407. // }
  408. // },
  409. //策略通道
  410. onwarning(row){
  411. if(row.operator){
  412. this.infoForm = row
  413. this.GroupDialog = true
  414. const params = new URLSearchParams()
  415. params.append('operator', row.operator)
  416. api.getAllChannelnfos(params).then((res)=>{
  417. this.channelInfosList = res.data.data
  418. })
  419. }else{
  420. this.$message({
  421. type: 'error',
  422. message: "请先选择运营商"
  423. })
  424. }
  425. // if(this.infoForm.channelInfos == undefined || this.infoForm.channelInfos.length == 0){
  426. // this.infoForm.channelInfos = [
  427. // {
  428. // channelName :"",
  429. // weight:""
  430. // }
  431. // ]
  432. // }
  433. },
  434. handleClose(done) {
  435. this.GroupDialog = false
  436. // this.$confirm('确定要提交表单吗?')
  437. // .then(_ => {
  438. // this.GroupDialog = false
  439. // })
  440. // .catch(_ => {});
  441. },
  442. operatorClick(row){
  443. row.channels = []
  444. },
  445. //添加分发组通道
  446. onAddChannel(){
  447. let object = {
  448. channelId :"",
  449. weight:""
  450. }
  451. this.infoForm.channels.push(object)
  452. },
  453. //删除分发组
  454. priceDelete(row,index,e){
  455. // row.splice(index,1)
  456. if(row.distributeGroupId){
  457. this.$confirm('是否删除该分发组', '提示', {
  458. confirmButtonText: '确定',
  459. cancelButtonText: '取消',
  460. type: 'warning'
  461. }).then(()=>{
  462. api.distributeGroupDelete(row.distributeGroupId).then((res)=>{
  463. this.dataForm. distributeGroups.splice(index,1)
  464. this.reLoad()
  465. this.$message({
  466. type: 'success',
  467. message: '删除成功'
  468. })
  469. })
  470. }).catch(() => {
  471. this.$message({
  472. type: 'info',
  473. message: '已取消'
  474. });
  475. });
  476. }else{
  477. this.dataForm.distributeGroups.splice(index,1)
  478. this.$message({
  479. type: 'success',
  480. message: '删除成功'
  481. })
  482. }
  483. let target=e.target;
  484. if(target.nodeName == 'SPAN' || target.nodeName == 'I'){
  485. target = e.target.parentNode;
  486. }
  487. target.blur();
  488. },
  489. //删除分发组中的通道
  490. CardsDelete(row,index,e){
  491. let relationId=this.dataForm.relationId
  492. if(row.id){
  493. this.$confirm('是否删除该通道', '提示', {
  494. confirmButtonText: '确定',
  495. cancelButtonText: '取消',
  496. type: 'warning'
  497. }).then(()=>{
  498. api.channelnfosdelete(row.id).then((res)=>{
  499. this.reLoad()
  500. this.infoForm.channels.splice(index,1)
  501. this.$message({
  502. type: 'success',
  503. message: '删除成功'
  504. })
  505. })
  506. }).catch(() => {
  507. this.$message({
  508. type: 'info',
  509. message: '已取消'
  510. });
  511. });
  512. }else{
  513. this.infoForm.channels.splice(index,1)
  514. this.$message({
  515. type: 'success',
  516. message: '删除成功'
  517. })
  518. }
  519. let target=e.target;
  520. if(target.nodeName == 'SPAN' || target.nodeName == 'I'){
  521. target = e.target.parentNode;
  522. }
  523. target.blur();
  524. },
  525. //搜索数据
  526. Search(){
  527. this.body.current = 1
  528. this.reLoad()
  529. },
  530. //新增和修改API
  531. submitForm(){
  532. this.$refs['dataForm'].validate((valid) => {
  533. if (valid) {
  534. if (!this.operation) {
  535. let dataForm = this.dataForm
  536. // 编辑
  537. this.$confirm('确认是否提交, 是否继续?', '提示', {
  538. confirmButtonText: '确定',
  539. cancelButtonText: '取消',
  540. // showClose:false,
  541. // closeOnClickModal:false,
  542. type: 'warning'
  543. }).then(() => {
  544. this.buttonLoading = true
  545. api.channelGroupUpdate(dataForm).then(response => {
  546. this.buttonLoading = false
  547. if (response.data.status == '200') {
  548. this.$message({
  549. type: 'success',
  550. message: '操作成功'
  551. })
  552. this.dialogFormVisible = false
  553. this.reLoad()
  554. } else {
  555. this.$message({
  556. type: 'error',
  557. message: response.data.msg
  558. })
  559. }
  560. })
  561. .finally(() => this.buttonLoading = false)
  562. })
  563. } else {
  564. // // 添加
  565. this.buttonLoading = true
  566. api.channelGroupAdd(this.dataForm).then(response => {
  567. if (response.status === 200) {
  568. this.$message({
  569. type: 'success',
  570. message: '操作成功'
  571. })
  572. this.dialogFormVisible = false
  573. this.reLoad()
  574. } else {
  575. this.$message({
  576. type: 'error',
  577. message: response.data.msg
  578. })
  579. }
  580. })
  581. .finally(() =>
  582. setTimeout(()=>{
  583. this.buttonLoading = false
  584. },1600)
  585. )
  586. }
  587. }
  588. })
  589. },
  590. //新增弹框
  591. dataFormAdd(){
  592. this.operation = true // true:新增, false:编辑
  593. this.dialogFormVisible = true // 控制弹出框
  594. this.dataForm = {}
  595. if(this.$refs['dataForm']){
  596. this.$refs['dataForm'].resetFields();
  597. }
  598. },
  599. //编辑弹框
  600. handleEdit(row){
  601. this.operation = false // true:新增, false:编辑
  602. this.dialogFormVisible = true // 控制弹出框
  603. // row.distributeGroups = [
  604. // {name:"ck分发组",policy:1,channelInfos:[],operator:2,weight:"99",isValid:1}
  605. // ]
  606. this.dataForm = JSON.parse(JSON.stringify(row))
  607. if(this.$refs['dataForm']){
  608. this.$refs['dataForm'].resetFields();
  609. }
  610. },
  611. //删除API
  612. ModifyDelete(row,e){
  613. const that = this
  614. let target=e.target;
  615. if(target.nodeName == 'SPAN' || target.nodeName == 'I'){
  616. target = e.target.parentNode;
  617. }
  618. target.blur();
  619. that.$confirm('此操作将删除通道:' + row.groupName, '提示', {
  620. confirmButtonText: '确定',
  621. cancelButtonText: '取消',
  622. type: 'warning'
  623. })
  624. .then(() => {
  625. api.channelGroupIdDelete(row.channelGroupId).then((res)=>{
  626. if (res.status === 200) {
  627. that.$message({
  628. type: 'success',
  629. message: '删除成功'
  630. })
  631. that.reLoad()
  632. } else {
  633. that.$message({
  634. type: 'error',
  635. message: res.data.message
  636. })
  637. }
  638. })
  639. })
  640. },
  641. ///分页
  642. handleSizeChange: function(val) {
  643. this.body.size = val
  644. this.reLoad()
  645. },
  646. handleCurrentChange: function(val) {
  647. this.body.current = val
  648. this.reLoad()
  649. }
  650. }
  651. }
  652. </script>
  653. <style scoped>
  654. .flex{
  655. width: 90%;
  656. display: flex;
  657. flex-direction: row;
  658. margin-bottom: 10px;
  659. /* flex-wrap: wrap; */
  660. justify-content: flex-start;
  661. }
  662. .flexend{
  663. display: flex;
  664. justify-content: flex-end;
  665. /* padding-right: 2rem; */
  666. width: 100%;
  667. /* margin: 0 auto; */
  668. padding-bottom: 20px;
  669. }
  670. .el-card {
  671. border: 0px solid #e6ebf5;
  672. margin-top: 20px;
  673. }
  674. .dialogFooterl{
  675. float: right;
  676. margin-top: 35px;
  677. margin-right: 35px;
  678. }
  679. .addGroupButton{
  680. width: 80%;
  681. margin: 30px 10px 10px 90px;
  682. text-align: center;
  683. }
  684. :focus {
  685. outline: 0;
  686. }
  687. .code{
  688. position: absolute;
  689. top: 0;
  690. width: 90%;
  691. height: 90%;
  692. /* border: 1px solid red; */
  693. z-index: 20;
  694. }
  695. </style>