riku
2023-12-18 356f54467f525f437f41271fb62f6be66f2ab1e5
1. 调整飞羽环境用户信息的编辑
已修改18个文件
379 ■■■■ 文件已修改
src/api/fysp/evaluateApi.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/problemApi.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/sceneApi.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/taskApi.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/userApi.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fytz/noticeApi.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fytz/userApi.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/form/FYForm.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionLocation.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionScene.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionUserType.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/composables/formConfirm.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/composables/messageBox.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/baseinfo/fysp/scene/CompSceneBaseInfo.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fytz/user/UserInfo.vue 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fytz/user/components/CompUserInfo.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fytz/user/components/CompUserInfoAddDrawer.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/evaluateApi.js
@@ -6,6 +6,6 @@
   * 获取自动评估历史记录
   */
  fetchAutoEvaluation(param){
    return $fysp.post(`evaluation/auto/record`, param).then((res) => res.data);
    return $fysp.post(`evaluation/auto/record`, param);
  }
};
src/api/fysp/problemApi.js
@@ -10,6 +10,6 @@
   */
  checkProblem({ pId, action, remark = '', userId = id, userName = name }) {
    const params = `?pId=${pId}&action=${action}&remark=${remark}&userId=${userId}&userName=${userName}`;
    return $fysp.post(`problemlist/check${params}`).then((res) => res.data);
    return $fysp.post(`problemlist/check${params}`);
  },
};
src/api/fysp/sceneApi.js
@@ -7,7 +7,7 @@
   */
  searchScene(area, page = 1, perPage = 20) {
    const params = `page=${page}&per_page=${perPage}`;
    return $fysp.post(`scense/find?${params}`, area).then((res) => res.data);
    return $fysp.post(`scense/find?${params}`, area);
  },
  /**
@@ -16,13 +16,11 @@
   * @returns 场景详情
   */
  getSceneDetail(sId) {
    return $fysp
      .get(`scense/detail`, {
    return $fysp.get(`scense/detail`, {
        params: {
          sceneId: sId,
        },
      })
      .then((res) => res.data);
        sceneId: sId
      }
    });
  },
  /**
@@ -33,29 +31,23 @@
    const rb = {
      scense: scene ? scene : null,
      subScene: subScene ? JSON.stringify(subScene) : null,
      sceneDevice: sceneDevice ? sceneDevice : null,
      sceneDevice: sceneDevice ? sceneDevice : null
    };
    return $fysp
      .post(`scense/detail/update?${params}`, rb)
      .then((res) => res.data);
    return $fysp.post(`scense/detail/update?${params}`, rb);
  },
  /**
   * 更新场景额外信息
   */
  updateSubScene(typeId, subScene) {
    return this.updateSceneDetail(typeId, { subScene: subScene }).then(
      (res) => res.data
    );
    return this.updateSceneDetail(typeId, { subScene: subScene });
  },
  /**
   * 更新场景设备信息
   */
  updateSceneDevice(typeId, sceneDevice) {
    return this.updateSceneDetail(typeId, { sceneDevice: sceneDevice }).then(
      (res) => res.data
    );
    return this.updateSceneDetail(typeId, { sceneDevice: sceneDevice });
  },
  /**
@@ -63,7 +55,7 @@
   * @param {Object} scene
   */
  createScene(scene) {
    return $fysp.put('scense', scene).then((res) => res.data);
    return $fysp.put('scense', scene);
  },
  /**
@@ -71,6 +63,6 @@
   * @param {Object} scene
   */
  updateScene(scene) {
    return $fysp.post('scense', scene).then((res) => res.data);
  },
    return $fysp.post('scense', scene);
  }
};
src/api/fysp/taskApi.js
@@ -5,33 +5,29 @@
   * 获取顶层任务
   */
  getTopTask() {
    return $fysp.get('task/alltask/0').then((res) => res.data);
    return $fysp.get('task/alltask/0');
  },
  /**
   * 获取子任务统计信息
   */
  getSubtaskSummary({ topTaskId = undefined, sceneTypeId = undefined }) {
    return $fysp
      .get('subtask/summary', {
    return $fysp.get('subtask/summary', {
        params: {
          topTaskId: topTaskId,
          sceneTypeId: sceneTypeId,
        },
      })
      .then((res) => res.data);
        sceneTypeId: sceneTypeId
      }
    });
  },
  /**
   * 获取子任务问题详情
   */
  getProBySubtask(id) {
    return $fysp
      .get('problemlist/subtask', {
    return $fysp.get('problemlist/subtask', {
        params: {
          stGuid: id,
        },
      })
      .then((res) => res.data);
  },
        stGuid: id
      }
    });
  }
};
src/api/fysp/userApi.js
@@ -5,29 +5,27 @@
   * 获取用户详情
   */
  getUserById(id) {
    return $fysp.get(`userinfo/${id}`).then((res) => res.data);
    return $fysp.get(`userinfo/${id}`);
  },
  /**
   * 更新用户详情
   */
  updateUser(user) {
    return $fysp.post(`userinfo`, user).then((res) => res.data);
    return $fysp.post(`userinfo`, user);
  },
  /**
   * 获取场景的用户详情
   */
  getUserByScene(sId) {
    return $fysp
      .get(`userinfo/scene/get?sceneId=${sId}`)
      .then((res) => res.data);
    return $fysp.get(`userinfo/scene/get?sceneId=${sId}`);
  },
  /**
   * 自动创建账户
   */
  autoCreateAccount(sId) {
    return $fysp.post(`userinfo/create?sceneId=${sId}`).then((res) => res.data);
  },
    return $fysp.post(`userinfo/create?sceneId=${sId}`);
  }
};
src/api/fytz/noticeApi.js
@@ -9,27 +9,23 @@
   */
  getNoticeHistory({ type, subtype = null, page = 1, perPage = 20 }) {
    const params = `userId=${id}&page=${page}&per_page=${perPage}`;
    return $fytz
      .post(`notifications/history?${params}`, {
    return $fytz.post(`notifications/history?${params}`, {
        ecNoticetype: type,
        ecNoticesubtype: subtype,
      })
      .then((res) => res.data);
      ecNoticesubtype: subtype
    });
  },
  /**
   * 获取用户未读通知
   */
  getNotification() {
    return $fytz
      .get('notifications', {
    return $fytz.get('notifications', {
        params: {
          userId: id,
          page: 1,
          per_page: 30,
        },
      })
      .then((res) => res.data);
        per_page: 30
      }
    });
  },
  /**
@@ -66,8 +62,6 @@
  releaseNotice(notice) {
    notice.authorId = id;
    notice.authorName = name;
    return $fytz
      .post(`notifications/${id}/release2`, notice)
      .then((res) => res.data);
  },
    return $fytz.post(`notifications/${id}/release2`, notice);
  }
};
src/api/fytz/userApi.js
@@ -11,7 +11,7 @@
   */
  fetchUser(page = 1, per_page = 20, data) {
    const params = `page=${page}&per_page=${per_page}`;
    return $fytz.post(`baseInfo/search/?${params}`, data).then((res) => res.data);
    return $fytz.post(`baseInfo/search/?${params}`, data);
  },
  /**
@@ -20,9 +20,7 @@
   * @returns
   */
  fetchUserBaseInfo(userId) {
    return $fytz
      .get(`userInfo/baseInfo?userId=${userId}`)
      .then((res) => res.data);
    return $fytz.get(`userInfo/baseInfo?userId=${userId}`);
  },
  /**
@@ -31,7 +29,7 @@
   * @returns 
   */
  updateUserInfo(data) {
    return $fytz.post('userInfo', data).then((res) => res.data);
    return $fytz.post('userInfo', data);
  },
  /**
@@ -40,6 +38,13 @@
   * @returns 
   */
  createUser(data) {
    return $fytz.put('userInfo', data).then((res) => res.data);
    return $fytz.put('userInfo/create', data);
  },
  /**
   * 重置用户密码
   */
  resetPassword(id) {
    return $fytz.post(`userInfo/resetPw?userId=${id}`);
  }
};
src/api/index.js
@@ -20,7 +20,7 @@
//飞羽监管
const $fysp = axios.create({
  baseURL: ip1,
  timeout: 10000,
  timeout: 10000
});
$fysp.imgUrl = `${ip1_file}images/`;
$fysp.downloadUrl = `${ip1_file}files/`;
@@ -28,7 +28,7 @@
//飞羽环境
const $fytz = axios.create({
  baseURL: ip2,
  timeout: 10000,
  timeout: 10000
});
$fytz.imgUrl = `${ip2_file}images/`;
@@ -51,7 +51,7 @@
      console.log(error);
      ElMessage({
        message: error,
        type: 'error',
        type: 'error'
      });
      return Promise.reject(error);
    }
@@ -65,17 +65,18 @@
      console.log(response);
      console.log('==>请求结束');
      if (response.status == 200) {
        if (
          response.data.success != undefined &&
          response.data.success != null
        ) {
        if (response.data.success != undefined && response.data.success != null) {
          if (response.data.success == true) {
            return response;
            return response.data;
          } else {
            ElMessage({
              message: response.data.message,
              type: 'error'
            });
            return Promise.reject(response.data.message);
          }
        } else {
          return response;
          return response.data;
        }
      } else {
        return Promise.reject(response);
@@ -88,7 +89,7 @@
      console.log('==>请求结束');
      ElMessage({
        message: error,
        type: 'error',
        type: 'error'
      });
      return Promise.reject(error);
    }
src/components/form/FYForm.vue
@@ -12,8 +12,8 @@
      <el-button :disabled="!edit" type="primary" @click="onSubmit" :loading="loading"
        >提交</el-button
      >
      <el-button :disabled="!edit" @click="onReset">重置</el-button>
      <el-button v-if="enableCancelBtn" @click="onCancel">取消</el-button>
      <el-button v-if="useReset" :disabled="!edit" @click="onReset">重置</el-button>
      <el-button v-if="useCancel" @click="onCancel">取消</el-button>
    </el-form-item>
  </el-form>
</template>
@@ -39,7 +39,9 @@
    default: true
  },
  //取消按钮是否可用
  enableCancelBtn: Boolean,
  useCancel: Boolean,
  //重置按钮是否可用
  useReset: Boolean,
  //触发重置
  reset: Boolean,
  //通知编辑状态
@@ -50,7 +52,7 @@
const emit = defineEmits(['submit', 'cancel', 'update:isEdit']);
//表单操作函数
const { formObj, formRef, edit, onSubmit, onCancel, onReset } = useFormConfirm({
const { formObj, formRef, edit, onSubmit, onCancel, onReset, formProps } = useFormConfirm({
  submit: {
    do: submit
  },
@@ -69,6 +71,9 @@
    emit('submit', formObj, () => {
      loading.value = false;
      resolve();
    },(err)=>{
      loading.value = false;
      reject(err);
    });
  });
}
@@ -83,7 +88,8 @@
  () => props.formInfo,
  (nValue) => {
    formObj.value = nValue;
  }
  },
  { deep: false, immediate: false }
);
//监听表单重置功能触发
src/components/search-option/FYOptionLocation.vue
@@ -1,5 +1,5 @@
<template>
  <el-form-item :label="placeholder">
  <el-form-item :label="placeholder" :prop="prop">
    <el-cascader
      v-model="selectedOptions"
      :options="locations"
@@ -39,7 +39,8 @@
    checkStrictly: {
      type: Boolean,
      default: true
    }
    },
    prop: String
  },
  emits: ['update:value'],
  data() {
@@ -81,9 +82,7 @@
          return
        }
        if (nVal != oVal) {
          if (nVal || nVal.length > 0) {
            this.selectedOptions = this.optionFormatReverse(nVal)
          }
        }
      },
      deep: true,
@@ -125,6 +124,7 @@
    },
    optionFormatReverse(val) {
      const res = []
      if (val) {
      if (val.pCode) {
        res.push([val.pCode, val.pName])
      }
@@ -137,6 +137,7 @@
      if (val.tCode) {
        res.push([val.tCode, val.tName])
      }
      }
      return res
    }
  },
src/components/search-option/FYOptionScene.vue
@@ -1,5 +1,5 @@
<template>
  <el-form-item label="场景类型">
  <el-form-item label="场景类型" :prop="prop">
    <el-select
      v-model="selectedOptions"
      placeholder="场景类型"
@@ -37,6 +37,7 @@
      type: Boolean,
      default: true,
    },
    prop: String
  },
  emits: ['update:value'],
  data() {
src/components/search-option/FYOptionUserType.vue
@@ -1,5 +1,5 @@
<template>
  <el-form-item label="用户类型">
  <el-form-item label="用户类型" :prop="prop">
    <el-select
      v-model="selectedOptions"
      placeholder="用户类型"
@@ -32,6 +32,7 @@
      type: Boolean,
      default: true,
    },
    prop: String
  },
  emits: ['update:value'],
  data() {
src/composables/formConfirm.js
@@ -1,4 +1,4 @@
import { onActivated, onDeactivated, ref, watch } from 'vue';
import { defineProps, onActivated, onDeactivated, ref, watch } from 'vue';
import { useCloned } from '@vueuse/core';
import { useMessageBoxTip, useMessageBox } from './messageBox';
@@ -6,19 +6,24 @@
export function useFormConfirm({
  defaultForm = undefined,
  submit = {
    do: () => {},
    do: () => {}
  },
  cancel = {
    do: () => {},
    do: () => {}
  },
  reset = {
    do: () => {},
  },
    do: () => {}
  }
}) {
  if (!submit.title) submit.title = '提交';
  if (!submit.msg) submit.msg = '确认是否提交?';
  if (!cancel.title) cancel.title = '取消';
  if (!cancel.msg) cancel.msg = '是否放弃已编辑的内容?';
  const formProps = defineProps({
    // 是否在提交成功后清空表单
    clearAftSubmit: Boolean
  });
  //表单内容
  const formObj = ref(defaultForm ? defaultForm : {});
@@ -67,20 +72,21 @@
    edit.value = false;
    isReset = true;
    formObj.value = useCloned(formObjClone.cloned, {
      manual: true,
      manual: true
    }).cloned.value;
    formRef.value.clearValidate();
  };
  // 清空表单
  const clear = function () {
    edit.value = false;
    isReset = true;
    formRef.value.resetFields();
    // formRef.value.resetFields();
    edit.value = false;
  };
  // 提交成功后
  const submited = function () {
    if (formProps.clearAftSubmit) clear();
    edit.value = false;
    formObjClone = useCloned(formObj, { manual: true });
  };
@@ -93,10 +99,10 @@
          confirmMsg: submit.msg,
          confirmTitle: submit.title,
          onConfirm: async () => {
            await submit.do();
            const res = await submit.do();
            submited();
            return;
          },
            return res;
          }
        });
      }
    });
@@ -110,9 +116,9 @@
        confirmMsg: cancel.msg,
        confirmTitle: cancel.title,
        onConfirm: () => {
          clear();
          // clear();
          return cancel.do();
        },
        }
      });
    } else {
      cancel.do();
@@ -130,7 +136,7 @@
          onConfirm: () => {
            _reset();
            return reset.do();
          },
          }
        });
      } else {
        _reset();
@@ -141,5 +147,5 @@
    }
  };
  return { formObj, formRef, edit, onSubmit, onCancel, onReset };
  return { formProps, formObj, formRef, edit, onSubmit, onCancel, onReset };
}
src/composables/messageBox.js
@@ -15,7 +15,7 @@
      let msg = `已${doneMsg}`
      if (typeof onConfirm === 'function') {
        const str = await onConfirm();
        if (str && str != '') {
        if (typeof str === 'string' && str != '') {
          msg = `已${doneMsg}, ${str}`
        }
      }
src/views/baseinfo/fysp/scene/CompSceneBaseInfo.vue
@@ -3,6 +3,7 @@
  <FYForm
    :form-info="_formInfo"
    :rules="rules"
    :useReset="true"
    @submit="submit"
    @cancel="cancel"
  >
@@ -105,7 +106,7 @@
const emit = defineEmits(['onSubmit', 'onCancel']);
const _formInfo = ref();
const _formInfo = ref({});
const sceneTypes = reactive(enumScene(2, false));
const locations = reactive(enumLocation(false));
const cascaderProps = reactive({
src/views/fytz/user/UserInfo.vue
@@ -6,7 +6,11 @@
        :level="4"
        v-model:value="formSearch._locations"
      ></FYOptionLocation>
      <FYOptionText label="关键字" placeholder="输入名称关键字" v-model:value="formSearch.searchText"></FYOptionText>
      <FYOptionText
        label="关键字"
        placeholder="输入名称关键字"
        v-model:value="formSearch.searchText"
      ></FYOptionText>
      <FYOptionScene
        :allOption="true"
        :type="1"
@@ -19,13 +23,7 @@
    </template>
    <template #table-column>
      <el-table-column
        type="index"
        fixed="left"
        prop="userInfo.realname"
        label="名称"
        width="400"
      >
      <el-table-column type="index" fixed="left" prop="userInfo.realname" label="名称" width="400">
        <template #default="scope">
          <el-tooltip
            effect="dark"
@@ -54,11 +52,7 @@
      <el-table-column prop="userInfo.usertype" label="用户类型" width="90" />
      <el-table-column fixed="right" align="right" label="操作" width="160">
        <template #header>
          <el-button
            icon="DocumentAdd"
            size="default"
            type="success"
            @click="drawer = true"
          <el-button icon="DocumentAdd" size="default" type="success" @click="drawer = true"
            >新增用户</el-button
          >
        </template>
@@ -93,7 +87,7 @@
export default {
  components: {
    CompUserInfoAddDrawer,
    CompUserInfoAddDrawer
  },
  data() {
    return {
@@ -101,26 +95,26 @@
        _locations: {},
        searchText: '',
        scensetype: {},
        online: {},
        online: {}
      },
      drawer: false,
      drawer: false
    };
  },
  computed: {
    ...mapStores(useLoadingStore),
    ...mapStores(useLoadingStore)
  },
  methods: {
    onSearch(page, func) {
      const f = this.formSearch;
      const area = {};
      // 行政区划
      area.provinceCode = f._locations.pCode ? f._locations.pCode + '0000' : undefined
      area.provinceCode = f._locations.pCode;
      area.provinceName = f._locations.pName;
      if (area.provinceCode == null) {
        area.provinceCode = null;
        area.provinceName = null;
      }
      area.cityCode = f._locations.cCode ? f._locations.cCode.substring(0, 3) + '100' : undefined
      area.cityCode = f._locations.cCode;
      area.cityName = f._locations.cName;
      area.districtCode = f._locations.dCode;
      area.districtName = f._locations.dName;
@@ -140,7 +134,7 @@
        if (res) {
          func({
            data: res.data,
            total: res.head.totalCount,
            total: res.head.totalCount
          });
        }
      });
@@ -154,12 +148,12 @@
      const param = {
        guid: scope.row.userInfo.guid,
        isenable: !scope.row.userInfo.isenable
      }
      };
      const msg = scope.row.userInfo.isenable ? '下线' : '上线';
      useMessageBoxTip({
        confirmMsg: `确认${msg}该场景?`,
        confirmTitle: msg,
        onConfirm: () => {
        onConfirm: async () => {
          scope.row.loading2 = true;
          return userApi
            .updateUserInfo(param)
@@ -171,13 +165,13 @@
            .finally(() => {
              scope.row.loading2 = false;
            });
        },
        }
      });
    },
    tableRowClassName({ row }) {
      return row.userInfo.isenable ? 'online-row' : 'offline-row';
    },
  },
    }
  }
};
</script>
<style></style>
src/views/fytz/user/components/CompUserInfo.vue
@@ -3,6 +3,9 @@
    :form-info="_formInfo"
    :rules="rules"
    :reset="active"
    :useCancel="create"
    :useReset="!create"
    :clearAftSubmit="create"
    v-model:is-edit="_edit"
    @submit="submit"
    @cancel="cancel"
@@ -38,6 +41,7 @@
        </el-col>
      </el-form-item>
      <FYOptionUserType
        prop="_usertype"
        :allOption="false"
        :initValue="false"
        v-model:value="formObj._usertype"
@@ -60,17 +64,17 @@
      <el-form-item label="手机" prop="telephone">
        <el-input clearable type="tel" v-model="formObj.telephone" placeholder="手机" />
      </el-form-item>
      <!-- <el-form-item label="省/市/区/镇" prop="_locations">
        <el-cascader
          v-model="formObj._locations"
          :options="locations"
          placeholder="省/市/区/镇"
          :props="locationsProps"
          style="width: 280px"
          :disabled="!create"
        />
      </el-form-item> -->
      <FYOptionLocation
        v-if="create"
        prop="_locations"
        :allOption="false"
        :level="4"
        :checkStrictly="false"
        :initValue="false"
        v-model:value="formObj._locations"
      ></FYOptionLocation>
      <FYOptionScene
        prop="_scenetype"
        :allOption="false"
        :type="1"
        :initValue="false"
@@ -103,13 +107,8 @@
const emit = defineEmits(['onSubmit', 'onCancel', 'update:isEdit']);
const _formInfo = ref();
const _formObject = { value: {} };
const _formInfo = ref({ isenable: true });
const _edit = ref(false);
const locations = enumLocation(false);
const locationsProps = reactive({
  checkStrictly: true
});
const rules = reactive({
  acountname: [
    {
@@ -170,6 +169,16 @@
}
function parseUserInfoReverse(formObj) {
  // 行政区划信息填充
  const a = formObj.value._locations;
  formObj.value.provincecode = a.pCode;
  formObj.value.provincename = a.pName;
  formObj.value.citycode = a.cCode;
  formObj.value.cityname = a.cName;
  formObj.value.districtcode = a.dCode;
  formObj.value.extension1 = a.dName;
  formObj.value.towncode = a.tCode;
  formObj.value.townname = a.tName;
  // 用户类型信息填充
  const b = formObj.value._usertype;
  formObj.value.usertypeid = b.value;
@@ -182,53 +191,54 @@
  return formObj;
}
function createUser(formObj, func) {
function createUser(formObj, success, fail) {
  const params = {
    userInfo: formObj.value,
    baseInfo: {
      biProvinceCode: formObj.value.provincecode,
      biProvinceName: formObj.value.provincename,
      biCityCode: formObj.value.citycode,
      biCityName: formObj.value.cityname,
      biDistrictCode: formObj.value.districtcode,
      biDistrictName: formObj.value.extension1,
      biTownCode: formObj.value.towncode,
      biTownName: formObj.value.townname
      // biAreaCode
      // biArea
      // biManagementCompanyId
      // biManagementCompany
      // biContact
      // biTelephone
      // biAddress
    }
  };
  return userApi
    .createUser(formObj.value)
    .createUser(params)
    .then(() => {
      emit('onSubmit', formObj);
      emit('onSubmit', params);
      success();
    })
    .finally(() => {
      _formObject.value = formObj.value;
      func();
    .catch((err) => {
      fail(err);
    });
}
function updateUser(formObj, func) {
function updateUser(formObj, success, fail) {
  return userApi
    .updateUserInfo(formObj.value)
    .then(() => {
      emit('onSubmit', formObj);
      if (success) success();
    })
    .finally(() => {
      _formObject.value = formObj.value;
      if (func) func();
    .catch((err) => {
      if (fail) fail(err);
    });
}
function submit(formObj, func) {
  // 行政区划信息填充
  // const a = formObj.value._locations;
  // if (a[0]) {
  //   formObj.value.provincecode = a[0][0];
  //   formObj.value.provincename = a[0][1];
  // }
  // if (a[1]) {
  //   formObj.value.citycode = a[1][0];
  //   formObj.value.cityname = a[1][1];
  // }
  // if (a[2]) {
  //   formObj.value.districtcode = a[2][0];
  //   formObj.value.extension1 = a[2][1];
  // }
  // if (a[3]) {
  //   formObj.value.towncode = a[3][0];
  //   formObj.value.townname = a[3][1];
  // }
function submit(formObj, success, fail) {
  parseUserInfoReverse(formObj);
  return props.create ? createUser(formObj, func) : updateUser(formObj, func);
  return props.create ? createUser(formObj, success, fail) : updateUser(formObj, success, fail);
}
function cancel() {
@@ -239,14 +249,22 @@
  () => props.formInfo,
  (nValue) => {
    _formInfo.value = parseUserInfo(nValue);
    _formObject.value = _formInfo.value;
  }
);
// watch(
//   () => props.create,
//   (nValue) => {
//     if (nValue) {
//     }
//   },
//   {immediate:true}
// );
watch(_edit, (nValue) => {
  emit('update:isEdit', nValue);
});
// 重置密码
@@ -257,10 +275,10 @@
    confirmMsg: '是否重置该场景密码?',
    confirmTitle: '重置密码',
    onConfirm: async () => {
      pwLoading.value = true
      _formObject.value.password = '123456';
      await updateUser(_formObject);
      pwLoading.value = false
      pwLoading.value = true;
      return userApi.resetPassword(props.formInfo.guid).finally(() => {
        pwLoading.value = false;
      });
    }
  });
}
src/views/fytz/user/components/CompUserInfoAddDrawer.vue
@@ -58,9 +58,10 @@
      }
    },
    onDrawerCancel() {
      this.onDrawerClose(() => {
      // this.onDrawerClose(() => {
      //   this.drawer_ = false;
      // });
        this.drawer_ = false;
      });
    },
  },
};