|  | @@ -1,6 +1,6 @@
 | 
											
												
													
														|  |  <script lang="ts" setup>
 |  |  <script lang="ts" setup>
 | 
											
												
													
														|  |  /**
 |  |  /**
 | 
											
												
													
														|  | - * @Name: createDialog.vue
 |  | 
 | 
											
												
													
														|  | 
 |  | + * @Name: CreateDialog.vue
 | 
											
												
													
														|  |   * @Description: 商品监控-创建对话框
 |  |   * @Description: 商品监控-创建对话框
 | 
											
												
													
														|  |   * @Author: xinyan
 |  |   * @Author: xinyan
 | 
											
												
													
														|  |   */
 |  |   */
 | 
											
										
											
												
													
														|  | @@ -9,12 +9,14 @@ import { ElMessage, FormInstance, FormRules } from 'element-plus';
 | 
											
												
													
														|  |  import { DictionaryStore } from '/@/stores/dictionary';
 |  |  import { DictionaryStore } from '/@/stores/dictionary';
 | 
											
												
													
														|  |  import { useResponse } from '/@/utils/useResponse';
 |  |  import { useResponse } from '/@/utils/useResponse';
 | 
											
												
													
														|  |  import * as api from '../api';
 |  |  import * as api from '../api';
 | 
											
												
													
														|  | 
 |  | +import { Close, Finished } from '@element-plus/icons-vue';
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  const shopOptions = <Ref>inject('shopOptions');
 |  |  const shopOptions = <Ref>inject('shopOptions');
 | 
											
												
													
														|  |  const groupOptions = <Ref>inject('groupOptions');
 |  |  const groupOptions = <Ref>inject('groupOptions');
 | 
											
												
													
														|  |  const { data: staticData } = DictionaryStore();
 |  |  const { data: staticData } = DictionaryStore();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  const loading = ref(false);
 |  |  const loading = ref(false);
 | 
											
												
													
														|  | 
 |  | +const createDialog = <Ref>useTemplateRef('createDialog');
 | 
											
												
													
														|  |  const createOpen = defineModel({ default: false });
 |  |  const createOpen = defineModel({ default: false });
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  const emit = defineEmits(['refresh']);
 |  |  const emit = defineEmits(['refresh']);
 | 
											
										
											
												
													
														|  | @@ -48,7 +50,6 @@ const rules = reactive<FormRules<RuleForm>>({
 | 
											
												
													
														|  |  	country: [{ required: true, message: '请选择国家', trigger: 'change' }],
 |  |  	country: [{ required: true, message: '请选择国家', trigger: 'change' }],
 | 
											
												
													
														|  |  	shop: [{ required: true, message: '请输入店铺', trigger: 'blur' }],
 |  |  	shop: [{ required: true, message: '请输入店铺', trigger: 'blur' }],
 | 
											
												
													
														|  |  	group: [{ required: true, message: '请输入分组', trigger: 'blur' }],
 |  |  	group: [{ required: true, message: '请输入分组', trigger: 'blur' }],
 | 
											
												
													
														|  | -	status: [{ message: '请选择状态', trigger: 'blur' }],
 |  | 
 | 
											
												
													
														|  |  	// frequency: [ { message: '请选择更新频率', trigger: 'blur' } ]
 |  |  	// frequency: [ { message: '请选择更新频率', trigger: 'blur' } ]
 | 
											
												
													
														|  |  });
 |  |  });
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -82,6 +83,11 @@ const submitForm = async (formEl: FormInstance | undefined) => {
 | 
											
												
													
														|  |  	});
 |  |  	});
 | 
											
												
													
														|  |  };
 |  |  };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +function cancelDialog() {
 | 
											
												
													
														|  | 
 |  | +	resetForm(ruleFormRef.value);
 | 
											
												
													
														|  | 
 |  | +	createDialog.value.visible = false;
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  const resetForm = (formEl: FormInstance | undefined) => {
 |  |  const resetForm = (formEl: FormInstance | undefined) => {
 | 
											
												
													
														|  |  	if (!formEl) return;
 |  |  	if (!formEl) return;
 | 
											
												
													
														|  |  	formEl.resetFields();
 |  |  	formEl.resetFields();
 | 
											
										
											
												
													
														|  | @@ -89,7 +95,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
 | 
											
												
													
														|  |  </script>
 |  |  </script>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  <template>
 |  |  <template>
 | 
											
												
													
														|  | -	<el-dialog v-model="createOpen" :close-on-click-modal="false" :close-on-press-escape="false" :title="`商品监控 - 创建 `" style="width: 40%">
 |  | 
 | 
											
												
													
														|  | 
 |  | +	<el-dialog ref="createDialog" v-model="createOpen" :close-on-click-modal="false" :close-on-press-escape="false" :title="`商品监控 - 创建 `" style="width: 40%">
 | 
											
												
													
														|  |  		<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-position="top" label-width="auto" class="mx-2.5 mt-5" status-icon>
 |  |  		<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-position="top" label-width="auto" class="mx-2.5 mt-5" status-icon>
 | 
											
												
													
														|  |  			<el-row :gutter="20">
 |  |  			<el-row :gutter="20">
 | 
											
												
													
														|  |  				<el-col :span="24">
 |  |  				<el-col :span="24">
 | 
											
										
											
												
													
														|  | @@ -142,8 +148,8 @@ const resetForm = (formEl: FormInstance | undefined) => {
 | 
											
												
													
														|  |  			</el-row>
 |  |  			</el-row>
 | 
											
												
													
														|  |  		</el-form>
 |  |  		</el-form>
 | 
											
												
													
														|  |  		<template #footer>
 |  |  		<template #footer>
 | 
											
												
													
														|  | -			<el-button :icon="Finished" @click="resetForm(ruleFormRef);createOpen = false">取 消</el-button>
 |  | 
 | 
											
												
													
														|  | -			<el-button :icon="Close" :loading="loading" type="primary" @click="submitForm(ruleFormRef)">确 定</el-button>
 |  | 
 | 
											
												
													
														|  | 
 |  | +			<el-button :icon="Close" @click="cancelDialog">取 消</el-button>
 | 
											
												
													
														|  | 
 |  | +			<el-button :icon="Finished" :loading="loading" type="primary" @click="submitForm(ruleFormRef)">确 定</el-button>
 | 
											
												
													
														|  |  		</template>
 |  |  		</template>
 | 
											
												
													
														|  |  	</el-dialog>
 |  |  	</el-dialog>
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 |