zhaoke 2 жил өмнө
parent
commit
13c95880a4

+ 52 - 51
src/views/newRole/index.vue

@@ -103,11 +103,25 @@
         </div>
       </div>
     </div>
+    <Dialog :flag="rmFlag">
+      <div class="airportInfoDialog">
+        <div class="title del-title">删除</div>
+        <div class="content del-content">
+          <span class="el-icon-error error r10"></span>您是否确认删除<span class="error l10">{{ dataObj.role_name }}</span>
+          ?
+        </div>
+        <div class="foot right Delfoot">
+          <el-button size="medium" class="r24" @click="tableRemove" type="danger">删除</el-button>
+          <el-button size="medium" @click="rmFlag = false">取消</el-button>
+        </div>
+      </div>
+    </Dialog>
   </div>
 </template>
 
 <script>
 import Table from '@/views/newTable/index.vue'
+import Dialog from "@/layout/components/Dialog/index.vue"
 import { Query, newData, modifyData, moveData } from "@/api/webApi"
 import { setTree } from '@/utils/validate'
 import pb from '@/layout/mixin/getPublicData'
@@ -115,7 +129,7 @@ import pf from '@/layout/mixin/publicFunc'
 import * as _ from 'lodash'
 export default {
   name: 'NewService',
-  components: { Table },
+  components: { Table, Dialog },
   mixins: [pb, pf],
   data () {
     return {
@@ -155,7 +169,8 @@ export default {
       checkArrs: [],
       checkDatas: [],
       checkGroups: [],
-      multipleTable: []
+      multipleTable: [],
+      rmFlag: false
     }
   },
   computed: {
@@ -247,6 +262,10 @@ export default {
     },
     //服务列表-新增
     handleAdd () {
+      const datas = this.arrs.filter(item => item.role_name == '新建角色')
+      if (datas && datas.length) {
+        return
+      }
       this.dataType = 'add'
       this.flag = false
       this.dataObj.role_name = '新建角色'
@@ -316,61 +335,38 @@ export default {
         this.$message.error('请先选中服务后再操作')
       }
     },
-    //服务列表-删除
-    handleError () {
+    async tableRemove () {
       if (this.dataObj.role_ID && this.dataType == 'edit') {
-        this.$confirm('此操作将删除该服务, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(async () => {
-          const code = await this.getChangeList(this.queryId, this.dataObj, 3)
-          if (code) {
-            this.resetTable()
-            this.getQueryListCo(this.queryId)
-            this.activeIndex = null;
-            this.dataObj = {};
-            for (const key in this.formInline) {
-              if (Object.hasOwnProperty.call(this.formInline, key)) {
-                this.formInline[key] = null
-              }
+        const code = await this.getChangeList(this.queryId, this.dataObj, 3)
+        if (code) {
+          this.resetTable()
+          this.getQueryListCo(this.queryId)
+          this.activeIndex = null;
+          this.dataObj = {};
+          for (const key in this.formInline) {
+            if (Object.hasOwnProperty.call(this.formInline, key)) {
+              this.formInline[key] = null
             }
-            this.flag = true
           }
-          this.tipMsg(code)
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });
-        });
+          this.flag = true
+        }
+        this.tipMsg(code)
       } else if (this.dataType == 'add' && this.arrs[this.arrs.length - 1].role_ID) {
-        this.$confirm('此操作将删除该服务, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(async () => {
-          const code = await this.getChangeList(this.queryId, this.arrs[this.arrs.length - 1], 3)
-          if (code) {
-            this.resetTable()
-            this.getQueryListCo(this.queryId)
-            this.activeIndex = null;
-            this.dataObj = {};
-            for (const key in this.formInline) {
-              if (Object.hasOwnProperty.call(this.formInline, key)) {
-                this.formInline[key] = null
-              }
+        const code = await this.getChangeList(this.queryId, this.arrs[this.arrs.length - 1], 3)
+        if (code) {
+          this.resetTable()
+          this.getQueryListCo(this.queryId)
+          this.activeIndex = null;
+          this.dataObj = {};
+          for (const key in this.formInline) {
+            if (Object.hasOwnProperty.call(this.formInline, key)) {
+              this.formInline[key] = null
             }
-            this.flag = true
-            this.dataType = 'edit'
           }
-          this.tipMsg(code)
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });
-        });
+          this.flag = true
+          this.dataType = 'edit'
+        }
+        this.tipMsg(code)
       }
       else {
         this.arrs.splice(this.activeIndex, 1)
@@ -378,6 +374,11 @@ export default {
         this.flag = true
         this.dataObj = {}
       }
+      this.rmFlag = false
+    },
+    //服务列表-删除
+    handleError () {
+      this.rmFlag = true
     },
     handleNodeClick (data) {
       this.treeCheckId = data.auth_id

+ 64 - 63
src/views/systemSettings/views/newMachine/index.vue

@@ -94,17 +94,31 @@
         </div>
       </div>
     </div>
+    <Dialog :flag="rmFlag">
+      <div class="airportInfoDialog">
+        <div class="title del-title">删除</div>
+        <div class="content del-content">
+          <span class="el-icon-error error r10"></span>您是否确认删除<span class="error l10">{{ dataObj.deployNodeName }}</span>
+          ?
+        </div>
+        <div class="foot right Delfoot">
+          <el-button size="medium" class="r24" @click="tableRemove" type="danger">删除</el-button>
+          <el-button size="medium" @click="rmFlag = false">取消</el-button>
+        </div>
+      </div>
+    </Dialog>
   </div>
 </template>
 
 <script>
 import Table from './components/table.vue'
+import Dialog from "@/layout/components/Dialog/index.vue"
 import { Query, newData, modifyData, moveData, start, stop } from "@/api/webApi"
 import pf from '@/layout/mixin/publicFunc'
 import * as _ from 'lodash'
 export default {
   name: 'NewService',
-  components: { Table },
+  components: { Table, Dialog },
   mixins: [pf],
   data () {
     return {
@@ -138,7 +152,8 @@ export default {
       loading: false,
       dataId: 8,
       msgContent: {},
-      jqList: []
+      jqList: [],
+      rmFlag: false
     }
   },
   computed: {
@@ -222,10 +237,14 @@ export default {
     },
     //服务列表-新增
     handleAdd () {
+      const datas = this.arrs.filter(item => item.deployNodeName == '新建机器')
+      if (datas && datas.length) {
+        return
+      }
       this.dataType = 'add'
       this.flag = false
-      this.dataObj.serviceName = '新建服务'
-      this.arrs.push({ serviceName: '新建服务' })
+      this.dataObj.deployNodeName = '新建机器'
+      this.arrs.push({ deployNodeName: '新建机器' })
       this.activeIndex = this.arrs.length - 1
       for (const key in this.formInline) {
         if (Object.hasOwnProperty.call(this.formInline, key)) {
@@ -308,69 +327,46 @@ export default {
         this.$message.error('请先选中服务后再操作')
       }
     },
-    //服务列表-删除
-    handleError () {
+    async tableRemove () {
       if (this.dataObj.deployNodeID && this.dataType == 'edit') {
-        this.$confirm('此操作将删除该服务, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(async () => {
-          const code = await this.getChangeList(this.queryId, this.dataObj, 3)
-          if (code) {
-            this.$message.success('操作成功')
-            this.resetTable()
-            this.getQuery(this.queryId)
-          } else {
-            this.$message.success('操作失败')
-          }
-          this.msgContent = {}
-          this.activeIndex = null;
-          this.dataObj = {};
-          for (const key in this.formInline) {
-            if (Object.hasOwnProperty.call(this.formInline, key)) {
-              this.formInline[key] = null
-            }
+        const code = await this.getChangeList(this.queryId, this.dataObj, 3)
+        if (code) {
+          this.$message.success('操作成功')
+          this.resetTable()
+          this.getQuery(this.queryId)
+        } else {
+          this.$message.success('操作失败')
+        }
+        this.msgContent = {}
+        this.activeIndex = null;
+        this.dataObj = {};
+        for (const key in this.formInline) {
+          if (Object.hasOwnProperty.call(this.formInline, key)) {
+            this.formInline[key] = null
           }
-          this.flag = true
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });
-        });
+        }
+        this.flag = true
       } else if (this.dataType == 'add' && this.arrs[this.arrs.length - 1].deployNodeID) {
-        this.$confirm('此操作将删除该服务, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(async () => {
-          const code = await this.getChangeList(this.queryId, this.arrs[this.arrs.length - 1], 3)
-          if (code) {
-            this.$message.success('操作成功')
-            this.resetTable()
-            this.getQuery(this.queryId)
-          } else {
-            this.$message.success('操作失败')
-          }
-          this.msgContent = {
-            service_id: ''
-          }
-          this.activeIndex = null;
-          this.dataObj = {};
-          for (const key in this.formInline) {
-            if (Object.hasOwnProperty.call(this.formInline, key)) {
-              this.formInline[key] = null
-            }
+        const code = await this.getChangeList(this.queryId, this.arrs[this.arrs.length - 1], 3)
+        if (code) {
+          this.$message.success('操作成功')
+          this.resetTable()
+          this.getQuery(this.queryId)
+        } else {
+          this.$message.success('操作失败')
+        }
+        this.msgContent = {
+          service_id: ''
+        }
+        this.activeIndex = null;
+        this.dataObj = {};
+        for (const key in this.formInline) {
+          if (Object.hasOwnProperty.call(this.formInline, key)) {
+            this.formInline[key] = null
           }
-          this.flag = true
-          this.dataType = 'edit'
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });
-        });
+        }
+        this.flag = true
+        this.dataType = 'edit'
       }
       else {
         this.arrs.splice(this.activeIndex, 1)
@@ -378,6 +374,11 @@ export default {
         this.flag = true
         this.dataObj = {}
       }
+      this.rmFlag = false
+    },
+    //服务列表-删除
+    handleError () {
+      this.rmFlag = true
     },
     //服务列表-增/删/改
     async generalDataReception (event, data) {

+ 53 - 52
src/views/systemSettings/views/newService/index.vue

@@ -157,22 +157,37 @@
         </div>
       </div>
     </div>
+    <Dialog :flag="rmFlag">
+      <div class="airportInfoDialog">
+        <div class="title del-title">删除</div>
+        <div class="content del-content">
+          <span class="el-icon-error error r10"></span>您是否确认删除<span class="error l10">{{ dataObj.serviceName }}</span>
+          ?
+        </div>
+        <div class="foot right Delfoot">
+          <el-button size="medium" class="r24" @click="tableRemove" type="danger">删除</el-button>
+          <el-button size="medium" @click="rmFlag = false">取消</el-button>
+        </div>
+      </div>
+    </Dialog>
   </div>
 </template>
 
 <script>
 import Table from '@/views/newTable/index.vue'
+import Dialog from "@/layout/components/Dialog/index.vue"
 import { Query, newData, modifyData, moveData, start, stop } from "@/api/webApi"
 import * as _ from 'lodash'
 export default {
   name: 'NewService',
-  components: { Table },
+  components: { Table, Dialog },
   data () {
     return {
       title: '服务设置',
       search: '',
       arrs: [],
       flag: true,
+      rmFlag: false,
       formInline: {
         serviceName: '',
         serviceType: '',
@@ -297,6 +312,10 @@ export default {
     },
     //服务列表-新增
     handleAdd () {
+      const datas = this.arrs.filter(item => item.serviceName == '新建服务')
+      if (datas && datas.length) {
+        return
+      }
       this.dataType = 'add'
       this.flag = false
       this.dataObj.serviceName = '新建服务'
@@ -384,61 +403,38 @@ export default {
         this.$message.error('请先选中服务后再操作')
       }
     },
-    //服务列表-删除
-    handleError () {
+    tableRemove () {
       if (this.dataObj.serviceID && this.dataType == 'edit') {
-        this.$confirm('此操作将删除该服务, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          const obj = {}
-          obj.filter = this.dataObj
-          this.generalDataReception(3, [obj])
-          this.msgContent = {
-            service_id: ''
-          }
-          this.activeIndex = null;
-          this.dataObj = {};
-          for (const key in this.formInline) {
-            if (Object.hasOwnProperty.call(this.formInline, key)) {
-              this.formInline[key] = null
-            }
+        const obj = {}
+        obj.filter = this.dataObj
+        this.generalDataReception(3, [obj])
+        this.msgContent = {
+          service_id: ''
+        }
+        this.activeIndex = null;
+        this.dataObj = {};
+        for (const key in this.formInline) {
+          if (Object.hasOwnProperty.call(this.formInline, key)) {
+            this.formInline[key] = null
           }
-          this.flag = true
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });
-        });
+        }
+        this.flag = true
       } else if (this.dataType == 'add' && this.arrs[this.arrs.length - 1].serviceID) {
-        this.$confirm('此操作将删除该服务, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          const obj = {}
-          obj.filter = this.arrs[this.arrs.length - 1]
-          this.generalDataReception(3, [obj])
-          this.msgContent = {
-            service_id: ''
-          }
-          this.activeIndex = null;
-          this.dataObj = {};
-          for (const key in this.formInline) {
-            if (Object.hasOwnProperty.call(this.formInline, key)) {
-              this.formInline[key] = null
-            }
+        const obj = {}
+        obj.filter = this.arrs[this.arrs.length - 1]
+        this.generalDataReception(3, [obj])
+        this.msgContent = {
+          service_id: ''
+        }
+        this.activeIndex = null;
+        this.dataObj = {};
+        for (const key in this.formInline) {
+          if (Object.hasOwnProperty.call(this.formInline, key)) {
+            this.formInline[key] = null
           }
-          this.flag = true
-          this.dataType = 'edit'
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });
-        });
+        }
+        this.flag = true
+        this.dataType = 'edit'
       }
       else {
         this.arrs.splice(this.activeIndex, 1)
@@ -451,6 +447,11 @@ export default {
           }
         }
       }
+      this.rmFlag = false
+    },
+    //服务列表-删除
+    handleError () {
+      this.rmFlag = true
     },
     //服务列表-增/删/改
     async generalDataReception (event, data) {