You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.6 KiB

2 years ago
  1. <template>
  2. <div style="margin-left:5px;display: flex;">
  3. <div :style="'width:' + (window.pageWidth - 200 - 110 - 50) + 'px;'">
  4. <el-table :data="tableData" border
  5. :height="window.pageHeight < 600 ? 215 : Math.floor((window.pageHeight - 170) / 2)"
  6. highlight-current-row @row-click="rowClick" size="small" ref="elTable">
  7. <el-table-column type="index" label="序号" min-width="40" align="center"/>
  8. <el-table-column prop="suggestionContent" label="建议内容">
  9. <template slot-scope="scope">
  10. <el-input type="textarea" v-model="scope.row.suggestionContent" placeholder="建议内容" style="width: 100%"
  11. :autosize="{ minRows: 1, maxRows: 100 }">
  12. </el-input>
  13. </template>
  14. </el-table-column>
  15. </el-table>
  16. </div>
  17. <!--按钮-->
  18. <div style="margin-left: 10px;">
  19. <div>
  20. <el-button type="primary" class="btnClass" @click="btnQuery">新增</el-button>
  21. </div>
  22. <div>
  23. <el-button type="danger" class="btnClass" @click="btnQuery">删除</el-button>
  24. </div>
  25. <div>
  26. <el-button type="success" class="btnClass" @click="btnQuery">保存</el-button>
  27. </div>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import moment from "moment";
  33. import { mapState } from "vuex";
  34. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  35. import Sortable from "sortablejs";
  36. import { deepCopy,dddw } from '@/utlis/proFunc';
  37. export default {
  38. components: {
  39. },
  40. props:["formDiagnosis"],
  41. data() {
  42. return {
  43. tableData:[], //建议列表
  44. curRow:{}, //当前选中建议
  45. };
  46. },
  47. created() {
  48. this.init()
  49. },
  50. //挂载完成
  51. mounted() {
  52. this.btnQuery();
  53. },
  54. computed: {
  55. ...mapState(["window"]),
  56. },
  57. methods: {
  58. moment,dddw,
  59. init(){
  60. this.tableData = deepCopy(this.formDiagnosis.suggestions)
  61. },
  62. //供树节点组件调用,更新当前所选的项目类别
  63. refreshItemTypeId(itemTypeId){
  64. this.query.itemTypeId = itemTypeId
  65. },
  66. rowClick(row){
  67. this.curRow = row
  68. },
  69. },
  70. watch: {
  71. "formDiagnosis.id"(newVal,oldVal){
  72. this.init()
  73. }
  74. },
  75. };
  76. </script>
  77. <style scoped>
  78. @import '../../assets/css/global_button.css';
  79. @import '../../assets/css/global_card.css';
  80. @import '../../assets/css/global_dialog.css';
  81. @import '../../assets/css/global_form.css';
  82. @import '../../assets/css/global_input.css';
  83. @import '../../assets/css/global_table.css';
  84. @import '../../assets/css/global.css';
  85. .btnClass{
  86. width:100px;
  87. margin-bottom: 5px;
  88. }
  89. </style>