浏览代码

别名维护系统-别名信息获取、详情获取

liucf 6 年之前
父节点
当前提交
7857b515a8
共有 6 个文件被更改,包括 350 次插入0 次删除
  1. 3 0
      src/api/config.js
  2. 9 0
      src/api/icss.js
  3. 122 0
      src/components/icss/AddSimilarName.vue
  4. 3 0
      src/components/icss/DeptInfo.vue
  5. 209 0
      src/components/icss/SimilarName.vue
  6. 4 0
      src/routes.js

+ 3 - 0
src/api/config.js

@@ -95,6 +95,9 @@ export default {
     'modifDeptInfo': 'api/icssman/deptInfo/updateDeptInfo', //科室维护-修改
     'saveOrUpdate': 'api/icssman/questionInfo/saveOrUpdate', //添加标签保存
     'deleteTagGroup': 'api/icssman/questionInfo/delete', //删除标签组
+    'similarName': 'api/icssman/retrieval/retrievalList', //别名维护
+    'delSimilarName': 'api/icssman/retrieval/delRetrievalsByQuesId', //别名维护-删除
+    'similarNameDetl': 'api/icssman/retrieval/getRetrievalsByTag', //别名维护-详情
 	},
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 9 - 0
src/api/icss.js

@@ -42,4 +42,13 @@ export default {
     deleteTagGroup(param) {
         return axios.post(urls.deleteTagGroup, param)
     },
+    similarName(param) {//别名维护
+        return axios.post(urls.similarName, param)
+    },
+    delSimilarName(param) {//别名维护-删除
+        return axios.post(urls.delSimilarName, param)
+    },
+    similarNameDetl(param) {//别名维护-删除
+        return axios.post(urls.similarNameDetl, param)
+    },
 }

+ 122 - 0
src/components/icss/AddSimilarName.vue

@@ -0,0 +1,122 @@
+<template>
+  <div>
+    <crumbs :title="minTitle" linkTo="/admin/LT-YXSJWH-BMWH"></crumbs>
+    <div class="contents">
+      <div class="content">
+        <h3>选择标签</h3>
+        <p>{{name}}</p>
+        <h3>添加别名</h3>
+        <p>本体添加:</p>
+        <table class="deptbox">
+          <tr>
+            <td>本体</td>
+            <td>拼音</td>
+          </tr>
+          <tr v-for="item in questionName">
+            <td class="desc">{{item.retrievalName}}</td>
+            <td>{{item.retrievalSpell}}</td>
+          </tr>
+        </table>
+        <p>别名添加:</p>
+        <table class="deptbox">
+          <tr>
+            <td>别名</td>
+            <td>拼音</td>
+          </tr>
+          <tr v-if="retrievalNames.length>0" v-for="it in retrievalNames">
+            <td class="desc">{{it.retrievalName}}</td>
+            <td>{{it.retrievalSpell}}</td>
+          </tr>
+        </table>
+        <p>子项添加:</p>
+        <table class="deptbox">
+          <tr>
+            <td>子项</td>
+            <td>拼音</td>
+          </tr>
+          <tr v-if="retrievalSonNames.length>0" v-for="v in retrievalSonNames">
+            <td class="desc">{{v.retrievalName}}</td>
+            <td>{{v.retrievalSpell}}</td>
+          </tr>
+        </table>
+      </div>
+    </div>   
+  </div>
+</template>
+<script type="text/javascript">
+  import api from '@api/icss.js';
+  export default{
+    name:'AddSimilarName',
+    data(){
+      return{
+        questionName:[], //本体
+        retrievalNames:[],  //同义词 
+        retrievalSonNames:[],  //子项
+        id:null,
+        name:"",
+        minTitle:"别名维护-添加别名"
+      }
+    },
+    created(){
+      this.id = this.$route.params.id;
+      this.name = this.$route.params.name;
+      if(this.id){
+        this.getDetail();
+      }
+      
+    },
+    methods:{
+      getDetail(){
+        const param = {'questionId':this.id,'questionName':this.name}
+        api.similarNameDetl(param).then((res)=>{
+          let result = res.data;
+          if(result.code==0){
+            // this.data = result.data;
+            const data = result.data;
+            for(let i in data){
+              if(i==1){
+                this.questionName = data[i];
+              }else if(i==2){
+                this.retrievalNames = data[i];
+              }else if(i==3){
+                this.retrievalSonNames = data[i];
+              }
+            }
+          }else{
+            console.log(result.msg);
+          }
+        })
+      }
+    }
+  }
+</script>
+<style lang="less" scoped>
+  @import "../../less/admin.less";
+  .content{
+    background: #fff;
+    padding: 20px 10px 30px;
+  }
+  .deptbox{
+    // width: 100%;
+    background: #fff;
+    padding: 20px 10px 30px;
+    font-size: 14px;
+    // color: #545455;
+    text-align: left;
+    >tr{
+      height: 30px;
+      // width: 111px;
+      /* td:first-child{
+        text-align: right;
+        width: 75px;
+      } */
+      td{
+        width: 111px;
+        border: 1px solid #666;
+      }
+    }
+    .desc{
+      // vertical-align: top;
+    }  
+  }
+</style>

+ 3 - 0
src/components/icss/DeptInfo.vue

@@ -194,4 +194,7 @@
         margin-right:10px;
         color: unset;
     }
+    .delete{
+        color: red
+    }
 </style>

+ 209 - 0
src/components/icss/SimilarName.vue

@@ -0,0 +1,209 @@
+<template>
+    <div>
+        <crumbs title="别名维护系统">
+            <el-form :inline="true" class="demo-form-inline">
+                <el-form-item label="标签名称:">
+                    <el-input size="mini" v-model="filter.proName" placeholder="标签名称"></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button size="mini" @click="filterDatas">确认</el-button>
+                    <el-button size="mini" @click="filterDatas">导入</el-button>
+                    <router-link to="/admin/LT-YXSJWH-TJKS" style="margin:0 10px">
+                        <el-button size="mini" type="warning">添加别名</el-button>
+                    </router-link>
+                </el-form-item>
+            </el-form>
+        </crumbs>
+        <div class="contents">
+            <el-table :data="list"
+                      border
+                      style="width: 100%">
+                <el-table-column
+                        type="index"
+                        :index="indexMethod"
+                        label="编号"
+                        width="60">
+                </el-table-column>
+                <el-table-column
+                        prop="gmtOperate"
+                        label="操作时间"
+                        :show-overflow-tooltip="true">
+                </el-table-column>
+                <el-table-column
+                        prop="questionName"
+                        label="标签名称">
+                </el-table-column>
+                <el-table-column
+                        prop="retrievalSelfName"
+                        label="本体">
+                </el-table-column>
+                <el-table-column
+                        prop="retrievalNames"
+                        label="别名">
+                </el-table-column>
+                <el-table-column
+                        prop="retrievalSonNames"
+                        label="子项">
+                </el-table-column>
+                <el-table-column
+                        prop="operatorName"
+                        label="操作人">
+                </el-table-column>
+                
+                <el-table-column
+                        label="操作" width="160">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
+                        <span style="margin:0 3px;">|</span>
+                        <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.questionId)">删除</el-button>
+                    </template>
+                </el-table-column>
+                <!-- <el-table-column
+                        label="详情">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="getDetailList(scope.row.questionId)">详情</el-button>
+                    </template>
+                </el-table-column> -->
+            </el-table>
+            <el-pagination v-if="total>pageSize"
+                           :current-page.sync="currentPage"
+                           @current-change="currentChange"
+                           background
+                           :page-size="pageSize"
+                           layout="total,prev, pager, next, jumper"
+                           :total="total">
+            </el-pagination>
+        </div>
+
+    </div>
+</template>
+
+<script>
+  import api from '@api/icss.js';
+  import utils from '@api/utils.js';
+
+  export default {
+    name: 'SimilarName',
+    data: function () {
+      return {
+        list: [],
+        cacheData: {},
+        currentPage: 1,
+        pageSize: 10,
+        total: 0,
+        linkIn:[],
+        pays:[],
+        filter: {
+          proName: ''
+        }
+      }
+    },
+    created() {
+      this.getDataList();
+    },
+    methods: {
+      toEditProduct(row){
+        this.$router.push({
+          name:'AddSimilarName',
+          params: {id:row.questionId,name:row.questionName}
+        })
+      },
+      filterDatas(){
+        this.currentPage = 1;
+        this.getDataList();
+      },
+      getDataList() {
+        const param = this.getFilterItems();
+        api.similarName(param).then((res) => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.list = data.records;
+            this.cacheData[param.current] = data.records;
+            this.total = data.total;
+          }
+        }).catch((error) => {
+          console.log(error);
+        });
+      },
+      getDetailList(id) {
+        const param = {'id': id,};
+        this.$router.push({name:'DeptInfoDetail', params:{id: id}})
+        /*api.getDeptInfoDetials(param).then((res) => {
+          if (res.data.code == '0') {
+            this.$router.push({name:'DeptInfoDetail', params:{id: id}})
+            // console.log("详情接口调用成功");
+          } else {
+            this.$message({
+              showClose: true,
+              message:res.data.msg,
+              type:'warning'
+            });
+            this.getDataList()  //刷新列表
+          }
+        }).catch((error) => {
+          console.log(error);
+        });*/
+      },
+      getFilterItems() {
+        const param = {
+          questionName: this.filter.proName,
+          current: this.currentPage,
+          size: this.pageSize
+        };
+        return param;
+      },
+      indexMethod(index) {
+        return ((this.currentPage - 1) * this.pageSize) + index + 1;
+      },
+      currentChange(next) {
+        this.currentPage = next;
+        if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+          this.list = this.cacheData[next];
+        } else {
+          this.getDataList();
+        }
+      },
+      warning(msg,type){
+        this.$message({
+          showClose: true,
+          message:msg,
+          type:type||'warning'
+        })
+      },
+      showConfirmDialog(msg,resolve){
+        this.$alert(msg, '提示', {
+          confirmButtonText: '确定',
+          type: 'warning'
+        }).then(() => {
+          resolve();
+        }).catch(() => {});
+      },
+      showDelDialog(id){
+        this.showConfirmDialog('是否删除该标签名?',()=>{
+          api.delSimilarName({questionId:id}).then((res)=>{
+            if(res.data.code=='0'){
+              this.warning(res.data.msg||'操作成功','success');
+              this.getDataList();
+            }else{
+              this.warning(res.data.msg);
+            }
+          }).catch((error)=>{
+            this.warning(error);
+          })
+        });
+      }
+    }
+  }
+</script>
+
+<style lang="less">
+    @import "../../less/admin.less";
+    .status-span{
+        font-size: 12px;
+        margin-right:10px;
+        color: unset;
+    }
+    .delete{
+        color: red
+    }
+</style>

+ 4 - 0
src/routes.js

@@ -36,6 +36,8 @@ import DeptInfoDetail from '@components/icss/DeptInfoDetail.vue';//科室信息-
 import AddDeptInfo from '@components/icss/AddDeptInfo.vue';//科室信息-添加
 import IndeptLabel from '@components/icss/IndeptLabel.vue';//独立标签
 import AddIndeptLabel from '@components/icss/AddIndeptLabel.vue'//独立标签-添加
+import SimilarName from '@components/icss/SimilarName.vue'//别名维护
+import AddSimilarName from '@components/icss/AddSimilarName.vue'//别名维护-详情
 
 export default [
   {
@@ -141,6 +143,8 @@ export default [
       {path:'LT-YXSJWH-TJKS',component:AddDeptInfo,name:'AddDeptInfo'},     //科室维护--添加
       {path:'LT-YXSJWH-DLLXBQWH',component:IndeptLabel,name:'IndeptLabel'},     //独立标签维护--详情
       {path:'LT-YXSJWH-TJDLBQ',component:AddIndeptLabel,name:'AddIndeptLabel'},     //独立标签维护--添加
+      {path:'LT-YXSJWH-BMWH',component:SimilarName,name:'SimilarName'},     //别名维护
+      {path:'LT-YXSJWH-TJBM',component:AddSimilarName,name:'AddSimilarName'},     //别名维护-详情
     ]
   }
 ]