Explorar o código

ios图片测试

LuChongMei hai 9 meses
pai
achega
51ece113b0

+ 31 - 18
src/store/index.js

@@ -1,25 +1,38 @@
 import { createStore } from "vuex";
-const TOKEN_Key="MZ_USER";
-const PCTOKEN_Key="MZ_TOKEN";
-const COLOR_Key="MZ_COLOR";
-const store =createStore({
-    state:{
-        user:window.localStorage.getItem(TOKEN_Key),
-        pctoken:window.localStorage.getItem(PCTOKEN_Key),
-        selectcolor:window.localStorage.getItem(COLOR_Key)
+const TOKEN_Key = "MZ_USER";
+const PCTOKEN_Key = "MZ_TOKEN";
+const COLOR_Key = "MZ_COLOR";
+const store = createStore({
+    state() {
+        // user:window.localStorage.getItem(TOKEN_Key),
+        // pctoken:window.localStorage.getItem(PCTOKEN_Key),
+        // selectcolor:window.localStorage.getItem(COLOR_Key)
+        return {
+            user: window.localStorage.getItem(TOKEN_Key),
+            pctoken: window.localStorage.getItem(PCTOKEN_Key),
+            selectcolor: window.localStorage.getItem(COLOR_Key)
+        }
     },
-    mutations:{
-        setUser(state,data){
-            state.user=data;
-            window.localStorage.setItem(TOKEN_Key,state.user);
+    mutations: {
+        setUser(state, data) {
+            state.user = data;
+            xm.setStorage({ key: TOKEN_Key, value: state.user }).then(() => {
+
+            })
+            window.localStorage.setItem(TOKEN_Key, state.user);
         },
-        setPcToken(state,data){
-            state.pctoken=data;
-            window.localStorage.setItem(PCTOKEN_Key,state.pctoken);
+        setPcToken(state, data) {
+            state.pctoken = data;
+            xm.setStorage({ key: "MZ_TOKEN", value: state.pctoken }).then(() => {
+            })
+            window.localStorage.setItem(PCTOKEN_Key, state.pctoken);
         },
-        setSelectColor(state,data){
-            state.selectcolor=data;
-            window.localStorage.setItem(COLOR_Key,state.selectcolor);
+        setSelectColor(state, data) {
+            state.selectcolor = data;
+            xm.setStorage({ key: COLOR_Key, value: state.selectcolor }).then(() => {
+
+            })
+            window.localStorage.setItem(COLOR_Key, state.selectcolor);
         },
     },
 });

+ 454 - 332
src/views/placeManage/placeFirefighting/placeFirefightingView.vue

@@ -1,348 +1,470 @@
 <template>
-	<van-nav-bar fixed title="消防设备添加" left-text="" left-arrow @click-left="onClickLeft"
-		:style="{ 'background-color': selectColor }">
-	</van-nav-bar>
-	<div class="main">
-		<van-form @submit="submit" show-error :show-error-message="false">
-			<van-cell-group>
-				<van-field v-model="inputForm.name" center required :rules="[{ required: true }]" label="设备名称:"
-					placeholder="请填写设备名称" input-align="right" />
-			</van-cell-group>
-			<van-cell-group>
-				<van-field v-model="locationName" readonly required :rules="[{ required: true }]" label="所属场所:"
-					placeholder="请选择所属场所" input-align="right" right-icon="arrow-down" @click="hs_site = true">
-				</van-field>
-				<van-dialog v-model:show="hs_site" title="所属场所" show-cancel-button>
-					<div class="dialog">
-						<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
-							<van-radio-group v-model="checked">
-								<van-cell-group inset>
-									<van-cell v-for="item in sitelist" :key="item" :title="item.name" clickable
-										@click="getsite(item)">
-										<template #right-icon>
-											<van-radio :name="item.id" @click="getsite(item)" />
-										</template>
-									</van-cell>
-								</van-cell-group>
-							</van-radio-group>
-						</van-list>
-					</div>
-				</van-dialog>
-			</van-cell-group>
-			<van-cell-group>
-				<van-field v-model="inputForm.personInCharge" center required label-width="7.2em"
-					:rules="[{ required: true }]" label="消防负责人:" placeholder="请填写消防负责人" input-align="right" />
-			</van-cell-group>
-			<van-cell-group>
-				<van-field v-model="inputForm.contactInformation" center label="联系方式:" placeholder="请填写联系方式"
-					input-align="right" />
-			</van-cell-group>
-			<van-cell-group>
-				<van-field v-model="typeOfEmployeesName" readonly required :rules="[{ required: true }]"
-					label-width="7.2em" label="设备类型:" placeholder="请选择设备类型" input-align="right" right-icon="arrow-down"
-					@click="hs_typeOfEmployees = true" />
-				<van-popup v-model:show="hs_typeOfEmployees" round position="bottom">
-					<van-picker title="设备类型" :columns="$dictUtils.getDictList('hs_site_fire_type')"
-						:columns-field-names="{
+  <van-nav-bar
+    fixed
+    title="消防设备添加"
+    left-text=""
+    left-arrow
+    @click-left="onClickLeft"
+    :style="{ 'background-color': selectColor }"
+  >
+  </van-nav-bar>
+  <div class="main">
+    <van-form @submit="submit" show-error :show-error-message="false">
+      <van-cell-group>
+        <van-field
+          v-model="inputForm.name"
+          center
+          required
+          :rules="[{ required: true }]"
+          label="设备名称:"
+          placeholder="请填写设备名称"
+          input-align="right"
+        />
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          v-model="locationName"
+          readonly
+          required
+          :rules="[{ required: true }]"
+          label="所属场所:"
+          placeholder="请选择所属场所"
+          input-align="right"
+          right-icon="arrow-down"
+          @click="hs_site = true"
+        >
+        </van-field>
+        <van-dialog v-model:show="hs_site" title="所属场所" show-cancel-button>
+          <div class="dialog">
+            <van-list
+              v-model:loading="loading"
+              :finished="finished"
+              finished-text="没有更多了"
+              @load="onLoad"
+            >
+              <van-radio-group v-model="checked">
+                <van-cell-group inset>
+                  <van-cell
+                    v-for="item in sitelist"
+                    :key="item"
+                    :title="item.name"
+                    clickable
+                    @click="getsite(item)"
+                  >
+                    <template #right-icon>
+                      <van-radio :name="item.id" @click="getsite(item)" />
+                    </template>
+                  </van-cell>
+                </van-cell-group>
+              </van-radio-group>
+            </van-list>
+          </div>
+        </van-dialog>
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          v-model="inputForm.personInCharge"
+          center
+          required
+          label-width="7.2em"
+          :rules="[{ required: true }]"
+          label="消防负责人:"
+          placeholder="请填写消防负责人"
+          input-align="right"
+        />
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          v-model="inputForm.contactInformation"
+          center
+          label="联系方式:"
+          placeholder="请填写联系方式"
+          input-align="right"
+        />
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          v-model="typeOfEmployeesName"
+          readonly
+          required
+          :rules="[{ required: true }]"
+          label-width="7.2em"
+          label="设备类型:"
+          placeholder="请选择设备类型"
+          input-align="right"
+          right-icon="arrow-down"
+          @click="hs_typeOfEmployees = true"
+        />
+        <van-popup v-model:show="hs_typeOfEmployees" round position="bottom">
+          <van-picker
+            title="设备类型"
+            :columns="$dictUtils.getDictList('hs_site_fire_type')"
+            :columns-field-names="{
               text: 'label',
               value: 'value',
-            }" @cancel="hs_typeOfEmployees = false" @confirm="gettypeOfEmployees" />
-				</van-popup>
-			</van-cell-group>
-			<van-cell-group>
-				<van-field v-model="inputForm.effectiveDateStart" center readonly required label-width="8em"
-					:rules="[{ required: true }]" label="有效起始时间:" placeholder="请选择时间" input-align="right"
-					right-icon="arrow-down" @click="hs_Start = true" />
-				<van-popup v-model:show="hs_Start" round position="bottom">
-					<van-picker-group title="有效起始时间" :tabs="['选择日期', '选择时间']" next-step-text="下一步" @confirm="getTime"
-						@cancel="hs_Start = false">
-						<van-date-picker v-model="currentDate" />
-						<van-time-picker v-model="currentTime" :columns-type="columnsType" />
-					</van-picker-group>
-				</van-popup>
-			</van-cell-group>
-			<van-cell-group>
-				<van-field v-model="inputForm.effectiveDateEnd" center readonly required label-width="8em"
-					:rules="[{ required: true }]" label="有效结束时间:" placeholder="请选择时间" input-align="right"
-					right-icon="arrow-down" @click="hs_End = true" />
-				<van-popup v-model:show="hs_End" round position="bottom">
-					<van-picker-group title="有效结束时间" :tabs="['选择日期', '选择时间']" next-step-text="下一步" @confirm="getTimeend"
-						@cancel="hs_End = false">
-						<van-date-picker v-model="currentDate" />
-						<van-time-picker v-model="currentTime" :columns-type="columnsType" />
-					</van-picker-group>
-				</van-popup>
-			</van-cell-group>
-			<van-cell-group>
-				<van-field v-model="inputForm.nextMaintenanceDate" center readonly label-width="8em" label="下次保养时期:"
-					placeholder="请选择时间" input-align="right" right-icon="arrow-down" @click="hs_upkeep = true" />
-				<van-popup v-model:show="hs_upkeep" round position="bottom">
-					<van-picker-group title="下次保养时期" :tabs="['选择日期', '选择时间']" next-step-text="下一步"
-						@confirm="getTimeupkeep" @cancel="hs_upkeep = false">
-						<van-date-picker v-model="currentDate" />
-						<van-time-picker v-model="currentTime" :columns-type="columnsType" />
-					</van-picker-group>
-				</van-popup>
-			</van-cell-group>
-			<van-cell-group>
-				<van-field v-model="inputForm.position" center required :rules="[{ required: true }]" label="位置:"
-					placeholder="请填写设备位置" input-align="right" />
-			</van-cell-group>
-			<van-cell-group>
-				<van-field name="uploader" label-align="top" label-width="8em" label="设备图片:">
-					<template #input>
-						<van-uploader readonly v-model="fileList" :max-count="5" accept="" :preview-full-image="false"
-							:before-delete="deleteRead" @click-upload="chooseImg">
-						</van-uploader>
-					</template>
-				</van-field>
-			</van-cell-group>
-			<div class="subbtn">
-				<van-button type="primary" native-type="submit">提交</van-button>
-				<van-button @click="onClickLeft" type="default" hairline>取消</van-button>
-			</div>
-		</van-form>
-	</div>
+            }"
+            @cancel="hs_typeOfEmployees = false"
+            @confirm="gettypeOfEmployees"
+          />
+        </van-popup>
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          v-model="inputForm.effectiveDateStart"
+          center
+          readonly
+          required
+          label-width="8em"
+          :rules="[{ required: true }]"
+          label="有效起始时间:"
+          placeholder="请选择时间"
+          input-align="right"
+          right-icon="arrow-down"
+          @click="hs_Start = true"
+        />
+        <van-popup v-model:show="hs_Start" round position="bottom">
+          <van-picker-group
+            title="有效起始时间"
+            :tabs="['选择日期', '选择时间']"
+            next-step-text="下一步"
+            @confirm="getTime"
+            @cancel="hs_Start = false"
+          >
+            <van-date-picker v-model="currentDate" />
+            <van-time-picker
+              v-model="currentTime"
+              :columns-type="columnsType"
+            />
+          </van-picker-group>
+        </van-popup>
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          v-model="inputForm.effectiveDateEnd"
+          center
+          readonly
+          required
+          label-width="8em"
+          :rules="[{ required: true }]"
+          label="有效结束时间:"
+          placeholder="请选择时间"
+          input-align="right"
+          right-icon="arrow-down"
+          @click="hs_End = true"
+        />
+        <van-popup v-model:show="hs_End" round position="bottom">
+          <van-picker-group
+            title="有效结束时间"
+            :tabs="['选择日期', '选择时间']"
+            next-step-text="下一步"
+            @confirm="getTimeend"
+            @cancel="hs_End = false"
+          >
+            <van-date-picker v-model="currentDate" />
+            <van-time-picker
+              v-model="currentTime"
+              :columns-type="columnsType"
+            />
+          </van-picker-group>
+        </van-popup>
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          v-model="inputForm.nextMaintenanceDate"
+          center
+          readonly
+          label-width="8em"
+          label="下次保养时期:"
+          placeholder="请选择时间"
+          input-align="right"
+          right-icon="arrow-down"
+          @click="hs_upkeep = true"
+        />
+        <van-popup v-model:show="hs_upkeep" round position="bottom">
+          <van-picker-group
+            title="下次保养时期"
+            :tabs="['选择日期', '选择时间']"
+            next-step-text="下一步"
+            @confirm="getTimeupkeep"
+            @cancel="hs_upkeep = false"
+          >
+            <van-date-picker v-model="currentDate" />
+            <van-time-picker
+              v-model="currentTime"
+              :columns-type="columnsType"
+            />
+          </van-picker-group>
+        </van-popup>
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          v-model="inputForm.position"
+          center
+          required
+          :rules="[{ required: true }]"
+          label="位置:"
+          placeholder="请填写设备位置"
+          input-align="right"
+        />
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          name="uploader"
+          label-align="top"
+          label-width="8em"
+          label="设备图片:"
+        >
+          <template #input>
+            <van-uploader
+              readonly
+              v-model="fileList"
+              :max-count="5"
+              accept=""
+              :preview-full-image="false"
+              :before-delete="deleteRead"
+              @click-upload="chooseImg"
+            >
+            </van-uploader>
+          </template>
+        </van-field>
+      </van-cell-group>
+      <div class="subbtn">
+        <van-button type="primary" native-type="submit">提交</van-button>
+        <van-button @click="onClickLeft" type="default" hairline
+          >取消</van-button
+        >
+      </div>
+    </van-form>
+  </div>
 </template>
 
 <script>
-	import {
-		ref
-	} from "vue";
-	import {
-		useRouter
-	} from "vue-router";
-	import placeFirefighting from "@/api/placeFirefighting/placeFirefighting";
-	import PlaceRegister from "@/api/placeRegister/placeRegister";
-	import tools from "@/api/sys/tools";
-	import $base from "@/utils/config";
-	import {
-		formatDate,
-		formatTime
-	} from "@/utils/datatime";
-	export default {
-		setup() {
-			const inputForm = ref({
-				id: "",
-				name: "",
-				siteId: "",
-				personInCharge: "",
-				contactInformation: "",
-				equipmentType: "",
-				devicePicture: "",
-				effectiveDate: [],
-				effectiveDateStart: "",
-				effectiveDateEnd: "",
-				nextMaintenanceDate: "",
-				position: "",
-			});
-			// 导航栏颜色
-			const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
-			//返回取消按钮
-			const onClickLeft = () => {
-				history.back();
-			};
-			// 所属场所
-			const locationName = ref("");
-			const checked = ref("");
-			const sitelist = ref([]);
-			let hs_site = ref(false);
-			const getsite = (val) => {
-				let id = "";
-				id = val.id;
-				locationName.value = val.name;
-				const json = Object.assign(inputForm.value, {
-					siteId: val.id
-				});
-				inputForm.value = json;
-				checked.value = val.id;
-			};
-			const loading = ref(false);
-			const finished = ref(false);
-			const refreshing = ref(false);
-			let index = 0;
-			const onLoad = () => {
-				loading.value = true;
-				finished.value = false;
-				// 异步更新数据
-				new PlaceRegister()
-					.religiousList({
-						current: index + 1,
-						size: 10,
-					})
-					.then(({
-						records,
-						pages
-					}) => {
-						sitelist.value = sitelist.value.concat(records);
-						// 加载状态结束
-						loading.value = false;
-						if (index + 1 >= pages) {
-							finished.value = true;
-						}
-						index++;
-					});
-			};
-			// 设备类型
-			const typeOfEmployeesName = ref("");
-			let hs_typeOfEmployees = ref(false);
-			const gettypeOfEmployees = ({
-				selectedOptions
-			}) => {
-				hs_typeOfEmployees.value = false;
-				const json = Object.assign(inputForm.value, {
-					equipmentType: selectedOptions[0].value,
-				});
-				inputForm.value = json;
-				typeOfEmployeesName.value = selectedOptions[0].label;
-			};
-			//有效期起始时间
-			let hs_Start = ref(false);
-			let currentDate = ref(formatDate(new Date()));
-			let currentTime = ref(formatTime(new Date()));
-			const columnsType = ["hour", "minute", "second"];
-			const getTime = () => {
-				hs_Start.value = false;
-				inputForm.value.effectiveDateStart = `${currentDate.value.join(
+import { ref } from "vue";
+import { useStore } from "vuex";
+import { useRouter } from "vue-router";
+import placeFirefighting from "@/api/placeFirefighting/placeFirefighting";
+import PlaceRegister from "@/api/placeRegister/placeRegister";
+import tools from "@/api/sys/tools";
+import $base from "@/utils/config";
+import { formatDate, formatTime } from "@/utils/datatime";
+export default {
+  setup() {
+    const store = useStore();
+    const inputForm = ref({
+      id: "",
+      name: "",
+      siteId: "",
+      personInCharge: "",
+      contactInformation: "",
+      equipmentType: "",
+      devicePicture: "",
+      effectiveDate: [],
+      effectiveDateStart: "",
+      effectiveDateEnd: "",
+      nextMaintenanceDate: "",
+      position: "",
+    });
+    // 导航栏颜色
+    const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
+    //返回取消按钮
+    const onClickLeft = () => {
+      history.back();
+    };
+    // 所属场所
+    const locationName = ref("");
+    const checked = ref("");
+    const sitelist = ref([]);
+    let hs_site = ref(false);
+    const getsite = (val) => {
+      let id = "";
+      id = val.id;
+      locationName.value = val.name;
+      const json = Object.assign(inputForm.value, {
+        siteId: val.id,
+      });
+      inputForm.value = json;
+      checked.value = val.id;
+    };
+    const loading = ref(false);
+    const finished = ref(false);
+    const refreshing = ref(false);
+    let index = 0;
+    const onLoad = () => {
+      loading.value = true;
+      finished.value = false;
+      // 异步更新数据
+      new PlaceRegister()
+        .religiousList({
+          current: index + 1,
+          size: 10,
+        })
+        .then(({ records, pages }) => {
+          sitelist.value = sitelist.value.concat(records);
+          // 加载状态结束
+          loading.value = false;
+          if (index + 1 >= pages) {
+            finished.value = true;
+          }
+          index++;
+        });
+    };
+    // 设备类型
+    const typeOfEmployeesName = ref("");
+    let hs_typeOfEmployees = ref(false);
+    const gettypeOfEmployees = ({ selectedOptions }) => {
+      hs_typeOfEmployees.value = false;
+      const json = Object.assign(inputForm.value, {
+        equipmentType: selectedOptions[0].value,
+      });
+      inputForm.value = json;
+      typeOfEmployeesName.value = selectedOptions[0].label;
+    };
+    //有效期起始时间
+    let hs_Start = ref(false);
+    let currentDate = ref(formatDate(new Date()));
+    let currentTime = ref(formatTime(new Date()));
+    const columnsType = ["hour", "minute", "second"];
+    const getTime = () => {
+      hs_Start.value = false;
+      inputForm.value.effectiveDateStart = `${currentDate.value.join(
         "-"
       )} ${currentTime.value.join(":")}`;
-			};
-			//有效期结束时间
-			let hs_End = ref(false);
-			const getTimeend = () => {
-				hs_End.value = false;
-				inputForm.value.effectiveDateEnd = `${currentDate.value.join(
+    };
+    //有效期结束时间
+    let hs_End = ref(false);
+    const getTimeend = () => {
+      hs_End.value = false;
+      inputForm.value.effectiveDateEnd = `${currentDate.value.join(
         "-"
       )} ${currentTime.value.join(":")}`;
-			};
-			//下次保养日期
-			let hs_upkeep = ref(false);
-			const getTimeupkeep = () => {
-				hs_upkeep.value = false;
-				inputForm.value.nextMaintenanceDate = `${currentDate.value.join(
+    };
+    //下次保养日期
+    let hs_upkeep = ref(false);
+    const getTimeupkeep = () => {
+      hs_upkeep.value = false;
+      inputForm.value.nextMaintenanceDate = `${currentDate.value.join(
         "-"
       )} ${currentTime.value.join(":")}`;
-			};
-			//图片上传
-			let fileList = ref([]);
-			let fileImg = ref([]);
-			const chooseImg = () => {
-				window.xm.getToken().then(async function(token) {
-					xm.showToast({
-						message: token,
-					});
-					xm.showLoading()
-					xm.chooseFile({
-						count: 1,
-						name: "file",
-						url: $base +
-							`/sys/file/webupload/upload?uploadPath=religioussites/fire/fireEquipment`,
-						headers: {
-							"Content-Type": "multipart/form-data",
-							"Authorization": token
-						},
-					}).then((res) => {
-						// "token": token,
-						let data = res[0].data;
-						data.name = decodeURIComponent(
-							data.id.substring(data.url.lastIndexOf("/") + 1)
-						);
-						data.url = $base + data.url;
-						xm.showToast({
-							message: data.url,
-						});
-						fileImg.value.push(data);
-						fileList.value.push(data);
-						xm.hideLoading()
-					});
-				})
-			};
-			// 删除文件
-			const deleteRead = (file) => {
-				//删除文件操作
-				for (let index = 0; index < fileList.value.length; index++) {
-					if (file.id == fileList.value[index].id) {
-						fileList.value.splice(index, 1);
-						if (fileImg.value[index]) {
-							let delurl = fileImg.value[index].url;
-							new tools().uploadFiledelete("", delurl).then(({
-								data
-							}) => {});
-							fileImg.value.splice(index, 1);
-						}
-					}
-				}
-			};
-			let router = useRouter();
-			//数据提交
-			const submit = () => {
-				//保存前附件处理
-				inputForm.value.devicePicture = fileImg.value
-					.map((option) => option.id)
-					.join("|");
-				new placeFirefighting()
-					.placeFirefightingsave(inputForm.value)
-					.then((res) => {
-						console.log(res);
-						if (res.status == 200) {
-							xm.showToast({
-								message: "设备添加成功",
-							});
-							router.push({
-								path: "/placeFirefightingList",
-							});
-						} else {
-							xm.showToast({
-								message: "设备添加失败",
-							});
-						}
-					});
-			};
-			return {
-				inputForm,
-				selectColor,
-				onClickLeft,
-				//所属场所
-				locationName,
-				checked,
-				hs_site,
-				getsite,
-				sitelist,
-				loading,
-				finished,
-				onLoad,
-				refreshing,
-				//设备类型
-				typeOfEmployeesName,
-				hs_typeOfEmployees,
-				gettypeOfEmployees,
-				// 有效起始时间
-				currentDate,
-				currentTime,
-				columnsType,
-				hs_Start,
-				getTime,
-				// 有效结束时间
-				hs_End,
-				getTimeend,
-				// 下次保养日期
-				hs_upkeep,
-				getTimeupkeep,
-				//图片上传
-				fileList,
-				chooseImg,
-				deleteRead,
-				//数据提交
-				submit,
-			};
-		},
-	};
+    };
+    //图片上传
+    let fileList = ref([]);
+    let fileImg = ref([]);
+
+    const chooseImg = () => {
+      if (store.state.pctoken != "") {
+        xm.showToast({
+          message: store.state.pctoken,
+        });
+        // xm.showLoading();
+        xm.chooseFile({
+          count: 1,
+          name: "file",
+          url:
+            $base +
+            `/sys/file/webupload/upload?uploadPath=religioussites/fire/fireEquipment`,
+          headers: {
+            "Content-Type": "multipart/form-data",
+          },
+        }).then((res) => {
+          // "token": token,
+          let data = res[0].data;
+          data.name = decodeURIComponent(
+            data.id.substring(data.url.lastIndexOf("/") + 1)
+          );
+          data.url = $base + data.url;
+          xm.showToast({
+            message: data.url,
+          });
+          fileImg.value.push(data);
+          fileList.value.push(data);
+          xm.hideLoading();
+        });
+      }
+    };
+    // 删除文件
+    const deleteRead = (file) => {
+      //删除文件操作
+      for (let index = 0; index < fileList.value.length; index++) {
+        if (file.id == fileList.value[index].id) {
+          fileList.value.splice(index, 1);
+          if (fileImg.value[index]) {
+            let delurl = fileImg.value[index].url;
+            new tools().uploadFiledelete("", delurl).then(({ data }) => {});
+            fileImg.value.splice(index, 1);
+          }
+        }
+      }
+    };
+    let router = useRouter();
+    //数据提交
+    const submit = () => {
+      //保存前附件处理
+      inputForm.value.devicePicture = fileImg.value
+        .map((option) => option.id)
+        .join("|");
+      new placeFirefighting()
+        .placeFirefightingsave(inputForm.value)
+        .then((res) => {
+          console.log(res);
+          if (res.status == 200) {
+            xm.showToast({
+              message: "设备添加成功",
+            });
+            router.push({
+              path: "/placeFirefightingList",
+            });
+          } else {
+            xm.showToast({
+              message: "设备添加失败",
+            });
+          }
+        });
+    };
+    return {
+      inputForm,
+      selectColor,
+      onClickLeft,
+      //所属场所
+      locationName,
+      checked,
+      hs_site,
+      getsite,
+      sitelist,
+      loading,
+      finished,
+      onLoad,
+      refreshing,
+      //设备类型
+      typeOfEmployeesName,
+      hs_typeOfEmployees,
+      gettypeOfEmployees,
+      // 有效起始时间
+      currentDate,
+      currentTime,
+      columnsType,
+      hs_Start,
+      getTime,
+      // 有效结束时间
+      hs_End,
+      getTimeend,
+      // 下次保养日期
+      hs_upkeep,
+      getTimeupkeep,
+      //图片上传
+      fileList,
+      chooseImg,
+      deleteRead,
+      //数据提交
+      submit,
+    };
+  },
+};
 </script>
 
 <style>
-	.dialog {
-		width: 100%;
-		height: 400px;
-		overflow: auto;
-	}
+.dialog {
+  width: 100%;
+  height: 400px;
+  overflow: auto;
+}
 </style>

+ 419 - 371
src/views/tab_a/tabAll.vue

@@ -1,399 +1,447 @@
 <template>
-	<div class="bg">
-		<!-- <van-nav-bar
+  <div class="bg">
+    <!-- <van-nav-bar
 	  title="智慧“和顺”"
 	  left-text="民宗干事"
 	  left-arrow
 	  @click-left="onClickLeft"
 	/> -->
 
-		<!-- <van-image
+    <!-- <van-image
 		width="100%"
 		height="10rem"
 		fit="cover"
 		src="https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400"
 		/> -->
 
-		<van-swipe :autoplay="3000" lazy-render>
-			<van-swipe-item v-for="image in BannerImgurls" :key="image">
-				<van-image width="100%" height="10rem" fit="cover" :src="image" />
-			</van-swipe-item>
-		</van-swipe>
-
-		<div class="tabtitlelay" @click="goToBeDone">
-			<div class="tabtitle1"></div>
-			<div class="tabtitle">我的待办</div>
-			<div class="tabtitle2">(</div>
-			<div class="tabtitle3">{{ sum }}</div>
-			<div class="tabtitle4">)</div>
-			<van-icon name="ellipsis" class="tabtitle5" />
-		</div>
-
-		<div class="flexll">
-			<div class="ffl2" id="0" @click="goToBeDone($event)">
-				<div class="textRegular">待处理</div>
-				<div class="textRed">{{ sum1 ? sum1 : 0 }}</div>
-			</div>
-			<div class="verticalLine"></div>
-			<div class="ffl2" id="1" @click="goToBeDone($event)">
-				<div class="textRegular">已处理</div>
-				<div class="textBlue">{{ sum2 ? sum2 : 0 }}</div>
-			</div>
-		</div>
-		<div class="hLine"></div>
-
-		<div class="tabtitlelay">
-			<div class="tabtitle1"></div>
-			<div class="tabtitle">场所管理</div>
-		</div>
-
-		<van-grid :border="false">
-			<van-grid-item icon="./loginbg/csdj.png" text="场所登记" @click="goPlaceRegister" />
-			<van-grid-item icon="./loginbg/csry.png" text="场所人员信息" @click="goPlacePerson" />
-			<van-grid-item icon="./loginbg/cspw.png" text="牌位管理" @click="goPlaceTablet" />
-			<van-grid-item icon="./loginbg/csxf.png" text="场所消防" @click="PlaceFirefighting" />
-		</van-grid>
-
-		<div class="hLine"></div>
-
-		<div class="tabtitlelay">
-			<div class="tabtitle1"></div>
-			<div class="tabtitle">{{ testshow }}</div>
-		</div>
-
-		<van-grid :border="false">
-			<van-grid-item icon="./loginbg/hd_cshd.png" @click="placeActivity" text="场所活动" />			
-			<van-grid-item icon="./loginbg/hd_jc.png" text="场所检查" @click="tohd_jc" />
-			<van-grid-item icon="./loginbg/hd_hy.png" text="负责人会议" @click="tohd_hy" />
-		</van-grid>
-		
-		<div class="tabtitlelay">
-			<div class="tabtitle1"></div>
-			<div class="tabtitle">{{ testshow2 }}</div>
-		</div>
-		
-		<van-grid :border="false">
-			<van-grid-item icon="./loginbg/hd_ssjhd.png" @click="selfMeetingList" text="私设聚会点" />
-			<van-grid-item icon="./loginbg/hd_xjqz.png" @click="abnormalCrowd" text="信教群众异常" />
-			<van-grid-item icon="./loginbg/hd_af.png" text="安防设施异常" @click="tohd_af" />
-			<van-grid-item icon="./loginbg/hd_qt.png" text="其他有害信息" @click="tohd_qt" />
-		</van-grid>
-	</div>
+    <van-swipe :autoplay="3000" lazy-render>
+      <van-swipe-item v-for="image in BannerImgurls" :key="image">
+        <van-image width="100%" height="10rem" fit="cover" :src="image" />
+      </van-swipe-item>
+    </van-swipe>
+
+    <div class="tabtitlelay" @click="goToBeDone">
+      <div class="tabtitle1"></div>
+      <div class="tabtitle">我的待办</div>
+      <div class="tabtitle2">(</div>
+      <div class="tabtitle3">{{ sum }}</div>
+      <div class="tabtitle4">)</div>
+      <van-icon name="ellipsis" class="tabtitle5" />
+    </div>
+
+    <div class="flexll">
+      <div class="ffl2" id="0" @click="goToBeDone($event)">
+        <div class="textRegular">待处理</div>
+        <div class="textRed">{{ sum1 ? sum1 : 0 }}</div>
+      </div>
+      <div class="verticalLine"></div>
+      <div class="ffl2" id="1" @click="goToBeDone($event)">
+        <div class="textRegular">已处理</div>
+        <div class="textBlue">{{ sum2 ? sum2 : 0 }}</div>
+      </div>
+    </div>
+    <div class="hLine"></div>
+
+    <div class="tabtitlelay">
+      <div class="tabtitle1"></div>
+      <div class="tabtitle">场所管理</div>
+    </div>
+
+    <van-grid :border="false">
+      <van-grid-item
+        icon="./loginbg/csdj.png"
+        text="场所登记"
+        @click="goPlaceRegister"
+      />
+      <van-grid-item
+        icon="./loginbg/csry.png"
+        text="场所人员信息"
+        @click="goPlacePerson"
+      />
+      <van-grid-item
+        icon="./loginbg/cspw.png"
+        text="牌位管理"
+        @click="goPlaceTablet"
+      />
+      <van-grid-item
+        icon="./loginbg/csxf.png"
+        text="场所消防"
+        @click="PlaceFirefighting"
+      />
+    </van-grid>
+
+    <div class="hLine"></div>
+
+    <div class="tabtitlelay">
+      <div class="tabtitle1"></div>
+      <div class="tabtitle">{{ testshow }}</div>
+    </div>
+
+    <van-grid :border="false">
+      <van-grid-item
+        icon="./loginbg/hd_cshd.png"
+        @click="placeActivity"
+        text="场所活动"
+      />
+      <van-grid-item
+        icon="./loginbg/hd_jc.png"
+        text="场所检查"
+        @click="tohd_jc"
+      />
+      <van-grid-item
+        icon="./loginbg/hd_hy.png"
+        text="负责人会议"
+        @click="tohd_hy"
+      />
+    </van-grid>
+
+    <div class="tabtitlelay">
+      <div class="tabtitle1"></div>
+      <div class="tabtitle">{{ testshow2 }}</div>
+    </div>
+
+    <van-grid :border="false">
+      <van-grid-item
+        icon="./loginbg/hd_ssjhd.png"
+        @click="selfMeetingList"
+        text="私设聚会点"
+      />
+      <van-grid-item
+        icon="./loginbg/hd_xjqz.png"
+        @click="abnormalCrowd"
+        text="信教群众异常"
+      />
+      <van-grid-item
+        icon="./loginbg/hd_af.png"
+        text="安防设施异常"
+        @click="tohd_af"
+      />
+      <van-grid-item
+        icon="./loginbg/hd_qt.png"
+        text="其他有害信息"
+        @click="tohd_qt"
+      />
+    </van-grid>
+  </div>
 </template>
 
 <script>
 import tool from "@/tool";
 import qs from "qs";
 import userSets from "@/api/sys/userSets";
-import toBeDone from '@/api/toBeDone/toBeDone';
+import toBeDone from "@/api/toBeDone/toBeDone";
 import $base from "@/utils/config";
 export default {
-	data() {
-		return {
-			title: '民宗干事',
-			username: "",
-			sms: "",
-			password: "",
-			password2: "",
-			con1: 0,
-			con2: 0,
-			testshow: "活动管理",
-			testshow2: "异常监管",
-			sum: "0",
-			sum1: "0",
-			sum2: "0",
-			BannerImgurls: ['https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400', 'https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400']
-		}
-	},
-
-	created() {
-		let id = this.$route.query.id;
-		window.xm.setNavigationBarTitle({ title: '宗教和顺' })
-		this.TokenLogin2();
-		this.$dictUtils.refreshDictList();
-	},
-
-	methods: {
-		// 待办跳转
-		goToBeDone(e) {
-			let value = JSON.stringify(e.currentTarget.id)
-			this.$router.push({
-				path: "/toBeDone",
-				query: { "name": value }
-			});
-		},
-		// 场所登记跳转
-		goPlaceRegister() {
-			this.$router.push("/placeRegisterList");
-		},
-		// 人员档案跳转
-		goPlacePerson() {
-			this.$router.push("/placePerson");
-		},
-		// 牌位管理跳转
-		goPlaceTablet() {
-			this.$router.push("/placeTablet");
-		},
-		//场所消防
-		PlaceFirefighting(){
-			this.$router.push("/placeFirefightingList");
-		},
-		//待办数据获取
-		dataNumber() {
-			new toBeDone().list().then((res) => {
-				this.sum1 = res.records.length;
-				this.sum = this.sum1 + this.sum2;
-			})
-			new toBeDone().list2().then((res1) => {
-				this.sum2 = res1.records.length;
-				this.sum = this.sum1 + this.sum2;
-
-			})
-
-		},
-		onClickLeft() {
-			history.back();
-		},
-		tohd_jc() {
-			//this.onlineXm.xmNavTo("../activityMan\siteInspection\siteInspectionList");
-			this.$router.push("/siteInspectionList");
-		},
-		tohd_af() {
-			this.$router.push("/securityFacilitiesErrList");
-		},
-		tohd_hy() {
-			this.$router.push("/religiousConferenceList");
-		},
-		tohd_qt() {
-			this.$router.push("/nonReligiousInformationList");
-		},
-		// 活动场所
-		placeActivity() {
-			this.$router.push("/placeActivityList")
-		},
-		selfMeetingList() {
-			this.$router.push("/selfMeetingList")
-		},
-		abnormalCrowd() {
-			this.$router.push("/differentbelieversList")
-		},
-		async TokenLogin() {
-			let that = this;
-			//添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
-			if (this.$store.state.pctoken == "" || this.$store.state.pctoken == undefined) {
-
-				//SDK中 getToken() 方法获取免登token
-				//window.xm.getToken().then(async function(token){//上线取消注释
-				let token = "test";//上线注释
-
-				const inputForm = qs.stringify({
-					'token': token
-				}, { allowDots: true, arrayFormat: 'indices' })
-				var res = await this.$API.yin.TokenLogin.get(inputForm);
-				//存PCtoken
-				this.$store.commit('setPcToken', res.PcToken);
-				this.$store.commit('setUser', res.account);
-
-				//})//上线取消注释
-
-			}
-
-		},
-
-		TokenLogin2() {
-			let that = this;
-			//添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
-			if (this.$store.state.pctoken == "" || this.$store.state.pctoken == undefined) {
-
-				//SDK中 getToken() 方法获取免登token
-				window.xm.getToken().then(async function (token) {//上线取消注释
-					// let token = "test";//上线注释	
-
-
-					new userSets()
-						.TokenLogin({
-							token: token
-						})
-						.then((res) => {
-							xm.showToast({
-								message: "111"+res.header['Set-Cookie'],
-							});
-							that.$store.commit('setPcToken', res.PcToken);
-							that.$store.commit('setUser', res.account);
-							that.getBannerImg();//获取轮播图
-							that.getSelectColor();//获取主题颜色
-							that.dataNumber();//获取待办事项数
-						});
-
-				})//上线取消注释
-
-			} else {
-				xm.showToast({
-					message: "111"+res.header['Set-Cookie'],
-				});
-				that.getBannerImg();//获取轮播图
-				that.getSelectColor();//获取主题颜色
-				that.dataNumber();//获取待办事项数
-			}
-
-
-		},
-
-		getStatistics() {
-			let that = this;
-			new userSets()
-				.Statistics()
-				.then((res) => {
-					if (res[0].sum != undefined && res[0].sum != null && res[0].sum != "") {
-						that.sum = res[0].sum;
-					}
-					if (res[0].sum1 != undefined && res[0].sum1 != null && res[0].sum1 != "") {
-						that.sum1 = res[0].sum1;
-					}
-					if (res[0].sum2 != undefined && res[0].sum2 != null && res[0].sum2 != "") {
-						that.sum2 = res[0].sum2;
-					}
-				});
-		},
-
-		getBannerImg() {
-			new userSets()
-				.BannerImg({
-					'current': 1,
-					'size': 5,
-					'orders': [],
-				})
-				.then((res) => {
-					let bs = [];
-
-					res.records[0].bannerImg.split("|").forEach((item) => {
-						if (item.trim().length > 0) {
-							bs.push($base + item.replace('程序附件//', '程序附件/'),
-							);
-						}
-					});
-					this.BannerImgurls = bs;
-				});
-		},
-
-		getSelectColor() {
-			let that = this;
-			new userSets()
-				.SelectColor()
-				.then((res) => {
-					//console.log(res.records[0].selectColor.substring(1, 7));
-					//存PCtoken
-					that.$store.commit('setSelectColor', res.默认);
-				});
-		},
-
-
-
-		//测试接口,可删除
-		async gettest() {
-			let that = this;
-
-			//SDK中 getToken() 方法获取免登token
-			// window.xm.getToken().then(function(token){
-			// 	console.log(token);
-
-			// 	that.con1="哈哈"+token;
-			// 	window.xm.showToast({
-			// 		message:that.con1
-			// 	})
-
-			// })
-
-			//测试数据同步接口的
-			const inputForm = {
-				'iamRequestId': '120010',
-				'iamRemoteUser': 'admin12022',
-				'iamRemotePwd': ''
-			}
-			var res = await this.$API.yin.SchemaService.post(inputForm);
-			if (res.type == 1) {
-				this.$router.replace({
-					path: "/main",
-				});
-			} else {
-				Toast.fail(res.message);
-			}
-
-		},
-
-		//测试接口,可删除
-		async gettest2() {
-			var datas = {
-				username: "admin",
-			};
-			var res = await this.$API.my.OrderDetails.get(datas);
-			this.con1 = res;
-			console.log(res);
-		},
-
-
-		//用户数据同步测试用(用户保存)
-		async gettestUser1() {
-			const inputForm = {
-				'iamRequestId': '120010',
-				'iamRemoteUser': 'admin',
-				'iamRemotePwd': '11',
-				'loginName': 'yzt2',
-				'name': '同步用户2',
-				'password': '111',
-				'idcard': '320911199010000002',
-				'email': '818166662@qq.com',
-				'phone': '88868882',
-				'mobile': '1829999992',
-				'loginFlag': '1',
-				'photo': '',
-				'sign': '个性签名2',
-			}
-			var res = await this.$API.yin.UserCreateService.post(inputForm);
-			console.log(res);
-		},
-		//(用户更新)
-		async gettestUser2() {
-			const inputForm = {
-				'iamRequestId': '120010',
-				'iamRemoteUser': 'admin',
-				'iamRemotePwd': '11',
-				'uid': '1639158103696228354',
-				'loginName': 'yzt222',
-				'name': '11',
-				// 'password': '',
-				// 'idcard': '',
-				// 'email': '',
-				// 'phone': '',
-				// 'mobile': '',
-				// 'loginFlag': '',
-				// 'photo': '',
-				// 'sign': '',
-			}
-			var res = await this.$API.yin.UserUpdateService.post(inputForm);
-			console.log(res);
-
-		},
-		//(用户删除)
-		async gettestUser3() {
-			const inputForm = {
-				'iamRequestId': '120010',
-				'iamRemoteUser': 'admin',
-				'iamRemotePwd': '111',
-				'uid': '1639158103696228354',
-			}
-			var res = await this.$API.yin.UserDeleteService.post(inputForm);
-			console.log(res);
-		},
-
-	},
-
+  data() {
+    return {
+      title: "民宗干事",
+      username: "",
+      sms: "",
+      password: "",
+      password2: "",
+      con1: 0,
+      con2: 0,
+      testshow: "活动管理",
+      testshow2: "异常监管",
+      sum: "0",
+      sum1: "0",
+      sum2: "0",
+      BannerImgurls: [
+        "https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400",
+        "https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400",
+      ],
+    };
+  },
+
+  created() {
+    let id = this.$route.query.id;
+    window.xm.setNavigationBarTitle({ title: "宗教和顺" });
+    this.TokenLogin2();
+    this.$dictUtils.refreshDictList();
+  },
+
+  methods: {
+    // 待办跳转
+    goToBeDone(e) {
+      let value = JSON.stringify(e.currentTarget.id);
+      this.$router.push({
+        path: "/toBeDone",
+        query: { name: value },
+      });
+    },
+    // 场所登记跳转
+    goPlaceRegister() {
+      this.$router.push("/placeRegisterList");
+    },
+    // 人员档案跳转
+    goPlacePerson() {
+      this.$router.push("/placePerson");
+    },
+    // 牌位管理跳转
+    goPlaceTablet() {
+      this.$router.push("/placeTablet");
+    },
+    //场所消防
+    PlaceFirefighting() {
+      this.$router.push("/placeFirefightingList");
+    },
+    //待办数据获取
+    dataNumber() {
+      new toBeDone().list().then((res) => {
+        this.sum1 = res.records.length;
+        this.sum = this.sum1 + this.sum2;
+      });
+      new toBeDone().list2().then((res1) => {
+        this.sum2 = res1.records.length;
+        this.sum = this.sum1 + this.sum2;
+      });
+    },
+    onClickLeft() {
+      history.back();
+    },
+    tohd_jc() {
+      //this.onlineXm.xmNavTo("../activityMan\siteInspection\siteInspectionList");
+      this.$router.push("/siteInspectionList");
+    },
+    tohd_af() {
+      this.$router.push("/securityFacilitiesErrList");
+    },
+    tohd_hy() {
+      this.$router.push("/religiousConferenceList");
+    },
+    tohd_qt() {
+      this.$router.push("/nonReligiousInformationList");
+    },
+    // 活动场所
+    placeActivity() {
+      this.$router.push("/placeActivityList");
+    },
+    selfMeetingList() {
+      this.$router.push("/selfMeetingList");
+    },
+    abnormalCrowd() {
+      this.$router.push("/differentbelieversList");
+    },
+    async TokenLogin() {
+      let that = this;
+      //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
+      if (
+        this.$store.state.pctoken == "" ||
+        this.$store.state.pctoken == undefined
+      ) {
+        //SDK中 getToken() 方法获取免登token
+        //window.xm.getToken().then(async function(token){//上线取消注释
+        let token = "test"; //上线注释
+
+        const inputForm = qs.stringify(
+          {
+            token: token,
+          },
+          { allowDots: true, arrayFormat: "indices" }
+        );
+        var res = await this.$API.yin.TokenLogin.get(inputForm);
+        //存PCtoken
+        this.$store.commit("setPcToken", res.PcToken);
+        this.$store.commit("setUser", res.account);
+
+        //})//上线取消注释
+      }
+    },
+
+    TokenLogin2() {
+      let that = this;
+      xm.getStorage({ key: "MZ_TOKEN" }).then((result) => {
+        xm.showToast({
+          message: result,
+        });
+        return result;
+      });
+      //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
+      if (
+        this.$store.state.pctoken == "" ||
+        this.$store.state.pctoken == undefined
+      ) {
+        //SDK中 getToken() 方法获取免登token
+        // window.xm.getToken().then(async function (token) {
+        //上线取消注释
+        let token = "test"; //上线注释
+
+        new userSets()
+          .TokenLogin({
+            token: token,
+          })
+          .then((res) => {
+            // xm.showToast({
+            //   message: res.PcToken,
+            // });
+            that.$store.commit("setPcToken", res.PcToken);
+            that.$store.commit("setUser", res.account);
+            that.getBannerImg(); //获取轮播图
+            that.getSelectColor(); //获取主题颜色
+            that.dataNumber(); //获取待办事项数
+          });
+        // }); //上线取消注释
+      } else {
+        xm.showToast({
+          message: "222",
+        });
+        that.getBannerImg(); //获取轮播图
+        that.getSelectColor(); //获取主题颜色
+        that.dataNumber(); //获取待办事项数
+      }
+    },
+
+    getStatistics() {
+      let that = this;
+      new userSets().Statistics().then((res) => {
+        if (res[0].sum != undefined && res[0].sum != null && res[0].sum != "") {
+          that.sum = res[0].sum;
+        }
+        if (
+          res[0].sum1 != undefined &&
+          res[0].sum1 != null &&
+          res[0].sum1 != ""
+        ) {
+          that.sum1 = res[0].sum1;
+        }
+        if (
+          res[0].sum2 != undefined &&
+          res[0].sum2 != null &&
+          res[0].sum2 != ""
+        ) {
+          that.sum2 = res[0].sum2;
+        }
+      });
+    },
+
+    getBannerImg() {
+      new userSets()
+        .BannerImg({
+          current: 1,
+          size: 5,
+          orders: [],
+        })
+        .then((res) => {
+          let bs = [];
+
+          res.records[0].bannerImg.split("|").forEach((item) => {
+            if (item.trim().length > 0) {
+              bs.push($base + item.replace("程序附件//", "程序附件/"));
+            }
+          });
+          this.BannerImgurls = bs;
+        });
+    },
+
+    getSelectColor() {
+      let that = this;
+      new userSets().SelectColor().then((res) => {
+        //console.log(res.records[0].selectColor.substring(1, 7));
+        //存PCtoken
+        that.$store.commit("setSelectColor", res.默认);
+      });
+    },
+
+    //测试接口,可删除
+    async gettest() {
+      let that = this;
+
+      //SDK中 getToken() 方法获取免登token
+      // window.xm.getToken().then(function(token){
+      // 	console.log(token);
+
+      // 	that.con1="哈哈"+token;
+      // 	window.xm.showToast({
+      // 		message:that.con1
+      // 	})
+
+      // })
+
+      //测试数据同步接口的
+      const inputForm = {
+        iamRequestId: "120010",
+        iamRemoteUser: "admin12022",
+        iamRemotePwd: "",
+      };
+      var res = await this.$API.yin.SchemaService.post(inputForm);
+      if (res.type == 1) {
+        this.$router.replace({
+          path: "/main",
+        });
+      } else {
+        Toast.fail(res.message);
+      }
+    },
+
+    //测试接口,可删除
+    async gettest2() {
+      var datas = {
+        username: "admin",
+      };
+      var res = await this.$API.my.OrderDetails.get(datas);
+      this.con1 = res;
+      console.log(res);
+    },
+
+    //用户数据同步测试用(用户保存)
+    async gettestUser1() {
+      const inputForm = {
+        iamRequestId: "120010",
+        iamRemoteUser: "admin",
+        iamRemotePwd: "11",
+        loginName: "yzt2",
+        name: "同步用户2",
+        password: "111",
+        idcard: "320911199010000002",
+        email: "818166662@qq.com",
+        phone: "88868882",
+        mobile: "1829999992",
+        loginFlag: "1",
+        photo: "",
+        sign: "个性签名2",
+      };
+      var res = await this.$API.yin.UserCreateService.post(inputForm);
+      console.log(res);
+    },
+    //(用户更新)
+    async gettestUser2() {
+      const inputForm = {
+        iamRequestId: "120010",
+        iamRemoteUser: "admin",
+        iamRemotePwd: "11",
+        uid: "1639158103696228354",
+        loginName: "yzt222",
+        name: "11",
+        // 'password': '',
+        // 'idcard': '',
+        // 'email': '',
+        // 'phone': '',
+        // 'mobile': '',
+        // 'loginFlag': '',
+        // 'photo': '',
+        // 'sign': '',
+      };
+      var res = await this.$API.yin.UserUpdateService.post(inputForm);
+      console.log(res);
+    },
+    //(用户删除)
+    async gettestUser3() {
+      const inputForm = {
+        iamRequestId: "120010",
+        iamRemoteUser: "admin",
+        iamRemotePwd: "111",
+        uid: "1639158103696228354",
+      };
+      var res = await this.$API.yin.UserDeleteService.post(inputForm);
+      console.log(res);
+    },
+  },
 };
 </script>
 
 <style>
 .bg {
-	height: 100%;
-	background: #ffffff;
+  height: 100%;
+  background: #ffffff;
 }
 </style>