From eeef5d4039d2b3fee6854ddc2789aa23232b2cfb Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期三, 27 九月 2023 17:24:10 +0800
Subject: [PATCH] 登陆页换了背景,加了风险排名

---
 src/views/setting/SetConfiguration.vue |  224 ++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 162 insertions(+), 62 deletions(-)

diff --git a/src/views/setting/SetConfiguration.vue b/src/views/setting/SetConfiguration.vue
index d8d07c5..62ca902 100644
--- a/src/views/setting/SetConfiguration.vue
+++ b/src/views/setting/SetConfiguration.vue
@@ -1,76 +1,176 @@
 <script>
-import {useCounterStore} from '@/stores/counter';
+import TimeSelectWithShortCuts from '@/sfc/TimeSelectWithShortCuts.vue'
+import settingApi from '@/api/data_access_setting/settingApi.js'
+import dayjs from 'dayjs'
+import { ElMessage } from 'element-plus'
+// import exceptionApi from '@/api/exceptionApi.js'
+
 export default {
-   data(){
-      return{
+  components: {
+    TimeSelectWithShortCuts
+  },
+  data() {
+    return {
+      // 鍖哄煙
+      radio: 0,
+      // 瀹氭椂
+      radio1: '',
+      beginTime: '',
+      endTime: '',
 
-      }
-   },
-   setup(){
-    const store = useCounterStore()
-    const unsubscribe = store.$onAction(
-  ({
-    name, // action 鐨勫悕瀛�
-    store, // store 瀹炰緥
-    args, // 璋冪敤杩欎釜 action 鐨勫弬鏁�
-    after, // 鍦ㄨ繖涓� action 鎵ц瀹屾瘯涔嬪悗锛屾墽琛岃繖涓嚱鏁�
-    onError, // 鍦ㄨ繖涓� action 鎶涘嚭寮傚父鐨勬椂鍊欙紝鎵ц杩欎釜鍑芥暟
-  }) => {
-    // 璁板綍寮�濮嬬殑鏃堕棿鍙橀噺
-    const startTime = Date.now()
-    // 杩欏皢鍦� `store` 涓婄殑鎿嶄綔鎵ц涔嬪墠瑙﹀彂
-    console.log(`Start "${name}" with params [${args.join(', ')}].`)
-
-    // 濡傛灉 action 鎴愬姛骞朵笖瀹屽叏杩愯鍚庯紝after 灏嗚Е鍙戙��
-    // 瀹冨皢绛夊緟浠讳綍杩斿洖鐨� promise
-    after((result) => { 
-      console.log(
-        `Finished "${name}" after ${
-          Date.now() - startTime
-        }ms.\nResult: ${result}.`
-      )
-    })
-
-    // 濡傛灉 action 鎶涘嚭鎴栬繑鍥� Promise.reject 锛宱nError 灏嗚Е鍙�
-    onError((error) => {
-      console.warn(
-        `Failed "${name}" after ${Date.now() - startTime}ms.\nError: ${error}.`
-      )
-    })
-  }
-)
-    return{
-      store,unsubscribe
+      // a :[],
+      // exception: {
+      //   // 鏂數鎴栨柇缃�
+      //   exception0: [],
+      //   // 鏁版嵁瓒呬綆
+      //   exception1: [],
+      //   // 瓒呮爣
+      //   exception2: [],
+      //   // 鏁版嵁闀挎椂娈垫棤娉㈠姩
+      //   exception3: [],
+      //   // 閲忕骇绐佸彉寮傚父
+      //   exception4: [],
+      // }
     }
-   },
-   computed:{
-    a(){
-      return this.store.doubleCount*2
+  },
+  mounted() {
+    // this.get()
+    // this.getAll()
+    console.log('鏃堕棿',new Date().getMilliseconds()); 
+  },
+  methods: {
+    giveTime(val) {
+      //灏嗕腑鍥芥爣鍑嗘椂闂磋浆涓烘寚瀹氭牸寮�(璇ョ粍浠惰繑鍥炵殑鏍囧噯鏃堕棿鐨勬牸寮忥紝鎵�浠ュ繀椤荤殑鍔犺繖涓嚱鏁�)
+      this.beginTime = dayjs(val[0]).format('YYYY-MM-DD HH:mm:ss')
+      this.endTime = dayjs(val[1]).format('YYYY-MM-DD HH:mm:ss')
     },
+    set() {
+      const params = {}
+      params.user = 'admin'
+      params.beginTime = this.beginTime
+      params.endTime = this.endTime
+      params.region = '閲戝北'
+      params.isRegularTime = this.radio1
+      settingApi.submitSetting(params).then((res) => {
+        if (res.data.code == 1) {
+          ElMessage.success('璁剧疆鎴愬姛')
+        } else {
+          ElMessage('璁剧疆澶辫触')
+        }
+      })
+    },
+  //   get(){
  
-   },
-   mounted(){
+  //     exceptionApi.analysisdata('閲戝北鍖洪噾灞辨柊鍩嶫SC1-0401鍗曞厓1-11-01鍦板潡椤圭洰09','2023-07-01 00:00:00','2023-07-03 00:00:00').then((res)=>{
+  //       this.a = res.data.data
+  //       // console.log('鏁版嵁涓猴細',res.data.data);
+  //       return res.data.data
+  //     }).then(result =>{
+  //       console.log('閾撅細',result);
+  //       exceptionApi.analysisdata('涓婃捣鍥芥灄寤烘潗鏈夐檺鍏徃','2023-07-01 00:00:00','2023-07-03 00:00:00')
+  //     }
+  //     )
+  //   },
 
-   },
-   methods:{
-    doThing(){
-      this.store.increment(5)
-      this.store.doubleCount
-    }
-   }
+  //  async getAll(){
+  //    const a = await this.$http
+  //       .get('/dust/sitenamecode', {
+  //         params: {
+  //           exceptionType: '0',
+  //           beginTime: this.beginTime,
+  //           endTime: this.endTime
+  //         }
+  //       }).then((result) => {
+  //         this.exception.exception0 = result.data.data
+  //       })
+        
+  //       const b = await this.$http
+  //       .get('/dust/sitenamecode', {
+  //         params: {
+  //           exceptionType: '1',
+  //           beginTime: this.beginTime,
+  //           endTime: this.endTime
+  //         }
+  //       }).then((result) => {
+  //         this.exception.exception1 = result.data.data
+  //       })
+       
+        
+  //       const c = await this.$http
+  //       .get('/dust/sitenamecode', {
+  //         params: {
+  //           exceptionType: '2',
+  //           beginTime: this.beginTime,
+  //           endTime: this.endTime
+  //         }
+  //       }).then((result) => {
+  //         this.exception.exception2 = result.data.data
+  //       })
+  //       const d = await this.$http
+  //       .get('/dust/sitenamecode', {
+  //         params: {
+  //           exceptionType: '3',
+  //           beginTime: this.beginTime,
+  //           endTime: this.endTime
+  //         }
+  //       }).then((result) => {
+  //         this.exception.exception3 = result.data.data
+  //       })
+        
+  //      console.log('澶�1锛�',this.exception.exception0);
+  //      console.log('澶�2锛�',this.exception.exception1);
+  //      console.log('澶�3锛�',this.exception.exception2);
+  //      console.log('澶�4锛�',this.exception.exception3);
+  //       // Promise.all([a,b,c,d,e,f,g,h]).then((responses)=>{
+  //       //   console.log('鍏ㄩ儴鏁版嵁涓猴細');
+  //       //   for (const response of responses) {
+  //       //     console.log('鏁版嵁锛�',response.data.data);
+
+  //       // }
+  //       // })
+  //   }
+  }
 }
 </script>
 
 <template>
-  <div>
-    <el-button type="primary" @click="doThing">鐐瑰嚮{{ store.doubleCount }}</el-button>
-  </div>
-  <div>{{ a }}</div>
-  <div>{{ store.secret }}</div>
-  <div>{{ store.vue }}</div>
-  <div>{{ store.澶� }}</div>
+  <el-card> 
+  <el-form>
+    <div>鐢熸垚閰嶇疆鏂囦欢</div>
+    <el-form-item label="鍖哄煙锛�">
+      <el-radio-group v-model="radio">
+        <el-radio :label="0">閲戝北</el-radio>
+      </el-radio-group>
+    </el-form-item>
+    <el-form-item>
+      <TimeSelectWithShortCuts @submit-time="giveTime"></TimeSelectWithShortCuts>
+    </el-form-item>
 
+    <el-form-item label="鏄惁瀹氭椂锛�">
+      <el-radio-group v-model="radio1">
+        <el-radio label="1" size="large">鏄�</el-radio>
+        <el-radio label="2" size="large">鍚�</el-radio>
+      </el-radio-group>
+    </el-form-item>
+
+    <el-form-item> <el-button type="success" @click="set">璁剧疆</el-button></el-form-item>
+  </el-form>
+  <correct theme="outline" size="24" fill="#333"/>
+
+</el-card>
 </template>
-<style scoped>
 
-</style>
\ No newline at end of file
+<style scoped>
+.el-card {
+  margin: 10px;
+}
+div {
+  margin-bottom: 10px;
+  color: #333333;
+}
+:deep(.el-form-item__label) {
+  font-weight: bold;
+  font-size: 16px;
+  color: #333333;
+}
+</style>

--
Gitblit v1.9.3