fangmingyue 1 年之前
父節點
當前提交
9e980f77b4
共有 7 個檔案被更改,包括 89 行新增14 行删除
  1. 9
    0
      src/pages/custom/index.jsx
  2. 9
    5
      src/pages/project/Edit.jsx
  3. 24
    1
      src/pages/project/index.jsx
  4. 18
    0
      src/pages/user/Edit.jsx
  5. 15
    0
      src/pages/user/index.jsx
  6. 13
    7
      src/utils/request.js
  7. 1
    1
      vite.config.js

+ 9
- 0
src/pages/custom/index.jsx 查看文件

25
     {
25
     {
26
       title: "公司",
26
       title: "公司",
27
       dataIndex: "customName",
27
       dataIndex: "customName",
28
+      ellipsis: true,
28
       search: false,
29
       search: false,
29
     },
30
     },
30
     {
31
     {
31
       title: "税号",
32
       title: "税号",
32
       dataIndex: "dutyParagraph",
33
       dataIndex: "dutyParagraph",
34
+      ellipsis: true,
33
       search: false,
35
       search: false,
34
     },
36
     },
35
     {
37
     {
36
       title: "开户行",
38
       title: "开户行",
37
       search: false,
39
       search: false,
38
       dataIndex: "openingBank",
40
       dataIndex: "openingBank",
41
+      ellipsis: true,
39
     },
42
     },
40
     {
43
     {
41
       title: "账号",
44
       title: "账号",
42
       dataIndex: "account",
45
       dataIndex: "account",
43
       search: false,
46
       search: false,
47
+      ellipsis: true,
44
     },
48
     },
45
     {
49
     {
46
       title: "联系人姓名",
50
       title: "联系人姓名",
47
       dataIndex: "contactsName",
51
       dataIndex: "contactsName",
52
+      ellipsis: true,
48
     },
53
     },
49
     {
54
     {
50
       title: "联系人头衔",
55
       title: "联系人头衔",
51
       dataIndex: "contactsTitle",
56
       dataIndex: "contactsTitle",
52
       search: false,
57
       search: false,
58
+      ellipsis: true,
53
     },
59
     },
54
     {
60
     {
55
       title: "联系人手机",
61
       title: "联系人手机",
56
       dataIndex: "contactsPhone",
62
       dataIndex: "contactsPhone",
63
+      ellipsis: true,
57
     },
64
     },
58
     {
65
     {
59
       title: "联系人邮箱",
66
       title: "联系人邮箱",
60
       dataIndex: "contactsEmail",
67
       dataIndex: "contactsEmail",
61
       search: false,
68
       search: false,
69
+      ellipsis: true,
62
     },
70
     },
63
     {
71
     {
64
       title: "操作",
72
       title: "操作",
94
     <Page>
102
     <Page>
95
       <ProTable
103
       <ProTable
96
         actionRef={actionRef}
104
         actionRef={actionRef}
105
+        // scroll={{ x: 1900 }}
97
         rowKey="customId"
106
         rowKey="customId"
98
         toolBarRender={() => [
107
         toolBarRender={() => [
99
           <Button
108
           <Button

+ 9
- 5
src/pages/project/Edit.jsx 查看文件

36
       })
36
       })
37
     }
37
     }
38
     getTaCustom().then((res) => {
38
     getTaCustom().then((res) => {
39
-      setList(res.records);
39
+      setList(res.records?.map(x => ({ label: x.customName, value: x.customId })) || []);
40
     })
40
     })
41
   }, [id])
41
   }, [id])
42
 
42
 
110
           </Form.Item>
110
           </Form.Item>
111
 
111
 
112
           <Form.Item name="customId" label="所属客户">
112
           <Form.Item name="customId" label="所属客户">
113
-            <Select placeholder="请选择">
114
-              {
113
+            <Select placeholder="请选择" options={list} />
114
+            {/* {
115
                 list.map((res, index) => {
115
                 list.map((res, index) => {
116
                   return (
116
                   return (
117
                     <Option key={index} value={res.customId}>{res.customName}</Option>
117
                     <Option key={index} value={res.customId}>{res.customName}</Option>
118
                   )
118
                   )
119
                 })
119
                 })
120
               }
120
               }
121
-            </Select>
121
+            </Select> */}
122
           </Form.Item>
122
           </Form.Item>
123
           <Form.Item name="quotation" label="合同报价">
123
           <Form.Item name="quotation" label="合同报价">
124
             <Input placeholder="请输入" />
124
             <Input placeholder="请输入" />
125
           </Form.Item>
125
           </Form.Item>
126
           <Form.Item name="stage" label="目前阶段">
126
           <Form.Item name="stage" label="目前阶段">
127
-            <Input placeholder="请输入" />
127
+            <Select>
128
+              <Select.Option value={0}>未开始</Select.Option>
129
+              <Select.Option value={1}>处理中</Select.Option>
130
+              <Select.Option value={2}>以完成</Select.Option>
131
+            </Select>
128
           </Form.Item>
132
           </Form.Item>
129
           <Form.Item name="contactsName" label="联系人姓名">
133
           <Form.Item name="contactsName" label="联系人姓名">
130
             <Input placeholder="请输入" />
134
             <Input placeholder="请输入" />

+ 24
- 1
src/pages/project/index.jsx 查看文件

16
     {
16
     {
17
       title: "项目名称",
17
       title: "项目名称",
18
       dataIndex: "projectName",
18
       dataIndex: "projectName",
19
+      ellipsis: true,
19
     },
20
     },
20
     {
21
     {
21
       title: "简介",
22
       title: "简介",
22
       dataIndex: "introduction",
23
       dataIndex: "introduction",
23
       search: false,
24
       search: false,
25
+      ellipsis: true,
24
     },
26
     },
25
     {
27
     {
26
       title: "开始日期",
28
       title: "开始日期",
36
       title: "运维服务期",
38
       title: "运维服务期",
37
       dataIndex: "crm",
39
       dataIndex: "crm",
38
       search: false,
40
       search: false,
41
+      ellipsis: true,
39
     },
42
     },
40
     {
43
     {
41
       title: "所属客户",
44
       title: "所属客户",
42
       dataIndex: "customId",
45
       dataIndex: "customId",
43
       valueType: "select",
46
       valueType: "select",
44
       search: false,
47
       search: false,
45
-      request: TaCustom
48
+      request: TaCustom,
49
+      ellipsis: true,
46
     },
50
     },
47
     {
51
     {
48
       title: "合同报价",
52
       title: "合同报价",
49
       dataIndex: "quotation",
53
       dataIndex: "quotation",
50
       search: false,
54
       search: false,
55
+      ellipsis: true,
51
     },
56
     },
52
     {
57
     {
53
       title: "目前阶段",
58
       title: "目前阶段",
54
       dataIndex: "stage",
59
       dataIndex: "stage",
55
       search: false,
60
       search: false,
61
+      valueType: "select",
62
+      valueEnum: {
63
+        0: "未开始",
64
+        1: "处理中",
65
+        2: "以完成",
66
+      }
56
     },
67
     },
57
     {
68
     {
58
       title: "联系人姓名",
69
       title: "联系人姓名",
59
       dataIndex: "contactsName",
70
       dataIndex: "contactsName",
71
+      ellipsis: true,
60
     },
72
     },
61
     {
73
     {
62
       title: "联系人头衔",
74
       title: "联系人头衔",
63
       dataIndex: "contactsTitle",
75
       dataIndex: "contactsTitle",
64
       search: false,
76
       search: false,
77
+      ellipsis: true,
65
     },
78
     },
66
 
79
 
67
     {
80
     {
68
       title: "联系人手机",
81
       title: "联系人手机",
69
       dataIndex: "contactsPhone",
82
       dataIndex: "contactsPhone",
70
       search: false,
83
       search: false,
84
+      ellipsis: true,
71
     },
85
     },
72
     {
86
     {
73
       title: "联系人邮箱",
87
       title: "联系人邮箱",
74
       dataIndex: "contactsEmail",
88
       dataIndex: "contactsEmail",
75
       search: false,
89
       search: false,
90
+      ellipsis: true,
76
     },
91
     },
77
     {
92
     {
78
       title: "负责人",
93
       title: "负责人",
79
       dataIndex: "headPerson",
94
       dataIndex: "headPerson",
95
+      ellipsis: true,
80
     },
96
     },
81
     {
97
     {
82
       title: "服务运营商",
98
       title: "服务运营商",
83
       dataIndex: "serviceIsp",
99
       dataIndex: "serviceIsp",
84
       search: false,
100
       search: false,
101
+      ellipsis: true,
85
     },
102
     },
86
 
103
 
87
     {
104
     {
88
       title: "主机",
105
       title: "主机",
89
       dataIndex: "hostMachine",
106
       dataIndex: "hostMachine",
90
       search: false,
107
       search: false,
108
+      ellipsis: true,
91
     },
109
     },
92
     {
110
     {
93
       title: "数据库",
111
       title: "数据库",
94
       dataIndex: "dataBase",
112
       dataIndex: "dataBase",
95
       search: false,
113
       search: false,
114
+      ellipsis: true,
96
     },
115
     },
97
     {
116
     {
98
       title: "OSS",
117
       title: "OSS",
99
       dataIndex: "oss",
118
       dataIndex: "oss",
100
       search: false,
119
       search: false,
120
+      ellipsis: true,
101
     },
121
     },
102
     {
122
     {
103
       title: "前端地址",
123
       title: "前端地址",
104
       dataIndex: "webUrl",
124
       dataIndex: "webUrl",
105
       search: false,
125
       search: false,
126
+      ellipsis: true,
106
     },
127
     },
107
 
128
 
108
     {
129
     {
109
       title: "账户",
130
       title: "账户",
110
       dataIndex: "account",
131
       dataIndex: "account",
111
       search: false,
132
       search: false,
133
+      ellipsis: true,
112
     },
134
     },
113
     {
135
     {
114
       title: "密码",
136
       title: "密码",
115
       dataIndex: "password",
137
       dataIndex: "password",
116
       render: (_, row) => row?.password.replace(row.password, '******'),
138
       render: (_, row) => row?.password.replace(row.password, '******'),
117
       search: false,
139
       search: false,
140
+      ellipsis: true,
118
     },
141
     },
119
   ];
142
   ];
120
 
143
 

+ 18
- 0
src/pages/user/Edit.jsx 查看文件

76
             <Input placeholder="请输入电话" />
76
             <Input placeholder="请输入电话" />
77
           </Form.Item>
77
           </Form.Item>
78
 
78
 
79
+          <Form.Item
80
+            label="账户"
81
+            name="account"
82
+            rules={[{ required: true, message: "请输入账户" }]}
83
+          >
84
+            <Input placeholder="请输入账户" style={{ borderRadius: "4px" }} />
85
+          </Form.Item>
86
+          <Form.Item
87
+            label="密码"
88
+            name="password"
89
+            rules={[{ required: true, message: "请输入密码" }]}
90
+          >
91
+            <Input.Password
92
+              placeholder="请输入密码"
93
+              style={{ borderRadius: "4px" }}
94
+            />
95
+          </Form.Item>
96
+
79
           <Form.Item {...tailFormItemLayout}>
97
           <Form.Item {...tailFormItemLayout}>
80
             <Button loading={submiting} type="primary" htmlType="submit">
98
             <Button loading={submiting} type="primary" htmlType="submit">
81
               保存
99
               保存

+ 15
- 0
src/pages/user/index.jsx 查看文件

22
     {
22
     {
23
       title: "姓名",
23
       title: "姓名",
24
       dataIndex: "userName",
24
       dataIndex: "userName",
25
+      ellipsis: true,
25
     },
26
     },
26
     {
27
     {
27
       title: "电话",
28
       title: "电话",
28
       dataIndex: "phone",
29
       dataIndex: "phone",
30
+      ellipsis: true,
31
+    },
32
+    {
33
+      title: "账户",
34
+      dataIndex: "account",
35
+      ellipsis: true,
36
+      search: false,
37
+    },
38
+    {
39
+      title: "密码",
40
+      dataIndex: "password",
41
+      ellipsis: true,
42
+      search: false,
43
+      render: (_, row) => row?.password.replace(row.password, '******'),
29
     },
44
     },
30
     {
45
     {
31
       title: "操作",
46
       title: "操作",

+ 13
- 7
src/utils/request.js 查看文件

103
 
103
 
104
 export default instance;
104
 export default instance;
105
 
105
 
106
-export function queryTable(apiRequest) {
106
+export function queryTable (apiRequest) {
107
   return function (params) {
107
   return function (params) {
108
     const { pageSize } = params;
108
     const { pageSize } = params;
109
     return apiRequest({
109
     return apiRequest({
126
   };
126
   };
127
 }
127
 }
128
 
128
 
129
-export function queryDict(
129
+function getValueOfType (value, type) {
130
+  if (type == 'string') return `${value}`
131
+  if (type == 'int' || type == 'integer') return value - 0;
132
+  return value;
133
+}
134
+
135
+export function queryDict (
130
   apiRequest,
136
   apiRequest,
131
-  { labelKey = "name", valueKey = "id" } = {}
137
+  { labelKey = "name", valueKey = "id", valueType }
132
 ) {
138
 ) {
133
   return function (params) {
139
   return function (params) {
134
     const { current, pageSize, ...leftParams } = params || {};
140
     const { current, pageSize, ...leftParams } = params || {};
140
       .then((res) => {
146
       .then((res) => {
141
         return res?.records?.map((x) => ({
147
         return res?.records?.map((x) => ({
142
           label: x[labelKey],
148
           label: x[labelKey],
143
-          value: x[valueKey],
149
+          value: getValueOfType(x[valueKey], valueType),
144
           ...x,
150
           ...x,
145
         }));
151
         }));
146
       })
152
       })
151
       });
157
       });
152
   };
158
   };
153
 }
159
 }
154
-export function restful(url) {
160
+export function restful (url) {
155
   const list = (params) => instance.get(url, { params });
161
   const list = (params) => instance.get(url, { params });
156
   const get = (id) => instance.get(`${url}/${id}`);
162
   const get = (id) => instance.get(`${url}/${id}`);
157
   const add = (data) => instance.post(url, data);
163
   const add = (data) => instance.post(url, data);
161
   return [list, get, add, update, del];
167
   return [list, get, add, update, del];
162
 }
168
 }
163
 
169
 
164
-export function useRequest(fn) {
170
+export function useRequest (fn) {
165
   const [loading, setLoading] = React.useState(false);
171
   const [loading, setLoading] = React.useState(false);
166
 
172
 
167
   const p = (...args) =>
173
   const p = (...args) =>
181
   return [loading, p];
187
   return [loading, p];
182
 }
188
 }
183
 
189
 
184
-function downloadBlob(response) {
190
+function downloadBlob (response) {
185
   let fileName = "未知文件";
191
   let fileName = "未知文件";
186
   const contentType = response.headers["content-type"];
192
   const contentType = response.headers["content-type"];
187
   const contentDisposition = response.headers["content-disposition"];
193
   const contentDisposition = response.headers["content-disposition"];

+ 1
- 1
vite.config.js 查看文件

11
     host: "0.0.0.0",
11
     host: "0.0.0.0",
12
     proxy: {
12
     proxy: {
13
       '/api': {
13
       '/api': {
14
-        target: 'http://127.0.0.1:8090',
14
+        target: 'http://192.168.89.25:8090',
15
         changeOrigin: true,
15
         changeOrigin: true,
16
       },
16
       },
17
       // '/': 'http://192.168.89.25:8090',
17
       // '/': 'http://192.168.89.25:8090',