Commit 643471d9da599d243bce42fc8055e8b07a867f9c

Authored by boyang
1 parent b6577f58

添加邮件配置页面注释

src/views/project/config/DrawerCreate.vue
@@ -17,8 +17,6 @@ @@ -17,8 +17,6 @@
17 <div> 17 <div>
18 <BasicForm @register="registerForm" /> 18 <BasicForm @register="registerForm" />
19 </div> 19 </div>
20 - <!-- <div>客户编码</div>  
21 - <textarea></textarea> -->  
22 </BasicDrawer> 20 </BasicDrawer>
23 </template> 21 </template>
24 <script lang="ts" setup> 22 <script lang="ts" setup>
@@ -27,12 +25,10 @@ @@ -27,12 +25,10 @@
27 import { defineComponent, ref, computed, unref, toRaw } from 'vue'; 25 import { defineComponent, ref, computed, unref, toRaw } from 'vue';
28 import { useOrderInfo } from '/@/hooks/component/order'; 26 import { useOrderInfo } from '/@/hooks/component/order';
29 import { useOrderStoreWithOut } from '/@/store/modules/order'; 27 import { useOrderStoreWithOut } from '/@/store/modules/order';
30 - // import { configInfos } from './event';  
31 28
32 const orderStore = useOrderStoreWithOut(); 29 const orderStore = useOrderStoreWithOut();
33 const { customerCode: customerCodeOptions } = useOrderInfo(orderStore); 30 const { customerCode: customerCodeOptions } = useOrderInfo(orderStore);
34 const emit = defineEmits(['success2']); 31 const emit = defineEmits(['success2']);
35 - // const isUpdate = ref(true);  
36 const configInfos: ConfigInfo[] = [ 32 const configInfos: ConfigInfo[] = [
37 { 33 {
38 fieldName: '确认样品确认状态', 34 fieldName: '确认样品确认状态',
@@ -207,11 +203,6 @@ @@ -207,11 +203,6 @@
207 // 方式1 203 // 方式1
208 resetFields(); 204 resetFields();
209 setDrawerProps({ confirmLoading: false }); 205 setDrawerProps({ confirmLoading: false });
210 - console.log(data.data, 666);  
211 - // setFieldsValue({  
212 - // // ...toRaw(data.data),  
213 - // settingValue: 'customerCode',  
214 - // });  
215 }); 206 });
216 207
217 interface ConfigInfo { 208 interface ConfigInfo {
src/views/project/config/DrawerEdit.vue
@@ -152,21 +152,10 @@ @@ -152,21 +152,10 @@
152 // 方式1 152 // 方式1
153 resetFields(); 153 resetFields();
154 setDrawerProps({ confirmLoading: false }); 154 setDrawerProps({ confirmLoading: false });
155 - console.log(data.data, 666);  
156 - // setFieldsValue({  
157 - // settingValue: data.data.settingValue,  
158 - // enableFlag: data.data.enableFlag,  
159 - // // settingValue: data.info,  
160 - // });  
161 setFieldsValue({ 155 setFieldsValue({
162 ...toRaw(data.data), 156 ...toRaw(data.data),
163 }); 157 });
164 }); 158 });
165 - // function replaceChineseCommas(text: string): string {  
166 - // // 使用正则表达式替换中文逗号  
167 - // const replacedText = text.replace(/,/g, ',');  
168 - // return replacedText;  
169 - // }  
170 //获取现有的列表 159 //获取现有的列表
171 async function getData() { 160 async function getData() {
172 const emailAll = await getEmailList({}); 161 const emailAll = await getEmailList({});
@@ -178,10 +167,10 @@ @@ -178,10 +167,10 @@
178 typeValue: string; 167 typeValue: string;
179 configInfos: any[]; 168 configInfos: any[];
180 } 169 }
  170 + //完成编辑
181 async function handleSubmit() { 171 async function handleSubmit() {
182 try { 172 try {
183 const values = await validate(); 173 const values = await validate();
184 - console.log(values, '5656values1');  
185 const newValues = ref<NewValues>({ 174 const newValues = ref<NewValues>({
186 id: '', 175 id: '',
187 type: '', 176 type: '',
@@ -192,33 +181,26 @@ @@ -192,33 +181,26 @@
192 newValues.value.id = values.id; 181 newValues.value.id = values.id;
193 newValues.value.type = values.type; 182 newValues.value.type = values.type;
194 newValues.value.typeValue = values.typeValue; 183 newValues.value.typeValue = values.typeValue;
195 - console.log(newValues.value.id, '5656idwd');  
196 //获取所有数据 184 //获取所有数据
197 //找出需要修改的数据,并将修改后的configInfos赋值给新对象 185 //找出需要修改的数据,并将修改后的configInfos赋值给新对象
198 getData().then((res) => { 186 getData().then((res) => {
199 - console.log(res, 5656111);  
200 for (const value1 of res) { 187 for (const value1 of res) {
201 //循环整个列表,找出编辑行 188 //循环整个列表,找出编辑行
202 if (value1.id == values.id) { 189 if (value1.id == values.id) {
203 // test.value = value1; 190 // test.value = value1;
204 newValues.value.configInfos = value1.configInfos; 191 newValues.value.configInfos = value1.configInfos;
205 - console.log(newValues.value, '5656fornewvalue');  
206 for (const value2 of newValues.value.configInfos) { 192 for (const value2 of newValues.value.configInfos) {
207 //遍历所有邮件事件 193 //遍历所有邮件事件
208 - // console.log(value2, '5656value2');  
209 for (const value3 in values) { 194 for (const value3 in values) {
210 //遍历编辑框传递数据 195 //遍历编辑框传递数据
211 - // console.log(value3, '5656value3');  
212 if (value2.fieldValue == value3) { 196 if (value2.fieldValue == value3) {
213 const arr: string[] = values[value3].split(/[,|,]/); 197 const arr: string[] = values[value3].split(/[,|,]/);
214 value2.emails = arr; 198 value2.emails = arr;
215 - console.log(value2.emails, '5656value2.emails');  
216 } 199 }
217 } 200 }
218 } 201 }
219 } 202 }
220 } 203 }
221 - console.log(newValues.value, 56566);  
222 emit('success', { 204 emit('success', {
223 values: { ...newValues.value }, 205 values: { ...newValues.value },
224 }); 206 });
src/views/project/config/EmailPanel.vue
@@ -91,23 +91,20 @@ @@ -91,23 +91,20 @@
91 columns: columns, 91 columns: columns,
92 bordered: true, 92 bordered: true,
93 rowKey: 'id', 93 rowKey: 'id',
94 - // rowSelection: {  
95 - // type: 'checkbox',  
96 - // },  
97 actionColumn: { 94 actionColumn: {
98 width: 180, 95 width: 180,
99 title: '操作', 96 title: '操作',
100 dataIndex: 'action', 97 dataIndex: 'action',
101 }, 98 },
102 - // showSelectionBar: true, // 显示多选状态栏  
103 }); 99 });
  100 + //新增
104 function handleCreate(record) { 101 function handleCreate(record) {
105 openDrawerCreate(true, { 102 openDrawerCreate(true, {
106 data: record, 103 data: record,
107 isUpdate: false, 104 isUpdate: false,
108 }); 105 });
109 } 106 }
110 - 107 + //编辑
111 function handleEdit(record) { 108 function handleEdit(record) {
112 console.log('点击了编辑', record); 109 console.log('点击了编辑', record);
113 openDrawerEdit(true, { 110 openDrawerEdit(true, {
@@ -115,43 +112,29 @@ @@ -115,43 +112,29 @@
115 isUpdate: true, 112 isUpdate: true,
116 }); 113 });
117 } 114 }
118 - // async function handleSuccess({ isUpdate, values }) {  
119 - // console.log(values, 888, 999);  
120 - // if (isUpdate) {  
121 - // await emailEdit({ ...values });  
122 - // } else {  
123 - // await emailCreate({ ...values });  
124 - // }  
125 - // console.log(isUpdate);  
126 - // console.log(values);  
127 - // reload();  
128 - // } 115 + //编辑完成后向接口传递数据
129 async function handleSuccess({ values }) { 116 async function handleSuccess({ values }) {
130 - console.log(values, '5656receive');  
131 await emailEdit({ ...values }); 117 await emailEdit({ ...values });
132 - // await emailEdit({  
133 - // type: values.type,  
134 - // typeValue: values.typeValue,  
135 - // configInfos: values.configInfos,  
136 - // });  
137 reload(); 118 reload();
138 } 119 }
139 - 120 + //新增完成后向接口传递数据
140 async function handleSuccessCreate({ values }) { 121 async function handleSuccessCreate({ values }) {
141 await emailCreate({ ...values }); 122 await emailCreate({ ...values });
142 - console.log(values, 777);  
143 reload(); 123 reload();
144 } 124 }
  125 + //删除
145 async function handleDelete(record: any) { 126 async function handleDelete(record: any) {
146 console.log('点击了删除', record); 127 console.log('点击了删除', record);
147 await emailDelete({ id: record.id }); 128 await emailDelete({ id: record.id });
148 reload(); 129 reload();
149 } 130 }
  131 + //启用
150 async function handleOpen(record) { 132 async function handleOpen(record) {
151 console.log(record, 'opt'); 133 console.log(record, 'opt');
152 await emailOpt({ id: record.id, enableflag: record.enableFlag === 10 ? 30 : 10 }); 134 await emailOpt({ id: record.id, enableflag: record.enableFlag === 10 ? 30 : 10 });
153 reload(); 135 reload();
154 } 136 }
  137 + //禁用
155 async function handleForbid(record) { 138 async function handleForbid(record) {
156 console.log(record.id, record.enableFlag, 999); 139 console.log(record.id, record.enableFlag, 999);
157 await emailOpt({ id: record.id, enableflag: record.enableFlag === 10 ? 30 : 10 }); 140 await emailOpt({ id: record.id, enableflag: record.enableFlag === 10 ? 30 : 10 });