|
@@ -93,13 +93,15 @@
|
|
|
</div>
|
|
|
<div class="fixed__btn__panel">
|
|
|
<el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width" :loading="loading">确 定</el-button>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import {mapGetters} from "vuex";
|
|
|
+
|
|
|
export default {
|
|
|
name: "add",
|
|
|
data(){
|
|
@@ -170,6 +172,11 @@ export default {
|
|
|
orderTablecols:[]
|
|
|
}
|
|
|
},
|
|
|
+ computed:{
|
|
|
+ ...mapGetters({
|
|
|
+ loading:'loading'
|
|
|
+ })
|
|
|
+ },
|
|
|
methods:{
|
|
|
validateInput() {
|
|
|
// 使用正则表达式验证输入是否为数值
|
|
@@ -210,10 +217,12 @@ export default {
|
|
|
onSubmit(){
|
|
|
this.$refs.formRef.validate(async (valid)=>{
|
|
|
if (!valid) return false
|
|
|
+ this.$store.commit('setLoading',true)
|
|
|
const res = await this.$api.requested({
|
|
|
"id": 20240111085604,
|
|
|
"content": this.form
|
|
|
})
|
|
|
+ this.$store.commit('setLoading',false)
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
this.dialogVisible = false
|
|
|
this.$refs.formRef.resetFields()
|