fangmingyue před 1 rokem
rodič
revize
9e980f77b4

+ 9
- 0
src/pages/custom/index.jsx Zobrazit soubor

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

+ 9
- 5
src/pages/project/Edit.jsx Zobrazit soubor

@@ -36,7 +36,7 @@ export default (props) => {
36 36
       })
37 37
     }
38 38
     getTaCustom().then((res) => {
39
-      setList(res.records);
39
+      setList(res.records?.map(x => ({ label: x.customName, value: x.customId })) || []);
40 40
     })
41 41
   }, [id])
42 42
 
@@ -110,21 +110,25 @@ export default (props) => {
110 110
           </Form.Item>
111 111
 
112 112
           <Form.Item name="customId" label="所属客户">
113
-            <Select placeholder="请选择">
114
-              {
113
+            <Select placeholder="请选择" options={list} />
114
+            {/* {
115 115
                 list.map((res, index) => {
116 116
                   return (
117 117
                     <Option key={index} value={res.customId}>{res.customName}</Option>
118 118
                   )
119 119
                 })
120 120
               }
121
-            </Select>
121
+            </Select> */}
122 122
           </Form.Item>
123 123
           <Form.Item name="quotation" label="合同报价">
124 124
             <Input placeholder="请输入" />
125 125
           </Form.Item>
126 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 132
           </Form.Item>
129 133
           <Form.Item name="contactsName" label="联系人姓名">
130 134
             <Input placeholder="请输入" />

+ 24
- 1
src/pages/project/index.jsx Zobrazit soubor

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

+ 18
- 0
src/pages/user/Edit.jsx Zobrazit soubor

@@ -76,6 +76,24 @@ export default (props) => {
76 76
             <Input placeholder="请输入电话" />
77 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 97
           <Form.Item {...tailFormItemLayout}>
80 98
             <Button loading={submiting} type="primary" htmlType="submit">
81 99
               保存

+ 15
- 0
src/pages/user/index.jsx Zobrazit soubor

@@ -22,10 +22,25 @@ export default (props) => {
22 22
     {
23 23
       title: "姓名",
24 24
       dataIndex: "userName",
25
+      ellipsis: true,
25 26
     },
26 27
     {
27 28
       title: "电话",
28 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 46
       title: "操作",

+ 13
- 7
src/utils/request.js Zobrazit soubor

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

+ 1
- 1
vite.config.js Zobrazit soubor

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