index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="follow_wrap">
  3. <u-navbar placeholder title="呼叫中心配置" @rightClick="handleNavSaveClick" @leftClick="handleBack">
  4. <view class="u-nav-slot" slot="left">
  5. <u-icon name="arrow-left" size="19"></u-icon>
  6. </view>
  7. <view class="u-nav-slot" slot="right">
  8. 保存
  9. </view>
  10. </u-navbar>
  11. <view class="form_wrap">
  12. <u--form labelPosition="left" labelWidth="100" :model="form" :rules="rules" ref="form" class="form_wrap">
  13. <u-form-item label="是否启用" prop="isCallOff" borderBottom>
  14. <u-switch inactiveColor="rgb(230, 230, 230)" v-model="form.isCallOff" inactiveValue="2" activeValue="1"
  15. size="20" @change="changeIsCallOff"></u-switch>
  16. </u-form-item>
  17. <u-form-item label="呼叫中心" prop="webRtcIp" borderBottom class="form_required">
  18. <u--input v-model="form.webRtcIp" disabledColor="#ffffff" placeholder="如:10.12.200.100"
  19. border="none"></u--input>
  20. </u-form-item>
  21. <u-form-item label="端口号" prop="webRtcPort" borderBottom class="form_required">
  22. <u--input v-model="form.webRtcPort" disabledColor="#ffffff" placeholder="如:5500" border="none"></u--input>
  23. </u-form-item>
  24. <view class="line"></view>
  25. <u-form-item label="版本号" prop="folder" borderBottom>
  26. v{{version}}
  27. </u-form-item>
  28. </u--form>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. version: this.$store.state.app.currentVersion,
  37. rules: {
  38. 'webRtcIp': {
  39. type: 'string',
  40. required: true,
  41. message: '请输入呼叫中心地址',
  42. trigger: ['blur', 'change']
  43. },
  44. 'webRtcPort': {
  45. type: 'string',
  46. required: true,
  47. message: '请输入呼叫中心端口',
  48. trigger: ['blur', 'change']
  49. },
  50. },
  51. form : uni.$u.deepClone(this.$store.state.user.netConfig),
  52. }
  53. },
  54. methods: {
  55. changeIsCallOff(value){
  56. this.form.isCallOff = value;
  57. },
  58. handleBack(){
  59. uni.navigateTo({
  60. url: "/pages/login/index"
  61. })
  62. },
  63. handleNavSaveClick() {
  64. this.$refs.form.validate().then(async () => {
  65. this.$store.commit("user/SET_NETCONFIG", this.form);
  66. uni.$u.api.getAppSystemList().then((res)=>{
  67. const systemCodeList = res.data;
  68. this.$store.dispatch("user/setSystemlist",systemCodeList);
  69. uni.$u.toast("保存成功");
  70. this.handleBack();
  71. }).catch((e)=>{
  72. uni.$u.toast("服务网络不通");
  73. })
  74. })
  75. },
  76. },
  77. onLoad(option) {}
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .form_wrap {
  82. background-color: #fff;
  83. margin: 20rpx 0;
  84. .form_wrap {
  85. ::v-deep .u-form-item__body {
  86. padding: 20rpx 40rpx;
  87. }
  88. }
  89. .line {
  90. width: 100%;
  91. height: 20rpx;
  92. background: #f5f6f8;
  93. }
  94. .uuid_box {
  95. display: flex;
  96. align-items: center;
  97. text-align: right;
  98. justify-content: space-between;
  99. .copy_btn {
  100. display: flex;
  101. font-size: 24rpx;
  102. color: #108CFF;
  103. margin-left: 20rpx;
  104. }
  105. }
  106. }
  107. </style>