|
@@ -1,39 +1,47 @@
|
|
|
<style lang="scss">
|
|
|
-.govern {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- .category {
|
|
|
- width: 35%;
|
|
|
- padding: 10px;
|
|
|
- }
|
|
|
- li {
|
|
|
- width: 35%;
|
|
|
- list-style: none;
|
|
|
- background: #fff;
|
|
|
- border: 1px solid #d9d9d9;
|
|
|
- }
|
|
|
- .custom-tree-node {
|
|
|
- width: 100%;
|
|
|
- .el-tree-node__content {
|
|
|
- height: 32px;
|
|
|
+ .govern {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .category {
|
|
|
+ width: 35%;
|
|
|
+ padding: 10px;
|
|
|
}
|
|
|
- .label_name {
|
|
|
- font-size: 14px;
|
|
|
+
|
|
|
+ li {
|
|
|
+ width: 35%;
|
|
|
+ list-style: none;
|
|
|
+ background: #fff;
|
|
|
+ border: 1px solid #d9d9d9;
|
|
|
}
|
|
|
- .edit {
|
|
|
- float: right;
|
|
|
- i {
|
|
|
- font-weight: bolder;
|
|
|
+
|
|
|
+ .custom-tree-node {
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ .el-tree-node__content {
|
|
|
+ height: 32px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .label_name {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
+
|
|
|
+ .edit {
|
|
|
+ float: right;
|
|
|
+
|
|
|
+ i {
|
|
|
+ font-weight: bolder;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .company {
|
|
|
+ width: 65%;
|
|
|
+ min-height: 80vh;
|
|
|
+ padding: 10px;
|
|
|
}
|
|
|
}
|
|
|
- .company {
|
|
|
- width: 65%;
|
|
|
- min-height: 80vh;
|
|
|
- padding: 10px;
|
|
|
- }
|
|
|
-}
|
|
|
</style>
|
|
|
<template>
|
|
|
<section>
|
|
@@ -52,47 +60,19 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>-->
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="(dialogVisible = true), (catform = { parent_id: null })"
|
|
|
- icon="el-icon-circle-plus"
|
|
|
- size="mini"
|
|
|
- style="width: 100%; margin-bottom: 10px"
|
|
|
- >新增百科分类</el-button
|
|
|
- >
|
|
|
- <el-tree
|
|
|
- :data="data"
|
|
|
- default-expand-all
|
|
|
- node-key="id"
|
|
|
- :props="props"
|
|
|
- :expand-on-click-node="false"
|
|
|
- >
|
|
|
- <span
|
|
|
- class="custom-tree-node"
|
|
|
- slot-scope="{ node, data }"
|
|
|
- @click.stop="() => getData(data)"
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="(dialogVisible = true), (catform = { parent_id: null })"
|
|
|
+ icon="el-icon-circle-plus" size="mini" style="width: 100%; margin-bottom: 10px">新增百科分类</el-button>
|
|
|
+ <el-tree :data="data" default-expand-all node-key="id" :props="props" :expand-on-click-node="false">
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data }" @click.stop="() => getData(data)">
|
|
|
<span class="label_name">{{ node.label }}</span>
|
|
|
<span class="edit">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="mini"
|
|
|
- @click.stop="() => append(data)"
|
|
|
- >
|
|
|
+ <el-button type="text" size="mini" @click.stop="() => append(data)">
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="mini"
|
|
|
- @click.stop="() => edit(data)"
|
|
|
- >
|
|
|
+ <el-button type="text" size="mini" @click.stop="() => edit(data)">
|
|
|
<i class="el-icon-edit"></i>
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="mini"
|
|
|
- @click.stop="() => remove(data)"
|
|
|
- >
|
|
|
+ <el-button type="text" size="mini" @click.stop="() => remove(data)">
|
|
|
<i class="el-icon-delete"></i>
|
|
|
</el-button>
|
|
|
</span>
|
|
@@ -100,52 +80,23 @@
|
|
|
</el-tree>
|
|
|
</li>
|
|
|
<li class="company">
|
|
|
- <el-form
|
|
|
- ref="queryBaikeDetailParams"
|
|
|
- :model="queryBaikeDetailParams"
|
|
|
- label-width="80px"
|
|
|
- :inline="true"
|
|
|
- >
|
|
|
+ <el-form ref="queryBaikeDetailParams" :model="queryBaikeDetailParams" label-width="80px" :inline="true">
|
|
|
<el-form-item label="名称">
|
|
|
- <el-input
|
|
|
- v-model="queryBaikeDetailParams.name"
|
|
|
- placeholder=""
|
|
|
- width="200px"
|
|
|
- size="mini"
|
|
|
- clearable
|
|
|
- @clear="getData"
|
|
|
- ></el-input>
|
|
|
+ <el-input v-model="queryBaikeDetailParams.name" placeholder="" width="200px" size="mini" clearable
|
|
|
+ @clear="getData"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态">
|
|
|
- <el-select
|
|
|
- v-model="queryBaikeDetailParams.status"
|
|
|
- placeholder=""
|
|
|
- size="mini"
|
|
|
- @change="getData"
|
|
|
- @clear="getData"
|
|
|
- clearable
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in baikeStatusList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
+ <el-select v-model="queryBaikeDetailParams.status" placeholder="" size="mini" @change="getData"
|
|
|
+ @clear="getData" clearable>
|
|
|
+ <el-option v-for="item in baikeStatusList" :key="item.value" :label="item.label" :value="item.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button @click="getData" size="mini" type="primary"
|
|
|
- >搜索</el-button
|
|
|
- >
|
|
|
+ <el-button @click="getData" size="mini" type="primary">搜索</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float: right">
|
|
|
- <el-button
|
|
|
- @click="openBaikeDetailForm('add',{})"
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- >添加词条</el-button
|
|
|
- >
|
|
|
+ <el-button @click="openBaikeDetailForm('add',{})" size="mini" type="primary">添加词条</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-table :data="baikeList" style="width: 100%">
|
|
@@ -154,47 +105,24 @@
|
|
|
<el-table-column prop="status" label="状态">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- <el-tag
|
|
|
- type="success"
|
|
|
- v-if="scope.row.status == 1"
|
|
|
- size="mini"
|
|
|
- >已发布</el-tag
|
|
|
- >
|
|
|
+ <el-tag type="success" v-if="scope.row.status == 1" size="mini">已发布</el-tag>
|
|
|
<el-tag type="warning" v-else size="mini">待编辑</el-tag>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="editor" label="作者"></el-table-column>
|
|
|
<el-table-column prop="ctime" label="创建时间"></el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="date"
|
|
|
- label="操作"
|
|
|
- width="150"
|
|
|
- >
|
|
|
+ <el-table-column align="center" prop="date" label="操作" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- @click="openBaikeDetailForm('edit',scope.row)"
|
|
|
- size="mini"
|
|
|
- type="warning"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- @click="delBaikeDetail(scope.row)"
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ <el-button @click="topBaikeDetail(scope.row,'top')" size="mini" type="primary" v-if="scope.row.istop==0">置顶
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="topBaikeDetail(scope.row,'cancel')" size="mini" type="primary" v-else>取消置顶</el-button>
|
|
|
+ <el-button @click="openBaikeDetailForm('edit',scope.row)" size="mini" type="warning">编辑</el-button>
|
|
|
+ <el-button @click="delBaikeDetail(scope.row)" size="mini" type="danger">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <Page
|
|
|
- ref="pageButton"
|
|
|
- :current="form.page"
|
|
|
- :page_size="form.page_size"
|
|
|
- :total="total"
|
|
|
- @pageChange="gopage"
|
|
|
- />
|
|
|
+ <Page ref="pageButton" :current="form.page" :page_size="form.page_size" :total="total" @pageChange="gopage" />
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -203,11 +131,7 @@
|
|
|
<div>
|
|
|
<el-form ref="form" :model="catform" label-width="80px">
|
|
|
<el-form-item label="上级分类">
|
|
|
- <el-input
|
|
|
- v-model="catform.parent_name"
|
|
|
- placeholder=""
|
|
|
- disabled=""
|
|
|
- ></el-input>
|
|
|
+ <el-input v-model="catform.parent_name" placeholder="" disabled=""></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="分类名称">
|
|
|
<el-input v-model="catform.name" placeholder=""></el-input>
|
|
@@ -225,29 +149,22 @@
|
|
|
<el-form-item label="词条分类">
|
|
|
<el-input v-model="baikeDetailForm.category_name" placeholder="" disabled></el-input>
|
|
|
<el-input v-model="baikeDetailForm.category_id" placeholder="" type="hidden"></el-input>
|
|
|
- <el-tree
|
|
|
- :data="data"
|
|
|
- show-checkbox
|
|
|
- node-key="id"
|
|
|
- ref="tree"
|
|
|
- highlight-current
|
|
|
- @check="setSelected"
|
|
|
- >
|
|
|
+ <el-tree :data="data" show-checkbox node-key="id" ref="tree" highlight-current @check="setSelected">
|
|
|
</el-tree>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="词条名称">
|
|
|
<el-input v-model="baikeDetailForm.name" placeholder=""></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="封面图片" prop="">
|
|
|
- <el-upload class="avatar-uploader" action="/api/admin/uploadfile" :data="{watermark:0}"
|
|
|
- :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
|
|
|
- <img v-if="baikeDetailForm.img" :src="baikeDetailForm.img" class="avatar" />
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
+ <el-upload class="avatar-uploader" action="/api/admin/uploadfile" :data="{watermark:0}"
|
|
|
+ :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
|
|
|
+ <img v-if="baikeDetailForm.img" :src="baikeDetailForm.img" class="avatar" />
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="词条简介">
|
|
|
- <el-input v-model="baikeDetailForm.intro" placeholder="" type="textarea" rows=10></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <el-input v-model="baikeDetailForm.intro" placeholder="" type="textarea" rows=10></el-input>
|
|
|
+ </el-form-item>
|
|
|
<!-- <el-form-item label="词条解释">
|
|
|
<fuEditor
|
|
|
v-model="baikeDetailForm.content"
|
|
@@ -255,52 +172,41 @@
|
|
|
></fuEditor>
|
|
|
</el-form-item> -->
|
|
|
<el-form-item label="词条解释">
|
|
|
- <vue-ueditor-wrap ref="editor" v-model="baikeDetailForm.content" :config="myConfig"></vue-ueditor-wrap>
|
|
|
- </el-form-item>
|
|
|
+ <vue-ueditor-wrap ref="editor" v-model="baikeDetailForm.content" :config="myConfig"></vue-ueditor-wrap>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
<el-form-item label="作者">
|
|
|
<el-input v-model="baikeDetailForm.editor" placeholder=""></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" @click="dialogFormVisible = false"
|
|
|
- >取 消</el-button
|
|
|
- >
|
|
|
- <el-button size="small" type="primary" @click="saveBaikeDetail('save')"
|
|
|
- >保 存</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="success"
|
|
|
- @click="saveBaikeDetail('publish')"
|
|
|
- >发 布</el-button
|
|
|
- >
|
|
|
+ <el-button size="small" @click="dialogFormVisible = false">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="saveBaikeDetail('save')">保 存</el-button>
|
|
|
+ <el-button size="small" type="success" @click="saveBaikeDetail('publish')">发 布</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import Page from "../../components/Page";
|
|
|
-import fuEditor from "@/components/fuEditor/index.vue";
|
|
|
-export default {
|
|
|
- components: {
|
|
|
- Page,
|
|
|
- fuEditor,
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- filter: {
|
|
|
- area: "",
|
|
|
- name: "",
|
|
|
- },
|
|
|
- dialogFormVisible: false,
|
|
|
- dialogVisible: false,
|
|
|
- data: [
|
|
|
- {
|
|
|
+ import Page from "../../components/Page";
|
|
|
+ import fuEditor from "@/components/fuEditor/index.vue";
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ Page,
|
|
|
+ fuEditor,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ filter: {
|
|
|
+ area: "",
|
|
|
+ name: "",
|
|
|
+ },
|
|
|
+ dialogFormVisible: false,
|
|
|
+ dialogVisible: false,
|
|
|
+ data: [{
|
|
|
id: 3,
|
|
|
label: "一级 3",
|
|
|
- children: [
|
|
|
- {
|
|
|
+ children: [{
|
|
|
id: 7,
|
|
|
label: "二级 3-1",
|
|
|
},
|
|
@@ -309,211 +215,259 @@ export default {
|
|
|
label: "二级 3-2",
|
|
|
},
|
|
|
],
|
|
|
+ }, ],
|
|
|
+ form: {
|
|
|
+ parent_id: null,
|
|
|
+ is_active: false
|
|
|
},
|
|
|
- ],
|
|
|
- form: { parent_id: null, is_active: false },
|
|
|
- props: {
|
|
|
- label: "name",
|
|
|
- },
|
|
|
- //下属企业
|
|
|
- enterprise: {
|
|
|
- enterprise_id: "",
|
|
|
- },
|
|
|
- enterpriseList: [],
|
|
|
- area: [],
|
|
|
- show: 0,
|
|
|
- baikeList: [],
|
|
|
- total: 0,
|
|
|
- queryParams: {
|
|
|
- page: 1,
|
|
|
- page_size: 10,
|
|
|
- },
|
|
|
- catform: {},
|
|
|
- queryBaikeDetailParams: {},
|
|
|
- baikeStatusList: [
|
|
|
- { label: "待编辑", value: 0 },
|
|
|
- { label: "已发布", value: 1 },
|
|
|
- ],
|
|
|
- baikeDetailForm: {},
|
|
|
- isClear: false,
|
|
|
- };
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getData(data) {
|
|
|
- this.$api.getBaikeCategoryList().then((res) => {
|
|
|
- this.data = res.data.data;
|
|
|
- });
|
|
|
- if (data && data.id) {
|
|
|
- this.queryBaikeDetailParams.category_id = data.id;
|
|
|
- this.queryBaikeDetailParams.category_name = data.name;
|
|
|
- }
|
|
|
- this.$api.getBaikeDetailList(this.queryBaikeDetailParams).then((res) => {
|
|
|
- this.baikeList = res.data.data.list;
|
|
|
- this.total = res.data.data.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- append(data) {
|
|
|
- this.dialogVisible = true;
|
|
|
- this.catform = {
|
|
|
- parent_id: data.id,
|
|
|
- parent_name: data.name,
|
|
|
+ props: {
|
|
|
+ label: "name",
|
|
|
+ },
|
|
|
+ //下属企业
|
|
|
+ enterprise: {
|
|
|
+ enterprise_id: "",
|
|
|
+ },
|
|
|
+ enterpriseList: [],
|
|
|
+ area: [],
|
|
|
+ show: 0,
|
|
|
+ baikeList: [],
|
|
|
+ total: 0,
|
|
|
+ queryParams: {
|
|
|
+ page: 1,
|
|
|
+ page_size: 10,
|
|
|
+ },
|
|
|
+ catform: {},
|
|
|
+ queryBaikeDetailParams: {},
|
|
|
+ baikeStatusList: [{
|
|
|
+ label: "待编辑",
|
|
|
+ value: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已发布",
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ baikeDetailForm: {},
|
|
|
+ isClear: false,
|
|
|
};
|
|
|
},
|
|
|
- edit(data) {
|
|
|
- this.dialogVisible = true;
|
|
|
- this.$api.getBaikeCategoryDetail({ id: data.id }).then((res) => {
|
|
|
- this.catform = res.data.data;
|
|
|
- });
|
|
|
- },
|
|
|
- editDetail(data) {
|
|
|
- this.show = 1;
|
|
|
- this.$api.getBaikeDetail({ id: data.id }).then((res) => {
|
|
|
- this.form = res.data.data;
|
|
|
- this.form.is_active = Boolean(this.form.is_active);
|
|
|
- });
|
|
|
- },
|
|
|
- remove(data) {
|
|
|
- this.$confirm("确定删除“" + data.name + "”分类?", "提示", {
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- this.$api.delBaikeCategory({ id: data.id }).then((res) => {
|
|
|
- this.$message({ message: "删除成功!", type: "success" });
|
|
|
- this.getData();
|
|
|
+ methods: {
|
|
|
+ getData(data) {
|
|
|
+ this.$api.getBaikeCategoryList().then((res) => {
|
|
|
+ this.data = res.data.data;
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- delBaikeDetail(data) {
|
|
|
- this.$confirm("确定删除“" + data.name + "”分类?", "提示", {
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- this.$api.delBaikeDetail({ id: data.id }).then((res) => {
|
|
|
- this.$message({ message: "删除成功!", type: "success" });
|
|
|
- this.getData();
|
|
|
+ if (data && data.id) {
|
|
|
+ this.queryBaikeDetailParams.category_id = data.id;
|
|
|
+ this.queryBaikeDetailParams.category_name = data.name;
|
|
|
+ }
|
|
|
+ this.$api.getBaikeDetailList(this.queryBaikeDetailParams).then((res) => {
|
|
|
+ this.baikeList = res.data.data.list;
|
|
|
+ this.total = res.data.data.total;
|
|
|
+ this.loading = false;
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- save() {
|
|
|
- var parm = this.catform;
|
|
|
- if (parm.password != parm.repassword) {
|
|
|
- this.$message.error("两次输入的密码不一致,请检查!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (parm.id) {
|
|
|
- this.$api.editBaikeCategory(parm).then((res) => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- this.$message({ message: "修改成功!", type: "success" });
|
|
|
+ },
|
|
|
+ append(data) {
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.catform = {
|
|
|
+ parent_id: data.id,
|
|
|
+ parent_name: data.name,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ edit(data) {
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.$api.getBaikeCategoryDetail({
|
|
|
+ id: data.id
|
|
|
+ }).then((res) => {
|
|
|
+ this.catform = res.data.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ editDetail(data) {
|
|
|
+ this.show = 1;
|
|
|
+ this.$api.getBaikeDetail({
|
|
|
+ id: data.id
|
|
|
+ }).then((res) => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.form.is_active = Boolean(this.form.is_active);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ remove(data) {
|
|
|
+ this.$confirm("确定删除“" + data.name + "”分类?", "提示", {
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.$api.delBaikeCategory({
|
|
|
+ id: data.id
|
|
|
+ }).then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "删除成功!",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
this.getData();
|
|
|
- this.form = {
|
|
|
- parent_id: null,
|
|
|
- is_active: false,
|
|
|
- };
|
|
|
- } else {
|
|
|
- this.$message.error(res.data.message);
|
|
|
- }
|
|
|
+ });
|
|
|
});
|
|
|
- } else {
|
|
|
- this.$api.addBaikeCategory(parm).then((res) => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- this.$message({ message: "添加成功!", type: "success" });
|
|
|
+ },
|
|
|
+ delBaikeDetail(data) {
|
|
|
+ this.$confirm("确定删除“" + data.name + "”分类?", "提示", {
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.$api.delBaikeDetail({
|
|
|
+ id: data.id
|
|
|
+ }).then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "删除成功!",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
this.getData();
|
|
|
- this.form = {
|
|
|
- parent_id: null,
|
|
|
- is_active: false,
|
|
|
- };
|
|
|
- } else {
|
|
|
- this.$message.error(res.data.message);
|
|
|
- }
|
|
|
+ });
|
|
|
});
|
|
|
- }
|
|
|
- this.dialogVisible = false;
|
|
|
- },
|
|
|
- //下属企业
|
|
|
- add() {
|
|
|
- let parm = this.enterprise;
|
|
|
- parm.goverment_id = this.form.id;
|
|
|
- if (!parm.enterprise_id) {
|
|
|
- this.$message.error("请选择企业");
|
|
|
- }
|
|
|
- this.$api.saveSubent(parm).then((res) => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- this.$message({ message: "添加成功!", type: "success" });
|
|
|
- this.dialogFormVisible = false;
|
|
|
- this.edit({ id: parm.goverment_id });
|
|
|
- } else {
|
|
|
- this.$message.error(res.data.message);
|
|
|
+ },
|
|
|
+ save() {
|
|
|
+ var parm = this.catform;
|
|
|
+ if (parm.password != parm.repassword) {
|
|
|
+ this.$message.error("两次输入的密码不一致,请检查!");
|
|
|
+ return;
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- del(id) {
|
|
|
- this.$confirm("确定删除该企业?", "提示", {
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- this.$api
|
|
|
- .deleteSubent({ enterprise_id: id, goverment_id: this.form.id })
|
|
|
- .then((res) => {
|
|
|
- this.$message({ message: "删除成功!", type: "success" });
|
|
|
- this.edit({ id: this.form.id });
|
|
|
+ if (parm.id) {
|
|
|
+ this.$api.editBaikeCategory(parm).then((res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功!",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getData();
|
|
|
+ this.form = {
|
|
|
+ parent_id: null,
|
|
|
+ is_active: false,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.message);
|
|
|
+ }
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- getBaikeDetailList() {
|
|
|
- this.$api.getBaikeDetailList(this.queryBaikeDetailParams).then((res) => {
|
|
|
- this.baikeList = res.data.data.list;
|
|
|
- });
|
|
|
- },
|
|
|
- saveBaikeDetail(action) {
|
|
|
- var parm = this.baikeDetailForm;
|
|
|
- parm.action = action;
|
|
|
- if (parm.id) {
|
|
|
- this.$api.editBaikeDetail(parm).then((res) => {
|
|
|
+ } else {
|
|
|
+ this.$api.addBaikeCategory(parm).then((res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: "添加成功!",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getData();
|
|
|
+ this.form = {
|
|
|
+ parent_id: null,
|
|
|
+ is_active: false,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
+ //下属企业
|
|
|
+ add() {
|
|
|
+ let parm = this.enterprise;
|
|
|
+ parm.goverment_id = this.form.id;
|
|
|
+ if (!parm.enterprise_id) {
|
|
|
+ this.$message.error("请选择企业");
|
|
|
+ }
|
|
|
+ this.$api.saveSubent(parm).then((res) => {
|
|
|
if (res.data.code == 0) {
|
|
|
- this.$message({ message: "修改成功!", type: "success" });
|
|
|
- this.getData();
|
|
|
+ this.$message({
|
|
|
+ message: "添加成功!",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ this.edit({
|
|
|
+ id: parm.goverment_id
|
|
|
+ });
|
|
|
} else {
|
|
|
this.$message.error(res.data.message);
|
|
|
}
|
|
|
});
|
|
|
- } else {
|
|
|
- this.$api.addBaikeDetail(parm).then((res) => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- this.$message({ message: "添加成功!", type: "success" });
|
|
|
- this.getData();
|
|
|
+ },
|
|
|
+ del(id) {
|
|
|
+ this.$confirm("确定删除该企业?", "提示", {
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.$api
|
|
|
+ .deleteSubent({
|
|
|
+ enterprise_id: id,
|
|
|
+ goverment_id: this.form.id
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "删除成功!",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.edit({
|
|
|
+ id: this.form.id
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getBaikeDetailList() {
|
|
|
+ this.$api.getBaikeDetailList(this.queryBaikeDetailParams).then((res) => {
|
|
|
+ this.baikeList = res.data.data.list;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ saveBaikeDetail(action) {
|
|
|
+ var parm = this.baikeDetailForm;
|
|
|
+ parm.action = action;
|
|
|
+ if (parm.id) {
|
|
|
+ this.$api.editBaikeDetail(parm).then((res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功!",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getData();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$api.addBaikeDetail(parm).then((res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: "添加成功!",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getData();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ },
|
|
|
+ openBaikeDetailForm(action, row) {
|
|
|
+ if (action == "add") {
|
|
|
+ if (!this.queryBaikeDetailParams.category_id) {
|
|
|
+ this.$message.error("请选择词条分类!");
|
|
|
} else {
|
|
|
- this.$message.error(res.data.message);
|
|
|
+ this.baikeDetailForm.category_id = this.queryBaikeDetailParams.category_id;
|
|
|
+ this.baikeDetailForm.category_name = this.queryBaikeDetailParams.category_name;
|
|
|
+ this.dialogFormVisible = true;
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
- this.dialogFormVisible = false;
|
|
|
- },
|
|
|
- openBaikeDetailForm(action,row) {
|
|
|
- if (action == "add") {
|
|
|
- if (!this.queryBaikeDetailParams.category_id) {
|
|
|
- this.$message.error("请选择词条分类!");
|
|
|
} else {
|
|
|
- this.baikeDetailForm.category_id = this.queryBaikeDetailParams.category_id;
|
|
|
- this.baikeDetailForm.category_name = this.queryBaikeDetailParams.category_name;
|
|
|
- this.dialogFormVisible = true;
|
|
|
+ this.$api.getBaikeDetail({
|
|
|
+ id: row.id
|
|
|
+ }).then((res) => {
|
|
|
+ this.baikeDetailForm = res.data.data;
|
|
|
+ this.dialogFormVisible = true;
|
|
|
+ })
|
|
|
}
|
|
|
- }else{
|
|
|
- this.$api.getBaikeDetail({id:row.id}).then((res)=>{
|
|
|
- this.baikeDetailForm = res.data.data;
|
|
|
- this.dialogFormVisible = true;
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- setSelected(nodes,keys){
|
|
|
- this.baikeDetailForm.category_id = nodes.id;
|
|
|
- this.baikeDetailForm.category_name = nodes.name;
|
|
|
- },
|
|
|
- gopage(size) {
|
|
|
- if (size) {
|
|
|
- this.queryParams.page_size = size;
|
|
|
- }
|
|
|
- this.queryParams.page = this.$refs.pageButton.page;
|
|
|
- this.getData();
|
|
|
- },
|
|
|
- handleAvatarSuccess(res, file) {
|
|
|
+ },
|
|
|
+ setSelected(nodes, keys) {
|
|
|
+ this.baikeDetailForm.category_id = nodes.id;
|
|
|
+ this.baikeDetailForm.category_name = nodes.name;
|
|
|
+ },
|
|
|
+ gopage(size) {
|
|
|
+ if (size) {
|
|
|
+ this.queryParams.page_size = size;
|
|
|
+ }
|
|
|
+ this.queryParams.page = this.$refs.pageButton.page;
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ handleAvatarSuccess(res, file) {
|
|
|
this.baikeDetailForm.img = res.data.url;
|
|
|
console.log(this.baikeDetailForm.img)
|
|
|
},
|
|
@@ -529,10 +483,22 @@ export default {
|
|
|
this.$message.error("上传头像图片大小不能超过 2MB!");
|
|
|
}
|
|
|
return isJPG && isLt2M;
|
|
|
+ },
|
|
|
+ topBaikeDetail(row,action){
|
|
|
+ let params = {
|
|
|
+ id:row.id,
|
|
|
+ action:action
|
|
|
+ }
|
|
|
+ this.$api.baikeDetailTop(params).then(res=>{
|
|
|
+ if(res.data.code==0){
|
|
|
+ this.$message.success("成功")
|
|
|
+ this.getData()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getData();
|
|
|
- },
|
|
|
-};
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ };
|
|
|
</script>
|