Forráskód Böngészése

文本分析列表删除增加确定,修改跳转参数不不正确,图标展示不全,词表排序重新写。

qinpeng 2 éve
szülő
commit
72a615d050

BIN
src/assets/teacherdev/sort-down.png


BIN
src/assets/teacherdev/sort-sele-down.png


BIN
src/assets/teacherdev/sort-sele-up.png


BIN
src/assets/teacherdev/sort-up.png


+ 265 - 8
src/views/Textanalysis/WordTable.vue

@@ -31,11 +31,142 @@
         </div>
       </div>
       <div class="table">
-        <el-table
+        <table border="0" cellspacing="0" cellpadding="0">
+          <tr>
+            <th
+              v-for="(item, i) in tableHeader"
+              :key="i"
+              :style="{ width: item.width }"
+              :class="[i == tableHeader.length - 1 ? 'bz' : '']"
+              v-if="
+                (item.name == '拼音' && typeIndex != 0) || item.name != '拼音'
+              "
+            >
+              <div>
+                <span>
+                  {{
+                    item.name == "音节"
+                      ? typeIndex == 0
+                        ? "音节"
+                        : "汉字"
+                      : item.name
+                  }}
+                </span>
+                <template v-if="item.sortShow">
+                  <div class="sort">
+                    <div>
+                      <img
+                        v-if="item.sort != 'up'"
+                        @click="SortEvent('up', item.name, item.sortName)"
+                        src="../../assets/teacherdev/sort-up.png"
+                        alt=""
+                      />
+                      <img
+                        v-if="item.sort == 'up'"
+                        @click="SortEvent('up', item.name, item.sortName)"
+                        src="../../assets/teacherdev/sort-sele-up.png"
+                        alt=""
+                      />
+                    </div>
+                    <div>
+                      <img
+                        v-if="item.sort != 'down'"
+                        @click="SortEvent('down', item.name, item.sortName)"
+                        src="../../assets/teacherdev/sort-down.png"
+                        alt=""
+                      />
+                      <img
+                        v-if="item.sort == 'down'"
+                        @click="SortEvent('down', item.name, item.sortName)"
+                        src="../../assets/teacherdev/sort-sele-down.png"
+                        alt=""
+                      />
+                    </div>
+                  </div>
+                </template>
+              </div>
+            </th>
+          </tr>
+          <tr v-for="(item, i) in dataList.list" :key="i + 'td'">
+            <td class="sort-td">{{ item.number }}</td>
+            <td class="sort-td">
+              <span
+                :style="{
+                  color:
+                    item.levelName && levelMap[item.levelName]
+                      ? levelMap[item.levelName].color
+                      : '',
+                }"
+                >{{ item.word }}</span
+              >
+            </td>
+            <td class="sort-td" v-if="typeIndex != 0">
+              {{ item.pinYin }}
+            </td>
+            <td class="sort-td">
+              <span
+                :style="{
+                  color:
+                    item.gradeName && levelMap[item.gradeName]
+                      ? levelMap[item.gradeName].color
+                      : '',
+                }"
+                >{{ item.gradeName }}</span
+              >
+            </td>
+            <td class="sort-td">
+              <span
+                :style="{
+                  color:
+                    item.levelName && levelMap[item.levelName]
+                      ? levelMap[item.levelName].color
+                      : '',
+                }"
+                >{{ item.levelName }}</span
+              >
+            </td>
+            <td class="sort-td">
+              {{ item.freq }}
+            </td>
+            <td class="sort-td">{{ item.textRatio }}%</td>
+            <td>
+              <div style="display: flex">
+                <span
+                  v-for="(items, i) in item.remarks"
+                  :key=""
+                  class="beizhu"
+                  style="margin-right: 10px"
+                >
+                  <span
+                    style="font-size: 18px; font-weight: 400"
+                    v-html="items.word"
+                  >
+                  </span>
+                  <span
+                    :style="{
+                      color:
+                        items.levelName && levelMap[items.levelName]
+                          ? levelMap[items.levelName].color
+                          : '',
+                    }"
+                  >
+                    {{ items.levelName }}
+                  </span>
+                  <span>
+                    {{ items.freq }}
+                  </span>
+                </span>
+              </div>
+            </td>
+          </tr>
+        </table>
+        <!-- <el-table
           :data="dataList.list"
           style="width: 100%"
           @sort-change="sort_change"
           ref="table"
+          :sort-orders="['levelName']"
+          sortable="custom"
         >
           <el-table-column prop="number" label="序号" width="48" align="center">
           </el-table-column>
@@ -90,10 +221,6 @@
           <el-table-column prop="freq" label="频数" width="108" sortable>
           </el-table-column>
           <el-table-column prop="textRatio" label="比例" width="110" sortable>
-            <!-- <template slot-scope="item">
-              <span v-if="headText == 1">{{ item.row.wordRatio }}%</span>
-              <span v-else>{{ item.row.textRatio }}%</span>
-            </template> -->
           </el-table-column>
           <el-table-column prop="" label="备注">
             <template slot-scope="item">
@@ -126,7 +253,7 @@
               </div>
             </template>
           </el-table-column>
-        </el-table>
+        </el-table> -->
       </div>
       <div class="page" v-if="dataList.list.length > 0">
         <el-pagination
@@ -162,6 +289,62 @@ export default {
       typeIndex: 0,
       headText: 1,
       keyword: "",
+      tableHeader: [
+        {
+          name: "序号",
+          sortShow: false,
+          width: "48px",
+        },
+        {
+          name: "音节",
+          sortShow: true,
+          sort: "",
+          width: "93px",
+          sortName: "word",
+        },
+        {
+          name: "拼音",
+          sortShow: true,
+          sort: "",
+          width: "95px",
+          sortName: "pin_yin",
+        },
+        {
+          name: "等次",
+          sortShow: true,
+          sort: "",
+          width: "95px",
+          sortName: "grade_id",
+        },
+        {
+          name: "级别",
+          sortShow: true,
+          sort: "down",
+          width: "106px",
+          sortName: "level_id",
+        },
+        {
+          name: "频数",
+          sortShow: true,
+          sort: "",
+          width: "108px",
+          sortName: "freq",
+        },
+        {
+          name: "比例",
+          sortShow: true,
+          sort: "",
+          width: "110px",
+          sortName: "word_ratio",
+        },
+        {
+          name: "备注",
+          sortShow: false,
+          sort: "",
+          width: "",
+          sortName: "",
+        },
+      ],
       dataList: {
         list: [],
       },
@@ -171,8 +354,8 @@ export default {
       searchType: null,
       levelMap: null,
       loading: false,
-      sortType: null,
-      sortField: null,
+      sortType: 0,
+      sortField: "level_id",
     };
   },
   //计算属性 类似于data概念
@@ -218,6 +401,26 @@ export default {
       this.page = 1;
       this.getlist();
     },
+    SortEvent(type, name,sortName) {
+      this.tableHeader.forEach((item) => {
+        if (item.name == name) {
+          if (!item.sort || item.sort == "up") {
+            item.sort = "down";
+          } else if (item.sort == "down") {
+            item.sort = "up";
+          }
+        } else {
+          item.sort = "";
+        }
+      });
+      if (type == "down") {
+        this.sortType = 1;
+      } else {
+        this.sortType = 0;
+      }
+      this.sortField = sortName;
+      this.getlist();
+    },
     sort_change(column, prop, order) {
       if (this.$refs.table) this.$refs.table.clearSort();
       column.column.order = column.order;
@@ -352,7 +555,61 @@ export default {
     }
     .table {
       margin-top: 21px;
+      table {
+        width: 100%;
+        border-collapse: collapse;
+        background: #ffffff;
+
+        th {
+          background: #ffffff;
+          .bz {
+            flex: 1;
+          }
+          > div {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            padding: 0 8px;
+            height: 48px;
+
+            .sort {
+              cursor: pointer;
+              > div {
+                img {
+                  width: 11px;
+                  height: 11px;
+                }
+              }
+              > :nth-child(1) {
+                > img {
+                  position: relative;
+                  top: 3px;
+                }
+              }
+              > :nth-child(2) {
+                > img {
+                  position: relative;
+                  bottom: 7px;
+                }
+              }
+            }
+          }
+        }
+        td {
+          height: 40px;
+          line-height: 40px;
+          text-align: left;
+          border-bottom: 1px solid #eeeeee;
+          font-weight: 600;
+          font-size: 14px;
+        }
+        .sort-td {
+          padding: 0 9px;
+          text-align: center;
+        }
+      }
     }
+
     .page {
       margin-top: 24px;
     }

+ 3 - 2
src/views/Textanalysis/index.vue

@@ -997,6 +997,7 @@ export default {
             tooltip: {},
             radar: {
               indicator: leidaList,
+              radius:"50%"
             },
             series: buildSeries(value),
           };
@@ -1046,7 +1047,7 @@ export default {
             : this.base.vocabularyTextCount;
       }
       postapi({
-        url: "/GCLSTCServer/tools/TS/statistics",
+        url: "/GCLSTRCServer/tools/TS/statistics",
         data: {
           searchType: this.leftNavIndex,
           partitionKey: this.partitionKey,
@@ -1076,7 +1077,7 @@ export default {
     getArticleData() {
       this.loading = true;
       postapi({
-        url: "/GCLSTCServer/tools/TS/analysis/parsed/text",
+        url: "/GCLSTRCServer/tools/TS/analysis/parsed/text",
         data: {
           partitionKey: this.partitionKey,
         },

+ 11 - 9
src/views/teacher-dev/TextAnalysis.vue

@@ -29,11 +29,13 @@
             </div>
             <div class="time">{{ item.createDate }}</div>
             <div class="cxjx" @click="anewSubmit(item)">重新解析</div>
-            <img
-              @click="deleteOne(item.id, i)"
-              src="../../assets/teacherdev/delete-one.png"
-              alt=""
-            />
+            <el-popconfirm title="确定删除这一条记录吗?" @confirm='deleteOne(item.id, i)'>
+              <img
+                slot="reference"
+                src="../../assets/teacherdev/delete-one.png"
+                alt=""
+              />
+            </el-popconfirm>
           </div>
         </div>
       </div>
@@ -78,7 +80,7 @@ export default {
           query: {
             partitionKey: item.partitionKey,
             subjectWords: item.subjectWords,
-            wordTextCount: item.textCount,
+            wordTextCount: item.wordTextCount,
             wordCount: item.wordCount,
             vocabularyTextCount: item.vocabularyTextCount,
             vocabularyCount: item.vocabularyCount,
@@ -114,7 +116,7 @@ export default {
     },
     anewSubmit(item) {
       this.loading = true;
-      postapi({ 
+      postapi({
         url: "/GCLSTCServer/tools/TS/reparse",
         data: {
           partitionKey: item.partitionKey,
@@ -127,7 +129,7 @@ export default {
               query: {
                 partitionKey: res.data.result.partitionKey,
                 subjectWords: res.data.result.subjectWords,
-                wordTextCount: res.data.result.textCount,
+                wordTextCount: res.data.result.wordTextCount,
                 wordCount: res.data.result.wordCount,
                 vocabularyTextCount: res.data.result.vocabularyTextCount,
                 vocabularyCount: res.data.result.vocabularyCount,
@@ -170,7 +172,7 @@ export default {
               query: {
                 partitionKey: res.data.result.partitionKey,
                 subjectWords: res.data.result.subjectWords,
-                wordTextCount: res.data.result.textCount,
+                wordTextCount: res.data.result.wordTextCount,
                 wordCount: res.data.result.wordCount,
                 vocabularyTextCount: res.data.result.vocabularyTextCount,
                 vocabularyCount: res.data.result.vocabularyCount,

+ 1 - 1
vue.config.js

@@ -43,7 +43,7 @@ module.exports = {
       // http://mk.wmjh.cn
       // https://gcls.helxsoft.cn
       [process.env.VUE_APP_BASE_API]: {
-        target: `https://gcls.helxsoft.cn`,
+        target: `http://mk.wmjh.cn`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''