zlisen 3 år sedan
förälder
incheckning
97eddca8aa
2 ändrade filer med 19 tillägg och 14 borttagningar
  1. 6
    3
      src/pages/building/List/tableColumns.js
  2. 13
    11
      src/pages/system/Sellhouse/Edit.jsx

+ 6
- 3
src/pages/building/List/tableColumns.js Visa fil

@@ -1,4 +1,5 @@
1
-import { router } from 'umi'
1
+// import { router } from 'umi'
2
+import { Link } from 'umi';
2 3
 import { Button, Badge } from 'antd'
3 4
 import moment from 'moment'
4 5
 import OperButton from '@/components/OperButton'
@@ -37,15 +38,17 @@ export default ({page, onPublish, onDelete}) => [
37 38
     align: 'center',
38 39
     render: (t, row) => (
39 40
       <AuthButton name="building.detail" noRight={t}>
40
-        <Button
41
+        <Link target= "_blank" to={`/building/add?id=${row.buildingId}`}>{t}</Link>
42
+        {/* <Button
41 43
           type="link"
42 44
           onClick={() => router.push({
45
+            target: '_blank',
43 46
             pathname: '/building/add',
44 47
             query: {
45 48
               id: row.buildingId,
46 49
             },
47 50
           })}
48
-        >{t}</Button>
51
+        >{t}</Button> */}
49 52
       </AuthButton>
50 53
     )
51 54
   },

+ 13
- 11
src/pages/system/Sellhouse/Edit.jsx Visa fil

@@ -107,16 +107,16 @@ const Edit = props => {
107 107
       ],
108 108
     },
109 109
 
110
-    {
111
-      label: '状态',
112
-      name: 'publishStatus',
113
-      type: FieldTypes.Select,
114
-      dict: [
115
-        { label: '未发布', value: 0 },
116
-        { label: '已发布', value: 1 },
117
-      ],
118
-      value: policyData.publishStatus != null ? policyData.publishStatus : 1,
119
-    },
110
+    // {
111
+    //   label: '状态',
112
+    //   name: 'publishStatus',
113
+    //   type: FieldTypes.Select,
114
+    //   dict: [
115
+    //     { label: '未发布', value: 0 },
116
+    //     { label: '已发布', value: 1 },
117
+    //   ],
118
+    //   value: policyData.publishStatus != null ? policyData.publishStatus : 1,
119
+    // },
120 120
   ];
121 121
 
122 122
   const handleSubmit = val => {
@@ -127,6 +127,7 @@ const Edit = props => {
127 127
       return;
128 128
     }
129 129
     val.isHot = val.isHot ? 1 : 0;
130
+
130 131
     if (policyId) {
131 132
       val.policyId = policyId;
132 133
       request({ ...apis.system.updateTaPolicy, urlData: { id: policyId }, data: val })
@@ -138,6 +139,7 @@ const Edit = props => {
138 139
           message.info(err.msg || err.message);
139 140
         });
140 141
     } else {
142
+      val.publishStatus = 0;
141 143
       request({ ...apis.system.addTaPolicy, data: val })
142 144
         .then(data => {
143 145
           message.info('保存成功');
@@ -151,7 +153,7 @@ const Edit = props => {
151 153
 
152 154
   return (
153 155
     <Card>
154
-      <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
156
+      <XForm onSubmit={handleSubmit} onCancel={cancelPage} submitBtn={policyData.publishStatus !== 1}  fields={fields}></XForm>
155 157
     </Card>
156 158
   );
157 159
 };