瀏覽代碼

拼音校正功能

natasha 1 周之前
父節點
當前提交
cdfbec9c1e

+ 30 - 0
src/api/list.js

@@ -115,3 +115,33 @@ export function PageQueryTemplateListOrg(data) {
 export function PageQueryTemplateListOrgManager(data) {
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=page_query-PageQueryTemplateList_OrgManager`, data);
 }
+
+/**
+ * @description 分页查询拼音校正列表(个人)
+ * @param {object} data
+ * @param {number} data.page_capacity - 每页容量
+ * @param {number} data.cur_page - 当前查询页码
+ */
+export function PageQueryPinyinCorrectionListPersonal(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=page_query-PageQueryPinyinCorrectionList_Personal`, data);
+}
+
+/**
+ * @description 分页查询拼音校正列表(机构管理员)
+ * @param {object} data
+ * @param {number} data.page_capacity - 每页容量
+ * @param {number} data.cur_page - 当前查询页码
+ */
+export function PageQueryPinyinCorrectionListOrg(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=page_query-PageQueryPinyinCorrectionList_OrgManager`, data);
+}
+
+/**
+ * @description 分页查询拼音校正列表(系统管理员)
+ * @param {object} data
+ * @param {number} data.page_capacity - 每页容量
+ * @param {number} data.cur_page - 当前查询页码
+ */
+export function PageQueryPinyinCorrectionListAdmin(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=page_query-PageQueryPinyinCorrectionList_Admin`, data);
+}

+ 26 - 0
src/api/pinyinCorrection.js

@@ -0,0 +1,26 @@
+import { http } from '@/utils/http';
+
+
+
+// 添加拼音校正
+export function toolAddPinyinCorrection(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=tool-AddPinyinCorrection`, data);
+}
+
+// 删除拼音校正
+export function toolDeletePinyinCorrection(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=tool-DeletePinyinCorrection`, data);
+}
+
+// 得到词性列表
+export function toolGetCXList() {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=tool-GetCXList`);
+}
+
+// 复制拼音校正到指定库
+export function toolCopyPinyinCorrectionToStorage(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=tool-CopyPinyinCorrectionToStorage`,data);
+}
+
+
+

+ 2 - 0
src/layouts/default/header/index.vue

@@ -60,12 +60,14 @@ export default {
       ORG_MANAGER: [
         { key: 'project_manage/org/project', name: '项目管理', isShow: true },
         { key: 'personal_workbench/template_list_manager', name: '模板管理', isShow: true },
+        { key: 'personal_workbench/pinyin_correction_list_org', name: '拼音校正库', isShow: true },
         { key: 'user_manage_org', name: '用户管理', isShow: true },
         { key: 'personal_center', name: '个人中心', isShow: true },
       ],
       ADMIN: [
         { key: 'org_manage', name: '机构管理', isShow: true },
         { key: 'user_manage', name: '用户管理', isShow: true },
+        { key: 'personal_workbench/pinyin_correction_list_manager', name: '拼音校正库', isShow: true },
         { key: 'system_config', name: '系统配置', isShow: true },
       ],
     };

+ 27 - 0
src/router/modules/project.js

@@ -126,6 +126,33 @@ const personalWorkPage = {
       },
       component: () => import('@/views/personal_workbench/template_list/preview/index.vue'),
     },
+    // 拼音校正列表--个人
+    {
+      path: 'personal_workbench/pinyin_correction_list',
+      name: 'PersonalWorkbenchPinyinCorrectionList',
+      meta: {
+        title: '我的拼音校正库',
+      },
+      component: () => import('@/views/personal_workbench/pinyin_correction_list/index.vue'),
+    },
+    // 拼音校正列表--机构
+    {
+      path: 'personal_workbench/pinyin_correction_list_org',
+      name: 'PersonalWorkbenchPinyinCorrectionListOrg',
+      meta: {
+        title: '拼音校正库',
+      },
+      component: () => import('@/views/personal_workbench/pinyin_correction_list_org/index.vue'),
+    },
+    // 拼音校正列表--管理员
+    {
+      path: 'personal_workbench/pinyin_correction_list_manager',
+      name: 'PersonalWorkbenchPinyinCorrectionListManager',
+      meta: {
+        title: '拼音校正库',
+      },
+      component: () => import('@/views/personal_workbench/pinyin_correction_list_manager/index.vue'),
+    },
   ],
 };
 

+ 1 - 0
src/views/personal_workbench/common/menu.vue

@@ -39,6 +39,7 @@ export default {
     const subMenuLists = [
       { key: '/personal_workbench/edit_task', name: '我的编辑任务' },
       { key: '/personal_workbench/template_list', name: '我的模板库' },
+      { key: '/personal_workbench/pinyin_correction_list', name: '我的拼音校正库' },
     ];
 
     if (this.onlyKey) {

+ 270 - 0
src/views/personal_workbench/pinyin_correction_list/index.vue

@@ -0,0 +1,270 @@
+<template>
+  <div class="template">
+    <MenuPage only-key="/personal_workbench/pinyin_correction_list" />
+
+    <div class="template-list">
+      <div id="query-form">
+        <el-form inline>
+          <el-form-item prop="word" label="词汇">
+            <el-input v-model="form.word" />
+          </el-form-item>
+
+          <el-form-item class="search-box">
+            <el-button class="search-btn" type="primary" @click="queryList">查询</el-button>
+          </el-form-item>
+        </el-form>
+        <el-button type="primary" size="small" @click="visible = true"> 添加拼音校正 </el-button>
+      </div>
+      <el-table
+        v-if="tableHeight"
+        :data="list"
+        :max-height="tableHeight + 'px'"
+        @sort-change="handleSort"
+        :default-sort="dataSort"
+      >
+        <el-table-column
+          type="index"
+          label="序号"
+          width="60"
+          align="center"
+          :index="(form.cur_page - 1) * form.page_capacity + 1"
+          header-align="center"
+          class-name="index-column"
+        />
+        <el-table-column min-width="250" prop="id" label="编号" align="center" header-align="center" />
+        <el-table-column prop="word" label="词汇" align="center" header-align="center" sortable />
+        <el-table-column min-width="100" prop="pos_name" label="词性" align="center" header-align="center" sortable>
+        </el-table-column>
+
+        <el-table-column min-width="100" prop="pinyin" label="拼音" align="center" header-align="center" sortable>
+        </el-table-column>
+        <el-table-column
+          min-width="100"
+          prop="pinyin_lt"
+          label="连体拼音"
+          align="center"
+          header-align="center"
+          sortable
+        >
+        </el-table-column>
+
+        <el-table-column
+          prop="create_time"
+          label="创建时间"
+          align="center"
+          width="180"
+          header-align="center"
+          sortable
+        />
+
+        <el-table-column prop="operation" label="操作" fixed="right" width="200" align="center" header-align="center">
+          <template slot-scope="{ row }">
+            <span class="link danger" @click="deleteTemplate(row)">删除</span>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <PaginationPage ref="pagination" :total="total" @getList="queryTemplateList" />
+    </div>
+    <el-dialog
+      title="添加拼音校正"
+      :visible="visible"
+      width="460px"
+      :close-on-click-modal="false"
+      class="add-chapter"
+      @close="dialogClose"
+    >
+      <el-form ref="form" :model="data" :rules="rules" label-width="80px">
+        <el-form-item label="词汇" prop="word">
+          <el-input ref="word" v-model="data.word" placeholder="请输入词汇" />
+        </el-form-item>
+        <el-form-item label="词性" prop="pos">
+          <el-select v-model="data.pos">
+            <el-option v-for="item in cxList" :key="item.pos" :label="item.pos_name" :value="item.pos" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="拼音" prop="pinyin">
+          <el-input ref="pinyin" v-model="data.pinyin" placeholder="多个拼音用,分割" />
+        </el-form-item>
+        <el-form-item label="连体拼音" prop="pinyin_lt">
+          <el-input ref="pinyin_lt" v-model="data.pinyin_lt" placeholder="请输入连体拼音" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button @click="dialogClose">取消</el-button>
+        <el-button type="primary" :loading="loading" @click="addTemplate">确定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import MenuPage from '../common/menu.vue';
+import PaginationPage from '@/components/PaginationPage.vue';
+
+import { PageQueryPinyinCorrectionListPersonal } from '@/api/list.js';
+import { toolAddPinyinCorrection, toolDeletePinyinCorrection, toolGetCXList } from '@/api/pinyinCorrection';
+
+export default {
+  name: 'PersonalWorkbenchPinyinCorrectionList',
+  components: {
+    MenuPage,
+    PaginationPage,
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      cur_page_begin_index: 0,
+
+      form: {
+        word: '',
+        page_capacity: 10,
+        cur_page: 1,
+        order_column_list: [],
+      },
+      dataSort: {},
+      tableHeight: 0,
+      rules: {
+        word: [{ required: true, message: '请输入词汇', trigger: 'blur' }],
+        // pos: [{ required: true, message: '请选择词性', trigger: 'change' }],
+        // pinyin: [{ required: true, message: '请输入拼音', trigger: 'blur' }],
+      },
+      data: {
+        storage_type: 0,
+        word: '',
+        pos: '',
+        pinyin: '',
+        pinyin_lt: '',
+      },
+      visible: false,
+      loading: false,
+      cxList: [],
+    };
+  },
+  created() {
+    this.getCXList();
+  },
+  mounted() {
+    this.tableHeight =
+      document.getElementsByClassName('app-container')[0].clientHeight -
+      document.getElementById('query-form').clientHeight -
+      document.getElementsByClassName('el-pagination')[0].clientHeight -
+      10;
+  },
+  methods: {
+    // 获取词性列表
+    getCXList() {
+      this.cxList = [];
+      toolGetCXList().then(({ cx_list }) => {
+        this.cxList = cx_list;
+      });
+    },
+    handleSort(value) {
+      let dataSort = {
+        prop: value.prop,
+        order: value.order,
+      };
+      this.dataSort = dataSort;
+      this.queryList();
+    },
+    queryTemplateList(data) {
+      this.form.page_capacity = data.page_capacity;
+      this.form.cur_page = data.cur_page;
+      let order_column_list = [];
+      if (Object.keys(this.dataSort).length === 0) {
+        order_column_list = ['create_time:desc'];
+      } else {
+        if (this.dataSort.order == 'descending') {
+          order_column_list = [this.dataSort.prop + ':desc'];
+        } else if (this.dataSort.order == 'ascending') {
+          // 升序不传值
+          order_column_list = [this.dataSort.prop];
+        } else {
+          order_column_list = ['create_time:desc'];
+        }
+      }
+      this.form.order_column_list = order_column_list;
+      PageQueryPinyinCorrectionListPersonal(this.form).then(({ total_count, word_list }) => {
+        this.total = total_count;
+        this.list = word_list;
+      });
+    },
+    queryList() {
+      this.queryTemplateList({ cur_page: 1, page_capacity: this.form.page_capacity });
+    },
+    // 关闭弹窗
+    dialogClose() {
+      this.visible = false;
+    },
+    // 确定创建拼音校正
+    addTemplate() {
+      this.loading = true;
+      toolAddPinyinCorrection(this.data)
+        .then((res) => {
+          this.loading = false;
+          this.visible = false;
+          if (res.status === 1) {
+            this.$message({
+              type: 'success',
+              message: '创建成功!',
+            });
+            this.data = {
+              storage_type: 0,
+              word: '',
+              pos: '',
+              pinyin: '',
+              pinyin_lt: '',
+            };
+
+            this.queryList();
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+
+    // 删除词汇
+    deleteTemplate(row) {
+      this.$confirm('是否删除此词汇?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          toolDeletePinyinCorrection({ id: row.id }).then((res) => {
+            if (res.status === 1) {
+              this.$message({
+                type: 'success',
+                message: '删除成功!',
+              });
+              this.queryTemplateList({ cur_page: this.form.cur_page, page_capacity: this.form.page_capacity });
+            }
+          });
+        })
+        .catch(() => {});
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+@use '@/styles/mixin.scss' as *;
+
+.template {
+  @include page-base;
+  @include table-list;
+
+  #query-form {
+    display: flex;
+    gap: 10px;
+    align-items: center;
+    justify-content: space-between;
+
+    :deep .el-form-item--small.el-form-item {
+      margin-bottom: 5px;
+    }
+  }
+}
+</style>

+ 333 - 0
src/views/personal_workbench/pinyin_correction_list_manager/index.vue

@@ -0,0 +1,333 @@
+<template>
+  <div class="template">
+    <MenuPage only-key="/personal_workbench/pinyin_correction_list" />
+
+    <div class="template-list">
+      <div id="query-form">
+        <el-form inline>
+          <el-form-item prop="storage_type" label="库类型">
+            <el-select v-model="form.storage_type">
+              <el-option v-for="item in storageTypeList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="word" label="词汇">
+            <el-input v-model="form.word" />
+          </el-form-item>
+
+          <el-form-item class="search-box">
+            <el-button class="search-btn" type="primary" @click="queryList">查询</el-button>
+          </el-form-item>
+        </el-form>
+        <el-button type="primary" size="small" @click="visible = true"> 添加拼音校正 </el-button>
+      </div>
+      <el-table
+        v-if="tableHeight"
+        :data="list"
+        :max-height="tableHeight + 'px'"
+        @sort-change="handleSort"
+        :default-sort="dataSort"
+      >
+        <el-table-column
+          type="index"
+          label="序号"
+          width="60"
+          align="center"
+          :index="(form.cur_page - 1) * form.page_capacity + 1"
+          header-align="center"
+          class-name="index-column"
+        />
+        <el-table-column min-width="250" prop="id" label="编号" align="center" header-align="center" />
+        <el-table-column prop="word" label="词汇" align="center" header-align="center" sortable />
+        <el-table-column min-width="100" prop="pos_name" label="词性" align="center" header-align="center" sortable>
+        </el-table-column>
+
+        <el-table-column min-width="100" prop="pinyin" label="拼音" align="center" header-align="center" sortable>
+        </el-table-column>
+        <el-table-column
+          min-width="100"
+          prop="pinyin_lt"
+          label="连体拼音"
+          align="center"
+          header-align="center"
+          sortable
+        >
+        </el-table-column>
+        <el-table-column
+          min-width="100"
+          prop="storage_type"
+          label="库类型"
+          align="center"
+          header-align="center"
+          sortable
+        >
+          <template slot-scope="{ row }">
+            {{ storageTypeList.find((item) => item.value === row.storage_type).label }}
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          prop="create_time"
+          label="创建时间"
+          align="center"
+          width="180"
+          header-align="center"
+          sortable
+        />
+
+        <el-table-column prop="operation" label="操作" fixed="right" width="200" align="center" header-align="center">
+          <template slot-scope="{ row }">
+            <span class="link danger" @click="deleteTemplate(row)">删除</span>
+            <span class="link" @click="copyPinyin(row)" v-if="row.storage_type !== 2">写入全域库</span>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <PaginationPage ref="pagination" :total="total" @getList="queryTemplateList" />
+    </div>
+    <el-dialog
+      title="添加拼音校正"
+      :visible="visible"
+      width="460px"
+      :close-on-click-modal="false"
+      class="add-chapter"
+      @close="dialogClose"
+    >
+      <el-form ref="form" :model="data" :rules="rules" label-width="80px">
+        <el-form-item label="词汇" prop="word">
+          <el-input ref="word" v-model="data.word" placeholder="请输入词汇" />
+        </el-form-item>
+        <el-form-item label="词性" prop="pos">
+          <el-select v-model="data.pos">
+            <el-option v-for="item in cxList" :key="item.pos" :label="item.pos_name" :value="item.pos" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="拼音" prop="pinyin">
+          <el-input ref="pinyin" v-model="data.pinyin" placeholder="多个拼音用,分割" />
+        </el-form-item>
+        <el-form-item label="连体拼音" prop="pinyin_lt">
+          <el-input ref="pinyin_lt" v-model="data.pinyin_lt" placeholder="请输入连体拼音" />
+        </el-form-item>
+        <el-form-item prop="storage_type" label="库类型">
+          <el-select v-model="data.storage_type">
+            <el-option v-for="item in storageTypeList" :key="item.value" :label="item.label" :value="item.value" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button @click="dialogClose">取消</el-button>
+        <el-button type="primary" :loading="loading" @click="addTemplate">确定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import MenuPage from '../common/menu.vue';
+import PaginationPage from '@/components/PaginationPage.vue';
+
+import { PageQueryPinyinCorrectionListAdmin } from '@/api/list.js';
+import {
+  toolAddPinyinCorrection,
+  toolDeletePinyinCorrection,
+  toolGetCXList,
+  toolCopyPinyinCorrectionToStorage,
+} from '@/api/pinyinCorrection';
+
+export default {
+  name: 'PersonalWorkbenchPinyinCorrectionListManager',
+  components: {
+    MenuPage,
+    PaginationPage,
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      cur_page_begin_index: 0,
+
+      form: {
+        storage_type: null,
+        word: '',
+        page_capacity: 10,
+        cur_page: 1,
+        order_column_list: [],
+      },
+      dataSort: {},
+      tableHeight: 0,
+      rules: {
+        word: [{ required: true, message: '请输入词汇', trigger: 'blur' }],
+        // pos: [{ required: true, message: '请选择词性', trigger: 'change' }],
+        // pinyin: [{ required: true, message: '请输入拼音', trigger: 'blur' }],
+      },
+      data: {
+        storage_type: 0,
+        word: '',
+        pos: '',
+        pinyin: '',
+        pinyin_lt: '',
+      },
+      visible: false,
+      loading: false,
+      cxList: [],
+      storageTypeList: [
+        {
+          value: 0,
+          label: '个人库',
+        },
+        {
+          value: 1,
+          label: '机构库',
+        },
+        {
+          value: 2,
+          label: '全域库',
+        },
+      ],
+    };
+  },
+  created() {
+    this.getCXList();
+  },
+  mounted() {
+    this.tableHeight =
+      document.getElementsByClassName('app-container')[0].clientHeight -
+      document.getElementById('query-form').clientHeight -
+      document.getElementsByClassName('el-pagination')[0].clientHeight -
+      10;
+  },
+  methods: {
+    // 获取词性列表
+    getCXList() {
+      this.cxList = [];
+      toolGetCXList().then(({ cx_list }) => {
+        this.cxList = cx_list;
+      });
+    },
+    handleSort(value) {
+      let dataSort = {
+        prop: value.prop,
+        order: value.order,
+      };
+      this.dataSort = dataSort;
+      this.queryList();
+    },
+    queryTemplateList(data) {
+      this.form.page_capacity = data.page_capacity;
+      this.form.cur_page = data.cur_page;
+      let order_column_list = [];
+      if (Object.keys(this.dataSort).length === 0) {
+        order_column_list = ['create_time:desc'];
+      } else {
+        if (this.dataSort.order == 'descending') {
+          order_column_list = [this.dataSort.prop + ':desc'];
+        } else if (this.dataSort.order == 'ascending') {
+          // 升序不传值
+          order_column_list = [this.dataSort.prop];
+        } else {
+          order_column_list = ['create_time:desc'];
+        }
+      }
+      this.form.order_column_list = order_column_list;
+      PageQueryPinyinCorrectionListAdmin(this.form).then(({ total_count, word_list }) => {
+        this.total = total_count;
+        this.list = word_list;
+      });
+    },
+    queryList() {
+      this.queryTemplateList({ cur_page: 1, page_capacity: this.form.page_capacity });
+    },
+    // 关闭弹窗
+    dialogClose() {
+      this.visible = false;
+    },
+    // 确定创建拼音校正
+    addTemplate() {
+      this.loading = true;
+      toolAddPinyinCorrection(this.data)
+        .then((res) => {
+          this.loading = false;
+          this.visible = false;
+          if (res.status === 1) {
+            this.$message({
+              type: 'success',
+              message: '创建成功!',
+            });
+            this.data = {
+              storage_type: 0,
+              word: '',
+              pos: '',
+              pinyin: '',
+              pinyin_lt: '',
+            };
+
+            this.queryList();
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+
+    // 删除词汇
+    deleteTemplate(row) {
+      this.$confirm('是否删除此词汇?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          toolDeletePinyinCorrection({ id: row.id }).then((res) => {
+            if (res.status === 1) {
+              this.$message({
+                type: 'success',
+                message: '删除成功!',
+              });
+              this.queryTemplateList({ cur_page: this.form.cur_page, page_capacity: this.form.page_capacity });
+            }
+          });
+        })
+        .catch(() => {});
+    },
+    // 复制拼音到指定库
+    copyPinyin(row) {
+      this.$confirm('是否要将此词汇写入机构库吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          toolCopyPinyinCorrectionToStorage({ pinyin_correction_id: row.id, storage_type: 2 }).then((res) => {
+            if (res.status === 1) {
+              this.$message({
+                type: 'success',
+                message: '操作成功!',
+              });
+              this.queryTemplateList({ cur_page: this.form.cur_page, page_capacity: this.form.page_capacity });
+            }
+          });
+        })
+        .catch(() => {});
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+@use '@/styles/mixin.scss' as *;
+
+.template {
+  @include page-base;
+  @include table-list;
+
+  #query-form {
+    display: flex;
+    gap: 10px;
+    align-items: center;
+    justify-content: space-between;
+
+    :deep .el-form-item--small.el-form-item {
+      margin-bottom: 5px;
+    }
+  }
+}
+</style>

+ 329 - 0
src/views/personal_workbench/pinyin_correction_list_org/index.vue

@@ -0,0 +1,329 @@
+<template>
+  <div class="template">
+    <MenuPage only-key="/personal_workbench/pinyin_correction_list" />
+
+    <div class="template-list">
+      <div id="query-form">
+        <el-form inline>
+          <el-form-item prop="storage_type" label="库类型">
+            <el-select v-model="form.storage_type">
+              <el-option v-for="item in storageTypeList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="word" label="词汇">
+            <el-input v-model="form.word" />
+          </el-form-item>
+
+          <el-form-item class="search-box">
+            <el-button class="search-btn" type="primary" @click="queryList">查询</el-button>
+          </el-form-item>
+        </el-form>
+        <el-button type="primary" size="small" @click="visible = true"> 添加拼音校正 </el-button>
+      </div>
+      <el-table
+        v-if="tableHeight"
+        :data="list"
+        :max-height="tableHeight + 'px'"
+        @sort-change="handleSort"
+        :default-sort="dataSort"
+      >
+        <el-table-column
+          type="index"
+          label="序号"
+          width="60"
+          align="center"
+          :index="(form.cur_page - 1) * form.page_capacity + 1"
+          header-align="center"
+          class-name="index-column"
+        />
+        <el-table-column min-width="250" prop="id" label="编号" align="center" header-align="center" />
+        <el-table-column prop="word" label="词汇" align="center" header-align="center" sortable />
+        <el-table-column min-width="100" prop="pos_name" label="词性" align="center" header-align="center" sortable>
+        </el-table-column>
+
+        <el-table-column min-width="100" prop="pinyin" label="拼音" align="center" header-align="center" sortable>
+        </el-table-column>
+        <el-table-column
+          min-width="100"
+          prop="pinyin_lt"
+          label="连体拼音"
+          align="center"
+          header-align="center"
+          sortable
+        >
+        </el-table-column>
+        <el-table-column
+          min-width="100"
+          prop="storage_type"
+          label="库类型"
+          align="center"
+          header-align="center"
+          sortable
+        >
+          <template slot-scope="{ row }">
+            {{ storageTypeList.find((item) => item.value === row.storage_type).label }}
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          prop="create_time"
+          label="创建时间"
+          align="center"
+          width="180"
+          header-align="center"
+          sortable
+        />
+
+        <el-table-column prop="operation" label="操作" fixed="right" width="200" align="center" header-align="center">
+          <template slot-scope="{ row }">
+            <span class="link danger" @click="deleteTemplate(row)">删除</span>
+            <span class="link" @click="copyPinyin(row)" v-if="row.storage_type === 0">写入机构库</span>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <PaginationPage ref="pagination" :total="total" @getList="queryTemplateList" />
+    </div>
+    <el-dialog
+      title="添加拼音校正"
+      :visible="visible"
+      width="460px"
+      :close-on-click-modal="false"
+      class="add-chapter"
+      @close="dialogClose"
+    >
+      <el-form ref="form" :model="data" :rules="rules" label-width="80px">
+        <el-form-item label="词汇" prop="word">
+          <el-input ref="word" v-model="data.word" placeholder="请输入词汇" />
+        </el-form-item>
+        <el-form-item label="词性" prop="pos">
+          <el-select v-model="data.pos">
+            <el-option v-for="item in cxList" :key="item.pos" :label="item.pos_name" :value="item.pos" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="拼音" prop="pinyin">
+          <el-input ref="pinyin" v-model="data.pinyin" placeholder="多个拼音用,分割" />
+        </el-form-item>
+        <el-form-item label="连体拼音" prop="pinyin_lt">
+          <el-input ref="pinyin_lt" v-model="data.pinyin_lt" placeholder="请输入连体拼音" />
+        </el-form-item>
+        <el-form-item prop="storage_type" label="库类型">
+          <el-select v-model="data.storage_type">
+            <el-option v-for="item in storageTypeList" :key="item.value" :label="item.label" :value="item.value" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button @click="dialogClose">取消</el-button>
+        <el-button type="primary" :loading="loading" @click="addTemplate">确定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import MenuPage from '../common/menu.vue';
+import PaginationPage from '@/components/PaginationPage.vue';
+
+import { PageQueryPinyinCorrectionListOrg } from '@/api/list.js';
+import {
+  toolAddPinyinCorrection,
+  toolDeletePinyinCorrection,
+  toolGetCXList,
+  toolCopyPinyinCorrectionToStorage,
+} from '@/api/pinyinCorrection';
+
+export default {
+  name: 'PersonalWorkbenchPinyinCorrectionListOrg',
+  components: {
+    MenuPage,
+    PaginationPage,
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      cur_page_begin_index: 0,
+
+      form: {
+        storage_type: null,
+        word: '',
+        page_capacity: 10,
+        cur_page: 1,
+        order_column_list: [],
+      },
+      dataSort: {},
+      tableHeight: 0,
+      rules: {
+        word: [{ required: true, message: '请输入词汇', trigger: 'blur' }],
+        // pos: [{ required: true, message: '请选择词性', trigger: 'change' }],
+        // pinyin: [{ required: true, message: '请输入拼音', trigger: 'blur' }],
+      },
+      data: {
+        storage_type: 0,
+        word: '',
+        pos: '',
+        pinyin: '',
+        pinyin_lt: '',
+      },
+      visible: false,
+      loading: false,
+      cxList: [],
+      storageTypeList: [
+        {
+          value: 0,
+          label: '个人库',
+        },
+        {
+          value: 1,
+          label: '机构库',
+        },
+      ],
+    };
+  },
+  created() {
+    this.getCXList();
+  },
+  mounted() {
+    this.tableHeight =
+      document.getElementsByClassName('app-container')[0].clientHeight -
+      document.getElementById('query-form').clientHeight -
+      document.getElementsByClassName('el-pagination')[0].clientHeight -
+      10;
+  },
+  methods: {
+    // 获取词性列表
+    getCXList() {
+      this.cxList = [];
+      toolGetCXList().then(({ cx_list }) => {
+        this.cxList = cx_list;
+      });
+    },
+    handleSort(value) {
+      let dataSort = {
+        prop: value.prop,
+        order: value.order,
+      };
+      this.dataSort = dataSort;
+      this.queryList();
+    },
+    queryTemplateList(data) {
+      this.form.page_capacity = data.page_capacity;
+      this.form.cur_page = data.cur_page;
+      let order_column_list = [];
+      if (Object.keys(this.dataSort).length === 0) {
+        order_column_list = ['create_time:desc'];
+      } else {
+        if (this.dataSort.order == 'descending') {
+          order_column_list = [this.dataSort.prop + ':desc'];
+        } else if (this.dataSort.order == 'ascending') {
+          // 升序不传值
+          order_column_list = [this.dataSort.prop];
+        } else {
+          order_column_list = ['create_time:desc'];
+        }
+      }
+      this.form.order_column_list = order_column_list;
+      PageQueryPinyinCorrectionListOrg(this.form).then(({ total_count, word_list }) => {
+        this.total = total_count;
+        this.list = word_list;
+      });
+    },
+    queryList() {
+      this.queryTemplateList({ cur_page: 1, page_capacity: this.form.page_capacity });
+    },
+    // 关闭弹窗
+    dialogClose() {
+      this.visible = false;
+    },
+    // 确定创建拼音校正
+    addTemplate() {
+      this.loading = true;
+      toolAddPinyinCorrection(this.data)
+        .then((res) => {
+          this.loading = false;
+          this.visible = false;
+          if (res.status === 1) {
+            this.$message({
+              type: 'success',
+              message: '创建成功!',
+            });
+            this.data = {
+              storage_type: 0,
+              word: '',
+              pos: '',
+              pinyin: '',
+              pinyin_lt: '',
+            };
+
+            this.queryList();
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+
+    // 删除词汇
+    deleteTemplate(row) {
+      this.$confirm('是否删除此词汇?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          toolDeletePinyinCorrection({ id: row.id }).then((res) => {
+            if (res.status === 1) {
+              this.$message({
+                type: 'success',
+                message: '删除成功!',
+              });
+              this.queryTemplateList({ cur_page: this.form.cur_page, page_capacity: this.form.page_capacity });
+            }
+          });
+        })
+        .catch(() => {});
+    },
+    // 复制拼音到指定库
+    copyPinyin(row) {
+      this.$confirm('是否要将此词汇写入机构库吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          toolCopyPinyinCorrectionToStorage({ pinyin_correction_id: row.id, storage_type: 1 }).then((res) => {
+            if (res.status === 1) {
+              this.$message({
+                type: 'success',
+                message: '操作成功!',
+              });
+              this.queryTemplateList({ cur_page: this.form.cur_page, page_capacity: this.form.page_capacity });
+            }
+          });
+        })
+        .catch(() => {});
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+@use '@/styles/mixin.scss' as *;
+
+.template {
+  @include page-base;
+  @include table-list;
+
+  #query-form {
+    display: flex;
+    gap: 10px;
+    align-items: center;
+    justify-content: space-between;
+
+    :deep .el-form-item--small.el-form-item {
+      margin-bottom: 5px;
+    }
+  }
+}
+</style>