|
@@ -17,8 +17,9 @@
|
|
|
<span class="s2">{{ serviceState }}</span>
|
|
|
</div>
|
|
|
<div class="manageBtns">
|
|
|
- <el-button size="mini" @click="slotVisible = true" type="primary">1个插槽</el-button>
|
|
|
- <el-button size="mini" class="btn-white" plain type="primary">查看日志</el-button>
|
|
|
+ <el-button size="mini" @click="slotVisible = true" type="primary">{{ slotValue }}个插槽</el-button>
|
|
|
+ <el-button size="mini" @click="handleLog" class="btn-white" plain type="primary">查看日志</el-button>
|
|
|
+ <el-button size="mini" @click="editSubmitHandler" type="primary">保存</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="content-list-box-body">
|
|
@@ -269,11 +270,84 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="foot mt24">
|
|
|
- <el-button size="medium" type="primary" class="r25 r26">确定</el-button>
|
|
|
+ <el-button size="medium" @click="slotQd" type="primary" class="r25 r26">确定</el-button>
|
|
|
<el-button size="medium" class="r26" @click="slotVisible = false">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</Dialog>
|
|
|
+ <Dialog :flag="logVisible" width="900px">
|
|
|
+ <div class="logDialog">
|
|
|
+ <div style="position: relative" class="title">
|
|
|
+ <span>查看日志</span>
|
|
|
+ <span @click="logVisible = false" class="el-icon-close logClose"></span>
|
|
|
+ </div>
|
|
|
+ <div class="interfaceLog">
|
|
|
+ <div class="interfaceLog_head flex">
|
|
|
+ <div class="interfaceLog_head_time flex-wrap">
|
|
|
+ <div class="interfaceLog_head_time_start">
|
|
|
+ <el-date-picker v-model="timeStart" value-format="yyyy-MM-dd HH:mm:ss" size="small" @change="timeStartChange" type="datetime" placeholder="选择开始日期时间" default-time="00:00:00">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ <div class="interfaceLog_head_time_end">
|
|
|
+ <el-date-picker v-model="timeEnd" value-format="yyyy-MM-dd HH:mm:ss" size="small" @change="timeEndChange" type="datetime" placeholder="选择结束日期时间" default-time="00:00:00">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex-wrap">
|
|
|
+ <el-input placeholder="请输入搜索关键词" size="small" v-model="input" clearable> </el-input>
|
|
|
+ <el-button size="mini" style="margin-left: 16px" @click="handleOk" type="primary">查询</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-loading="loading"
|
|
|
+ element-loading-text="拼命加载中"
|
|
|
+ stripe
|
|
|
+ element-loading-spinner="el-icon-loading"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
+ class="interfaceLog_content flex-wrap"
|
|
|
+ >
|
|
|
+ <el-table :data="tableData" class="table" height="500px" border style="width: 100%; margin-top: 20px">
|
|
|
+ <el-table-column prop="logTime" width="200" label="时间"> </el-table-column>
|
|
|
+ <el-table-column prop="logType" width="100" label="类型"> </el-table-column>
|
|
|
+ <el-table-column width="200" label="位置">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tooltip class="item" effect="dark" :content="scope.row.logPositionID" placement="top">
|
|
|
+ <div class="logPositionID">{{ scope.row.logPositionID }}</div>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="100" prop="resultCode" label="成败"> </el-table-column>
|
|
|
+ <el-table-column label="详情">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="flex-wrap">
|
|
|
+ <el-tooltip class="item" effect="dark" :content="scope.row.resultDetails" placement="top">
|
|
|
+ <span :id="'logId' + scope.$index" class="logDetails">{{ scope.row.resultDetails }}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-button @click="logCopy(scope.$index)" style="margin-left: 10px" type="text">复制</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- <div class="interfaceLog_content_progress">
|
|
|
+ <el-timeline>
|
|
|
+ <el-timeline-item v-for="(item,index) in preDatas" :key="index">
|
|
|
+ <div class="list">
|
|
|
+ <div class="list_status"></div>
|
|
|
+ <div class="list_title flex">
|
|
|
+ <span class="l_title">{{item.title}}</span>
|
|
|
+ <span v-if="item.status == 1" class="l_status l_success">成功</span>
|
|
|
+ <span v-else class="l_status l_error">失败</span>
|
|
|
+ </div>
|
|
|
+ <div class="list_code">{{item.code}}</div>
|
|
|
+ <div class="list_time">{{item.time}}</div>
|
|
|
+ </div>
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -281,10 +355,9 @@
|
|
|
// import NoData from '@/components/nodata'
|
|
|
import Dialog from "@/layout/components/Dialog";
|
|
|
import DataTable from "@/components/Table";
|
|
|
-import { myQuery, GeneralDataReception } from "@/api/dataIntegration";
|
|
|
-
|
|
|
+import { myQuery, GeneralDataReception, Query } from "@/api/dataIntegration";
|
|
|
+import { parseTime } from "@/utils/index";
|
|
|
import operate from "./mixins/operate";
|
|
|
-
|
|
|
export default {
|
|
|
components: {
|
|
|
// NoData,
|
|
@@ -303,6 +376,7 @@ export default {
|
|
|
serviceState: this.$route.query.runState,
|
|
|
operateDialogType: null,
|
|
|
delObj: {},
|
|
|
+ slotValue: 0,
|
|
|
deleteDialogType: null,
|
|
|
sourceFormVisible: false,
|
|
|
slotVisible: false,
|
|
@@ -347,15 +421,31 @@ export default {
|
|
|
connectConfig: "",
|
|
|
},
|
|
|
sourceDatas: [],
|
|
|
+ selDatas: [],
|
|
|
+ selObj: {},
|
|
|
+ selAll: [],
|
|
|
+ logVisible: false,
|
|
|
+ timeStart: parseTime(new Date(), "{y}-{m}-{d} 00:00:00"),
|
|
|
+ timeEnd: parseTime(new Date().getTime() + 24 * 60 * 60 * 1000, "{y}-{m}-{d} 00:00:00"),
|
|
|
+ tableData: [],
|
|
|
+ loading: false,
|
|
|
+ input: "",
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.slotVisible = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.slotVisible = false;
|
|
|
+ }, 0);
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.queryServiceByID(this.serviceID);
|
|
|
this.getDataSourceList(DATACONTENT_ID.sysSourceId);
|
|
|
},
|
|
|
methods: {
|
|
|
selectionAll(arr) {
|
|
|
- console.log(arr);
|
|
|
+ this.slotValue = arr.length;
|
|
|
+ this.selAll = _.cloneDeep(arr);
|
|
|
},
|
|
|
editSubmitHandler() {
|
|
|
this.$refs["serviceForm"].validate((valid) => {
|
|
@@ -380,16 +470,88 @@ export default {
|
|
|
this.getDataSourceList(DATACONTENT_ID.sysServiceXyId);
|
|
|
this.sourceFormVisible = true;
|
|
|
},
|
|
|
- async machineSelectionChangeHandler(selection, row) {
|
|
|
- const isSelected = selection.findIndex((item) => item.deployNodeID === row.deployNodeID) > -1;
|
|
|
- const event = isSelected ? 1 : 3;
|
|
|
+ slotQd() {
|
|
|
+ const arr = this.selDatas;
|
|
|
+ const row = this.selObj;
|
|
|
+ const datas = this.selAll;
|
|
|
+ const res = [...datas, ...arr].filter((item) => !(datas.some((p) => item.deployNodeID == p.deployNodeID) && arr.some((c) => item.deployNodeID == c.deployNodeID)));
|
|
|
+ // const isSelected = selection.findIndex((item) => item.deployNodeID === row.deployNodeID) > -1;
|
|
|
+ const event = arr.length >= datas.length ? 1 : 3;
|
|
|
try {
|
|
|
- const message = await this.updateServiceNode(event, row);
|
|
|
- this.$message.success(message ?? "操作成功");
|
|
|
+ res.forEach(async (item) => {
|
|
|
+ const message = await this.updateServiceNode(event, item);
|
|
|
+ this.$message.success(message ?? "操作成功");
|
|
|
+ });
|
|
|
} catch (error) {
|
|
|
this.$message.error(error);
|
|
|
this.$refs["serviceMachineTable"].toggleRowSelection(row, !isSelected);
|
|
|
}
|
|
|
+ this.slotVisible = false;
|
|
|
+ this.slotValue = arr.length;
|
|
|
+ this.selAll = _.cloneDeep(arr);
|
|
|
+ },
|
|
|
+ timeStartChange(val) {
|
|
|
+ if (val >= this.timeEnd) {
|
|
|
+ this.timeStart = "";
|
|
|
+ this.$message.error("开始时间不能大于结束时间,请重新选择");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ timeEndChange(val) {
|
|
|
+ if (val <= this.timeEnd) {
|
|
|
+ this.timeEnd = "";
|
|
|
+ this.$message.error("结束时间不能小于开始时间,请重新选择");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleLog() {
|
|
|
+ this.logVisible = true;
|
|
|
+ this.getQuery();
|
|
|
+ },
|
|
|
+ handleOk() {
|
|
|
+ this.getQuery();
|
|
|
+ },
|
|
|
+ async getQuery() {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ const { code, returnData } = await Query({
|
|
|
+ id: DATACONTENT_ID.sysServiceTopTableId,
|
|
|
+ dataContent: JSON.stringify([this.serviceID, this.timeStart, this.timeEnd]),
|
|
|
+ });
|
|
|
+ if (code == 0) {
|
|
|
+ const { listValues } = returnData;
|
|
|
+ this.tableData = listValues;
|
|
|
+ this.loading = false;
|
|
|
+ } else {
|
|
|
+ this.$message.error("网络错误");
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.loading = false;
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ logCopy(index) {
|
|
|
+ const ele = document.getElementById("logId" + index);
|
|
|
+ const val = ele.innerText;
|
|
|
+ try {
|
|
|
+ const input = document.createElement("input");
|
|
|
+ //将input的值设置为需要复制的内容
|
|
|
+ input.value = val;
|
|
|
+ //添加input标签
|
|
|
+ document.body.appendChild(input);
|
|
|
+ //选中input标签
|
|
|
+ input.select();
|
|
|
+ //执行复制
|
|
|
+ document.execCommand("copy");
|
|
|
+ //移除input标签
|
|
|
+ document.body.removeChild(input);
|
|
|
+ this.$message.success("复制成功");
|
|
|
+ } catch (e) {
|
|
|
+ this.$message.error("复制失败");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ machineSelectionChangeHandler(selection, row) {
|
|
|
+ this.selDatas = selection;
|
|
|
+ this.selObj = row;
|
|
|
},
|
|
|
async getDataSourceList(id) {
|
|
|
const dataSourceList = await this.getSelectOption(id);
|
|
@@ -615,5 +777,40 @@ export default {
|
|
|
margin-bottom: 0px;
|
|
|
}
|
|
|
}
|
|
|
+ .interfaceLog {
|
|
|
+ padding: 0 20px 20px 20px;
|
|
|
+ }
|
|
|
+ .interfaceLog_head_time_end {
|
|
|
+ margin-left: 16px;
|
|
|
+ }
|
|
|
+ .logClose {
|
|
|
+ font-size: 20px;
|
|
|
+ position: absolute;
|
|
|
+ right: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .interfaceLog_content {
|
|
|
+ ::v-deep .table {
|
|
|
+ color: #101116;
|
|
|
+ thead {
|
|
|
+ color: #101116;
|
|
|
+ }
|
|
|
+ .success {
|
|
|
+ color: #33bf47;
|
|
|
+ }
|
|
|
+ .error {
|
|
|
+ color: #df4545;
|
|
|
+ }
|
|
|
+ .logPositionID,
|
|
|
+ .logDetails {
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ .logDetails {
|
|
|
+ max-width: 65%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|