瀏覽代碼

图像识别

zhujindu 9 月之前
父節點
當前提交
70da588ba1
共有 2 個文件被更改,包括 465 次插入1 次删除
  1. 233 1
      src/views/AIImage/AIImageDetail.vue
  2. 232 0
      src/views/AIImage/radioGroup.vue

+ 233 - 1
src/views/AIImage/AIImageDetail.vue

@@ -41,17 +41,231 @@
       </div>
     </div>
     <p class="titleText">反馈不一致原因</p>
-    <div class="feedbackReason"></div>
+    <div class="feedbackReason">
+      <radioGroup :clueOptionList="customerClueItemList"></radioGroup>
+    </div>
+    <div class="confirmBtn"><van-button type="info">提交</van-button></div>
   </div>
 </template>
 <script>
 import { ImagePreview } from 'vant';
+import radioGroup from './radioGroup.vue';
 export default {
   name: 'AIImageDetail',
+  components: { radioGroup },
   data() {
     return {
       data: {},
       storeId: null,
+      customerClueItemList: [
+        {
+          searchValue: null,
+          createBy: 'admin',
+          createTime: '2024-12-18 13:55:04',
+          updateBy: '',
+          updateTime: null,
+          remark: '',
+          params: {},
+          pageSize: null,
+          pageNum: null,
+          customerClueItemId: 357,
+          customerClueId: 72,
+          customerClueInfoId: 263,
+          customerClueName: 'Ai识别是否正檐',
+          itemOptionParentId: null,
+          isMust: '0',
+          answerType: 'dx',
+          minTextLength: null,
+          answerValue: null,
+          sort: 1,
+          delFlag: null,
+          fileIdList: null,
+          customerClueOptionList: [
+            {
+              searchValue: null,
+              createBy: 'admin',
+              createTime: '2024-12-18 13:55:04',
+              updateBy: '',
+              updateTime: null,
+              remark: null,
+              params: {},
+              pageSize: null,
+              pageNum: null,
+              customerClueOptionId: 470,
+              customerClueItemId: 357,
+              customerClueOption: '是',
+              value: 'N',
+              checked: false,
+              customerClueItemList: [],
+            },
+            {
+              searchValue: null,
+              createBy: 'admin',
+              createTime: '2024-12-18 13:55:04',
+              updateBy: '',
+              updateTime: null,
+              remark: null,
+              params: {},
+              pageSize: null,
+              pageNum: null,
+              customerClueOptionId: 471,
+              customerClueItemId: 357,
+              customerClueOption: '否',
+              value: 'N',
+              checked: false,
+              customerClueItemList: [],
+            },
+          ],
+          fileInfoList: null,
+          max: false,
+          del: true,
+        },
+        {
+          searchValue: null,
+          createBy: 'admin',
+          createTime: '2024-12-18 13:55:04',
+          updateBy: '',
+          updateTime: null,
+          remark: '',
+          params: {},
+          pageSize: null,
+          pageNum: null,
+          customerClueItemId: 358,
+          customerClueId: 72,
+          customerClueInfoId: 263,
+          customerClueName: '处理情况',
+          itemOptionParentId: null,
+          isMust: '0',
+          answerType: 'dx',
+          minTextLength: null,
+          answerValue: null,
+          sort: 2,
+          delFlag: null,
+          fileIdList: null,
+          customerClueOptionList: [
+            {
+              searchValue: null,
+              createBy: 'admin',
+              createTime: '2024-12-18 13:55:04',
+              updateBy: '',
+              updateTime: null,
+              remark: null,
+              params: {},
+              pageSize: null,
+              pageNum: null,
+              customerClueOptionId: 472,
+              customerClueItemId: 358,
+              customerClueOption: '处理中',
+              value: 'N',
+              checked: false,
+              customerClueItemList: [
+                {
+                  searchValue: null,
+                  createBy: 'admin',
+                  createTime: '2024-12-18 13:55:04',
+                  updateBy: '',
+                  updateTime: null,
+                  remark: '请输入进度',
+                  params: {},
+                  pageSize: null,
+                  pageNum: null,
+                  customerClueItemId: 359,
+                  customerClueId: 72,
+                  customerClueInfoId: null,
+                  customerClueName: '处理进度',
+                  itemOptionParentId: 472,
+                  isMust: '0',
+                  answerType: 'wb',
+                  minTextLength: null,
+                  answerValue: null,
+                  sort: 3,
+                  delFlag: null,
+                  fileIdList: null,
+                  customerClueOptionList: [],
+                  fileInfoList: null,
+                  max: false,
+                  del: true,
+                },
+              ],
+            },
+            {
+              searchValue: null,
+              createBy: 'admin',
+              createTime: '2024-12-18 13:55:04',
+              updateBy: '',
+              updateTime: null,
+              remark: null,
+              params: {},
+              pageSize: null,
+              pageNum: null,
+              customerClueOptionId: 473,
+              customerClueItemId: 358,
+              customerClueOption: '已解决',
+              value: 'N',
+              checked: false,
+              customerClueItemList: [
+                {
+                  searchValue: null,
+                  createBy: 'admin',
+                  createTime: '2024-12-18 13:55:04',
+                  updateBy: '',
+                  updateTime: null,
+                  remark: '解决方案请输入10字以上',
+                  params: {},
+                  pageSize: null,
+                  pageNum: null,
+                  customerClueItemId: 360,
+                  customerClueId: 72,
+                  customerClueInfoId: null,
+                  customerClueName: '解决方案',
+                  itemOptionParentId: 473,
+                  isMust: '0',
+                  answerType: 'wb',
+                  minTextLength: 10,
+                  answerValue: null,
+                  sort: 3,
+                  delFlag: null,
+                  fileIdList: null,
+                  customerClueOptionList: [],
+                  fileInfoList: null,
+                  max: false,
+                  del: true,
+                },
+              ],
+            },
+          ],
+          fileInfoList: null,
+          max: false,
+          del: true,
+        },
+        {
+          searchValue: null,
+          createBy: 'admin',
+          createTime: '2024-12-18 13:54:13',
+          updateBy: 'admin',
+          updateTime: '2024-12-18 13:55:04',
+          remark: '',
+          params: {},
+          pageSize: null,
+          pageNum: null,
+          customerClueItemId: 361,
+          customerClueId: 72,
+          customerClueInfoId: 263,
+          customerClueName: '结果照片上传',
+          itemOptionParentId: null,
+          isMust: '1',
+          answerType: 'zp',
+          minTextLength: null,
+          answerValue: null,
+          sort: 4,
+          delFlag: null,
+          fileIdList: null,
+          customerClueOptionList: [],
+          fileInfoList: null,
+          max: false,
+          del: true,
+        },
+      ],
     };
   },
   mounted() {
@@ -106,5 +320,23 @@ export default {
       }
     }
   }
+  .titleText {
+    padding: 10px 0;
+    font-size: 16px;
+    font-weight: 600;
+    margin: 0;
+  }
+  .feedbackReason {
+    padding: 10px;
+    background: #fff;
+  }
+  .confirmBtn {
+    position: sticky;
+    bottom: 0;
+    padding-top: 20px;
+    button {
+      width: 100%;
+    }
+  }
 }
 </style>

+ 232 - 0
src/views/AIImage/radioGroup.vue

@@ -0,0 +1,232 @@
+<template>
+  <div class="radioGroup">
+    <template v-for="(val, ind) in clueOptionList">
+      <!-- <div class="title" v-if="val.customerClueName">
+          <span class="van-f-red" v-if="val.isMust == 0">*</span>
+          {{ val.customerClueName }}
+        </div> -->
+      <template v-if="val.answerType == 'dx'">
+        <div class="title" v-if="val.customerClueName">
+          <span class="van-f-red" v-if="val.isMust == 0">*</span>
+          {{ val.customerClueName }}
+        </div>
+        <van-radio-group v-model="val.searchValue" @change="radioGroupChange">
+          <template v-for="(item, index) in val.customerClueOptionList">
+            <van-radio :name="item.customerClueOptionId" @click="radioClick" :key="index">
+              {{ item.customerClueOption }}
+            </van-radio>
+            <radioGroup
+              :clueOptionList="item.customerClueItemList"
+              :parentOptionList="val"
+              :parentId="item.customerClueOptionId"
+              v-if="val.searchValue == item.customerClueOptionId"></radioGroup>
+          </template>
+        </van-radio-group>
+      </template>
+      <!-- 回答类型:wb-文本,sz-数字,rq-日期,zp-照片,dx-单选,bg-表格 -->
+      <template v-if="val.answerType == 'wb'">
+        <div class="title" v-if="val.customerClueName">
+          <span class="van-f-red" v-if="val.isMust == 0">*</span>
+          {{ val.customerClueName }}
+        </div>
+        <template v-if="parentOptionList.searchValue == val.itemOptionParentId">
+          <van-field
+            v-model="val.answerValue"
+            :placeholder="val.remark"
+            :minTextLength="val.minTextLength"
+            :error-message="val.remark"
+            :class="{
+              fieldInput: true,
+              rulesClass: val.answerValue != null && val.answerValue.length < val.minTextLength,
+            }" />
+          <span
+            class="rulesErrorMessage"
+            v-if="val.answerValue != null && val.answerValue.length < val.minTextLength">
+            {{ val.remark }}
+          </span>
+        </template>
+      </template>
+      <!-- 数字输入框 -->
+      <template v-if="val.answerType == 'sz'">
+        <div class="title" v-if="val.customerClueName">
+          <span class="van-f-red" v-if="val.isMust == 0">*</span>
+          {{ val.customerClueName }}
+        </div>
+        <van-field
+          class="fieldInput"
+          v-model="val.answerValue"
+          :placeholder="val.remark"
+          :minTextLength="val.minTextLength"
+          :error-message="val.remark"
+          type="number"></van-field>
+      </template>
+      <!-- 表格 -->
+      <template v-if="val.answerType == 'bg'">
+        <div class="title" v-if="val.customerClueName">
+          <span class="van-f-red" v-if="val.isMust == 0">*</span>
+          {{ val.customerClueName }}
+        </div>
+        <el-table :data="val.tableData.data" style="width: 100%; position: relative; left: -10px">
+          <el-table-column
+            v-for="(item, index) in val.tableData.title"
+            :prop="item.prop"
+            :label="item.label"
+            align="center">
+            <template slot-scope="scope">
+              <template v-if="item.answerType == 'text'">
+                {{ scope.row[item.prop] }}
+              </template>
+              <template v-if="item.answerType == 'wb'">
+                <van-field v-model="scope.row[item.prop]" />
+              </template>
+              <!-- 正整数 digit -->
+              <template v-if="item.answerType == 'sz'">
+                <van-field v-model="scope.row[item.prop]" type="digit" />
+              </template>
+            </template>
+          </el-table-column>
+        </el-table>
+      </template>
+    </template>
+  </div>
+</template>
+<script>
+export default {
+  name: 'radioGroup',
+  props: {
+    clueOptionList: {
+      type: Array,
+      default: () => [],
+    },
+    parentOptionList: {
+      type: Object,
+      default: () => {},
+    },
+    parentId: {
+      type: [Number, null],
+      default: null,
+    },
+  },
+  data() {
+    return {};
+  },
+  watch: {
+    clueOptionList: {
+      handler(val) {
+        val.forEach((item) => {
+          // bg表格数据存在remark
+          if (item.answerType == 'bg') {
+            this.$set(item, 'tableData', JSON.parse(item.remark));
+          }
+        });
+      },
+      immediate: true,
+    },
+  },
+  created() {
+    // console.log(this.clueOptionList);
+  },
+  methods: {
+    radioGroupChange(name) {
+      if (!name) return;
+      // console.log(name);
+      // console.log(this.clueOptionList);
+      // 如果选中的数据有父级,将父级数据修改为选中状态
+      if (this.parentOptionList && this.parentId) {
+        this.$set(this.parentOptionList, 'searchValue', this.parentId);
+      }
+      // 获取选中数据
+      let clueOptionList = this.clueOptionList.find((val) => val.searchValue == name);
+      let activaRadio = clueOptionList.customerClueOptionList.find(
+        (val) => val.customerClueOptionId == name
+      );
+      // 修改选中状态
+      this.$set(activaRadio, 'value', 'Y');
+
+      // 过滤未选中的数据
+      let exceptItself = clueOptionList.customerClueOptionList.filter(
+        (val) => val.customerClueOptionId !== name
+      );
+      // 删除未选中数据状态兄弟级和子级
+      // console.log(exceptItself);
+      this.toggleOtheChildren(exceptItself);
+    },
+    toggleOtheChildren(exceptItself) {
+      if (!exceptItself) return;
+      exceptItself.forEach((val) => {
+        this.$set(val, 'value', 'N');
+        if (val.customerClueItemList && val.customerClueItemList[0]) {
+          this.$set(val.customerClueItemList[0], 'searchValue', null);
+          if (
+            val.customerClueItemList[0] &&
+            val.customerClueItemList[0].customerClueOptionList.length
+          ) {
+            this.toggleOtheChildren(val.customerClueItemList[0].customerClueOptionList);
+          }
+        }
+      });
+    },
+    radioClick(event) {
+      // console.log(event);
+    },
+  },
+};
+</script>
+<style lang="scss">
+.radioGroup {
+  font-size: 15px;
+  .van-radio {
+    padding: 5px 0;
+  }
+  .van-radio-group {
+    padding-left: 20px;
+  }
+  .van-cell {
+    padding: 10px 0;
+    /* font-size: 14px; */
+  }
+  .van-cell::after {
+    border: 0;
+  }
+  .van-field {
+    padding: 0;
+    width: 100%;
+    border-radius: 4px;
+    overflow: hidden;
+    background-color: unset;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #cdc8c8;
+  }
+  .van-field__control {
+    /* padding: 0 10px; */
+    /* margin: 5px 0; */
+    padding-left: 10px;
+  }
+  .van-radio__label {
+    /* font-size: 14px; */
+  }
+  .van-f-red {
+    font-size: 14px;
+  }
+  .rulesClass {
+    border: 1px solid #ff0505;
+  }
+  .fieldInput {
+    /* height: 38px; */
+  }
+  .rulesErrorMessage {
+    color: red;
+    font-size: 12px;
+    padding: 3px 0;
+  }
+  .uploadImg {
+    width: 50px;
+  }
+  .el-table {
+    .el-table__cell {
+      padding: 3px 0;
+    }
+  }
+}
+</style>