From 28cbf4f043cfc0a4621cc8683ba66bcbdd350eca Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期五, 01 十二月 2023 12:02:34 +0800
Subject: [PATCH] 1.增加了风险模型的弹出框组件 2.增加了用户可配置的页面
---
src/views/setting/SetConfiguration.vue | 159 +++++++++++++++++++++++++++++++---------------------
1 files changed, 95 insertions(+), 64 deletions(-)
diff --git a/src/views/setting/SetConfiguration.vue b/src/views/setting/SetConfiguration.vue
index d8d07c5..138de34 100644
--- a/src/views/setting/SetConfiguration.vue
+++ b/src/views/setting/SetConfiguration.vue
@@ -1,76 +1,107 @@
<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')
},
-
- },
- mounted(){
-
- },
- methods:{
- doThing(){
- this.store.increment(5)
- this.store.doubleCount
- }
- }
+ 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('璁剧疆澶辫触')
+ }
+ })
+ },
+
+ }
}
</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