Kaynağa Gözat

feat: 报警问题管理预审后生效模式按钮移动至默认数据页面

“fujiacheng” 1 yıl önce
ebeveyn
işleme
ad1d69b8dd

+ 77 - 52
src/views/datamanager/alertformdata/AlertformData.vue

@@ -1,75 +1,100 @@
 <template>
   <div class="container-box">
     <div class="control-btn" v-if="hasPermisson()">
-      <div class="btn" :class="{ 'btn-active': activeName === 'default' }" @click="activeName = 'default'">默认数据</div>
-      <div class="btn" :class="{ 'btn-active': activeName === 'show' }" @click="activeName = 'show'">展示数据</div>
+      <div
+        class="btn"
+        :class="{ 'btn-active': activeName === 'default' }"
+        @click="activeName = 'default'"
+        >默认数据</div
+      >
+
+      <div class="btn" :class="{ 'btn-active': activeName === 'show' }" @click="activeName = 'show'"
+        >展示数据</div
+      >
+    </div>
+
+    <div style="margin-bottom: 10px; display: flex" v-show="activeName === 'default'">
+      <div style="line-height: 33px">预审后生效模式:</div>
+      <el-switch :model-value="devMode" @change="switchDevMode" />
     </div>
+
     <Default class="content-box" v-if="activeName === 'default'" />
     <Show class="content-box" v-else />
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue';
-import Default from './components/default/Default.vue';
-import Show from './components/show/Show.vue';
-import { useUserStore } from '@/store/modules/user';
+  import { ref } from 'vue';
+  import Default from './components/default/Default.vue';
+  import Show from './components/show/Show.vue';
+  import { useUserStore } from '@/store/modules/user';
+  import { getDevMode, switchDevMode as SDM } from '@/api/datamanagement/getDevMode';
 
-const activeName = ref('default');
+  const devMode = ref(true);
+  getDevMode().then((res) => {
+    devMode.value = res;
+  });
 
-const userStore = useUserStore();
-const hasPermisson = () => {
-  return userStore.checkPermission("question_mock_edit_admin");
-};
-</script>
+  const switchDevMode = () => {
+    SDM();
+    devMode.value = !devMode.value;
+  };
 
-<style scoped lang="scss">
-.container-box {
-  width: 100%;
-  height: 100%;
-  display: flex;
-  flex-direction: column;
-  min-height: calc(100vh - 90px);
-  padding: 21px;
-  background-color: rgba(255, 255, 255, 1);
-  border-radius: 10px;
-}
+  const activeName = ref('default');
 
-.control-btn {
-  display: flex;
-  margin-bottom: 20px;
+  const userStore = useUserStore();
+  const hasPermisson = () => {
+    return userStore.checkPermission('question_mock_edit_admin');
+  };
+</script>
 
-  .btn {
+<style scoped lang="scss">
+  .container-box {
+    width: 100%;
+    height: 100%;
     display: flex;
-    justify-content: center;
-    align-items: center;
-    width: 188px;
-    height: 38px;
-    font-size: 14px;
-    font-weight: 400;
-    color: rgba(0, 0, 0, 0.88);
-    border: 1px solid #D9D9D9;
-    background: rgba(0, 0, 0, 0.02);
-    cursor: pointer;
+    flex-direction: column;
+    min-height: calc(100vh - 90px);
+    padding: 21px;
+    background-color: rgba(255, 255, 255, 1);
+    border-radius: 10px;
   }
 
-  :first-child {
-    border-radius: 8px 0px 0px 8px;
-  }
+  .control-btn {
+    display: flex;
+    margin-bottom: 20px;
 
-  :last-child {
-    border-radius: 0px 8px 8px 0px;
-  }
+    .btn {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      width: 188px;
+      height: 38px;
+      font-size: 14px;
+      font-weight: 400;
+      color: rgba(0, 0, 0, 0.88);
+      border: 1px solid #d9d9d9;
+      background: rgba(0, 0, 0, 0.02);
+      cursor: pointer;
+    }
 
-  .btn-active {
-    font-weight: 500;
-    color: #1890FF;
-    border: 1px solid #1890FF;
-    background-color: rgba(24, 144, 255, 0.15);
+    :first-child {
+      border-radius: 8px 0px 0px 8px;
+    }
+
+    :last-child {
+      border-radius: 0px 8px 8px 0px;
+    }
+
+    .btn-active {
+      font-weight: 500;
+      color: #1890ff;
+      border: 1px solid #1890ff;
+      background-color: rgba(24, 144, 255, 0.15);
+    }
   }
-}
 
-.content-box {
-  flex: 1;
-}
+  .content-box {
+    flex: 1;
+  }
 </style>

+ 0 - 15
src/views/datamanager/alertformdata/components/common/QueryForm.vue

@@ -1,9 +1,5 @@
 <template>
   <div>
-    <div style="margin-bottom: 10px; display: flex">
-      <div style="line-height: 33px">预审后生效模式:</div>
-      <el-switch :model-value="devMode" @change="switchDevMode" />
-    </div>
     <el-form :model="queryForm" label-width="auto" :inline="true" ref="formRef">
       <div class="select-group">
         <el-form-item label="问题来源:" prop="source">
@@ -80,17 +76,6 @@
   import type { FormInstance } from 'element-plus';
   import { reactive, ref } from 'vue';
   import { sourceOptions, issueStateOptions } from './constant.question';
-  import { getDevMode, switchDevMode as SDM } from '@/api/datamanagement/getDevMode';
-
-  const devMode = ref(false);
-  getDevMode().then((res) => {
-    devMode.value = res;
-  });
-
-  const switchDevMode = () => {
-    SDM();
-    devMode.value = !devMode.value;
-  };
 
   interface Props {
     // isShowTab: boolean       // true展示数据,false默认数据