소스 검색

Form changes

master
JannekeDL 5 년 전
부모
커밋
040bc95f2f
2개의 변경된 파일78개의 추가작업 그리고 72개의 파일을 삭제
  1. 7
    7
      src/components/property/propertyImage.vue
  2. 71
    65
      src/components/property/propertyeditPage.vue

+ 7
- 7
src/components/property/propertyImage.vue 파일 보기

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
     <div>
3
     <div>
4
-      <label class="btn btn-a" style="width: 137px; height:58px;">
4
+      <label class="btn btn-b-n" style="width: 85px; height:40px;">
5
         Upload
5
         Upload
6
         <input
6
         <input
7
           type="file"
7
           type="file"
30
   data() {
30
   data() {
31
     return {
31
     return {
32
       images: {},
32
       images: {},
33
-      image: [],
33
+      image: []
34
     };
34
     };
35
   },
35
   },
36
 
36
 
50
         const reader = new FileReader();
50
         const reader = new FileReader();
51
         var vm = this;
51
         var vm = this;
52
 
52
 
53
-        reader.onload = (e) => {
53
+        reader.onload = e => {
54
           vm.image.push(e.target.result);
54
           vm.image.push(e.target.result);
55
           console.log(vm.image);
55
           console.log(vm.image);
56
         };
56
         };
63
       this.images.splice(key, 1);
63
       this.images.splice(key, 1);
64
 
64
 
65
       if (!this.image.length) {
65
       if (!this.image.length) {
66
-        this.$refs.im.value = '';
66
+        this.$refs.im.value = "";
67
       }
67
       }
68
-    },
69
-  },
68
+    }
69
+  }
70
 };
70
 };
71
-</script>
71
+</script>

+ 71
- 65
src/components/property/propertyeditPage.vue 파일 보기

30
           >
30
           >
31
             <div class="form-group row">
31
             <div class="form-group row">
32
               <div class="col-md-4">
32
               <div class="col-md-4">
33
-                <label>Property Type</label>
33
+                <label for="Property Type"></label>
34
                 <select
34
                 <select
35
-                  class="form-control form-control-lg form-control-a"
35
+                  class="form-control"
36
                   name="propertyType"
36
                   name="propertyType"
37
                   id="propertyType"
37
                   id="propertyType"
38
                   v-model="property.propertyTypeId"
38
                   v-model="property.propertyTypeId"
39
                 >
39
                 >
40
-                  <option value="0">Please Select</option>
40
+                  <option value="0">Please select Property Type</option>
41
                   <option v-for="item in propertyTypes" :value="item.id">{{ item.description }}</option>
41
                   <option v-for="item in propertyTypes" :value="item.id">{{ item.description }}</option>
42
                 </select>
42
                 </select>
43
               </div>
43
               </div>
44
             </div>
44
             </div>
45
             <div class="form-group row">
45
             <div class="form-group row">
46
               <div class="col-md-4">
46
               <div class="col-md-4">
47
-                <label>Address Line 1</label>
47
+                <label for="Address Line 1"></label>
48
                 <input
48
                 <input
49
-                  class="form-control form-control-lg form-control-a"
49
+                  class="form-control"
50
                   type="text"
50
                   type="text"
51
+                  placeholder="Address Line 1"
51
                   name="address1"
52
                   name="address1"
52
                   id="address1"
53
                   id="address1"
53
                   v-model="property.addressLine1"
54
                   v-model="property.addressLine1"
54
                 />
55
                 />
55
               </div>
56
               </div>
56
               <div class="col-md-4">
57
               <div class="col-md-4">
57
-                <label>Address Line 2</label>
58
+                <label for="Address Line 2"></label>
58
                 <input
59
                 <input
59
-                  class="form-control form-control-lg form-control-a"
60
+                  class="form-control"
60
                   type="text"
61
                   type="text"
62
+                  placeholder="Address Line 2"
61
                   name="address2"
63
                   name="address2"
62
                   id="address2"
64
                   id="address2"
63
                   v-model="property.addressLine2"
65
                   v-model="property.addressLine2"
64
                 />
66
                 />
65
               </div>
67
               </div>
66
               <div class="col-md-4">
68
               <div class="col-md-4">
67
-                <label>Address Line 3</label>
69
+                <label for="Address Line 3"></label>
68
                 <input
70
                 <input
69
-                  class="form-control form-control-lg form-control-a"
71
+                  class="form-control"
70
                   type="text"
72
                   type="text"
73
+                  placeholder="Address Line 3"
71
                   name="address3"
74
                   name="address3"
72
                   id="address3"
75
                   id="address3"
73
                   v-model="property.addressLine3"
76
                   v-model="property.addressLine3"
76
             </div>
79
             </div>
77
             <div class="form-group row">
80
             <div class="form-group row">
78
               <div class="col-md-4">
81
               <div class="col-md-4">
79
-                <label>Province</label>
82
+                <label for="Province"></label>
80
                 <select
83
                 <select
81
-                  class="form-control form-control-lg form-control-a"
84
+                  class="form-control"
82
                   name="propertyType"
85
                   name="propertyType"
83
                   id="propertyType"
86
                   id="propertyType"
84
                   @change="ProvinceSelected"
87
                   @change="ProvinceSelected"
85
                   v-model="property.provinceId"
88
                   v-model="property.provinceId"
86
                 >
89
                 >
87
-                  <option value="0">Please Select</option>
90
+                  <option value="0">Please select Province</option>
88
                   <option
91
                   <option
89
                     v-for="province in provinces"
92
                     v-for="province in provinces"
90
                     :value="province.id"
93
                     :value="province.id"
92
                 </select>
95
                 </select>
93
               </div>
96
               </div>
94
               <div class="col-md-4">
97
               <div class="col-md-4">
95
-                <label>City</label>
98
+                <label for="City"></label>
96
                 <select
99
                 <select
97
-                  class="form-control form-control-lg form-control-a"
100
+                  class="form-control"
98
                   name="propertyType"
101
                   name="propertyType"
99
                   id="propertyType"
102
                   id="propertyType"
100
                   @change="CitySelected"
103
                   @change="CitySelected"
101
                   v-model="property.cityId"
104
                   v-model="property.cityId"
102
                 >
105
                 >
103
-                  <option value="0">Please Select</option>
106
+                  <option value="0">Please select City</option>
104
                   <option v-for="city in cities" :value="city.id">{{ city.description }}</option>
107
                   <option v-for="city in cities" :value="city.id">{{ city.description }}</option>
105
                 </select>
108
                 </select>
106
               </div>
109
               </div>
107
               <div class="col-md-4">
110
               <div class="col-md-4">
108
-                <label>Suburb</label>
111
+                <label for="Suburb"></label>
109
                 <select
112
                 <select
110
-                  class="form-control form-control-lg form-control-a"
113
+                  class="form-control"
111
                   name="propertyType"
114
                   name="propertyType"
112
                   id="suburbselector"
115
                   id="suburbselector"
113
                   v-model="property.suburbId"
116
                   v-model="property.suburbId"
114
                 >
117
                 >
115
-                  <option value="0">Please Select</option>
118
+                  <option value="0">Please select Suburb</option>
116
                   <option v-for="suburb in suburbs" :value="suburb.id">{{ suburb.description }}</option>
119
                   <option v-for="suburb in suburbs" :value="suburb.id">{{ suburb.description }}</option>
117
                 </select>
120
                 </select>
118
               </div>
121
               </div>
119
             </div>
122
             </div>
120
             <div class="form-group row">
123
             <div class="form-group row">
121
               <div class="col-md-4">
124
               <div class="col-md-4">
122
-                <label v-if="salesType === 'Rental'">Rental</label>
123
-                <label v-if="salesType !== 'Rental'">Sale Price</label>
125
+                <label v-if="salesType === 'Rental'">Rental Price</label>
126
+                <label v-if="salesType !== 'Rental'">Sales Price</label>
124
                 <input
127
                 <input
125
-                  class="form-control form-control-lg form-control-a"
128
+                  class="form-control"
126
                   type="number"
129
                   type="number"
127
                   name="price"
130
                   name="price"
128
                   id="price"
131
                   id="price"
132
+                  placeholder="R"
129
                   v-model="property.price"
133
                   v-model="property.price"
130
                 />
134
                 />
131
               </div>
135
               </div>
132
               <div class="col-md-4" v-if="salesType === 'Rental'">
136
               <div class="col-md-4" v-if="salesType === 'Rental'">
133
                 <label>Per</label>
137
                 <label>Per</label>
134
                 <select
138
                 <select
135
-                  class="form-control form-control-lg form-control-a"
139
+                  class="form-control"
136
                   name="propertyType"
140
                   name="propertyType"
137
                   id="propertyType"
141
                   id="propertyType"
138
                   v-model="property.per"
142
                   v-model="property.per"
139
                 >
143
                 >
140
-                  <option value>Please Select</option>
144
+                  <option value>Please select</option>
141
                   <option value="month">Month</option>
145
                   <option value="month">Month</option>
142
                   <option value="day">Day</option>
146
                   <option value="day">Day</option>
143
                 </select>
147
                 </select>
145
             </div>
149
             </div>
146
             <div class="form-group row">
150
             <div class="form-group row">
147
               <div class="col-md-12">
151
               <div class="col-md-12">
148
-                <label>Property Description</label>
152
+                <label for="Property Description"></label>
149
                 <textarea
153
                 <textarea
150
-                  class="form-control editor form-control-lg form-control-a"
154
+                  class="form-control editor"
155
+                  placeholder="Property Description"
151
                   name="description"
156
                   name="description"
152
                   v-model="property.description"
157
                   v-model="property.description"
153
                 ></textarea>
158
                 ></textarea>
159
+                <br />
154
                 <p>* A listing fee of R380 including VAT is payable to list your Property on the Uni-Vate website</p>
160
                 <p>* A listing fee of R380 including VAT is payable to list your Property on the Uni-Vate website</p>
155
               </div>
161
               </div>
156
             </div>
162
             </div>
176
               </div>
182
               </div>
177
             </div>
183
             </div>
178
             <ImageLoad />
184
             <ImageLoad />
179
-            <button type="submit" class="btn btn-a">Save</button>
185
+            <button type="submit" class="btn btn-b-n" style="width: 85px; height:40px;">Save</button>
180
           </form>
186
           </form>
181
         </div>
187
         </div>
182
       </div>
188
       </div>
185
 </template>
191
 </template>
186
 
192
 
187
 <script>
193
 <script>
188
-import UserField from './propertyUserField.vue';
189
-import ImageLoad from './propertyImage.vue';
194
+import UserField from "./propertyUserField.vue";
195
+import ImageLoad from "./propertyImage.vue";
190
 
196
 
191
 export default {
197
 export default {
192
-  name: 'PropertyEdit',
198
+  name: "PropertyEdit",
193
   components: {
199
   components: {
194
     UserField,
200
     UserField,
195
-    ImageLoad,
201
+    ImageLoad
196
   },
202
   },
197
   data() {
203
   data() {
198
     return {
204
     return {
199
       ApiRunning: false,
205
       ApiRunning: false,
200
-      propertyType: 'Residential',
201
-      salesType: 'Rental',
202
-      imageFile: '',
206
+      propertyType: "Residential",
207
+      salesType: "Rental",
208
+      imageFile: "",
203
       provinces: [],
209
       provinces: [],
204
       cities: [],
210
       cities: [],
205
       suburbs: [],
211
       suburbs: [],
206
       propertyValues: [],
212
       propertyValues: [],
207
       propValuesProp: [],
213
       propValuesProp: [],
208
       propertyTypes: [],
214
       propertyTypes: [],
209
-      selectedProvince: '',
210
-      selectedCity: '',
215
+      selectedProvince: "",
216
+      selectedCity: "",
211
       property: {
217
       property: {
212
         propertyTypeId: 0,
218
         propertyTypeId: 0,
213
-        addressLine1: '',
214
-        addressLine2: '',
215
-        addressLine3: '',
219
+        addressLine1: "",
220
+        addressLine2: "",
221
+        addressLine3: "",
216
         suburbId: 0,
222
         suburbId: 0,
217
         cityId: 0,
223
         cityId: 0,
218
         provinceId: 0,
224
         provinceId: 0,
219
-        price: '',
220
-        per: '',
221
-        description: '',
222
-        isSale: false,
223
-      },
225
+        price: "",
226
+        per: "",
227
+        description: "",
228
+        isSale: false
229
+      }
224
     };
230
     };
225
   },
231
   },
226
   methods: {
232
   methods: {
227
     SubmitData() {
233
     SubmitData() {
228
-      const axios = require('axios');
234
+      const axios = require("axios");
229
       axios
235
       axios
230
-        .post('http://localhost:57260/Property/Property', this.property, {
236
+        .post("http://localhost:57260/Property/Property", this.property, {
231
           headers: {
237
           headers: {
232
-            'Content-type': 'application/json',
233
-          },
238
+            "Content-type": "application/json"
239
+          }
234
         })
240
         })
235
-        .then((response) => {})
236
-        .catch((e) => {
241
+        .then(response => {})
242
+        .catch(e => {
237
           alert(e);
243
           alert(e);
238
         });
244
         });
239
 
245
 
244
         this.selectedProvince = this.provinces[
250
         this.selectedProvince = this.provinces[
245
           item.target.options.selectedIndex - 1
251
           item.target.options.selectedIndex - 1
246
         ].description;
252
         ].description;
247
-        const axios = require('axios');
253
+        const axios = require("axios");
248
         axios
254
         axios
249
           .get(
255
           .get(
250
-            `http://localhost:57260/region/city/getby/${this.selectedProvince}`,
256
+            `http://localhost:57260/region/city/getby/${this.selectedProvince}`
251
           )
257
           )
252
           .then(response => (this.cities = response.data));
258
           .then(response => (this.cities = response.data));
253
       }
259
       }
257
         this.selectedCity = this.cities[
263
         this.selectedCity = this.cities[
258
           item.target.options.selectedIndex - 1
264
           item.target.options.selectedIndex - 1
259
         ].description;
265
         ].description;
260
-        const axios = require('axios');
266
+        const axios = require("axios");
261
         axios
267
         axios
262
           .get(
268
           .get(
263
-            `http://localhost:57260/region/Suburb/${this.selectedProvince}/${this.selectedCity}`,
269
+            `http://localhost:57260/region/Suburb/${this.selectedProvince}/${this.selectedCity}`
264
           )
270
           )
265
           .then(response => (this.suburbs = response.data));
271
           .then(response => (this.suburbs = response.data));
266
       }
272
       }
267
-    },
273
+    }
268
   },
274
   },
269
   mounted() {
275
   mounted() {
270
     this.propertyType = this.$route.params.propType;
276
     this.propertyType = this.$route.params.propType;
271
     this.salesType = this.$route.params.saleType;
277
     this.salesType = this.$route.params.saleType;
272
 
278
 
273
-    const axios = require('axios');
279
+    const axios = require("axios");
274
     axios
280
     axios
275
-      .get('http://localhost:57260/Property/PropertyFields/Property Overview')
281
+      .get("http://localhost:57260/Property/PropertyFields/Property Overview")
276
       .then(response => (this.propValuesProp = response.data));
282
       .then(response => (this.propValuesProp = response.data));
277
 
283
 
278
     axios
284
     axios
279
-      .get('http://localhost:57260/Property/PropertyFields')
285
+      .get("http://localhost:57260/Property/PropertyFields")
280
       .then(response => (this.propertyValues = response.data));
286
       .then(response => (this.propertyValues = response.data));
281
 
287
 
282
     axios
288
     axios
283
       .get(
289
       .get(
284
-        `http://localhost:57260/Property/PropertyType/type/${this.propertyType}`,
290
+        `http://localhost:57260/Property/PropertyType/type/${this.propertyType}`
285
       )
291
       )
286
       .then(response => (this.propertyTypes = response.data));
292
       .then(response => (this.propertyTypes = response.data));
287
 
293
 
288
     axios
294
     axios
289
-      .get('http://localhost:57260/region/province')
295
+      .get("http://localhost:57260/region/province")
290
       .then(response => (this.provinces = response.data));
296
       .then(response => (this.provinces = response.data));
291
   },
297
   },
292
   computed: {
298
   computed: {
294
       this.propertyType = this.$route.params.propType;
300
       this.propertyType = this.$route.params.propType;
295
       this.salesType = this.$route.params.saleType;
301
       this.salesType = this.$route.params.saleType;
296
 
302
 
297
-      const axios = require('axios');
303
+      const axios = require("axios");
298
       axios
304
       axios
299
         .get(
305
         .get(
300
-          `http://localhost:57260/Property/PropertyType/type/${this.propertyType}`,
306
+          `http://localhost:57260/Property/PropertyType/type/${this.propertyType}`
301
         )
307
         )
302
         .then(response => (this.propertyTypes = response.data));
308
         .then(response => (this.propertyTypes = response.data));
303
-    },
309
+    }
304
   },
310
   },
305
   watch: {
311
   watch: {
306
     SalesTypeChanged() {
312
     SalesTypeChanged() {
307
       console.log(this.salesType);
313
       console.log(this.salesType);
308
-    },
309
-  },
314
+    }
315
+  }
310
 };
316
 };
311
-</script>
317
+</script>

Loading…
취소
저장