Browse Source

feat(useI18n): 国际化

tangning 3 years ago
parent
commit
c90dcfdddd
77 changed files with 3769 additions and 611 deletions
  1. 133 0
      src/locales/lang/zh-CN/apiCode.ts
  2. 12 0
      src/locales/lang/zh-CN/common.ts
  3. 1 0
      src/locales/lang/zh-CN/layout.ts
  4. 8 0
      src/locales/lang/zh-CN/routes/corporation.ts
  5. 3 0
      src/locales/lang/zh-CN/routes/devices.ts
  6. 14 0
      src/locales/lang/zh-CN/routes/member.ts
  7. 78 0
      src/locales/lang/zh-CN/routes/product.ts
  8. 57 0
      src/locales/lang/zh-CN/routes/rightsEnterprises.ts
  9. 25 0
      src/locales/lang/zh-CN/routes/scenes.ts
  10. 13 0
      src/locales/lang/zh-CN/routes/staff.ts
  11. 58 0
      src/locales/lang/zh-CN/routes/system.ts
  12. 0 1
      src/locales/lang/zh-CN/sys.ts
  13. 19 0
      src/store/modules/locale.ts
  14. 15 12
      src/views/advertisement/list.vue
  15. 7 3
      src/views/advertisement/listDrawer.vue
  16. 12 11
      src/views/advertisement/pads.vue
  17. 9 3
      src/views/advertisement/padsDrawer.vue
  18. 50 9
      src/views/advertisement/schemas.ts
  19. 0 11
      src/views/bulletin/decoration.vue
  20. 0 11
      src/views/bulletin/sell.vue
  21. 5 5
      src/views/corporation/AddCorporationModal.vue
  22. 22 3
      src/views/corporation/AddModal.vue
  23. 9 9
      src/views/corporation/SubaccountModal.vue
  24. 39 38
      src/views/corporation/chargeModal.vue
  25. 2 2
      src/views/corporation/detailsModal.vue
  26. 1 1
      src/views/corporation/deviceModal.vue
  27. 1 1
      src/views/corporation/index.vue
  28. 1 1
      src/views/corporation/verify.vue
  29. 1 1
      src/views/devices/AddModal.vue
  30. 11 11
      src/views/devices/list.vue
  31. 15 15
      src/views/member/list.vue
  32. 15 14
      src/views/product/addCategoryModal.vue
  33. 4 4
      src/views/product/addModal.vue
  34. 15 13
      src/views/product/category.vue
  35. 33 31
      src/views/product/drawer.data.ts
  36. 13 13
      src/views/product/editCategoryModal.vue
  37. 7 6
      src/views/product/goodsSpecs.vue
  38. 15 15
      src/views/product/list.data.ts
  39. 15 13
      src/views/product/list.vue
  40. 9 7
      src/views/product/productDrawer.vue
  41. 18 18
      src/views/product/ref.vue
  42. 215 0
      src/views/rightsEnterprises/BindModal.vue
  43. 204 0
      src/views/rightsEnterprises/addCameraModal.vue
  44. 328 0
      src/views/rightsEnterprises/addModal.vue
  45. 296 0
      src/views/rightsEnterprises/camera.vue
  46. 108 0
      src/views/rightsEnterprises/cameraBind.vue
  47. 291 0
      src/views/rightsEnterprises/cameraList.vue
  48. 235 0
      src/views/rightsEnterprises/enterprises.vue
  49. 316 0
      src/views/rightsEnterprises/list.vue
  50. 265 0
      src/views/rightsEnterprises/rightsList.vue
  51. 287 0
      src/views/rightsEnterprises/staff.vue
  52. 22 24
      src/views/scenes/downloadModal.vue
  53. 7 7
      src/views/scenes/editorModal.vue
  54. 33 27
      src/views/scenes/list.vue
  55. 11 11
      src/views/scenes/live.vue
  56. 47 28
      src/views/scenes/liveDrawer.vue
  57. 78 0
      src/views/staff/clean.vue
  58. 5 5
      src/views/staff/delListModal.vue
  59. 44 10
      src/views/staff/detailsModal.vue
  60. 9 12
      src/views/staff/list.vue
  61. 36 1
      src/views/sys/login/Login.vue
  62. 12 10
      src/views/system/account/AccountDetail.vue
  63. 0 69
      src/views/system/account/AccountModal.vue
  64. 4 2
      src/views/system/account/DeptTree.vue
  65. 15 13
      src/views/system/account/account.data.ts
  66. 7 7
      src/views/system/account/index.vue
  67. 5 2
      src/views/system/dept/DeptModal.vue
  68. 19 18
      src/views/system/dept/dept.data.ts
  69. 9 5
      src/views/system/dept/index.vue
  70. 3 1
      src/views/system/menu/MenuDrawer.vue
  71. 7 5
      src/views/system/menu/index.vue
  72. 44 43
      src/views/system/menu/menu.data.ts
  73. 7 4
      src/views/system/password/index.vue
  74. 9 8
      src/views/system/password/pwd.data.ts
  75. 7 2
      src/views/system/role/RoleDrawer.vue
  76. 8 6
      src/views/system/role/index.vue
  77. 11 9
      src/views/system/role/role.data.ts

+ 133 - 0
src/locales/lang/zh-CN/apiCode.ts

@@ -0,0 +1,133 @@
+export default {
+  errCode3001: '缺少必要参数',
+  errCode3002: '访问异常!',
+  errCode3003: '非法访问!',
+  errCode3004: '用户未登录',
+  errCode3005: '验证码已过期',
+  errCode3006: '验证码错误',
+  errCode3007: '昵称已存在',
+  errCode3008: '该邮箱已被注册',
+  errCode3009: '两次输入的密码不一致',
+  errCode3010: '昵称长度错误',
+  errCode3011: '密码需要包含英文大小写、数字,长度8,16字符',
+  errCode3012: '昵称包含敏感词',
+  errCode3013: '手机号码格式错误',
+  errCode3014: '账号或密码不正确',
+  errCode3015: '用户不存在',
+  errCode3016: '登录失败,账号无权访问',
+  errCode3017: '空文件',
+  errCode3018: '需要上传或使用的文件不存在',
+  errCode3019: '邮箱格式不正确',
+  errCode3020: '邮箱地址已存在',
+  errCode3021: '账号不存在,请核对后重新输入。',
+  errCode3022: '该场景已添加协作者,请先取消协作后再添加',
+  errCode3023: '手机验证码获取验证码次数过多,请明天再试',
+  errCode3024: '不能将场景协作给自己',
+  errCode3025: '不能将相机分配给自己',
+  errCode3026: '有部分场景已存在协作者,请先取消协作后再添加',
+  errCode3027: '原密码错误',
+  errCode3028: '角色已存在',
+  errCode3029: '当前角色存在关联的用户,请先删除用户或修改用户所属角色',
+  errCode3030: '当前增值权益不存在',
+  errCode3031: '相机已绑定',
+  errCode3032: '当前相机已被授权,请选择另外相机绑定',
+  errCode3033: '60秒内不能重复获取验证码',
+  errCode3034: '服务器繁忙,请重试!',
+  errCode3035: '当前企业账号未审核通过,请稍后重试',
+
+  errCode9001: '经销商已存在',
+  errCode9002: '请先删除经销商下的用户',
+
+  errCode4001: '验证码超时',
+  errCode4002: '用户已经存在',
+  errCode4003: '企业邮箱已经被注册',
+  errCode4004: '两次输入的密码不正确',
+  errCode4005: '手机号与验证码不匹配',
+  errCode4006: '验证码错误',
+  errCode4007: '用户名不存在',
+  errCode4008: '用户尚未登录',
+  errCode4009: '异常错误',
+  errCode4010: '绑定的相机不存在',
+  errCode4011: '相机已经被绑定',
+  errCode4012: '账号或密码错误',
+  errCode4013: '昵称重复',
+  errCode4014: '余额不足,无法生成模型,请前往网页端充值或上传时去掉生成模型选项',
+  errCode4015: '昵称中包含敏感词',
+  errCode4016: '参数为空',
+  errCode4017: '场景为空',
+  errCode4018: '场景不属于该相机',
+  errCode4019: '场景序号为空',
+  errCode4020: '相机未绑定用户',
+  errCode4021: '开票失败,该订单已经开具发票',
+
+  errCode6001: 'SN码已存在,请重新输入',
+  errCode6002: '退充值超过了充值总额',
+  errCode6003: '该相机未被绑定,请前往,我的相机 先绑定相机后再进行授权',
+  errCode6004: '表示相机的点数超过了10万',
+  errCode6005: '无权操作该相机',
+  errCode6006: '不支持重复绑定',
+  errCode6007: '八目相机不支持解除绑定',
+  errCode6008: '相机容量不足',
+  errCode6009: 'data,fdage文件不存在',
+  errCode6010: '该序列号已被绑定',
+  errCode6011: '查询不到企业相机列表',
+  errCode6012: '相机未绑定用户',
+  errCode6013: '必须输入需迁相机所绑定用户的验证码',
+  errCode6014: '必须输入目标相机所绑定用户的验证码',
+  errCode6015: '该相机已添加协作者,请先取消协作后再添加',
+  errCode6016: '部分相机已添加协作者,请先取消协作后再添加',
+  errCode6017: '设备已出库,不可删除',
+  errCode6018: '设备类型不存在',
+  errCode6019: 'sn码未填写',
+  errCode6020: 'sn码不存在',
+  errCode6021: '出库类型未填写',
+  errCode6022: '出库类型不存在',
+  errCode6023: '经销商未填写',
+  errCode6024: '经销商类型不存在',
+  errCode6025: 'sn码未出库',
+  errCode6026: '客户名称未填写',
+  errCode6027: '客户名称不存在',
+  errCode6028: '相机类型不正确!',
+  errCode6029: '相机不存在!',
+
+  errCode8001: '订单不存在',
+  errCode8002: '支付失败',
+  errCode8003: '开票金额超过范围',
+  errCode8004: '支付方式异常',
+
+  errCode5001: 'modeldatajson为空',
+  errCode5002: 'order值为空',
+  errCode5003: 'guideSid或order值为空',
+  errCode5004: 'guideSid或guideName值为空',
+  errCode5005: '场景为空',
+  errCode5006: '余额不足',
+  errCode5007: '非八目场景',
+  errCode5008: '该场景已经被封存,无法删除',
+  errCode5009: '场景被删除',
+  errCode5010: '场景不属于该相机',
+  errCode5011: '创建',
+  errCode5012: '数据不正常',
+  errCode5013: '场景对应的用户名为空',
+  errCode5014: '该用户无权操作该场景',
+  errCode5015: '该场景不属于当前登录账号',
+  errCode5016: '热点外链场景不对',
+  errCode5017: '*上传模型失败,请参照右侧教程',
+  errCode5018: 'zip文件只能有一层目录或无目录',
+  errCode5019: '必须有且仅有一个obj和mtl文件',
+  errCode5020: '贴图需控制在1,5M以内,obj文件需要控制在20M以内。',
+  errCode5021: '场景密钥不正确',
+  errCode5022: '上传文件格式,名称不一致',
+  errCode5023: '上传文件格式不正确,只能是jpg或mp4格式',
+  errCode5024: '有场景打包中,请稍后重试',
+  errCode5025: '数据包不存在,请先打成zip包',
+  errCode5026: '上传的压缩包类型不正确',
+  errCode5027: '文件夹不存在',
+  errCode5028: '无权修改该文件夹',
+  errCode5029: '场景下载失败,请稍后重试',
+  errCode5030: '同级文件夹名称不能重复',
+  errCode5031: '场景打包中不能重复操作',
+  errCode5032: '三维家打包记录不存在',
+  errCode5033: '该场景正在计算中',
+  errCode5034: '该场景已封存',
+  errCode5035: '任务已存在',
+};

+ 12 - 0
src/locales/lang/zh-CN/common.ts

@@ -2,6 +2,7 @@ export default {
   okText: '确认',
   okText: '确认',
   closeText: '关闭',
   closeText: '关闭',
   cancelText: '取消',
   cancelText: '取消',
+  EditorNot: '是否取消编辑',
   loadingText: '加载中...',
   loadingText: '加载中...',
   saveText: '保存',
   saveText: '保存',
   delText: '删除',
   delText: '删除',
@@ -24,6 +25,11 @@ export default {
   yes: '是',
   yes: '是',
   no: '否',
   no: '否',
   roleName: '角色',
   roleName: '角色',
+  roleNameText: '角色名称',
+  addRoleName: '新增角色',
+  editRoleName: '编辑角色',
+  submitState: '提交成功!',
+
   unusual: '异常',
   unusual: '异常',
   operation: '操作',
   operation: '操作',
   normal: '正常',
   normal: '正常',
@@ -33,6 +39,7 @@ export default {
   fullName: '员工名称',
   fullName: '员工名称',
   print: '打印',
   print: '打印',
   all: '全部',
   all: '全部',
+  tips: '提示',
   optSuccess: '操作成功!',
   optSuccess: '操作成功!',
   optFail: '操作失败!',
   optFail: '操作失败!',
   notConnect: '暂未接入',
   notConnect: '暂未接入',
@@ -40,4 +47,9 @@ export default {
   mobile: '手机',
   mobile: '手机',
   phone: '请填写您的手机号码!',
   phone: '请填写您的手机号码!',
   phoneError: '请正确填写您的手机号码!',
   phoneError: '请正确填写您的手机号码!',
+  staffPhoneError: '请正确填写您的企业账户!',
+  uploadMessge: '请选择上传文件',
+  userNick: '请输入员工名称',
+  userCorrectNameNick: '请输入正确的员工名称',
+  warning: '警告',
 };
 };

+ 1 - 0
src/locales/lang/zh-CN/layout.ts

@@ -47,6 +47,7 @@ export default {
     menuTypeMixSidebar: '左侧菜单混合模式',
     menuTypeMixSidebar: '左侧菜单混合模式',
     menuTypeMix: '顶部菜单混合模式',
     menuTypeMix: '顶部菜单混合模式',
     menuTypeTopMenu: '顶部菜单模式',
     menuTypeTopMenu: '顶部菜单模式',
+    menuDistribution: '菜单分配',
 
 
     on: '开',
     on: '开',
     off: '关',
     off: '关',

+ 8 - 0
src/locales/lang/zh-CN/routes/corporation.ts

@@ -1,4 +1,5 @@
 export default {
 export default {
+  pageTitle: '设备充值',
   recharge: '充值',
   recharge: '充值',
   device: '设备',
   device: '设备',
   deviceId: '设备ID',
   deviceId: '设备ID',
@@ -16,6 +17,8 @@ export default {
   submitTime: '提交时间',
   submitTime: '提交时间',
   enterpriseId: '企业账号',
   enterpriseId: '企业账号',
   rechargeId: '充值账号',
   rechargeId: '充值账号',
+  newPoint: '当前余额',
+  addPointnumber: '充 值',
   sceneLogo: '加载界面LOGO',
   sceneLogo: '加载界面LOGO',
   floorLogo: '加载地面LOGO',
   floorLogo: '加载地面LOGO',
   bgMusic: '背景音乐',
   bgMusic: '背景音乐',
@@ -34,6 +37,7 @@ export default {
   allow: '同意',
   allow: '同意',
   name: '信息标题',
   name: '信息标题',
   area: '所属区域',
   area: '所属区域',
+  areaText: '地区',
   address: '详细地址',
   address: '详细地址',
   website: '企业官网',
   website: '企业官网',
   introduce: '企业简介',
   introduce: '企业简介',
@@ -44,4 +48,8 @@ export default {
   optSuccess: '添加成功,默认密码为Geosign123',
   optSuccess: '添加成功,默认密码为Geosign123',
   approveState: '审核状态',
   approveState: '审核状态',
   maxlength: '输入超长',
   maxlength: '输入超长',
+  uploadHelp: '支持png  jpg图片格式',
+  addTips: '员工账号已被绑定',
+  rechargeTips: '此操作将对该账号进行充值, 是否继续?',
+  deviceNumberMax: '最多批量增加20个!',
 };
 };

+ 3 - 0
src/locales/lang/zh-CN/routes/devices.ts

@@ -48,6 +48,9 @@ export default {
   addeduser: '已添加员工数',
   addeduser: '已添加员工数',
   num: '设备数量',
   num: '设备数量',
   subNum: '可添加员工总数',
   subNum: '可添加员工总数',
+  addCameraTitle: '新增相机',
+  searchKey: '关键字',
+  searchKeyPlaceholder: '支持搜索 手机号、sn码',
 
 
   // normalSales: '正常销售',
   // normalSales: '正常销售',
   // normalSales: '正常销售',
   // normalSales: '正常销售',

+ 14 - 0
src/locales/lang/zh-CN/routes/member.ts

@@ -0,0 +1,14 @@
+export default {
+  username: '名称',
+  avatar: '头像',
+  birthday: '出生日期',
+  lastLoginTime: '最后登录时间',
+  nickname: '微信名',
+  pageTitle: '微信用户列表',
+  gender: {
+    text: '性别',
+    1: '男',
+    0: '女',
+    2: '其他',
+  },
+};

+ 78 - 0
src/locales/lang/zh-CN/routes/product.ts

@@ -0,0 +1,78 @@
+export default {
+  name: '分类名称',
+  parentId: '上级分类',
+  addGoods: '新增商品',
+  editGoods: '编辑商品',
+  addAttributes: '新增商品属性',
+  levelNum: '级数',
+  batch: {
+    del: '批量删除',
+    grounding: '批量上架',
+    undercarriage: '批量下架',
+    delMessge: '是否确定批量删除?',
+    groundingMessge: '是否确定批量上架?',
+    undercarriageMessge: '是否确定批量下架?',
+  },
+  wapBannerUrl: '手机banner',
+  createType: '新增商品分类',
+  tradeName: '商品名称',
+  goodsSimpleDesc: '商品描述',
+  realShopUrl: '购买链接',
+  goodsgg: '商品规格',
+  productList: '规格明细',
+  isOnSale: '是否上架',
+  isLaunched: '上架状态',
+  primaryPicUrl: '主图',
+  listPicUrl: '列表图',
+  unit: '零售价格',
+  amount: '销售量',
+  salesPrice: '销售价',
+  marketingUnit: '市场价',
+  createTime: '下单时间',
+  addTime: '创建时间',
+  goodsSn: '规格值',
+  goodsId: '规格名',
+  field: '字段',
+  stock: '库存',
+  dataSave: '数据已保存',
+  correctData: '请填写正确的数据',
+  dataSaveFail: '保存失败',
+  specificationCode: '规格编码',
+  addAttribute: '添加属性值',
+  addSpecs: '添加规格项目',
+  addSubmit: '生成规格明细',
+  productListMessge: '请选生成规格明细!!',
+  preservation: '正在保存...',
+  realShopUrlMessge: '仅支持京东链接',
+  sortOrderTips: '请输入正确的排序',
+  nameMessge: '请输入分类名称',
+  productRefMessge: '请输入商品属性',
+  onSale: {
+    1: '上架',
+    0: '下架',
+    9: '暂未接入',
+  },
+  level: {
+    name: '级别',
+    1: '一级分类',
+    2: '二级分类',
+  },
+  isShow: {
+    1: '显示',
+    0: '不显示',
+  },
+
+  image: '封面',
+  featuredFirst: '推荐位',
+  addFeaturedFirst: '推荐位',
+  editFeaturedFirst: '推荐位',
+  title: '标题',
+  saveTime: '编辑时间',
+  pageTitle: '轮播图',
+  Submit: '提交',
+  addinfo: '新增轮播资讯',
+  editinfo: '编辑轮播资讯',
+  orderNum: '推荐排序',
+  orderNum1: '请输入排序数',
+  orderNum2: '请输入正确的排序数',
+};

+ 57 - 0
src/locales/lang/zh-CN/routes/rightsEnterprises.ts

@@ -0,0 +1,57 @@
+export default {
+  menuName: '企业权益管理',
+  menuList: '企业权益',
+  menuTableList: '企业相机权益',
+  staffList: '员工权益',
+  staffName: '员工名称',
+  staffPhone: '员工手机号码',
+  timeField: '时间',
+  companyName: '企业名称',
+  companyId: '企业ID',
+  companyPhone: '企业账号',
+  userPermNum: '用户权益总数',
+  exUserPermNum: '已过期用户权益数',
+  // companyName:'购买日期',
+  ddd: '公司到期日期',
+  add: '新增权益',
+  title: '新增权益',
+  rightsType: '权益类型',
+  year: '年限',
+  muber: '数量',
+  purchaseTime: '购买日期',
+  permName: '权益',
+  createTime: '购买时间',
+  activationTime: '激活时间',
+  expirationTime: '到期时间',
+  incrementNum: '权益数',
+  addText: '新增',
+  kk: '四维看看 pro',
+  kj: '四维看见',
+  ss: '四维深时',
+  snCode: '授权相机S/N码',
+  snCodeText: '相机SN码',
+  cameraIncrementTypeName: '设备类型',
+  state: {
+    0: '未激活',
+    1: '已生效',
+    2: '已过期',
+    9: '未过期',
+  },
+  addcamera: '新增相机权益',
+  maxlength: '请输入0-999的权益数!',
+  integer: '权益数应为正整数!',
+  cameraTitle: '相机权益',
+  see: '查看',
+  warrant: '授权',
+  cameraEquityId: '相机权益ID',
+  unbindorNot: '是否确定解绑相机?',
+  authorizedCamera: '授权相机',
+  activationTimeOut: '权益激活时间',
+  expirationTimeOut: '权益过期时间',
+  unbindPer: '解绑权益',
+  incrementNum1: '请输入权益数',
+  perMessge: '不支持两个权益都为空',
+  incrementNum2: '请输入正确的权益数',
+  alertMessge: '带看权益为 ${lookNum} 个、拍摄权益为 ${shotNum} 个',
+  unbindPercontent: '解绑权益后,公司员工的权益时间将缩减,是否继续解绑?',
+};

+ 25 - 0
src/locales/lang/zh-CN/routes/scenes.ts

@@ -1,5 +1,6 @@
 export default {
 export default {
   sceneName: '场景名称',
   sceneName: '场景名称',
+  scenePic: '场景封面',
   webSite: '场景链接',
   webSite: '场景链接',
   childName: '拍摄设备ID',
   childName: '拍摄设备ID',
   viewCount: '场景访问量',
   viewCount: '场景访问量',
@@ -19,6 +20,7 @@ export default {
   downloadScene: '下载场景',
   downloadScene: '下载场景',
   downloadSceneConfirm: '是否确认下载场景',
   downloadSceneConfirm: '是否确认下载场景',
   editor: '打开编辑器',
   editor: '打开编辑器',
+  editorScenes: '编辑场景',
   cancelDownload: '取消下载',
   cancelDownload: '取消下载',
   own: '主播选择',
   own: '主播选择',
   userName: '员工名称',
   userName: '员工名称',
@@ -33,6 +35,8 @@ export default {
   detailAddr: '详细地址',
   detailAddr: '详细地址',
   contractPhone: '联系电话',
   contractPhone: '联系电话',
   simpleDesc: '直播间描述',
   simpleDesc: '直播间描述',
+  appletPicUrl: '小程序封面',
+  applet: '小程序',
   roleType: {
   roleType: {
     0: '公司管理员',
     0: '公司管理员',
     1: '公司员工',
     1: '公司员工',
@@ -42,6 +46,27 @@ export default {
     1: '二手房',
     1: '二手房',
     2: '公寓',
     2: '公寓',
     3: '民宿',
     3: '民宿',
+    4: '装修',
     9: '全部',
     9: '全部',
   },
   },
+  status: '状态',
+  getting: '获取中',
+  gain: '获取成功',
+  statusText: {
+    1: '正常',
+    0: '封存',
+    2: '禁用',
+  },
+  showTips: '是否显示在小程序',
+  liveRoomUrl: '直播间链接',
+  nameTips: '仅能输入 英文大小写和中文,最多可输入50个字',
+  appListPicUrlMessage: '推荐大小:400 * 400 像素',
+  sceneNumMessage: '直播间绑定后,将无法修改',
+  location: '直播间位置',
+  locationMessage: '查询地址异常',
+  map: '地图位置',
+  picList: '直播间图片',
+  contractPhoneMessage: '支持填写400(400-xxx-xxxx)热线、手机号等联系方式',
+  addAnchor: '新增直播间',
+  editAnchor: '编辑直播间',
 };
 };

+ 13 - 0
src/locales/lang/zh-CN/routes/staff.ts

@@ -12,4 +12,17 @@ export default {
     0: '公司管理员',
     0: '公司管理员',
     1: '公司员工',
     1: '公司员工',
   },
   },
+  permListName: {
+    1: '带看',
+    2: '拍摄',
+  },
+  closeStutaText: '清除状态',
+  delUser: '删除员工',
+  toUserPhone: '选择迁移的员工',
+  delUserTips: '请将员工的数据迁移后,再删除员工(删除员工后,权益将进行解绑)',
+  addTips: '手机号未在指房宝APP中进行注册',
+  companyId: '公司',
+  add: '新 增',
+  addMessage: '剩余带看权益为 {lookNum} 个、拍摄权益为 {shotNum} 个',
+  delMessage: '此操作将对{userName}进行删除, 是否继续?',
 };
 };

+ 58 - 0
src/locales/lang/zh-CN/routes/system.ts

@@ -1,6 +1,64 @@
 const account = {
 const account = {
   userName: '用户名',
   userName: '用户名',
   accountList: '账户列表',
   accountList: '账户列表',
+  addHost: '新增主持人',
+  edit: '编辑用户资料',
+  delText: '删除此账号',
+  departmentList: '部门列表',
+  departmentName: '部门名称',
+  addDepartment: '新增部门',
+  editDepartment: '编辑部门',
+  addUser: '新增账号',
+  editUser: '编辑账号',
+  parentDept: '上级部门',
+  infoData: {
+    title: '用户{userId}的资料',
+    content: '这是用户资料详情页面。本页面仅用于演示相同路由在tab中打开多个页面并且显示不同的数据',
+  },
+  disable: '禁用账号',
+  set: '修改密码',
+  userProfile: '用户资料',
+  log: '操作日志',
+  userinfo: '这是用户{userId}资料Tab',
+  userlog: '这是用户{userId}操作日志Tab',
+  setTitle: '详情:用户',
+  enable: '启用',
+  stopUsing: '停用',
+  remarks: '备注',
+  newMenu: '新增菜单',
+  menuList: '菜单列表',
+  menuType: '菜单类型',
+  menuName: '菜单名称',
+  menuName1: '请输入菜单名称',
+  menuName2: '请输入正确的菜单名称',
+  menuPath: '菜单路径',
+  routerPath: '菜单路径',
+  menuUrl: '外链地址',
+  menuParentName: '上级菜单',
+  component: '组件路径',
+  icon: '图标',
+  perms: '权限标识',
+  passwordOld: '当前密码',
+  passwordNew: '新密码',
+  passwordNew1: '请输入新密码',
+  confirmPassword: '确认密码',
+  confirmPassword1: '不能为空',
+  confirmPassword2: '两次输入的密码不一致!',
+  isExt: {
+    title: '是否外链',
+    1: '是',
+    0: '否',
+    url: '',
+  },
+  type: {
+    title: '类型',
+    0: '目录',
+    1: '菜单',
+    2: '按钮',
+    3: '按钮',
+  },
+  roleTitle: '角色列表',
+  isPlatformRole: '是否平台角色',
 };
 };
 
 
 export default {
 export default {

+ 0 - 1
src/locales/lang/zh-CN/sys.ts

@@ -88,7 +88,6 @@ export default {
     mobilePlaceholder: '请输入手机号码',
     mobilePlaceholder: '请输入手机号码',
     policyPlaceholder: '勾选后才能注册',
     policyPlaceholder: '勾选后才能注册',
     diffPwd: '两次输入密码不一致',
     diffPwd: '两次输入密码不一致',
-
     userName: '账号',
     userName: '账号',
     password: '密码',
     password: '密码',
     confirmPassword: '确认密码',
     confirmPassword: '确认密码',

+ 19 - 0
src/store/modules/locale.ts

@@ -14,6 +14,11 @@ const lsLocaleSetting = (ls.get(LOCALE_KEY) || localeSetting) as LocaleSetting;
 interface LocaleState {
 interface LocaleState {
   localInfo: LocaleSetting;
   localInfo: LocaleSetting;
 }
 }
+interface appItem {
+  name: string;
+  icon: string;
+  url: string;
+}
 
 
 export const useLocaleStore = defineStore({
 export const useLocaleStore = defineStore({
   id: 'app-locale',
   id: 'app-locale',
@@ -27,6 +32,20 @@ export const useLocaleStore = defineStore({
     getLocale(): LocaleType {
     getLocale(): LocaleType {
       return this.localInfo?.locale ?? 'zh_CN';
       return this.localInfo?.locale ?? 'zh_CN';
     },
     },
+    getAppList(): appItem[] {
+      return [
+        {
+          name: 'iOS版',
+          url: 'https://oss.4dkankan.jp/img/static/ios.png',
+          icon: 'uil:apple',
+        },
+        {
+          name: 'Android版',
+          url: 'https://oss.4dkankan.jp/img/static/android.png',
+          icon: 'uil:android',
+        },
+      ];
+    },
   },
   },
   actions: {
   actions: {
     /**
     /**

+ 15 - 12
src/views/advertisement/list.vue

@@ -2,7 +2,7 @@
   <div class="p-4">
   <div class="p-4">
     <BasicTable @register="registerTable">
     <BasicTable @register="registerTable">
       <template #toolbar>
       <template #toolbar>
-        <a-button type="primary" @click="handleCreate">新增</a-button>
+        <a-button type="primary" @click="handleCreate">{{ t('routes.devices.add') }}</a-button>
       </template>
       </template>
       <template #time="{ record }">
       <template #time="{ record }">
         <Time v-if="record.createTime" :value="record.createTime" mode="date" />
         <Time v-if="record.createTime" :value="record.createTime" mode="date" />
@@ -14,14 +14,14 @@
         <TableAction
         <TableAction
           :actions="[
           :actions="[
             {
             {
-              label: '编辑',
+              label: t('common.edit'),
               onClick: handleEdit.bind(null, record),
               onClick: handleEdit.bind(null, record),
             },
             },
             {
             {
               color: 'error',
               color: 'error',
-              label: '删除',
+              label: t('common.delText'),
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.delConfirm'),
                 confirm: deleteConfirm.bind(null, record),
                 confirm: deleteConfirm.bind(null, record),
               },
               },
             },
             },
@@ -40,7 +40,9 @@
   import { Time } from '/@/components/Time';
   import { Time } from '/@/components/Time';
   import listDrawer from './listDrawer.vue';
   import listDrawer from './listDrawer.vue';
   import { ListApi, itemDeletelApi } from '/@/api/advertisement/list';
   import { ListApi, itemDeletelApi } from '/@/api/advertisement/list';
-  // param type 2
+  import { useI18n } from '/@/hooks/web/useI18n';
+  const { t } = useI18n();
+
   export default defineComponent({
   export default defineComponent({
     components: { BasicTable, TableAction, TableImg, listDrawer, Time },
     components: { BasicTable, TableAction, TableImg, listDrawer, Time },
     setup() {
     setup() {
@@ -48,37 +50,37 @@
       const [registerDrawer, { openDrawer }] = useDrawer();
       const [registerDrawer, { openDrawer }] = useDrawer();
       const columns: BasicColumn[] = [
       const columns: BasicColumn[] = [
         {
         {
-          title: '序号',
+          title: t('component.table.index'),
           dataIndex: 'id',
           dataIndex: 'id',
           fixed: 'left',
           fixed: 'left',
           width: 100,
           width: 100,
         },
         },
         {
         {
-          title: '封面',
+          title: t('routes.product.image'),
           dataIndex: 'image',
           dataIndex: 'image',
           ellipsis: true,
           ellipsis: true,
           slots: { customRender: 'img' },
           slots: { customRender: 'img' },
           width: 230,
           width: 230,
         },
         },
         {
         {
-          title: '标题',
+          title: t('routes.product.title'),
           dataIndex: 'title',
           dataIndex: 'title',
           width: 230,
           width: 230,
         },
         },
         {
         {
-          title: '排序',
+          title: t('routes.scenes.sortOrder'),
           dataIndex: 'orderNum',
           dataIndex: 'orderNum',
           width: 100,
           width: 100,
         },
         },
         {
         {
-          title: '编辑时间',
+          title: t('routes.product.saveTime'),
           dataIndex: 'createTime',
           dataIndex: 'createTime',
           slots: { customRender: 'time' },
           slots: { customRender: 'time' },
           width: 150,
           width: 150,
         },
         },
 
 
         {
         {
-          title: '操作',
+          title: t('common.operating'),
           dataIndex: '',
           dataIndex: '',
           fixed: 'right',
           fixed: 'right',
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
@@ -88,7 +90,7 @@
 
 
       // { getForm }
       // { getForm }
       const [registerTable, { reload }] = useTable({
       const [registerTable, { reload }] = useTable({
-        title: '轮播图',
+        title: t('routes.product.pageTitle'),
         api: ListApi,
         api: ListApi,
         columns: columns,
         columns: columns,
         useSearchForm: false,
         useSearchForm: false,
@@ -124,6 +126,7 @@
         registerDrawer,
         registerDrawer,
         handleCreate,
         handleCreate,
         handleEdit,
         handleEdit,
+        t,
       };
       };
     },
     },
   });
   });

+ 7 - 3
src/views/advertisement/listDrawer.vue

@@ -16,6 +16,8 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { schemas } from './schemas';
   import { schemas } from './schemas';
   import { itemUpdateApi, itemSaveApi } from '/@/api/advertisement/list';
   import { itemUpdateApi, itemSaveApi } from '/@/api/advertisement/list';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  const { t } = useI18n();
   export default defineComponent({
   export default defineComponent({
     components: { BasicDrawer, BasicForm },
     components: { BasicDrawer, BasicForm },
     setup(_, { emit }) {
     setup(_, { emit }) {
@@ -35,11 +37,13 @@
           span: 8,
           span: 8,
         },
         },
         submitButtonOptions: {
         submitButtonOptions: {
-          text: '提交',
+          text: t('routes.product.Submit'),
         },
         },
         submitFunc: summitAddDrawer,
         submitFunc: summitAddDrawer,
       });
       });
-      const getTitle = computed(() => (!unref(isUpdate) ? '新增轮播资讯' : '编辑轮播资讯'));
+      const getTitle = computed(() =>
+        !unref(isUpdate) ? t('routes.product.addinfo') : t('routes.product.editinfo'),
+      );
       const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
       const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
         resetFields();
         resetFields();
         setDrawerProps({ confirmLoading: false });
         setDrawerProps({ confirmLoading: false });
@@ -75,7 +79,7 @@
                 loading: false,
                 loading: false,
               },
               },
             });
             });
-            createMessage.success('提交成功!');
+            createMessage.success(t('common.submitState'));
             emit('reload');
             emit('reload');
             closeDrawer();
             closeDrawer();
           });
           });

+ 12 - 11
src/views/advertisement/pads.vue

@@ -2,7 +2,7 @@
   <div class="p-4">
   <div class="p-4">
     <BasicTable @register="registerTable">
     <BasicTable @register="registerTable">
       <template #toolbar>
       <template #toolbar>
-        <a-button type="primary" @click="handleCreate">新增</a-button>
+        <a-button type="primary" @click="handleCreate">{{ t('routes.devices.add') }}</a-button>
       </template>
       </template>
       <template #img="{ record }">
       <template #img="{ record }">
         <TableImg :size="90" :simpleShow="true" :imgList="[record.image]" />
         <TableImg :size="90" :simpleShow="true" :imgList="[record.image]" />
@@ -11,14 +11,14 @@
         <TableAction
         <TableAction
           :actions="[
           :actions="[
             {
             {
-              label: '编辑',
+              label: t('common.edit'),
               onClick: handleEdit.bind(null, record),
               onClick: handleEdit.bind(null, record),
             },
             },
             {
             {
               color: 'error',
               color: 'error',
-              label: '删除',
+              label: t('common.delText'),
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.delConfirm'),
                 confirm: handleDelete.bind(null, record),
                 confirm: handleDelete.bind(null, record),
               },
               },
             },
             },
@@ -52,30 +52,30 @@
       const type = route.fullPath.split('/').pop(); //charAt(route.fullPath.length - 2) || '1';
       const type = route.fullPath.split('/').pop(); //charAt(route.fullPath.length - 2) || '1';
       const columns: BasicColumn[] = [
       const columns: BasicColumn[] = [
         {
         {
-          title: '排序',
+          title: t('component.table.index'),
           dataIndex: 'orderNum',
           dataIndex: 'orderNum',
           fixed: 'left',
           fixed: 'left',
           width: 100,
           width: 100,
         },
         },
         {
         {
-          title: '封面',
+          title: t('routes.product.image'),
           dataIndex: 'image',
           dataIndex: 'image',
           ellipsis: true,
           ellipsis: true,
           slots: { customRender: 'img' },
           slots: { customRender: 'img' },
           width: 230,
           width: 230,
         },
         },
         {
         {
-          title: '标题',
+          title: t('routes.product.title'),
           dataIndex: 'title',
           dataIndex: 'title',
           width: 230,
           width: 230,
         },
         },
         {
         {
-          title: '直播间链接',
+          title: t('routes.scenes.liveRoomUrl'),
           dataIndex: 'sceneUrl',
           dataIndex: 'sceneUrl',
           width: 300,
           width: 300,
         },
         },
         {
         {
-          title: '编辑时间',
+          title: t('routes.product.saveTime'),
           dataIndex: 'createTime',
           dataIndex: 'createTime',
           width: 150,
           width: 150,
           customRender: ({ record }) => {
           customRender: ({ record }) => {
@@ -90,7 +90,7 @@
         },
         },
 
 
         {
         {
-          title: '操作',
+          title: t('common.operating'),
           dataIndex: '',
           dataIndex: '',
           fixed: 'right',
           fixed: 'right',
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
@@ -99,7 +99,7 @@
       ];
       ];
 
 
       const [registerTable, { getForm, reload }] = useTable({
       const [registerTable, { getForm, reload }] = useTable({
-        title: '推荐位',
+        title: t('routes.product.featuredFirst'),
         api: RecommendListApi,
         api: RecommendListApi,
         columns: columns,
         columns: columns,
         // useSearchForm: true,
         // useSearchForm: true,
@@ -140,6 +140,7 @@
         reload,
         reload,
         type,
         type,
         handleDelete,
         handleDelete,
+        t,
       };
       };
     },
     },
   });
   });

+ 9 - 3
src/views/advertisement/padsDrawer.vue

@@ -16,6 +16,7 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { padsSchemas } from './schemas';
   import { padsSchemas } from './schemas';
   import { padsSaveApi, padsUpdateApi } from '/@/api/advertisement/list';
   import { padsSaveApi, padsUpdateApi } from '/@/api/advertisement/list';
+  import { useI18n } from '/@/hooks/web/useI18n';
 
 
   export default defineComponent({
   export default defineComponent({
     components: { BasicDrawer, BasicForm },
     components: { BasicDrawer, BasicForm },
@@ -27,6 +28,7 @@
     },
     },
     emits: ['reload'],
     emits: ['reload'],
     setup(props, { emit }) {
     setup(props, { emit }) {
+      const { t } = useI18n();
       const { createMessage } = useMessage();
       const { createMessage } = useMessage();
       const modelRef = ref({
       const modelRef = ref({
         type: props.type,
         type: props.type,
@@ -45,7 +47,7 @@
           span: 8,
           span: 8,
         },
         },
         submitButtonOptions: {
         submitButtonOptions: {
-          text: '提交',
+          text: t('routes.product.Submit'),
         },
         },
         submitFunc: summitAddDrawer,
         submitFunc: summitAddDrawer,
       });
       });
@@ -69,7 +71,7 @@
                 loading: false,
                 loading: false,
               },
               },
             });
             });
-            createMessage.success('提交成功!');
+            createMessage.success(t('common.submitState'));
             emit('reload');
             emit('reload');
             closeDrawer();
             closeDrawer();
           });
           });
@@ -77,7 +79,11 @@
           console.log('error', error);
           console.log('error', error);
         }
         }
       }
       }
-      const getTitle = computed(() => (!unref(isUpdate) ? '新增推荐位' : '编辑推荐位'));
+      const getTitle = computed(() =>
+        !unref(isUpdate)
+          ? t('routes.product.addFeaturedFirst')
+          : t('routes.product.editFeaturedFirst'),
+      );
       const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
       const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
         resetFields();
         resetFields();
         setDrawerProps({ confirmLoading: false });
         setDrawerProps({ confirmLoading: false });

+ 50 - 9
src/views/advertisement/schemas.ts

@@ -4,13 +4,15 @@ import { FormSchema } from '/@/components/Form';
 // import { h } from 'vue';
 // import { h } from 'vue';
 import { uploadApi } from '/@/api/advertisement/list';
 import { uploadApi } from '/@/api/advertisement/list';
 import { BrandListApi } from '/@/api/order/list';
 import { BrandListApi } from '/@/api/order/list';
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
 
 
 export const padsSchemas: FormSchema[] = [
 export const padsSchemas: FormSchema[] = [
   {
   {
     field: 'image',
     field: 'image',
     component: 'Upload',
     component: 'Upload',
-    label: '封面',
-    rules: [{ required: true, message: '请选择上传文件' }],
+    label: t('routes.product.image'),
+    rules: [{ required: true, message: t('common.uploadMessge') }],
     itemProps: {
     itemProps: {
       validateTrigger: 'blur',
       validateTrigger: 'blur',
     },
     },
@@ -29,16 +31,16 @@ export const padsSchemas: FormSchema[] = [
   {
   {
     field: 'title',
     field: 'title',
     component: 'Input',
     component: 'Input',
-    label: '标题',
+    label: t('routes.product.title'),
     componentProps: {
     componentProps: {
-      placeholder: '标题',
+      placeholder: t('routes.product.title'),
       maxLength: 15,
       maxLength: 15,
     },
     },
     required: true,
     required: true,
   },
   },
   {
   {
     field: 'connectId',
     field: 'connectId',
-    label: '直播间名称',
+    label: t('routes.scenes.liveName'),
     component: 'ApiSelect',
     component: 'ApiSelect',
     required: true,
     required: true,
     itemProps: {
     itemProps: {
@@ -59,15 +61,35 @@ export const padsSchemas: FormSchema[] = [
   },
   },
   {
   {
     field: 'orderNum',
     field: 'orderNum',
-    component: 'Input',
-    label: '排序',
+    component: 'InputNumber',
+    label: t('routes.scenes.sortOrder'),
     defaultValue: 0,
     defaultValue: 0,
     componentProps: {
     componentProps: {
-      placeholder: '推荐排序',
+      maxLength: 5,
+      placeholder: t('routes.product.orderNum'),
       type: 'number',
       type: 'number',
       min: 0,
       min: 0,
     },
     },
     required: true,
     required: true,
+    rules: [
+      {
+        required: true,
+        // @ts-ignore
+        validator: async (rule, value) => {
+          const regPos = /(^[1-9]\d*$)/; // 非负整数
+          // var reg = /\S+@\S+\.\S+/;
+          if (!value) {
+            return Promise.reject(t('routes.product.orderNum1'));
+          }
+          if (!regPos.test(value)) {
+            /* eslint-disable-next-line */
+            return Promise.reject(t('routes.product.orderNum2'));
+          }
+          return Promise.resolve();
+        },
+        trigger: 'change',
+      },
+    ],
   },
   },
   // {
   // {
   //   field: 'connectId',
   //   field: 'connectId',
@@ -84,7 +106,7 @@ export const schemas: FormSchema[] = [
     field: 'image',
     field: 'image',
     component: 'Upload',
     component: 'Upload',
     label: '封面图',
     label: '封面图',
-    rules: [{ required: true, message: '请选择上传文件' }],
+    rules: [{ required: true, message: t('common.uploadMessge') }],
     itemProps: {
     itemProps: {
       validateTrigger: 'blur',
       validateTrigger: 'blur',
     },
     },
@@ -123,6 +145,25 @@ export const schemas: FormSchema[] = [
       min: 0,
       min: 0,
     },
     },
     required: true,
     required: true,
+    rules: [
+      {
+        required: true,
+        // @ts-ignore
+        validator: async (rule, value) => {
+          const regPos = /(^[1-9]\d*$)/; // 非负整数
+          // var reg = /\S+@\S+\.\S+/;
+          if (!value) {
+            return Promise.reject(t('routes.product.orderNum1'));
+          }
+          if (!regPos.test(value)) {
+            /* eslint-disable-next-line */
+            return Promise.reject(t('routes.product.orderNum2'));
+          }
+          return Promise.resolve();
+        },
+        trigger: 'change',
+      },
+    ],
   },
   },
   // {
   // {
   //   field: 'url',
   //   field: 'url',

+ 0 - 11
src/views/bulletin/decoration.vue

@@ -85,17 +85,6 @@
                 const newStatus = checked ? '1' : '0';
                 const newStatus = checked ? '1' : '0';
                 const { createMessage } = useMessage();
                 const { createMessage } = useMessage();
                 createMessage.info(`暂未接入` + newStatus);
                 createMessage.info(`暂未接入` + newStatus);
-                // setRoleStatus(record.id, newStatus)
-                //   .then(() => {
-                //     record.status = newStatus;
-                //     createMessage.success(`已成功修改角色状态`);
-                //   })
-                //   .catch(() => {
-                //     createMessage.error('修改角色状态失败');
-                //   })
-                //   .finally(() => {
-                //     record.pendingStatus = false;
-                //   });
               },
               },
             });
             });
           },
           },

+ 0 - 11
src/views/bulletin/sell.vue

@@ -85,17 +85,6 @@
                 const newStatus = checked ? '1' : '0';
                 const newStatus = checked ? '1' : '0';
                 const { createMessage } = useMessage();
                 const { createMessage } = useMessage();
                 createMessage.info(`暂未接入` + newStatus);
                 createMessage.info(`暂未接入` + newStatus);
-                // setRoleStatus(record.id, newStatus)
-                //   .then(() => {
-                //     record.status = newStatus;
-                //     createMessage.success(`已成功修改角色状态`);
-                //   })
-                //   .catch(() => {
-                //     createMessage.error('修改角色状态失败');
-                //   })
-                //   .finally(() => {
-                //     record.pendingStatus = false;
-                //   });
               },
               },
             });
             });
           },
           },

+ 5 - 5
src/views/corporation/AddCorporationModal.vue

@@ -80,7 +80,7 @@
     },
     },
     {
     {
       field: 'area',
       field: 'area',
-      label: '地区',
+      label: t('routes.corporation.areaText'),
       component: 'ApiCascader',
       component: 'ApiCascader',
       required: true,
       required: true,
       componentProps: {
       componentProps: {
@@ -147,8 +147,8 @@
       component: 'Upload',
       component: 'Upload',
       label: t('routes.corporation.companyLogo'),
       label: t('routes.corporation.companyLogo'),
       required: true,
       required: true,
-      rules: [{ required: true, message: '请选择上传文件' }],
-      helpMessage: '支持png  jpg图片格式',
+      rules: [{ required: true, message: t('common.uploadMessge') }],
+      helpMessage: t('routes.corporation.uploadHelp'),
       itemProps: {
       itemProps: {
         validateTrigger: 'onBlur',
         validateTrigger: 'onBlur',
       },
       },
@@ -173,11 +173,11 @@
       component: 'Upload',
       component: 'Upload',
       label: t('routes.corporation.qualification'),
       label: t('routes.corporation.qualification'),
       required: true,
       required: true,
-      rules: [{ required: true, message: '请选择上传文件' }],
+      rules: [{ required: true, message: t('common.uploadMessge') }],
       itemProps: {
       itemProps: {
         validateTrigger: 'onBlur',
         validateTrigger: 'onBlur',
       },
       },
-      helpMessage: '支持png  jpg图片格式',
+      helpMessage: t('routes.corporation.uploadHelp'),
       componentProps: {
       componentProps: {
         api: uploadLogoApi,
         api: uploadLogoApi,
         maxNumber: 1,
         maxNumber: 1,

+ 22 - 3
src/views/corporation/AddModal.vue

@@ -33,6 +33,25 @@
       componentProps: {
       componentProps: {
         maxLength: 25,
         maxLength: 25,
       },
       },
+      rules: [
+        {
+          required: true,
+          // @ts-ignore
+          validator: async (rule, value) => {
+            var reg_tel = /^[a-zA-Z\u4e00-\u9fa5]+$/;
+            // var reg = /\S+@\S+\.\S+/;
+            if (!value) {
+              return Promise.reject(t('common.userNick'));
+            }
+            if (!reg_tel.test(value)) {
+              /* eslint-disable-next-line */
+              return Promise.reject(t('common.userCorrectNameNick'));
+            }
+            return Promise.resolve();
+          },
+          trigger: 'change',
+        },
+      ],
     },
     },
     {
     {
       field: 'phone',
       field: 'phone',
@@ -67,7 +86,7 @@
     {
     {
       field: 'roleId',
       field: 'roleId',
       component: 'ApiRadioGroup',
       component: 'ApiRadioGroup',
-      label: '角色',
+      label: t('common.roleName'),
       required: true,
       required: true,
       itemProps: {
       itemProps: {
         validateTrigger: 'blur',
         validateTrigger: 'blur',
@@ -122,7 +141,7 @@
         });
         });
 
 
         if (addTips) {
         if (addTips) {
-          return createMessage.error('员工账号已被绑定');
+          return createMessage.error(t('routes.corporation.addTips'));
         }
         }
         //TODO hack parameter
         //TODO hack parameter
         let res = await checkUserAddAble({ phone: values.phone });
         let res = await checkUserAddAble({ phone: values.phone });
@@ -137,7 +156,7 @@
           resetFields();
           resetFields();
           closeModal();
           closeModal();
         } else {
         } else {
-          createMessage.error('员工账号已被绑定');
+          createMessage.error(t('routes.corporation.addTips'));
         }
         }
       };
       };
       function handleVisibleChange(v) {
       function handleVisibleChange(v) {

+ 9 - 9
src/views/corporation/SubaccountModal.vue

@@ -89,7 +89,7 @@
                 // },
                 // },
                 {
                 {
                   icon: 'mdi:account-multiple-remove-outline',
                   icon: 'mdi:account-multiple-remove-outline',
-                  label: '删除',
+                  label: t('common.delText'),
                   onClick: handleDelete.bind(null, record, 'unbond'),
                   onClick: handleDelete.bind(null, record, 'unbond'),
                 },
                 },
               ]"
               ]"
@@ -169,7 +169,7 @@
           dataIndex: 'userName',
           dataIndex: 'userName',
         },
         },
         {
         {
-          title: '角色',
+          title: t('common.roleName'),
           width: 100,
           width: 100,
           dataIndex: 'roleName',
           dataIndex: 'roleName',
         },
         },
@@ -381,7 +381,7 @@
           }
           }
           createConfirm({
           createConfirm({
             iconType: 'warning',
             iconType: 'warning',
-            title: '提示',
+            title: t('common.tips'),
             content: t('routes.devices.unbindWarning'),
             content: t('routes.devices.unbindWarning'),
             onOk: async () => {
             onOk: async () => {
               // tableRef.value.deleteTableDataRecord(item.id);
               // tableRef.value.deleteTableDataRecord(item.id);
@@ -457,16 +457,16 @@
         }
         }
         minNumber.lookNum = lookNum;
         minNumber.lookNum = lookNum;
         minNumber.shotNum = shotNum;
         minNumber.shotNum = shotNum;
-        let obj = {
-          8: '带看&拍摄员工',
-          81: '带看员工',
-          82: '拍摄员工',
-        };
+        // let obj = {
+        //   8: '带看&拍摄员工',
+        //   81: '带看员工',
+        //   82: '拍摄员工',
+        // };
         insertTableDataRecord({
         insertTableDataRecord({
           nickName: newUser.memoName,
           nickName: newUser.memoName,
           userName: newUser.phone,
           userName: newUser.phone,
           phone: newUser.phone,
           phone: newUser.phone,
-          roleName: obj[newUser.roleId],
+          roleName: t('routes.scenes.roleType.1'),
           roleId: newUser.roleId,
           roleId: newUser.roleId,
         });
         });
 
 

+ 39 - 38
src/views/corporation/chargeModal.vue

@@ -2,7 +2,7 @@
   <BasicModal
   <BasicModal
     v-bind="$attrs"
     v-bind="$attrs"
     @register="register"
     @register="register"
-    title="设备充值"
+    :title="t('routes.corporation.pageTitle')"
     @ok="submit"
     @ok="submit"
     @visible-change="handleVisibleChange"
     @visible-change="handleVisibleChange"
   >
   >
@@ -25,41 +25,6 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { addPoint } from '/@/api/corporation/modal';
   import { addPoint } from '/@/api/corporation/modal';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useMessage } from '/@/hooks/web/useMessage';
-  const schemas: FormSchema[] = [
-    {
-      field: 'userName',
-      component: 'Input',
-      label: '充值账号',
-      labelWidth: 100,
-      slot: 'text',
-      colProps: {
-        span: 20,
-      },
-    },
-    {
-      field: 'point',
-      component: 'Input',
-      slot: 'text',
-      label: '当前余额',
-      labelWidth: 100,
-      colProps: {
-        span: 20,
-      },
-      componentProps: {
-        disabled: true,
-      },
-    },
-    {
-      field: 'addPointnumber',
-      component: 'InputNumber',
-      label: '充 值',
-      labelWidth: 100,
-      colProps: {
-        span: 20,
-      },
-      defaultValue: 0,
-    },
-  ];
   export default defineComponent({
   export default defineComponent({
     components: { BasicModal, BasicForm },
     components: { BasicModal, BasicForm },
     props: {
     props: {
@@ -68,6 +33,41 @@
     emits: ['register', 'update'],
     emits: ['register', 'update'],
     setup(props, { emit }) {
     setup(props, { emit }) {
       const { t } = useI18n();
       const { t } = useI18n();
+      const schemas: FormSchema[] = [
+        {
+          field: 'userName',
+          component: 'Input',
+          label: t('routes.corporation.rechargeId'),
+          labelWidth: 100,
+          slot: 'text',
+          colProps: {
+            span: 20,
+          },
+        },
+        {
+          field: 'point',
+          component: 'Input',
+          slot: 'text',
+          label: t('routes.corporation.newPoint'),
+          labelWidth: 100,
+          colProps: {
+            span: 20,
+          },
+          componentProps: {
+            disabled: true,
+          },
+        },
+        {
+          field: 'addPointnumber',
+          component: 'InputNumber',
+          label: t('routes.corporation.addPointnumber'),
+          labelWidth: 100,
+          colProps: {
+            span: 20,
+          },
+          defaultValue: 0,
+        },
+      ];
       const { createConfirm, createMessage } = useMessage();
       const { createConfirm, createMessage } = useMessage();
       const reload = inject('tablereload');
       const reload = inject('tablereload');
       const modelRef = ref({
       const modelRef = ref({
@@ -100,8 +100,8 @@
       async function submit() {
       async function submit() {
         createConfirm({
         createConfirm({
           iconType: 'warning',
           iconType: 'warning',
-          title: '提示',
-          content: '此操作将对该账号进行充值, 是否继续?',
+          title: t('common.tips'),
+          content: t('routes.corporation.rechargeTips'),
           onOk: async () => {
           onOk: async () => {
             saveTable();
             saveTable();
           },
           },
@@ -134,6 +134,7 @@
         registerForm,
         registerForm,
         modelRef,
         modelRef,
         handleVisibleChange,
         handleVisibleChange,
+        t,
       };
       };
     },
     },
   });
   });

+ 2 - 2
src/views/corporation/detailsModal.vue

@@ -95,7 +95,7 @@
         },
         },
         {
         {
           field: 'contacts',
           field: 'contacts',
-          label: '联系人',
+          label: t('routes.corporation.managerName'),
           slot: 'text',
           slot: 'text',
           component: 'Input',
           component: 'Input',
           componentProps: {
           componentProps: {
@@ -214,7 +214,7 @@
             return {
             return {
               field: `ID${index}`,
               field: `ID${index}`,
               component: 'Input',
               component: 'Input',
-              label: '设备ID' + index,
+              label: t('routes.corporation.device') + 'ID' + index,
               itemProps: {
               itemProps: {
                 validateTrigger: 'blur',
                 validateTrigger: 'blur',
               },
               },

+ 1 - 1
src/views/corporation/deviceModal.vue

@@ -126,7 +126,7 @@
           colProps: {
           colProps: {
             span: 8,
             span: 8,
           },
           },
-          helpMessage: '最多批量增加20个!',
+          helpMessage: t('routes.corporation.deviceNumberMax'),
           // componentProps: () => {
           // componentProps: () => {
           //   return {
           //   return {
           //     // xxxx props schema, tableAction, formModel  checkDevice
           //     // xxxx props schema, tableAction, formModel  checkDevice

+ 1 - 1
src/views/corporation/index.vue

@@ -215,7 +215,7 @@
         schemas: [
         schemas: [
           {
           {
             field: 'name',
             field: 'name',
-            label: '企业名称',
+            label: t('routes.corporation.enterpriseName'),
             component: 'Input',
             component: 'Input',
             colProps: {
             colProps: {
               xl: 5,
               xl: 5,

+ 1 - 1
src/views/corporation/verify.vue

@@ -8,7 +8,7 @@
       </template>
       </template>
       <template #no="{ record }">
       <template #no="{ record }">
         <Tag :color="renderTag(record.state, 'color')">
         <Tag :color="renderTag(record.state, 'color')">
-          {{ renderTag(record.state, 'text') || '审核中' }}
+          {{ renderTag(record.state, 'text') || t('routes.corporation.stateName.0') }}
         </Tag>
         </Tag>
       </template>
       </template>
       <template #time="{ record }">
       <template #time="{ record }">

+ 1 - 1
src/views/devices/AddModal.vue

@@ -2,7 +2,7 @@
   <BasicModal
   <BasicModal
     v-bind="$attrs"
     v-bind="$attrs"
     @register="register"
     @register="register"
-    title="新增相机"
+    :title="t('routes.devices.addCameraTitle')"
     @visible-change="handleVisibleChange"
     @visible-change="handleVisibleChange"
     @cancel="resetFields"
     @cancel="resetFields"
     @ok="handleSubmit"
     @ok="handleSubmit"

+ 11 - 11
src/views/devices/list.vue

@@ -159,12 +159,12 @@
           // },
           // },
           {
           {
             field: 'searchKey',
             field: 'searchKey',
-            label: '关键字',
+            label: t('routes.devices.searchKey'),
             labelWidth: 80,
             labelWidth: 80,
             component: 'Input',
             component: 'Input',
             componentProps: {
             componentProps: {
               maxLength: 100,
               maxLength: 100,
-              placeholder: '支持搜索 手机号、sn码',
+              placeholder: t('routes.devices.searchKeyPlaceholder'),
             },
             },
             colProps: {
             colProps: {
               span: 12,
               span: 12,
@@ -212,15 +212,15 @@
       function rendercameraTypeLabel(cameraType: number): string {
       function rendercameraTypeLabel(cameraType: number): string {
         switch (cameraType) {
         switch (cameraType) {
           case 4:
           case 4:
-            return '四维看看Pro八目相机';
+            return t('routes.devices.cameraName.4');
           case 1:
           case 1:
-            return '四维看看Lite双目相机';
+            return t('routes.devices.cameraName.1');
           case 9:
           case 9:
-            return '四维看看双目转台相机';
+            return t('routes.devices.cameraName.9');
           case 10:
           case 10:
-            return '四维看看激光相机';
+            return t('routes.devices.cameraName.10');
           case 6:
           case 6:
-            return '第三方相机';
+            return t('routes.devices.cameraName.6');
           default:
           default:
             return '';
             return '';
         }
         }
@@ -228,13 +228,13 @@
       function renderOwnTypeLabel(type: number): string {
       function renderOwnTypeLabel(type: number): string {
         switch (type) {
         switch (type) {
           case 0:
           case 0:
-            return '正常销售';
+            return t('routes.devices.ownName.0');
           case 2:
           case 2:
-            return '礼品赠送';
+            return t('routes.devices.ownName.2');
           case 1:
           case 1:
-            return '员工自用';
+            return t('routes.devices.ownName.1');
           case 3:
           case 3:
-            return '其它';
+            return t('routes.devices.ownName.3');
           default:
           default:
             return '';
             return '';
         }
         }

+ 15 - 15
src/views/member/list.vue

@@ -45,16 +45,16 @@ weixinOpenid: "oeADe5U9uLeMYsNigq98zdu8J96A"
         <TableAction
         <TableAction
           :actions="[
           :actions="[
             {
             {
-              label: '详情',
+              label: t('common.details'),
               onClick: () => {
               onClick: () => {
                 go(`/order/list/detail/${record.orderNo}`);
                 go(`/order/list/detail/${record.orderNo}`);
               },
               },
             },
             },
             {
             {
-              label: '打印',
+              label: t('common.print'),
               color: 'error',
               color: 'error',
               onClick: () => {
               onClick: () => {
-                createMessage.info(`暂未接入`);
+                createMessage.info(t('common.notConnect'));
               },
               },
             },
             },
           ]"
           ]"
@@ -90,44 +90,44 @@ weixinOpenid: "oeADe5U9uLeMYsNigq98zdu8J96A"
           width: 60,
           width: 60,
         },
         },
         {
         {
-          title: '名称',
+          title: t('routes.member.username'),
           dataIndex: 'username',
           dataIndex: 'username',
           // sorter: true,
           // sorter: true,
           width: 160,
           width: 160,
         },
         },
         {
         {
-          title: '头像',
+          title: t('routes.member.username'),
           dataIndex: 'avatar',
           dataIndex: 'avatar',
           slots: { customRender: 'avatar' },
           slots: { customRender: 'avatar' },
           width: 120,
           width: 120,
         },
         },
         {
         {
-          title: '性别',
+          title: t('routes.member.gender.text'),
           dataIndex: 'gender',
           dataIndex: 'gender',
           slots: { customRender: 'gender' },
           slots: { customRender: 'gender' },
           // sorter: true,
           // sorter: true,
           width: 120,
           width: 120,
         },
         },
         {
         {
-          title: '出生日期',
+          title: t('routes.member.birthday'),
           dataIndex: 'birthday',
           dataIndex: 'birthday',
           slots: { customRender: 'birthday' },
           slots: { customRender: 'birthday' },
           width: 120,
           width: 120,
         },
         },
         {
         {
-          title: '最后登录时间',
+          title: t('routes.member.lastLoginTime'),
           dataIndex: 'lastLoginTime',
           dataIndex: 'lastLoginTime',
           slots: { customRender: 'lastLoginTime' },
           slots: { customRender: 'lastLoginTime' },
           // sorter: true,
           // sorter: true,
           width: 120,
           width: 120,
         },
         },
         {
         {
-          title: '微信名',
+          title: t('routes.member.nickname'),
           dataIndex: 'nickname',
           dataIndex: 'nickname',
           width: 120,
           width: 120,
         },
         },
         {
         {
-          title: '手机号',
+          title: t('routes.corporation.phone'),
           dataIndex: 'mobile',
           dataIndex: 'mobile',
           width: 120,
           width: 120,
         },
         },
@@ -138,7 +138,7 @@ weixinOpenid: "oeADe5U9uLeMYsNigq98zdu8J96A"
         schemas: [
         schemas: [
           {
           {
             field: 'username',
             field: 'username',
-            label: '名称',
+            label: t('routes.member.username'),
             component: 'Input',
             component: 'Input',
             componentProps: {
             componentProps: {
               maxLength: 100,
               maxLength: 100,
@@ -152,7 +152,7 @@ weixinOpenid: "oeADe5U9uLeMYsNigq98zdu8J96A"
       };
       };
 
 
       const [registerTable] = useTable({
       const [registerTable] = useTable({
-        title: '微信用户列表',
+        title: t('routes.member.pageTitle'),
         api: ListApi,
         api: ListApi,
         columns: columns,
         columns: columns,
         useSearchForm: true,
         useSearchForm: true,
@@ -174,11 +174,11 @@ weixinOpenid: "oeADe5U9uLeMYsNigq98zdu8J96A"
       function renderGenderLabel(gender: number): string {
       function renderGenderLabel(gender: number): string {
         switch (gender) {
         switch (gender) {
           case 0:
           case 0:
-            return '女';
+            return t('routes.member.gender.0');
           case 1:
           case 1:
-            return '男';
+            return t('routes.member.gender.1');
           default:
           default:
-            return '未知';
+            return t('routes.member.gender.2');
         }
         }
       }
       }
 
 

+ 15 - 14
src/views/product/addCategoryModal.vue

@@ -7,7 +7,7 @@ name: "test"
 type: 0
 type: 0
 wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-oss-process=image/resize,m_fixed,w_100,h_100" -->
 wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-oss-process=image/resize,m_fixed,w_100,h_100" -->
 <template>
 <template>
-  <BasicModal v-bind="$attrs" @register="register" title="新 增" @ok="handleOk">
+  <BasicModal v-bind="$attrs" @register="register" :title="t('routes.staff.add')" @ok="handleOk">
     <div class="pt-3px pr-3px">
     <div class="pt-3px pr-3px">
       <BasicForm @register="registerForm" />
       <BasicForm @register="registerForm" />
     </div>
     </div>
@@ -20,13 +20,14 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useMessage } from '/@/hooks/web/useMessage';
-
+  import { useI18n } from '/@/hooks/web/useI18n';
+  const { t } = useI18n();
   const isLevel2 = (type: string) => type === 'L2';
   const isLevel2 = (type: string) => type === 'L2';
   const schemas: FormSchema[] = [
   const schemas: FormSchema[] = [
     {
     {
       field: 'name',
       field: 'name',
       component: 'Input',
       component: 'Input',
-      label: '分类名称',
+      label: t('routes.product.name'),
       colProps: {
       colProps: {
         span: 24,
         span: 24,
       },
       },
@@ -38,7 +39,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
     {
     {
       field: 'level',
       field: 'level',
       component: 'RadioGroup',
       component: 'RadioGroup',
-      label: '级别',
+      label: t('routes.product.level.name'),
       defaultValue: 'L1',
       defaultValue: 'L1',
       colProps: {
       colProps: {
         span: 24,
         span: 24,
@@ -46,11 +47,11 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
       componentProps: {
       componentProps: {
         options: [
         options: [
           {
           {
-            label: '一级分类',
+            label: t('routes.product.level.1'),
             value: 'L1',
             value: 'L1',
           },
           },
           {
           {
-            label: '二级分类',
+            label: t('routes.product.level.2'),
             value: 'L2',
             value: 'L2',
           },
           },
         ],
         ],
@@ -60,7 +61,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
     {
     {
       field: 'parentId',
       field: 'parentId',
       component: 'ApiSelect',
       component: 'ApiSelect',
-      label: '上级分类',
+      label: t('routes.product.parentId'),
       ifShow: ({ values }) => isLevel2(values.level),
       ifShow: ({ values }) => isLevel2(values.level),
       colProps: {
       colProps: {
         span: 18,
         span: 18,
@@ -79,7 +80,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
     {
     {
       field: 'isShow',
       field: 'isShow',
       component: 'RadioGroup',
       component: 'RadioGroup',
-      label: '是否显示',
+      label: t('routes.scenes.isShow'),
       defaultValue: '1',
       defaultValue: '1',
       colProps: {
       colProps: {
         span: 24,
         span: 24,
@@ -87,11 +88,11 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
       componentProps: {
       componentProps: {
         options: [
         options: [
           {
           {
-            label: '显示',
+            label: t('routes.product.isShow.1'),
             value: '1',
             value: '1',
           },
           },
           {
           {
-            label: '不显示',
+            label: t('routes.product.isShow.0'),
             value: '0',
             value: '0',
           },
           },
         ],
         ],
@@ -100,7 +101,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
     {
     {
       field: 'sortOrder',
       field: 'sortOrder',
       component: 'InputNumber',
       component: 'InputNumber',
-      label: '排序',
+      label: t('routes.scenes.sortOrder'),
       defaultValue: 1,
       defaultValue: 1,
       colProps: {
       colProps: {
         span: 24,
         span: 24,
@@ -114,7 +115,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
       component: 'Upload',
       component: 'Upload',
       label: '手机banner',
       label: '手机banner',
       show: false,
       show: false,
-      rules: [{ required: true, message: '请选择上传文件' }],
+      rules: [{ required: true, message: t('common.uploadMessge') }],
       componentProps: {
       componentProps: {
         api: uploadBannerApi,
         api: uploadBannerApi,
         maxNumber: 1,
         maxNumber: 1,
@@ -169,7 +170,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
             });
             });
             emit('update');
             emit('update');
             resetFields();
             resetFields();
-            createMessage.success('操作成功');
+            createMessage.success(t('common.optSuccess'));
             closeModal();
             closeModal();
           }
           }
         } catch (error) {
         } catch (error) {
@@ -178,7 +179,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
         // let res = await saveItemApi(data);
         // let res = await saveItemApi(data);
       }
       }
 
 
-      return { register, schemas, registerForm, handleOk };
+      return { register, schemas, registerForm, handleOk, t };
     },
     },
   });
   });
 </script>
 </script>

+ 4 - 4
src/views/product/addModal.vue

@@ -18,11 +18,12 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  const { t } = useI18n();
   const schemas: FormSchema[] = [
   const schemas: FormSchema[] = [
     {
     {
       field: 'name',
       field: 'name',
       component: 'Input',
       component: 'Input',
-      label: '商品属性',
+      label: t('routes.dashboard.productRef'),
       colProps: {
       colProps: {
         span: 18,
         span: 18,
       },
       },
@@ -34,7 +35,7 @@
     {
     {
       field: 'sortOrder',
       field: 'sortOrder',
       component: 'InputNumber',
       component: 'InputNumber',
-      label: '排序',
+      label: t('routes.scenes.sortOrder'),
       defaultValue: 1,
       defaultValue: 1,
       rules: [
       rules: [
         {
         {
@@ -42,7 +43,7 @@
           // @ts-ignore
           // @ts-ignore
           validator: async (rule, value) => {
           validator: async (rule, value) => {
             if (value && (value < 0 || value > 1000)) {
             if (value && (value < 0 || value > 1000)) {
-              return Promise.reject('请输入正确的排序');
+              return Promise.reject(t('routes.product.sortOrderTips'));
             }
             }
             return Promise.resolve();
             return Promise.resolve();
           },
           },
@@ -63,7 +64,6 @@
     setup(_, context) {
     setup(_, context) {
       const modelRef = ref({});
       const modelRef = ref({});
       const { createMessage } = useMessage();
       const { createMessage } = useMessage();
-      const { t } = useI18n();
       const [
       const [
         registerForm,
         registerForm,
         {
         {

+ 15 - 13
src/views/product/category.vue

@@ -2,7 +2,9 @@
   <div>
   <div>
     <BasicTable @register="registerTable">
     <BasicTable @register="registerTable">
       <template #toolbar v-if="!getCheckRole('tourist')">
       <template #toolbar v-if="!getCheckRole('tourist')">
-        <a-button primary color="error" @click="handleCreate"> 新增商品分类</a-button>
+        <a-button primary color="error" @click="handleCreate">
+          {{ t('routes.product.createType') }}</a-button
+        >
         <!-- <a-button ghost color="warning" @click="expandAll">展开全部</a-button>
         <!-- <a-button ghost color="warning" @click="expandAll">展开全部</a-button>
         <a-button type="primary" @click="collapseAll">折叠全部</a-button> -->
         <a-button type="primary" @click="collapseAll">折叠全部</a-button> -->
       </template>
       </template>
@@ -10,14 +12,14 @@
         <TableAction
         <TableAction
           :actions="[
           :actions="[
             {
             {
-              label: '编辑',
+              label: t('common.edit'),
               onClick: handleEdit.bind(null, record),
               onClick: handleEdit.bind(null, record),
             },
             },
             {
             {
               color: 'error',
               color: 'error',
-              label: '删除',
+              label: t('common.delText'),
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.delConfirm'),
                 confirm: handleDelete.bind(null, record),
                 confirm: handleDelete.bind(null, record),
               },
               },
             },
             },
@@ -61,30 +63,30 @@
           width: 100,
           width: 100,
         },
         },
         {
         {
-          title: '分类名称',
+          title: t('routes.product.name'),
           dataIndex: 'name',
           dataIndex: 'name',
           width: 200,
           width: 200,
           align: 'left',
           align: 'left',
         },
         },
         {
         {
-          title: '排序',
+          title: t('routes.scenes.sortOrder'),
           dataIndex: 'sortOrder',
           dataIndex: 'sortOrder',
           width: 50,
           width: 50,
         },
         },
         {
         {
-          title: '级数',
+          title: t('routes.product.levelNum'),
           dataIndex: 'level',
           dataIndex: 'level',
           width: 50,
           width: 50,
         },
         },
         {
         {
-          title: '状态',
+          title: t('common.state'),
           dataIndex: 'isShow',
           dataIndex: 'isShow',
           width: 80,
           width: 80,
           customRender: ({ record }) => {
           customRender: ({ record }) => {
             const status = record.isShow;
             const status = record.isShow;
             const enable = status === 1;
             const enable = status === 1;
             const color = enable ? 'green' : 'red';
             const color = enable ? 'green' : 'red';
-            const text = enable ? '显示' : '不显示';
+            const text = enable ? t('routes.product.isShow.1') : t('routes.product.isShow.0');
             return h(Tag, { color: color }, () => text);
             return h(Tag, { color: color }, () => text);
           },
           },
         },
         },
@@ -97,7 +99,7 @@
       const [registeraddCategoryModal, { openModal: openAddCategoryModal }] = useModal();
       const [registeraddCategoryModal, { openModal: openAddCategoryModal }] = useModal();
       const [registerEditCategoryModal, { openModal: openEditategoryModal }] = useModal();
       const [registerEditCategoryModal, { openModal: openEditategoryModal }] = useModal();
       const [registerTable, { reload, expandAll, collapseAll }] = useTable({
       const [registerTable, { reload, expandAll, collapseAll }] = useTable({
-        title: '商品分类',
+        title: t('routes.dashboard.productCategory'),
         api: categoryApi,
         api: categoryApi,
         columns: columns,
         columns: columns,
         isTreeTable: true,
         isTreeTable: true,
@@ -107,10 +109,10 @@
           schemas: [
           schemas: [
             {
             {
               field: 'name',
               field: 'name',
-              label: '分类名称',
+              label: t('routes.product.name'),
               component: 'Input',
               component: 'Input',
               componentProps: {
               componentProps: {
-                placeholder: '请输入分类名称',
+                placeholder: t('routes.product.nameMessge'),
                 maxLength: 100,
                 maxLength: 100,
               },
               },
               colProps: {
               colProps: {
@@ -129,7 +131,7 @@
         actionColumn: {
         actionColumn: {
           ifShow: !getCheckRole('tourist'),
           ifShow: !getCheckRole('tourist'),
           width: 100,
           width: 100,
-          title: '操作',
+          title: t('common.operating'),
           dataIndex: 'action',
           dataIndex: 'action',
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
           fixed: undefined,
           fixed: undefined,

+ 33 - 31
src/views/product/drawer.data.ts

@@ -7,11 +7,13 @@ import { Switch } from 'ant-design-vue';
 import { useMessage } from '/@/hooks/web/useMessage';
 import { useMessage } from '/@/hooks/web/useMessage';
 import { Tinymce } from '/@/components/Tinymce/index';
 import { Tinymce } from '/@/components/Tinymce/index';
 import { BrandListApi } from '/@/api/order/list';
 import { BrandListApi } from '/@/api/order/list';
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
 
 
 export const formSchema: FormSchema[] = [
 export const formSchema: FormSchema[] = [
   {
   {
     field: 'categoryId',
     field: 'categoryId',
-    label: '商品分类',
+    label: t('routes.dashboard.productCategory'),
     component: 'ApiTreeSelect',
     component: 'ApiTreeSelect',
     required: true,
     required: true,
     componentProps: {
     componentProps: {
@@ -42,7 +44,7 @@ export const formSchema: FormSchema[] = [
   // },
   // },
   {
   {
     field: 'name',
     field: 'name',
-    label: '商品名称',
+    label: t('routes.product.tradeName'),
     component: 'Input',
     component: 'Input',
     required: true,
     required: true,
     componentProps: {
     componentProps: {
@@ -51,7 +53,7 @@ export const formSchema: FormSchema[] = [
   },
   },
   {
   {
     field: 'goodsSimpleDesc',
     field: 'goodsSimpleDesc',
-    label: '商品描述',
+    label: t('routes.product.goodsSimpleDesc'),
     component: 'Input',
     component: 'Input',
     required: true,
     required: true,
     componentProps: {
     componentProps: {
@@ -60,7 +62,7 @@ export const formSchema: FormSchema[] = [
   },
   },
   {
   {
     field: 'brandId',
     field: 'brandId',
-    label: '直播间名称',
+    label: t('routes.scenes.liveName'),
     component: 'ApiSelect',
     component: 'ApiSelect',
     itemProps: {
     itemProps: {
       validateTrigger: 'blur',
       validateTrigger: 'blur',
@@ -80,10 +82,10 @@ export const formSchema: FormSchema[] = [
   {
   {
     field: 'realShopUrl',
     field: 'realShopUrl',
     component: 'Input',
     component: 'Input',
-    label: '购买链接',
+    label: t('routes.product.realShopUrl'),
     renderComponentContent: () => {
     renderComponentContent: () => {
       return {
       return {
-        suffix: () => '仅支持京东链接',
+        suffix: () => t('routes.product.realShopUrlMessge'),
       };
       };
     },
     },
     componentProps: {
     componentProps: {
@@ -101,7 +103,7 @@ export const formSchema: FormSchema[] = [
             if (reg.test(value) && value.includes('.jd.')) {
             if (reg.test(value) && value.includes('.jd.')) {
               resolve();
               resolve();
             } else {
             } else {
-              reject('不是京东链接!!');
+              reject(t('routes.product.realShopUrlMessge'));
             }
             }
           });
           });
         },
         },
@@ -110,13 +112,13 @@ export const formSchema: FormSchema[] = [
   },
   },
   {
   {
     field: 'goodsgg',
     field: 'goodsgg',
-    label: '商品规格',
+    label: t('routes.product.goodsgg'),
     slot: 'goodsgg',
     slot: 'goodsgg',
     component: 'Input',
     component: 'Input',
   },
   },
   {
   {
     field: 'productList',
     field: 'productList',
-    label: '规格明细',
+    label: t('routes.product.productList'),
     slot: 'detailed',
     slot: 'detailed',
     rules: [
     rules: [
       {
       {
@@ -125,7 +127,7 @@ export const formSchema: FormSchema[] = [
           console.log('validator', value);
           console.log('validator', value);
           return new Promise((resolve, reject) => {
           return new Promise((resolve, reject) => {
             if (!value) {
             if (!value) {
-              reject('请选生成规格明细!!');
+              reject(t('routes.product.productListMessge'));
             }
             }
             const check =
             const check =
               value &&
               value &&
@@ -152,7 +154,7 @@ export const formSchema: FormSchema[] = [
             if (check) {
             if (check) {
               resolve();
               resolve();
             } else {
             } else {
-              reject('请输入商品明细!!');
+              reject(t('routes.product.productListMessge'));
             }
             }
           });
           });
         },
         },
@@ -162,14 +164,14 @@ export const formSchema: FormSchema[] = [
   },
   },
   {
   {
     field: 'isOnSale',
     field: 'isOnSale',
-    label: '是否上架',
+    label: t('routes.product.isOnSale'),
     component: 'Switch',
     component: 'Switch',
   },
   },
   {
   {
     field: 'primaryPicUrl',
     field: 'primaryPicUrl',
     component: 'Upload',
     component: 'Upload',
-    label: '主图',
-    rules: [{ required: true, message: '请选择上传文件' }],
+    label: t('routes.product.primaryPicUrl'),
+    rules: [{ required: true, message: t('common.uploadMessge') }],
     itemProps: {
     itemProps: {
       validateTrigger: 'blur',
       validateTrigger: 'blur',
     },
     },
@@ -187,11 +189,11 @@ export const formSchema: FormSchema[] = [
   {
   {
     field: 'listPicUrl',
     field: 'listPicUrl',
     component: 'Upload',
     component: 'Upload',
-    label: '列表图',
+    label: t('routes.product.listPicUrl'),
     itemProps: {
     itemProps: {
       validateTrigger: 'blur',
       validateTrigger: 'blur',
     },
     },
-    rules: [{ required: true, message: '请选择上传文件' }],
+    rules: [{ required: true, message: t('common.uploadMessge') }],
     componentProps: {
     componentProps: {
       api: uploadApi,
       api: uploadApi,
       maxSize: 5,
       maxSize: 5,
@@ -220,7 +222,7 @@ export const formSchema: FormSchema[] = [
   // },
   // },
   {
   {
     field: 'goodsDesc',
     field: 'goodsDesc',
-    label: '商品描述',
+    label: t('routes.product.goodsSimpleDesc'),
     component: 'Input',
     component: 'Input',
     render: ({ model, field }) => {
     render: ({ model, field }) => {
       return h(Tinymce, {
       return h(Tinymce, {
@@ -242,61 +244,61 @@ export const columns: BasicColumn[] = [
     width: 60,
     width: 60,
   },
   },
   {
   {
-    title: '商品名称',
+    title: t('routes.product.tradeName'),
     dataIndex: 'name',
     dataIndex: 'name',
 
 
     width: 160,
     width: 160,
   },
   },
   {
   {
-    title: '商品描述',
+    title: t('routes.product.goodsSimpleDesc'),
     dataIndex: 'desc',
     dataIndex: 'desc',
     width: 150,
     width: 150,
   },
   },
   {
   {
-    title: '购买链接',
+    title: t('routes.product.realShopUrl'),
     dataIndex: 'link',
     dataIndex: 'link',
     slots: { customRender: 'link' },
     slots: { customRender: 'link' },
     width: 150,
     width: 150,
   },
   },
   {
   {
-    title: '商品分类',
+    title: t('routes.dashboard.productCategory'),
     dataIndex: 'productType',
     dataIndex: 'productType',
     slots: { customRender: 'productType' },
     slots: { customRender: 'productType' },
     sorter: true,
     sorter: true,
     width: 120,
     width: 120,
   },
   },
   {
   {
-    title: '直播间名称',
+    title: t('routes.scenes.liveName'),
     dataIndex: 'steamRoom.name',
     dataIndex: 'steamRoom.name',
     sorter: true,
     sorter: true,
     width: 120,
     width: 120,
   },
   },
   {
   {
-    title: '零售价格',
+    title: t('routes.product.unit'),
     dataIndex: 'unit',
     dataIndex: 'unit',
     sorter: true,
     sorter: true,
     width: 80,
     width: 80,
   },
   },
   {
   {
-    title: '销售量',
+    title: t('routes.product.amount'),
     dataIndex: 'amount',
     dataIndex: 'amount',
     sorter: true,
     sorter: true,
     width: 80,
     width: 80,
   },
   },
   {
   {
-    title: '市场价',
+    title: t('routes.product.marketingUnit'),
     dataIndex: 'marketingUnit',
     dataIndex: 'marketingUnit',
     sorter: true,
     sorter: true,
     width: 80,
     width: 80,
   },
   },
   {
   {
-    title: '下单时间',
+    title: t('routes.product.createTime'),
     dataIndex: 'createTime',
     dataIndex: 'createTime',
     sorter: true,
     sorter: true,
     width: 140,
     width: 140,
   },
   },
   {
   {
-    title: '上架状态',
+    title: t('routes.product.isLaunched'),
     dataIndex: 'isLaunched',
     dataIndex: 'isLaunched',
     width: 180,
     width: 180,
     customRender: ({ record }) => {
     customRender: ({ record }) => {
@@ -305,20 +307,20 @@ export const columns: BasicColumn[] = [
       }
       }
       return h(Switch, {
       return h(Switch, {
         checked: record.isLaunched,
         checked: record.isLaunched,
-        checkedChildren: '上架',
-        unCheckedChildren: '下架',
+        checkedChildren: t('routes.product.onSale.1'),
+        unCheckedChildren: t('routes.product.onSale.0'),
         loading: false,
         loading: false,
         onChange(checked: boolean) {
         onChange(checked: boolean) {
           record.pendingStatus = true;
           record.pendingStatus = true;
           const newStatus = checked ? '1' : '0';
           const newStatus = checked ? '1' : '0';
           const { createMessage } = useMessage();
           const { createMessage } = useMessage();
-          createMessage.info(`暂未接入` + newStatus);
+          createMessage.info(t('routes.product.onSale.9') + newStatus);
         },
         },
       });
       });
     },
     },
   },
   },
   {
   {
-    title: '操作',
+    title: t('common.operating'),
     dataIndex: '',
     dataIndex: '',
     slots: { customRender: 'action' },
     slots: { customRender: 'action' },
     fixed: 'right',
     fixed: 'right',

+ 13 - 13
src/views/product/editCategoryModal.vue

@@ -7,7 +7,7 @@ name: "test"
 type: 0
 type: 0
 wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-oss-process=image/resize,m_fixed,w_100,h_100" -->
 wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-oss-process=image/resize,m_fixed,w_100,h_100" -->
 <template>
 <template>
-  <BasicModal v-bind="$attrs" @register="register" title="编  辑" @ok="handleOk">
+  <BasicModal v-bind="$attrs" @register="register" :title="t('common.edit')" @ok="handleOk">
     <div class="pt-3px pr-3px">
     <div class="pt-3px pr-3px">
       <BasicForm @register="registerForm" />
       <BasicForm @register="registerForm" />
     </div>
     </div>
@@ -34,7 +34,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
     {
     {
       field: 'name',
       field: 'name',
       component: 'Input',
       component: 'Input',
-      label: '分类名称',
+      label: t('routes.product.name'),
       colProps: {
       colProps: {
         span: 24,
         span: 24,
       },
       },
@@ -46,7 +46,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
     {
     {
       field: 'level',
       field: 'level',
       component: 'RadioGroup',
       component: 'RadioGroup',
-      label: '级别',
+      label: t('routes.product.level.name'),
       defaultValue: 'L1',
       defaultValue: 'L1',
       colProps: {
       colProps: {
         span: 24,
         span: 24,
@@ -54,11 +54,11 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
       componentProps: {
       componentProps: {
         options: [
         options: [
           {
           {
-            label: '一级分类',
+            label: t('routes.product.level.1'),
             value: 'L1',
             value: 'L1',
           },
           },
           {
           {
-            label: '二级分类',
+            label: t('routes.product.level.2'),
             value: 'L2',
             value: 'L2',
           },
           },
         ],
         ],
@@ -68,7 +68,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
     {
     {
       field: 'parentId',
       field: 'parentId',
       component: 'ApiSelect',
       component: 'ApiSelect',
-      label: '上级分类',
+      label: t('routes.product.parentId'),
       ifShow: ({ values }) => isLevel2(values.level),
       ifShow: ({ values }) => isLevel2(values.level),
       colProps: {
       colProps: {
         span: 18,
         span: 18,
@@ -86,7 +86,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
     {
     {
       field: 'isShow',
       field: 'isShow',
       component: 'RadioGroup',
       component: 'RadioGroup',
-      label: '是否显示',
+      label: t('routes.scenes.isShow'),
       defaultValue: '1',
       defaultValue: '1',
       colProps: {
       colProps: {
         span: 24,
         span: 24,
@@ -94,11 +94,11 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
       componentProps: {
       componentProps: {
         options: [
         options: [
           {
           {
-            label: '显示',
+            label: t('routes.product.isShow.1'),
             value: '1',
             value: '1',
           },
           },
           {
           {
-            label: '不显示',
+            label: t('routes.product.isShow.0'),
             value: '0',
             value: '0',
           },
           },
         ],
         ],
@@ -107,7 +107,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
     {
     {
       field: 'sortOrder',
       field: 'sortOrder',
       component: 'InputNumber',
       component: 'InputNumber',
-      label: '排序',
+      label: t('routes.scenes.sortOrder'),
       defaultValue: 1,
       defaultValue: 1,
       colProps: {
       colProps: {
         span: 24,
         span: 24,
@@ -120,8 +120,8 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
       field: 'wapBannerUrl',
       field: 'wapBannerUrl',
       component: 'Upload',
       component: 'Upload',
       show: false,
       show: false,
-      label: '手机banner',
-      rules: [{ required: true, message: '请选择上传文件' }],
+      label: t('routes.product.wapBannerUrl'),
+      rules: [{ required: true, message: t('common.uploadMessge') }],
       itemProps: {
       itemProps: {
         validateTrigger: 'blur',
         validateTrigger: 'blur',
       },
       },
@@ -209,7 +209,7 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
         // let res = await saveItemApi(data);
         // let res = await saveItemApi(data);
       }
       }
 
 
-      return { register, schemas, registerForm, handleOk };
+      return { register, schemas, registerForm, handleOk, t };
     },
     },
   });
   });
 </script>
 </script>

+ 7 - 6
src/views/product/goodsSpecs.vue

@@ -23,7 +23,7 @@
         />
         />
       </template>
       </template>
       <template #addAttribute="{ field }">
       <template #addAttribute="{ field }">
-        <a-button @click="addBut(field)"> 添加属性值 </a-button>
+        <a-button @click="addBut(field)"> {{ t('routes.product.addAttribute') }} </a-button>
       </template>
       </template>
       <template #formFooter>
       <template #formFooter>
         <div>
         <div>
@@ -31,9 +31,9 @@
             :disabled="Object.keys(ggList.list)?.length > 2"
             :disabled="Object.keys(ggList.list)?.length > 2"
             style="margin-right: 30px"
             style="margin-right: 30px"
             @click="addBut"
             @click="addBut"
-            >添加规格项目</a-button
+            >{{ t('routes.product.addSpecs') }}</a-button
           >
           >
-          <a-button @click="handleSubmit">生成规格明细</a-button>
+          <a-button @click="handleSubmit">{{ t('routes.product.addSubmit') }}</a-button>
         </div>
         </div>
       </template>
       </template>
     </BasicForm>
     </BasicForm>
@@ -46,7 +46,8 @@
   // import { uploadApi } from '/@/api/advertisement/list';
   // import { uploadApi } from '/@/api/advertisement/list';
   // import { useMessage } from '/@/hooks/web/useMessage';
   // import { useMessage } from '/@/hooks/web/useMessage';
   import { queryAll } from '/@/api/product/list';
   import { queryAll } from '/@/api/product/list';
-
+  import { useI18n } from '/@/hooks/web/useI18n';
+  const { t } = useI18n();
   interface valList {
   interface valList {
     name: string;
     name: string;
     // picUrl: string;
     // picUrl: string;
@@ -94,7 +95,7 @@
         let parentList: FormSchema[] = [
         let parentList: FormSchema[] = [
           {
           {
             field: 'name_' + number,
             field: 'name_' + number,
-            label: '商品属性',
+            label: t('routes.dashboard.productRef'),
             component: 'ApiTreeSelect',
             component: 'ApiTreeSelect',
             colProps: {
             colProps: {
               span: 18,
               span: 18,
@@ -130,7 +131,7 @@
         let list: FormSchema[] = [
         let list: FormSchema[] = [
           {
           {
             field: 'goodsSn_' + number + '_' + val,
             field: 'goodsSn_' + number + '_' + val,
-            label: '规格值',
+            label: t('routes.product.goodsSn'),
             component: 'Input',
             component: 'Input',
             required: true,
             required: true,
             colProps: {
             colProps: {

+ 15 - 15
src/views/product/list.data.ts

@@ -8,12 +8,13 @@ import { useI18n } from '/@/hooks/web/useI18n';
 import { useUserStore } from '/@/store/modules/user';
 import { useUserStore } from '/@/store/modules/user';
 const userStore = useUserStore();
 const userStore = useUserStore();
 const { getCheckRole } = userStore;
 const { getCheckRole } = userStore;
+const { t } = useI18n();
 export const searchForm: Partial<FormProps> = {
 export const searchForm: Partial<FormProps> = {
   labelWidth: 100,
   labelWidth: 100,
   schemas: [
   schemas: [
     {
     {
       field: 'name',
       field: 'name',
-      label: '商品名称',
+      label: t('routes.product.tradeName'),
       component: 'Input',
       component: 'Input',
       componentProps: {
       componentProps: {
         placeholder: '请输入商品名称',
         placeholder: '请输入商品名称',
@@ -26,7 +27,7 @@ export const searchForm: Partial<FormProps> = {
     },
     },
     {
     {
       field: 'brandName',
       field: 'brandName',
-      label: '直播间名称',
+      label: t('routes.scenes.liveName'),
       component: 'Input',
       component: 'Input',
       componentProps: {
       componentProps: {
         placeholder: '请输入直播间名称',
         placeholder: '请输入直播间名称',
@@ -47,7 +48,7 @@ export const columns: BasicColumn[] = [
   //   width: 60,
   //   width: 60,
   // },
   // },
   {
   {
-    title: '商品名称',
+    title: t('routes.product.tradeName'),
     dataIndex: 'name',
     dataIndex: 'name',
     width: 160,
     width: 160,
   },
   },
@@ -57,20 +58,20 @@ export const columns: BasicColumn[] = [
   //   width: 150,
   //   width: 150,
   // },
   // },
   {
   {
-    title: '购买链接',
+    title: t('routes.product.realShopUrl'),
     dataIndex: 'realShopUrl',
     dataIndex: 'realShopUrl',
     slots: { customRender: 'realShopUrl' },
     slots: { customRender: 'realShopUrl' },
     width: 150,
     width: 150,
   },
   },
   {
   {
-    title: '商品分类',
+    title: t('routes.dashboard.productCategory'),
     dataIndex: 'categoryName',
     dataIndex: 'categoryName',
     // slots: { customRender: 'productType' },
     // slots: { customRender: 'productType' },
     sorter: true,
     sorter: true,
     width: 120,
     width: 120,
   },
   },
   {
   {
-    title: '直播间名称',
+    title: t('routes.scenes.liveName'),
     dataIndex: 'brandName',
     dataIndex: 'brandName',
     ellipsis: true,
     ellipsis: true,
     // customRender: ({ record }) => {
     // customRender: ({ record }) => {
@@ -80,32 +81,32 @@ export const columns: BasicColumn[] = [
     width: 120,
     width: 120,
   },
   },
   {
   {
-    title: '销售价',
+    title: t('routes.product.salesPrice'),
     dataIndex: 'retailPrice',
     dataIndex: 'retailPrice',
     sorter: true,
     sorter: true,
     width: 80,
     width: 80,
   },
   },
   {
   {
-    title: '销售量',
+    title: t('routes.product.amount'),
     dataIndex: 'sellVolume',
     dataIndex: 'sellVolume',
     sorter: true,
     sorter: true,
     width: 80,
     width: 80,
   },
   },
   {
   {
-    title: '市场价',
+    title: t('routes.product.marketingUnit'),
     dataIndex: 'marketPrice',
     dataIndex: 'marketPrice',
     sorter: true,
     sorter: true,
     width: 80,
     width: 80,
   },
   },
   {
   {
-    title: '创建时间',
+    title: t('routes.product.addTime'),
     dataIndex: 'addTime',
     dataIndex: 'addTime',
     slots: { customRender: 'addTime' },
     slots: { customRender: 'addTime' },
     sorter: true,
     sorter: true,
     width: 140,
     width: 140,
   },
   },
   {
   {
-    title: '上架状态',
+    title: t('routes.product.isLaunched'),
     dataIndex: 'isOnSale',
     dataIndex: 'isOnSale',
     width: 180,
     width: 180,
     customRender: ({ record }) => {
     customRender: ({ record }) => {
@@ -114,15 +115,14 @@ export const columns: BasicColumn[] = [
       }
       }
       return h(Switch, {
       return h(Switch, {
         checked: record.isOnSale === 1,
         checked: record.isOnSale === 1,
-        checkedChildren: '上架',
-        unCheckedChildren: '下架',
+        checkedChildren: t('routes.product.onSale.1'),
+        unCheckedChildren: t('routes.product.onSale.0'),
         loading: false,
         loading: false,
         onChange: async (checked: boolean) => {
         onChange: async (checked: boolean) => {
           record.pendingStatus = true;
           record.pendingStatus = true;
           const id: string = record.id || '';
           const id: string = record.id || '';
           const newStatus = checked ? 1 : 0;
           const newStatus = checked ? 1 : 0;
           const { createMessage } = useMessage();
           const { createMessage } = useMessage();
-          const { t } = useI18n();
           if (checked) {
           if (checked) {
             Reflect.set(record, 'isOnSale', newStatus);
             Reflect.set(record, 'isOnSale', newStatus);
             await EnSaleApi([id]);
             await EnSaleApi([id]);
@@ -137,7 +137,7 @@ export const columns: BasicColumn[] = [
     },
     },
   },
   },
   {
   {
-    title: '操作',
+    title: t('common.operating'),
     dataIndex: '',
     dataIndex: '',
     slots: { customRender: 'action' },
     slots: { customRender: 'action' },
     ifShow: !getCheckRole('tourist'),
     ifShow: !getCheckRole('tourist'),

+ 15 - 13
src/views/product/list.vue

@@ -4,31 +4,33 @@
       @register="registerTable"
       @register="registerTable"
       :rowSelection="{ type: 'checkbox', onChange: onSelectChange }"
       :rowSelection="{ type: 'checkbox', onChange: onSelectChange }"
     >
     >
-      <template #toolbar v-if="!getCheckRole('tourist')">
-        <a-button type="primary" @click="handleCreate"> 新增商品</a-button>
+      <template #toolbar v-if="!getCheckRole('tourist') && showAction()">
+        <a-button type="primary" @click="handleCreate">
+          {{ t('routes.product.addGoods') }}</a-button
+        >
         <PopConfirmButton
         <PopConfirmButton
-          title="是否确定批量删除?"
+          :title="t('routes.product.batch.delMessge')"
           primary
           primary
           color="error"
           color="error"
           @confirm="handlePatchDelete"
           @confirm="handlePatchDelete"
         >
         >
-          批量删除</PopConfirmButton
+          {{ t('routes.product.batch.del') }}</PopConfirmButton
         >
         >
         <PopConfirmButton
         <PopConfirmButton
-          title="是否确定批量上架?"
+          :title="t('routes.product.batch.groundingMessge')"
           primary
           primary
           color="warning"
           color="warning"
           @confirm="handlePatchEnSale"
           @confirm="handlePatchEnSale"
         >
         >
-          批量上架</PopConfirmButton
+          {{ t('routes.product.batch.grounding') }}</PopConfirmButton
         >
         >
         <PopConfirmButton
         <PopConfirmButton
-          title="是否确定批量下架?"
+          :title="t('routes.product.batch.undercarriageMessge')"
           ghost
           ghost
           color="error"
           color="error"
           @confirm="handlePatchUnSale"
           @confirm="handlePatchUnSale"
         >
         >
-          批量下架</PopConfirmButton
+          {{ t('routes.product.batch.undercarriage') }}</PopConfirmButton
         >
         >
       </template>
       </template>
       <template #realShopUrl="{ record }">
       <template #realShopUrl="{ record }">
@@ -42,14 +44,14 @@
         <TableAction
         <TableAction
           :actions="[
           :actions="[
             {
             {
-              label: '编辑',
+              label: t('common.edit'),
               onClick: handleEdit.bind(null, record),
               onClick: handleEdit.bind(null, record),
             },
             },
             {
             {
               color: 'error',
               color: 'error',
-              label: '删除',
+              label: t('common.delText'),
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.delConfirm'),
                 confirm: () => {
                 confirm: () => {
                   handleSingleDelete(record.id);
                   handleSingleDelete(record.id);
                 },
                 },
@@ -92,7 +94,7 @@
       const userStore = useUserStore();
       const userStore = useUserStore();
       const { getCheckRole } = userStore;
       const { getCheckRole } = userStore;
       const [registerTable, { reload, getSelectRowKeys }] = useTable({
       const [registerTable, { reload, getSelectRowKeys }] = useTable({
-        title: '商品列表',
+        title: t('routes.dashboard.productList'),
         api: ListApi,
         api: ListApi,
         columns: columns,
         columns: columns,
         useSearchForm: true,
         useSearchForm: true,
@@ -165,7 +167,7 @@
           const keys = getSelectRowKeys();
           const keys = getSelectRowKeys();
           console.log('key', keys);
           console.log('key', keys);
           if (keys.length === 0) {
           if (keys.length === 0) {
-            createMessage.info('请至少选择一项');
+            createMessage.info(t('modal.atLeastOne'));
             return;
             return;
           }
           }
           await UnSaleApi(keys);
           await UnSaleApi(keys);

+ 9 - 7
src/views/product/productDrawer.vue

@@ -17,10 +17,10 @@
           <thead>
           <thead>
             <tr style="" v-show="editData.productList.length > 0">
             <tr style="" v-show="editData.productList.length > 0">
               <th style="min-width: 60px">{{ editData.categoryName }}</th>
               <th style="min-width: 60px">{{ editData.categoryName }}</th>
-              <th>库存</th>
-              <th>规格编码</th>
-              <th>市场价</th>
-              <th>销售价</th>
+              <th>{{ t('routes.product.stock') }}</th>
+              <th>{{ t('routes.product.specificationCode') }}</th>
+              <th>{{ t('routes.product.marketingUnit') }}</th>
+              <th>{{ t('routes.product.salesPrice') }}</th>
             </tr>
             </tr>
           </thead>
           </thead>
           <tbody>
           <tbody>
@@ -155,7 +155,7 @@
         schemas: [
         schemas: [
           {
           {
             field: 'goodsId',
             field: 'goodsId',
-            label: '规格名',
+            label: t('routes.product.goodsId'),
             component: 'ApiTreeSelect',
             component: 'ApiTreeSelect',
             componentProps: {
             componentProps: {
               api: async (params) => {
               api: async (params) => {
@@ -174,7 +174,7 @@
           {
           {
             field: 'goodsSn',
             field: 'goodsSn',
             component: 'Input',
             component: 'Input',
-            label: '字段0',
+            label: t('routes.product.field') + '0',
             colProps: {
             colProps: {
               span: 8,
               span: 8,
             },
             },
@@ -267,7 +267,9 @@
           productList: productList,
           productList: productList,
         });
         });
       }
       }
-      const getTitle = computed(() => (!unref(isUpdate) ? '新增商品' : '编辑商品'));
+      const getTitle = computed(() =>
+        !unref(isUpdate) ? t('routes.product.addGoods') : t('routes.product.editGoods'),
+      );
 
 
       async function handleSubmit() {
       async function handleSubmit() {
         const { companyId, id } = userinfo.value;
         const { companyId, id } = userinfo.value;

+ 18 - 18
src/views/product/ref.vue

@@ -45,11 +45,11 @@
       console.log('registerModal', registerModal);
       console.log('registerModal', registerModal);
       const columns: BasicColumn[] = [
       const columns: BasicColumn[] = [
         {
         {
-          title: '商品属性',
+          title: t('routes.dashboard.productRef'),
           editRow: true,
           editRow: true,
           editRule: async (text) => {
           editRule: async (text) => {
             if (!text) {
             if (!text) {
-              return '请输入商品属性';
+              return t('routes.product.productRefMessge');
             }
             }
             if (text && text.length > 15) {
             if (text && text.length > 15) {
               return t('routes.corporation.maxlength');
               return t('routes.corporation.maxlength');
@@ -61,12 +61,12 @@
           width: 100,
           width: 100,
         },
         },
         {
         {
-          title: '排序',
+          title: t('routes.scenes.sortOrder'),
           dataIndex: 'sortOrder',
           dataIndex: 'sortOrder',
           editComponent: 'InputNumber',
           editComponent: 'InputNumber',
           editRule: async (text) => {
           editRule: async (text) => {
             if (text == null || text < 0) {
             if (text == null || text < 0) {
-              return '请输入正确排序';
+              return t('routes.product.sortOrderTips');
             }
             }
             return '';
             return '';
           },
           },
@@ -76,7 +76,7 @@
       ];
       ];
 
 
       const [registerTable, { expandAll, reload, collapseAll }] = useTable({
       const [registerTable, { expandAll, reload, collapseAll }] = useTable({
-        title: '商品属性',
+        title: t('routes.dashboard.productRef'),
         api: attributeListApi,
         api: attributeListApi,
         columns: columns,
         columns: columns,
         useSearchForm: true,
         useSearchForm: true,
@@ -96,7 +96,7 @@
           schemas: [
           schemas: [
             {
             {
               field: `name`,
               field: `name`,
-              label: `商品属性`,
+              label: t('routes.dashboard.productRef'),
               component: 'Input',
               component: 'Input',
               colProps: {
               colProps: {
                 xl: 6,
                 xl: 6,
@@ -111,7 +111,7 @@
         actionColumn: {
         actionColumn: {
           ifShow: !getCheckRole('tourist'),
           ifShow: !getCheckRole('tourist'),
           width: 160,
           width: 160,
-          title: '操作',
+          title: t('common.operating'),
           dataIndex: 'action',
           dataIndex: 'action',
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
         },
         },
@@ -126,8 +126,8 @@
       function handleDelete(record) {
       function handleDelete(record) {
         createConfirm({
         createConfirm({
           iconType: 'warning',
           iconType: 'warning',
-          title: '警告',
-          content: `此操作将对${record.name}进行删除, 是否继续?`,
+          title: t('common.warning'),
+          content: t('routes.staff.delMessage', { userName: record.name }),
           onOk: async () => {
           onOk: async () => {
             let res = await attributeDeleteApi(record.id);
             let res = await attributeDeleteApi(record.id);
             console.log('res', res);
             console.log('res', res);
@@ -146,7 +146,7 @@
 
 
       async function handleSave(record: EditRecordRow) {
       async function handleSave(record: EditRecordRow) {
         // 校验
         // 校验
-        msg.loading({ content: '正在保存...', duration: 0, key: 'saving' });
+        msg.loading({ content: t('routes.product.preservation'), duration: 0, key: 'saving' });
         const valid = await record.onValid?.();
         const valid = await record.onValid?.();
         console.log('ref', valid);
         console.log('ref', valid);
         if (valid) {
         if (valid) {
@@ -165,13 +165,13 @@
             if (pass) {
             if (pass) {
               currentEditKeyRef.value = '';
               currentEditKeyRef.value = '';
             }
             }
-            msg.success({ content: '数据已保存', key: 'saving' });
+            msg.success({ content: t('routes.product.dataSave'), key: 'saving' });
             reload();
             reload();
           } catch (error) {
           } catch (error) {
-            msg.error({ content: '保存失败', key: 'saving' });
+            msg.error({ content: t('routes.product.dataSaveFail'), key: 'saving' });
           }
           }
         } else {
         } else {
-          msg.error({ content: '请填写正确的数据', key: 'saving' });
+          msg.error({ content: t('routes.product.correctData'), key: 'saving' });
         }
         }
       }
       }
       function createActions(record: EditRecordRow, column: BasicColumn): ActionItem[] {
       function createActions(record: EditRecordRow, column: BasicColumn): ActionItem[] {
@@ -179,12 +179,12 @@
         if (!record.editable) {
         if (!record.editable) {
           return [
           return [
             {
             {
-              label: '编辑',
+              label: t('common.edit'),
               disabled: currentEditKeyRef.value ? currentEditKeyRef.value !== record.key : false,
               disabled: currentEditKeyRef.value ? currentEditKeyRef.value !== record.key : false,
               onClick: handleEdit.bind(null, record),
               onClick: handleEdit.bind(null, record),
             },
             },
             {
             {
-              label: '删除',
+              label: t('common.delText'),
               color: 'error',
               color: 'error',
               disabled: currentEditKeyRef.value ? currentEditKeyRef.value !== record.key : false,
               disabled: currentEditKeyRef.value ? currentEditKeyRef.value !== record.key : false,
               onClick: handleDelete.bind(null, record),
               onClick: handleDelete.bind(null, record),
@@ -193,13 +193,13 @@
         }
         }
         return [
         return [
           {
           {
-            label: '保存',
+            label: t('common.saveText'),
             onClick: handleSave.bind(null, record, column),
             onClick: handleSave.bind(null, record, column),
           },
           },
           {
           {
-            label: '取消',
+            label: t('common.cancelText'),
             popConfirm: {
             popConfirm: {
-              title: '是否取消编辑',
+              title: t('common.EditorNot'),
               confirm: handleCancel.bind(null, record, column),
               confirm: handleCancel.bind(null, record, column),
             },
             },
           },
           },

+ 215 - 0
src/views/rightsEnterprises/BindModal.vue

@@ -0,0 +1,215 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @cancel="resetFields"
+    @register="register"
+    :title="title"
+    @ok="handleOk"
+  >
+    <div class="pt-3px pr-3px">
+      <BasicForm @register="registerForm">
+        <template #permList="{ model, field }">
+          <a-select
+            :options="permListOptions"
+            mode="multiple"
+            v-model:value="model[field]"
+            allowClear
+          />
+        </template>
+        <template #text="{ model, field }">
+          {{ model[field] }}
+        </template>
+      </BasicForm>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, ref, computed, reactive } from 'vue';
+  import { bindRights, bindStaffList } from '/@/api/rightsEnterprises/list'; //roleLIstApi
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useUserStore } from '/@/store/modules/user';
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['ok'],
+    setup(_, context) {
+      const modelRef = ref({
+        isSee: false,
+      });
+      const userStore = useUserStore();
+      const userIdList = reactive({
+        list: [],
+      });
+      const userinfo = computed(() => userStore.getUserInfo);
+      const { companyId } = userinfo.value;
+      console.log('companyId', companyId);
+      const permListOptions = computed(() => {
+        return [
+          {
+            label: t('routes.staff.permListName.1'),
+            value: '1',
+          },
+          {
+            label: t('routes.staff.permListName.2'),
+            value: '2',
+          },
+        ];
+      });
+      const schemas: FormSchema[] = [
+        {
+          field: 'permName',
+          component: 'Input',
+          label: t('routes.staff.permList'),
+          colProps: {
+            span: 18,
+          },
+          required: false,
+          slot: 'text',
+        },
+        {
+          field: 'userId',
+          label: t('common.fullName'),
+          component: 'Select',
+          itemProps: {
+            validateTrigger: 'blur',
+          },
+          colProps: {
+            span: 22,
+          },
+          required: true,
+          // ifShow: getCheckRole('plat_admin'),
+          componentProps: {
+            options: userIdList.list,
+            onChange: userIdChange,
+          },
+        },
+        {
+          field: 'staffPhone',
+          component: 'Input',
+          label: t('common.mobile'),
+          colProps: {
+            span: 22,
+          },
+          componentProps: {
+            maxLength: 15,
+          },
+          slot: 'text',
+        },
+        {
+          field: 'activationTime',
+          component: 'Input',
+          label: t('routes.rightsEnterprises.activationTimeOut'),
+          colProps: {
+            span: 22,
+          },
+          defaultValue: 8,
+          slot: 'text',
+        },
+        {
+          field: 'expirationTime',
+          component: 'Input',
+          label: t('routes.rightsEnterprises.expirationTimeOut'),
+          colProps: {
+            span: 22,
+          },
+          defaultValue: 8,
+          slot: 'text',
+        },
+        {
+          field: 'id',
+          component: 'Input',
+          label: 'id',
+          show: false,
+        },
+      ];
+      const title = ref(t('common.bind'));
+      const { createMessage } = useMessage();
+      const [registerForm, { setFieldsValue, validate, updateSchema, resetFields }] = useForm({
+        labelWidth: 120,
+        schemas,
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      async function onDataReceive(data) {
+        // 方式1;
+        let list = await bindStaffList({
+          companyId: data.companyId,
+          staffPermId: data.id,
+        });
+        userIdList.list = list.map((ele) => {
+          return {
+            ...ele,
+            label: ele.staffName,
+            value: ele.staffId,
+            key: ele.staffPhone,
+          };
+        });
+        console.log('handleDelete', userIdList.list);
+        modelRef.value.isSee = data.userId ? true : false;
+        title.value = data.userId ? t('routes.rightsEnterprises.see') : t('common.bind');
+        setFieldsValue({
+          ...data,
+          userId: data.userId ? data.staffName : data.userId,
+        });
+        let setSchema = [
+          {
+            field: 'userId',
+            required: !data.userId,
+            slot: !!data.userId ? 'text' : false,
+          },
+          {
+            field: 'userId',
+            componentProps: {
+              options: userIdList.list,
+            },
+          },
+        ];
+        updateSchema(setSchema);
+      }
+      function userIdChange(val, item) {
+        console.log('handleDelete', val, item);
+        setFieldsValue({
+          ...item,
+        });
+      }
+      async function handleOk() {
+        if (modelRef.value.isSee) {
+          return closeModal();
+        }
+        let data = await validate();
+        let res = await bindRights({
+          userId: data.userId,
+          id: data.id,
+        });
+        context && context.emit('update', res);
+        createMessage.success(t('common.optSuccess'));
+        closeModal();
+        resetFields();
+      }
+
+      return {
+        register,
+        title,
+        schemas,
+        registerForm,
+        modelRef,
+        handleOk,
+        resetFields,
+        permListOptions,
+        t,
+      };
+    },
+  });
+</script>

+ 204 - 0
src/views/rightsEnterprises/addCameraModal.vue

@@ -0,0 +1,204 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    :title="t('routes.rightsEnterprises.addcamera')"
+    @ok="handleOk"
+    width="600px"
+  >
+    <div style="padding-bottom: 90px" class="pt-3px pr-3px">
+      <BasicForm @register="registerForm">
+        <template #text="{ model, field }">
+          {{ model[field] }}
+        </template>
+      </BasicForm>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, ref, computed } from 'vue';
+  import { addCamrea, deviceType } from '/@/api/rightsEnterprises/list'; //roleLIstApi
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { ListAllCompanyApi } from '/@/api/corporation/list';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import dayjs from 'dayjs';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useUserStore } from '/@/store/modules/user';
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['ok'],
+    setup(_, context) {
+      const modelRef = ref({
+        isSee: false,
+      });
+      const userStore = useUserStore();
+      const userinfo = computed(() => userStore.getUserInfo);
+      const { companyId } = userinfo.value;
+      console.log('companyId', companyId);
+      const schemas: FormSchema[] = [
+        {
+          field: 'companyId',
+          label: t('routes.rightsEnterprises.companyName'),
+          component: 'ApiSelect',
+          itemProps: {
+            validateTrigger: 'blur',
+          },
+          colProps: {
+            span: 22,
+          },
+          required: true,
+          componentProps: {
+            api: ListAllCompanyApi,
+            showSearch: true,
+            resultField: 'list',
+            labelField: 'name',
+            valueField: 'id',
+            immediate: true,
+            params: {
+              page: 1,
+              limit: 1000,
+            },
+            onOptionsChange: (data) => {
+              console.log('data', data, arguments);
+            },
+            onChange: (data) => {
+              console.log('data', data, arguments);
+            },
+          },
+        },
+        {
+          field: 'userIncrementTypeId',
+          label: t('routes.rightsEnterprises.cameraIncrementTypeName'),
+          component: 'ApiSelect',
+          itemProps: {
+            validateTrigger: 'blur',
+          },
+          colProps: {
+            span: 22,
+          },
+          required: true,
+          // ifShow: getCheckRole('plat_admin'),
+          componentProps: {
+            api: deviceType,
+            showSearch: true,
+            resultField: 'list',
+            labelField: 'name',
+            valueField: 'id',
+            immediate: true,
+            params: {
+              page: 1,
+              limit: 1000,
+            },
+            required: true,
+          },
+        },
+        {
+          label: t('routes.rightsEnterprises.incrementNum'),
+          field: 'incrementNum',
+          component: 'Input',
+          colProps: {
+            span: 22,
+          },
+          componentProps: {
+            maxLength: 3,
+          },
+          rules: [
+            {
+              required: true,
+              // @ts-ignore
+              validator: async (rule, value) => {
+                var regPos = /(^[1-9]\d*$)/; // 非负整数
+                // var reg = /\S+@\S+\.\S+/;
+                if (!value) {
+                  return Promise.reject(t('routes.rightsEnterprises.incrementNum1'));
+                }
+                if (!regPos.test(value)) {
+                  /* eslint-disable-next-line */
+                  return Promise.reject(t('routes.rightsEnterprises.incrementNum2'));
+                }
+                return Promise.resolve();
+              },
+              trigger: 'change',
+            },
+          ],
+        },
+        {
+          field: 'incrementEndTime',
+          component: 'DatePicker',
+          label: t('routes.rightsEnterprises.expirationTime'),
+          colProps: {
+            span: 22,
+          },
+          componentProps: {
+            valueFormat: 'YYYY-MM-DD',
+            disabledDate: (current) => {
+              return current && current < dayjs().endOf('day');
+            },
+          },
+        },
+      ];
+      const title = ref(t('common.bind'));
+      const { createMessage } = useMessage();
+      const [registerForm, { setFieldsValue, validate, updateSchema, resetFields }] = useForm({
+        labelWidth: 120,
+        schemas,
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      function onDataReceive(data) {
+        // 方式1;
+        modelRef.value.isSee = data.userId ? true : false;
+        setFieldsValue({
+          ...data,
+          userId: data.userId ? data.staffName : data.userId,
+        });
+        let setSchema = [
+          {
+            field: 'companyId',
+            componentProps: {
+              disabled: !data.modify,
+            },
+          },
+        ];
+        console.log('handleDelete', data, setSchema);
+        updateSchema(setSchema);
+      }
+
+      async function handleOk() {
+        if (modelRef.value.isSee) {
+          return closeModal();
+        }
+        let data = await validate();
+        let res = await addCamrea({
+          ...data,
+        });
+        context && context.emit('update', res);
+        createMessage.success(t('common.optSuccess'));
+        closeModal();
+        resetFields();
+      }
+
+      return {
+        register,
+        title,
+        schemas,
+        registerForm,
+        modelRef,
+        handleOk,
+        resetFields,
+        t,
+      };
+    },
+  });
+</script>

+ 328 - 0
src/views/rightsEnterprises/addModal.vue

@@ -0,0 +1,328 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    :title="t('routes.rightsEnterprises.add')"
+    @ok="saveTable"
+    width="700px"
+    @visible-change="handleVisibleChange"
+  >
+    <div class="pt-3px pr-3px">
+      <BasicForm @register="registerForm">
+        <template #text="{ model, field }">
+          {{ model[field] }}
+        </template>
+      </BasicForm>
+      <div class="table_list">
+        <BasicTable @register="registerSubtable">
+          <template #time>
+            <Time :value="new Date()" mode="date" />
+          </template>
+        </BasicTable>
+      </div>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, reactive, nextTick, unref } from 'vue';
+  import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
+  import { BasicTable, useTable, BasicColumn } from '/@/components/Table';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { Time } from '/@/components/Time';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { allListType, saveRights } from '/@/api/rightsEnterprises/list';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  export default defineComponent({
+    components: {
+      BasicModal,
+      BasicForm,
+      BasicTable,
+      Time,
+    },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['addtable', 'register', 'update'],
+    setup(props, { emit }) {
+      const { t } = useI18n();
+      const { createConfirm, createMessage } = useMessage();
+
+      const [registerModal, { openModal: addopenModal }] = useModal();
+      const minNumber = reactive({
+        shotNum: 0,
+        lookNum: 0,
+      });
+      const modelRef = reactive({
+        id: 0,
+        subNum: 0,
+        companyId: 0,
+      });
+      const columns: BasicColumn[] = [
+        {
+          title: t('routes.rightsEnterprises.rightsType'),
+          width: 0,
+          ifShow: false,
+          dataIndex: 'id',
+        },
+        {
+          title: t('routes.rightsEnterprises.rightsType'),
+          width: 160,
+          dataIndex: 'permType',
+        },
+        {
+          title: t('routes.rightsEnterprises.year'),
+          width: 80,
+          dataIndex: 'useYear',
+        },
+        {
+          title: t('routes.rightsEnterprises.muber'),
+          dataIndex: 'muber',
+          edit: true,
+          // slots: { customRender: 'subNum' },
+          editRule: async (text) => {
+            var regPos = /^[0-9]\d*$/; // 整数
+            if (text > 999 || text < -1) {
+              return t('routes.rightsEnterprises.maxlength');
+            } else if (!regPos.test(text)) {
+              return t('routes.rightsEnterprises.integer');
+            }
+            return '';
+          },
+          editComponent: 'InputNumber',
+          width: 200,
+        },
+        {
+          title: t('routes.rightsEnterprises.purchaseTime'),
+          width: 150,
+          dataIndex: 'purchaseTime',
+          slots: { customRender: 'time' },
+        },
+      ];
+      const schemas: FormSchema[] = [
+        {
+          field: 'companyPhone',
+          component: 'Input',
+          label: `${t('routes.corporation.enterpriseId')} :`,
+          slot: 'text',
+          labelWidth: 200,
+        },
+        {
+          field: 'companyName',
+          label: `${t('routes.corporation.enterpriseName')} :`,
+          slot: 'text',
+          component: 'Input',
+          labelWidth: 200,
+        },
+      ];
+      const [registerForm, { setFieldsValue, resetFields, getFieldsValue, validateFields }] =
+        useForm({
+          labelWidth: 120,
+          schemas,
+          showActionButtonGroup: false,
+          actionColOptions: {
+            span: 24,
+          },
+        });
+
+      const [
+        registerSubtable,
+        { reload: reloadSubtable, deleteTableDataRecord, getDataSource, insertTableDataRecord },
+      ] = useTable({
+        // title: `${t('routes.devices.listTile')}`,
+        rowKey: 'phone',
+        api: allListType,
+        showIndexColumn: false,
+        canResize: false,
+        afterFetch: (T) => {
+          console.log('afterFetch', T);
+          return T.map((ele) => {
+            ele.muber = 1;
+            return ele;
+          });
+        },
+        columns,
+        bordered: true,
+        pagination: false,
+      });
+
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(unref(data));
+      });
+
+      async function onDataReceive(data) {
+        console.log('Data Received', data);
+        // 方式1;
+        resetFields();
+        reloadSubtable();
+        modelRef.companyId = data.companyId;
+        setFieldsValue({
+          ...data,
+        });
+      }
+      async function numOnChange() {
+        // await setFieldsValue({
+        //   [name]: data,
+        // });
+        let { shotNum, lookNum } = getFieldsValue();
+        modelRef.subNum = lookNum + shotNum;
+        validateFields(['lookNum', 'shotNum']);
+      }
+      async function numsOnChange(data, type) {
+        let formdata = getFieldsValue();
+        let value = formdata[type];
+        if (data) {
+          value++;
+        } else {
+          value--;
+        }
+        await setFieldsValue({
+          [type]: value,
+        });
+        let { shotNum, lookNum } = getFieldsValue();
+        modelRef.subNum = lookNum + shotNum;
+        validateFields(['lookNum', 'shotNum']);
+      }
+      async function handleDelete(item, type) {
+        if (type == 'edit') {
+          //编辑
+          const { memoName, phone } = item;
+          EditModal(true, {
+            memoName,
+            phone,
+          });
+        } else {
+          let { lookNum, shotNum } = minNumber;
+          // minNumber.shotNum = shotNum;
+          //解除
+          if (item.roleId == 8) {
+            lookNum--;
+            shotNum--;
+          } else if (item.roleId == 81) {
+            lookNum--;
+          } else if (item.roleId == 82) {
+            shotNum--;
+          }
+          createConfirm({
+            iconType: 'warning',
+            title: t('common.tips'),
+            content: t('routes.devices.unbindWarning'),
+            onOk: async () => {
+              // tableRef.value.deleteTableDataRecord(item.id);
+              deleteTableDataRecord(item.userName);
+              minNumber.lookNum = lookNum;
+              minNumber.shotNum = shotNum;
+            },
+          });
+        }
+      }
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      function openTargetModal() {
+        console.log('openTargetModal');
+        addopenModal(true);
+      }
+      async function saveTable() {
+        // let tableData = tableRef.value.getDataSource() || [];
+        // let fromData = await validate();
+        let tableData = getDataSource();
+        let SunNum = 0,
+          permList = [];
+        tableData?.map((ele) => {
+          SunNum = SunNum + ele.muber;
+          permList.push({
+            staffPermTypeId: ele.id,
+            num: ele.muber || 0,
+            // takeLookNum:50,
+          });
+        });
+        if (SunNum == 0) {
+          return createMessage.warning(t('routes.rightsEnterprises.perMessge'));
+        }
+        let res = await saveRights({
+          companyId: modelRef.companyId,
+          permList,
+        });
+        console.log('tableData', res);
+        createMessage.success(t('common.optSuccess'));
+        // reload();
+        emit('update');
+        closeModal();
+      }
+      function addTabledata(val) {
+        console.log('addTabledata', val);
+      }
+      function getTableList(callback) {
+        // let data = getFieldsValue();
+        let tableList = unref(getDataSource());
+        // setFieldsValue({
+        //   subNum: Number(data.subNum) - 1,
+        // });
+        callback(tableList);
+      }
+      // function formatRoleName(val) {
+
+      // },
+      function handleAddUser(newUser) {
+        let DataSource = getDataSource();
+        let { shotNum, lookNum } = getFieldsValue();
+        const total = DataSource?.length;
+        let look = 0,
+          shoot = 0;
+        DataSource.map((ele) => {
+          if (ele.roleId == 8) {
+            look++;
+            shoot++;
+          } else if (ele.roleId == 81) {
+            look++;
+          } else if (ele.roleId == 82) {
+            shoot++;
+          }
+        });
+        console.log('look', look, shoot, 'shotNum, lookNum', shotNum, lookNum, newUser);
+        // if ((newUser.roleId == 8 || newUser.roleId == 81) && !(look < lookNum)) {
+        //   return createMessage.error('可带看员工数不足');
+        // } else if ((newUser.roleId == 8 || newUser.roleId == 82) && !(shoot < shotNum)) {
+        //   return createMessage.error('可拍摄员工数不足');
+        // }
+        minNumber.lookNum = lookNum;
+        minNumber.shotNum = shotNum;
+        insertTableDataRecord({
+          nickName: newUser.memoName,
+          userName: newUser.phone,
+          phone: newUser.phone,
+          roleName: t('routes.staff.roleType.1'),
+          roleId: newUser.roleId,
+        });
+
+        setFieldsValue({
+          addeduser: total || 0,
+        });
+        createMessage.success(t('layout.setting.operatingTitle'));
+      }
+      return {
+        register,
+        handleDelete,
+        numOnChange,
+        numsOnChange,
+        modelRef,
+        schemas,
+        registerForm,
+        minNumber,
+        handleVisibleChange,
+        registerModal,
+        openTargetModal,
+
+        addopenModal,
+        saveTable,
+        closeModal,
+        addTabledata,
+        t,
+        registerSubtable,
+        reloadSubtable,
+        handleAddUser,
+        getTableList,
+      };
+    },
+  });
+</script>

+ 296 - 0
src/views/rightsEnterprises/camera.vue

@@ -0,0 +1,296 @@
+<template>
+  <div>
+    <BasicTable @register="registerTable">
+      <template #toolbar>
+        <!-- RoleEnum.COMPANY_ADMIN, -->
+        <a-button v-power="[RoleEnum.PLAT_ADMIN]" type="primary" @click="handleOpenModal">
+          {{ t('routes.rightsEnterprises.addText') }}</a-button
+        >
+      </template>
+      <template #status="{ record }">
+        {{ renderStatus(record.state) }}
+      </template>
+      <template #createTime="{ record }">
+        <Time v-show="record.createTime" :value="record.createTime" mode="datetime" />
+      </template>
+      <template #incrementEndTime="{ record }">
+        <span v-if="record.status" style="color: #ed6f6f">已过期</span>
+        <Time v-else :value="record.incrementEndTime" mode="datetime" />
+      </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: t('routes.rightsEnterprises.warrant'),
+              ifShow: !record.snCode && !record.status,
+              color: 'success',
+              onClick: handleDelete.bind(null, record),
+            },
+            {
+              label: t('common.unbind'),
+              color: 'error',
+              ifShow: !!record.snCode,
+              onClick: handleUpBind.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <addCameraModal @register="register" @update="reload" />
+    <BindModal @register="registerDelList" @update="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, computed, onMounted, ref, watch, reactive } from 'vue';
+  import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useModal } from '/@/components/Modal';
+  import { uploadApi } from '/@/api/sys/upload';
+  import BindModal from './cameraBind.vue';
+  import addCameraModal from './addCameraModal.vue';
+  import { cameraDetailList, unbindCamera } from '/@/api/rightsEnterprises/list';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
+  import dayjs from 'dayjs';
+  import { RoleEnum } from '/@/enums/roleEnum';
+  import { useGo } from '/@/hooks/web/usePage';
+  import { Time } from '/@/components/Time';
+  import { useUserStore } from '/@/store/modules/user';
+  export default defineComponent({
+    name: 'StaffList',
+    components: {
+      BasicTable,
+      TableAction,
+      Time,
+      BindModal,
+      addCameraModal,
+    },
+    props: {
+      companyInfo: {
+        type: Object,
+        default: function () {
+          return {};
+        },
+      },
+    },
+    setup(props) {
+      const [register, { openModal }] = useModal();
+      const surplusSubNum = ref({
+        lookNum: 0,
+        shotNum: 0,
+      });
+      const [registerDetail, { openModal: openDetaileModal }] = useModal();
+      const [registerDelList, { openModal: openDelListeModal }] = useModal();
+      const { createConfirm, createMessage } = useMessage();
+      const userStore = useUserStore();
+      const { getCheckRole } = userStore;
+      const userinfo = computed(() => userStore.getUserInfo);
+      const modelRef = reactive({
+        companyId: userinfo.value.companyId,
+        companyName: '',
+        companyPhone: '',
+      });
+      const go = useGo();
+      const { t } = useI18n();
+      watch(
+        () => props.companyInfo,
+        (newProps) => {
+          modelRef.companyId = newProps.companyId;
+          modelRef.companyName = newProps.companyName;
+          modelRef.companyPhone = newProps.companyPhone;
+          console.log('companyInfo', modelRef);
+          reload();
+        },
+        {
+          deep: true,
+        },
+      );
+      onMounted(() => {});
+
+      const columns: BasicColumn[] = [
+        {
+          title: t('routes.rightsEnterprises.cameraEquityId'),
+          dataIndex: 'id',
+          fixed: 'left',
+          width: 100,
+        },
+        {
+          title: t('routes.rightsEnterprises.snCode'),
+          dataIndex: 'snCode',
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.cameraIncrementTypeName'),
+          dataIndex: 'cameraIncrementTypeName',
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.companyName'),
+          dataIndex: 'companyName',
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.companyPhone'),
+          dataIndex: 'companyPhone',
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.purchaseTime'),
+          dataIndex: 'createTime',
+          slots: { customRender: 'createTime' },
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.expirationTime'),
+          dataIndex: 'incrementEndTime',
+          slots: { customRender: 'incrementEndTime' },
+          width: 160,
+        },
+        {
+          title: t('common.operating'),
+          dataIndex: '',
+          ifShow: !getCheckRole('tourist'),
+          slots: { customRender: 'action' },
+          fixed: 'right',
+          width: 60,
+        },
+      ];
+
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        schemas: [
+          // {
+          //   field: 'staffName',
+          //   label: t('routes.rightsEnterprises.companyName'),
+          //   component: 'Input',
+          //   componentProps: {
+          //     maxLength: 15,
+          //   },
+          //   colProps: {
+          //     span: 6,
+          //   },
+          // },
+          // {
+          //   field: 'staffPhone',
+          //   label: t('routes.corporation.enterpriseId'),
+          //   component: 'Input',
+          //   componentProps: {
+          //     maxLength: 15,
+          //   },
+          //   colProps: {
+          //     span: 6,
+          //   },
+          // },
+          {
+            field: 'snCode',
+            label: t('routes.rightsEnterprises.snCodeText'),
+            component: 'Input',
+            componentProps: {
+              maxLength: 15,
+            },
+            colProps: {
+              span: 6,
+            },
+          },
+        ],
+      };
+
+      const [registerTable, { reload }] = useTable({
+        title: t('routes.rightsEnterprises.cameraTitle'),
+        api: cameraDetailList,
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        tableSetting: { fullScreen: true },
+        showIndexColumn: true,
+        rowKey: 'id',
+        immediate: userinfo.value.companyId ? true : false,
+        pagination: { pageSize: 20 },
+        searchInfo: modelRef,
+        afterFetch: (T) => {
+          let newDate = dayjs();
+          return T.map((ele) => {
+            if (ele.incrementEndTime) {
+              ele.status = dayjs(ele.incrementEndTime).isAfter(newDate) ? 0 : 1;
+            }
+            console.log('newDate', ele);
+            return ele;
+          });
+        },
+        bordered: true,
+        sortFn: (sortInfo) => {
+          let order = sortInfo.order && sortInfo.order.replace('end', '');
+          return { ...sortInfo, sidx: sortInfo.field, order: order };
+        },
+      });
+
+      function renderStatus(type: number): string {
+        switch (type) {
+          // case 0:
+          //   return t('routes.rightsEnterprises.state.0');
+          // case 1:
+          //   return t('routes.rightsEnterprises.state.1');
+          case 2:
+            return t('routes.rightsEnterprises.state.2');
+          default:
+            return t('routes.rightsEnterprises.state.9');
+        }
+      }
+      function handleOpenModal() {
+        openModal(true, modelRef);
+      }
+      function handleCreate() {
+        // if (
+        //   getCheckRole([RoleEnum.COMPANY_ADMIN]) &&
+        //   surplusSubNum.value.lookNum == 0 &&
+        //   surplusSubNum.value.shotNum == 0
+        // ) {
+        //   return createMessage.error('新增失败,可添加员工数量为0个');
+        // }
+        openDetaileModal(true, {});
+      }
+      function handleEdit(record: Recordable) {
+        openDetaileModal(true, record);
+      }
+      async function handleDelete(record) {
+        return openDelListeModal(true, {
+          ...record,
+        });
+      }
+      function handleUpBind(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: t('sys.app.logoutTip'),
+          content: t('routes.rightsEnterprises.unbindorNot'),
+          onOk: async () => {
+            await unbindCamera({ id: record.id });
+            reload();
+          },
+        });
+      }
+      return {
+        registerTable,
+        registerDetail,
+        registerDelList,
+        openDelListeModal,
+        createMessage,
+        modelRef,
+        handleUpBind,
+        t,
+        reload,
+        go,
+        renderStatus,
+        handleCreate,
+        handleOpenModal,
+        register,
+        handleEdit,
+        handleDelete,
+        uploadApi: uploadApi as any,
+        RoleEnum,
+        surplusSubNum,
+        getCheckRole,
+      };
+    },
+  });
+</script>

+ 108 - 0
src/views/rightsEnterprises/cameraBind.vue

@@ -0,0 +1,108 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @cancel="resetFields"
+    @register="register"
+    :title="t('routes.rightsEnterprises.authorizedCamera')"
+    @ok="handleOk"
+  >
+    <div class="pt-3px pr-3px">
+      <BasicForm @register="registerForm" />
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, ref } from 'vue';
+  import { bindCamera } from '/@/api/rightsEnterprises/list'; //roleLIstApi
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update'],
+    setup(_, context) {
+      const { t } = useI18n();
+      const modelRef = ref({
+        isSee: false,
+      });
+      const schemas: FormSchema[] = [
+        {
+          field: 'snCode',
+          component: 'Input',
+          label: t('routes.rightsEnterprises.snCode'),
+          colProps: {
+            span: 18,
+          },
+          required: true,
+        },
+        {
+          field: 'id',
+          component: 'Input',
+          label: 'id',
+          show: false,
+        },
+      ];
+      const title = ref(t('common.bind'));
+      const { createMessage } = useMessage();
+      const [registerForm, { setFieldsValue, validate, updateSchema, resetFields }] = useForm({
+        labelWidth: 120,
+        schemas,
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      function onDataReceive(data) {
+        // 方式1;
+        console.log('handleDelete', data);
+        modelRef.value.isSee = data.userId ? true : false;
+        setFieldsValue({
+          ...data,
+          userId: data.userId ? data.staffName : data.userId,
+        });
+        let setSchema = [
+          {
+            field: 'userId',
+            required: !data.userId,
+            slot: !!data.userId ? 'text' : false,
+          },
+        ];
+        updateSchema(setSchema);
+      }
+
+      async function handleOk() {
+        if (modelRef.value.isSee) {
+          return closeModal();
+        }
+        let data = await validate();
+        let res = await bindCamera({
+          snCode: data.snCode,
+          id: data.id,
+        });
+        context && context.emit('update', res);
+        createMessage.success(t('common.optSuccess'));
+        closeModal();
+        resetFields();
+      }
+
+      return {
+        register,
+        title,
+        schemas,
+        registerForm,
+        modelRef,
+        handleOk,
+        resetFields,
+        t,
+      };
+    },
+  });
+</script>

+ 291 - 0
src/views/rightsEnterprises/cameraList.vue

@@ -0,0 +1,291 @@
+<template>
+  <div>
+    <BasicTable @register="registerTable">
+      <template #toolbar>
+        <a-button
+          v-power="[RoleEnum.COMPANY_ADMIN, RoleEnum.PLAT_ADMIN]"
+          type="primary"
+          @click="handleCreate"
+          >{{ t('routes.rightsEnterprises.addText') }}</a-button
+        >
+      </template>
+      <template #headerTop v-if="getCheckRole([RoleEnum.COMPANY_ADMIN])">
+        <Alert
+          :message="t('routes.rightsEnterprises.alertMessge', { ...surplusSubNum })"
+          type="info"
+        />
+      </template>
+      <template #role="{ record }">
+        {{ renderRoleType(record.role) }}
+      </template>
+      <template #status="{ record }">
+        {{ renderStatus(record.status) }}
+      </template>
+      <template #createTime="{ record }">
+        <Time :value="record.createTime" mode="datetime" />
+      </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: t('routes.rightsEnterprises.see'),
+              onClick: handleEdit.bind(null, record),
+            },
+            {
+              color: 'warning',
+              label: t('routes.rightsEnterprises.addText'),
+              onClick: handleOpenModal.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <addModal @register="register" @update="reload" />
+    <ProductDrawer @register="registerDrawer" type="camera" @reload="reload" />
+    <addCameraModal @register="register" @update="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, computed, onMounted, ref } from 'vue';
+  import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useModal } from '/@/components/Modal';
+  import { uploadApi } from '/@/api/sys/upload';
+  import { Alert } from 'ant-design-vue';
+  import { cameraListApi, delApi, getNumByStaff } from '/@/api/rightsEnterprises/list';
+  import { useDrawer } from '/@/components/Drawer';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import ProductDrawer from './productDrawer.vue';
+  import { RoleEnum } from '/@/enums/roleEnum';
+  import { useGo } from '/@/hooks/web/usePage';
+  import addCameraModal from './addCameraModal.vue';
+  import addModal from './addModal.vue';
+  import { Time } from '/@/components/Time';
+  import { useUserStore } from '/@/store/modules/user';
+  import { useTabs } from '/@/hooks/web/useTabs';
+  import { useRouter } from 'vue-router';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      TableAction,
+      Time,
+      Alert,
+      addModal,
+      ProductDrawer,
+      addCameraModal,
+    },
+    setup() {
+      const router = useRouter();
+      const [register, { openModal }] = useModal();
+      const [registerDrawer, { openDrawer }] = useDrawer();
+      const surplusSubNum = ref({
+        lookNum: 0,
+        shotNum: 0,
+      });
+      const { createConfirm, createMessage } = useMessage();
+      const userStore = useUserStore();
+      const { getCheckRole } = userStore;
+      const userinfo = computed(() => userStore.getUserInfo);
+      const companyId = ref(userinfo.value.companyId);
+      const go = useGo();
+      const { closeCurrent } = useTabs();
+      const { t } = useI18n();
+      console.log('companyId', companyId);
+      if (companyId.value) {
+        closeCurrent();
+        router.push(`detail/${companyId.value}`);
+      }
+      onMounted(() => {
+        getNumByStaffData();
+      });
+
+      const columns: BasicColumn[] = [
+        {
+          title: 'ID',
+          dataIndex: 'id',
+          fixed: 'left',
+          width: 60,
+        },
+        {
+          title: t('routes.rightsEnterprises.companyName'),
+          dataIndex: 'name',
+          width: 180,
+        },
+        {
+          title: t('routes.rightsEnterprises.companyPhone'),
+          dataIndex: 'phone',
+          width: 150,
+        },
+        {
+          title: t('routes.rightsEnterprises.kk'),
+          dataIndex: 'proIncrementNum',
+          width: 80,
+        },
+
+        {
+          title: t('routes.rightsEnterprises.kj'),
+          dataIndex: 'seeIncrementNum',
+          // sorter: true,
+          width: 80,
+        },
+        {
+          title: t('routes.rightsEnterprises.ss'),
+          dataIndex: 'sensorIncrementNum',
+          // slots: { customRender: 'createTime' },
+          width: 80,
+        },
+        {
+          title: t('common.operating'),
+          dataIndex: '',
+          ifShow: !getCheckRole('tourist'),
+          slots: { customRender: 'action' },
+          fixed: 'right',
+          width: 80,
+        },
+      ];
+
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        schemas: [
+          {
+            field: 'companyName',
+            label: t('routes.rightsEnterprises.companyName'),
+            component: 'Input',
+            componentProps: {
+              maxLength: 15,
+            },
+            colProps: {
+              span: 8,
+            },
+          },
+          // {
+          //   field: 'companyPhone',
+          //   label: t('routes.rightsEnterprises.companyPhone'),
+          //   component: 'Input',
+          //   componentProps: {
+          //     maxLength: 15,
+          //   },
+          //   colProps: {
+          //     span: 8,
+          //   },
+          // },
+        ],
+      };
+
+      const [registerTable, { reload }] = useTable({
+        title: t('routes.rightsEnterprises.menuTableList'),
+        api: cameraListApi,
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        tableSetting: { fullScreen: true },
+        showIndexColumn: true,
+        // searchInfo:'',
+        rowKey: 'id',
+        pagination: { pageSize: 20 },
+        beforeFetch: (T) => {
+          return {
+            ...T,
+            limit: T.limit,
+            page: T.page,
+            startTime: T.fieldTime?.[0],
+            endTime: T.fieldTime?.[1],
+          };
+        },
+        bordered: true,
+        sortFn: (sortInfo) => {
+          let order = sortInfo.order && sortInfo.order.replace('end', '');
+          return { ...sortInfo, sidx: sortInfo.field, order: order };
+        },
+      });
+
+      function renderRoleType(type: number): string {
+        switch (type) {
+          case 0:
+            return t('routes.staff.roleType.0');
+          case 1:
+            return t('routes.staff.roleType.1');
+          default:
+            return '';
+        }
+      }
+      function renderStatus(type: number): string {
+        switch (type) {
+          case 1:
+            return t('common.normal');
+          case 0:
+            return t('common.unNormal');
+          default:
+            return '';
+        }
+      }
+      function handleOpenModal(record: Recordable) {
+        openModal(true, {
+          ...record,
+          modify: true,
+          companyId: record.id,
+          companyPhone: record.phone,
+          companyName: record.name,
+        });
+      }
+      function handleCreate() {
+        openModal(true, {
+          modify: true,
+        });
+      }
+      function getNumByStaffData() {
+        getNumByStaff({}).then((res) => {
+          surplusSubNum.value.lookNum = res.lookNum;
+          surplusSubNum.value.shotNum = res.shotNum;
+        });
+      }
+      function handleEdit(record) {
+        // router.push(`detail/${record.companyId}`);
+        openDrawer(true, {
+          record: {
+            ...record,
+            companyId: record.id,
+            companyName: record.name,
+            companyPhone: record.phone,
+            userPermNum:
+              record.proIncrementNum + record.seeIncrementNum + record.sensorIncrementNum,
+          },
+          isUpdate: true,
+        });
+      }
+      function handDelconfirm(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: t('common.warning'),
+          content: t('routes.staff.delMessage', { userName: record.userName }),
+          onOk: async () => {
+            await delApi({ userId: record.id });
+            reload();
+          },
+        });
+      }
+      return {
+        registerTable,
+        createMessage,
+        handDelconfirm,
+        t,
+        reload,
+        openModal,
+        go,
+        renderRoleType,
+        renderStatus,
+        handleOpenModal,
+        handleCreate,
+        handleEdit,
+        register,
+        uploadApi: uploadApi as any,
+        RoleEnum,
+        surplusSubNum,
+        getCheckRole,
+        getNumByStaffData,
+        registerDrawer,
+      };
+    },
+  });
+</script>

+ 235 - 0
src/views/rightsEnterprises/enterprises.vue

@@ -0,0 +1,235 @@
+<template>
+  <div>
+    <BasicTable @register="registerTable">
+      <template #toolbar>
+        <a-button
+          v-power="[RoleEnum.COMPANY_ADMIN, RoleEnum.PLAT_ADMIN]"
+          type="primary"
+          @click="handleCreate"
+          >{{ t('routes.rightsEnterprises.addText') }}</a-button
+        >
+      </template>
+      <template #headerTop v-if="getCheckRole([RoleEnum.COMPANY_ADMIN])">
+        <Alert
+          :message="t('routes.rightsEnterprises.alertMessge', { ...surplusSubNum })"
+          type="info"
+        />
+      </template>
+      <template #role="{ record }">
+        {{ renderRoleType(record.role) }}
+      </template>
+      <template #status="{ record }">
+        {{ renderStatus(record.status) }}
+      </template>
+      <template #createTime="{ record }">
+        <Time :value="record.createTime" mode="datetime" />
+      </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: t('routes.rightsEnterprises.see'),
+              onClick: handleEdit.bind(null, record),
+            },
+            {
+              color: 'warning',
+              label: t('routes.rightsEnterprises.add'),
+              onClick: handleOpenModal.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <addModal @register="register" @update="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, computed, onMounted, ref } from 'vue';
+  import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useModal } from '/@/components/Modal';
+  import { uploadApi } from '/@/api/sys/upload';
+  import { Alert } from 'ant-design-vue';
+  import { ListApi, delApi, getNumByStaff } from '/@/api/rightsEnterprises/list';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { RoleEnum } from '/@/enums/roleEnum';
+  import { useGo } from '/@/hooks/web/usePage';
+  import addModal from './addModal.vue';
+  import { Time } from '/@/components/Time';
+  import { useUserStore } from '/@/store/modules/user';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      TableAction,
+      Time,
+      Alert,
+      addModal,
+    },
+    setup() {
+      const [register, { openModal }] = useModal();
+      const surplusSubNum = ref({
+        lookNum: 0,
+        shotNum: 0,
+      });
+      const { createConfirm, createMessage } = useMessage();
+      const userStore = useUserStore();
+      const { getCheckRole } = userStore;
+      const roleList = computed(() => userStore.getRoleList);
+      console.log('getRoleList', roleList);
+      const go = useGo();
+      const { t } = useI18n();
+      onMounted(() => {
+        getNumByStaffData();
+      });
+
+      const columns: BasicColumn[] = [
+        {
+          title: 'ID',
+          dataIndex: 'companyId',
+          fixed: 'left',
+          width: 60,
+        },
+        {
+          title: t('routes.staff.deptName'),
+          dataIndex: 'companyName',
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.companyPhone'),
+          dataIndex: 'companyPhone',
+          width: 80,
+        },
+        {
+          title: t('routes.rightsEnterprises.userPermNum'),
+          dataIndex: 'userPermNum',
+          width: 130,
+        },
+
+        {
+          title: t('routes.rightsEnterprises.exUserPermNum'),
+          dataIndex: 'exUserPermNum',
+          sorter: true,
+          width: 130,
+        },
+        {
+          title: t('routes.staff.createTime'),
+          dataIndex: 'createTime',
+          // slots: { customRender: 'createTime' },
+          width: 130,
+        },
+        {
+          title: t('common.operating'),
+          dataIndex: '',
+          ifShow: !getCheckRole('tourist'),
+          slots: { customRender: 'action' },
+          fixed: 'right',
+          width: 120,
+        },
+      ];
+
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        schemas: [
+          {
+            field: 'fieldTime',
+            component: 'RangePicker',
+            label: t('routes.rightsEnterprises.timeField'),
+            colProps: {
+              span: 8,
+            },
+          },
+        ],
+      };
+
+      const [registerTable, { reload }] = useTable({
+        title: t('routes.rightsEnterprises.menuList'),
+        api: ListApi,
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        tableSetting: { fullScreen: true },
+        showIndexColumn: true,
+        rowKey: 'id',
+        pagination: { pageSize: 20 },
+        beforeFetch: (T) => {
+          return {
+            limit: T.limit,
+            page: T.page,
+            startTime: T.fieldTime?.[0],
+            endTime: T.fieldTime?.[1],
+          };
+        },
+        bordered: true,
+        sortFn: (sortInfo) => {
+          let order = sortInfo.order && sortInfo.order.replace('end', '');
+          return { ...sortInfo, sidx: sortInfo.field, order: order };
+        },
+      });
+
+      function renderRoleType(type: number): string {
+        switch (type) {
+          case 0:
+            return t('routes.staff.roleType.0');
+          case 1:
+            return t('routes.staff.roleType.1');
+          default:
+            return '';
+        }
+      }
+      function renderStatus(type: number): string {
+        switch (type) {
+          case 1:
+            return t('common.normal');
+          case 0:
+            return t('common.unNormal');
+          default:
+            return '';
+        }
+      }
+      function handleOpenModal(record: Recordable) {
+        console.log('Received', record);
+        openModal(true, record);
+      }
+      function getNumByStaffData() {
+        getNumByStaff({}).then((res) => {
+          surplusSubNum.value.lookNum = res.lookNum;
+          surplusSubNum.value.shotNum = res.shotNum;
+        });
+      }
+      function handleEdit(record) {
+        console.log('record', record);
+      }
+      function handDelconfirm(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: t('common.warning'),
+          content: t('routes.staff.delMessage', { userName: record.userName }),
+          onOk: async () => {
+            await delApi({ userId: record.id });
+            reload();
+          },
+        });
+      }
+      return {
+        registerTable,
+        createMessage,
+        handDelconfirm,
+        t,
+        reload,
+        openModal,
+        go,
+        renderRoleType,
+        renderStatus,
+        handleOpenModal,
+        handleEdit,
+        register,
+        uploadApi: uploadApi as any,
+        RoleEnum,
+        surplusSubNum,
+        getCheckRole,
+        getNumByStaffData,
+      };
+    },
+  });
+</script>

+ 316 - 0
src/views/rightsEnterprises/list.vue

@@ -0,0 +1,316 @@
+<template>
+  <div>
+    <BasicTable @register="registerTable" :searchInfo="modelRef">
+      <template #toolbar>
+        <a-button v-power="[RoleEnum.PLAT_ADMIN]" type="primary" @click="handleOpenModal">
+          {{ t('routes.devices.add') }}</a-button
+        >
+      </template>
+      <template #status="{ record }">
+        {{ renderStatus(record.state) }}
+      </template>
+      <template #createTime="{ record, field }">
+        <Time :value="record[field]" mode="datetime" />
+      </template>
+      <!-- onClick: handleOpenModal.bind(null, record), -->
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: t('routes.rightsEnterprises.see'),
+              ifShow: !!record.userId,
+              onClick: handleDelete.bind(null, record),
+            },
+            {
+              label: t('common.bind'),
+              color: 'success',
+              ifShow: (record.state == 0 || record.state == 1) && !record.userId,
+              onClick: handleDelete.bind(null, record),
+            },
+            {
+              label: t('common.unbind'),
+              ifShow:
+                getCheckRole([RoleEnum.PLAT_ADMIN]) &&
+                (record.state == 0 || record.state == 1) &&
+                !!record.userId &&
+                dayjs(record.activationTime).isAfter(dayjs()),
+              color: 'error',
+              onClick: handleUpBind.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <addModal @register="register" @update="reload" />
+    <BindModal @register="registerDelList" @update="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, computed, onMounted, ref, watch, reactive } from 'vue';
+  import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useModal } from '/@/components/Modal';
+  import { uploadApi } from '/@/api/sys/upload';
+  import BindModal from './BindModal.vue';
+  import addModal from './addModal.vue';
+  import { staffList, unbindRights } from '/@/api/rightsEnterprises/list';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
+  import dayjs from 'dayjs';
+  import { RoleEnum } from '/@/enums/roleEnum';
+  import { useGo } from '/@/hooks/web/usePage';
+  import { Time } from '/@/components/Time';
+  import { useUserStore } from '/@/store/modules/user';
+  export default defineComponent({
+    name: 'StaffList',
+    components: {
+      BasicTable,
+      TableAction,
+      Time,
+      BindModal,
+      addModal,
+      // DelListModal,
+    },
+    props: {
+      companyInfo: {
+        type: Object,
+        default: function () {
+          return {};
+        },
+      },
+    },
+    setup(props) {
+      const [register, { openModal }] = useModal();
+      const surplusSubNum = ref({
+        lookNum: 0,
+        shotNum: 0,
+      });
+      const [registerDetail, { openModal: openDetaileModal }] = useModal();
+      const [registerDelList, { openModal: openDelListeModal }] = useModal();
+      const { createConfirm, createMessage } = useMessage();
+      const userStore = useUserStore();
+      const { getCheckRole } = userStore;
+      const userinfo = computed(() => userStore.getUserInfo);
+      // const {companyInfo} = toRefs(props)
+      const modelRef = reactive({
+        companyId: userinfo.value.companyId,
+        companyName: userinfo.value.companyName,
+        companyPhone: userinfo.value.phone,
+      });
+      const go = useGo();
+      const { t } = useI18n();
+      watch(
+        () => props.companyInfo,
+        (newProps) => {
+          modelRef.companyId = newProps.companyId;
+          modelRef.companyName = newProps.companyName;
+          modelRef.companyPhone = newProps.companyPhone;
+          reload();
+        },
+        {
+          deep: true,
+        },
+      );
+      onMounted(() => {
+        getNumByStaffData();
+      });
+
+      const columns: BasicColumn[] = [
+        {
+          title: 'ID',
+          dataIndex: 'id',
+          fixed: 'left',
+          ifShow: false,
+          width: 0,
+        },
+        {
+          title: t('routes.rightsEnterprises.permName'),
+          dataIndex: 'permName',
+          width: 160,
+        },
+        {
+          title: t('routes.staff.userName'),
+          dataIndex: 'staffName',
+          width: 80,
+        },
+        {
+          title: t('common.mobile'),
+          dataIndex: 'staffPhone',
+          width: 160,
+        },
+
+        {
+          title: t('common.roleName'),
+          dataIndex: 'staffRoleName',
+          // slots: { customRender: 'role' },
+          sorter: true,
+          width: 80,
+        },
+        {
+          title: t('routes.rightsEnterprises.createTime'),
+          dataIndex: 'createTime',
+          // slots: { customRender: 'createTime' },
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.activationTime'),
+          dataIndex: 'activationTime',
+          // slots: { customRender: 'createTime' },
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.expirationTime'),
+          dataIndex: 'expirationTime',
+          // slots: { customRender: 'createTime' },
+          width: 160,
+        },
+        {
+          title: t('common.state'),
+          dataIndex: 'status',
+          slots: { customRender: 'status' },
+          width: 80,
+        },
+        {
+          title: t('common.operating'),
+          dataIndex: '',
+          ifShow: !getCheckRole('tourist'),
+          slots: { customRender: 'action' },
+          fixed: 'right',
+          width: 100,
+        },
+      ];
+
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        schemas: [
+          {
+            field: 'staffName',
+            label: t('routes.rightsEnterprises.staffName'),
+            component: 'Input',
+            componentProps: {
+              maxLength: 15,
+            },
+            colProps: {
+              span: 8,
+            },
+          },
+          {
+            field: 'staffPhone',
+            label: t('routes.corporation.phone'),
+            component: 'Input',
+            componentProps: {
+              maxLength: 15,
+            },
+            colProps: {
+              span: 8,
+            },
+          },
+        ],
+      };
+
+      const [registerTable, { reload }] = useTable({
+        title: t('routes.rightsEnterprises.staffList'),
+        api: staffList,
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        tableSetting: { fullScreen: true },
+        showIndexColumn: true,
+        rowKey: 'id',
+        immediate: userinfo.value.companyId ? true : false,
+        pagination: { pageSize: 20 },
+        searchInfo: modelRef,
+        afterFetch: (T) => {
+          getNumByStaffData();
+          return T;
+        },
+        bordered: true,
+        sortFn: (sortInfo) => {
+          let order = sortInfo.order && sortInfo.order.replace('end', '');
+          return { ...sortInfo, sidx: sortInfo.field, order: order };
+        },
+      });
+
+      function renderStatus(type: number): string {
+        switch (type) {
+          // case 0:
+          //   return t('routes.rightsEnterprises.state.0');
+          // case 1:
+          //   return t('routes.rightsEnterprises.state.1');
+          case 2:
+            return t('routes.rightsEnterprises.state.2');
+          default:
+            return t('routes.rightsEnterprises.state.9');
+        }
+      }
+      function handleOpenModal(record: Recordable) {
+        console.log('userinfo', userinfo);
+        openModal(true, {
+          ...record,
+          ...modelRef,
+        });
+      }
+      function handleCreate() {
+        // if (
+        //   getCheckRole([RoleEnum.COMPANY_ADMIN]) &&
+        //   surplusSubNum.value.lookNum == 0 &&
+        //   surplusSubNum.value.shotNum == 0
+        // ) {
+        //   return createMessage.error('新增失败,可添加员工数量为0个');
+        // }
+        openDetaileModal(true, {});
+      }
+      function handleEdit(record: Recordable) {
+        openDetaileModal(true, record);
+      }
+      function getNumByStaffData() {
+        // getNumByStaff({}).then((res) => {
+        //   surplusSubNum.value.lookNum = res.lookNum;
+        //   surplusSubNum.value.shotNum = res.shotNum;
+        // });
+      }
+      async function handleDelete(record) {
+        return openDelListeModal(true, {
+          ...record,
+          ...modelRef,
+        });
+      }
+      function handleUpBind(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: t('routes.rightsEnterprises.unbindPer'),
+          content: t('routes.rightsEnterprises.unbindPercontent'),
+          onOk: async () => {
+            await unbindRights({ id: record.id });
+            reload();
+          },
+        });
+      }
+      return {
+        registerTable,
+        registerDetail,
+        registerDelList,
+        openDelListeModal,
+        createMessage,
+        modelRef,
+        handleUpBind,
+        t,
+        reload,
+        go,
+        renderStatus,
+        handleCreate,
+        handleOpenModal,
+        register,
+        handleEdit,
+        handleDelete,
+        uploadApi: uploadApi as any,
+        RoleEnum,
+        surplusSubNum,
+        getCheckRole,
+        getNumByStaffData,
+        dayjs,
+      };
+    },
+  });
+</script>

+ 265 - 0
src/views/rightsEnterprises/rightsList.vue

@@ -0,0 +1,265 @@
+<template>
+  <div>
+    <BasicTable @register="registerTable">
+      <template #toolbar>
+        <!-- <a-button
+          v-power="[RoleEnum.COMPANY_ADMIN, RoleEnum.PLAT_ADMIN]"
+          type="primary"
+          @click="handleCreate"
+          >新增</a-button
+        > -->
+      </template>
+      <template #headerTop v-if="getCheckRole([RoleEnum.COMPANY_ADMIN])">
+        <Alert
+          :message="t('routes.rightsEnterprises.alertMessge', { ...surplusSubNum })"
+          type="info"
+        />
+      </template>
+      <template #role="{ record }">
+        {{ renderRoleType(record.role) }}
+      </template>
+      <template #status="{ record }">
+        {{ renderStatus(record.status) }}
+      </template>
+      <template #createTime="{ record }">
+        <Time :value="record.createTime" mode="datetime" />
+      </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: t('routes.rightsEnterprises.see'),
+              onClick: handleEdit.bind(null, record),
+            },
+            {
+              color: 'success',
+              label: t('routes.rightsEnterprises.add'),
+              onClick: handleOpenModal.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <addModal @register="register" @update="reload" />
+    <ProductDrawer @register="registerDrawer" type="rights" @reload="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, computed, onMounted, ref } from 'vue';
+  import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useModal } from '/@/components/Modal';
+  import { uploadApi } from '/@/api/sys/upload';
+  import { Alert } from 'ant-design-vue';
+  import { ListApi, delApi, getNumByStaff } from '/@/api/rightsEnterprises/list';
+  import { useDrawer } from '/@/components/Drawer';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import ProductDrawer from './productDrawer.vue';
+  import { RoleEnum } from '/@/enums/roleEnum';
+  import { useGo } from '/@/hooks/web/usePage';
+  import addModal from './addModal.vue';
+  import { Time } from '/@/components/Time';
+  import { useUserStore } from '/@/store/modules/user';
+  import { useTabs } from '/@/hooks/web/useTabs';
+  import { useRouter } from 'vue-router';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      TableAction,
+      Time,
+      Alert,
+      addModal,
+      ProductDrawer,
+    },
+    setup() {
+      const router = useRouter();
+      const [register, { openModal }] = useModal();
+      const [registerDrawer, { openDrawer }] = useDrawer();
+      const surplusSubNum = ref({
+        lookNum: 0,
+        shotNum: 0,
+      });
+      const { createConfirm, createMessage } = useMessage();
+      const { closeCurrent } = useTabs();
+      const userStore = useUserStore();
+      const { getCheckRole } = userStore;
+      const userinfo = computed(() => userStore.getUserInfo);
+      const companyId = ref(userinfo.value.companyId);
+      const go = useGo();
+      const { t } = useI18n();
+      console.log('companyId', companyId);
+      if (companyId.value) {
+        closeCurrent();
+        router.replace(`detail/${companyId.value}`);
+      }
+      onMounted(() => {
+        getNumByStaffData();
+      });
+
+      const columns: BasicColumn[] = [
+        {
+          title: 'ID',
+          dataIndex: 'companyId',
+          ifShow: false,
+          fixed: 'left',
+          width: 60,
+        },
+        {
+          title: t('routes.rightsEnterprises.companyName'),
+          dataIndex: 'companyName',
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.companyPhone'),
+          dataIndex: 'companyPhone',
+          width: 120,
+        },
+        {
+          title: t('routes.rightsEnterprises.userPermNum'),
+          dataIndex: 'userPermNum',
+          width: 130,
+        },
+
+        {
+          title: t('routes.rightsEnterprises.exUserPermNum'),
+          dataIndex: 'exUserPermNum',
+          // sorter: true,
+          width: 120,
+        },
+        // {
+        //   title: t('routes.staff.createTime'),
+        //   dataIndex: 'createTime',
+        //   // slots: { customRender: 'createTime' },
+        //   width: 130,
+        // },
+        {
+          title: t('common.operating'),
+          dataIndex: '',
+          ifShow: !getCheckRole('tourist'),
+          slots: { customRender: 'action' },
+          fixed: 'right',
+          width: 80,
+        },
+      ];
+
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        schemas: [
+          {
+            field: 'fieldTime',
+            component: 'RangePicker',
+            label: t('routes.rightsEnterprises.timeField'),
+            ifShow: !getCheckRole('plat_admin'),
+            colProps: {
+              span: 8,
+            },
+          },
+          {
+            field: 'companyName',
+            component: 'Input',
+            label: t('routes.rightsEnterprises.companyName'),
+            colProps: {
+              span: 8,
+            },
+          },
+        ],
+      };
+      const [registerTable, { reload }] = useTable({
+        title: t('routes.rightsEnterprises.menuList'),
+        api: ListApi,
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        tableSetting: { fullScreen: true },
+        showIndexColumn: true,
+        pagination: { pageSize: 20 },
+        rowKey: 'companyId',
+        fetchSetting: {
+          pageField: 'page',
+          sizeField: 'limit',
+          listField: 'list',
+          totalField: 'totalCount',
+        },
+        beforeFetch: (T) => {
+          return {
+            ...T,
+            limit: T.limit,
+            page: T.page,
+            startTime: T.fieldTime?.[0],
+            endTime: T.fieldTime?.[1],
+          };
+        },
+      });
+
+      function renderRoleType(type: number): string {
+        switch (type) {
+          case 0:
+            return t('routes.staff.roleType.0');
+          case 1:
+            return t('routes.staff.roleType.1');
+          default:
+            return '';
+        }
+      }
+      function renderStatus(type: number): string {
+        switch (type) {
+          case 1:
+            return t('common.normal');
+          case 0:
+            return t('common.unNormal');
+          default:
+            return '';
+        }
+      }
+      function handleOpenModal(record: Recordable) {
+        console.log('Received', record);
+        openModal(true, record);
+      }
+      function getNumByStaffData() {
+        getNumByStaff({}).then((res) => {
+          surplusSubNum.value.lookNum = res.lookNum;
+          surplusSubNum.value.shotNum = res.shotNum;
+        });
+      }
+      function handleEdit(record) {
+        // router.push(`detail/${record.companyId}`);
+        openDrawer(true, {
+          record,
+          isUpdate: true,
+        });
+      }
+      function handDelconfirm(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: t('common.warning'),
+          content: t('routes.staff.delMessage', { userName: record.userName }),
+          onOk: async () => {
+            await delApi({ userId: record.id });
+            reload();
+          },
+        });
+      }
+      return {
+        registerTable,
+        createMessage,
+        handDelconfirm,
+        t,
+        reload,
+        openModal,
+        go,
+        renderRoleType,
+        renderStatus,
+        handleOpenModal,
+        handleEdit,
+        register,
+        uploadApi: uploadApi as any,
+        RoleEnum,
+        surplusSubNum,
+        getCheckRole,
+        getNumByStaffData,
+        registerDrawer,
+      };
+    },
+  });
+</script>

+ 287 - 0
src/views/rightsEnterprises/staff.vue

@@ -0,0 +1,287 @@
+<template>
+  <div>
+    <BasicTable @register="registerTable">
+      <template #toolbar>
+        <a-button
+          v-power="[RoleEnum.COMPANY_ADMIN, RoleEnum.PLAT_ADMIN]"
+          type="primary"
+          @click="handleOpenModal"
+          >{{ t('routes.rightsEnterprises.addText') }}</a-button
+        >
+      </template>
+      <template #status="{ record }">
+        {{ renderStatus(record.state) }}
+      </template>
+      <template #createTime="{ record, field }">
+        <Time :value="record[field]" mode="datetime" />
+      </template>
+      <!-- onClick: handleOpenModal.bind(null, record), -->
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: t('routes.rightsEnterprises.see'),
+              ifShow: !!record.userId,
+              onClick: handleDelete.bind(null, record),
+            },
+            {
+              label: t('common.bind'),
+              color: 'success',
+              ifShow: record.state == 0 && !record.userId,
+              onClick: handleDelete.bind(null, record),
+            },
+            {
+              label: t('common.unbind'),
+              ifShow: record.state == 0 && !!record.userId,
+              color: 'error',
+              onClick: handleUpBind.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <addModal @register="register" @update="reload" />
+    <BindModal @register="registerDelList" @update="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, computed, onMounted, ref } from 'vue';
+  import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useModal } from '/@/components/Modal';
+  import { uploadApi } from '/@/api/sys/upload';
+  import BindModal from './BindModal.vue';
+  import addModal from './addModal.vue';
+  import { staffList, unbindRights } from '/@/api/rightsEnterprises/list';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
+  import { RoleEnum } from '/@/enums/roleEnum';
+  import { useGo } from '/@/hooks/web/usePage';
+  import { Time } from '/@/components/Time';
+  import { useUserStore } from '/@/store/modules/user';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      TableAction,
+      Time,
+      BindModal,
+      addModal,
+      // DelListModal,
+    },
+    setup() {
+      const [register, { openModal }] = useModal();
+      const surplusSubNum = ref({
+        lookNum: 0,
+        shotNum: 0,
+      });
+      const [registerDetail, { openModal: openDetaileModal }] = useModal();
+      const [registerDelList, { openModal: openDelListeModal }] = useModal();
+      const { createConfirm, createMessage } = useMessage();
+      const userStore = useUserStore();
+      const { getCheckRole } = userStore;
+      const userinfo = computed(() => userStore.getUserInfo);
+      const { companyId } = userinfo.value;
+      const roleList = computed(() => userStore.getRoleList);
+      console.log('getRoleList', roleList, companyId);
+      const go = useGo();
+      const { t } = useI18n();
+      onMounted(() => {
+        getNumByStaffData();
+      });
+
+      const columns: BasicColumn[] = [
+        {
+          title: 'ID',
+          dataIndex: 'id',
+          fixed: 'left',
+          ifShow: false,
+          width: 0,
+        },
+        {
+          title: t('routes.rightsEnterprises.permName'),
+          dataIndex: 'permName',
+          width: 160,
+        },
+        {
+          title: t('routes.staff.userName'),
+          dataIndex: 'staffName',
+          width: 80,
+        },
+        {
+          title: t('common.mobile'),
+          dataIndex: 'staffPhone',
+          width: 160,
+        },
+
+        {
+          title: t('common.roleName'),
+          dataIndex: 'staffRoleName',
+          // slots: { customRender: 'role' },
+          sorter: true,
+          width: 80,
+        },
+        {
+          title: t('routes.rightsEnterprises.createTime'),
+          dataIndex: 'createTime',
+          // slots: { customRender: 'createTime' },
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.activationTime'),
+          dataIndex: 'activationTime',
+          // slots: { customRender: 'createTime' },
+          width: 160,
+        },
+        {
+          title: t('routes.rightsEnterprises.expirationTime'),
+          dataIndex: 'expirationTime',
+          // slots: { customRender: 'createTime' },
+          width: 160,
+        },
+        {
+          title: t('common.state'),
+          dataIndex: 'status',
+          slots: { customRender: 'status' },
+          width: 80,
+        },
+        {
+          title: t('common.operating'),
+          dataIndex: '',
+          ifShow: !getCheckRole('tourist'),
+          slots: { customRender: 'action' },
+          fixed: 'right',
+          width: 100,
+        },
+      ];
+
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        schemas: [
+          {
+            field: 'staffName',
+            label: t('routes.rightsEnterprises.staffName'),
+            component: 'Input',
+            componentProps: {
+              maxLength: 15,
+            },
+            colProps: {
+              xl: 5,
+              xxl: 5,
+            },
+          },
+          {
+            field: 'staffPhone',
+            label: t('routes.corporation.phone'),
+            component: 'Input',
+            componentProps: {
+              maxLength: 15,
+            },
+            colProps: {
+              xl: 5,
+              xxl: 5,
+            },
+          },
+        ],
+      };
+
+      const [registerTable, { reload }] = useTable({
+        title: t('routes.rightsEnterprises.staffList'),
+        api: staffList,
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        tableSetting: { fullScreen: true },
+        showIndexColumn: true,
+        rowKey: 'id',
+        pagination: { pageSize: 20 },
+        searchInfo: {
+          companyId,
+        },
+        afterFetch: (T) => {
+          getNumByStaffData();
+          return T;
+        },
+        bordered: true,
+        sortFn: (sortInfo) => {
+          let order = sortInfo.order && sortInfo.order.replace('end', '');
+          return { ...sortInfo, sidx: sortInfo.field, order: order };
+        },
+      });
+
+      function renderStatus(type: number): string {
+        console.log('renderStatus', type);
+        switch (type) {
+          // case 0:
+          //   return t('routes.rightsEnterprises.state.0');
+          // case 1:
+          //   return t('routes.rightsEnterprises.state.1');
+          case 2:
+            return t('routes.rightsEnterprises.state.2');
+          default:
+            return t('routes.rightsEnterprises.state.9');
+        }
+      }
+      function handleOpenModal(record: Recordable) {
+        openModal(true, record);
+      }
+      function handleCreate() {
+        // if (
+        //   getCheckRole([RoleEnum.COMPANY_ADMIN]) &&
+        //   surplusSubNum.value.lookNum == 0 &&
+        //   surplusSubNum.value.shotNum == 0
+        // ) {
+        //   return createMessage.error('新增失败,可添加员工数量为0个');
+        // }
+        openDetaileModal(true, {});
+      }
+      function handleEdit(record: Recordable) {
+        openDetaileModal(true, record);
+      }
+      function getNumByStaffData() {
+        // getNumByStaff({}).then((res) => {
+        //   surplusSubNum.value.lookNum = res.lookNum;
+        //   surplusSubNum.value.shotNum = res.shotNum;
+        // });
+      }
+      async function handleDelete(record) {
+        return openDelListeModal(true, {
+          ...record,
+        });
+      }
+      function handleUpBind(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: t('routes.rightsEnterprises.unbindPer'),
+          content: t('routes.rightsEnterprises.unbindPercontent'),
+          onOk: async () => {
+            await unbindRights({ id: record.id });
+            reload();
+          },
+        });
+      }
+      return {
+        registerTable,
+        registerDetail,
+        registerDelList,
+        openDelListeModal,
+        createMessage,
+        handleUpBind,
+        t,
+        reload,
+        go,
+        renderStatus,
+        handleCreate,
+        handleOpenModal,
+        register,
+        handleEdit,
+        handleDelete,
+        uploadApi: uploadApi as any,
+        RoleEnum,
+        surplusSubNum,
+        getCheckRole,
+        getNumByStaffData,
+      };
+    },
+  });
+</script>

+ 22 - 24
src/views/scenes/downloadModal.vue

@@ -41,27 +41,6 @@
     // downloadByOnlineUrl,
     // downloadByOnlineUrl,
   } from '/@/utils/file/download';
   } from '/@/utils/file/download';
 
 
-  const schemas: FormSchema[] = [
-    {
-      field: 'sceneName',
-      label: '场景名称:',
-      component: 'Input',
-      slot: 'label',
-    },
-    {
-      field: 'process',
-      label: '下载进度:',
-      component: 'Input',
-      slot: 'process',
-    },
-    {
-      field: 'status',
-      label: '状态:',
-      component: 'Input',
-      slot: 'status',
-    },
-  ];
-
   export default defineComponent({
   export default defineComponent({
     components: { BasicModal, BasicForm },
     components: { BasicModal, BasicForm },
     props: {
     props: {
@@ -78,7 +57,26 @@
       downloadInfo.process = 0;
       downloadInfo.process = 0;
       downloadInfo.status = '下载中';
       downloadInfo.status = '下载中';
       downloadInfo.isDownloaded = false;
       downloadInfo.isDownloaded = false;
-
+      const schemas: FormSchema[] = [
+        {
+          field: 'sceneName',
+          label: t('routes.scenes.sceneName') + ':',
+          component: 'Input',
+          slot: 'label',
+        },
+        {
+          field: 'process',
+          label: t('routes.scenes.process') + ':',
+          component: 'Input',
+          slot: 'process',
+        },
+        {
+          field: 'status',
+          label: t('routes.scenes.status') + ':',
+          component: 'Input',
+          slot: 'status',
+        },
+      ];
       const [registerForm, { setFieldsValue }] = useForm({
       const [registerForm, { setFieldsValue }] = useForm({
         schemas: schemas,
         schemas: schemas,
         labelWidth: 120,
         labelWidth: 120,
@@ -121,13 +119,13 @@
           const percent = res.percent && Math.round(res.percent);
           const percent = res.percent && Math.round(res.percent);
           downloadInfo.process = percent;
           downloadInfo.process = percent;
           if (res.status === 1000) {
           if (res.status === 1000) {
-            downloadInfo.status = '获取中';
+            downloadInfo.status = t('routes.scenes.getting');
           }
           }
           if (res.status === 1002 && res.url) {
           if (res.status === 1002 && res.url) {
             cancelDownload();
             cancelDownload();
             finishDowloadUrl.value = res.url;
             finishDowloadUrl.value = res.url;
             downloadInfo.isDownloaded = true;
             downloadInfo.isDownloaded = true;
-            downloadInfo.status = '获取成功';
+            downloadInfo.status = t('routes.scenes.gain');
             handleSubmit();
             handleSubmit();
           }
           }
         }, 2000);
         }, 2000);

+ 7 - 7
src/views/scenes/editorModal.vue

@@ -3,7 +3,7 @@
     v-bind="$attrs"
     v-bind="$attrs"
     @cancel="resetFields"
     @cancel="resetFields"
     @register="register"
     @register="register"
-    title="编辑场景"
+    :title="t('routes.scenes.editorScenes')"
     @ok="handleOk"
     @ok="handleOk"
   >
   >
     <div class="pt-3px pr-3px">
     <div class="pt-3px pr-3px">
@@ -48,7 +48,7 @@
         {
         {
           field: 'sceneName',
           field: 'sceneName',
           component: 'Input',
           component: 'Input',
-          label: '场景名称',
+          label: t('routes.scenes.sceneName'),
           slot: 'text',
           slot: 'text',
           colProps: {
           colProps: {
             span: 22,
             span: 22,
@@ -56,7 +56,7 @@
         },
         },
         {
         {
           field: 'picList',
           field: 'picList',
-          label: '场景封面',
+          label: t('routes.scenes.scenePic'),
           component: 'Upload',
           component: 'Upload',
           required: true,
           required: true,
           itemProps: {
           itemProps: {
@@ -81,18 +81,18 @@
         {
         {
           field: 'isShow',
           field: 'isShow',
           component: 'RadioGroup',
           component: 'RadioGroup',
-          label: '是否显示在小程序',
+          label: t('routes.scenes.showTips'),
           required: true,
           required: true,
           defaultValue: 0,
           defaultValue: 0,
           componentProps: {
           componentProps: {
             options: [
             options: [
               {
               {
-                label: '是',
+                label: t('common.yes'),
                 value: 1,
                 value: 1,
                 key: 1,
                 key: 1,
               },
               },
               {
               {
-                label: '否',
+                label: t('common.no'),
                 value: 0,
                 value: 0,
                 key: 0,
                 key: 0,
               },
               },
@@ -136,7 +136,7 @@
         resetFields();
         resetFields();
       }
       }
 
 
-      return { options, register, registerForm, model: modelRef, handleOk, resetFields };
+      return { options, register, registerForm, modelRef, handleOk, resetFields, t };
     },
     },
   });
   });
 </script>
 </script>

+ 33 - 27
src/views/scenes/list.vue

@@ -19,31 +19,37 @@
       </template>
       </template>
       <template #action="{ record }">
       <template #action="{ record }">
         <TableAction
         <TableAction
-          :actions="[
-            {
-              // icon: 'mdi:briefcase-download',
-              label: t('routes.scenes.downloadScene'),
-              popConfirm: {
-                title: t('routes.scenes.downloadSceneConfirm'),
-                confirm: handleDownloadScene.bind(null, record),
-              },
-            },
-            {
-              color: 'error',
-              label: t('routes.scenes.editor'),
-              onClick: openSceneEditor.bind(null, record),
-            },
-            {
-              label: '编辑场景',
-              onClick: openSceneEditorModal.bind(null, record),
-            },
-            {
-              color: 'error',
-              label: t('routes.scenes.makeLiveCover'),
-              ifShow: record.lived !== true,
-              onClick: generateDefaultLiveRoom.bind(null, record),
-            },
-          ]"
+          :actions="
+            record.payStatus == 1
+              ? [
+                  {
+                    // icon: 'mdi:briefcase-download',
+                    label: t('routes.scenes.downloadScene'),
+                    popConfirm: {
+                      title: t('routes.scenes.downloadSceneConfirm'),
+                      confirm: handleDownloadScene.bind(null, record),
+                    },
+                  },
+                  {
+                    color: 'error',
+                    label: t('routes.scenes.editor'),
+                    onClick: openSceneEditor.bind(null, record),
+                  },
+                  {
+                    label: t('routes.scenes.editorScenes'),
+                    onClick: openSceneEditorModal.bind(null, record),
+                  },
+                  {
+                    color: 'error',
+                    label: t('routes.scenes.makeLiveCover'),
+                    ifShow:
+                      (record.lived !== true && getEquity([1, 2])) ||
+                      (record.lived !== true && getCheckRole(['super', 'plat_admin'])),
+                    onClick: generateDefaultLiveRoom.bind(null, record),
+                  },
+                ]
+              : []
+          "
         />
         />
       </template>
       </template>
     </BasicTable>
     </BasicTable>
@@ -119,7 +125,7 @@
           width: 180,
           width: 180,
         },
         },
         {
         {
-          title: '小程序封面',
+          title: t('routes.scenes.appletPicUrl'),
           dataIndex: 'appListPicUrl',
           dataIndex: 'appListPicUrl',
           ellipsis: true,
           ellipsis: true,
           slots: { customRender: 'cover' },
           slots: { customRender: 'cover' },
@@ -141,7 +147,7 @@
           width: 180,
           width: 180,
         },
         },
         {
         {
-          title: '小程序' + t('routes.scenes.isShow'),
+          title: t('routes.scenes.applet') + t('routes.scenes.isShow'),
           dataIndex: 'isShow',
           dataIndex: 'isShow',
           width: 180,
           width: 180,
           customRender: ({ record }) => {
           customRender: ({ record }) => {

+ 11 - 11
src/views/scenes/live.vue

@@ -7,7 +7,7 @@
           v-show="!getCheckRole(['host', 'tourist', 'company_viewer'])"
           v-show="!getCheckRole(['host', 'tourist', 'company_viewer'])"
           @click="handleAddLiveScene"
           @click="handleAddLiveScene"
         >
         >
-          新增</a-button
+          {{ t('routes.devices.add') }}</a-button
         >
         >
         <!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
         <!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
         <a-button type="primary" color="error" @click="() => {}"> 删除</a-button> -->
         <a-button type="primary" color="error" @click="() => {}"> 删除</a-button> -->
@@ -33,14 +33,14 @@
             },
             },
             {
             {
               color: 'warning',
               color: 'warning',
-              label: '编辑',
+              label: t('common.edit'),
               onClick: handleEditLiveScene.bind(null, record),
               onClick: handleEditLiveScene.bind(null, record),
             },
             },
             {
             {
               color: 'error',
               color: 'error',
-              label: '删除',
+              label: t('common.delText'),
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.delConfirm'),
                 confirm: handleDeleteLiveScene.bind(null, record),
                 confirm: handleDeleteLiveScene.bind(null, record),
               },
               },
             },
             },
@@ -107,7 +107,7 @@
           width: 100,
           width: 100,
         },
         },
         {
         {
-          title: '场景名称',
+          title: t('routes.scenes.sceneName'),
           dataIndex: 'sceneName',
           dataIndex: 'sceneName',
           width: 140,
           width: 140,
         },
         },
@@ -125,7 +125,7 @@
           sorter: true,
           sorter: true,
         },
         },
         {
         {
-          title: '直播间链接',
+          title: t('routes.scenes.liveRoomUrl'),
           dataIndex: 'liveRoomUrl',
           dataIndex: 'liveRoomUrl',
           slots: { customRender: 'link' },
           slots: { customRender: 'link' },
           width: 180,
           width: 180,
@@ -227,15 +227,15 @@
       function renderHouseType(type: number): string {
       function renderHouseType(type: number): string {
         switch (type) {
         switch (type) {
           case 0:
           case 0:
-            return '新房';
+            return t('routes.scenes.houseType.0');
           case 1:
           case 1:
-            return '二手房';
+            return t('routes.scenes.houseType.1');
           case 2:
           case 2:
-            return '公寓';
+            return t('routes.scenes.houseType.2');
           case 3:
           case 3:
-            return '民宿';
+            return t('routes.scenes.houseType.3');
           case 4:
           case 4:
-            return '装修';
+            return t('routes.scenes.houseType.4');
           default:
           default:
             return t(`routes.scenes.houseType.9`);
             return t(`routes.scenes.houseType.9`);
         }
         }

+ 47 - 28
src/views/scenes/liveDrawer.vue

@@ -33,6 +33,19 @@
             </template>
             </template>
           </a-input>
           </a-input>
         </template>
         </template>
+        <template #sceneNum="{ model, field }">
+          <Select
+            :disabled="isUpdate"
+            v-bind="$attrs"
+            v-model:value="model[field]"
+            @change="handleChange"
+            @search="handleSearch"
+            showSearch
+            :placeholder="t('routes.scenes.sceneUrl')"
+            :options="getOptions"
+            :filterOption="filterOption"
+          />
+        </template>
       </BasicForm>
       </BasicForm>
     </div>
     </div>
   </BasicDrawer>
   </BasicDrawer>
@@ -150,7 +163,7 @@
           component: 'Input',
           component: 'Input',
           label: t('routes.scenes.liveName'),
           label: t('routes.scenes.liveName'),
           required: true,
           required: true,
-          helpMessage: '仅能输入 英文大小写和中文,最多可输入50个字',
+          helpMessage: t('routes.scenes.nameTips'),
           componentProps: {
           componentProps: {
             maxLength: 50,
             maxLength: 50,
           },
           },
@@ -159,7 +172,7 @@
           field: 'appListPicUrl',
           field: 'appListPicUrl',
           label: t('routes.scenes.appListPicUrl'),
           label: t('routes.scenes.appListPicUrl'),
           component: 'Upload',
           component: 'Upload',
-          helpMessage: '推荐大小:400 * 400 像素',
+          helpMessage: t('routes.scenes.appListPicUrlMessage'),
           required: true,
           required: true,
           colProps: {
           colProps: {
             span: 10,
             span: 10,
@@ -195,27 +208,31 @@
             validateTrigger: 'blur',
             validateTrigger: 'blur',
           },
           },
           required: true,
           required: true,
-          helpMessage: '直播间绑定后,将无法修改',
-          componentProps: {
-            api: getAllSceneApi,
-            immediate: true,
-            resultField: 'list',
-            labelField: 'sceneName',
-            valueField: 'num',
-            onChange: function (_, item) {
-              console.log('onChange', item);
-              myData.sceneUrl = item.webSite || item.sceneUrl || item.liveRoomUrl;
-            },
-            params: {
-              page: 1,
-              limit: 100,
-            },
-          },
+          helpMessage: t('routes.scenes.sceneNumMessage'),
+          slot: 'sceneNum',
+          // componentProps: {
+          //   api: getAllSceneApi,
+          //   immediate: true,
+          //   resultField: 'list',
+          //   labelField: 'sceneName',
+          //   valueField: 'num',
+          //   onChange: function (_, item) {
+          //     console.log('onChange', item);
+          //     myData.sceneUrl = item.webSite || item.sceneUrl || item.liveRoomUrl;
+          //   },
+          //   onSearch:function(vale,item) {
+          //     console.log('onChange', vale,item);
+          //   },
+          //   params: {
+          //     page: 1,
+          //     limit: 100,
+          //   },
+          // },
         },
         },
 
 
         {
         {
           field: 'location',
           field: 'location',
-          label: '直播间位置',
+          label: t('routes.scenes.location'),
           component: 'ApiCascader',
           component: 'ApiCascader',
           itemProps: {
           itemProps: {
             validateTrigger: 'blur',
             validateTrigger: 'blur',
@@ -266,7 +283,7 @@
         },
         },
         {
         {
           field: 'map',
           field: 'map',
-          label: '地图位置',
+          label: t('routes.scenes.map'),
           component: 'Input',
           component: 'Input',
           slot: 'map',
           slot: 'map',
           colProps: {
           colProps: {
@@ -275,9 +292,9 @@
         },
         },
         {
         {
           field: 'picList',
           field: 'picList',
-          label: '直播间图片',
+          label: t('routes.scenes.picList'),
           component: 'Upload',
           component: 'Upload',
-          helpMessage: '推荐大小:400 * 400 像素',
+          helpMessage: t('routes.scenes.appListPicUrlMessage'),
           componentProps: {
           componentProps: {
             api: uploadLiveApi,
             api: uploadLiveApi,
             maxSize: 5,
             maxSize: 5,
@@ -334,12 +351,12 @@
           componentProps: {
           componentProps: {
             options: [
             options: [
               {
               {
-                label: '是',
+                label: t('common.yes'),
                 value: 1,
                 value: 1,
                 key: 1,
                 key: 1,
               },
               },
               {
               {
-                label: '否',
+                label: t('common.no'),
                 value: 0,
                 value: 0,
                 key: 0,
                 key: 0,
               },
               },
@@ -351,7 +368,7 @@
           component: 'Input',
           component: 'Input',
           label: t('routes.scenes.contractPhone'),
           label: t('routes.scenes.contractPhone'),
           required: true,
           required: true,
-          helpMessage: ['支持填写400(400-xxx-xxxx)热线、手机号等联系方式'],
+          helpMessage: [t('routes.scenes.contractPhoneMessage')],
         },
         },
       ];
       ];
       // updateSchema, validate
       // updateSchema, validate
@@ -486,7 +503,7 @@
                 detailAddr.value = defaultAddress.address;
                 detailAddr.value = defaultAddress.address;
               }
               }
             } else {
             } else {
-              createMessage.error('查询地址异常');
+              createMessage.error(t('routes.scenes.locationMessage'));
             }
             }
           });
           });
           // const marker = new AMap.Marker({
           // const marker = new AMap.Marker({
@@ -501,7 +518,9 @@
         let { province, city, district } = addressComponent;
         let { province, city, district } = addressComponent;
         return [province, city, district];
         return [province, city, district];
       }
       }
-      const getTitle = computed(() => (!unref(isUpdate) ? '新增直播间' : '编辑直播间'));
+      const getTitle = computed(() =>
+        !unref(isUpdate) ? t('routes.scenes.addAnchor') : t('routes.scenes.editAnchor'),
+      );
 
 
       async function handleMapSearch() {
       async function handleMapSearch() {
         console.log('handleMapSearch');
         console.log('handleMapSearch');
@@ -550,7 +569,7 @@
                   //   detailAddr.value = defaultAddress.address;
                   //   detailAddr.value = defaultAddress.address;
                 }
                 }
               } else {
               } else {
-                createMessage.error('查询地址异常');
+                createMessage.error(t('routes.scenes.locationMessage'));
               }
               }
             });
             });
           });
           });

+ 78 - 0
src/views/staff/clean.vue

@@ -0,0 +1,78 @@
+<template>
+  <div class="p-4">
+    <BasicForm @register="register" @submit="handleSubmit" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent } from 'vue';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { clean } from '/@/api/staff/list';
+  // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
+  export default defineComponent({
+    components: {
+      BasicForm,
+    },
+    setup() {
+      const { t } = useI18n();
+      const { createMessage } = useMessage();
+      const schemas: FormSchema[] = [
+        {
+          field: 'userName',
+          component: 'Input',
+          label: t('routes.corporation.phone'),
+          colProps: {
+            span: 8,
+          },
+          componentProps: {
+            // type:"number"
+          },
+          rules: [
+            {
+              required: true,
+              // @ts-ignore
+              validator: async (rule, value) => {
+                var reg_tel =
+                  /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
+                // var reg = /\S+@\S+\.\S+/;
+                if (!value) {
+                  /* eslint-disable-next-line */
+
+                  return Promise.reject(t('common.phone'));
+                }
+                if (!reg_tel.test(value)) {
+                  /* eslint-disable-next-line */
+                  return Promise.reject(t('common.phoneError'));
+                }
+                return Promise.resolve();
+              },
+              trigger: 'change',
+            },
+          ],
+        },
+      ];
+      const [register, { setProps, validate, resetFields }] = useForm({
+        labelWidth: 120,
+        schemas,
+        actionColOptions: {
+          span: 4,
+        },
+        submitButtonOptions: {
+          text: t('routes.staff.closeStutaText'),
+        },
+      });
+      async function handleSubmit() {
+        let data = await validate();
+        await clean({ userName: data.userName }); //
+        createMessage.success(t('common.optSuccess'));
+        setTimeout(() => resetFields(), 500);
+      }
+      return {
+        handleSubmit,
+        setProps,
+        register,
+      };
+    },
+  });
+</script>

+ 5 - 5
src/views/staff/delListModal.vue

@@ -3,13 +3,13 @@
     v-bind="$attrs"
     v-bind="$attrs"
     @cancel="resetFields"
     @cancel="resetFields"
     @register="register"
     @register="register"
-    title="删除员工"
+    :title="t('routes.staff.delUser')"
     @ok="handleOk"
     @ok="handleOk"
   >
   >
     <div class="pt-3px pr-3px">
     <div class="pt-3px pr-3px">
       <BasicForm @register="registerForm">
       <BasicForm @register="registerForm">
         <template #tips>
         <template #tips>
-          <div>请将当前员工的直播间数据进行迁移后,再删除员工</div>
+          <div>{{ t('routes.staff.delUserTips') }}</div>
         </template>
         </template>
       </BasicForm>
       </BasicForm>
     </div>
     </div>
@@ -41,7 +41,7 @@
         {
         {
           field: 'toUserPhone',
           field: 'toUserPhone',
           component: 'Select',
           component: 'Select',
-          label: '选择迁移的员工',
+          label: t('routes.staff.toUserPhone'),
           required: true,
           required: true,
           itemProps: {
           itemProps: {
             validateTrigger: 'blur',
             validateTrigger: 'blur',
@@ -86,7 +86,7 @@
           updateSchema({
           updateSchema({
             field: 'toUserPhone',
             field: 'toUserPhone',
             component: 'Select',
             component: 'Select',
-            label: '选择迁移的员工',
+            label: t('routes.staff.toUserPhone'),
             required: true,
             required: true,
             itemProps: {
             itemProps: {
               validateTrigger: 'blur',
               validateTrigger: 'blur',
@@ -118,7 +118,7 @@
         resetFields();
         resetFields();
       }
       }
 
 
-      return { options, register, registerForm, model: modelRef, handleOk, resetFields };
+      return { options, register, registerForm, model: modelRef, handleOk, resetFields, t };
     },
     },
   });
   });
 </script>
 </script>

+ 44 - 10
src/views/staff/detailsModal.vue

@@ -31,11 +31,14 @@
       const modelRef = ref({});
       const modelRef = ref({});
       const userStore = useUserStore();
       const userStore = useUserStore();
       const { getCheckRole } = userStore;
       const { getCheckRole } = userStore;
+      const userinfo = computed(() => userStore.getUserInfo);
+      const { companyId } = userinfo.value;
+      console.log('companyId', companyId);
       const schemas: FormSchema[] = [
       const schemas: FormSchema[] = [
         {
         {
           field: 'phone',
           field: 'phone',
           component: 'Input',
           component: 'Input',
-          label: '手机号',
+          label: t('routes.corporation.phone'),
           colProps: {
           colProps: {
             span: 18,
             span: 18,
           },
           },
@@ -62,7 +65,7 @@
                   if (res == true) {
                   if (res == true) {
                     return Promise.resolve();
                     return Promise.resolve();
                   } else {
                   } else {
-                    return Promise.reject('手机号未在指房宝APP中进行注册');
+                    return Promise.reject(t('routes.staff.addTips'));
                   }
                   }
                 } catch (err) {
                 } catch (err) {
                   return Promise.reject(err);
                   return Promise.reject(err);
@@ -75,7 +78,7 @@
         {
         {
           field: 'nickName',
           field: 'nickName',
           component: 'Input',
           component: 'Input',
-          label: '员工名称',
+          label: t('routes.staff.userName'),
           colProps: {
           colProps: {
             span: 22,
             span: 22,
           },
           },
@@ -90,11 +93,11 @@
                 var reg_tel = /^[a-zA-Z0-9\u4e00-\u9fa5()]+$/;
                 var reg_tel = /^[a-zA-Z0-9\u4e00-\u9fa5()]+$/;
                 // var reg = /\S+@\S+\.\S+/;
                 // var reg = /\S+@\S+\.\S+/;
                 if (!value) {
                 if (!value) {
-                  return Promise.reject('请输入员工名称');
+                  return Promise.reject(t('common.userNick'));
                 }
                 }
                 if (!reg_tel.test(value)) {
                 if (!reg_tel.test(value)) {
                   /* eslint-disable-next-line */
                   /* eslint-disable-next-line */
-                  return Promise.reject('请输入正确的员工名称');
+                  return Promise.reject(t('common.userCorrectNameNick'));
                 }
                 }
                 return Promise.resolve();
                 return Promise.resolve();
               },
               },
@@ -104,7 +107,7 @@
         },
         },
         {
         {
           field: 'companyId',
           field: 'companyId',
-          label: '公司',
+          label: t('routes.staff.companyId'),
           component: 'ApiSelect',
           component: 'ApiSelect',
           itemProps: {
           itemProps: {
             validateTrigger: 'blur',
             validateTrigger: 'blur',
@@ -131,7 +134,7 @@
         {
         {
           field: 'roleId',
           field: 'roleId',
           component: 'ApiSelect',
           component: 'ApiSelect',
-          label: '角色',
+          label: t('common.roleName'),
           required: true,
           required: true,
           itemProps: {
           itemProps: {
             validateTrigger: 'blur',
             validateTrigger: 'blur',
@@ -143,13 +146,44 @@
           componentProps: {
           componentProps: {
             options: [
             options: [
               {
               {
-                label: '公司员工',
+                label: t('routes.staff.roleType.1'),
                 value: 8,
                 value: 8,
                 key: 8,
                 key: 8,
               },
               },
             ],
             ],
           },
           },
         },
         },
+        {
+          field: 'permList',
+          component: 'ApiSelect',
+          label: t('routes.staff.permList'),
+          colProps: {
+            span: 22,
+          },
+          componentProps: {
+            api: async function (params) {
+              const res = await getAllList(params);
+              console.log('params', params, res);
+              // const treeData = makeTree(res);
+              return res.map((i) => {
+                return {
+                  ...i,
+                  permName: i.permName + '  ' + i.createTime,
+                };
+              });
+            },
+            labelField: 'permName',
+            valueField: 'id',
+            immediate: true,
+            mode: 'multiple',
+            params: {
+              page: 1,
+              limit: 100,
+              // companyId:
+            },
+            required: true,
+          },
+        },
         // {
         // {
         //   field: 'status',
         //   field: 'status',
         //   label: '状态',
         //   label: '状态',
@@ -173,7 +207,7 @@
           show: false,
           show: false,
         },
         },
       ];
       ];
-      const title = ref('新 增');
+      const title = ref(t('routes.staff.add'));
       const { createMessage } = useMessage();
       const { createMessage } = useMessage();
       const [registerForm, { setFieldsValue, validate, updateSchema, resetFields }] = useForm({
       const [registerForm, { setFieldsValue, validate, updateSchema, resetFields }] = useForm({
         labelWidth: 120,
         labelWidth: 120,
@@ -222,7 +256,7 @@
             },
             },
           },
           },
         ];
         ];
-        title.value = data.id ? '编辑' : '新增';
+        title.value = data.id ? t('common.edit') : t('routes.devices.add');
         updateSchema(setSchema);
         updateSchema(setSchema);
       }
       }
 
 

+ 9 - 12
src/views/staff/list.vue

@@ -6,14 +6,11 @@
           v-power="[RoleEnum.COMPANY_ADMIN, RoleEnum.PLAT_ADMIN]"
           v-power="[RoleEnum.COMPANY_ADMIN, RoleEnum.PLAT_ADMIN]"
           type="primary"
           type="primary"
           @click="handleCreate"
           @click="handleCreate"
-          >新增</a-button
+          >{{ t('routes.devices.add') }}</a-button
         >
         >
       </template>
       </template>
       <template #headerTop v-if="getCheckRole([RoleEnum.COMPANY_ADMIN])">
       <template #headerTop v-if="getCheckRole([RoleEnum.COMPANY_ADMIN])">
-        <Alert
-          :message="`可新增带看员工为 ${surplusSubNum.lookNum} 个、拍摄员工为 ${surplusSubNum.shotNum} 个`"
-          type="info"
-        />
+        <Alert :message="t('routes.staff.addMessage', { ...surplusSubNum })" type="info" />
       </template>
       </template>
       <template #role="{ record }">
       <template #role="{ record }">
         {{ renderRoleType(record.role) }}
         {{ renderRoleType(record.role) }}
@@ -29,7 +26,7 @@
         <TableAction
         <TableAction
           :actions="[
           :actions="[
             {
             {
-              label: '编辑',
+              label: t('common.edit'),
               onClick: handleEdit.bind(null, record),
               onClick: handleEdit.bind(null, record),
             },
             },
             {
             {
@@ -38,10 +35,10 @@
               onClick: handleOpenModal.bind(null, record),
               onClick: handleOpenModal.bind(null, record),
             },
             },
             {
             {
-              label: '删除',
+              label: t('common.delText'),
               color: 'error',
               color: 'error',
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.delConfirm'),
                 confirm: handleDelete.bind(null, record),
                 confirm: handleDelete.bind(null, record),
               },
               },
             },
             },
@@ -124,7 +121,7 @@
           width: 80,
           width: 80,
         },
         },
         {
         {
-          title: '手机',
+          title: t('common.mobile'),
           dataIndex: 'phone',
           dataIndex: 'phone',
           width: 160,
           width: 160,
         },
         },
@@ -151,7 +148,7 @@
           width: 130,
           width: 130,
         },
         },
         {
         {
-          title: '操作',
+          title: t('common.operating'),
           dataIndex: '',
           dataIndex: '',
           ifShow: !getCheckRole('tourist'),
           ifShow: !getCheckRole('tourist'),
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
@@ -257,8 +254,8 @@
       function handDelconfirm(record) {
       function handDelconfirm(record) {
         createConfirm({
         createConfirm({
           iconType: 'warning',
           iconType: 'warning',
-          title: '警告',
-          content: `此操作将对${record.userName}进行删除, 是否继续?`,
+          title: t('common.warning'),
+          content: t('routes.staff.delMessage', { userName: record.userName }),
           onOk: async () => {
           onOk: async () => {
             await delApi({ userId: record.id });
             await delApi({ userId: record.id });
             reload();
             reload();

+ 36 - 1
src/views/sys/login/Login.vue

@@ -27,6 +27,15 @@
             <div class="mt-5 font-normal text-white text-md dark:text-gray-500 -enter-x">
             <div class="mt-5 font-normal text-white text-md dark:text-gray-500 -enter-x">
               {{ t('sys.login.signInDesc') }}
               {{ t('sys.login.signInDesc') }}
             </div>
             </div>
+            <div class="appcode">
+              <div v-for="item in getAppList" :key="item.name">
+                <img :src="item.url" alt="" />
+                <div class="title">
+                  <Icon :icon="item.icon" :size="20" />
+                  {{ item.name }}
+                </div>
+              </div>
+            </div>
           </div>
           </div>
         </div>
         </div>
         <div class="flex w-full h-full py-5 xl:h-auto xl:py-0 xl:my-0 xl:w-6/12">
         <div class="flex w-full h-full py-5 xl:h-auto xl:py-0 xl:my-0 xl:w-6/12">
@@ -58,6 +67,7 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useLocaleStore } from '/@/store/modules/locale';
   import { useLocaleStore } from '/@/store/modules/locale';
+  import Icon from '/@/components/Icon/src/Icon.vue';
 
 
   defineProps({
   defineProps({
     sessionTimeout: {
     sessionTimeout: {
@@ -71,6 +81,10 @@
   const localeStore = useLocaleStore();
   const localeStore = useLocaleStore();
   const showLocale = localeStore.getShowPicker;
   const showLocale = localeStore.getShowPicker;
   const title = computed(() => globSetting?.title ?? '');
   const title = computed(() => globSetting?.title ?? '');
+  const { getAppList } = localeStore;
+  defineExpose({
+    getAppList,
+  });
 </script>
 </script>
 <style lang="less">
 <style lang="less">
   @prefix-cls: ~'@{namespace}-login';
   @prefix-cls: ~'@{namespace}-login';
@@ -155,6 +169,28 @@
     }
     }
 
 
     .container {
     .container {
+      .my-auto {
+        .appcode {
+          margin-top: 1.25rem;
+          width: 340px;
+          display: flex;
+          justify-content: space-between;
+          img {
+            width: 150px;
+            padding: 2px;
+            background: #fff;
+          }
+          .title {
+            text-align: center;
+            margin-top: 10px;
+            background: rgb(130, 166, 230);
+            padding: 5px;
+            border-radius: 3px;
+            color: #fff;
+            font-size: 20px;
+          }
+        }
+      }
       .@{logo-prefix-cls} {
       .@{logo-prefix-cls} {
         display: flex;
         display: flex;
         width: 60%;
         width: 60%;
@@ -164,7 +200,6 @@
           font-size: 24px;
           font-size: 24px;
           color: #fff;
           color: #fff;
         }
         }
-
         img {
         img {
           width: 48px;
           width: 48px;
         }
         }

+ 12 - 10
src/views/system/account/AccountDetail.vue

@@ -1,26 +1,26 @@
 <template>
 <template>
   <PageWrapper
   <PageWrapper
-    :title="`用户` + userId + `的资料`"
-    content="这是用户资料详情页面。本页面仅用于演示相同路由在tab中打开多个页面并且显示不同的数据"
+    :title="t('routes.system.infoData.title', { userId: userId })"
+    :content="t('routes.system.infoData.content')"
     contentBackground
     contentBackground
     @back="goBack"
     @back="goBack"
   >
   >
     <template #extra>
     <template #extra>
-      <a-button type="primary" danger> 禁用账号 </a-button>
-      <a-button type="primary"> 修改密码 </a-button>
+      <a-button type="primary" danger> {{ t('routes.system.disable') }} </a-button>
+      <a-button type="primary"> {{ t('routes.system.set') }} </a-button>
     </template>
     </template>
     <template #footer>
     <template #footer>
       <a-tabs default-active-key="detail" v-model:activeKey="currentKey">
       <a-tabs default-active-key="detail" v-model:activeKey="currentKey">
-        <a-tab-pane key="detail" tab="用户资料" />
-        <a-tab-pane key="logs" tab="操作日志" />
+        <a-tab-pane key="detail" :tab="t('routes.system.userProfile')" />
+        <a-tab-pane key="logs" :tab="t('routes.system.log')" />
       </a-tabs>
       </a-tabs>
     </template>
     </template>
     <div class="pt-4 m-4 desc-wrap">
     <div class="pt-4 m-4 desc-wrap">
       <template v-if="currentKey == 'detail'">
       <template v-if="currentKey == 'detail'">
-        <div v-for="i in 10" :key="i">这是用户{{ userId }}资料Tab</div>
+        <div v-for="i in 10" :key="i">{{ t('routes.system.userinfo', { userId: userId }) }}</div>
       </template>
       </template>
       <template v-if="currentKey == 'logs'">
       <template v-if="currentKey == 'logs'">
-        <div v-for="i in 10" :key="i">这是用户{{ userId }}操作日志Tab</div>
+        <div v-for="i in 10" :key="i">{{ t('routes.system.userlog', { userId: userId }) }}</div>
       </template>
       </template>
     </div>
     </div>
   </PageWrapper>
   </PageWrapper>
@@ -33,6 +33,8 @@
   import { useGo } from '/@/hooks/web/usePage';
   import { useGo } from '/@/hooks/web/usePage';
   import { useTabs } from '/@/hooks/web/useTabs';
   import { useTabs } from '/@/hooks/web/useTabs';
   import { Tabs } from 'ant-design-vue';
   import { Tabs } from 'ant-design-vue';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  const { t } = useI18n();
   export default defineComponent({
   export default defineComponent({
     name: 'AccountDetail',
     name: 'AccountDetail',
     components: { PageWrapper, ATabs: Tabs, ATabPane: Tabs.TabPane },
     components: { PageWrapper, ATabs: Tabs, ATabPane: Tabs.TabPane },
@@ -47,14 +49,14 @@
       // 本页代码仅作演示,实际应当通过userId从接口获得用户的相关资料
       // 本页代码仅作演示,实际应当通过userId从接口获得用户的相关资料
 
 
       // 设置Tab的标题(不会影响页面标题)
       // 设置Tab的标题(不会影响页面标题)
-      setTitle('详情:用户' + userId.value);
+      setTitle(t('routes.system.setTitle') + userId.value);
 
 
       // 页面左侧点击返回链接时的操作
       // 页面左侧点击返回链接时的操作
       function goBack() {
       function goBack() {
         // 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
         // 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
         go('/system/account');
         go('/system/account');
       }
       }
-      return { userId, currentKey, goBack };
+      return { userId, currentKey, goBack, t };
     },
     },
   });
   });
 </script>
 </script>

+ 0 - 69
src/views/system/account/AccountModal.vue

@@ -1,69 +0,0 @@
-<template>
-  <BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
-    <BasicForm @register="registerForm" />
-  </BasicModal>
-</template>
-<script lang="ts">
-  import { defineComponent, ref, computed, unref } from 'vue';
-  import { BasicModal, useModalInner } from '/@/components/Modal';
-  import { BasicForm, useForm } from '/@/components/Form/index';
-  import { accountFormSchema } from './account.data';
-  import { saveAccountUserApi, updateAccountUserApi } from '/@/api/system/system';
-  // import { makeMenuTree, TreeMenuNode } from '/@/utils/treeUtils';
-
-  export default defineComponent({
-    name: 'AccountModal',
-    components: { BasicModal, BasicForm },
-    emits: ['success', 'register'],
-    setup(_, { emit }) {
-      const isUpdate = ref(true);
-      const rowId = ref('');
-      // updateSchema
-      const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
-        labelWidth: 100,
-        schemas: accountFormSchema,
-        showActionButtonGroup: false,
-        actionColOptions: {
-          span: 23,
-        },
-      });
-
-      const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
-        resetFields();
-        setModalProps({ confirmLoading: false });
-        isUpdate.value = !!data?.isUpdate;
-
-        if (unref(isUpdate)) {
-          rowId.value = data.record.id;
-          setFieldsValue({
-            ...data.record,
-          });
-        }
-      });
-
-      const getTitle = computed(() => (!unref(isUpdate) ? '新增账号' : '编辑账号'));
-
-      async function handleSubmit() {
-        try {
-          const values = await validate();
-          console.log('handleSubmit', values);
-          setModalProps({ confirmLoading: true });
-          // TODO custom api
-          console.log(values);
-          if (!unref(isUpdate)) {
-            await saveAccountUserApi(values);
-          } else {
-            await updateAccountUserApi({ ...values, id: rowId.value });
-          }
-
-          closeModal();
-          emit('success');
-        } finally {
-          setModalProps({ confirmLoading: false });
-        }
-      }
-
-      return { registerModal, registerForm, getTitle, handleSubmit };
-    },
-  });
-</script>

+ 4 - 2
src/views/system/account/DeptTree.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div class="m-4 mr-0 overflow-hidden bg-white">
   <div class="m-4 mr-0 overflow-hidden bg-white">
     <BasicTree
     <BasicTree
-      title="部门列表"
+      :title="t('routes.system.departmentList')"
       toolbar
       toolbar
       search
       search
       :clickRowToExpand="false"
       :clickRowToExpand="false"
@@ -16,6 +16,8 @@
 
 
   import { BasicTree, TreeItem } from '/@/components/Tree';
   import { BasicTree, TreeItem } from '/@/components/Tree';
   import { getDeptList } from '/@/api/system/system';
   import { getDeptList } from '/@/api/system/system';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  const { t } = useI18n();
 
 
   export default defineComponent({
   export default defineComponent({
     name: 'DeptTree',
     name: 'DeptTree',
@@ -36,7 +38,7 @@
       onMounted(() => {
       onMounted(() => {
         fetch();
         fetch();
       });
       });
-      return { treeData, handleSelect };
+      return { treeData, handleSelect, t };
     },
     },
   });
   });
 </script>
 </script>

+ 15 - 13
src/views/system/account/account.data.ts

@@ -11,7 +11,7 @@ const { t } = useI18n();
 
 
 export const columns: BasicColumn[] = [
 export const columns: BasicColumn[] = [
   {
   {
-    title: '用户名',
+    title: t(''),
     dataIndex: 'nickName',
     dataIndex: 'nickName',
     width: 120,
     width: 120,
   },
   },
@@ -21,12 +21,12 @@ export const columns: BasicColumn[] = [
   //   width: 120,
   //   width: 120,
   // },
   // },
   {
   {
-    title: '手机',
+    title: t('common.mobile'),
     dataIndex: 'phone',
     dataIndex: 'phone',
     width: 140,
     width: 140,
   },
   },
   {
   {
-    title: '创建时间',
+    title: t('routes.staff.createTime'),
     dataIndex: 'createTime',
     dataIndex: 'createTime',
     width: 180,
     width: 180,
     customRender: ({ record }) => {
     customRender: ({ record }) => {
@@ -37,15 +37,17 @@ export const columns: BasicColumn[] = [
     },
     },
   },
   },
   {
   {
-    title: '状态',
+    title: t('routes.scenes.status'),
     dataIndex: 'recStatus',
     dataIndex: 'recStatus',
     width: 120,
     width: 120,
     customRender: ({ record }) => {
     customRender: ({ record }) => {
-      return record.recStatus == 'I' ? '禁用' : '正常';
+      return record.recStatus == 'I'
+        ? t('routes.scenes.statusText.2')
+        : t('routes.scenes.statusText.1');
     },
     },
   },
   },
   {
   {
-    title: '角色',
+    title: t('common.roleName'),
     dataIndex: 'roleName',
     dataIndex: 'roleName',
     width: 200,
     width: 200,
   },
   },
@@ -58,7 +60,7 @@ export const columns: BasicColumn[] = [
 export const searchFormSchema: FormSchema[] = [
 export const searchFormSchema: FormSchema[] = [
   {
   {
     field: 'userName',
     field: 'userName',
-    label: '用户名',
+    label: t('routes.system.userName'),
     component: 'Input',
     component: 'Input',
     componentProps: {
     componentProps: {
       maxLength: 100,
       maxLength: 100,
@@ -79,7 +81,7 @@ export const searchFormSchema: FormSchema[] = [
 export const accountFormSchema: FormSchema[] = [
 export const accountFormSchema: FormSchema[] = [
   {
   {
     field: 'nickName',
     field: 'nickName',
-    label: '用户名',
+    label: t('routes.system.userName'),
     component: 'Input',
     component: 'Input',
     required: true,
     required: true,
     // helpMessage: ['本字段演示异步验证', '不能输入带有admin的用户名'],
     // helpMessage: ['本字段演示异步验证', '不能输入带有admin的用户名'],
@@ -115,7 +117,7 @@ export const accountFormSchema: FormSchema[] = [
     ifShow: false,
     ifShow: false,
   },
   },
   {
   {
-    label: '角色',
+    label: t('common.roleName'),
     field: 'roleId',
     field: 'roleId',
     component: 'ApiSelect',
     component: 'ApiSelect',
     // component: 'ApiRadioGroup',
     // component: 'ApiRadioGroup',
@@ -154,7 +156,7 @@ export const accountFormSchema: FormSchema[] = [
   // },
   // },
   {
   {
     field: 'phone',
     field: 'phone',
-    label: '手机号',
+    label: t('routes.corporation.phone'),
     component: 'Input',
     component: 'Input',
     required: true,
     required: true,
     // helpMessage: ['验证提示', '手机号需在指房宝APP注册后才可新增'],
     // helpMessage: ['验证提示', '手机号需在指房宝APP注册后才可新增'],
@@ -202,7 +204,7 @@ export const accountFormSchema: FormSchema[] = [
   },
   },
   {
   {
     field: 'recStatus',
     field: 'recStatus',
-    label: '状态',
+    label: t('routes.scenes.status'),
     component: 'RadioGroup',
     component: 'RadioGroup',
     required: true,
     required: true,
     defaultValue: 'A',
     defaultValue: 'A',
@@ -210,11 +212,11 @@ export const accountFormSchema: FormSchema[] = [
       options: [
       options: [
         {
         {
           value: 'A',
           value: 'A',
-          label: '正常',
+          label: t('routes.scenes.statusText.1'),
         },
         },
         {
         {
           value: 'I',
           value: 'I',
-          label: '禁用',
+          label: t('routes.scenes.statusText.2'),
         },
         },
       ],
       ],
     },
     },

+ 7 - 7
src/views/system/account/index.vue

@@ -7,7 +7,7 @@
       :rowSelection="{ type: 'checkbox' }"
       :rowSelection="{ type: 'checkbox' }"
     >
     >
       <template #toolbar>
       <template #toolbar>
-        <a-button type="primary" @click="handleCreate">新增主持人</a-button>
+        <a-button type="primary" @click="handleCreate">{{ t('routes.system.addHost') }}</a-button>
       </template>
       </template>
       <template #action="{ record }">
       <template #action="{ record }">
         <TableAction
         <TableAction
@@ -18,16 +18,16 @@
             //   onClick: handleView.bind(null, record),
             //   onClick: handleView.bind(null, record),
             // },
             // },
             {
             {
-              label: '编辑',
-              tooltip: '编辑用户资料',
+              label: t('common.edit'),
+              tooltip: t('routes.system.edit'),
               onClick: handleEdit.bind(null, record),
               onClick: handleEdit.bind(null, record),
             },
             },
             {
             {
               color: 'error',
               color: 'error',
-              label: '删除',
-              tooltip: '删除此账号',
+              label: t('common.delText'),
+              tooltip: t('routes.system.delText'),
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.delConfirm'),
                 confirm: handleDelete.bind(null, record),
                 confirm: handleDelete.bind(null, record),
               },
               },
             },
             },
@@ -85,7 +85,7 @@
         },
         },
         actionColumn: {
         actionColumn: {
           width: 120,
           width: 120,
-          title: '操作',
+          title: t('common.operating'),
           dataIndex: 'action',
           dataIndex: 'action',
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
         },
         },

+ 5 - 2
src/views/system/dept/DeptModal.vue

@@ -8,7 +8,8 @@
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { formSchema } from './dept.data';
   import { formSchema } from './dept.data';
-
+  import { useI18n } from '/@/hooks/web/useI18n';
+  const { t } = useI18n();
   import { getDeptList } from '/@/api/system/system';
   import { getDeptList } from '/@/api/system/system';
   export default defineComponent({
   export default defineComponent({
     name: 'DeptModal',
     name: 'DeptModal',
@@ -40,7 +41,9 @@
         });
         });
       });
       });
 
 
-      const getTitle = computed(() => (!unref(isUpdate) ? '新增部门' : '编辑部门'));
+      const getTitle = computed(() =>
+        !unref(isUpdate) ? t('routes.system.addDepartment') : t('routes.system.editDepartment'),
+      );
 
 
       async function handleSubmit() {
       async function handleSubmit() {
         try {
         try {

+ 19 - 18
src/views/system/dept/dept.data.ts

@@ -2,38 +2,39 @@ import { BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
 import { h } from 'vue';
 import { h } from 'vue';
 import { Tag } from 'ant-design-vue';
 import { Tag } from 'ant-design-vue';
-
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
 export const columns: BasicColumn[] = [
 export const columns: BasicColumn[] = [
   {
   {
-    title: '部门名称',
+    title: t('routes.system.departmentName'),
     dataIndex: 'deptName',
     dataIndex: 'deptName',
     width: 160,
     width: 160,
     align: 'left',
     align: 'left',
   },
   },
   {
   {
-    title: '排序',
+    title: t('routes.scenes.sortOrder'),
     dataIndex: 'orderNo',
     dataIndex: 'orderNo',
     width: 50,
     width: 50,
   },
   },
   {
   {
-    title: '状态',
+    title: t('routes.scenes.status'),
     dataIndex: 'status',
     dataIndex: 'status',
     width: 80,
     width: 80,
     customRender: ({ record }) => {
     customRender: ({ record }) => {
       const status = record.status;
       const status = record.status;
       const enable = ~~status === 0;
       const enable = ~~status === 0;
       const color = enable ? 'green' : 'red';
       const color = enable ? 'green' : 'red';
-      const text = enable ? '启用' : '停用';
+      const text = enable ? t('routes.system.enable') : t('routes.system.stopUsing');
       return h(Tag, { color: color }, () => text);
       return h(Tag, { color: color }, () => text);
     },
     },
   },
   },
   {
   {
-    title: '创建时间',
+    title: t('routes.staff.createTime'),
     dataIndex: 'createTime',
     dataIndex: 'createTime',
     width: 180,
     width: 180,
   },
   },
   {
   {
-    title: '备注',
+    title: t('routes.system.remarks'),
     dataIndex: 'remark',
     dataIndex: 'remark',
   },
   },
 ];
 ];
@@ -41,7 +42,7 @@ export const columns: BasicColumn[] = [
 export const searchFormSchema: FormSchema[] = [
 export const searchFormSchema: FormSchema[] = [
   {
   {
     field: 'deptName',
     field: 'deptName',
-    label: '部门名称',
+    label: t('routes.system.departmentName'),
     component: 'Input',
     component: 'Input',
     colProps: { span: 8 },
     colProps: { span: 8 },
     componentProps: {
     componentProps: {
@@ -50,13 +51,13 @@ export const searchFormSchema: FormSchema[] = [
   },
   },
   {
   {
     field: 'status',
     field: 'status',
-    label: '状态',
+    label: t('routes.scenes.status'),
     component: 'Select',
     component: 'Select',
     componentProps: {
     componentProps: {
       maxLength: 100,
       maxLength: 100,
       options: [
       options: [
-        { label: '启用', value: '0' },
-        { label: '停用', value: '1' },
+        { label: t('routes.system.enable'), value: '0' },
+        { label: t('routes.system.stopUsing'), value: '1' },
       ],
       ],
     },
     },
     colProps: { span: 8 },
     colProps: { span: 8 },
@@ -66,13 +67,13 @@ export const searchFormSchema: FormSchema[] = [
 export const formSchema: FormSchema[] = [
 export const formSchema: FormSchema[] = [
   {
   {
     field: 'deptName',
     field: 'deptName',
-    label: '部门名称',
+    label: t('routes.system.departmentName'),
     component: 'Input',
     component: 'Input',
     required: true,
     required: true,
   },
   },
   {
   {
     field: 'parentDept',
     field: 'parentDept',
-    label: '上级部门',
+    label: t('routes.system.parentDept'),
     component: 'TreeSelect',
     component: 'TreeSelect',
 
 
     componentProps: {
     componentProps: {
@@ -87,25 +88,25 @@ export const formSchema: FormSchema[] = [
   },
   },
   {
   {
     field: 'orderNo',
     field: 'orderNo',
-    label: '排序',
+    label: t('routes.scenes.sortOrder'),
     component: 'InputNumber',
     component: 'InputNumber',
     required: true,
     required: true,
   },
   },
   {
   {
     field: 'status',
     field: 'status',
-    label: '状态',
+    label: t('routes.scenes.status'),
     component: 'RadioButtonGroup',
     component: 'RadioButtonGroup',
     defaultValue: '0',
     defaultValue: '0',
     componentProps: {
     componentProps: {
       options: [
       options: [
-        { label: '启用', value: '0' },
-        { label: '停用', value: '1' },
+        { label: t('routes.system.enable'), value: '0' },
+        { label: t('routes.system.stopUsing'), value: '1' },
       ],
       ],
     },
     },
     required: true,
     required: true,
   },
   },
   {
   {
-    label: '备注',
+    label: t('routes.system.remarks'),
     field: 'remark',
     field: 'remark',
     component: 'InputTextArea',
     component: 'InputTextArea',
   },
   },

+ 9 - 5
src/views/system/dept/index.vue

@@ -2,7 +2,9 @@
   <div>
   <div>
     <BasicTable @register="registerTable" :searchInfo="searchInfo">
     <BasicTable @register="registerTable" :searchInfo="searchInfo">
       <template #toolbar>
       <template #toolbar>
-        <a-button type="primary" @click="handleCreate"> 新增部门 </a-button>
+        <a-button type="primary" @click="handleCreate">
+          {{ t('routes.system.addDepartment') }}
+        </a-button>
       </template>
       </template>
       <template #action="{ record }">
       <template #action="{ record }">
         <TableAction
         <TableAction
@@ -15,7 +17,7 @@
               icon: 'ant-design:delete-outlined',
               icon: 'ant-design:delete-outlined',
               color: 'error',
               color: 'error',
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.delConfirm'),
                 confirm: handleDelete.bind(null, record),
                 confirm: handleDelete.bind(null, record),
               },
               },
             },
             },
@@ -31,7 +33,8 @@
 
 
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { getDeptList } from '/@/api/system/system';
   import { getDeptList } from '/@/api/system/system';
-
+  import { useI18n } from '/@/hooks/web/useI18n';
+  const { t } = useI18n();
   import { useModal } from '/@/components/Modal';
   import { useModal } from '/@/components/Modal';
   import DeptModal from './DeptModal.vue';
   import DeptModal from './DeptModal.vue';
 
 
@@ -45,7 +48,7 @@
       searchInfo.name = '';
       searchInfo.name = '';
       const [registerModal, { openModal }] = useModal();
       const [registerModal, { openModal }] = useModal();
       const [registerTable, { reload }] = useTable({
       const [registerTable, { reload }] = useTable({
-        title: '部门列表',
+        title: t('routes.system.departmentList'),
         api: getDeptList,
         api: getDeptList,
         columns,
         columns,
         formConfig: {
         formConfig: {
@@ -61,7 +64,7 @@
         canResize: false,
         canResize: false,
         actionColumn: {
         actionColumn: {
           width: 80,
           width: 80,
-          title: '操作',
+          title: t('common.operating'),
           dataIndex: 'action',
           dataIndex: 'action',
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
           fixed: undefined,
           fixed: undefined,
@@ -97,6 +100,7 @@
         handleDelete,
         handleDelete,
         handleSuccess,
         handleSuccess,
         searchInfo,
         searchInfo,
+        t,
       };
       };
     },
     },
   });
   });

+ 3 - 1
src/views/system/menu/MenuDrawer.vue

@@ -60,7 +60,9 @@
         });
         });
       });
       });
 
 
-      const getTitle = computed(() => (!unref(isUpdate) ? '新增菜单' : '编辑菜单'));
+      const getTitle = computed(() =>
+        !unref(isUpdate) ? t('routes.system.newMenu') : t('routes.system.editMenu'),
+      );
       const { createMessage } = useMessage();
       const { createMessage } = useMessage();
       const { t } = useI18n();
       const { t } = useI18n();
       async function handleSubmit() {
       async function handleSubmit() {

+ 7 - 5
src/views/system/menu/index.vue

@@ -2,7 +2,7 @@
   <div>
   <div>
     <BasicTable @register="registerTable" @fetch-success="onFetchSuccess" :searchInfo="searchInfo">
     <BasicTable @register="registerTable" @fetch-success="onFetchSuccess" :searchInfo="searchInfo">
       <template #toolbar>
       <template #toolbar>
-        <a-button type="primary" @click="handleCreate"> 新增菜单 </a-button>
+        <a-button type="primary" @click="handleCreate"> {{ t('routes.system.newMenu') }} </a-button>
       </template>
       </template>
       <template #action="{ record }">
       <template #action="{ record }">
         <TableAction
         <TableAction
@@ -15,7 +15,7 @@
               icon: 'ant-design:delete-outlined',
               icon: 'ant-design:delete-outlined',
               color: 'error',
               color: 'error',
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.operating'),
                 confirm: handleDelete.bind(null, record),
                 confirm: handleDelete.bind(null, record),
               },
               },
             },
             },
@@ -31,7 +31,8 @@
 
 
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { getMenuList, deleteMenuApi } from '/@/api/system/system';
   import { getMenuList, deleteMenuApi } from '/@/api/system/system';
-
+  import { useI18n } from '/@/hooks/web/useI18n';
+  const { t } = useI18n();
   import { useDrawer } from '/@/components/Drawer';
   import { useDrawer } from '/@/components/Drawer';
   import MenuDrawer from './MenuDrawer.vue';
   import MenuDrawer from './MenuDrawer.vue';
 
 
@@ -46,7 +47,7 @@
       searchInfo.order = 'asc';
       searchInfo.order = 'asc';
       const [registerDrawer, { openDrawer }] = useDrawer();
       const [registerDrawer, { openDrawer }] = useDrawer();
       const [registerTable, { reload }] = useTable({
       const [registerTable, { reload }] = useTable({
-        title: '菜单列表',
+        title: t('routes.system.menuList'),
         api: getMenuList,
         api: getMenuList,
         columns,
         columns,
         formConfig: {
         formConfig: {
@@ -63,7 +64,7 @@
         canResize: true,
         canResize: true,
         actionColumn: {
         actionColumn: {
           width: 80,
           width: 80,
-          title: '操作',
+          title: t('common.operating'),
           dataIndex: 'action',
           dataIndex: 'action',
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
           fixed: 'right',
           fixed: 'right',
@@ -115,6 +116,7 @@
         handleSuccess,
         handleSuccess,
         onFetchSuccess,
         onFetchSuccess,
         searchInfo,
         searchInfo,
+        t,
       };
       };
     },
     },
   });
   });

+ 44 - 43
src/views/system/menu/menu.data.ts

@@ -3,7 +3,8 @@ import { FormSchema } from '/@/components/Table';
 import { h } from 'vue';
 import { h } from 'vue';
 import { Tag } from 'ant-design-vue';
 import { Tag } from 'ant-design-vue';
 import { Icon } from '/@/components/Icon';
 import { Icon } from '/@/components/Icon';
-
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
 // const label =[]
 // const label =[]
 
 
 export const columns: BasicColumn[] = [
 export const columns: BasicColumn[] = [
@@ -13,24 +14,24 @@ export const columns: BasicColumn[] = [
     width: 80,
     width: 80,
   },
   },
   {
   {
-    title: '组件路径',
+    title: t('routes.system.component'),
     dataIndex: 'component',
     dataIndex: 'component',
     width: 80,
     width: 80,
   },
   },
   {
   {
-    title: '菜单名称',
+    title: t('routes.system.menuName'),
     dataIndex: 'name',
     dataIndex: 'name',
     width: 200,
     width: 200,
     align: 'left',
     align: 'left',
     fixed: 'left',
     fixed: 'left',
   },
   },
   {
   {
-    title: '上级菜单',
+    title: t('routes.system.menuParentName'),
     dataIndex: 'parentName',
     dataIndex: 'parentName',
     width: 100,
     width: 100,
   },
   },
   {
   {
-    title: '图标',
+    title: t('routes.system.icon'),
     dataIndex: 'icon',
     dataIndex: 'icon',
     width: 50,
     width: 50,
     customRender: ({ record }) => {
     customRender: ({ record }) => {
@@ -39,12 +40,12 @@ export const columns: BasicColumn[] = [
   },
   },
   // permission
   // permission
   {
   {
-    title: '权限标识',
+    title: t('routes.system.perms'),
     dataIndex: 'perms',
     dataIndex: 'perms',
     width: 250,
     width: 250,
   },
   },
   {
   {
-    title: '类型',
+    title: t('routes.system.type.title'),
     dataIndex: 'type',
     dataIndex: 'type',
     width: 100,
     width: 100,
     customRender: ({ record }) => {
     customRender: ({ record }) => {
@@ -54,19 +55,19 @@ export const columns: BasicColumn[] = [
       switch (type) {
       switch (type) {
         case 0:
         case 0:
           color = 'processing';
           color = 'processing';
-          label = '目录';
+          label = t('routes.system.type.0');
           break;
           break;
         case 1:
         case 1:
           color = 'warning';
           color = 'warning';
-          label = '菜单';
+          label = t('routes.system.type.1');
           break;
           break;
         case 2:
         case 2:
           color = 'error';
           color = 'error';
-          label = '按钮';
+          label = t('routes.system.type.2');
           break;
           break;
         default:
         default:
           color = 'green';
           color = 'green';
-          label = '目录';
+          label = t('routes.system.type.0');
           break;
           break;
       }
       }
 
 
@@ -74,30 +75,30 @@ export const columns: BasicColumn[] = [
     },
     },
   },
   },
   {
   {
-    title: '排序',
+    title: t('routes.scenes.sortOrder'),
     dataIndex: 'orderNum',
     dataIndex: 'orderNum',
     width: 50,
     width: 50,
   },
   },
 
 
   {
   {
-    title: '状态',
+    title: t('routes.scenes.status'),
     dataIndex: 'status',
     dataIndex: 'status',
     width: 80,
     width: 80,
     customRender: ({ record }) => {
     customRender: ({ record }) => {
       const status = record.status;
       const status = record.status;
       const enable = ~~status === 0;
       const enable = ~~status === 0;
       const color = enable ? 'green' : 'red';
       const color = enable ? 'green' : 'red';
-      const text = enable ? '启用' : '停用';
+      const text = enable ? t('routes.system.enable') : t('routes.system.stopUsing');
       return h(Tag, { color: color }, () => text);
       return h(Tag, { color: color }, () => text);
     },
     },
   },
   },
   {
   {
-    title: '菜单路径',
+    title: t('routes.system.menuPath'),
     dataIndex: 'path',
     dataIndex: 'path',
     width: 180,
     width: 180,
   },
   },
   {
   {
-    title: '外链地址',
+    title: t('routes.system.menuUrl'),
     dataIndex: 'url',
     dataIndex: 'url',
     width: 180,
     width: 180,
   },
   },
@@ -111,7 +112,7 @@ const idShowExt = (isExt: number) => isExt === 1;
 export const searchFormSchema: FormSchema[] = [
 export const searchFormSchema: FormSchema[] = [
   {
   {
     field: 'name',
     field: 'name',
-    label: '菜单名称',
+    label: t('routes.system.menuName'),
     component: 'Input',
     component: 'Input',
     componentProps: {
     componentProps: {
       maxLength: 100,
       maxLength: 100,
@@ -120,12 +121,12 @@ export const searchFormSchema: FormSchema[] = [
   },
   },
   {
   {
     field: 'status',
     field: 'status',
-    label: '状态',
+    label: t('routes.scenes.status'),
     component: 'Select',
     component: 'Select',
     componentProps: {
     componentProps: {
       options: [
       options: [
-        { label: '启用', value: 0 },
-        { label: '停用', value: 1 },
+        { label: t('routes.system.enable'), value: 0 },
+        { label: t('routes.system.stopUsing'), value: 1 },
       ],
       ],
     },
     },
     colProps: { span: 8 },
     colProps: { span: 8 },
@@ -135,22 +136,22 @@ export const searchFormSchema: FormSchema[] = [
 export const formSchema: FormSchema[] = [
 export const formSchema: FormSchema[] = [
   {
   {
     field: 'type',
     field: 'type',
-    label: '菜单类型',
+    label: t('routes.system.menuType'),
     component: 'RadioButtonGroup',
     component: 'RadioButtonGroup',
     defaultValue: 0,
     defaultValue: 0,
 
 
     componentProps: {
     componentProps: {
       options: [
       options: [
-        { label: '目录', value: 0 },
-        { label: '菜单', value: 1 },
-        { label: '按钮', value: 2 },
+        { label: t('routes.system.type.0'), value: 0 },
+        { label: t('routes.system.type.1'), value: 1 },
+        { label: t('routes.system.type.2'), value: 2 },
       ],
       ],
     },
     },
     colProps: { lg: 24, md: 24 },
     colProps: { lg: 24, md: 24 },
   },
   },
   {
   {
     field: 'name',
     field: 'name',
-    label: '菜单名称',
+    label: t('routes.system.menuName'),
     component: 'Input',
     component: 'Input',
     componentProps: {
     componentProps: {
       maxLength: 15,
       maxLength: 15,
@@ -163,11 +164,11 @@ export const formSchema: FormSchema[] = [
           const reg_tel = /^[a-zA-Z0-9\u4e00-\u9fa5()]+$/;
           const reg_tel = /^[a-zA-Z0-9\u4e00-\u9fa5()]+$/;
           // var reg = /\S+@\S+\.\S+/;
           // var reg = /\S+@\S+\.\S+/;
           if (!value) {
           if (!value) {
-            return Promise.reject('请输入菜单名称');
+            return Promise.reject(t('routes.system.menuName1'));
           }
           }
           if (!reg_tel.test(value)) {
           if (!reg_tel.test(value)) {
             /* eslint-disable-next-line */
             /* eslint-disable-next-line */
-            return Promise.reject('请输入正确的菜单名称');
+            return Promise.reject(t('routes.system.menuName2'));
           }
           }
           return Promise.resolve();
           return Promise.resolve();
         },
         },
@@ -178,7 +179,7 @@ export const formSchema: FormSchema[] = [
 
 
   {
   {
     field: 'parentId',
     field: 'parentId',
-    label: '上级菜单',
+    label: t('routes.system.menuParentName'),
     component: 'TreeSelect',
     component: 'TreeSelect',
     componentProps: {
     componentProps: {
       fieldNames: {
       fieldNames: {
@@ -192,14 +193,14 @@ export const formSchema: FormSchema[] = [
 
 
   {
   {
     field: 'orderNum',
     field: 'orderNum',
-    label: '排序',
+    label: t('routes.scenes.sortOrder'),
     defaultValue: 0,
     defaultValue: 0,
     component: 'InputNumber',
     component: 'InputNumber',
     required: true,
     required: true,
   },
   },
   {
   {
     field: 'icon',
     field: 'icon',
-    label: '图标',
+    label: t('routes.system.icon'),
     component: 'IconPicker',
     component: 'IconPicker',
     required: true,
     required: true,
     ifShow: ({ values }) => !isButton(values.type),
     ifShow: ({ values }) => !isButton(values.type),
@@ -207,45 +208,45 @@ export const formSchema: FormSchema[] = [
 
 
   {
   {
     field: 'path',
     field: 'path',
-    label: '路由地址',
+    label: t('routes.system.routerPath'),
     component: 'Input',
     component: 'Input',
     required: true,
     required: true,
     ifShow: ({ values }) => !isButton(values.type),
     ifShow: ({ values }) => !isButton(values.type),
   },
   },
   {
   {
     field: 'component',
     field: 'component',
-    label: '组件路径',
+    label: t('routes.system.component'),
     component: 'Input',
     component: 'Input',
     ifShow: ({ values }) => isMenu(values.type),
     ifShow: ({ values }) => isMenu(values.type),
   },
   },
   {
   {
     field: 'perms',
     field: 'perms',
-    label: '权限标识',
+    label: t('routes.system.perms'),
     defaultValue: '',
     defaultValue: '',
     component: 'Input',
     component: 'Input',
     ifShow: ({ values }) => !isDir(values.type),
     ifShow: ({ values }) => !isDir(values.type),
   },
   },
   {
   {
     field: 'status',
     field: 'status',
-    label: '状态',
+    label: t('routes.scenes.status'),
     component: 'RadioButtonGroup',
     component: 'RadioButtonGroup',
     defaultValue: 0,
     defaultValue: 0,
     componentProps: {
     componentProps: {
       options: [
       options: [
-        { label: '启用', value: 0 },
-        { label: '禁用', value: 1 },
+        { label: t('routes.system.enable'), value: 0 },
+        { label: t('routes.system.stopUsing'), value: 1 },
       ],
       ],
     },
     },
   },
   },
   {
   {
     field: 'isExt',
     field: 'isExt',
-    label: '是否外链',
+    label: t('routes.system.isExt.title'),
     component: 'RadioButtonGroup',
     component: 'RadioButtonGroup',
     defaultValue: 0,
     defaultValue: 0,
     componentProps: {
     componentProps: {
       options: [
       options: [
-        { label: '是', value: 1 },
-        { label: '否', value: 0 },
+        { label: t('routes.system.isExt.1'), value: 1 },
+        { label: t('routes.system.isExt.0'), value: 0 },
       ],
       ],
     },
     },
     ifShow: ({ values }) => !isButton(values.type),
     ifShow: ({ values }) => !isButton(values.type),
@@ -253,20 +254,20 @@ export const formSchema: FormSchema[] = [
 
 
   {
   {
     field: 'url',
     field: 'url',
-    label: '外链地址',
+    label: t('routes.system.menuUrl'),
     component: 'Input',
     component: 'Input',
     ifShow: ({ values }) => idShowExt(values.isExt),
     ifShow: ({ values }) => idShowExt(values.isExt),
   },
   },
 
 
   {
   {
     field: 'hideMenu',
     field: 'hideMenu',
-    label: '是否显示',
+    label: t('routes.scenes.isShow'),
     component: 'RadioButtonGroup',
     component: 'RadioButtonGroup',
     defaultValue: 0,
     defaultValue: 0,
     componentProps: {
     componentProps: {
       options: [
       options: [
-        { label: '是', value: 0 },
-        { label: '否', value: 1 },
+        { label: t('routes.system.isExt.1'), value: 0 },
+        { label: t('routes.system.isExt.0'), value: 1 },
       ],
       ],
     },
     },
     ifShow: ({ values }) => !isButton(values.type),
     ifShow: ({ values }) => !isButton(values.type),

+ 7 - 4
src/views/system/password/index.vue

@@ -3,8 +3,10 @@
     <div class="py-8 bg-white flex flex-col justify-center items-center">
     <div class="py-8 bg-white flex flex-col justify-center items-center">
       <BasicForm @register="register" />
       <BasicForm @register="register" />
       <div class="flex justify-center">
       <div class="flex justify-center">
-        <a-button @click="resetFields"> 重置 </a-button>
-        <a-button class="!ml-4" type="primary" @click="handleSubmit"> 确认 </a-button>
+        <a-button @click="resetFields"> {{ t('common.resetText') }} </a-button>
+        <a-button class="!ml-4" type="primary" @click="handleSubmit">
+          {{ t('common.okText') }}
+        </a-button>
       </div>
       </div>
     </div>
     </div>
   </PageWrapper>
   </PageWrapper>
@@ -13,12 +15,13 @@
   import { defineComponent } from 'vue';
   import { defineComponent } from 'vue';
   import { PageWrapper } from '/@/components/Page';
   import { PageWrapper } from '/@/components/Page';
   import { BasicForm, useForm } from '/@/components/Form';
   import { BasicForm, useForm } from '/@/components/Form';
-
+  import { useI18n } from '/@/hooks/web/useI18n';
   import { formSchema } from './pwd.data';
   import { formSchema } from './pwd.data';
   export default defineComponent({
   export default defineComponent({
     name: 'ChangePassword',
     name: 'ChangePassword',
     components: { BasicForm, PageWrapper },
     components: { BasicForm, PageWrapper },
     setup() {
     setup() {
+      const { t } = useI18n();
       const [register, { validate, resetFields }] = useForm({
       const [register, { validate, resetFields }] = useForm({
         size: 'large',
         size: 'large',
         labelWidth: 100,
         labelWidth: 100,
@@ -38,7 +41,7 @@
         } catch (error) {}
         } catch (error) {}
       }
       }
 
 
-      return { register, resetFields, handleSubmit };
+      return { register, resetFields, handleSubmit, t };
     },
     },
   });
   });
 </script>
 </script>

+ 9 - 8
src/views/system/password/pwd.data.ts

@@ -1,29 +1,30 @@
 import { FormSchema } from '/@/components/Form';
 import { FormSchema } from '/@/components/Form';
-
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
 export const formSchema: FormSchema[] = [
 export const formSchema: FormSchema[] = [
   {
   {
     field: 'passwordOld',
     field: 'passwordOld',
-    label: '当前密码',
+    label: t('routes.system.passwordOld'),
     component: 'InputPassword',
     component: 'InputPassword',
     required: true,
     required: true,
   },
   },
   {
   {
     field: 'passwordNew',
     field: 'passwordNew',
-    label: '新密码',
+    label: t('routes.system.passwordNew'),
     component: 'StrengthMeter',
     component: 'StrengthMeter',
     componentProps: {
     componentProps: {
-      placeholder: '新密码',
+      placeholder: t('routes.system.passwordNew'),
     },
     },
     rules: [
     rules: [
       {
       {
         required: true,
         required: true,
-        message: '请输入新密码',
+        message: t('routes.system.passwordNew1'),
       },
       },
     ],
     ],
   },
   },
   {
   {
     field: 'confirmPassword',
     field: 'confirmPassword',
-    label: '确认密码',
+    label: t('routes.system.confirmPassword'),
     component: 'InputPassword',
     component: 'InputPassword',
 
 
     dynamicRules: ({ values }) => {
     dynamicRules: ({ values }) => {
@@ -32,10 +33,10 @@ export const formSchema: FormSchema[] = [
           required: true,
           required: true,
           validator: (_, value) => {
           validator: (_, value) => {
             if (!value) {
             if (!value) {
-              return Promise.reject('不能为空');
+              return Promise.reject(t('routes.system.confirmPassword1'));
             }
             }
             if (value !== values.passwordNew) {
             if (value !== values.passwordNew) {
-              return Promise.reject('两次输入的密码不一致!');
+              return Promise.reject(t('routes.system.confirmPassword2'));
             }
             }
             return Promise.resolve();
             return Promise.resolve();
           },
           },

+ 7 - 2
src/views/system/role/RoleDrawer.vue

@@ -16,7 +16,7 @@
           :fieldNames="{ title: 'name', key: 'menuId' }"
           :fieldNames="{ title: 'name', key: 'menuId' }"
           :checkable="true"
           :checkable="true"
           toolbar
           toolbar
-          title="菜单分配"
+          :title="t('layout.setting.menuDistribution')"
         />
         />
       </template>
       </template>
     </BasicForm>
     </BasicForm>
@@ -31,6 +31,7 @@
   import { BasicTree } from '/@/components/Tree';
   import { BasicTree } from '/@/components/Tree';
   import { makeMenuTree, TreeMenuNode } from '/@/utils/treeUtils';
   import { makeMenuTree, TreeMenuNode } from '/@/utils/treeUtils';
   import { getMenuList, saveRoleApi, updateRoleApi } from '/@/api/system/system';
   import { getMenuList, saveRoleApi, updateRoleApi } from '/@/api/system/system';
+  import { useI18n } from '/@/hooks/web/useI18n';
 
 
   export default defineComponent({
   export default defineComponent({
     name: 'RoleDrawer',
     name: 'RoleDrawer',
@@ -39,6 +40,7 @@
     setup(_, { emit }) {
     setup(_, { emit }) {
       const isUpdate = ref(true);
       const isUpdate = ref(true);
       const treeData = ref<TreeMenuNode[]>([]);
       const treeData = ref<TreeMenuNode[]>([]);
+      const { t } = useI18n();
       const roleId = ref(0);
       const roleId = ref(0);
       const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
       const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
         labelWidth: 90,
         labelWidth: 90,
@@ -65,7 +67,9 @@
         }
         }
       });
       });
 
 
-      const getTitle = computed(() => (!unref(isUpdate) ? '新增角色' : '编辑角色'));
+      const getTitle = computed(() =>
+        !unref(isUpdate) ? t('common.addRoleName') : t('common.editRoleName'),
+      );
 
 
       async function handleSubmit() {
       async function handleSubmit() {
         try {
         try {
@@ -98,6 +102,7 @@
         getTitle,
         getTitle,
         handleSubmit,
         handleSubmit,
         treeData,
         treeData,
+        t,
       };
       };
     },
     },
   });
   });

+ 8 - 6
src/views/system/role/index.vue

@@ -8,14 +8,14 @@
         <TableAction
         <TableAction
           :actions="[
           :actions="[
             {
             {
-              label: '编辑',
+              label: t('common.edit'),
               onClick: handleEdit.bind(null, record),
               onClick: handleEdit.bind(null, record),
             },
             },
             {
             {
-              label: '删除',
+              label: t('common.delText'),
               color: 'error',
               color: 'error',
               popConfirm: {
               popConfirm: {
-                title: '是否确认删除',
+                title: t('common.delConfirm'),
                 confirm: handleDelete.bind(null, record),
                 confirm: handleDelete.bind(null, record),
               },
               },
             },
             },
@@ -28,7 +28,7 @@
 </template>
 </template>
 <script lang="ts">
 <script lang="ts">
   import { defineComponent, nextTick } from 'vue';
   import { defineComponent, nextTick } from 'vue';
-
+  import { useI18n } from '/@/hooks/web/useI18n';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { getRoleListByPage, deleteRoleApi } from '/@/api/system/system';
   import { getRoleListByPage, deleteRoleApi } from '/@/api/system/system';
   import { useDrawer } from '/@/components/Drawer';
   import { useDrawer } from '/@/components/Drawer';
@@ -41,11 +41,12 @@
     name: 'RoleManagement',
     name: 'RoleManagement',
     components: { BasicTable, RoleDrawer, TableAction },
     components: { BasicTable, RoleDrawer, TableAction },
     setup() {
     setup() {
+      const { t } = useI18n();
       const [registerDrawer, { openDrawer }] = useDrawer();
       const [registerDrawer, { openDrawer }] = useDrawer();
       const userStore = useUserStore();
       const userStore = useUserStore();
       const { getCheckRole } = userStore;
       const { getCheckRole } = userStore;
       const [registerTable, { reload }] = useTable({
       const [registerTable, { reload }] = useTable({
-        title: '角色列表',
+        title: t('routes.system.roleTitle'),
         api: getRoleListByPage,
         api: getRoleListByPage,
         columns,
         columns,
         formConfig: {
         formConfig: {
@@ -59,7 +60,7 @@
         actionColumn: {
         actionColumn: {
           ifShow: getCheckRole('super'),
           ifShow: getCheckRole('super'),
           width: 110,
           width: 110,
-          title: '操作',
+          title: t('common.operating'),
           dataIndex: 'action',
           dataIndex: 'action',
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
           fixed: undefined,
           fixed: undefined,
@@ -102,6 +103,7 @@
         handleDelete,
         handleDelete,
         handleSuccess,
         handleSuccess,
         getCheckRole,
         getCheckRole,
+        t,
       };
       };
     },
     },
   });
   });

+ 11 - 9
src/views/system/role/role.data.ts

@@ -4,6 +4,8 @@ import { h } from 'vue';
 // import { Switch } from 'ant-design-vue';
 // import { Switch } from 'ant-design-vue';
 import { Time } from '/@/components/Time';
 import { Time } from '/@/components/Time';
 import { ListAllCompanyApi } from '/@/api/corporation/list';
 import { ListAllCompanyApi } from '/@/api/corporation/list';
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
 
 
 export const columns: BasicColumn[] = [
 export const columns: BasicColumn[] = [
   {
   {
@@ -12,12 +14,12 @@ export const columns: BasicColumn[] = [
     width: 80,
     width: 80,
   },
   },
   {
   {
-    title: '角色名称',
+    title: t('common.roleNameText'),
     dataIndex: 'roleName',
     dataIndex: 'roleName',
     width: 200,
     width: 200,
   },
   },
   {
   {
-    title: '所属公司',
+    title: t('routes.staff.deptName'),
     dataIndex: 'companyName',
     dataIndex: 'companyName',
     width: 180,
     width: 180,
   },
   },
@@ -59,7 +61,7 @@ export const columns: BasicColumn[] = [
   //   },
   //   },
   // },
   // },
   {
   {
-    title: '创建时间',
+    title: t('routes.staff.createTime'),
     dataIndex: 'createTime',
     dataIndex: 'createTime',
     width: 180,
     width: 180,
     customRender: ({ record }) => {
     customRender: ({ record }) => {
@@ -70,7 +72,7 @@ export const columns: BasicColumn[] = [
     },
     },
   },
   },
   {
   {
-    title: '备注',
+    title: t('routes.system.remarks'),
     dataIndex: 'remark',
     dataIndex: 'remark',
   },
   },
 ];
 ];
@@ -78,7 +80,7 @@ export const columns: BasicColumn[] = [
 export const searchFormSchema: FormSchema[] = [
 export const searchFormSchema: FormSchema[] = [
   {
   {
     field: 'roleName',
     field: 'roleName',
-    label: '角色名称',
+    label: t('common.roleNameText'),
     component: 'Input',
     component: 'Input',
     componentProps: {
     componentProps: {
       maxLength: 100,
       maxLength: 100,
@@ -102,13 +104,13 @@ export const searchFormSchema: FormSchema[] = [
 export const formSchema: FormSchema[] = [
 export const formSchema: FormSchema[] = [
   {
   {
     field: 'roleName',
     field: 'roleName',
-    label: '角色名称',
+    label: t('common.roleNameText'),
     required: true,
     required: true,
     component: 'Input',
     component: 'Input',
   },
   },
   {
   {
     field: 'companyId',
     field: 'companyId',
-    label: '公司',
+    label: t('routes.staff.companyId'),
     component: 'ApiSelect',
     component: 'ApiSelect',
     // required: true,
     // required: true,
     itemProps: {
     itemProps: {
@@ -144,7 +146,7 @@ export const formSchema: FormSchema[] = [
   // },
   // },
   {
   {
     field: 'isPlatformRole',
     field: 'isPlatformRole',
-    label: '是否平台角色',
+    label: t('routes.system.isPlatformRole'),
     component: 'RadioButtonGroup',
     component: 'RadioButtonGroup',
     defaultValue: 0,
     defaultValue: 0,
     componentProps: {
     componentProps: {
@@ -155,7 +157,7 @@ export const formSchema: FormSchema[] = [
     },
     },
   },
   },
   {
   {
-    label: '备注',
+    label: t('routes.system.remarks'),
     field: 'remark',
     field: 'remark',
     component: 'InputTextArea',
     component: 'InputTextArea',
   },
   },