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.
1 line
9.5 KiB
1 line
9.5 KiB
{"version":3,"sources":["webpack:///src/views/butler/components/topiManagement/E:/前端/xmf/src/views/butler/components/topiManagement/addEidt.vue","webpack:///src/views/butler/page/src/views/butler/page/topiManagement.vue"],"names":[],"mappings":"AACA,4BACI,UAAW,CACX,WAAY,CACZ,YAAa,CACb,kBAAmB,CACnB,sBAAuB,CACvB,eAAgB,CAChB,0BAA+B,CAC/B,iBAAkB,CAClB,qBAAsB,CACtB,gCAAqC,CACrC,iBAAkB,CCXtB,uBACA,WAAA,CACA,WAAA,CACA,gBAAA,CACA,kBAAA,CACA,iBAAA,CACA,UAAA,CACA,wBACA","file":"chunk-1854d5d3.0e3be610.css","sourcesContent":["\n.sys-image {\n width: 80px;\n height: 80px;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n background: rgba(0, 0, 0, 0.04);\n border-radius: 2px;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n margin-right: 12px;\n}\n","<style scoped>\n.tips {\n margin: 20px;\n height: 38px;\n line-height: 38px;\n background: #fafafa;\n border-radius: 4px;\n opacity: 0.8;\n border: 1px solid #e8e8e8;\n}\n</style>\n<template>\n <div class=\"main-content\">\n <div class=\"main-titel\">\n <span>话题管理</span>\n </div>\n <div class=\"content\">\n <div class=\"content-btn\">\n <el-button\n class=\"init-button\"\n icon=\"el-icon-plus\"\n @click=\"addEidt_vrisible = true\"\n >新增话题</el-button\n >\n </div>\n\n <div class=\"\">\n <VueTable ref=\"table\" :config=\"config\" @tableCheck=\"tableCheck\">\n <template slot=\"footer\">\n <div class=\"table-footer\">\n <button @click=\"edit(table_row)\">编辑</button>\n <button @click=\"del(table_row)\">删除</button>\n <button @click=\"enable(table_row)\">启用</button>\n <button @click=\"disenable(table_row)\">禁用</button>\n </div>\n </template>\n </VueTable>\n </div>\n </div>\n <addEidt\n :drawerTitle=\"addEidtDrawerTitle\"\n ref=\"addEdit\"\n @submitSuccess=\"submitSuccess\"\n @handleClose=\"addEidtHandleClose\"\n :drawerVrisible=\"addEidt_vrisible\"\n ></addEidt>\n </div>\n</template>\n\n<script>\nimport addEidt from '@/views/butler/components/topiManagement/addEidt'\nimport { gambitEnableGambit, gambitDisableGambit } from '@/api/butler.js'\nexport default {\n data() {\n return {\n table_row: [],\n addEidtDrawerTitle: '新增话题',\n addEidt_vrisible: false,\n config: {\n thead: [\n { label: '序号', type: 'index', width: '80' },\n // { label: '话题资源ID', prop: 'id', width: '180' },\n { label: '话题标题', prop: 'title', width: '380' },\n { label: '话题摘要', prop: 'summary', width: '180' },\n { label: '话题内容', prop: 'content', width: '380' },\n { label: '开始时间', prop: 'beginDate', width: '180' },\n { label: '结束时间', prop: 'endDate', width: '180' },\n {\n label: '状态',\n prop: 'status',\n width: 'auto',\n type: 'function',\n callback: (row, prop) => {\n switch (row.status) {\n case 1:\n return '启用中'\n break\n case 2:\n return '禁用中'\n break\n default:\n break\n }\n }\n },\n { label: '发布人', prop: 'createName', width: '180' },\n { label: '发布时间', prop: 'createDate', width: '180' },\n {\n label: '是否可评论',\n prop: 'isRating',\n width: '110',\n type: 'function',\n callback: (row, prop) => {\n switch (row.isRating) {\n case 1:\n return '是'\n break\n case 0:\n return '否'\n break\n default:\n break\n }\n }\n },\n { label: '参与人数', prop: 'peopleNum', width: '110' }\n ],\n url: 'gambitList',\n table_data: [],\n search_item: [\n {\n type: 'startDate',\n label: '发布开始时间',\n placeholder: '请输入发布开始时间',\n prop: 'creatBeginDate'\n },\n {\n type: 'endDate',\n label: '发布结束时间',\n placeholder: '请输入发布结束时间',\n prop: 'creatEndDate'\n },\n {\n type: 'Input',\n label: '话题资源标题',\n placeholder: '请输入话题资源标题',\n prop: 'title'\n },\n\n {\n type: 'Input',\n label: '发布人姓名',\n placeholder: '请输入',\n prop: 'createName'\n },\n {\n type: 'select',\n label: '状态',\n placeholder: '请输入',\n value: null,\n options: [\n { value: 1, label: '启用中' },\n { value: 2, label: '禁用中' }\n ],\n prop: 'status'\n },\n\n {\n type: 'Input',\n label: '话题摘要',\n placeholder: '请输入',\n prop: 'summary',\n inputWidth: '692px'\n }\n ],\n data: {\n pageNum: 1,\n size: 10\n }\n }\n }\n },\n components: {\n addEidt\n },\n methods: {\n enable(data) {\n console.log(data)\n if (data.length != 1) {\n this.$message.error('只能对一条数据进行操作')\n return\n }\n gambitEnableGambit({ id: data[0].id }).then((res) => {\n if (res.status) {\n this.$message.success(res.message)\n this.$refs.table.loadData()\n }\n })\n },\n disenable(data) {\n // gambitDisableGambit\n if (data.length != 1) {\n this.$message.error('只能对一条数据进行操作')\n return\n }\n gambitDisableGambit({ id: data[0].id }).then((res) => {\n if (res.status) {\n this.$message.success(res.message)\n this.$refs.table.loadData()\n }\n })\n },\n tableCheck(arr) {\n this.table_row = arr\n },\n // 添加修改关闭\n addEidtHandleClose() {\n this.addEidt_vrisible = false\n },\n // 添加修改成功\n submitSuccess() {\n this.$refs.table.loadData()\n },\n // 编辑\n edit(data) {\n if (data.length > 1) {\n this.$message.error('只能查看一条数据的详情')\n return\n }\n if (!data.length) {\n this.$message.error('请选择')\n return\n }\n this.addEidt_vrisible = true\n this.$refs.addEdit.edit(data[0].id)\n },\n // 删除\n del(data) {\n if (data.length) {\n let arr = []\n for (let i = 0; i < this.table_row.length; i++) {\n arr.push(this.table_row[i].id)\n }\n this.$confirm('是否确认删除?删除不可恢复', '删除', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n confirmButtonClass: 'confirmButton',\n cancelButtonClass: 'cancelButton'\n })\n .then(() => {\n this.$refs.table.tableDelete(arr)\n })\n .catch((action) => {})\n } else {\n this.$message.error('请选中需要删除的数据')\n }\n }\n }\n}\n</script>"]} |