chenrui  il y a 2 ans
Parent
commit
d9f013558b

+ 11 - 2
src/components/minheader/index.vue

@@ -25,7 +25,7 @@
           type="danger"
           size="default"
           class="br L12"
-          @click="addJournal()"
+          @click="addslot()"
           >1个插槽</el-button
         >
       </template>
@@ -112,7 +112,12 @@ const props = defineProps({
 });
 //搜索内容
 const input = ref("");
-const emits = defineEmits(["addForm", "preserForm", "addJournalForm"]);
+const emits = defineEmits([
+  "addForm",
+  "preserForm",
+  "addJournalForm",
+  "addslotForm",
+]);
 const addBbut = () => {
   emits("addForm");
 };
@@ -130,6 +135,10 @@ const preserBtn = () => {
 const addJournal = () => {
   emits("addJournalForm");
 };
+//插槽
+const addslot = () => {
+  emits("addslotForm");
+};
 </script>
 <style lang="scss" scoped>
 .data-table-btn {

+ 250 - 2
src/views/systemSettings/serviceManagement/serviceMonitorEdit.vue

@@ -1,7 +1,13 @@
 <template>
   <div class="airportInfo">
     <div class="wrap_id">
-      <Minheader :is-Journal="true" :is-statuser="true" :is-Slot="true">
+      <Minheader
+        :is-Journal="true"
+        :is-statuser="true"
+        :is-Slot="true"
+        @addJournalForm="addJournalForm"
+        @addslotForm="addslotForm"
+      >
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">当前服务ID:101</div>
@@ -290,17 +296,168 @@
         </el-col>
       </el-row>
     </div>
+    <Dialog
+      width="852px"
+      :flag="flag"
+      :type="type"
+      :msgTitle="msgTitle"
+      @resetForm="resetForm"
+      @delRest="delRest"
+    >
+      <div class="logDialog">
+        <div class="interfaceLog">
+          <div class="interfaceLog_head flex">
+            <div class="interfaceLog_head_time flex-wrap">
+              <div class="interfaceLog_head_time_start r12">
+                <el-date-picker
+                  v-model="timeStart"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  size="default"
+                  @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="default"
+                  @change="timeEndChange"
+                  type="datetime"
+                  placeholder="选择结束日期时间"
+                  default-time="00:00:00"
+                >
+                </el-date-picker>
+              </div>
+            </div>
+            <div class="flex">
+              <el-input
+                placeholder="请输入搜索关键词"
+                size="default"
+                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 #default="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 #default="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>
+        </div>
+      </div>
+    </Dialog>
+    <Dialog
+      width="852px"
+      :flag="flaglod"
+      :type="typelod"
+      :msgTitle="msgTitlelod"
+      @resetForm="resetlodForm"
+      @delRest="dellodRest"
+    >
+      <div class="logcont">
+        <Minheader :is-auth="true" :is-statuser="true">
+          <template #header>
+            <div class="status flex-wrap">
+              <div class="manageTitle">插槽列表</div>
+            </div>
+          </template></Minheader
+        >
+      </div>
+      <div style="padding: 0 24px 24px 24px" class="dialog-content">
+        <DataTable
+          :tableHeader="states.list"
+          :tableData="tableDatas"
+          :tableBtnGroup="tableBtnGroup"
+          :tableProperty="{ rowKey: 'ID' }"
+          @btnClick="btnClick"
+        />
+      </div>
+    </Dialog>
   </div>
 </template>
 
 <script setup lang="ts">
 import Minheader from "@/components/minheader/index.vue";
 import DataTable from "@/components/tableTemp/index.vue";
+import Dialog from "@/components/dialog/index.vue";
 const tableOptionser = ref<Array>([]); //下拉
 const typeK = ref<String>("进行中"); //状态
 const flag = ref<Boolean>(false); //弹窗开关
+const flaglod = ref<Boolean>(false); //插槽弹窗开关
+const loading = ref<Boolean>(false); //loding
 const type = ref<String>(""); //判断是否删除
-const msgTitle = ref<String>("新增"); //弹窗标题
+const typelod = ref<String>(""); //判断是否删除
+const input = ref<String>(""); //输入搜索
+const msgTitle = ref<String>("查看日志"); //弹窗标题
+const msgTitlelod = ref<String>("插槽编辑"); //弹窗标题
+const timeEnd = ref<String>(""); //日志结束时间
+const timeStart = ref<String>(""); //日志开始时间
 const tableData = ref([
   {
     name: "测试",
@@ -321,6 +478,26 @@ const tableData = ref([
     two: "测试",
   },
 ]);
+const tableDatas = ref([
+  {
+    name: "测试",
+    china: "测试",
+    englin: "测试",
+    two: "测试",
+  },
+  {
+    name: "测试",
+    china: "测试",
+    englin: "测试",
+    two: "测试",
+  },
+  {
+    name: "测试",
+    china: "测试",
+    englin: "测试",
+    two: "测试",
+  },
+]);
 //表头
 const state = reactive({
   list: [
@@ -331,6 +508,14 @@ const state = reactive({
   ],
   listLoading: true,
 });
+//表头
+const states = reactive({
+  list: [
+    { label: "插槽名称", key: "name" },
+    { label: "插槽地址", key: "china" },
+  ],
+  listLoading: true,
+});
 const tableBtnGroup = ref([
   {
     name: "编辑",
@@ -402,6 +587,63 @@ const btnClick = (row, index, param) => {
   } else if (param === 4) {
   }
 };
+//查看日志
+const addJournalForm = () => {
+  flag.value = true;
+};
+//取消
+const resetForm = () => {
+  flag.value = false;
+};
+//删除
+const delRest = () => {
+  flag.value = false;
+};
+//开启插槽
+const addslotForm = () => {
+  flaglod.value = true;
+};
+//取消插槽
+const resetlodForm = () => {
+  flaglod.value = false;
+};
+//删除插槽
+const dellodRest = () => {
+  flaglod.value = false;
+};
+//时间限制
+const timeStartChange = (val) => {
+  if (val >= timeEnd) {
+    timeStart.value = "";
+  }
+};
+//时间限制
+const timeEndChange = (val) => {
+  if (val <= timeEnd) {
+    timeEnd.value = "";
+  }
+};
+//复制
+const 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("复制失败");
+  }
+};
 </script>
 
 <style lang="scss" scoped>
@@ -482,4 +724,10 @@ const btnClick = (row, index, param) => {
 ::v-deep .el-form-item__label {
   width: 100px;
 }
+.interfaceLog {
+  padding: 0 24px 24px 24px;
+}
+.logcont {
+  padding: 0 24px 24px 24px;
+}
 </style>