Commit 0afd1617e2e149e87af0c0f2e7b770d08bd29ce9
1 parent
6354f56c
修改 待办配置,添加 忽略未完成待办统计,并优化表单交互逻辑,对接接口;
Showing
2 changed files
with
43 additions
and
35 deletions
src/pages/backlog/TaskConfig/api.ts
1 | 1 | /* |
2 | 2 | * @Date: 2021-12-29 15:35:12 |
3 | 3 | * @LastEditors: wangqiang@feewee.cn |
4 | - * @LastEditTime: 2022-01-05 17:53:12 | |
4 | + * @LastEditTime: 2023-02-15 17:19:33 | |
5 | 5 | */ |
6 | 6 | import request from "@/utils/request"; |
7 | 7 | import { common } from "@/typing/common"; |
... | ... | @@ -51,7 +51,8 @@ export interface ListVO { |
51 | 51 | customTempPath?: string; // 自定义模板路径 |
52 | 52 | closeStand?: boolean; // 是否关单站岗 |
53 | 53 | /** 工作类型 */ |
54 | - workType?:number; | |
54 | + workType?: number; | |
55 | + ignoreCount?: boolean; // 忽略未完成待办统计 | |
55 | 56 | } |
56 | 57 | |
57 | 58 | export function getConfigListApi(params: ListParams): http.PromisePageResp<ListVO> { | ... | ... |
src/pages/backlog/TaskConfig/components/CreateModal.tsx
... | ... | @@ -50,9 +50,10 @@ export default function CreateModal({ |
50 | 50 | ...item, |
51 | 51 | funcPage: item.funcPage, |
52 | 52 | itemName: item.itemName, |
53 | - dock: item.dock, | |
54 | - exShow: item.exShow, | |
55 | - assess: item.assess, | |
53 | + dock: checkNull(item.dock) ? true : item.dock, | |
54 | + exShow: checkNull(item.exShow) ? true : item.exShow, | |
55 | + assess: checkNull(item.assess) ? true : item.assess, | |
56 | + ignoreCount: checkNull(item.ignoreCount) ? false : item.ignoreCount, | |
56 | 57 | itemType: item.itemType || TodoTypeEnum["业务性"], |
57 | 58 | listPage: item.listPage, |
58 | 59 | detailPage: item.detailPage, |
... | ... | @@ -79,9 +80,6 @@ export default function CreateModal({ |
79 | 80 | pageParam[obj.key.trim()] = (obj.value || "").trim(); |
80 | 81 | } |
81 | 82 | }); |
82 | - const dock = feildValue.dock; | |
83 | - const assess = feildValue.assess; | |
84 | - const exShow = feildValue.exShow; | |
85 | 83 | const params = { |
86 | 84 | ...feildValue, |
87 | 85 | itemName: (feildValue.itemName || "").trim(), |
... | ... | @@ -89,10 +87,6 @@ export default function CreateModal({ |
89 | 87 | funcPage: (feildValue.funcPage || "").trim(), |
90 | 88 | detailPage: (feildValue.detailPage || "").trim(), |
91 | 89 | pageParam: JSON.stringify(pageParam), |
92 | - dock: JSON.parse(dock), | |
93 | - assess: JSON.parse(assess), | |
94 | - exShow: JSON.parse(exShow), | |
95 | - itemCode: item.itemCode, | |
96 | 90 | id: item.id, |
97 | 91 | applySysId: feildValue.applySysId, |
98 | 92 | }; |
... | ... | @@ -122,8 +116,8 @@ export default function CreateModal({ |
122 | 116 | <Form |
123 | 117 | form={form} |
124 | 118 | onFinish={handleSave} |
125 | - wrapperCol={{ span: 18 }} | |
126 | - labelCol={{ span: 6 }} | |
119 | + // wrapperCol={{ span: 18 }} | |
120 | + // labelCol={{ span: 6 }} | |
127 | 121 | > |
128 | 122 | <Form.Item |
129 | 123 | label="待办名称" |
... | ... | @@ -152,11 +146,32 @@ export default function CreateModal({ |
152 | 146 | <Radio value={false}>否</Radio> |
153 | 147 | </Radio.Group> |
154 | 148 | </Form.Item> |
155 | - {/* 是否显示切换入口 */} | |
149 | + <Form.Item noStyle shouldUpdate={(prev, cur) => prev.dock !== cur.dock}> | |
150 | + {({ getFieldValue }) => { | |
151 | + const dock = getFieldValue("dock") || false; | |
152 | + if (dock) { | |
153 | + return ( | |
154 | + // 是否显示切换入口 | |
155 | + <Form.Item | |
156 | + label="显示切换入口" | |
157 | + name="exShow" | |
158 | + rules={[ | |
159 | + { required: true, message: "请选择是否显示切换入口" }, | |
160 | + ]} | |
161 | + > | |
162 | + <Radio.Group> | |
163 | + <Radio value>是</Radio> | |
164 | + <Radio value={false}>否</Radio> | |
165 | + </Radio.Group> | |
166 | + </Form.Item> | |
167 | + ); | |
168 | + } else return null; | |
169 | + }} | |
170 | + </Form.Item> | |
156 | 171 | <Form.Item |
157 | - label="显示切换入口" | |
158 | - name="exShow" | |
159 | - rules={[{ required: true, message: "请选择是否显示切换入口" }]} | |
172 | + label="待办时效考核" | |
173 | + name="assess" | |
174 | + rules={[{ required: true, message: "请选择是否对接待办时效考核" }]} | |
160 | 175 | > |
161 | 176 | <Radio.Group> |
162 | 177 | <Radio value>是</Radio> |
... | ... | @@ -164,9 +179,9 @@ export default function CreateModal({ |
164 | 179 | </Radio.Group> |
165 | 180 | </Form.Item> |
166 | 181 | <Form.Item |
167 | - label="待办时效考核" | |
168 | - name="assess" | |
169 | - rules={[{ required: true, message: "请选择是否对接待办时效考核" }]} | |
182 | + label="忽略未完成待办统计" | |
183 | + name="ignoreCount" | |
184 | + rules={[{ required: true, message: "请选择是否忽略未完成待办统计" }]} | |
170 | 185 | > |
171 | 186 | <Radio.Group> |
172 | 187 | <Radio value>是</Radio> |
... | ... | @@ -189,9 +204,7 @@ export default function CreateModal({ |
189 | 204 | |
190 | 205 | <Form.Item |
191 | 206 | noStyle |
192 | - shouldUpdate={(pre, cur) => | |
193 | - pre.dock !== cur.dock || pre.itemType !== cur.itemType | |
194 | - } | |
207 | + shouldUpdate={(pre, cur) => pre.dock !== cur.dock || pre.itemType !== cur.itemType} | |
195 | 208 | > |
196 | 209 | {({ getFieldValue }) => { |
197 | 210 | const dock = getFieldValue("dock"); |
... | ... | @@ -218,11 +231,9 @@ export default function CreateModal({ |
218 | 231 | |
219 | 232 | <Form.Item |
220 | 233 | noStyle |
221 | - shouldUpdate={(pre, cur) => | |
222 | - pre.customTemp !== cur.customTemp || | |
234 | + shouldUpdate={(pre, cur) => pre.customTemp !== cur.customTemp || | |
223 | 235 | pre.dock !== cur.dock || |
224 | - pre.itemType !== cur.itemType | |
225 | - } | |
236 | + pre.itemType !== cur.itemType} | |
226 | 237 | > |
227 | 238 | {({ getFieldValue }) => { |
228 | 239 | const dock = getFieldValue("dock"); |
... | ... | @@ -255,11 +266,9 @@ export default function CreateModal({ |
255 | 266 | |
256 | 267 | <Form.Item |
257 | 268 | noStyle |
258 | - shouldUpdate={(pre, cur) => | |
259 | - pre.dock !== cur.dock || | |
269 | + shouldUpdate={(pre, cur) => pre.dock !== cur.dock || | |
260 | 270 | pre.itemType !== cur.itemType || |
261 | - pre.customTemp !== cur.customTemp | |
262 | - } | |
271 | + pre.customTemp !== cur.customTemp} | |
263 | 272 | > |
264 | 273 | {({ getFieldValue }) => { |
265 | 274 | const dock = getFieldValue("dock"); |
... | ... | @@ -337,9 +346,7 @@ export default function CreateModal({ |
337 | 346 | |
338 | 347 | <Form.Item |
339 | 348 | noStyle |
340 | - shouldUpdate={(pre, cur) => | |
341 | - pre.itemType !== cur.itemType || pre.customTemp !== cur.customTemp | |
342 | - } | |
349 | + shouldUpdate={(pre, cur) => pre.itemType !== cur.itemType || pre.customTemp !== cur.customTemp} | |
343 | 350 | > |
344 | 351 | {({ getFieldValue }) => { |
345 | 352 | const itemType = getFieldValue("itemType"); | ... | ... |