应无所住,而生其心
排名
1
文章
860
粉丝
112
评论
163
net core webapi post传递参数
庸人 : 确实坑哈,我也是下班好了好几次,发现后台传递对象是可以的,但...
百度编辑器自定义模板
庸人 : 我建议换个编辑器,因为现在百度富文本已经停止维护了,用tinymec...
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:50010702506256
欢迎加群交流技术

vue elementui 常用表格,条件查询,类型解析,弹窗显示详情,图片显示,图片预览

5657人阅读 2020/6/8 10:18 总访问:5182795 评论:0 收藏:0 手机
分类: 前端

第一版

页面

  1. <template>
  2. <div class="app-container">
  3. <el-card>
  4. <!--查询条件-->
  5. <div class="clearfix">
  6. <el-radio-group v-model="queryParms.dealType" size="small" @change="search">
  7. <el-radio-button label="">所有反馈</el-radio-button>
  8. <el-radio-button label="0">未经处理</el-radio-button>
  9. <el-radio-button label="1">同意处理</el-radio-button>
  10. <el-radio-button label="2">驳回处理</el-radio-button>
  11. <el-radio-button label="3">不予处理</el-radio-button>
  12. </el-radio-group>
  13. <div style="flex: 1" />
  14. <el-select @change="search" v-model="queryParms.feedbackType" class="query-condition" size="small" filterable>
  15. <el-option label="反馈类型" value="" />
  16. <el-option v-for="item in feedbackTypes" :key="item.feedbackType" :label="item.feedbackName"
  17. :value="item.feedbackType" />
  18. </el-select>
  19. <el-input v-model="queryParms.queryName" size="small" class="query-condition" placeholder="姓名,校区,班级" />
  20. <el-button type="primary" size="small" @click="search">查询</el-button>
  21. </div>
  22. <el-table v-loading="loading" :data="dataList">
  23. <el-table-column label="NO" type="index" width="50" fixed="left" />
  24. <el-table-column label="姓名" prop="userShowName" />
  25. <el-table-column label="校区" prop="schoolName" />
  26. <el-table-column label="班级" prop="className" />
  27. <el-table-column label="账号" prop="userName" />
  28. <!-- <el-table-column label="类型" prop="feedbackType" /> -->
  29. <el-table-column label="描述" prop="feedbackDescribe" />
  30. <el-table-column prop="feedbackType" label="类型">
  31. <template slot-scope="scope">
  32. <el-tag v-if="scope.row.feedbackType == 1" type="danger">系统问题</el-tag>
  33. <el-tag v-if="scope.row.feedbackType == 2" type="warning">内容问题</el-tag>
  34. <el-tag v-if="scope.row.feedbackType == 3">我要吐槽</el-tag>
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="dealType" label="处理">
  38. <template slot-scope="scope">
  39. <el-tag v-if="scope.row.dealType == 0" type="danger">未经处理</el-tag>
  40. <el-tag v-if="scope.row.dealType == 1" type="success">同意处理</el-tag>
  41. <el-tag v-if="scope.row.dealType == 2" type="info">驳回处理</el-tag>
  42. <el-tag v-if="scope.row.dealType == 3" type="warning">不予处理</el-tag>
  43. </template>
  44. </el-table-column>
  45. <!-- <el-table-column label="地址" prop="feedbackPath" width="100" show-overflow-tooltip /> -->
  46. <el-table-column label="反馈时间" width="95">
  47. <template slot-scope="{ row }">
  48. {{ $utils.colDateFormat(row.createTime, "YYYY-MM-DD") }}
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="操作" width="100" fixed="right">
  52. <template slot-scope="{ row }">
  53. <el-link @click="showFeedbackDialog(row.id)">处理</el-link>
  54. <el-link style="margin-left:10px" @click="showDetais(row)">详情</el-link>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. <el-pagination background layout="total,prev, pager, next" :total="dataCount" :page-size="queryParms.PageSize"
  59. :current-page="queryParms.PageIndex" @current-change="currentChange" />
  60. </el-card>
  61. <el-dialog title="详情" :visible.sync="detailsDialogVisible" width="30%" :before-close="handleClose">
  62. <div>
  63. 地址:
  64. <span>{{ details.urlDetails }}</span>
  65. </div>
  66. <div>
  67. 内容:
  68. <span>{{ details.feedbackDescribe }}</span>
  69. </div>
  70. <span slot="footer" class="dialog-footer">
  71. <el-button @click="detailsDialogVisible = false">取 消</el-button>
  72. <el-button type="primary" @click="detailsDialogVisible = false">确 定</el-button>
  73. </span>
  74. </el-dialog>
  75. <DealFeedbackDialog ref="dealFeedbackDialog" />
  76. </div>
  77. </template>
  78. <script>
  79. import DealFeedbackDialog from './components/dealFeedbackDialog.vue'
  80. export default {
  81. name: 'GuidanceTeacher',
  82. components: {
  83. DealFeedbackDialog
  84. },
  85. data: () => {
  86. return {
  87. feedbackTypes: [
  88. { feedbackType: '1', feedbackName: '系统问题' },
  89. { feedbackType: '2', feedbackName: '内容问题' },
  90. { feedbackType: '3', feedbackName: '我要吐槽' }
  91. ],
  92. detailsDialogVisible: false,
  93. details:{
  94. urlDetails: "",
  95. feedbackDescribe:""
  96. },
  97. // selectSchoolID: "",
  98. queryParms: {
  99. key: '',
  100. status: '0',
  101. schoolID: '',
  102. courseId: '',
  103. dealType:'',
  104. queryName: "",
  105. feedbackType: "",
  106. PageIndex: 1,
  107. PageSize: 20
  108. },
  109. dataCount: 0,
  110. loading: true,
  111. dataList: [], // 反馈列表
  112. }
  113. },
  114. mounted() {
  115. this.getData()
  116. },
  117. methods: {
  118. showFeedbackDialog(feedbackId) {
  119. //调用子组件的方法打开弹窗
  120. this.$refs.dealFeedbackDialog.openFeedbackDialog(feedbackId);
  121. },
  122. showDetais(rowInp) {
  123. this.details.urlDetails = rowInp.feedbackPath
  124. this.details.feedbackDescribe = rowInp.feedbackDescribe
  125. this.detailsDialogVisible = true
  126. },
  127. getData() {
  128. this.loading = true
  129. this.$http
  130. .get(
  131. '/education/api/Feedback/GetFeedbackList',
  132. this.queryParms
  133. )
  134. .then((res) => {
  135. this.dataList = res.data
  136. this.loading = false
  137. // this.dataCount = res.data.dataCount
  138. })
  139. },
  140. currentChange(val) {
  141. this.queryParms.PageIndex = val
  142. this.getData()
  143. },
  144. search() {
  145. this.queryParms.PageIndex = 1
  146. this.getData()
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang="scss" scoped>
  152. .clearfix {
  153. display: flex;
  154. .query-condition {
  155. margin-left: 10px;
  156. }
  157. .el-input {
  158. max-width: 200px;
  159. }
  160. .el-button {
  161. margin-left: 10px;
  162. }
  163. }
  164. </style>

弹窗那个组件:

位置:components/dealFeedbackDialog.vue

  1. <!-- 处理问题反馈使用的弹窗 -->
  2. <template>
  3. <div>
  4. <!-- 弹窗start -->
  5. <div class="dialogContent">
  6. <el-dialog :visible.sync="dialogVisible" :show-close="false" width="700px" height="800px"
  7. :before-close="handleClose">
  8. <div slot="title" class="dialog-footer">
  9. <div style="font-size:16px">
  10. 问题反馈
  11. </div>
  12. <div class="separateline">
  13. </div>
  14. </div>
  15. <div style="margin-top:-10px">
  16. <div style="display:flex">
  17. <div style="width:78px;color:#000">
  18. 处理类型:
  19. </div>
  20. <div>
  21. <el-radio v-model="feedbackType" label="1">同意处理</el-radio>
  22. <el-radio v-model="feedbackType" label="2">驳回处理</el-radio>
  23. <el-radio v-model="feedbackType" label="3">不理不睬</el-radio>
  24. </div>
  25. </div>
  26. <div style="display:flex;margin-top: 30px;">
  27. <div style="width:78px;color:#000;">
  28. 处理意见
  29. </div>
  30. <div style="flex-grow: 1">
  31. <el-input type="textarea" v-model="describe" style="width:100%" :rows="7"
  32. placeholder="请输入内容">
  33. </el-input>
  34. </div>
  35. </div>
  36. </div>
  37. <span slot="footer" class="dialog-footer">
  38. <el-button @click="dialogVisible = false" size="small">我在想想</el-button>
  39. <el-button type="primary" size="small" @click="saveFeedback()">确定反馈</el-button>
  40. </span>
  41. </el-dialog>
  42. </div>
  43. <!-- 弹窗end -->
  44. </div>
  45. </template>
  46. <script>
  47. export default {
  48. // 组件名字
  49. name: 'FeedbackDialog',
  50. // 组件参数
  51. props: {
  52. index: {
  53. type: Number,
  54. default: 0
  55. },
  56. },
  57. data() {
  58. return {
  59. feedbackType: "1",
  60. feedbackId: 0,
  61. describe: "",
  62. dialogVisible: false
  63. }
  64. },
  65. mounted() {
  66. //alert("组件内部加载好了"+this.dialogVisibleParameter)
  67. this.initPic()
  68. },
  69. // 组件方法
  70. methods: {
  71. initPic() {
  72. },
  73. //模态框关闭前的事件
  74. handleClose(done) {
  75. },
  76. //打开弹窗
  77. openFeedbackDialog(feedbackId) {
  78. this.feedbackId = feedbackId
  79. this.dialogVisible = true
  80. },
  81. //清空一下反馈的数据,比如反馈成功之后清空一下,这样下次打开的时候不会让前面的数据还在
  82. clearFeedbackData() {
  83. },
  84. //确定反馈
  85. saveFeedback() {
  86. //this.$alert('功能开发中...')
  87. let _this = this;
  88. if (!this.describe) {
  89. this.$alert('请输入反馈意见...')
  90. return
  91. }
  92. //反馈回传的数据
  93. let feedbackData = {
  94. DealType: this.feedbackType,//处理类型
  95. DealingOpinion: this.describe,//处理意见
  96. Id: this.feedbackId
  97. }
  98. this.$http.post('/education/api/Feedback/DealFeedback', feedbackData).then((res) => {
  99. //_this.$alert('处理反馈成功!...')
  100. _this.dialogVisible = false
  101. console.log(res)
  102. })
  103. }
  104. }
  105. }
  106. </script>
  107. <style scoped="scoped" lang="scss">
  108. // 自定义的一根简单分割线
  109. .separateline {
  110. height: 1px;
  111. background: #eee;
  112. margin-left: -40px;
  113. margin-right: -40px;
  114. margin-top: 9px;
  115. }
  116. // 问题截图,传递图片的样式
  117. .form-content.panle {
  118. // padding: 20px;
  119. padding-bottom: 10px;
  120. // background-color: #f8f8f8;
  121. .img-boxs {
  122. display: flex;
  123. /* margin-right: 46px; */
  124. flex-wrap: wrap;
  125. .img-waper {
  126. margin-right: 10px;
  127. margin-bottom: 10px;
  128. position: relative;
  129. .remove-icon:hover {
  130. cursor: pointer;
  131. img {
  132. opacity: 0.6;
  133. }
  134. }
  135. .remove-icon {
  136. position: absolute;
  137. width: 14px;
  138. height: 14px;
  139. top: -8px;
  140. right: -5px;
  141. img {
  142. width: 100%;
  143. }
  144. }
  145. }
  146. }
  147. .add-btn:hover {
  148. cursor: pointer;
  149. opacity: 0.6;
  150. }
  151. .add-btn {
  152. width: 70px;
  153. height: 70px;
  154. border: solid 1px #DDDDDD;
  155. display: flex;
  156. align-items: center;
  157. flex-wrap: wrap;
  158. justify-content: space-around;
  159. .icon-waper {
  160. width: 18px;
  161. height: 21px;
  162. position: relative;
  163. .icon-x {
  164. width: 19px;
  165. height: 5px;
  166. background-color: #DDDDDD;
  167. position: absolute;
  168. top: 0;
  169. bottom: 0;
  170. margin: auto;
  171. }
  172. .icon-y {
  173. height: 21px;
  174. width: 5px;
  175. background-color: #DDDDDD;
  176. position: absolute;
  177. left: 0;
  178. right: 0;
  179. margin: auto;
  180. }
  181. }
  182. }
  183. }
  184. </style>
  185. <!-- 修改elementui里边对话框的默认样式
  186. 需要注意两点:
  187. 1:样式声明的时候不要加scoped,不然样式只在当前组件起作用,无法覆盖样式内容的样式
  188. 2:要修改默认弹窗里边的样式,加一个前缀,就可以做到只修改当前这个组件的了,不然可能会影响到其他地方的样式
  189. -->
  190. <style lang="scss">
  191. // 修改el-dialog里边的默认样式
  192. .dialogContent {
  193. .el-dialog {
  194. background-color: #F6F8FC;
  195. }
  196. .el-dialog__header {
  197. padding: 20px 40px 10px 40px;
  198. background-color: #f6f8fc !important;
  199. }
  200. .el-dialog__body {
  201. padding: 30px 40px;
  202. color: #606266;
  203. font-size: 14px;
  204. word-break: break-all;
  205. }
  206. .el-dialog__footer {
  207. padding: 0px 40px 30px 40px
  208. }
  209. // 修改默认按钮的padding也就是跳转按钮的宽度
  210. .el-button--small,
  211. .el-button--small.is-round {
  212. padding: 9px 16px;
  213. }
  214. // 修改默认按钮的圆角为直角
  215. .el-button--mini,
  216. .el-button--small {
  217. border-radius: 0px;
  218. }
  219. }
  220. </style>

第二版

改了一点加了一点点东西

页面

  1. <template>
  2. <div class="app-container">
  3. <el-card>
  4. <!--查询条件-->
  5. <div class="clearfix">
  6. <el-radio-group v-model="queryParms.dealType" size="small" @change="search">
  7. <el-radio-button label="0">未处理</el-radio-button>
  8. <el-radio-button label="1">已处理</el-radio-button>
  9. <el-radio-button label="2">已驳回</el-radio-button>
  10. <el-radio-button label="">所有</el-radio-button>
  11. <!-- <el-radio-button label="3">不予处理</el-radio-button> -->
  12. </el-radio-group>
  13. <div style="flex: 1" />
  14. <el-select v-model="queryParms.feedbackType" class="query-condition" size="small" filterable @change="search">
  15. <el-option label="反馈类型" value="" />
  16. <el-option
  17. v-for="item in feedbackTypes"
  18. :key="item.feedbackType"
  19. :label="item.feedbackName"
  20. :value="item.feedbackType"
  21. />
  22. </el-select>
  23. <el-input v-model="queryParms.queryName" size="small" class="query-condition" placeholder="姓名,校区,班级" />
  24. <el-button type="primary" size="small" @click="search">查询</el-button>
  25. </div>
  26. <el-table v-loading="loading" :data="dataList">
  27. <el-table-column label="NO" type="index" width="50" fixed="left" />
  28. <el-table-column label="姓名" prop="userShowName" width="80" />
  29. <!-- <el-table-column label="校区" prop="schoolName" />
  30. <el-table-column label="班级" prop="className" /> -->
  31. <el-table-column label="账号" prop="userName" />
  32. <!-- <el-table-column label="类型" prop="feedbackType" /> -->
  33. <el-table-column label="描述" prop="feedbackDescribe" />
  34. <el-table-column prop="feedbackType" label="类型" width="90">
  35. <template slot-scope="scope">
  36. <el-tag v-if="scope.row.feedbackType == 1" type="danger">系统问题</el-tag>
  37. <el-tag v-if="scope.row.feedbackType == 2" type="warning">内容问题</el-tag>
  38. <el-tag v-if="scope.row.feedbackType == 3">我要吐槽</el-tag>
  39. </template>
  40. </el-table-column>
  41. <el-table-column prop="dealType" label="处理" width="80">
  42. <template slot-scope="scope">
  43. <el-tag v-if="scope.row.dealType == 0" type="danger">未处理</el-tag>
  44. <el-tag v-if="scope.row.dealType == 1" type="success">已处理</el-tag>
  45. <el-tag v-if="scope.row.dealType == 2" type="info">已驳回</el-tag>
  46. <el-tag v-if="scope.row.dealType == 3" type="warning">不予处理</el-tag>
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="dataFromType" label="来源" width="80">
  50. <template slot-scope="scope">
  51. <el-tag v-if="scope.row.dataFromType == 0" type="danger">未知</el-tag>
  52. <el-tag v-if="scope.row.dataFromType == 1" type="warning">实验</el-tag>
  53. <el-tag v-if="scope.row.dataFromType == 2" type="success">评估</el-tag>
  54. </template>
  55. </el-table-column>
  56. <!-- <el-table-column label="地址" prop="feedbackPath" width="100" show-overflow-tooltip /> -->
  57. <el-table-column label="反馈时间" width="95">
  58. <template slot-scope="{ row }">
  59. {{ $utils.colDateFormat(row.createTime, "YYYY-MM-DD") }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="操作" width="100" fixed="right">
  63. <template slot-scope="{ row }">
  64. <el-link @click="showFeedbackDialog(row.id)">处理</el-link>
  65. <el-link style="margin-left:10px" @click="showDetais(row)">详情</el-link>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <el-pagination
  70. background
  71. layout="total,prev, pager, next"
  72. :total="dataCount"
  73. :page-size="queryParms.PageSize"
  74. :current-page="queryParms.PageIndex"
  75. @current-change="currentChange"
  76. />
  77. </el-card>
  78. <el-dialog title="详情" :visible.sync="detailsDialogVisible" width="30%" :before-close="handleClose">
  79. <div>
  80. <span style="font-weight:800">反馈地址:</span>
  81. <span>{{ details.urlDetails }}</span>
  82. </div>
  83. <div style="margin-top:9px">
  84. <span style="font-weight:800"> 反馈内容:</span>
  85. <span>{{ details.feedbackDescribe }}</span>
  86. </div>
  87. <div style="margin-top:9px">
  88. <span style="font-weight:800"> 反馈校区:</span>
  89. <span>{{ details.schoolName }}</span>
  90. </div>
  91. <div style="margin-top:9px">
  92. <span style="font-weight:800"> 反馈班级:</span>
  93. <span>{{ details.className }}</span>
  94. </div>
  95. <div style="margin-top:9px">
  96. <span style="font-weight:800"> 处理意见:</span>
  97. <span v-if="details.dealingOpinion">{{ details.dealingOpinion }}</span>
  98. <!-- <span v-if="!details.dealingOpinion">暂未处理</span> -->
  99. <el-tag v-if="!details.dealingOpinion" type="danger">暂未处理</el-tag>
  100. </div>
  101. <div style="margin-top:9px;display:flex">
  102. <div style="font-weight:800"> 问题截图:</div>
  103. <div style="display:flex">
  104. <div
  105. v-for="(item, i) in details.feedbackImgs"
  106. :key="i + 'img'"
  107. style="margin-right:10px"
  108. class="img-waper"
  109. @click="onPreviewImg(i)"
  110. >
  111. <!-- 用id去显示图片,其实就是图片处理后的名称 -->
  112. <img
  113. :src="'/oss/api/ImageViewer/' + item.id + '.jpg?percent=0.6&quality=80&od=true'"
  114. width="70px"
  115. height="70px"
  116. >
  117. </div>
  118. </div>
  119. </div>
  120. <span slot="footer" class="dialog-footer">
  121. <el-button @click="detailsDialogVisible = false">取 消</el-button>
  122. <el-button type="primary" @click="detailsDialogVisible = false">确 定</el-button>
  123. </span>
  124. </el-dialog>
  125. <DealFeedbackDialog ref="dealFeedbackDialog" />
  126. <el-image-viewer
  127. v-if="showViewer"
  128. style="z-index:99999999"
  129. :on-close="closeViewer"
  130. :initial-index="initialIndex"
  131. :url-list="details.feedbackImgs.map(a=>a.fileUrl)"
  132. />
  133. </div>
  134. </template>
  135. <script>
  136. import DealFeedbackDialog from './components/dealFeedbackDialog.vue'
  137. import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
  138. export default {
  139. name: 'GuidanceTeacher',
  140. components: {
  141. DealFeedbackDialog,
  142. ElImageViewer
  143. },
  144. data: () => {
  145. return {
  146. feedbackTypes: [
  147. { feedbackType: '1', feedbackName: '系统问题' },
  148. { feedbackType: '2', feedbackName: '内容问题' },
  149. { feedbackType: '3', feedbackName: '我要吐槽' }
  150. ],
  151. detailsDialogVisible: false,
  152. showViewer: false,
  153. details: {
  154. urlDetails: '',
  155. feedbackDescribe: '',
  156. dealingOpinion: '',
  157. schoolName: '',
  158. className: '',
  159. feedbackImgs: []
  160. },
  161. // selectSchoolID: "",
  162. queryParms: {
  163. key: '',
  164. status: '0',
  165. schoolID: '',
  166. courseId: '',
  167. dealType: 0,
  168. queryName: '',
  169. feedbackType: '',
  170. PageIndex: 1,
  171. PageSize: 20
  172. },
  173. dataCount: 0,
  174. loading: true,
  175. dataList: [] // 反馈列表
  176. }
  177. },
  178. mounted() {
  179. this.getData()
  180. },
  181. methods: {
  182. showFeedbackDialog(feedbackId) {
  183. // 调用子组件的方法打开弹窗
  184. this.$refs.dealFeedbackDialog.openFeedbackDialog(feedbackId)
  185. },
  186. // 打开图片预览
  187. onPreviewImg(i) {
  188. // 设置预览图片的索引
  189. this.initialIndex = i
  190. this.showViewer = true
  191. },
  192. // 关闭图片预览
  193. closeViewer() {
  194. this.showViewer = false
  195. },
  196. showDetais(rowInp) {
  197. this.details.urlDetails = rowInp.feedbackPath
  198. this.details.feedbackDescribe = rowInp.feedbackDescribe
  199. this.details.dealingOpinion = rowInp.dealingOpinion
  200. this.details.schoolName = rowInp.schoolName
  201. this.details.className = rowInp.className
  202. this.details.feedbackImgs = JSON.parse(rowInp.feedbackImgs)
  203. this.detailsDialogVisible = true
  204. },
  205. getData() {
  206. this.loading = true
  207. this.$http
  208. .get(
  209. '/education/api/Feedback/GetFeedbackList',
  210. this.queryParms
  211. )
  212. .then((res) => {
  213. console.log(res)
  214. this.dataList = res.data.data
  215. this.loading = false
  216. this.dataCount = res.data.dataCount
  217. })
  218. },
  219. currentChange(val) {
  220. this.queryParms.PageIndex = val
  221. this.getData()
  222. },
  223. search() {
  224. this.queryParms.PageIndex = 1
  225. this.getData()
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="scss" scoped>
  231. .clearfix {
  232. display: flex;
  233. .query-condition {
  234. margin-left: 10px;
  235. }
  236. .el-input {
  237. max-width: 200px;
  238. }
  239. .el-button {
  240. margin-left: 10px;
  241. }
  242. }
  243. </style>

弹窗那个组件

  1. <!-- 处理问题反馈使用的弹窗 -->
  2. <template>
  3. <div>
  4. <!-- 弹窗start -->
  5. <div class="dialogContent">
  6. <el-dialog
  7. :visible.sync="dialogVisible"
  8. :show-close="false"
  9. width="700px"
  10. height="800px"
  11. :before-close="handleClose"
  12. >
  13. <div slot="title" class="dialog-footer">
  14. <div style="font-size:16px">
  15. 问题反馈
  16. </div>
  17. <div class="separateline" />
  18. </div>
  19. <div style="margin-top:-10px">
  20. <div style="display:flex">
  21. <div style="width:78px;color:#000">
  22. 处理类型:
  23. </div>
  24. <div>
  25. <el-radio v-model="feedbackType" label="1">同意处理</el-radio>
  26. <el-radio v-model="feedbackType" label="2">驳回处理</el-radio>
  27. <!-- <el-radio v-model="feedbackType" label="3">不理不睬</el-radio> -->
  28. </div>
  29. </div>
  30. <div style="display:flex;margin-top: 30px;">
  31. <div style="width:78px;color:#000;">
  32. 处理意见
  33. </div>
  34. <div style="flex-grow: 1">
  35. <el-input
  36. v-model="describe"
  37. type="textarea"
  38. style="width:100%"
  39. :rows="7"
  40. placeholder="请输入内容"
  41. />
  42. </div>
  43. </div>
  44. </div>
  45. <span slot="footer" class="dialog-footer">
  46. <el-button size="small" @click="dialogVisible = false">我在想想</el-button>
  47. <el-button type="primary" size="small" @click="saveFeedback()">确定反馈</el-button>
  48. </span>
  49. </el-dialog>
  50. </div>
  51. <!-- 弹窗end -->
  52. </div>
  53. </template>
  54. <script>
  55. export default {
  56. // 组件名字
  57. name: 'FeedbackDialog',
  58. // 组件参数
  59. props: {
  60. index: {
  61. type: Number,
  62. default: 0
  63. }
  64. },
  65. data() {
  66. return {
  67. feedbackType: '1',
  68. feedbackId: 0,
  69. describe: '',
  70. dialogVisible: false
  71. }
  72. },
  73. mounted() {
  74. // alert("组件内部加载好了"+this.dialogVisibleParameter)
  75. this.initPic()
  76. },
  77. // 组件方法
  78. methods: {
  79. initPic() {
  80. },
  81. // 模态框关闭前的事件
  82. handleClose(done) {
  83. },
  84. // 打开弹窗
  85. openFeedbackDialog(feedbackId) {
  86. this.feedbackId = feedbackId
  87. this.dialogVisible = true
  88. },
  89. // 清空一下反馈的数据,比如反馈成功之后清空一下,这样下次打开的时候不会让前面的数据还在
  90. clearFeedbackData() {
  91. },
  92. // 处理反馈
  93. saveFeedback() {
  94. // this.$alert('功能开发中...')
  95. const _this = this
  96. if (!this.describe) {
  97. this.$alert('请输入反馈意见...')
  98. return
  99. }
  100. // 反馈回传的数据
  101. const feedbackData = {
  102. DealType: this.feedbackType, // 处理类型
  103. DealingOpinion: this.describe, // 处理意见
  104. Id: this.feedbackId
  105. }
  106. this.$http.post('/education/api/Feedback/DealFeedback', feedbackData).then((res) => {
  107. // _this.$alert('处理反馈成功!...')
  108. _this.dialogVisible = false
  109. // 调用父组件的刷新方法
  110. _this.$parent.getData()
  111. console.log(res)
  112. })
  113. }
  114. }
  115. }
  116. </script>
  117. <style scoped="scoped" lang="scss">
  118. // 自定义的一根简单分割线
  119. .separateline {
  120. height: 1px;
  121. background: #eee;
  122. margin-left: -40px;
  123. margin-right: -40px;
  124. margin-top: 9px;
  125. }
  126. // 问题截图,传递图片的样式
  127. .form-content.panle {
  128. // padding: 20px;
  129. padding-bottom: 10px;
  130. // background-color: #f8f8f8;
  131. .img-boxs {
  132. display: flex;
  133. /* margin-right: 46px; */
  134. flex-wrap: wrap;
  135. .img-waper {
  136. margin-right: 10px;
  137. margin-bottom: 10px;
  138. position: relative;
  139. .remove-icon:hover {
  140. cursor: pointer;
  141. img {
  142. opacity: 0.6;
  143. }
  144. }
  145. .remove-icon {
  146. position: absolute;
  147. width: 14px;
  148. height: 14px;
  149. top: -8px;
  150. right: -5px;
  151. img {
  152. width: 100%;
  153. }
  154. }
  155. }
  156. }
  157. .add-btn:hover {
  158. cursor: pointer;
  159. opacity: 0.6;
  160. }
  161. .add-btn {
  162. width: 70px;
  163. height: 70px;
  164. border: solid 1px #DDDDDD;
  165. display: flex;
  166. align-items: center;
  167. flex-wrap: wrap;
  168. justify-content: space-around;
  169. .icon-waper {
  170. width: 18px;
  171. height: 21px;
  172. position: relative;
  173. .icon-x {
  174. width: 19px;
  175. height: 5px;
  176. background-color: #DDDDDD;
  177. position: absolute;
  178. top: 0;
  179. bottom: 0;
  180. margin: auto;
  181. }
  182. .icon-y {
  183. height: 21px;
  184. width: 5px;
  185. background-color: #DDDDDD;
  186. position: absolute;
  187. left: 0;
  188. right: 0;
  189. margin: auto;
  190. }
  191. }
  192. }
  193. }
  194. </style>
  195. <style lang="scss">
  196. // 修改el-dialog里边的默认样式
  197. .dialogContent {
  198. .el-dialog {
  199. background-color: #F6F8FC;
  200. }
  201. .el-dialog__header {
  202. padding: 20px 40px 10px 40px;
  203. background-color: #f6f8fc !important;
  204. }
  205. .el-dialog__body {
  206. padding: 30px 40px;
  207. color: #606266;
  208. font-size: 14px;
  209. word-break: break-all;
  210. }
  211. .el-dialog__footer {
  212. padding: 0px 40px 30px 40px
  213. }
  214. // 修改默认按钮的padding也就是跳转按钮的宽度
  215. .el-button--small,
  216. .el-button--small.is-round {
  217. padding: 9px 16px;
  218. }
  219. // 修改默认按钮的圆角为直角
  220. .el-button--mini,
  221. .el-button--small {
  222. border-radius: 0px;
  223. }
  224. }
  225. </style>

欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739。有需要软件开发,或者学习软件技术的朋友可以和我联系~(Q:815170684)

评价

饰心

2020/7/10 9:46:00

哇  好神奇

剑轩:@饰心嘿嘿嘿,那个全局变量怎么优化呢。就是在data里边定义不用全局变量

2020/7/11 12:25:07 回复

vue elementui常用表单验证

&lt;script&gt; exportdefault{ name:&quot;form&quot;, data(){ //ip地址校验 varIPValidator=(rule,value,callbac...

vue elementui隐藏表格列。vue element-ui表格添加自增序号列

vue elementui隐藏表格列v-if就搞定了,如果不是动态的显示与隐藏直接设置成false就行 &lt;el-table-column label=&quot;...

vue elementuivue3 element plus 文件上传的时候设置其他参数。后台.net接收传递的额外参数。图片上传

比如上传文件的时候额外传递两个select选择的值 前台前面上传文件的时候要提供默认参数很简单,el-upload绑定一个data即可...

vue elementui 图片预览。el-image-viewer图片查看器。修改图片预览的自带样式。点击哪一个就查看哪一个图片

先引入图片预览的组件 import ElImageViewer from &#39;element-ui/packages/image/src/image-viewer&#39; export defa...

vue elementui 基础表格布局基础表格+条件+搜索框布局类型处理父子组件方法调用

[TOC]基础表格+条件+搜索框布局效果如下:代码如下: &lt;template&gt; &lt;div class=&quot;app-container&quot;&gt...

vue elementui 弹窗el-dialog自定义弹窗样式单选按钮el-radio联动

效果如下: 代码如下: &lt;!-- 处理问题反馈使用的弹窗 --&gt; &lt;template&gt; &lt;div&gt; &lt;!-- 弹窗sta...

vue elementui分页条使用与.net后台sqlsugar等分页方法使用。常用分页模板

分页条&lt;div style=&quot;margin-top: 20px;margin-bottom: 20px;text-align: center;&quot;&gt; &lt;el-pagination ...

vue elementui table去掉滚动条

当table内容列过多时,可通过height属性设置table高度以固定table高度、固定表头,使table内容可以滚动。现在需求是右侧滚...

vue-element-admin 常用表格与搜索栏界面搭配 。 element ui样式搭配。模板

界面大概的样子:代码(下方有vue3中的写法):&lt;template&gt; &lt;divclass=&quot;app-container&quot;&gt; &lt;el-fo...

css弹性盒子flex布局

css弹性盒子由于版本不同浏览器问题造成了一些不同的写法display:flexbox;在google浏览器中如果使用下面的写法就不行displa...

可输入下拉文本框据输入动态加载数据 jquery-editable-select

用到一个jquery-editable-select的控件github地址:https://github.com/indrimuska/jquery-editable-select这个插件的原理是...

.net mvc分部页.net core分部页

.net分部页的三种方式第一种:@Html.Partial(&quot;_分部页&quot;)第二种:@{ Html.RenderPartial(&quot;分部页&quot;);}...

css中单位pxemrem和vh/vw的理解

&gt;px像素(Pixel)。相对长度单位。像素px是相对于显示器屏幕分辨率而言的。em是相对长度单位。相对于当前对象内文本的字...

让IIS支持webp格式图片让IIS支持vtt格式iis设置mime类型iis配置支持的类型

webp格式图片可以让图片体积变小。也让下载图片变得更加困难一点 在线制作webp工具 https://www.upyun.com/webp?utm_mediu...

网页上传文件断点续传的实现无视文件大小上传以及datatables基本用法

首先明白js是客户带执行代码,c#是服务器上执行代码。本地文件需要用到js处理,服务器端接受c#代码处理1.HTML页面,文件信...