|
@@ -0,0 +1,502 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="articleList">
|
|
|
|
+ <search-box-new
|
|
|
|
+ ref="searchBox"
|
|
|
|
+ :formData="formData"
|
|
|
|
+ :formList="formList"
|
|
|
|
+ @search="search"
|
|
|
|
+ @init="init"
|
|
|
|
+ />
|
|
|
|
+ <table-list
|
|
|
|
+ rowKey="id"
|
|
|
|
+ ref="tableList"
|
|
|
|
+ :tableSets="tableSet"
|
|
|
|
+ :tableData="tableData"
|
|
|
|
+ :navText="navText"
|
|
|
|
+ @addClick="addClickFLs"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ @editInfo="editInfo"
|
|
|
|
+ >
|
|
|
|
+ <template slot="customize">
|
|
|
|
+ <el-button :size="size" type="danger" @click="plDel">删除</el-button>
|
|
|
|
+
|
|
|
|
+ </template>
|
|
|
|
+ <template slot="btn" slot-scope="props">
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ @click="editList(props.scope.row)"
|
|
|
|
+ >修改</el-button
|
|
|
|
+ >
|
|
|
|
+
|
|
|
|
+ <el-button type="text" @click="del(props.scope.row)">删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </table-list>
|
|
|
|
+ <pagination
|
|
|
|
+ :total="total"
|
|
|
|
+ :pageSize="formData.pageSize"
|
|
|
|
+ :currentPage="formData.pageNum"
|
|
|
|
+ @handleSizeChange="handleSizeChange"
|
|
|
|
+ @handleCurrentChange="handleCurrentChange"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import searchBoxNew from "@/components/searchBoxNew";
|
|
|
|
+import tableList from "@/components/tableList";
|
|
|
|
+import pagination from "@/components/pagination";
|
|
|
|
+export default {
|
|
|
|
+ name: "ArticleList",
|
|
|
|
+ components: { searchBoxNew, tableList, pagination },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ size: "medium",
|
|
|
|
+ loading: false, //当前表单加载是否加载动画
|
|
|
|
+ navText: {
|
|
|
|
+ title: "政策新闻列表",
|
|
|
|
+ index: 0,
|
|
|
|
+ ch: "条",
|
|
|
|
+ border: true,
|
|
|
|
+ num: true,
|
|
|
|
+ choice: true,
|
|
|
|
+ addHide: false,
|
|
|
|
+ openCheckMore: true,
|
|
|
|
+ backFatherBtn: {
|
|
|
|
+ status: false,
|
|
|
|
+ title: "未定义",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ //搜索
|
|
|
|
+ formList: [
|
|
|
|
+ {
|
|
|
|
+ prop: "type",
|
|
|
|
+ placeholder: "新闻分类",
|
|
|
|
+ scope: "select",
|
|
|
|
+ options: [
|
|
|
|
+ {
|
|
|
|
+ label: "全部状态",
|
|
|
|
+ value: "",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "开班消息",
|
|
|
|
+ value: 3,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "政策法规",
|
|
|
|
+ value: 1,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "通知通告",
|
|
|
|
+ value: 2,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ prop: "status",
|
|
|
|
+ placeholder: "发布状态",
|
|
|
|
+ scope: "select",
|
|
|
|
+ options: [
|
|
|
|
+ {
|
|
|
|
+ label: "全部状态",
|
|
|
|
+ value: "0,1",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "已发布",
|
|
|
|
+ value: 1,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "已停用",
|
|
|
|
+ value: 0,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ prop: "title",
|
|
|
|
+ placeholder: "请输入新闻标题",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ formData: {
|
|
|
|
+ status: "",
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 表单
|
|
|
|
+ tableSet: [
|
|
|
|
+ {
|
|
|
|
+ label: "新闻标题",
|
|
|
|
+ prop: "title",
|
|
|
|
+ hidden: true,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "分类",
|
|
|
|
+ prop: "type",
|
|
|
|
+ hidden: true,
|
|
|
|
+ scope: "isOptions",
|
|
|
|
+ options: [
|
|
|
|
+ {
|
|
|
|
+ label: "开班消息",
|
|
|
|
+ value: 3,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "政策法规",
|
|
|
|
+ value: 1,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "通知通告",
|
|
|
|
+ value: 2,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "发布状态",
|
|
|
|
+ prop: "status",
|
|
|
|
+ hidden: true,
|
|
|
|
+ scope: "isOptions",
|
|
|
|
+ options: [
|
|
|
|
+ {
|
|
|
|
+ label: "已发布",
|
|
|
|
+ value: 1,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "已停用",
|
|
|
|
+ value: 0,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "创建时间",
|
|
|
|
+ prop: "createTime",
|
|
|
|
+ hidden: true,
|
|
|
|
+ scope: "aTimeList",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "最近更新时间",
|
|
|
|
+ prop: "updateTime",
|
|
|
|
+ hidden: true,
|
|
|
|
+ scope: "aTimeList",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "排序",
|
|
|
|
+ prop: "sort",
|
|
|
|
+ hidden: true,
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ ],
|
|
|
|
+ tableData: [], //表单数据
|
|
|
|
+ total: 0, //一共多少条
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
|
|
+ activated() {
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ editList(v) {
|
|
|
|
+ const jump = () => {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "articleEdit",
|
|
|
|
+ query: {
|
|
|
|
+ id: v.id,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ const statusPage = this.$store.state.tagsView.visitedViews.some(
|
|
|
|
+ (item) => {
|
|
|
|
+ return item.name == "ArticleEdit";
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ if (statusPage) {
|
|
|
|
+ this.$store
|
|
|
|
+ .dispatch("tagsView/delCachedView", {
|
|
|
|
+ name: "ArticleEdit",
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ jump();
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ jump();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ addClickFLs(v, int) {
|
|
|
|
+ if (v === undefined) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "ArticleListAdd",
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ if (int === 0) {
|
|
|
|
+ const jump = () => {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "articleInfo",
|
|
|
|
+ query: {
|
|
|
|
+ id: v.informId,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ const statusPage = this.$store.state.tagsView.visitedViews.some(
|
|
|
|
+ (item) => {
|
|
|
|
+ return item.name == "ArticleInfo";
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ if (statusPage) {
|
|
|
|
+ this.$store
|
|
|
|
+ .dispatch("tagsView/delCachedView", {
|
|
|
|
+ name: "ArticleInfo",
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ jump();
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ jump();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (int === 6) {
|
|
|
|
+ const jump = () => {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "articleInfo",
|
|
|
|
+ query: {
|
|
|
|
+ id: v.informId,
|
|
|
|
+ active: 2,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ const statusPage = this.$store.state.tagsView.visitedViews.some(
|
|
|
|
+ (item) => {
|
|
|
|
+ return item.name == "ArticleInfo";
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ if (statusPage) {
|
|
|
|
+ this.$store
|
|
|
|
+ .dispatch("tagsView/delCachedView", {
|
|
|
|
+ name: "ArticleInfo",
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ jump();
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ jump();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ plDel() {
|
|
|
|
+ if (!this.$refs.tableList.allCheckData.length) {
|
|
|
|
+ this.$message.warning("请选择需要删除的新闻");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ var arst = this.$refs.tableList.allCheckData.map((item) => {
|
|
|
|
+ return item.id;
|
|
|
|
+ });
|
|
|
|
+ this.$alert(
|
|
|
|
+ "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ .then(() => {
|
|
|
|
+ var data = {
|
|
|
|
+ ids: arst,
|
|
|
|
+ status: -1,
|
|
|
|
+ };
|
|
|
|
+ this.$api.consultationdel(data).then((res) => {
|
|
|
|
+ this.$message.success("删除成功");
|
|
|
|
+ this.$refs.tableList.clearMoreActive();
|
|
|
|
+ this.search();
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "info",
|
|
|
|
+ message: "已取消删除",
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ editInfo(v) {
|
|
|
|
+ this.addClickFLs(v, 6);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ search(int) {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ if (int === 1) {
|
|
|
|
+ this.formData.pageNum = 1;
|
|
|
|
+ }
|
|
|
|
+ if (int === 2) {
|
|
|
|
+ this.formData = {
|
|
|
|
+ status: "",
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ this.$api
|
|
|
|
+ .consultationlist(this.formData)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.tableData = res.rows;
|
|
|
|
+ this.total = res.total;
|
|
|
|
+ this.navText.index = res.total;
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ init() {
|
|
|
|
+ this.search(2);
|
|
|
|
+ },
|
|
|
|
+ del(v) {
|
|
|
|
+ this.$alert(
|
|
|
|
+ "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ .then(() => {
|
|
|
|
+ var data = {
|
|
|
|
+ ids: [v.id],
|
|
|
|
+ status: -1,
|
|
|
|
+ };
|
|
|
|
+ this.$api.consultationdel(data).then((res) => {
|
|
|
|
+ this.$message.success("删除成功");
|
|
|
|
+ this.$refs.tableList.clearMoreActive();
|
|
|
|
+ this.search();
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "info",
|
|
|
|
+ message: "已取消删除",
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ addClick(v, int) {
|
|
|
|
+ if (v === undefined) {
|
|
|
|
+ this.listData = {
|
|
|
|
+ status: 1,
|
|
|
|
+ };
|
|
|
|
+ } else {
|
|
|
|
+ this.listData = JSON.parse(JSON.stringify(v));
|
|
|
|
+ }
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.listData.clearValidate();
|
|
|
|
+ });
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ },
|
|
|
|
+ submit() {},
|
|
|
|
+ close() {
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange(v) {
|
|
|
|
+ this.formData.pageSize = v;
|
|
|
|
+ this.formData.pageNum = 1;
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange(v) {
|
|
|
|
+ this.formData.pageNum = v;
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.custom-tree-node {
|
|
|
|
+ flex: 1;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ padding-right: 8px;
|
|
|
|
+}
|
|
|
|
+/deep/.el-button {
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+}
|
|
|
|
+/deep/.el-dialog {
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ .el-dialog__header {
|
|
|
|
+ padding: 0;
|
|
|
|
+ .hearders {
|
|
|
|
+ height: 40px;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding: 0px 18px 0px 20px;
|
|
|
|
+ border-bottom: 1px solid #e2e2e2;
|
|
|
|
+ .leftTitle {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ color: #2f4378;
|
|
|
|
+ }
|
|
|
|
+ .rightBoxs {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ img {
|
|
|
|
+ width: 14px;
|
|
|
|
+ height: 14px;
|
|
|
|
+ margin-left: 13px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .el-dialog__footer {
|
|
|
|
+ padding: 0;
|
|
|
|
+ .dialog-footer {
|
|
|
|
+ padding: 0px 40px;
|
|
|
|
+ height: 70px;
|
|
|
|
+ border-top: 1px solid #e2e2e2;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.imgBox {
|
|
|
|
+ width: 100%;
|
|
|
|
+ // height: 210px;
|
|
|
|
+ border: 1px solid #e2e2e2;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ padding: 8px 8px 3px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .imgLabel {
|
|
|
|
+ flex: 1;
|
|
|
|
+ width: 100%;
|
|
|
|
+ border: 1px dotted #e2e2e2;
|
|
|
|
+ color: #999;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ .msPhoto {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ max-width: 100%;
|
|
|
|
+ max-height: 270px;
|
|
|
|
+ img {
|
|
|
|
+ max-width: 100%;
|
|
|
|
+ max-height: 270px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .imgbbx {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ i {
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ margin: 14px 0;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ p {
|
|
|
|
+ margin: 5px 0px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|
|
|
|
+
|