|
@@ -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) {
|