Commit 643471d9da599d243bce42fc8055e8b07a867f9c

Authored by boyang
1 parent b6577f58

添加邮件配置页面注释

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