Browse Source

提示信息维护

zhouna 6 years ago
parent
commit
7e1c8ed574

+ 10 - 0
src/App.vue

@@ -9,12 +9,14 @@
   import axios from 'axios';
   import utils from '@api/utils.js';
   import api from './api/user.js';
+  import icss from './api/icss.js';
   document.title='朗通云平台';         //修改标签页标题
   export default {
     name: 'app',
     created() {
       this.getUserEnumsData();
       this.getDiagbotManEnumsData();
+      this.getIcssEnumsData();
       //请求拦截器,添加token
       axios.interceptors.request.use((req) => {
         const tokenStr = localStorage.getItem('token');
@@ -84,6 +86,14 @@
             localStorage.setItem('productEnumsData', JSON.stringify(data));
           }
         });
+      },
+      getIcssEnumsData(){
+        icss.getIcssEnumsData().then((res) => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            localStorage.setItem('icssEnumsData', JSON.stringify(data));
+          }
+        });
       }
     }
   }

+ 5 - 0
src/api/config.js

@@ -95,6 +95,11 @@ export default {
     'modifDeptInfo': 'api/icssman/deptInfo/updateDeptInfo', //科室维护-修改
     'saveOrUpdate': 'api/icssman/questionInfo/saveOrUpdate', //添加标签保存
     'deleteTagGroup': 'api/icssman/questionInfo/delete', //删除标签组
+    'getPromptList':'api/icssman/introduceInfo/getIntroducePage',//提示信息列表
+    'addPromptInfo':'api/icssman/introduceInfo/saveIntroduce',//新增提示信息
+    'delPromptInfo':'api/icssman/introduceInfo/deleteRecord',//删除提示信息
+    'PromptInfoDetail':'api/icssman/introduceDetail/getByIntroduceId',//提示信息详情
+    'getIcssEnumsData':'api/icssman/getIcssEnumsData',//icss枚举
 	},
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 16 - 1
src/api/icss.js

@@ -3,9 +3,24 @@ import config from '@api/config.js';
 
 const urls = config.urls;
 export default {
+    getIcssEnumsData(){
+        return axios.post(urls.getIcssEnumsData)
+    },
     getDropList() {
         return axios.post(urls.getDropList)
     },
+    getPromptList(param){
+      return axios.post(urls.getPromptList,param)
+    },
+    addPromptInfo(param){
+        return axios.post(urls.addPromptInfo,param)
+    },
+    delPromptInfo(param){
+        return axios.post(urls.delPromptInfo,param)
+    },
+    PromptInfoDetail(param){
+        return axios.post(urls.PromptInfoDetail,param)
+    },
     getTagList(param) {
         return axios.post(urls.getTagList, param)
     },
@@ -18,7 +33,7 @@ export default {
     detailsTagList(param) {
         return axios.post(urls.detailsTagList, param)
     },
-      detailsTag(param) {
+  detailsTag(param) {
         return axios.post(urls.detailsTag, param)
       },
     getDeptInfo(param) {//科室维护

+ 173 - 0
src/components/icss/AddPromptInfo.vue

@@ -0,0 +1,173 @@
+<template>
+    <div class="NoiseTemplateWrapper TemplateWrapper">
+        <div class="groupTitle"><i
+                class="el-icon-back"
+                @click="back"
+        ></i> 提示信息维护--添加</div>
+        <div class="info-container">
+            <el-form ref="form" :rules="rules" :model="form" label-width="130px">
+                <el-form-item label="静态知识名称:" prop="name">
+                    <el-input v-model="form.name"></el-input>
+                </el-form-item>
+                <p class="line"></p>
+                <el-form-item label="是否属于诊断:" prop="isReason">
+                    <el-select v-model="form.isReason" placeholder="请选择">
+                        <el-option label="否" value="0"></el-option>
+                        <el-option label="是" value="1"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="显示位置:" prop="position">
+                    <el-checkbox-group v-model="form.position">
+                        <el-checkbox v-for="it in positions" :label="it.name" :value="it.key" name="position"></el-checkbox>
+                    </el-checkbox-group>
+                </el-form-item>
+                <el-form-item label="添加段落:" prop="addPrg">
+                    <div class="add-prg">
+                        <el-form-item label="标题" prop="title" label-width="80px">
+                            <el-input v-model="form.title"></el-input>
+                        </el-form-item>
+                        <el-form-item label="内容" prop="desc" label-width="80px">
+                            <el-input type="textarea" v-model="form.desc"></el-input>
+                        </el-form-item>
+                    </div>
+                </el-form-item>
+                <el-form-item>
+                    <el-button>添加段落</el-button >
+                </el-form-item>
+                <p class="line"></p>
+                <TagPool :pool="tagPool"
+                         :sexType="sexType"
+                         @changeActionData="changeActionData"></TagPool>
+                </el-form>
+                <div class="btn">
+                    <el-button
+                            type="primary"
+                            @click="submitForm"
+                    >确 定</el-button>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+  /**
+   *
+   */
+  import api from '@api/icss.js';
+  import utils from '@api/utils.js';
+  import TagPool from './PromptTagPool';
+
+  export default {
+    name: 'AddPromptInfo',
+    components: {
+      TagPool
+    },
+    data() {
+      return {
+        tagPool:[],
+        sexType:'1',
+        positions:[],
+        form:{
+          name:'',
+          isReason:'0',
+          position:[]
+        },
+        rules: {
+          name: [
+            { required: true, message: '静态知识名称不能为空', trigger: 'change' }
+          ],
+          isReason: [
+            { required: true, message: '请选择是否属于诊断', trigger: 'change' }
+          ],
+          position: [
+            { required: true, message: '请选择显示位置', trigger: 'change' }
+          ],
+        }
+      }
+    },
+    created:function(){
+      const {isEdit,data} = this.$route.params;
+      //显示位置枚举列表
+      const pos = localStorage.getItem("icssEnumsData");
+      this.positions = JSON.parse(pos)&&JSON.parse(pos).introducePositionEnum;console.log(this.positons)
+      if(isEdit){
+        this.editData = data;
+      }
+    },
+    methods: {
+      back() { this.$router.go(-1) },
+      submitForm() {      // 调用子组件的方法验证公用部分
+        this.$refs.submitForm.submitForm('groups');
+      },
+      changeActionData(){
+
+      },
+      validatePass() {      //验证成功回调,调取接口
+        //仍需验证标签明细是否选择
+        /*if (this.itemsTypes.includes(+this.dataPub.region2)&&this.options.length==0) {
+          this.$message({
+            message: '至少填一个选项',
+            type: 'warning'
+          });
+          return;
+        }*/
+        const {isEdit,data} = this.$route.params;
+        let param = {
+
+        };
+        this.showSaveDialog(param);
+      },
+      showSaveDialog(param) {
+        this.showConfirmDialog('是否保存该标签?', () => {
+          api.saveOrUpdate(param).then((res) => {
+            if (res.data.code === '0') {
+              this.warning(res.data.msg || '保存成功', 'success');
+              this.$router.push("/admin/LT-YXSJWH-TSXXWH");
+            } else {
+              this.warning(res.data.msg)
+            }
+          }).catch((err) => {
+            this.warning(err);
+          })
+        });
+      },
+      showConfirmDialog(msg, resolve) {
+        this.$alert(msg, '提示', {
+          confirmButtonText: '确定',
+          type: 'warning'
+        }).then(() => {
+          resolve();
+        }).catch(() => {});
+      },
+      warning(msg, type) {
+        this.$message({
+          showClose: true,
+          message: msg,
+          type: type || 'warning'
+        })
+      },
+    }
+  }
+</script>
+<style lang="less">
+    @import "../../less/common.less";
+    .info-container{
+        background: #fff;
+        padding: 20px;
+        margin: 20px 20px -20px 20px;
+        .el-input__inner{
+            width: 200px;
+        }
+        .el-form-item__label{
+            text-align: left;
+        }
+        .add-prg .el-form-item{
+            margin-bottom: 20px;
+        }
+    }
+    .line{
+        border-top:1px #dcdfe6 solid;
+        margin-bottom: 25px;
+    }
+</style>
+

+ 205 - 0
src/components/icss/PromptInfo.vue

@@ -0,0 +1,205 @@
+<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 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>
+                    <router-link to="/admin/LT-YXSJWH-TJTSXX" 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="操作时间"
+                        width="180"
+                        :show-overflow-tooltip="true">
+                </el-table-column>
+                <el-table-column
+                        prop="name"
+                        label="静态知识名称">
+                </el-table-column>
+                <el-table-column
+                        prop="questionList"
+                        label="关联标签"
+                        width="240">
+                </el-table-column>
+                <el-table-column
+                        prop="operatorName"
+                        label="操作人"
+                        width="80">
+                </el-table-column>
+
+                <el-table-column
+                        label="操作" width="120">
+                    <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" @click="showDelDialog(scope.row.id)">删除</el-button>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                        label="详情">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="getDetailList(scope.row.id)">详情</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: 'prompt-info',
+    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:'AddPromptInfo',
+          params: {info:row}
+        })
+      },
+      filterDatas(){
+        this.currentPage = 1;
+        this.getDataList();
+      },
+      getDataList() {
+        const param = this.getFilterItems();
+        // const param = {
+        //   'name':''
+        // };
+        api.getPromptList(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 = {
+          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.deleteDeptInfo({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;
+    }
+</style>

+ 282 - 0
src/components/icss/PromptTagPool.vue

@@ -0,0 +1,282 @@
+<template>
+  <div class="tagPoolWrapper clearfix">
+    <div class="bottomPartLeft">
+      <p class="poolTitle">标签池:</p>
+      <div class="pool">
+        <el-input placeholder="请输入搜索内容"
+                v-model="searchVal">
+          <i slot="prefix"
+             class="el-input__icon el-icon-search"
+          ></i>
+        </el-input>
+        <ul class="tagList">
+          <li v-for="(item, index) in leftTagsList"
+              class = "tagItem tagName ellipsis"
+              :key='item.id'
+              :title="'[ '+item.tagName+' ]'"
+              :style="getStyle(item)?styles:null"
+              @click='selectLeftTag(item, index, $event)'
+          >
+            {{item.tagName}}
+          </li>
+        </ul>
+      </div>
+    </div>
+    <div class="bottomPartMid fl">
+      <p><span class="el-icon-arrow-right" @click="toRightList"></span></p>
+      <p><span class="el-icon-arrow-left" @click="toLeftList"></span></p>
+    </div>
+    <div class="bottomPartRight ">
+      <p class="poolTitle">操作界面:</p>
+      <ul class="tagList operationPool">
+        <li class = "tagItem operationItem"
+            v-for="(item) in rightTagsList"
+            :key='item.id'
+            :style="getStyle2(item)?styles:null"
+            @click='selectRightTag(item)'
+        >
+          <p v-if="item.tagName" class="tagName">{{item.tagName}} </p>
+        </li>
+      </ul>
+    </div>
+  </div>
+</template>
+<script>
+  import api from '@api/icss.js';
+  import utils from '@api/utils.js';
+
+  export default {
+    name: "PromptTagPool",
+    props: {
+      pool: {
+        default: () => [],
+        type: Array
+      },
+      type: {
+        default: '',
+        type: String
+      },
+      sexType: {
+        default: '',
+        type: String
+      },
+    },
+    data() {
+      return {
+        leftTagsList: [],
+        selectLeftTagsList: [],
+        rightTagsList: [],
+        selectRightTagsList: [],
+        searchVal: '',
+        styles:{
+          background:'#eae7e7'
+        },
+      }
+    },
+    mounted() {
+
+    },
+    watch: {
+      pool(newVal, preVal) {
+        if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+          this.leftTagsList = newVal
+        }
+      },
+      searchVal(newVal, preVal){
+        if(newVal.trim() == ''){
+          this.searchTagList()
+        }else if(newVal.trim() != preVal.trim()){
+          this.searchTagList()
+        }
+      },
+      sexType(newVal, preVal) {
+        if (newVal != preVal) {
+          if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+            this.leftTagsList = [];
+            this.selectLeftTagsList = [];
+            this.rightTagsList = [];
+            this.selectRightTagsList = [];
+            this.searchVal = '';
+            this.searchTagList();
+          }
+        }
+      },
+
+
+    },
+    methods: {
+      selectLeftTag(tag, index, e) {
+
+        const hasTag = this.isHasTag(tag, this.selectLeftTagsList);
+        if (hasTag) {
+          this.selectLeftTagsList = this.selectLeftTagsList.filter(item => item.id !== tag.id)
+        } else {
+          this.selectLeftTagsList.push(tag);
+        }
+
+      },
+      selectRightTag(tag) {
+        const hasTag = this.isHasTag(tag, this.selectRightTagsList);
+        if (hasTag) {
+          this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
+        } else {
+          this.selectRightTagsList.push(tag);
+        }
+
+      },
+      isHasTag(item, arr) {
+        for ( let i = 0; i <arr.length; i++) {
+          if(arr[i].id === item.id) {
+            return true;
+          }
+        }
+        return false;
+      },
+      getStyle(item){       //左侧选中状态
+        // console.log('selected',utils.filterArr(this.leftTagsList,item,2))
+        // return utils.filterArr(this.selectLeftTagsList,item,2)
+        return this.isHasTag(item, this.selectLeftTagsList)
+      },
+      getStyle2(item) {
+        // return utils.filterArr(this.selectRightTagsList,item,2)
+        return this.isHasTag(item, this.selectRightTagsList)
+      },
+      toLeftList() {
+        for (let i = 0; i < this.selectRightTagsList.length; i++) {
+          this.rightTagsList = this.rightTagsList.filter(item => item.id !== this.selectRightTagsList[i].id)
+        }
+        this.selectLeftTagsList = []
+        this.selectRightTagsList = []
+        this.searchTagList()
+        this.$emit('changeActionData',this.rightTagsList, false);
+      },
+      toRightList() {
+        this.rightTagsList.push(...this.selectLeftTagsList);
+
+        for (let i = 0; i < this.rightTagsList.length; i++) {
+          this.leftTagsList = this.leftTagsList.filter(item => item.id !== this.rightTagsList[i].id)
+        }
+        this.selectLeftTagsList = []
+        this.selectRightTagsList = []
+        this.$emit('changeActionData',this.rightTagsList, false);
+      },
+      searchTagList() {
+        let notIds = []
+        for (let i = 0; i < this.rightTagsList.length; i++) {
+          if(this.rightTagsList[i].id) {
+            notIds.push(this.rightTagsList[i].id)
+          }
+
+        }
+        let param = {
+          "tagName": this.searchVal,
+          "tagType": [1, 2],
+          "controlType": [],
+          "type": this.type || '',
+          "notIds": notIds,
+          "sexType": this.sexType,
+
+        }
+        api.searchTagList(param).then((res) => {
+          if (res.data.code === '0') {
+            this.leftTagsList = res.data.data
+            this.selectLeftTagsList = []
+            this.selectRightTagsList = []
+          }
+        })
+
+      }
+
+    }
+  }
+</script>
+
+<style lang="less">
+  @import '../../less/common.less';
+  .tagPoolWrapper {
+    .bottomPartLeft {
+      width: 30%;
+      box-sizing: border-box;
+      float: left;
+    }
+    .pool{
+      .el-input__inner {
+        width: 100%;
+        border: 1px solid #c0c4cc;
+        border-radius: 0;
+        height: 35px;
+        border-bottom: none;
+      }
+      .el-input__prefix {
+        left: 5px;
+        right: auto;
+      }
+    }
+    .poolTitle {
+      box-sizing: border-box;
+      margin-bottom: 10px;
+      font-size: 14px;
+      color: #606266;
+    }
+    .search {
+      width: 100%;
+      border-bottom: 1px solid @icssBorder;
+      box-sizing: border-box;
+      height: 30px;
+    }
+    .tagList {
+      height: 240px;
+      overflow-y: auto;
+      border: 1px solid @icssBorder;
+    }
+    .tagItem {
+      line-height: 30px;
+      padding: 0px 10px;
+      cursor: pointer;
+      font-size: 14px;
+      color: #606266;
+    }
+    .tagName:before {
+      content: '['
+    }
+    .tagName::after {
+      content: ']'
+    }
+    .operationPool {
+      position: relative;
+      width: 60%;
+      height: 275px;
+      overflow-y: auto;
+      border:1px solid @icssBorder;
+    }
+    .bottomPartMid {
+      width: 8%;
+      margin-top: 60px;
+    p {
+      width: 100%;
+      text-align: center;
+    span {
+      cursor: pointer;
+      display: inline-block;
+      width: 30px;
+      height: 40px;
+      line-height: 40px;
+      margin: 0 auto;
+      border: 1px solid @icssBorder;
+      margin-bottom: 15px;
+      font-size: 18px;
+    }
+    }
+    }
+    .bottomPartRight {
+      float: left;
+      width: 60%;
+    }
+    Button {
+      margin-top: 20px;
+    }
+    .active {
+      color: #aBcdef;
+    }
+  }
+</style>

+ 5 - 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 PromptInfo from '@components/icss/PromptInfo.vue'//提示信息
+import AddPromptInfo from '@components/icss/AddPromptInfo.vue'//添加提示信息
 
 export default [
   {
@@ -141,6 +143,9 @@ 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-TSXXWH',component:PromptInfo,name:'PromptInfo'},         //提示信息维护
+      {path:'LT-YXSJWH-TJTSXX',component:AddPromptInfo,name:'AddPromptInfo'},         //提示信息维护
+
     ]
   }
 ]