吉安感知网项目-前端
罗广辉
2026-02-03 bbf6d58d453cda88220d8513e98df808a698c7c7
Merge remote-tracking branch 'origin/master'
10 files modified
108 ■■■■ changed files
applications/drone-command/src/utils/validate.js 38 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/views/aICrudTemplate/FormDiaLog.vue 4 ●●●● patch | view | raw | blame | history
applications/drone-command/src/views/areaManage/precinctInfo/FormDiaLog.vue 4 ●●●● patch | view | raw | blame | history
applications/drone-command/src/views/basicManage/deviceStock/DeviceTrackDiaLog.vue 4 ●●●● patch | view | raw | blame | history
applications/drone-command/src/views/basicManage/deviceStock/FormDiaLog.vue 4 ●●●● patch | view | raw | blame | history
applications/task-work-order/src/styles/common/cockpit.scss 30 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/FormDiaLog.vue 3 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue 2 ●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue 2 ●●● patch | view | raw | blame | history
packages/utils/common/index.js 17 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/utils/validate.js
@@ -176,24 +176,30 @@
 * 判断手机号码是否正确
 */
export function isvalidatemobile(phone) {
  let list = [];
  let result = true;
  const list = [];
  let result = true; // true=不通过(保持你的语义)
  let msg = '';
  var isPhone = /^0\d{2,3}-?\d{7,8}$/;
  //增加134 减少|1349[0-9]{7},增加181,增加145,增加17[678]
  if (!validatenull(phone)) {
    if (phone.length === 11) {
      if (isPhone.test(phone)) {
        msg = '手机号码格式不正确';
      } else {
        result = false;
      }
    } else {
      msg = '手机号码长度不为11位';
    }
  } else {
    msg = '手机号码不能为空';
  const raw = String(phone ?? '').trim();
  if (!raw) {
    return [true, '手机号不能为空'];
  }
  // 1) 归一化:去空格/括号/短横线
  // 2) 去掉 +86/86 前缀
  const value = raw
    .replace(/[\s()()-]+/g, '')
    .replace(/^(?:\+?86)/, '');
  // 只允许纯数字11位手机号
  const mobile = /^1[3-9]\d{9}$/;
  if (mobile.test(value)) {
    result = false; // 通过
  } else {
    msg = '手机号格式不正确';
  }
  list.push(result);
  list.push(msg);
  return list;
applications/drone-command/src/views/aICrudTemplate/FormDiaLog.vue
@@ -102,7 +102,7 @@
import { ElMessage } from 'element-plus'
import { fwDeviceDetailApi, fwDeviceSubmitApi } from '@/views/aICrudTemplate/aICrudTemplateApi'
import { getUserListApi } from '@/api/system/user'
import { fieldRules } from '@ztzf/utils'
import { contactPhoneRules, fieldRules } from '@ztzf/utils'
const initForm = () => ({
    belongDept: '', // 所属部门
@@ -136,7 +136,7 @@
    deviceAtt: fieldRules(true),
    deviceModel: fieldRules(true, 50),
    belongDept: fieldRules(true),
    contactPhone: fieldRules(true, 50),
    contactPhone: contactPhoneRules(true, 50),
    charger: fieldRules(true),
}
applications/drone-command/src/views/areaManage/precinctInfo/FormDiaLog.vue
@@ -114,7 +114,7 @@
import { computed, nextTick, ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
import { fwPoliceStationDetailApi, fwPoliceStationSubmitApi } from './precinctInfoApi'
import { fieldRules } from '@ztzf/utils'
import { contactPhoneRules, fieldRules } from '@ztzf/utils'
import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue'
import * as Cesium from 'cesium'
import axios from 'axios'
@@ -147,7 +147,7 @@
    address: fieldRules(true, 50),
    stationName: fieldRules(true, 50),
    contactPerson: fieldRules(true, 50),
    contactPhone: fieldRules(true, 50),
    contactPhone: contactPhoneRules(true, 50),
    longitude: fieldRules(true),
}
applications/drone-command/src/views/basicManage/deviceStock/DeviceTrackDiaLog.vue
@@ -67,7 +67,7 @@
import { ElMessage } from 'element-plus'
import { getUserListApi } from '@/api/system/user'
import { getLazyTree } from '@/api/base/region'
import { fieldRules } from '@ztzf/utils'
import { contactPhoneRules, fieldRules } from '@ztzf/utils'
import { fwDeviceTrackSubmitApi } from '@/views/basicManage/deviceStock/fwDeviceTrackApi'
import { saveOperationLog } from '@ztzf/apis'
import { useRoute } from 'vue-router'
@@ -101,7 +101,7 @@
const rules = {
    charger: fieldRules(true), // 负责人
    contactPhone: fieldRules(true, 50), // 联系电话
    contactPhone: contactPhoneRules(true, 50), // 联系电话
    outTarget: fieldRules(true, 50),
    outTime: fieldRules(true),
    purpose: fieldRules(true, 50), // 用途
applications/drone-command/src/views/basicManage/deviceStock/FormDiaLog.vue
@@ -183,7 +183,7 @@
import { ElMessage } from 'element-plus'
import { fwDeviceDetailApi, fwDeviceSubmitApi } from '@/views/basicManage/deviceStock/fwDevice'
import { getUserListApi } from '@/api/system/user'
import { fieldRules, getDictLabel } from '@ztzf/utils'
import { contactPhoneRules, fieldRules, getDictLabel } from '@ztzf/utils'
import { fwDeviceTrackPageApi } from '@/views/basicManage/deviceStock/fwDeviceTrackApi'
import { saveOperationLog } from '@ztzf/apis'
import { useRoute } from 'vue-router'
@@ -244,7 +244,7 @@
    source: fieldRules(true, 50),
    purpose: fieldRules(true, 50),
    belongDept: fieldRules(true),
    contactPhone: fieldRules(true, 50),
    contactPhone: contactPhoneRules(true, 50),
    charger: fieldRules(true),
}
applications/task-work-order/src/styles/common/cockpit.scss
@@ -1176,6 +1176,35 @@
}
.gd-dialog-form {
  // 最后一排不需要设置 margin-bottom
  // border: 1px solid red;
  // 倒数第二个也设置为0
  // .el-col:nth-last-child(2) {
  //   margin-bottom: 0;
  // }
  // .el-col:nth-last-child(1) {
  //   margin-bottom: 0;
  // }
  // .el-form-item:nth-last-child(2) {
  //   margin-bottom: 0;
  // }
  //  .el-form-item:nth-last-child(1) {
  //   margin-bottom: 0;
  // }
  .gd-select {
    .el-select__wrapper {
      height: 36px;
    }
  }
  .gd-date-picker {
    height: 36px;
  }
  .gd-input {
    height: 36px;
  }
  .el-input,
  .el-input-number {
    min-width: 200px;
@@ -1187,6 +1216,7 @@
    .el-input__inner {
      text-align: left;
      color: #383874;
      &::placeholder {
        text-align: left;
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/FormDiaLog.vue
@@ -477,6 +477,9 @@
    color: #f56c6c;
    margin-right: 4px;
}
:deep(.el-table__header th) {
    font-weight: normal !important;
}
.grayText {
    color: #9f9f9f !important;
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
@@ -92,7 +92,7 @@
                </div>
                <!-- 编辑模式 -->
                <el-form class="gd-dialog-form" v-else ref="formRef" :model="formData" :rules="rules" label-width="110px">
                <el-form class="gd-dialog-form" v-else ref="formRef" :model="formData" :rules="rules" label-width="130px">
                    <div class="detail-title">巡查任务详情</div>
                    <el-row>
                        <el-col :span="12">
applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue
@@ -141,7 +141,7 @@
                                <el-input
                                    class="gd-input"
                                    type="textarea"
                                    :rows="4"
                                    :rows="3"
                                    v-model="formData.remark"
                                    placeholder="请输入"
                                    clearable
packages/utils/common/index.js
@@ -22,6 +22,23 @@
    return rules
}
const isContactPhone = value => {
    const mobile = /^1[3-9]\d{9}$/
    const landline = /^0\d{2,3}-?\d{7,8}$/
    return mobile.test(value) || landline.test(value)
}
export const contactPhoneRules = (required = true, max = 50) => {
    const validateContactPhone = (rule, value, callback) => {
        const nextValue = String(value || '').trim()
        if (!nextValue) return callback()
        if (isContactPhone(nextValue)) return callback()
        return callback(new Error('联系电话格式不正确'))
    }
    return [...fieldRules(required, max), { validator: validateContactPhone, trigger: ['blur', 'change'] }]
}
export function getDictLabel(value, dictList = []) {
    if (value === null || value === undefined || value === '') return '';
    const values = String(value).split(',');