zmc
2023-12-18 6c74bf912e251347714099a84585f825b32a1c08
Merge branch 'feature-001' of ssh://114.215.109.124:29418/supervision-vue into feature-001
已修改31个文件
已添加4个文件
1009 ■■■■■ 文件已修改
.prettierrc.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/evaluateApi.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/problemApi.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/sceneApi.js 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/taskApi.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/userApi.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fytz/noticeApi.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fytz/userApi.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/core/SiderMenu.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/form/FYForm.vue 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionLocation.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionOnlineStatus.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionScene.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionTime.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionUserType.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table/FYTable.vue 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/composables/formConfirm.js 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/composables/messageBox.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/constants/envCreditCode.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/constants/index.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/constants/menu.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/loadingStore.js 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/baseinfo/fysp/scene/CompSceneBaseInfo.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/baseinfo/fysp/scene/SceneInfo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/DataSource.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/ResultManage.vue 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/CompHistoryRecord.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/CompPreCheck.vue 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/CompQuickSet.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fytz/user/UserInfo.vue 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fytz/user/components/CompUserInfoAddDrawer.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.prettierrc.json
@@ -1,6 +1,6 @@
{
  "$schema": "https://json.schemastore.org/prettierrc",
  "semi": false,
  "semi": true,
  "tabWidth": 2,
  "singleQuote": true,
  "printWidth": 100,
package-lock.json
@@ -13,7 +13,7 @@
        "@vueuse/core": "^9.7.0",
        "axios": "^1.2.1",
        "dayjs": "^1.11.10",
        "element-plus": "^2.2.26",
        "element-plus": "^2.4.3",
        "pinia": "^2.0.26",
        "vue": "^3.2.45",
        "vue-router": "^4.1.6"
@@ -1838,8 +1838,9 @@
      }
    },
    "node_modules/@element-plus/icons-vue": {
      "version": "2.0.10",
      "license": "MIT",
      "version": "2.3.1",
      "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
      "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==",
      "peerDependencies": {
        "vue": "^3.2.0"
      }
@@ -3729,11 +3730,12 @@
      "license": "ISC"
    },
    "node_modules/element-plus": {
      "version": "2.2.26",
      "license": "MIT",
      "version": "2.4.3",
      "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.4.3.tgz",
      "integrity": "sha512-b3q26j+lM4SBqiyzw8HybybGnP2pk4MWgrnzzzYW5qKQUgV6EG1Zg7nMCfgCVccI8tNvZoTiUHb2mFaiB9qT8w==",
      "dependencies": {
        "@ctrl/tinycolor": "^3.4.1",
        "@element-plus/icons-vue": "^2.0.6",
        "@element-plus/icons-vue": "^2.3.1",
        "@floating-ui/dom": "^1.0.1",
        "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
        "@types/lodash": "^4.14.182",
@@ -8693,7 +8695,9 @@
      }
    },
    "@element-plus/icons-vue": {
      "version": "2.0.10",
      "version": "2.3.1",
      "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
      "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==",
      "requires": {}
    },
    "@eslint-community/eslint-utils": {
@@ -9942,10 +9946,12 @@
      "dev": true
    },
    "element-plus": {
      "version": "2.2.26",
      "version": "2.4.3",
      "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.4.3.tgz",
      "integrity": "sha512-b3q26j+lM4SBqiyzw8HybybGnP2pk4MWgrnzzzYW5qKQUgV6EG1Zg7nMCfgCVccI8tNvZoTiUHb2mFaiB9qT8w==",
      "requires": {
        "@ctrl/tinycolor": "^3.4.1",
        "@element-plus/icons-vue": "^2.0.6",
        "@element-plus/icons-vue": "^2.3.1",
        "@floating-ui/dom": "^1.0.1",
        "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
        "@types/lodash": "^4.14.182",
package.json
@@ -18,7 +18,7 @@
    "@vueuse/core": "^9.7.0",
    "axios": "^1.2.1",
    "dayjs": "^1.11.10",
    "element-plus": "^2.2.26",
    "element-plus": "^2.4.3",
    "pinia": "^2.0.26",
    "vue": "^3.2.45",
    "vue-router": "^4.1.6"
src/api/fysp/evaluateApi.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
import { $fysp } from '../index';
export default {
  /**
   * èŽ·å–è‡ªåŠ¨è¯„ä¼°åŽ†å²è®°å½•
   */
  fetchAutoEvaluation(param){
    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`, {
        params: {
          sceneId: sId,
        },
      })
      .then((res) => res.data);
    return $fysp.get(`scense/detail`, {
      params: {
        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', {
        params: {
          topTaskId: topTaskId,
          sceneTypeId: sceneTypeId,
        },
      })
      .then((res) => res.data);
    return $fysp.get('subtask/summary', {
      params: {
        topTaskId: topTaskId,
        sceneTypeId: sceneTypeId
      }
    });
  },
  /**
   * èŽ·å–å­ä»»åŠ¡é—®é¢˜è¯¦æƒ…
   */
  getProBySubtask(id) {
    return $fysp
      .get('problemlist/subtask', {
        params: {
          stGuid: id,
        },
      })
      .then((res) => res.data);
  },
    return $fysp.get('problemlist/subtask', {
      params: {
        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}`, {
        ecNoticetype: type,
        ecNoticesubtype: subtype,
      })
      .then((res) => res.data);
    return $fytz.post(`notifications/history?${params}`, {
      ecNoticetype: type,
      ecNoticesubtype: subtype
    });
  },
  /**
   * èŽ·å–ç”¨æˆ·æœªè¯»é€šçŸ¥
   */
  getNotification() {
    return $fytz
      .get('notifications', {
        params: {
          userId: id,
          page: 1,
          per_page: 30,
        },
      })
      .then((res) => res.data);
    return $fytz.get('notifications', {
      params: {
        userId: id,
        page: 1,
        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,26 +20,31 @@
   * @returns
   */
  fetchUserBaseInfo(userId) {
    return $fytz
      .get(`userInfo/baseInfo?userId=${userId}`)
      .then((res) => res.data);
    return $fytz.get(`userInfo/baseInfo?userId=${userId}`);
  },
  /**
   * æ›´æ–°ç”¨æˆ·è´¦æˆ·ä¿¡æ¯
   * @param {*} data
   * @returns
   * @param {*} data
   * @returns
   */
  updateUserInfo(data) {
    return $fytz.post('userInfo', data).then((res) => res.data);
    return $fytz.post('userInfo', data);
  },
  /**
   * æ–°å¢žç”¨æˆ·
   * @param {*} data
   * @returns
   * @param {*} data
   * @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
@@ -9,7 +9,7 @@
let ip2_file = 'https://fyami.com.cn/';
if (debug) {
  // ip1 = 'http://192.168.0.123:8082/';
  ip1 = 'http://192.168.0.138:8082/';
  // ip1_file = 'http://47.100.191.150:9005/';
  ip2 = 'http://192.168.0.138:8080/';
  // ip2_file = 'https://fyami.com.cn/';
@@ -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.d.ts
@@ -10,7 +10,6 @@
    BaseContentLayout: typeof import('./components/core/BaseContentLayout.vue')['default']
    BasePanelLayout: typeof import('./components/core/BasePanelLayout.vue')['default']
    Content: typeof import('./components/core/Content.vue')['default']
    copy: typeof import('./components/search-option/FYOptionScene copy.vue')['default']
    ElAside: typeof import('element-plus/es')['ElAside']
    ElAvatar: typeof import('element-plus/es')['ElAvatar']
    ElBacktop: typeof import('element-plus/es')['ElBacktop']
@@ -22,7 +21,6 @@
    ElCol: typeof import('element-plus/es')['ElCol']
    ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
    ElContainer: typeof import('element-plus/es')['ElContainer']
    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
    ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
    ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
    ElDivider: typeof import('element-plus/es')['ElDivider']
@@ -34,7 +32,6 @@
    ElIcon: typeof import('element-plus/es')['ElIcon']
    ElImage: typeof import('element-plus/es')['ElImage']
    ElInput: typeof import('element-plus/es')['ElInput']
    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
    ElMain: typeof import('element-plus/es')['ElMain']
    ElMenu: typeof import('element-plus/es')['ElMenu']
    ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
@@ -57,7 +54,6 @@
    ElTabs: typeof import('element-plus/es')['ElTabs']
    ElTag: typeof import('element-plus/es')['ElTag']
    ElTooltip: typeof import('element-plus/es')['ElTooltip']
    ElTransfer: typeof import('element-plus/es')['ElTransfer']
    ElTree: typeof import('element-plus/es')['ElTree']
    Footer: typeof import('./components/core/Footer.vue')['default']
    FormCol: typeof import('./components/layout/FormCol.vue')['default']
@@ -72,7 +68,6 @@
    FYTable: typeof import('./components/table/FYTable.vue')['default']
    Header: typeof import('./components/core/Header.vue')['default']
    MenuItems: typeof import('./components/core/MenuItems.vue')['default']
    ProblemCard: typeof import('./components/ProblemCard.vue')['default']
    RouterLink: typeof import('vue-router')['RouterLink']
    RouterView: typeof import('vue-router')['RouterView']
    SearchBar: typeof import('./components/SearchBar.vue')['default']
src/components/core/SiderMenu.vue
@@ -60,7 +60,7 @@
</template>
<script>
import { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from '../../constants/index'
import { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from '@/constants/index'
export default {
  name: 'CoreSiderMenu',
src/components/form/FYForm.vue
@@ -1,4 +1,3 @@
<!-- åœºæ™¯åŸºæœ¬ä¿¡æ¯ç¼–辑 -->
<template>
  <el-form
    :inline="false"
@@ -9,16 +8,12 @@
    label-width="150px"
  >
    <slot name="form-item" :formObj="formObj"></slot>
    <el-form-item>
      <el-button
        :disabled="!edit"
        type="primary"
        @click="onSubmit"
        :loading="loading"
    <el-form-item v-if="showButtons">
      <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,25 +34,31 @@
  formInfo: Object,
  //表单检验规则
  rules: Object,
  showButtons: {
    type: Boolean,
    default: true
  },
  //取消按钮是否可用
  enableCancelBtn: Boolean,
  useCancel: Boolean,
  //重置按钮是否可用
  useReset: Boolean,
  //触发重置
  reset: Boolean,
  //通知编辑状态
  isEdit: Boolean,
  isEdit: Boolean
});
//触发函数,提交和取消
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,
    do: submit
  },
  cancel: {
    do: cancel,
  },
    do: cancel
  }
});
//加载状态
@@ -70,6 +71,9 @@
    emit('submit', formObj, () => {
      loading.value = false;
      resolve();
    },(err)=>{
      loading.value = false;
      reject(err);
    });
  });
}
@@ -84,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,13 +82,12 @@
          return
        }
        if (nVal != oVal) {
          if (nVal || nVal.length > 0) {
            this.selectedOptions = this.optionFormatReverse(nVal);
          }
          this.selectedOptions = this.optionFormatReverse(nVal)
        }
      },
      deep: true,
    },
      immediate: true
    }
  },
  methods: {
    /**
@@ -124,17 +124,19 @@
    },
    optionFormatReverse(val) {
      const res = []
      if (val.pCode) {
        res.push([val.pCode, val.pName])
      }
      if (val.cCode) {
        res.push([val.cCode, val.cName])
      }
      if (val.dCode) {
        res.push([val.dCode, val.dName])
      }
      if (val.tCode) {
        res.push([val.tCode, val.tName])
      if (val) {
        if (val.pCode) {
          res.push([val.pCode, val.pName])
        }
        if (val.cCode) {
          res.push([val.cCode, val.cName])
        }
        if (val.dCode) {
          res.push([val.dCode, val.dName])
        }
        if (val.tCode) {
          res.push([val.tCode, val.tName])
        }
      }
      return res
    }
src/components/search-option/FYOptionOnlineStatus.vue
@@ -56,6 +56,7 @@
        }
      },
      deep: true,
      immediate: true
    },
  },
  mounted() {
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() {
@@ -61,6 +62,7 @@
        }
      },
      deep: true,
      immediate: true
    },
  },
  mounted() {
src/components/search-option/FYOptionTime.vue
@@ -47,7 +47,8 @@
        if (nVal != oVal) {
          this.selectedOptions = nVal
        }
      }
      },
      immediate: true
    }
  },
  methods: {
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() {
@@ -56,6 +57,7 @@
        }
      },
      deep: true,
      immediate: true
    },
  },
  mounted() {
src/components/table/FYTable.vue
@@ -6,18 +6,22 @@
      </template>
    </FYSearchBar>
  </el-row>
  <el-row ref="expandRef">
    <slot name="options-expand"></slot>
  </el-row>
  <el-table
    :data="tableData"
    v-loading="loading"
    table-layout="fixed"
    :row-class-name="tableRowClassName"
    :height="tableHeight"
    border
  >
    <slot name="table-column"></slot>
  </el-table>
  <el-pagination
    v-if="pagination"
    ref="paginationRef"
    class="el-pagination"
    v-model:current-page="currentPage"
@@ -41,6 +45,10 @@
export default {
  props: {
    rowClassName: undefined,
    pagination: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
@@ -49,21 +57,21 @@
      total: 0,
      currentPage: 1,
      pageSize: 20,
      loading: false,
    };
      loading: false
    }
  },
  emits: ['search'],
  watch: {
    currentPage(nValue, oValue) {
      if (nValue != oValue) {
        this.onSearch();
        this.onSearch()
      }
    },
    pageSize(nValue, oValue) {
      if (nValue != oValue) {
        this.onSearch();
        this.onSearch()
      }
    },
    }
  },
  methods: {
    /**
@@ -72,43 +80,45 @@
     * å›žè°ƒå‡½æ•°æŽ¥æ”¶ä¸€ä¸ªå¯¹è±¡ï¼ŒåŒ…括表格数据数组data和数据总数total
     */
    onSearch() {
      this.loading = true;
      this.loading = true
      this.$emit(
        'search',
        {
          currentPage: this.currentPage,
          pageSize: this.pageSize,
          pageSize: this.pageSize
        },
        (res) => {
          this.tableData = res.data;
          this.total = res.total;
          this.loading = false;
          this.tableData = res.data
          this.total = res.total ? res.total : 0
          this.loading = false
        }
      );
      )
    },
    calcTableHeight() {
      const h1 = this.$refs.searchRef.$el.offsetHeight;
      const h2 = this.$refs.paginationRef.$el.offsetHeight;
      const h1 = this.$refs.searchRef.$el.offsetHeight
      const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0
      const h3 = this.$refs.expandRef.$el.offsetHeight
      const h = h1 + h2 + h3
      // return `calc(100vh - ${h1}px - ${h2}px - var(--el-main-padding) * 2 - var(--el-header-height))`;
      return `calc(100vh - ${h1}px - ${h2}px - 60px - var(--el-main-padding) * 2)`;
      return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`
    },
    tableRowClassName({ row }) {
      if (this.rowClassName) {
        if (typeof this.rowClassName == 'string') {
          return this.rowClassName;
          return this.rowClassName
        } else if (typeof this.rowClassName == 'function') {
          return this.rowClassName({ row });
          return this.rowClassName({ row })
        }
      } else {
        return row.extension1 != '0' ? 'online-row' : 'offline-row';
        return row.extension1 != '0' ? 'online-row' : 'offline-row'
      }
    },
    }
  },
  mounted() {
    this.tableHeight = this.calcTableHeight();
    this.onSearch();
  },
};
    this.tableHeight = this.calcTableHeight()
    this.onSearch()
  }
}
</script>
<style>
src/composables/formConfirm.js
@@ -1,24 +1,29 @@
// è¡¨å•的确认和取消
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';
// è¡¨å•的确认和取消
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/constants/envCreditCode.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
// çŽ¯ä¿¡ç è½¬æ¢
function envCreditCode(score) {
  const s = parseInt(score)
  if (s <= 59) {
    return {
      value: 2,
      name: '红码',
      color: '#db2828'
    };
  } else if (s <= 89) {
    return {
      value: 1,
      name: '黄码',
      color: '#f7a62c'
    };
  } else {
    return {
      value: 0,
      name: '绿码',
      color: '#21ba45'
    };
  }
}
export { envCreditCode };
src/constants/index.js
@@ -1 +1,2 @@
export { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from './menu'
export { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from './menu';
export { envCreditCode } from './envCreditCode';
src/constants/menu.js
@@ -36,12 +36,12 @@
      {
        path: '/fysp/evaluation/datasource',
        icon: 'MessageBox',
        name: '评估数据源',
        name: '评估任务',
      },
      {
        path: '/fysp/evaluation/resultManage',
        icon: 'Tickets',
        name: '评估管理',
        name: '评估记录',
      },
    ],
  },
src/stores/loadingStore.js
@@ -1,23 +1,26 @@
// åŠ è½½çŠ¶æ€çš„é€»è¾‘ç®¡ç†
import { defineStore } from 'pinia'
import { defineStore } from 'pinia';
export const useLoadingStore = defineStore('loading', {
  state: () => {
    return {
      loadingStatus: []
    }
    };
  },
  actions: {
    pushLoading(func) {
      const timeout = setTimeout(func, 3000);
      this.loadingStatus.push({ t: timeout, f: func });
    },
    clearLoading() {
      this.loadingStatus.forEach(l => {
        if (typeof l === 'function') {
          l()
        }
      });
      if (this.loadingStatus.length > 0) {
        this.loadingStatus = []
        this.loadingStatus.forEach((obj) => {
          clearTimeout(obj.t)
          obj.f()
        });
        this.loadingStatus = [];
      }
    }
  }
})
});
src/views/baseinfo/fysp/scene/CompSceneBaseInfo.vue
@@ -1,6 +1,16 @@
<!-- åœºæ™¯åŸºæœ¬ä¿¡æ¯ç¼–辑 -->
<template>
<<<<<<< HEAD
  <FYForm :form-info="_formInfo" :rules="rules" @submit="submit" @cancel="cancel">
=======
  <FYForm
    :form-info="_formInfo"
    :rules="rules"
    :useReset="true"
    @submit="submit"
    @cancel="cancel"
  >
>>>>>>> 356f54467f525f437f41271fb62f6be66f2ab1e5
    <template #form-item="{ formObj }">
      <el-form-item label="场景名称" prop="name">
        <el-input clearable show-word-limit v-model="formObj.name" placeholder="场景名称" />
@@ -78,9 +88,9 @@
const emit = defineEmits(['onSubmit', 'onCancel'])
const _formInfo = ref()
const sceneTypes = reactive(enumScene(2, false))
const locations = reactive(enumLocation(false))
const _formInfo = ref({});
const sceneTypes = reactive(enumScene(2, false));
const locations = reactive(enumLocation(false));
const cascaderProps = reactive({
  checkStrictly: true
})
src/views/baseinfo/fysp/scene/SceneInfo.vue
@@ -107,7 +107,7 @@
    },
    itemEdit(scope) {
      scope.row.loading1 = true;
      this.loadingStore.loadingStatus.push(() => (scope.row.loading1 = false));
      this.loadingStore.pushLoading(() => (scope.row.loading1 = false));
      this.$router.push(`sceneEdit/${scope.row.guid}`);
    },
    itemActive(scope) {
src/views/fysp/evaluation/DataSource.vue
@@ -1,14 +1,28 @@
<template>
  <div>DataSource</div>
  <el-row :gutter="16">
    <el-col :span="16">
      <CompPreCheck></CompPreCheck>
    </el-col>
    <el-col :span="8">
      <div class="radius"></div>
    </el-col>
  </el-row>
</template>
<script>
import CompPreCheck from "./components/CompPreCheck.vue";
export default {
  name: 'DataSource',
  components: { CompPreCheck },
  data() {
    return {
    }
    return {};
  }
};
</script>
<style scoped>
.radius {
  height: 80vh;
  border: 1px solid var(--el-border-color);
  border-radius: var(--el-border-radius-base);
}
</style>
src/views/fysp/evaluation/ResultManage.vue
@@ -1,24 +1,173 @@
<template>
  <CompPreCheck @pre-check="autoEvaluate"></CompPreCheck>
  <!-- <CompPreCheck @pre-check="autoEvaluate"></CompPreCheck> -->
  <FYTable @search="onSearch" :pagination="false" ref="tableRef">
    <template #options>
      <!-- åŒºåŽ¿ -->
      <FYOptionLocation
        :allOption="false"
        :level="3"
        :checkStrictly="false"
        v-model:value="formSearch.locations"
      ></FYOptionLocation>
      <!-- åœºæ™¯ç±»åž‹ -->
      <FYOptionScene
        :allOption="false"
        :type="2"
        v-model:value="formSearch.scenetype"
      ></FYOptionScene>
      <!-- æ—¶é—´ -->
      <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime>
    </template>
    <template #options-expand>
      <CompQuickSet @quick-set="setOptions"></CompQuickSet>
    </template>
    <template #table-column>
      <el-table-column type="index" fixed="left" prop="sceneName" label="名称" width="300">
        <template #default="{ row }">
          <el-tooltip
            effect="dark"
            :content="row.sceneName"
            placement="top-start"
            :show-after="500"
          >
            {{ row.sceneName }}
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column
        prop="subTaskTime"
        label="巡查日期"
        width="110"
        sortable
        :formatter="timeFormat"
      />
      <el-table-column
        prop="evaluation.resultscorebef"
        label="得分"
        width="90"
        sortable
        :sort-method="sortScore"
      />
      <el-table-column prop="evaluation.resultscorebef" label="环信码" width="100">
        <template #default="{ row }">
          <span :style="`color: ${toCode(row).color};`">{{ toCode(row).name }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="dname" label="区县" width="90" />
      <el-table-column
        prop="tname"
        label="街道"
        width="110"
        :filters="townFilters"
        :filter-method="filterHandler"
      />
      <el-table-column prop="evaluation.scenseaddress" label="地址" />
      <!-- <el-table-column prop="biArea" label="集中区" width="110" />
      <el-table-column prop="biManagementCompany" label="物业" min-width="110"/> -->
      <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
          >
        </template>
        <template #default="{ row }">
          <el-button type="primary" size="small" @click="editRow(row)">查看</el-button>
        </template>
      </el-table-column>
    </template>
  </FYTable>
</template>
<script>
import CompPreCheck from './components/CompPreCheck.vue';
import dayjs from 'dayjs';
import evaluateApi from '@/api/fysp/evaluateApi';
import { envCreditCode } from '@/constants/index';
import CompQuickSet from './components/CompQuickSet.vue';
export default {
    name: 'ResultManage',
    components: { CompPreCheck },
    data() {
        return {};
  name: 'ResultManage',
  components: { CompQuickSet },
  data() {
    return {
      formSearch: {
        locations: {},
        scenetype: {},
        time: dayjs().add(-1, 'M').date(1).toDate()
      },
      townFilters: []
    };
  },
  methods: {
    setOptions(param) {
      this.formSearch.locations = param.locations;
      this.formSearch.scenetype = param.scenetype;
      this.$refs.tableRef.onSearch()
    },
    methods:{
      /**
       * é€šè¿‡è‡ªè¯„预检后,执行自动评估
       * @param {*} options æŸ¥è¯¢å‚æ•°
       */
      autoEvaluate(options){
    onSearch(page, func) {
      const { locations, scenetype, time } = this.formSearch;
      const area = {
        provincecode: locations.pCode,
        provincename: locations.pName,
        citycode: locations.cCode,
        cityname: locations.cName,
        districtcode: locations.dCode,
        districtname: locations.dName,
        starttime: dayjs(time).format('YYYY-MM-DD'),
        scensetypeid: scenetype.value
      };
      evaluateApi.fetchAutoEvaluation(area).then((res) => {
        if (typeof func === 'function') {
          func({ data: res.data });
        }
        if (res.data) {
          this.getFilters(res.data);
        }
      });
    },
    getFilters(data) {
      const townList = [];
      data.forEach((e) => {
        if (townList.indexOf(e.tname) == -1) {
          townList.push(e.tname);
        }
      });
      this.townFilters = townList.map((v) => {
        return { text: v, value: v };
      });
    },
    toCode(row, column) {
      if (row.evaluation) {
        return envCreditCode(row.evaluation.resultscorebef);
      } else {
        return '';
      }
    },
    timeFormat(row, column) {
      const time = row.subTaskTime;
      if (time) {
        return dayjs(time).format('MM-DD');
      } else {
        return '';
      }
    },
    filterHandler(value, row, column) {
      const property = column['property'];
      return row[property] === value;
    },
    sortScore(a, b) {
      const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
      const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
      return s1 - s2;
    }
  }
};
</script>
<style scoped>
.a {
  color: #f7a62c;
}
</style>
src/views/fysp/evaluation/components/CompHistoryRecord.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
<template>
  <div></div>
</template>
<script>
export default {
  methods:{
  }
}
</script>
src/views/fysp/evaluation/components/CompPreCheck.vue
@@ -1,115 +1,76 @@
<template>
  <FYSearchBar @search="preCheck">
    <template #options>
      <!-- åŒºåŽ¿ -->
      <FYOptionLocation
        :allOption="false"
        :level="3"
        :checkStrictly="false"
        v-model:value="formSearch._locations"
      ></FYOptionLocation>
      <!-- åœºæ™¯ç±»åž‹ -->
      <FYOptionScene
        :allOption="false"
        :type="2"
        v-model:value="formSearch.scenetype"
      ></FYOptionScene>
      <!-- æ—¶é—´ -->
      <FYOptionTime type="month" v-model:value="formSearch.time"></FYOptionTime>
  <el-steps :active="stepIndex" finish-status="success" style="" align-center>
    <el-step title="评估范围" />
    <el-step title="数据源检查" />
    <el-step title="豁免条目" />
    <el-step title="自动评估" />
  </el-steps>
  <el-card v-if="stepIndex == 0" shadow="never">
    <template #header>
      <div><el-text tag="b" size="large">选择评估范围</el-text></div>
      <el-text size="small" type="info">包括区县、场景类型以及月份</el-text>
    </template>
  </FYSearchBar>
  <el-row>
    <span>快捷选择</span>
    <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" @click="quickSet(v)">{{
      v.name
    }}</el-button>
  </el-row>
    <FYForm :form-info="evaConditon" :rules="evaConditionRules" :showButtons="false">
      <template #form-item="{ formObj }">
        <!-- åŒºåŽ¿ -->
        <FYOptionLocation
          :allOption="false"
          :level="3"
          :checkStrictly="false"
          v-model:value="formObj.locations"
        ></FYOptionLocation>
        <!-- åœºæ™¯ç±»åž‹ -->
        <FYOptionScene
          :allOption="false"
          :type="2"
          v-model:value="formObj.scenetype"
        ></FYOptionScene>
        <!-- æ—¶é—´ -->
        <FYOptionTime
          :initValue="true"
          type="month"
          v-model:value="formObj.time"
        ></FYOptionTime>
      </template>
    </FYForm>
    <template #footer>
      <el-row justify="space-around">
        <el-button type="primary" size="default">下一步</el-button>
      </el-row>
    </template>
  </el-card>
  <el-card v-if="stepIndex == 1" shadow="never"> Never2 </el-card>
  <el-card v-if="stepIndex == 2" shadow="never"> Never3 </el-card>
  <el-card v-if="stepIndex == 3" shadow="never"> Never4 </el-card>
</template>
<script>
import dayjs from 'dayjs';
/**
 * è‡ªåŠ¨è¯„ä¼°æ¡ä»¶åˆè§„æ€§æ£€æŸ¥
 */
export default {
  name: 'CompPreCheck',
  props: {
    quickSetting: {
      type: Array,
      default: () => {
        return [
          {
            name: '静安工地',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310106',
              dName: '静安区'
            },
            scenetype: { label: '工地', value: '1' }
          },
          {
            name: '徐汇餐饮',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310104',
              dName: '徐汇区'
            },
            scenetype: { label: '餐饮', value: '5' }
          },
          {
            name: '金山工地',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '工地', value: '1' }
          },
          {
            name: '金山码头',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '码头', value: '2' }
          },
          {
            name: '金山搅拌站',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '搅拌站', value: '3' }
          }
        ]
      }
    }
  },
  props: {},
  emits: ['preCheck'],
  data() {
    return {
      formSearch: {
        _locations: {},
        scenetype: {},
        time: undefined
      // æ“ä½œæ­¥éª¤ä¸‹æ ‡
      stepIndex: 0,
      // è¯„估任务范围
      evaConditon: {},
      evaConditionRules: {
        acountname: [
          {
            required: true,
            message: '账户名不能为空',
            trigger: 'blur'
          }
        ]
      }
    }
    };
  },
  methods: {
    /**
@@ -117,18 +78,8 @@
     * æ£€æŸ¥æ‰€é€‰èŒƒå›´å†…各项评估数据源是否完整
     */
    preCheck() {
      this.$emit('preCheck', this.formSearch)
    },
    /**
     * å¿«é€Ÿè®¾ç½®æ¡ä»¶
     */
    quickSet(set) {
      this.formSearch._locations = set.locations
      this.formSearch.scenetype = set.scenetype
      this.preCheck()
      // this.$emit('preCheck', param)
    }
  }
}
};
</script>
src/views/fysp/evaluation/components/CompQuickSet.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,94 @@
<template>
  <el-row>
    <span>快捷选择</span>
    <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" @click="quickSet(v)">{{
      v.name
    }}</el-button>
  </el-row>
</template>
<script>
export default {
  props: {
    quickSetting: {
      type: Array,
      default: () => {
        return [
          {
            name: '静安工地',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310106',
              dName: '静安区'
            },
            scenetype: { label: '工地', value: '1' }
          },
          {
            name: '徐汇餐饮',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310104',
              dName: '徐汇区'
            },
            scenetype: { label: '餐饮', value: '5' }
          },
          {
            name: '金山工地',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '工地', value: '1' }
          },
          {
            name: '金山码头',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '码头', value: '2' }
          },
          {
            name: '金山搅拌站',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '搅拌站', value: '3' }
          }
        ]
      }
    }
  },
  emits: ['quickSet'],
  methods: {
    /**
     * å¿«é€Ÿè®¾ç½®æ¡ä»¶
     * @param {locations, scenetype} set
     */
    quickSet(set) {
      // this.formSearch.locations = set.locations
      // this.formSearch.scenetype = set.scenetype
      this.$emit('quickSet', set)
    }
  }
}
</script>
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"
@@ -45,20 +43,16 @@
      <el-table-column prop="userInfo.extension1" label="区县" width="90" />
      <el-table-column prop="biTownName" label="街道" width="110" />
      <el-table-column prop="biArea" label="集中区" width="110" />
      <el-table-column prop="biManagementCompany" label="物业" min-width="110"/>
      <el-table-column prop="biManagementCompany" label="物业" min-width="110" />
      <el-table-column prop="userInfo.isenable" label="状态" width="90">
        <template #default="scope">
          {{ scope.row.userInfo.isenable ? '上线中' : '已下线' }}
        </template>
      </el-table-column>
      <el-table-column prop="userInfo.usertype" label="用户类型" width="90" />
      <el-table-column fixed="right" align="right" label="操作" width="140">
      <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>
@@ -70,13 +64,13 @@
            @click="editRow(scope)"
            >查看</el-button
          >
          <!-- <el-button
          <el-button
            :loading="scope.row.loading2"
            :type="scope.row.extension1 != '0' ? 'danger' : 'primary'"
            :type="scope.row.userInfo.isenable != '0' ? 'danger' : 'primary'"
            size="small"
            @click="itemActive(scope)"
            >{{ scope.row.extension1 != '0' ? '下线' : '上线' }}</el-button
          > -->
            >{{ scope.row.userInfo.isenable != '0' ? '下线' : '上线' }}</el-button
          >
        </template>
      </el-table-column>
    </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,43 +134,44 @@
        if (res) {
          func({
            data: res.data,
            total: res.head.totalCount,
            total: res.head.totalCount
          });
        }
      });
    },
    editRow(scope) {
      scope.row.loading1 = true;
      this.loadingStore.loadingStatus.push(() => (scope.row.loading1 = false));
      this.$router.push(`userEdit/${scope.row.biGuid}`);
      this.loadingStore.pushLoading(() => (scope.row.loading1 = false));
      this.$router.push(`userEdit/${scope.row.userInfo.guid}`);
    },
    itemActive(scope) {
      const rb = {};
      rb.guid = scope.row.guid;
      rb.extension1 = scope.row.extension1 != '0' ? '0' : '1';
      const msg = scope.row.extension1 != '0' ? '下线' : '上线';
      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
            .updateScene(rb)
            .updateUserInfo(param)
            .then((res) => {
              if (res == 1) {
                scope.row.extension1 = rb.extension1;
              if (res.success) {
                scope.row.userInfo.isenable = param.isenable;
              }
            })
            .finally(() => {
              scope.row.loading2 = false;
            });
        },
        }
      });
    },
    tableRowClassName({ row }) {
      return row.userInfo.isenable ? 'online-row' : 'offline-row';
    },
  },
    }
  }
};
</script>
<style></style>
src/views/fytz/user/components/CompUserInfoAddDrawer.vue
@@ -58,9 +58,10 @@
      }
    },
    onDrawerCancel() {
      this.onDrawerClose(() => {
        this.drawer_ = false;
      });
      // this.onDrawerClose(() => {
      //   this.drawer_ = false;
      // });
      this.drawer_ = false;
    },
  },
};