From da0a3c5dcb95cae59af0719d42f2b8f9225a5df5 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 14 九月 2023 17:33:06 +0800
Subject: [PATCH] 按钮样式修改
---
src/components/AddControl.vue | 73 +++++++++---------------------------
1 files changed, 19 insertions(+), 54 deletions(-)
diff --git a/src/components/AddControl.vue b/src/components/AddControl.vue
index 3317633..27a2799 100644
--- a/src/components/AddControl.vue
+++ b/src/components/AddControl.vue
@@ -23,14 +23,13 @@
<div style="color:#333;font-size:15px; font-weight:700;margin-bottom:10px;">宸ヨ壓鍙傛暟</div>
<el-form
ref="form"
- :model="form"
label-width="80px"
label-position="left"
>
<div v-for="(item,index) in Arr" :key="index">
- <el-form-item :label="item.value" prop="estimateHour" class="form-item">
+ <el-form-item :label="item.Key" prop="estimateHour" class="form-item">
<el-input
- v-model="item.key"
+ v-model="item.Value"
placeholder="璇疯緭鍏�"
disabled
></el-input>
@@ -41,7 +40,7 @@
<div slot="footer" class="dialog-footer tac">
<el-button @click="shutdown">鍏抽棴</el-button>
- <el-button type="primary" @click="onSubmit(form)">涓嬪彂鍙傛暟</el-button>
+ <el-button type="primary" @click="onSubmit()">涓嬪彂鍙傛暟</el-button>
</div>
</el-dialog>
</template>
@@ -55,65 +54,29 @@
export default {
components: {},
props: {
- id:{
- type: [Number,String],
+ Arr:{
+ type: [Array],
default: () => {
- return '';
+ return [];
},
}
},
data() {
return {
islook: false,
- form: {
- consumedHour: null,
- directorID: "",
- endDate: "",
- estimateHour: null,
- priority: null,
- progress: null,
- projectID: "",
- taskName: "",
- },
- Arr:[
- {
- value:'璁惧畾闀垮害',
- key:'100m',
- },
- {
- value:'鍒囧壊鏃堕棿',
- key:'100s',
- }
- ]
};
},
mounted() {
- this.getStartInfo()
+
},
watch: {
islook(val) {
if (val) {
- this.form = {
- consumedHour: null,
- directorID: "",
- endDate: "",
- estimateHour: null,
- priority: null,
- progress: null,
- projectID: "",
- taskName: "",
- };
}
},
},
methods: {
- getStartInfo(){
- startTask({id:this.id}).then(res=>{
- if(res.code==200){
-
- }
- })
- },
+
validatorNum(rule, value, callback) {
if (value) {
if (value == undefined || value == null) {
@@ -133,18 +96,20 @@
onSubmit() {
-
- sendProcessParams({id:this.id}).then(res=>{
- if(res.code==200){
- this.$message.success("涓嬪彂鎴愬姛锛�");
- this.$emit("shutdown", this.form);
- this.shutdown();
- }
- })
+ if(this.id){
+ sendProcessParams({id:this.id}).then(res=>{
+ if(res.code==200){
+ this.$message.success("涓嬪彂鎴愬姛锛�");
+ this.shutdown();
+ }
+ })
+ }else{
+ this.$message.error("褰撳墠璁惧娌℃湁宸ュ簭锛�");
+
+ }
},
shutdown() {
this.islook = false;
- this.$refs.form.resetFields();
},
},
};
--
Gitblit v1.8.0