chen.cheng пре 7 месеци
родитељ
комит
5f09ee2e15

+ 2 - 2
.env.h5dev

@@ -1,6 +1,6 @@
 //.env.dev
 VITE_BASE_API=/aiot-api
 
-VITE_BASE_URL=https://www.lj-info.com:8090/aiot-api
+VITE_BASE_URL=http://172.192.13.145:8019/aiot-api
 
-VITE_IMG_CDN=https://www.lj-info.com:8090/
+VITE_IMG_CDN=http://172.192.13.145:8019/

+ 1 - 2
src/pages/workbench/appctl.vue

@@ -18,7 +18,7 @@
             <up-icon
                 :name="baseListItem.name"
                 :size="22"
-                @click="throttle(()=>ctlClick(baseListIndex), 500)"
+                @click="()=>ctlClick(baseListIndex)"
             ></up-icon>
           </view>
           <text class="grid-text">{{ baseListItem.title }}</text>
@@ -36,7 +36,6 @@ import device from '@/static/aiot/icon/device.svg';
 import order from '@/static/aiot/icon/order.svg';
 import submitOrder from '@/static/aiot/icon/submit-order.svg';
 import list from '@/static/aiot/list.svg';
-import {throttle} from '@/uni_modules/uview-plus';
 
 const ctlItems = ref([
   {

+ 1 - 1
src/pages/workbenchsub/workorder/detail.vue

@@ -6,7 +6,7 @@
         工单信息
       </template>
       <template v-slot:content>
-        <view class="order-info">
+        <view class="order-info" style="width: 100%">
           <view class="mix-wrap">
             <view class="info-column">
               <label-text

+ 29 - 29
src/pages/workbenchsub/workorder/submit.vue

@@ -121,7 +121,14 @@
             :previewFullImage="true"
         ></up-upload>
       </up-form-item>
-      <up-button @click="submit" style="margin-top: 20rpx;">提交</up-button>
+      <up-button
+          :loading="state.loading"
+          loadingText="提交中"
+          :disabled="state.loading"
+          @click="submit"
+          style="margin-top: 20rpx;">
+        提交
+      </up-button>
     </up-form>
     <up-action-sheet
         :show="state.showOrderType"
@@ -158,14 +165,6 @@
         @cancel="state.showEndClendar = false"
     >
     </up-datetime-picker>
-    <up-upload
-        @afterRead="afterRead"
-        @delete="deletePic"
-        name="imags"
-        multiple
-        :maxCount="5"
-        :previewFullImage="true"
-    ></up-upload>
   </view>
 </template>
 
@@ -182,6 +181,7 @@ const state = reactive({
   showOrderLevel: false,
   showStartClendar: false,
   showEndClendar: false,
+  loading: false,
   model: {
     order: {
       files: [],
@@ -276,30 +276,30 @@ const afterRead = async (event) => {
   }
 }
 const submit = () => {
+  state.loading = true
   formRef.value.validate().then(async valid => {
-    if (valid) {
-      const order = state.model.order
-      submitOrderWork({
-        "name": order.name,
-        "type": order.type,
-        "level": order.level,
-        "estimatedStartTime": dayjs(order.startDate).format(DateFormat.YYYYMMDDHHMMSS),
-        "estimatedEndTime": dayjs(order.endDate).format(DateFormat.YYYYMMDDHHMMSS),
-        "description": order.desc,
-        "source": 2,
-        "problemImg": JSON.stringify(order.files),
-        "problemFile": null
-      }).then(res => {
-        uni.$u.toast('提交成功')
-        reloadPage()
-      })
-    } else {
-      uni.$u.toast('校验失败')
-    }
+    const order = state.model.order
+    submitOrderWork({
+      "name": order.name,
+      "type": order.type,
+      "level": order.level,
+      "estimatedStartTime": dayjs(order.startDate).format(DateFormat.YYYYMMDDHHMMSS),
+      "estimatedEndTime": dayjs(order.endDate).format(DateFormat.YYYYMMDDHHMMSS),
+      "description": order.desc,
+      "source": 2,
+      "problemImg": JSON.stringify(order.files),
+      "problemFile": null
+    }).then(res => {
+      uni.$u.toast('提交成功')
+      reloadPage()
+    }).finally(() => {
+      state.loading = false
+    })
   }).catch((e) => {
     // 处理验证错误
     uni.$u.toast('校验失败')
-  });
+    state.loading = false
+  })
 }
 </script>