Ver Fonte

Merge branch 'pre' of http://git.bjzxtw.org.cn:3000/zxt/admin_home into pre

dangyunlong há 2 dias atrás
pai
commit
bf91264dd2

+ 57 - 0
src/api/company.js

@@ -0,0 +1,57 @@
+// 企业管理
+import request from '@/utils/request'
+
+//获取企业列表
+export const getCompanyList = (params) => {
+    return request({
+        url: '/public/getCompanyList',
+        method: 'get',
+        params
+    })
+}
+
+//新增企业
+export const addCompany = (data) => {
+    return request({
+        url: '/public/addCompany',
+        method: 'post',
+        data
+    })
+}
+
+//删除企业
+export const delCompany = (data) => {
+    return request({
+        url: '/public/delCompany',
+        method: 'post',
+        data
+    })
+}
+
+//编辑企业
+export const upCompany = (data) => {
+    return request({
+        url: '/public/upCompany',
+        method: 'post',
+        data
+    })
+}
+
+//审核企业
+export const checkCompany = (data) => {
+    return request({
+        url: '/public/checkCompany',
+        method: 'post',
+        data
+    })
+}
+
+//企业详情
+export const getCompanyInfo = (params) => {
+    return request({
+        url: '/public/getCompanyInfo',
+        method: 'get',
+        params
+    })
+}
+

+ 51 - 1
src/router/index.js

@@ -1196,7 +1196,57 @@ export const constantRoutes = [
         }
       }
     ]
-  }
+  },
+  // --------------企业管理fr--------------start---------
+  {
+    path: '/companyList',
+    component: Layout,
+    children: [
+      {
+        name: '',
+        path: '',
+        component: () => import('@/views/company/companyList.vue'),
+        meta: {
+          title: '企业列表',
+          hidden: true,
+          breadcrumb: true
+        }
+      }
+    ]
+  },
+  {
+    path: '/checkcompanyList',
+    component: Layout,
+    children: [
+      {
+        name: '',
+        path: '',
+        component: () => import('@/views/company/checkcompanyList.vue'),
+        meta: {
+          title: '待审核列表',
+          hidden: true,
+          breadcrumb: true
+        }
+      }
+    ]
+  },
+  {
+    path: '/creatCompany',
+    component: Layout,
+    children: [
+      {
+        name: '',
+        path: '',
+        component: () => import('@/views/company/creatCompany'),
+        meta: {
+          title: '添加企业',
+          hidden: true,
+          breadcrumb: true
+        }
+      }
+    ]
+  },
+  // --------------企业管理fr--------------end---------
 ]
 
 /**

+ 72 - 0
src/store/modules/company.js

@@ -0,0 +1,72 @@
+import { getCompanyList,addCompany,delCompany,upCompany,checkCompany,getCompanyInfo} from '@/api/company'
+
+const state = {
+
+}
+
+const mutations = {
+
+}
+
+const actions = {
+    getCompanyList({commit},data) {
+        return new Promise((resolve, reject) => {
+            getCompanyList(data).then(response => {
+            resolve(response)
+          }).catch(error => {
+            reject(error)
+          })
+        })
+      },
+      addCompany({ commit }, data) {
+        return new Promise((resolve, reject) => {
+            addCompany(data).then(response => {
+                resolve(response)
+            }).catch(error => {
+                reject(error)
+            })
+        })
+    },
+    delCompany({ commit }, data) {
+        return new Promise((resolve, reject) => {
+            delCompany(data).then(response => {
+                resolve(response)
+            }).catch(error => {
+                reject(error)
+            })
+        })
+    },
+    upCompany({ commit }, data) {
+        return new Promise((resolve, reject) => {
+            upCompany(data).then(response => {
+                resolve(response)
+            }).catch(error => {
+                reject(error)
+            })
+        })
+    },
+    checkCompany({ commit }, data) {
+        return new Promise((resolve, reject) => {
+            checkCompany(data).then(response => {
+                resolve(response)
+            }).catch(error => {
+                reject(error)
+            })
+        })
+    },
+    getCompanyInfo({ commit }, data) {
+        return new Promise((resolve, reject) => {
+            getCompanyInfo(data).then(response => {
+                resolve(response)
+            }).catch(error => {
+                reject(error)
+            })
+        })
+    },
+}
+export default {
+    namespaced: true,
+    state,
+    mutations,
+    actions
+}

+ 361 - 0
src/views/company/checkcompanyList.vue

@@ -0,0 +1,361 @@
+<template>
+  <div class="mainBox">
+    <!--搜索功能 start------------------------------------------------------------>
+    <div class="layerBox_search">
+      <div class="layerBoxLine">
+        <el-row>
+          <el-col :span="8">
+            <div class="searchBox">
+              <div class="searchTitle">标题:</div>
+              <el-input placeholder="请输入标题" autocomplete="off" v-model="getApiData.title" />
+            </div>
+          </el-col>
+          <el-col :span="8">
+            <div class="searchBox">
+              <div class="searchTitle"> 网站名称:</div>
+              <el-input placeholder="请输入网站名称" autocomplete="off" v-model="getApiData.website_name" />
+            </div>
+          </el-col>
+          <el-col :span="8">
+            <div class="searchBox">
+              <div class="searchTitle">资讯状态:</div>
+              <el-select v-model="getApiData.status" placeholder="请选择..">
+                <el-option label="待审核" value="0"></el-option>
+                <el-option label="已拒绝" value="2"></el-option>
+              </el-select>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+    </div>
+
+    <div class="layerBoxNoBg">
+      <div>
+        <el-button type="primary" @click="goCreat">添加企业</el-button>
+      </div>
+      <div>
+        <el-button @click="clearSearchList">重置</el-button>
+        <el-button type="primary" @click="getData('search')">搜索</el-button>
+      </div>
+    </div>
+    <!--搜索功能 end------------------------------------------------------------>
+
+    <!--表格内容 start------------------------------------------------------------>
+    <div class="layerBox">
+      <tableTitle :name="tableDivTitle" />
+      <el-row>
+        <template>
+          <el-table :data="tableData" style="width: 100%">
+            <el-table-column fixed prop="id" label="ID" width="80"></el-table-column>
+            <el-table-column prop="title" label="企业题目" width="300">
+              <template slot-scope="scope">
+                <el-popover placement="top-start" width="340" trigger="hover" :content="scope.row.title">
+                  <span slot="reference" class="titleWidth">{{ scope.row.title }}</span>
+                </el-popover>
+              </template>
+            </el-table-column>
+            <el-table-column prop="category_name" label="栏目名称" width="210"></el-table-column>
+            <el-table-column prop="website_name" label="网站名称" width="210"></el-table-column>
+            <el-table-column prop="updated_at" label="修改时间" width=""></el-table-column>
+            <el-table-column prop="status" label="状态" width="">
+              <template slot-scope="scope">
+                <span v-if="scope.row.status == 0">待审核</span>
+                <span v-if="scope.row.status == 1">已通过</span>
+                <span v-if="scope.row.status == 2">已拒绝</span>
+              </template>
+            </el-table-column>
+            <el-table-column fixed="right" label="操作" width="350" header-align="center"
+              v-if="creatNews_user_type == 10000">
+              <template slot-scope="scope">
+                <div class="listBtnBox">
+                  <div class="listMainBtn" @click="getUpRow(scope.row.id, tableData)"><i class="el-icon-check"></i>审核
+                  </div>
+                  <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i
+                      class="el-icon-delete"></i>删除</div>
+                  <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i
+                      class="el-icon-edit-outline"></i>编辑</div>
+                </div>
+              </template>
+            </el-table-column>
+            
+            <el-table-column fixed="right" label="操作" width="180" header-align="center"
+              v-if="creatNews_user_type != 10000">
+              <template slot-scope="scope">
+                <div class="listBtnBox">
+                  <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i
+                      class="el-icon-delete"></i>删除</div>
+                  <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i
+                      class="el-icon-edit-outline"></i>编辑</div>
+                </div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </template>
+      </el-row>
+    </div>
+    <!--分页 start------------------------------------------------------------>
+    <div class="alignBox">
+      <el-row>
+        <el-col :span="24">
+          <el-pagination @size-change="handleSizeChange" :current-page="getApiData.page"
+            @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper"
+            :total="allCount"></el-pagination>
+        </el-col>
+      </el-row>
+    </div>
+    <!--分页 end------------------------------------------------------------>
+    <!--表格内容 end------------------------------------------------------------>
+        <!--弹出框1:外部表单弹出框 start------------------------------------------------------------>
+        <el-dialog title="请输入驳回理由" :visible.sync="examineWindow" :close-on-click-modal="false">
+          <el-form :model="form" ref="form" :rules="formRules" label-position="left">
+            <div class="formDiv">
+              <el-form-item label="驳回原因:" :label-width="formLabelWidth" prop="reason" class="custom-align-right">
+                <el-input type="textarea" v-model="form.reason" class="custom-textarea" placeholder="请输入驳回原因"
+                  :rows="3"></el-input>
+              </el-form-item>
+            </div>
+          </el-form>
+          <div slot="footer" class="dialog-footer">
+            <div>
+              <el-button type="info" @click="examineWindow = false">取消</el-button>
+              <el-button type="primary" @click="examineToServe">确定</el-button>
+            </div>
+          </div>
+        </el-dialog>
+        <!--弹出框1:外部表单弹出框 end------------------------------------------------------------>
+  </div>
+</template>
+
+<script>
+//表格标题
+import tableTitle from './components/tableTitle';
+//引入公用样式
+import '@/styles/global.less';
+//获得用户身份
+import { getUseType } from '@/utils/auth'
+
+export default {
+  components: {
+    tableTitle,//表格标题
+  },
+  data() {
+    let self = this;
+    //表单验证
+    const validateEmpty = (rule, value, callback) => {
+      if (value == '') {
+        callback(new Error('该项不能为空!'))
+      } else {
+        callback()
+      }
+    }
+    return {
+      //1.列表和分页相关 start ------------------------------------------------------------>
+      formLabelWidth: "120px",//表单label宽度
+      tableDivTitle: "企业列表",
+      tableData: [],//内容
+      webSiteData: [],//可选网站列表
+      creatNews_user_type: 0,//用户类型
+      //选择要发布的网站
+      webSiteForm: {
+        ignore_ids: []
+      },
+      status: 0,//审核状态
+      ids: [],//待选网站列表
+      loading: false,//loading
+      editId: 0,//要修改的网站id
+      selectStatusWindow: false,//反选窗口
+      getApiData: {
+        id: "",//id
+        title: "",//标题
+        website_name: "",//导航池id
+        ischeck: 1,//待审核列表  1      已审核列表     2
+        islink: "",//是否使用外链
+        status: null,//企业状态
+        page: 1,//当前是第几页
+        pageSize: 10,//一共多少条
+      },
+      //提交驳回
+      form: {
+        reason: ""
+      },
+      formRules: {
+        //导航池名称不能为空
+        reason: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+      },
+      allCount: 0,//总条数
+      examineWindow: false,//审核窗口
+      //分页相关 end ------------------------------------------------------------>
+    }
+  },
+  methods: {
+    //1.列表和分页相关 start ------------------------------------------------------------>
+    //1.1 开始请求列表信息方法
+    getData(type) {
+      if (type == "search") {
+        this.getApiData.page = 1;
+      }
+      this.$store.dispatch('company/getCompanyList', this.getApiData).then(res => {
+        //格式化:islink=0为不使用外面 islink=1为使用外链
+        //status=1为显示 status=2为不显示
+        let data = [];
+        this.tableData = res.data.data; //给与内容
+        this.allCount = res.data.total; //给与总条数
+      }).catch(() => {
+        this.$message({
+          type: 'warning',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
+    //1.2 删除内容
+    deleteRow(id) {
+      this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log("当前删除:" + id)
+        this.$store.dispatch('company/delCompany', { id: id }).then(res => {
+          this.getData();
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+        }).catch(() => {
+          this.$message({
+            type: 'warning',
+            message: '网络错误,请重试!'
+          });
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'warning',
+          message: '已取消删除'
+        });
+      });
+    },
+    //1.4 列表内容分页
+    //直接跳转
+    handleSizeChange(val) {
+      this.getApiData.page = val;
+      this.getData();
+    },
+    //1.5 点击分页
+    handleCurrentChange(val) {
+      this.getApiData.page = val;
+      this.getData();
+    },
+    //1.6 重置按钮
+    clearSearchList() {
+      this.tableData = [];
+      this.getApiData.id = "";
+      this.getApiData.title = "";
+      this.getApiData.website_name = "";
+      this.getApiData.status = null;
+      this.getApiData.page = 1;
+      this.getApiData.pageSize = 10;
+      this.getData();
+    },
+    //列表和分页相关 end ------------------------------------------------------------>
+
+    //2.添加新闻 start ------------------------------------------------------------>
+    //跳转到企业发布页面
+    goCreat() {
+      this.$router.push({
+        path: '/creatCompany',
+      });
+    },
+    goEdit(id) {
+      let data = {
+        id: id,
+        to: "checkCompany"
+      }
+      this.$router.push({
+        path: '/creatCompany',
+        query: data
+      });
+    },
+    // },
+   //1.4 审核温江
+   getUpRow(id) {
+    //设置待审核的id
+    this.editId = id;
+    console.log(id)
+    this.$confirm('将此文章通过审核吗?', '提示', {
+      confirmButtonText: '通过',
+      cancelButtonText: '拒绝',
+      distinguishCancelAndClose: true,  // 关键配置项,用于区分取消和关闭按钮
+      type: 'warning'
+    }).then(() => {
+      this.upRow(id, 1)
+    }).catch((the_reback) => {
+      //输入驳回理由
+      
+      if (the_reback == "cancel") {
+        //输入驳回理由
+        // console.log("驳回" )
+        this.examineWindow = true;
+      }
+
+    })
+  },
+  // //3.5 修改文章状态
+  upRow(id, status) {
+      let data = {
+        id: id,
+        status: status
+      }
+      this.$store.dispatch('company/checkCompany', data).then(res => {
+        if (res.code == 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          });
+          this.getData();
+        }
+      })
+    },
+    //3.编辑新闻 end ------------------------------------------------------------>
+
+    //提交驳回内容
+    examineToServe(id) {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          let data = {
+            id: this.editId,
+            status: 2,//驳回status
+            reason: this.form.reason
+          }
+          this.$store.dispatch('company/checkCompany', data).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                type: 'success',
+                message: '操作成功!'
+              });
+              this.getData();
+              this.form.reason = "";//清空上一次的输入
+              this.examineWindow = false;
+            }
+          })
+        } else {
+          this.$message.error("驳回理由不能为空!")
+        }
+      })
+    },
+  },
+  mounted() {
+    this.creatNews_user_type = getUseType()
+    //1.获得初始数据
+    this.getData();
+  }
+}
+</script>
+
+<style scoped lang="less">
+.titleWidth {
+  width: 350px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+</style>

+ 421 - 0
src/views/company/companyList.vue

@@ -0,0 +1,421 @@
+<template>
+    <div class="mainBox">
+      <!--搜索功能 start------------------------------------------------------------>
+      <div class="layerBox_search">
+        <div class="layerBoxLine">
+          <el-row>
+            <el-col :span="8">
+              <div class="searchBox">
+                <div class="searchTitle">标题:</div>
+                <el-input placeholder="请输入标题" autocomplete="off" v-model="getApiData.title" />
+              </div>
+            </el-col>
+            <el-col :span="8">
+              <div class="searchBox">
+                <div class="searchTitle"> 网站名称:</div>
+                <el-input placeholder="请输入网站名称" autocomplete="off" v-model="getApiData.category_name" />
+              </div>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+  
+      <div class="layerBoxNoBg">
+        <div>
+          <el-button type="primary" @click="goCreat">添加企业</el-button>
+        </div>
+        <div>
+          <el-button @click="clearSearchList">重置</el-button>
+          <el-button type="primary" @click="getData('search')">搜索</el-button>
+        </div>
+      </div>
+      <!--搜索功能 end------------------------------------------------------------>
+  
+      <!--表格内容 start------------------------------------------------------------>
+      <div class="layerBox">
+        <tableTitle :name="tableDivTitle" />
+        <el-row>
+          <template>
+            <el-table :data="tableData" style="width: 100%">
+              <el-table-column fixed prop="id" label="ID" width="80"></el-table-column>
+              <el-table-column prop="title" label="企业题目" width="300">
+                <template slot-scope="scope">
+                  <el-popover placement="top-start" width="340" trigger="hover" :content="scope.row.title">
+                    <span slot="reference" class="titleWidth">{{ scope.row.title }}</span>
+                  </el-popover>
+                </template>
+              </el-table-column>
+              <el-table-column prop="category_name" label="栏目名称" width="210"></el-table-column>
+              <el-table-column prop="website_name" label="网站名称" width="210"></el-table-column>
+              <el-table-column prop="updated_at" label="修改时间" width=""></el-table-column>
+              <el-table-column prop="status" label="状态" width="">
+                <template slot-scope="scope">
+                  <span v-if="scope.row.status == 0">待审核</span>
+                  <span v-if="scope.row.status == 1">已通过</span>
+                  <span v-if="scope.row.status == 2">已拒绝</span>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="350" header-align="center"
+                v-if="creatNews_user_type == 10000">
+                <template slot-scope="scope">
+                  <div class="listBtnBox">
+                    <div class="listUpBtn" @click="returnRow(scope.row.id, tableData)"><i
+                        class="el-icon-refresh-right"></i>撤回</div>
+                    <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i
+                        class="el-icon-delete"></i>删除</div>
+                    <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i
+                        class="el-icon-edit-outline"></i>编辑</div>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="180" header-align="center"
+                v-if="creatNews_user_type != 10000">
+                <template slot-scope="scope">
+                  <div class="listBtnBox">
+                    <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i
+                        class="el-icon-delete"></i>删除</div>
+                    <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i
+                        class="el-icon-edit-outline"></i>编辑</div>
+                  </div>
+                </template>
+              </el-table-column>
+            </el-table>
+          </template>
+        </el-row>
+      </div>
+      <!--分页 start------------------------------------------------------------>
+      <div class="alignBox">
+        <el-row>
+          <el-col :span="24">
+            <el-pagination @size-change="handleSizeChange" :current-page="getApiData.page"
+              @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper"
+              :total="allCount"></el-pagination>
+          </el-col>
+        </el-row>
+      </div>
+      <!--分页 end------------------------------------------------------------>
+      <!--表格内容 end------------------------------------------------------------>
+  
+      <!--弹出框:选择要发布的网站 start------------------------------------------------------------>
+      <el-dialog title="请选择不要发布的网站" :visible.sync="selectStatusWindow" :close-on-click-modal="false">
+        <el-form label-position="left">
+          <div class="formDiv">
+            <el-table v-loading="loading" ref="multipleTable" :data="webSiteData" tooltip-effect="dark"
+              style="width: 100%" @selection-change="handleSelectionChange">
+              <el-table-column type="selection" width="55"></el-table-column>
+              <el-table-column prop="website_id" label="网站id"></el-table-column>
+              <el-table-column prop="website_name" label="网站名称"></el-table-column>
+            </el-table>
+          </div>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <div>
+            <el-button type="info" @click="selectStatusWindow = false">取消</el-button>
+            <el-button type="primary" @click="selectWebSiteToServe">确定</el-button>
+          </div>
+        </div>
+      </el-dialog>
+      <!--弹出框:选择要发布的网站 end------------------------------------------------------------>
+    </div>
+  </template>
+  
+  <script>
+  //表格标题
+  import tableTitle from './components/tableTitle';
+  //引入公用样式
+  import '@/styles/global.less';
+  //获得用户身份
+  import { getUseType } from '@/utils/auth'
+  
+  export default {
+    components: {
+      tableTitle,//表格标题
+    },
+    data() {
+      return {
+        //1.列表和分页相关 start ------------------------------------------------------------>
+        tableDivTitle: "企业列表",
+        tableData: [],//内容
+        webSiteData: [],//可选网站列表
+        creatNews_user_type: 0,//用户类型
+        //选择要发布的网站
+        webSiteForm: {
+          ignore_ids: []
+        },
+        ids: [],//待选网站列表
+        loading: false,//loading
+        editId: 0,//要修改的网站id
+        selectStatusWindow: false,//反选窗口
+        getApiData: {
+          id: "",//id
+          title: "",//标题
+          category_name: "",//导航池id
+          ischeck: 2,//待审核列表  1      已审核列表     2
+          islink: "",//是否使用外链
+          status: 1,//企业状态
+          page: 1,//当前是第几页
+          pageSize: 10,//一共多少条
+        },
+        allCount: 0,//总条数
+        //分页相关 end ------------------------------------------------------------>
+      }
+    },
+    methods: {
+      //1.列表和分页相关 start ------------------------------------------------------------>
+      //1.1 开始请求列表信息方法
+      getData(type) {
+        if (type == "search") {
+          this.getApiData.page = 1;
+        }
+        this.$store.dispatch('company/getCompanyList', this.getApiData).then(res => {
+          //格式化:islink=0为不使用外面 islink=1为使用外链
+          //status=1为显示 status=2为不显示
+          let data = [];
+          this.tableData = res.data.data; //给与内容
+          this.allCount = res.data.total; //给与总条数
+        }).catch(() => {
+          this.$message({
+            type: 'warning',
+            message: '网络错误,请重试!'
+          });
+        })
+      },
+      //1.2 删除内容
+      deleteRow(id) {
+        this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          console.log("当前删除:" + id)
+          this.$store.dispatch('company/delCompany', { id: id }).then(res => {
+            this.getData();
+            this.$message({
+              type: 'success',
+              message: '删除成功!'
+            });
+          }).catch(() => {
+            this.$message({
+              type: 'warning',
+              message: '网络错误,请重试!'
+            });
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'warning',
+            message: '已取消删除'
+          });
+        });
+      },
+      //1.3 修改网站状态
+      upRow(id, status) {
+        let data = {
+          id: id,
+          status: status
+        }
+        this.$store.dispatch('company/upCompany', data).then(res => {
+          if (res.code == 200) {
+            this.$message({
+              type: 'success',
+              message: '企业状态已修改!'
+            });
+          }
+        }).catch(() => {
+          this.$message({
+            type: 'warning',
+            message: '已取消删除'
+          });
+        });
+      },
+      //1.4 列表内容分页
+      //直接跳转
+      handleSizeChange(val) {
+        this.getApiData.page = val;
+        this.getData();
+      },
+      //1.5 点击分页
+      handleCurrentChange(val) {
+        this.getApiData.page = val;
+        this.getData();
+      },
+      //1.6 重置按钮
+      clearSearchList() {
+        this.tableData = [];
+        this.getApiData.id = "";
+        this.getApiData.title = "";
+        this.getApiData.category_name = "";
+        this.getApiData.author = "";
+        this.getApiData.islink = "";
+        this.getApiData.status = "";
+        this.getApiData.page = 1;
+        this.getApiData.pageSize = 10;
+        this.getData();
+      },
+      //列表和分页相关 end ------------------------------------------------------------>
+  
+      //2.添加新闻 start ------------------------------------------------------------>
+      //跳转到企业发布页面
+      goCreat() {
+        this.$router.push({
+          path: '/creatCompany',
+        });
+      },
+      goEdit(id) {
+        let data = {
+          id: id
+        }
+        this.$router.push({
+          path: '/creatCompany',
+          query: data
+        });
+      },
+      //添加新闻 end ------------------------------------------------------------>
+  
+      //3.编辑新闻 start ------------------------------------------------------------>
+      //3.1 打开反选窗口
+      selectRow(cid, row) {
+        console.log(row)
+        this.selectStatusWindow = true;
+        //给与编辑的id
+        this.editId = row.id;
+        //给与编辑的状态
+        this.editStatus = row.status;
+        //把cid转换成数组,然后取出最后一位
+  
+        let cidLast = "";
+        // 判断cid是否为数组
+        if (!Array.isArray(cid)) {
+          let cidArr = cid.replace(/[\[\]]/g, '').split(',');
+          cidLast = cidArr[cidArr.length - 1];
+        } else {
+          cidLast = cid[cid.length - 1];
+        }
+        this.getWebsiteNavPoolSite(cidLast, row)
+      },
+      //3.2 获取可选网站列表
+      getWebsiteNavPoolSite(cid, row) {
+        this.loading = true;
+        let ignoreIds = JSON.parse(row.ignore_ids);
+        this.webSiteData = [];
+        this.$store.dispatch('news/getWebsiteNavPoolSite', { category_id: cid }).then(res => {
+          //this.webSiteData = res.data;
+          for (let item of res.data) {
+            if (item.website_name != null) {
+              this.webSiteData.push(item)
+            }
+          }
+  
+          //延迟一会返显,否则可能显示不了
+          if (res.data.length > 0 && ignoreIds != null) {
+            setTimeout(() => {
+              for (let index in this.webSiteData) {
+                if (ignoreIds.includes(this.webSiteData[index].website_id)) {
+                  //调用回显方法
+                  this.toggleSelection([this.webSiteData[index]])
+                }
+              }
+              this.loading = false;
+            }, 500)
+          } else {
+            this.loading = false;
+          }
+        })
+      },
+      //3.3 回显 选中的方法 
+      toggleSelection(rows) {
+        console.log(rows)
+        if (rows) {
+          rows.forEach(row => {
+            this.$refs.multipleTable.toggleRowSelection(row);
+          });
+        } else {
+          this.$refs.multipleTable.clearSelection();
+        }
+      },
+      //3.4 把选择的网站保存到待选择的网站列表
+      handleSelectionChange(val) {
+        console.log(val)
+        this.ids = val;
+      },
+      //3.5 提交选择的网站列表
+      selectWebSiteToServe(id) {
+        let ids = [];
+        for (let item of this.ids) {
+          ids.push(item.website_id)
+        }
+        //把数组转换为字符串
+        //let idsStr = ids.join(',');
+        //把数组转换为字符串
+        let idsStr = JSON.stringify(ids);
+  
+        if (idsStr.length == 0) {
+          this.$message.error("至少需要选择一个网站!")
+          return;
+        } else {
+          let data = {
+            id: this.editId,
+            ignore_ids: idsStr,
+            status: this.editStatus
+          }
+          this.$store.dispatch('news/upArticleStatus', data).then(res => {
+            console.log(res)
+            if (res.code == 200) {
+              this.$message({
+                type: 'success',
+                message: '企业绑定网站成功!'
+              });
+              this.selectStatusWindow = false;
+              this.getData();
+            } else {
+              this.$message.error(res.data.msg)
+            }
+          })
+        }
+      },
+      //3.6 撤回审核
+      returnRow(id) {
+        this.$confirm('确定要撤回吗?', '提示', {
+          confirmButtonText: '撤回',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          //撤回,把文章状态修改为0,重新进行审核
+          this.upRow(id, 0)
+        })
+      },
+      //3.5 修改文章状态
+      upRow(id, status) {
+        let data = {
+          id: id,
+          status: 0
+        }
+        this.$store.dispatch('company/checkCompany', data).then(res => {
+          if (res.code == 200) {
+            this.$message({
+              type: 'success',
+              message: '操作成功!'
+            });
+            this.getData();
+          }
+        })
+      },
+      //3.编辑新闻 end ------------------------------------------------------------>
+  
+    },
+    mounted() {
+      this.creatNews_user_type = getUseType()
+      //1.获得初始数据
+      this.getData();
+    }
+  }
+  </script>
+  
+  <style scoped lang="less">
+  .titleWidth {
+    width: 350px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+  </style>
+  

+ 106 - 0
src/views/company/components/CityCascader.vue

@@ -0,0 +1,106 @@
+<template>
+  <el-cascader
+    :key="cascaderKey"
+    v-model="internalValue"
+    placeholder="请选择地区"
+    :props="SearchCityData"
+    filterable
+    clearable
+    @change="handleChange">
+  </el-cascader>
+</template>
+
+<script>
+export default {
+  props: {
+    value: { // 接收外部传递的 v-model 值
+      type: [Array, String], // 允许传入数组或字符串类型的数据
+      default: () => [],
+    },
+  },
+  data() {
+    let self = this;
+    return {
+      internalValue: [], // 用于与级联选择器进行双向绑定的内部数据
+      cascaderKey: 0, // 用于强制刷新 cascader
+      SearchCityData: {
+        checkStrictly: true,
+        lazy: true,
+        async lazyLoad(node, resolve) {
+          const { level, data } = node;
+          let parentId = level == 0 ? 0 : data.value;
+          let parames = {
+            pid: parentId,
+          };
+          self.$store
+            .dispatch("pool/getcityList", parames)
+            .then((res) => {
+              if (res.data) {
+                const nodes = res.data.map((item) => ({
+                  value: item.id,
+                  label: item.name,
+                  leaf: level >= 3,
+                  children: [],
+                }));
+                resolve(nodes);
+              }
+            })
+            .catch(() => {
+              this.$message({
+                type: "info",
+                message: "网络错误,请重试!",
+              });
+            });
+        },
+      },
+    };
+  },
+  watch: {
+    value: {
+      immediate: true, // 组件挂载时立即执行
+      handler(newVal) {
+        try {
+          const parsedValue = Array.isArray(newVal) ? newVal : JSON.parse(newVal);
+          this.internalValue = parsedValue; // 设置内部值
+          if (parsedValue.length) {
+            this.loadCascaderPath(parsedValue); // 动态加载回显的路径
+          }
+        } catch (error) {
+          console.error("无法解析传入的值:", error);
+          this.internalValue = []; // 如果解析失败,重置为默认空数组
+        }
+      },
+    },
+  },
+  methods: {
+    handleChange(value) {
+      // 当选择变化时,向父组件发送更新的值
+      this.$emit("input", value); // v-model 双向绑定
+      this.$emit("update-city-id", value); // 额外事件,方便父组件监听
+    },
+    async loadCascaderPath(path) {
+      for (let i = 0; i < path.length; i++) {
+        const parentId = path[i - 1] || 0; // 获取当前层级的父级ID
+        const level = i; // 当前层级的索引
+        await this.$store.dispatch('pool/getcityList', { pid: parentId })
+          .then((res) => {
+            const nodes = res.data.map(item => ({
+              value: item.id,
+              label: item.name,
+              leaf: level >= 3, // 假设4层结构,设置叶子节点标记
+            }));
+            // 级联选择器加载数据
+            if (level === path.length - 1) {
+              this.internalValue = path; // 确保最后一级路径正确设置
+              this.cascaderKey += 1; // 强制刷新 cascader
+            }
+          });
+      }
+    },
+  },
+};
+</script>
+
+<style scoped>
+/* 可根据需要自定义样式 */
+</style>

+ 41 - 0
src/views/company/components/tableTitle.vue

@@ -0,0 +1,41 @@
+<template>
+  <div class="tableTitle">
+    <span class="tableFloatLine"></span>
+    {{ name }}
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    name: {
+      type: String,
+      required: true,
+    },
+  },
+  data() {
+    return {
+      someData: '',
+    };
+  },
+};
+</script>
+
+<style scoped lang="less">
+.tableTitle {
+  color: #333333;
+  position: relative;
+  padding-bottom: 20px;
+  margin-top: 20px;
+
+  .tableFloatLine {
+    width: 3px;
+    height: 16px;
+    background: #5570F1;
+    display: block;
+    position: absolute;
+    left: -20px;
+    top: 1px;
+  }
+}
+</style>

+ 40 - 0
src/views/company/components/tableTitle1.vue

@@ -0,0 +1,40 @@
+<template>
+  <div class="tableTitle">
+    <span class="tableFloatLine"></span>
+    {{ name }}
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    name: {
+      type: String,
+      required: true,
+    },
+  },
+  data() {
+    return {
+      someData: '',
+    };
+  },
+};
+</script>
+
+<style scoped lang="less">
+.tableTitle {
+  color: #333333;
+  position: relative;
+  padding-bottom: 20px;
+
+  .tableFloatLine {
+    width: 3px;
+    height: 16px;
+    background: #5570F1;
+    display: block;
+    position: absolute;
+    left: -20px;
+    top: 1px;
+  }
+}
+</style>

+ 1076 - 0
src/views/company/creatCompany.vue

@@ -0,0 +1,1076 @@
+<template>
+  <div class="mainBox">
+    <div class="layerBox">
+      <tableTitle :name="tableDivTitle" />
+      <el-form :model="form" ref="form" :rules="formRules" label-position="left" label-width="140px">
+        <div class="formDiv">
+          <div v-if="creatNews_user_type == 10000">
+            <el-form-item label="站点名称:" prop="website_id" class="custom-align-right">
+              <el-cascader :key="parentKey" v-model="form.website_id" placeholder="请选择站点名称"
+                popper-class="my_cascader" :options="creatNews_nav_pool_arr"
+                @change="creatNews_nav_pool_change_fun(form.website_id)" filterable clearable></el-cascader>
+            </el-form-item>
+            <el-form-item label="栏目名称:" prop="cat_arr_id" class="custom-align-right">
+                <el-cascader :key="parentKey_2" v-model="form.cat_arr_id" placeholder="请选择要绑定的展示名称" 
+                popper-class="my_cascader" style="height: 100%;" :props="parentData_2" filterable clearable>
+                </el-cascader>
+            </el-form-item>
+          </div>
+          <div v-if="creatNews_user_type != 10000">
+            <el-form-item label="栏目名称:" prop="cat_arr_id" class="custom-align-right">
+              <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的展示名称" :props="parentData"
+                  popper-class="my_cascader" style="height: 100%;" filterable clearable>
+              </el-cascader>
+            </el-form-item>
+          </div>
+          <div>
+          <el-form-item label="企业名称:" prop="title" class="custom-align-right">
+            <el-input v-model="form.title" autocomplete="off" placeholder="请输入企业名称"></el-input>
+            <!-- <el-checkbox v-model="form.islink">是否使用外链</el-checkbox> -->
+          </el-form-item>
+          <el-form-item label="作者:" prop="author" class="custom-align-right">
+            <el-input v-model="form.author" autocomplete="off" placeholder="请输入作者"></el-input>
+          </el-form-item>
+          <el-form-item label="来源名称:" prop="source" class="custom-align-right">
+            <el-input v-model="form.source" autocomplete="off" placeholder="请输入来源名称"></el-input>
+          </el-form-item>
+          <el-form-item label="来源链接:" prop="source_url" class="custom-align-right">
+            <el-input v-model="form.source_url" autocomplete="off" placeholder="请输入来源链接"></el-input>
+          </el-form-item>
+          <div>
+            <el-form-item label="缩略图:" class="custom-align-right" prop="">
+              <div class="uploaderBox" @mouseenter="hovering = true" mouseleave="hovering = false">
+                <el-upload class="avatar-uploader" action="#" :show-file-list="false"
+                  :before-upload="beforeAvatarUpload">
+                  <!-- 预览图片 -->
+                  <img v-if="imgUrl" :src="imgUrl" class="avatar">
+                  <div v-else class="chooseImgDiv">
+                    <div>
+                      <img src="@/assets/public/upload/noImage.png">
+                      <div>选择图片</div>
+                    </div>
+                  </div>
+                </el-upload>
+                <input type="hidden" v-model="form.imgurl">
+                <span class="photo_tips">推荐图片长宽比例为 16:9,大小不能超过 500 K。</span>
+                <div v-if="hovering && imgUrl" class="delete-button" @click="handleDelete">
+                  <i class="el-icon-delete"></i>
+                </div>
+              </div>
+            </el-form-item>
+            <el-form-item label="内容简介:" prop="description" class="custom-align-right">
+              <el-input v-model="form.description" autocomplete="off" placeholder="请输入内容简介" type="textarea" :rows="3"></el-input>
+            </el-form-item>
+            <el-form-item label="企业关键词:" prop="" class="custom-align-right">
+              <template #label>
+                <span class="askBox">
+                  企业关键词:
+                  <el-tooltip class="item" effect="dark" content="企业关键词,如:三农市场网、全国三农、信息一体化。" placement="top">
+                    <i class="el-icon-question"></i>
+                  </el-tooltip>
+                </span>
+              </template>
+              <tagInput :initialTags="tags" @tags-updated="updateTags"></tagInput>
+            </el-form-item>
+            <el-form-item label="企业描述:" prop="" class="custom-align-right">
+              <template #label>
+                <span class="askBox">
+                  企业描述:
+                  <el-tooltip class="item" effect="dark" content="企业描述,如:中国三农市场网创建以来,社会效益和会员经济效益贡献。" placement="top">
+                    <i class="el-icon-question"></i>
+                  </el-tooltip>
+                </span>
+              </template>
+              <el-input type="textarea" v-model="form.introduce" class="custom-textarea"
+                placeholder="请输入企业描述"></el-input>
+            </el-form-item>
+            <el-form-item label="企业性质:" prop="jobnature_id" class="custom-align-right">
+              <el-select v-model="form.jobnature_id" clearable placeholder="请选择公司的性质">
+                <el-option label="市场监管" :value="0"></el-option>
+                <el-option label="信访纪检" :value="1"></el-option>
+                <el-option label="公检法司" :value="2"></el-option>
+                <el-option label="高关注机构" :value="3"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="负责人:" prop="manager" class="custom-align-right">
+              <el-input v-model="form.manager" autocomplete="off" placeholder="请输入负责人"></el-input>
+            </el-form-item>
+            <el-form-item label="联系人:" prop="content_person" class="custom-align-right">
+              <el-input v-model="form.content_person" autocomplete="off" placeholder="请输入联系人"></el-input>
+            </el-form-item>
+            <el-form-item label="企业网址:" prop="company_url" class="custom-align-right">
+              <el-input v-model="form.company_url" autocomplete="off" placeholder="请输入企业网址"></el-input>
+            </el-form-item>
+            <el-form-item label="联系电话:" prop="telephone" class="custom-align-right">
+              <el-input v-model="form.telephone" autocomplete="off" placeholder="请输入联系电话"></el-input>
+            </el-form-item>
+            <el-form-item label="手机:" prop="mobile" class="custom-align-right">
+              <el-input v-model="form.mobile" autocomplete="off" placeholder="请输入手机"></el-input>
+            </el-form-item>
+            <el-form-item label="QQ:" prop="QQ" class="custom-align-right">
+              <el-input v-model="form.QQ" autocomplete="off" placeholder="请输入QQ"></el-input>
+            </el-form-item>
+            <el-form-item label="邮编:" prop="post_code" class="custom-align-right">
+              <el-input v-model="form.post_code" autocomplete="off" placeholder="请输入邮编"></el-input>
+            </el-form-item>
+            <el-form-item label="传真:" prop="fax" class="custom-align-right">
+              <el-input v-model="form.fax" autocomplete="off" placeholder="请输入传真"></el-input>
+            </el-form-item>
+            <el-form-item label="电子邮件:" prop="email" class="custom-align-right">
+              <el-input v-model="form.email" autocomplete="off" placeholder="请输入电子邮件"></el-input>
+            </el-form-item>
+            <el-form-item label="主营分类:" prop="main_business" class="custom-align-right">
+              <el-input v-model="form.main_business" autocomplete="off" placeholder="请输入主营分类"></el-input>
+            </el-form-item>
+            <el-form-item label="行政区划:" class="custom-align-right" prop="city_arr_id">
+              <CityCascader v-model="form.city_arr_id" @update-city-id="update_city_arr_id"></CityCascader>
+            </el-form-item>
+            <el-form-item label="详细地址:" prop="adress" class="custom-align-right">
+              <el-input v-model="form.adress" autocomplete="off" placeholder="请输入详细地址"></el-input>
+            </el-form-item>
+            <el-form-item label="公司性质:" prop="nature_id" class="custom-align-right">
+              <el-select v-model="form.nature_id" clearable placeholder="请选择公司的性质">
+                <el-option v-for="item in companynature_array" :key="item.id" :label="item.nature_name" :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="行业分类:" prop="hy_id" class="custom-align-right">
+              <el-select v-model="form.hy_id" clearable placeholder="请选择公司的行业分类">
+                <el-option v-for="item in hy_array" :key="item.hyid" :label="item.hyname" :value="item.hyid">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="注册资本:" prop="zc_money" class="custom-align-right">
+              <el-input v-model="form.zc_money" autocomplete="off" placeholder="请输入注册资本"></el-input>
+            </el-form-item>
+            <el-form-item label="注册地址:" prop="zc_address" class="custom-align-right">
+              <el-input v-model="form.zc_address" autocomplete="off" placeholder="请输入注册地址"></el-input>
+            </el-form-item>
+            <el-form-item label="经营模式:" prop="manage_model" class="custom-align-right">
+              <el-input v-model="form.manage_model" autocomplete="off" placeholder="请输入经营模式"></el-input>
+            </el-form-item>
+            <el-form-item label="成立日期:" prop="data" class="custom-align-right">
+              <el-date-picker v-model="form.data" placeholder="请选择成立日期"> </el-date-picker>
+            </el-form-item>
+            <el-form-item label="主营产品或服务:" prop="main_products" class="custom-align-right">
+              <el-input v-model="form.main_products" autocomplete="off" placeholder="请输入主营产品或服务"></el-input>
+            </el-form-item>
+            <el-form-item label="主要采购产品:" prop="main_buy_products" class="custom-align-right">
+              <el-input v-model="form.main_buy_products" autocomplete="off" placeholder="请输入主要采购产品"></el-input>
+            </el-form-item>
+            <el-form-item label="员工人数:" prop="number_id" class="custom-align-right">
+              <el-select v-model="form.number_id" clearable placeholder="请选择公司的员工人数">
+                <el-option v-for="item in companysize_array" :key="item.evalue" :label="item.ename" :value="item.evalue">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="主要职能:" prop="main_functions" class="custom-align-right">
+              <el-input v-model="form.main_functions" autocomplete="off" placeholder="请输入公司的主要职能"></el-input>
+            </el-form-item>
+              <el-form-item label="企业内容:" prop="content" class="custom-align-right">
+                <myEditor ref="myEditor" v-model="form.content"></myEditor>
+              </el-form-item>
+              <el-form-item label="" prop="commend_id" class="custom-align-right">
+                <draggable v-model="form.commend_id" @end="onDragEnd">
+                  <el-tag :key="item.id" v-for="item in form.commend_id" closable :disable-transitions="false"
+                    @close="handleClose(item)"> {{ item }}
+                  </el-tag>
+                </draggable>
+              </el-form-item>
+            </div>
+          </div>
+        </div>
+      </el-form>
+    </div>
+    <div class="bottomBtnBox">
+      <el-button type="info" @click="returnPage">返回</el-button>
+      <el-button type="primary" @click="editToServe" v-if="editStatus == true">确定</el-button>
+      <el-button type="primary" @click="addToServe" v-else>确定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getWebSiteId, getUseType } from '@/utils/auth'
+//表格标题
+import tableTitle from './components/tableTitle.vue';
+//引入tag标签组件
+import tagInput from '../../components/InputTag/index.vue';
+//引入公用样式
+import '@/styles/global.less';
+//城市级联选择器
+import CityCascader from './components/CityCascader';
+//引入富文本编辑器
+import myEditor from '../../components/edit/myEditor.vue';
+//引入拖拽组件
+import draggable from 'vuedraggable';
+
+export default {
+  components: {
+    tableTitle,
+    CityCascader,
+    tagInput,
+    myEditor,
+    draggable
+  },
+  data() {
+    //0.全局操作 start ------------------------------------------------------------>
+    //表单验证
+    const validateEmpty = (rule, value, callback) => {
+      if (value == '') {
+        callback(new Error('该项不能为空!'))
+      } else {
+        callback()
+      }
+    }
+    const validateArray = (rule, value, callback) => {
+      if (value.length == 0) {
+        callback(new Error('该项不能为空!'))
+      } else {
+        callback()
+      }
+    }
+    const validateRadio = (rule, value, callback) => {
+      if (value != '1' || value != '0') {
+        callback()
+      } else {
+        callback()
+      }
+    }
+    const validateZero = (rule, value, callback) => {
+      if (value == 0 || value == '' || value == "0") {
+        callback(new Error('该项不能为空!'))
+      } else {
+        callback()
+      }
+    }
+    let self = this;
+    //0.全局操作 end ------------------------------------------------------------>
+    return {
+      loading: false,
+      logoUrl: '',
+      hovering: false, // 鼠标悬浮状态 悬浮时显示删除
+      tags: [],//标签数组
+      websiteid: 0,
+      creatNews_pid_num: "0",//请求子导航用的pid
+      creatNews_nav_pool_arr: [],//
+      creatNews_add_nav_pool_arr: [],//
+      creatNews_son_website_id_num: "",
+      checked: false,
+      formLabelWidth: '80px',//表单的长度
+      //1.表单项 start ------------------------------------------------------------>
+      editStatus: false,
+      tableDivTitle:"添加企业",
+      disclaimer: true,//免责声明
+      //提交表单
+      creatNews_user_type: 0,//判断用户类型'
+      created_at: "",//创建时间
+
+      // 企业专属-下拉列表
+      companynature_array: [],//企业性质
+      hy_array: [],//行业分类
+      companysize_array: [],//公司规模
+      form: {
+        website_id: 0,//站点id
+        cat_arr_id: [],//导航池名称
+        nav_add_pool_id: [],//导航池子级
+        title: '',//企业标题
+        author: "",//作者
+        source: "",//来源名称
+        source_url: "",//来源地址
+        imgurl: "",//缩略图
+        introduce: "",//描述
+        keyword: "",//关键词
+        description: "",//简介
+        jobnature_id: null,//企业性质
+        manager: "",//负责人
+        content_person: "",//联系人
+        company_url: "",//企业网址
+        telephone: "",//联系电话
+        mobile: "",//手机
+        QQ: "",//QQ
+        post_code: "",//邮编
+        fax: "",//传真
+        email: "",//电子邮件
+        main_business: "",//主营分类
+        adress: "",//详细地址
+        nature_id: null,//公司性质
+        hy_id: null,//行业分类
+        zc_money: "",//注册资本
+        zc_address: "",//注册地址
+        manage_model: "",//经营模式
+        data: null,//成立日期
+        main_products: "",//主营产品或服务
+        main_buy_products: "",//主要采购产品
+        number_id: null,//员工人数
+        main_functions: "",//主要职能
+        content: "",//企业内容
+        user_type: "??",//判断用户类型'
+        city_arr_id: [],//行政区划
+        city_id: "",//区划最后一个数字
+        status: 0,//状态状态:0:未审核;1:已审核;2:已拒绝;
+      },
+      //1.2 表单验证规则
+      formRules: {
+        //导航池名称不能为空
+        website_id: [{ required: true, trigger: 'blur', validator: validateZero }],
+        //企业名称不能为空
+        title: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+        //如果使用了外链,外链地址不能为空
+        // city_arr_id: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+        //导航池名称不能为空
+        cat_arr_id: [{ required: true, trigger: 'blur', validator: validateArray }],
+        //行政区划
+        city_arr_id: [{ required: true, trigger: 'blur', validator: validateArray }],
+        //内容不能为空
+        content: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+      },
+
+      //1.4图片上传
+      imgUrl: "",//在页面上显示缩略图
+      //获取父级导航池
+      parentKey: 0,//获取父级导航
+      parentData: {
+        checkStrictly: true,
+        lazy: true,
+        async lazyLoad(node, resolve) {
+          const { level, data } = node;
+          if (data && data.children && data.children.length !== 0) {
+            return resolve(node)
+          }
+          let parentId;
+          parentId = level == 0 ? 0 : data.value;
+          let parames = {
+            'type': 1,
+            'website_id': getWebSiteId(),
+            'pid': parentId
+          }
+          self.$store.dispatch('pool/get_creatNews_nav_son_actions', parames).then(res => {
+            if (res.data) {
+              const nodes = res.data.map(item => ({
+                value: item.category_id,
+                label: item.name,
+                leaf: level >= 3,
+                children: [],
+                disabled: item.type != 1
+              }))
+              resolve(nodes)
+            }
+          })
+        }
+      },
+      parentKey_2: 0,//获取父级导航 
+      parentData_2: {
+        checkStrictly: true,
+        lazy: true,
+        async lazyLoad(node, resolve) {
+          const { level, data } = node;
+          if (data && data.children && data.children.length !== 0) {
+            return resolve(node)
+          }
+          let parentId;
+          if (self.ifwebsitId == true) {
+            console.log("网站选择已经改变!")
+            parentId = 0;
+            self.ifwebsitId = false;
+            self.cat_arr_id = [];
+          } else {
+            parentId = level == 0 ? 0 : data.value;
+            self.ifwebsitId = false;
+          }
+          let parames = {
+            'type': 1,
+            'website_id': self.form.website_id,
+            'pid': parentId
+          }
+          self.$store.dispatch('pool/get_creatNews_nav_son_actions', parames).then(res => {
+            if (res.data) {
+              const nodes = res.data.map(item => ({
+                value: item.category_id,
+                label: item.alias,
+                leaf: level >= 3,
+                children: [],
+                disabled: item.type != 1
+              }))
+              resolve(nodes)
+            }
+          })
+        }
+      },
+      inputList: [
+        { value: '' }
+      ]
+      //表单项 end ------------------------------------------------------------>
+    };
+
+  }, watch: {
+    '$route'(to, from) {
+      console.log(from, '---------------------------------------');
+      // 监听路由参数中的 id 变化,若变化则更新页面状态并获取数据
+      if (to.query.id) {
+        this.getMainData();
+      }
+    },
+  },
+  methods: {
+    // 3.获取行业分类
+    get_hyid(value) {
+      this.$store.dispatch('news/getIndustry').then(res => {
+        this.hy_array = res.data;
+      })
+    },
+     //13.获取公司规模
+     get_company_size(value) {
+      this.$store.dispatch('news/getCompanySize').then(res => {
+        this.companysize_array = res.data;
+      })
+    },
+    //14.获取公司性质
+    get_company_nature(value) {
+      this.$store.dispatch('news/getCompanyNature').then(res => {
+        this.companynature_array = res.data;
+      })
+    },
+    //1.提交表单 start ------------------------------------------------------------>
+    //1.1 直接上传图片
+    beforeAvatarUpload(file) {
+      const isJPG = file.type === 'image/jpeg';
+      const isPNG = file.type === 'image/png';
+      const isLt2M = file.size / 1024 / 1024 < 2;
+
+      if (!isJPG && !isPNG) {
+        this.$message.error('上传缩略图只能是 JPG 或 PNG 格式!');
+        return false;
+      }
+      if (!isLt2M) {
+        this.$message.error('上传缩略图大小不能超过 2MB!');
+        return false;
+      }
+
+      const formData = new FormData();
+      formData.append('file', file);
+
+      this.$store.dispatch('pool/uploadFile', formData).then(res => {
+        this.imgUrl = res.data.imgUrl;//显示缩略图
+        this.form.imgurl = res.data.imgUrl;//提供表单地址
+        console.log(res.data.imgUrl)
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '网络错误,请重试!'
+        });
+      })
+
+      // 阻止默认的上传行为
+      return false;
+    },
+    //1.2 提交表单
+    addToServe() {
+      
+      //取出行政职能和行政区划数组的最后一个数字
+      if (this.form.city_arr_id == "[]" || this.form.city_arr_id == null) {
+        this.form.city_arr_id = '[]'
+        this.form.city_id = 0;
+      } else {
+        if (JSON.parse(this.form.city_arr_id.length == 0)) {
+          this.form.city_id = 0;
+        } else {
+          this.form.city_id = this.form.city_arr_id[this.form.city_arr_id.length - 1];
+        }
+      }
+      // this.form.keyword = JSON.stringify(this.form.keyword);
+      //判断用户身份
+      if (this.creatNews_user_type == 10000) {
+        console.log("用户身份为管理员,无需审核直接发布!")
+        this.form.status = 1;
+      } else {
+        console.log("用户身份为其他用户,提交到审核!")
+        this.form.status = 0;
+        this.form.website_id = this.websiteid;
+      }
+      // console.log("this.form.city_arr_id==", JSON.stringify(this.form.city_arr_id));
+      
+      //先进行验证
+      console.log( "this.form==", this.form);
+
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          // delete formData.cat_arr_id;
+          if (this.form.data) {
+            // 使用日期格式化工具函数
+            const formatDate = (dateString, format = 'YYYY-MM-DD') => {
+              const date = new Date(dateString);
+              const year = date.getFullYear();
+              const month = String(date.getMonth() + 1).padStart(2, '0');
+              const day = String(date.getDate()).padStart(2, '0');
+              
+              return format
+                .replace('YYYY', year)
+                .replace('MM', month) 
+                .replace('DD', day);
+            };
+            
+            // 格式化日期并赋值给form.data
+            this.form.data = formatDate(this.form.data);
+            console.log('格式化后的日期:', this.form.data);
+          } else {
+            // 如果没有日期字段,可以设置默认值或其他处理
+            this.form.data = null;
+          }
+          const formData = { ...this.form };
+          formData.city_arr_id = Array.isArray(this.form.city_arr_id) ? JSON.stringify(this.form.city_arr_id):  this.form.city_arr_id ;
+          console.log("formData==", typeof(this.form.city_arr_id));
+          
+          delete formData.commend_id;
+          delete formData.nav_add_pool_id;
+          delete formData.user_type;
+          console.log("formData==格式化后的日期", formData);
+          // delete formData.data;
+          this.$store.dispatch('company/addCompany', formData).then(res => {
+            if (res.code == 200) {
+              console.log("企业发布成功!200")
+              //汇报结果
+              if (this.creatNews_user_type == 10000) {
+                this.$message({
+                  type: 'success',
+                  message: '已成功添加企业!'
+                });
+                this.cleatForm(2);
+                //返回列表页
+                this.returnPage()
+              } else {
+                this.$message({
+                  type: 'success',
+                  message: '待管理员审核!'
+                });
+                this.cleatForm(2);
+                //返回列表页
+                this.returnPage()
+              }
+            } else {
+              this.$message({
+                type: 'error',
+                message: res.message
+              });
+
+
+            }
+          }).catch(() => {
+            this.$message({
+              type: 'info',
+              message: '网络错误,请重试!'
+            });
+          })
+        }
+      })
+    },
+    //1.3 清理表单
+    cleatForm() {
+        this.form.website_id = 0;
+        this.form.cat_arr_id = [];
+        this.form.nav_add_pool_id = [],//导航池子级
+        this.form.title = "";
+        this.form.author = "";
+        this.form.source = "";
+        this.form.source_url = "";
+        this.form.imgurl = "";
+        this.form.introduce = "";
+        this.form.keyword = "";
+        this.form.description = "";
+        this.form.jobnature_id = null;
+        this.form.manager = "";
+        this.form.content_person = "";
+        this.form.company_url = "";
+        this.form.telephone = "";
+        this.form.mobile = "";
+        this.form.QQ = "";
+        this.form.post_code = "";
+        this.form.fax = "";
+        this.form.email = "";
+        this.form.main_business = "";
+        this.form.adress = "";
+        this.form.nature_id = null;
+        this.form.hy_id = null;
+        this.form.zc_money = "";
+        this.form.zc_address = "";
+        this.form.manage_model = "";
+        this.form.data = "";
+        this.form.main_products = "";
+        this.form.main_buy_products = "";
+        this.form.number_id = null;
+        this.form.main_functions = "";
+        this.form.content = "";
+        this.form.city_arr_id = [];
+        this.form.city_id = "";
+        this.form.status = 0;
+    },
+    //1.4更新详细地址
+    update_city_arr_id(value) {
+      console.log("行政区划ID已更新:", value);
+      this.form.city_arr_id = value;
+    },
+    //1.5 删除图片
+    handleDelete() {
+      // 删除图片
+      this.imgUrl = ''; // 清空图片 URL
+      this.form.imgurl = ''; // 清空表单中的图片 URL
+    },
+    //提交表单 end ------------------------------------------------------------>
+
+    //2.跳转操作 start ------------------------------------------------------------>
+    returnPage() {
+      if (this.$route.query.to == "checkCompany") {
+        this.$router.push({
+          path: '/checkcompanyList',
+        });
+      } else {
+        this.$router.push({
+          path: '/companyList',
+        });
+      }
+    },
+    //跳转操作 end ------------------------------------------------------------>
+
+    //3.回显操作 ------------------------------------------------------------>
+    //3.1回显数据
+    getMainData() {
+      let data = {
+        id: this.$route.query.id
+      };
+      this.$store.dispatch('company/getCompanyInfo', data).then(res => {
+        this.form.title = res.data.title;
+        if (typeof res.data.website_id === 'string') {
+          this.form.website_id = Number(res.data.website_id);
+        } else {
+          this.form.website_id = res.data.website_id//站点名称
+        }
+        this.created_at = res.data.created_at;
+        this.form.cat_arr_id = Array.isArray(res.data.cat_arr_id) ? res.data.cat_arr_id : JSON.parse(res.data.cat_arr_id);
+        console.log(this.form.cat_arr_id)
+        //回显导航池 连同非管理员得一起刷新
+        this.parentKey += 1; // 触发级联选择器重新加载
+        this.loadCascaderPath(this.form.cat_arr_id); // 加载路径数据
+        this.parentKey_2 += 1; // 触发级联选择器重新加载
+        this.loadCascaderPath(this.form.cat_arr_id); // 加载路径数据
+        //回显行政区划
+        this.form.city_arr_id = JSON.parse(res.data.city_arr_id);
+
+        //回显其他数据
+        this.form.imgurl = res.data.imgurl;
+        this.imgUrl = res.data.imgurl;
+        this.form.keyword = res.data.keyword;
+        this.tags = res.data.keyword ? res.data.keyword.split(",") : '';
+        this.form.description = res.data.description;
+        this.form.introduce = res.data.introduce;
+        //回显编辑器内容
+        this.$nextTick(() => {
+          this.form.content = res.data.content;
+        });
+        this.form.author = res.data.author;
+        this.form.jobnature_id = res.data.jobnature_id;
+        this.form.manager = res.data.manager;
+        this.form.source = res.data.source;
+        this.form.source_url = res.data.source_url;
+        this.form.status = res.data.status;
+        this.form.manager = res.data.manager;
+        this.form.content_person = res.data.content_person;
+        this.form.company_url = res.data.company_url;
+        this.form.telephone = res.data.telephone;
+        this.form.mobile = res.data.mobile;
+        this.form.QQ = res.data.QQ;
+        this.form.post_code = res.data.post_code;
+        this.form.fax = res.data.fax;
+        this.form.email = res.data.email;
+        this.form.main_business = res.data.main_business;
+        this.form.adress = res.data.adress;
+        this.form.nature_id = res.data.nature_id;
+        this.form.hy_id = res.data.hy_id;
+        this.form.zc_money = res.data.zc_money;
+        this.form.zc_address = res.data.zc_address;
+        this.form.manage_model = res.data.manage_model;
+        this.form.data = res.data.data;
+        this.form.main_business = res.data.main_business;
+        this.form.main_buy_products = res.data.main_buy_products;
+        this.form.main_products = res.data.main_products;
+        this.form.main_functions = res.data.main_functions;
+        this.form.number_id = res.data.number_id;
+        console.log(this.inputList)
+      })
+    },
+    async loadCascaderPath(path) {
+      for (let i = 0; i < path.length; i++) {
+        const parentId = path[i - 1] || 0; // 获取当前层级的父级ID
+        const level = i; // 当前层级的索引
+
+        await this.$store.dispatch('pool/categoryList', { pid: parentId })
+          .then((res) => {
+            const nodes = res.data.map(item => ({
+              value: item.id,
+              label: item.name,
+              leaf: level >= 3, // 假设4层结构,设置叶子节点标记
+            }));
+
+            // 级联选择器加载数据
+            if (level === path.length - 1) {
+              this.form.cat_arr_id = path; // 确保最后一级路径正确设置
+              this.parentKey += 1; // 强制刷新 cascader
+            }
+          });
+      }
+    },
+    //1.3提交修改
+    editToServe() {
+      //不使用外联 验证投票逻辑
+      this.form.id = this.editId;
+      //先进行验证
+      this.$refs.form.validate(valid => {
+      if (valid) {
+          // 如果没有,可以根据实际情况修改
+        if (this.form.data) {
+          // 使用日期格式化工具函数
+          const formatDate = (dateString, format = 'YYYY-MM-DD') => {
+            const date = new Date(dateString);
+            const year = date.getFullYear();
+            const month = String(date.getMonth() + 1).padStart(2, '0');
+            const day = String(date.getDate()).padStart(2, '0');
+            
+            return format
+              .replace('YYYY', year)
+              .replace('MM', month)
+              .replace('DD', day);
+          };
+          
+          // 格式化日期并赋值给form.data
+          this.form.data = formatDate(this.form.data);
+          console.log('格式化后的日期:', this.form.data);
+        } else {
+          // 如果没有日期字段,可以设置默认值或其他处理
+          this.form.data = null;
+        }
+        // ===== 日期处理逻辑结束 =====
+          //取出行政职能和行政区划数组的最后一个数字
+          if (this.form.city_arr_id == "[]" || this.form.city_arr_id == null) {
+            this.form.city_arr_id = '[]'
+            this.form.city_id = 0;
+          } else {
+            if (JSON.parse(this.form.city_arr_id.length == 0)) {
+              this.form.city_id = 0;
+            } else {
+              this.form.city_id = this.form.city_arr_id[this.form.city_arr_id.length - 1];
+            }
+          }
+          if (this.creatNews_user_type == 10000) {
+            console.log("用户身份为管理员,无需审核直接发布!")
+            this.form.status = 1;
+          } else {
+            console.log("用户身份为其他用户,提交到审核!")
+            this.form.status = 0;
+            this.form.website_id = this.websiteid;
+          }
+          console.log("this.form111==", this.form);
+          const formData = { ...this.form };
+          // console.log("this.form222==", this.form);
+          formData.city_arr_id = Array.isArray(this.form.city_arr_id) ? JSON.stringify(this.form.city_arr_id):  this.form.city_arr_id ;
+          
+          delete formData.commend_id;
+          delete formData.nav_add_pool_id;
+          delete formData.user_type;
+          // console.log("formData==", formData);
+          this.$store.dispatch('company/upCompany', formData).then(res => {
+          if (res.code != 200) {
+
+            this.$message({
+              type: 'error',
+              message: res.message
+            });
+
+          } else {
+            //汇报结果
+            if (this.creatNews_user_type == 10000) {
+              this.$message({
+                type: 'success',
+                message: '已成功编辑企业!'
+              });
+              this.cleatForm(2);
+              //返回列表页
+              this.returnPage()
+            } else {
+              this.$message({
+                type: 'success',
+                message: '待管理员审核!'
+              });
+              this.cleatForm(2);
+              //返回列表页
+              this.returnPage()
+            }
+          }
+          }).catch(() => {
+            this.$message({
+              type: 'info',
+              message: '网络错误,请重试!'
+            });
+          })
+        }
+      })
+    },
+    //1.4 修改是否原创
+    changeIsOriginal() {
+      if (this.form.is_original == 1) {
+        this.form.source = "本网";
+      } else {
+        this.form.source = "";
+        this.form.source_url = "";
+      }
+    },
+    //跳转操作 end ------------------------------------------------------------>
+
+
+    //5.站点选择 曹国庆 start ------------------------------------------------------------>
+    get_creatNews_form_id_fun() {
+      //判断用户类型ajax
+      this.$store.dispatch('public/getInfo').then(res => {
+        //     console.log("res======",res)
+        this.form.user_type = res.data.type_id;
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
+    get_creatNews_nav_pool_arr_fun() {//
+      this.$store.dispatch('pool/get_creatNews_nav_actions', { page: 1, pageSize: 666666 }).then(res => {
+        res.data.rows.forEach((per_obj) => {
+          let new_per = {
+            label: per_obj.website_name,
+            value: per_obj.id,
+          }
+          this.creatNews_nav_pool_arr.push(new_per)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
+    creatNews_nav_pool_change_fun() {
+      //开启导航池级联选择器
+      this.ifwebsitId = true;
+      console.log(this.ifwebsitId);
+      //  导航池级
+      let that = this;
+      // console.log("website_id",this.form.website_id)
+      this.form.website_id = this.form.website_id[0];
+      that.parentKey_2 += 1;
+      this.$store.dispatch('pool/get_creatNews_nav_son_actions', { type: 1, pid: String(this.creatNews_pid_num), website_id: String(this.form.website_id) }).then(res => {
+        if (res.data.length == 0) {//没有导航池子级
+          // alert("没有导航池子级");
+          return
+        }
+        this.creatNews_add_nav_pool_arr = res.data;
+        this.creatNews_add_nav_pool_arr.forEach((per_obj) => {
+          per_obj.label = per_obj.name,
+            per_obj.value = per_obj.id,
+            this.creatNews_pid_num = per_obj.category_id
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
+    updateTags(newTags) {
+      this.tags = newTags;
+      if(this.tags.length == 0){
+        this.form.keyword = '';
+      }else{
+        this.form.keyword = JSON.stringify(newTags);
+      }
+     
+      console.log(this.form.keyword);
+    },
+    //推荐等级多选获取到的数据
+    levelChange(value) {
+      this.form.level = value;
+    },
+    getNews() {
+      this.$store.dispatch('news/getArticleList', { page: 1, pageSize: 20 }).then(res => {
+        let data = [];
+        for (let item of res.data.rows) {
+          data.push(item)
+        }
+        this.commend_article = data;
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
+    // 远程搜索方法
+    remoteMethod(query) {
+      const artical_params = { page: 1, pageSize: 20, id: query }
+      if (query !== '') {
+        this.loading = true;
+        //如果全是数字,就id,其他就是搜title
+        let reg = /^[0-9]+$/;
+        let isNum = reg.test(query);
+        if (isNum) {
+          delete artical_params.title;
+          artical_params.id = query;
+        } else {
+          delete artical_params.id;
+          artical_params.title = query;
+        }
+        this.$store.dispatch('company/getCompanyList', artical_params).then(res => {
+          this.loading = false;
+          let data = [];
+          for (let item of res.data.rows) {
+            data.push(item);
+          }
+          this.commend_article = data;
+        }).catch(() => {
+          this.loading = false;
+          this.$message({
+            type: 'info',
+            message: '网络错误,请重试!'
+          });
+        });
+      } else {
+        this.commend_article = [];
+      }
+    },
+    //5.站点选择 曹国庆 end ------------------------------------------------------------>
+
+    //6.问卷 刘佳伟 start ------------------------------------------------------------>
+    addInput(index) {
+      // 在当前索引后插入一个新的输入框对象
+      if (this.inputList.length > 10) {
+        this.$message.warning('最多只能添加10个文本框');
+        return false;
+      }
+      this.inputList.splice(index + 1, 0, { value: '' });
+    },
+    deleteInput(index) {
+      if (this.inputList.length > 1) {
+        // 如果输入框数量大于 1,则删除当前索引对应的输入框对象
+        this.inputList.splice(index, 1);
+      } else {
+        this.$message.warning('至少保留一个输入框');
+      }
+    },
+    onDragEnd() {
+      // 处理拖拽结束事件(如果需要)
+      console.log('拖拽结束', this.commend_article);
+    },
+    handleClose(item) {
+      const index = this.form.commend_id.indexOf(item);
+      if (index > -1) {
+        this.form.commend_id.splice(index, 1);
+      }
+    },
+    //6.问卷 刘佳伟 end ------------------------------------------------------------>
+  },
+  mounted() {
+    console.log("mounted")
+    this.getNews()
+    console.log(this.commend_article, '-------news-------');
+    this.creatNews_user_type = getUseType()
+    this.websiteid = getWebSiteId()
+    //1.获得站点标识
+    this.get_company_nature()  //企业性质
+    this.get_hyid()    //企业行业
+    this.get_company_size()   //企业规模
+    this.get_creatNews_form_id_fun()
+    this.get_creatNews_nav_pool_arr_fun()
+    //2.判断是新建还是回显
+    if (this.$route.query.id != undefined) {
+      this.editId = this.$route.query.id;
+      this.editStatus = true;
+      // this.tableDivTitle = "编辑企业";
+      console.log("编辑企业!")
+      this.getMainData();
+    } else {
+      this.editStatus = false;
+      // this.tableDivTitle = "添加企业";
+      console.log("添加企业!")
+    }
+  },
+};
+</script>
+
+<style scoped lang="less">
+//执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
+::v-deep .custom-form-item>.el-form-item__label {
+  line-height: 140px !important;
+}
+
+::v-deep .custom-textarea .el-textarea__inner {
+  resize: none;
+  /* 禁止用户拖拽调整大小 */
+}
+
+::v-deep .custom-align-right .el-form-item__label {
+  text-align: right;
+  /* 设置标签文字右对齐 */
+}
+
+::v-deep .el-popper {
+  height: 500px;
+}
+
+::v-deep .el-select {
+  width: 100%;
+  /* 禁止用户拖拽调整大小 */
+}
+
+::v-deep .el-input-group__prepend {
+  color: black !important;
+}
+
+.formLabelFloatBox {
+  margin-bottom: 10px;
+  position: relative;
+
+  .formLabeladdIcon {
+    position: absolute;
+    right: 45px;
+    top: 5px;
+    width: 38px;
+    height: 24px;
+  }
+
+  .formLabelDelIcon {
+    position: absolute;
+    right: 5px;
+    top: 5px;
+    width: 38px;
+    height: 24px;
+  }
+}
+
+//该项不能为空几个字的位置
+::v-deep .el-form-item__error {
+  color: #ff4949;
+  font-size: 12px;
+  line-height: 1;
+  padding-top: 4px;
+  position: relative;
+  // top: 22%;
+  // left: 93%;
+}
+
+//输入框距离底部的距离
+::v-deep .el-form-item {
+  margin-bottom: 5px;
+}
+
+//图片提示文字样式
+.photo_tips {
+  font-size: 12px;
+  color: #999;
+}
+
+// 执行v-deep穿透scope选择器 end------------------------------------------------------------></style>

+ 31 - 17
src/views/componentGallery/imgList.vue

@@ -84,7 +84,7 @@
         <el-dialog :title="dialogName" :visible.sync="dialogTableVisible" width="45%" top="8vh" :close-on-click-modal="false">
             <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
                 <div class="dialogText">
-                    <el-form-item label="关联网站名称:" prop="website_id" v-if="this.dialogName=='添加图片'">
+                    <el-form-item label="关联网站名称:" prop="website_id">
                         <el-select v-model="ruleForm.website_id" :multiple="false" :multiple-limit="1" filterable remote
                             reserve-keyword placeholder="请输入关联网站名称" :remote-method="getWebNavList" :loading="webSiteLoading" @change="detectionWebSite">
                             <el-option v-for="item in webSiteList" :key="item.value" :label="item.label"
@@ -95,28 +95,33 @@
                     <el-form-item label="文件别名:" prop="img_alias">
                         <el-input v-model="ruleForm.img_alias" placeholder="请输入文件别名"></el-input>
                     </el-form-item>
-                    <el-form-item label="组件展示图:" prop="img_url" :label-width="formLabelWidth" v-if="this.dialogName=='添加图片'">
+                    <el-form-item label="组件展示图:" prop="img_url" :label-width="formLabelWidth">
                         <div class="uploaderBox">
                             <!-- 图片预览和信息展示 -->
-                            <div v-if="logoUrl" class="image-preview">
-                                <img :src="logoUrl" class="avatar">
-                                <div class="image-meta">
-                                <p>文件名:{{ imageInfo.name }}</p>
-                                <p>文件大小:{{ imageInfo.size }}</p>
+     
+                            <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeAvatarUpload">
+                                <div v-if="logoUrl"  class="image-preview">
+                                    <img :src="logoUrl" class="avatar">
+                                    
                                 </div>
-                            </div>
-                            <el-upload v-else class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeAvatarUpload">
-                                <div class="chooseImgDiv">
+                                
+                                <!-- 上传图标 -->
+                                <div v-else class="chooseImgDiv">
                                     <div>
                                         <img src="@/assets/public/upload/noImage.png">
                                         <div>选择图片</div>
                                     </div>
                                 </div>
                             </el-upload>
-                            <div v-if="hovering && logoUrl" class="delete-button" @click="handleDelete">
-                                <i class="el-icon-delete"></i>
+                            <div v-if="logoUrl" class="image-meta">
+                                <p>文件名:{{ this.ruleForm.name ||imageInfo.name }}</p>
+                                <p>文件大小:{{ this.ruleForm.img_size || imageInfo.size }}</p>
                             </div>
+                            <!-- 删除按钮,当鼠标悬浮时显示 -->
+                            <div v-if=" logoUrl" class="delete-button" @click="handleDelete">
+                                <i class="el-icon-delete"></i>
                             </div>
+                        </div>
                      </el-form-item>
                 </div>
                 <div class="dialogBtn">
@@ -152,7 +157,7 @@ import tableTitle from './components/tableTitle.vue';
 
 //引入公用样式
 import '@/styles/global.less';
-import { getComponentList, addComponent, delComponent, updateComponent, getComponentInfo } from '@/api/module'
+// import { getComponentList, addComponent, delComponent, updateComponent, getComponentInfo } from '@/api/module'
 import { getSectorList } from '@/api/plate'
 import { getTemplateClass } from '@/api/style'
 import { upWebsiteCategory } from '@/api/pool';
@@ -225,9 +230,11 @@ export default {
             sector_id: '', //关联版块id
 
             ruleForm: {
-                img_alias: '', //组件名称
-                img_url: '',//组件展示
+                img_alias: '', //静态资源管名称
+                img_url: '',//静态资源管展示
                 website_id: '', //关联网站名称
+                id: '', //id
+                img_size: '', //文件大小
             },
 
             rules: {
@@ -412,9 +419,15 @@ export default {
             console.log("编辑", row);
             this.activeid = row.id; // 存储当前编辑的活动ID
             this.ruleForm.img_alias = row.img_alias; // 回显图片别名
-            this.ruleForm.img_size = row.img_size    //图片大小
+            // this.ruleForm.img_size = row.img_size    //图片大小
             this.ruleForm.img_url = row.img_url      //图片地址
             this.logoUrl = row.img_url //图片展示图
+            this.ruleForm.website_id = row.website_name //网站id
+            this.ruleForm.id = row.id //id
+            this.ruleForm.name = row.name //图片名称
+            this.ruleForm.img_size = row.img_size //图片尺寸
+            // beforeAvatarUpload(row)
+            
         },
         // 弹出层相关方法
         // 提交表单
@@ -471,8 +484,9 @@ export default {
                 })
                 this.dialogVisible = true
             }
+
             if (this.dialogName == "编辑") {
-                this.$store.dispatch('module/upStaticResource', { id: this.activeid, img_alias: this.ruleForm.img_alias }).then(res => {
+                this.$store.dispatch('module/upStaticResource', this.ruleForm).then(res => {
                     if (res.code === 200) {
                         this.$message({
                             message: '编辑成功',

+ 2 - 2
src/views/news/addBook.vue

@@ -13,8 +13,8 @@
               </el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="展示名称:" prop="cat_arr_id" class="custom-align-right">
-            <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的展示名称" :props="parentData"
+          <el-form-item label="栏目名称:" prop="cat_arr_id" class="custom-align-right">
+            <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的栏目名称" :props="parentData"
               filterable clearable></el-cascader>
           </el-form-item>
           <el-form-item label="书刊音像标题:" prop="title" class="custom-align-right">

+ 2 - 2
src/views/news/addGood.vue

@@ -31,8 +31,8 @@
               </el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="展示名称:" prop="cat_arr_id" class="custom-align-right">
-            <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的展示名称" :props="parentData"
+          <el-form-item label="栏目名称:" prop="cat_arr_id" class="custom-align-right">
+            <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的栏目名称" :props="parentData"
               filterable clearable></el-cascader>
           </el-form-item>
           <div v-if="user_type == 10000">

+ 6 - 6
src/views/news/creatNews.vue

@@ -16,8 +16,8 @@
                 :options="creatNews_nav_pool_arr" @change="creatNews_nav_pool_change_fun(form.web_site_id)" filterable
                 clearable></el-cascader>
             </el-form-item>
-            <el-form-item label="展示名称:" prop="cat_arr_id" class="custom-align-right">
-              <el-cascader :key="parentKey_2" v-model="form.cat_arr_id" placeholder="请选择要绑定的展示名称" :props="parentData_2"
+            <el-form-item label="栏目名称:" prop="cat_arr_id" class="custom-align-right">
+              <el-cascader :key="parentKey_2" v-model="form.cat_arr_id" placeholder="请选择要绑定的栏目名称" :props="parentData_2"
                 popper-class="my_cascader" filterable clearable></el-cascader>
             </el-form-item>
             <el-form-item label="外链地址:" prop="linkurl" class="custom-align-right">
@@ -29,11 +29,11 @@
           </div>
           <div v-if="form.islink == false">
             <div v-if="creatNews_user_type != 10000">
-              <el-form-item label="展示名称:" prop="cat_arr_id" class="custom-align-right">
+              <el-form-item label="栏目名称:" prop="cat_arr_id" class="custom-align-right">
                 <el-cascader 
                     :key="parentKey" 
                     v-model="form.cat_arr_id" 
-                    placeholder="请选择要绑定的展示名称" 
+                    placeholder="请选择要绑定的栏目名称" 
                     :props="parentData"
                     popper-class="my_cascader" 
                     style="height: 100%;" 
@@ -49,11 +49,11 @@
                     popper-class="my_cascader" :options="creatNews_nav_pool_arr"
                     @change="creatNews_nav_pool_change_fun(form.web_site_id)" filterable clearable></el-cascader>
                 </el-form-item>
-                <el-form-item label="展示名称:" prop="cat_arr_id" class="custom-align-right">
+                <el-form-item label="栏目名称:" prop="cat_arr_id" class="custom-align-right">
                     <el-cascader 
                         :key="parentKey_2" 
                         v-model="form.cat_arr_id" 
-                        placeholder="请选择要绑定的展示名称"
+                        placeholder="请选择要绑定的栏目名称"
                         popper-class="my_cascader" 
                         style="height: 100%;" 
                         :props="parentData_2" 

+ 112 - 99
src/views/website/categoryList.vue

@@ -6,7 +6,7 @@
         <el-col :span="8">
           <div class="searchBox">
             <div class="searchTitle">栏目名称:</div>
-            <el-input v-model="getApiData.name"   placeholder="请输入栏目名称"  :clearable="true" @clear="onInputClear"/>
+            <el-input v-model="getApiData.name" placeholder="请输入栏目名称" :clearable="true" @clear="onInputClear" />
             <!-- <el-input placeholder="请输入栏目名称" autocomplete="off" v-model="getApiData.name" /> -->
           </div>
         </el-col>
@@ -28,19 +28,15 @@
       <tableTitle :name="tableDivTitle" />
       <el-row>
         <template>
-          <el-table 
-          :data="tableData"
-          style="width: 100%"
-          row-key="id"
-          :default-expand-all="isExpandAll"
-          :tree-props="{children: 'children', hasChildren: 'hasChildren'}" 
-          >
+          <el-table :data="tableData" style="width: 100%" row-key="id" :default-expand-all="isExpandAll"
+            :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
             <el-table-column fixed prop="id" label="编号" width="150"></el-table-column>
             <el-table-column prop="name" label="栏目名称">
               <template slot-scope="scope">
-                <span :class="{ highlight: isHighlight(scope.row, search) }" v-if="scope.row.pid==0">{{ scope.row.name }}</span>
-                <span :class="{ highlight: isHighlight(scope.row, search)}"  v-else>____{{ scope.row.name }}</span>
-            </template>
+                <span :class="{ highlight: isHighlight(scope.row, search) }" v-if="scope.row.pid == 0">{{ scope.row.name
+                }}</span>
+                <span :class="{ highlight: isHighlight(scope.row, search) }" v-else>____{{ scope.row.name }}</span>
+              </template>
             </el-table-column>
             <el-table-column label="是否外链" align="center">
               <template slot-scope="scope">
@@ -54,9 +50,12 @@
             <el-table-column fixed="right" label="操作" width="230" header-align="center">
               <template slot-scope="scope">
                 <div class="listBtnBox">
-                  <div class="listDeleteBtn" @click="deleteData(scope.row.id, tableData)"><i class="el-icon-delete"></i>删除</div>
-                  <div class="listEditBtn" @click="getDataMain(scope.row.id, tableData)"><i  class="el-icon-edit-outline"></i>编辑</div>
-                  <div class="listMainBtn" @click="addCategoryList(scope.row)"><i class="el-icon-document-add"></i>添加</div>
+                  <div class="listDeleteBtn" @click="deleteData(scope.row.id, tableData)"><i
+                      class="el-icon-delete"></i>删除</div>
+                  <div class="listEditBtn" @click="getDataMain(scope.row.id, tableData)"><i
+                      class="el-icon-edit-outline"></i>编辑</div>
+                  <div class="listMainBtn" @click="addCategoryList(scope.row)"><i class="el-icon-document-add"></i>添加
+                  </div>
                 </div>
                 <!-- <el-button @click.native.prevent="deleteData(scope.row.id, tableData)" type="text" size="small">删除</el-button>
                 <el-button @click.native.prevent="getDataMain(scope.row.id, tableData)" type="text" size="small">编辑</el-button> -->
@@ -85,7 +84,8 @@
       <el-form :model="form" ref="form" :rules="formRules" autocomplete="off" label-position="left">
         <div class="formDiv">
           <el-form-item label="栏目名称:" :label-width="formLabelWidth" prop="name" class="custom-align-right">
-            <el-input v-model="form.name" autocomplete="off" placeholder="请输入栏目名称"></el-input>
+            <el-input v-model="form.name" autocomplete="off" placeholder="请输入栏目名称"
+              :disabled="editId ? true : false"></el-input>
             <el-checkbox v-model="show_url" @change="ifUrl">引用外链</el-checkbox>
           </el-form-item>
           <div v-if="show_url == 1">
@@ -117,6 +117,30 @@
             <el-form-item label="父级栏目:" :label-width="formLabelWidth" class="custom-align-right">
               <el-cascader :key="parentKey" v-model="form.pid_arr" placeholder="请选择要绑定的父级栏目" :props="parentData"
                 filterable clearable></el-cascader>
+            </el-form-item>
+            <el-form-item label="栏目类型:" :label-width="formLabelWidth" prop="type" class="custom-align-right">
+              <template #label>
+                <span class="askBox">
+                  栏目类型:
+                  <el-tooltip class="item" effect="dark" content=" 选择类型提交后不可更改,请谨慎考虑后提交!" placement="top">
+                    <i class="el-icon-question"></i>
+                  </el-tooltip>
+                </span>
+              </template>
+
+              <el-radio-group v-model="form.type" size="small" :disabled="editId ? true : false">
+                <el-radio-button label="1">资讯</el-radio-button>
+                <el-radio-button label="2">商品</el-radio-button>
+                <el-radio-button label="3">书刊音响</el-radio-button>
+                <el-radio-button label="4">招聘</el-radio-button>
+                <el-radio-button label="5">求职</el-radio-button>
+              </el-radio-group>
+              <!-- 选择类型提交后不可更改,请谨慎考虑后提交! 提示词 -->
+              <div style="color: brown;">
+                选择类型提交后不可更改,请谨慎考虑后提交!
+              </div>
+
+
             </el-form-item>
             <el-form-item label="栏目标题:" :label-width="formLabelWidth" prop="seo_title" class="custom-align-right">
               <template #label>
@@ -184,7 +208,7 @@ export default {
     InputTag
   },
   data() {
-   
+
     //0.全局操作 start ------------------------------------------------------------>
     //表单验证
     const validateEmpty = (rule, value, callback) => {
@@ -315,6 +339,7 @@ export default {
         seo_title: "",//标题
         seo_keywords: "",//关键词
         seo_description: "",//描述
+        type: 1,//栏目类型
         pid_arr: []//父级栏目
       },
       //4.2表单验证规则
@@ -389,36 +414,34 @@ export default {
       parentData: {
         checkStrictly: true,
         lazy: true,
-        lazyLoad: async (node, resolve) => {
+        async lazyLoad(node, resolve) {
           const { level, data } = node;
           if (data && data.children && data.children.length !== 0) {
-            return resolve(node);
+            return resolve(node)
           }
-          const parentId = level === 0 ? 0 : data.value;
-          try {
-            const res = await this.$store.dispatch('pool/categoryList', { pid: parentId });
+          console.log(level)
+          let parentId = level == 0 ? 0 : data.value
+          let parames = {
+            'pid': parentId
+          }
+          self.$store.dispatch('pool/categoryList', parames).then(res => {
             if (res.data) {
               const nodes = res.data.map(item => ({
                 value: item.id,
                 label: item.name,
                 leaf: level >= 3,
                 children: []
-              }));
-              resolve(nodes);
-            } else {
-              resolve([]);
+              }))
+              resolve(nodes)
             }
-          } catch (error) {
-            console.error('Failed to load parent category data:', error);
-            resolve([]);
-          }
+          })
         }
       },
       //弹出框中的表单设置 end ------------------------------------------------------------>
     }
   },
   methods: {
-    onInputClear(){
+    onInputClear() {
       this.isExpandAll = false;
       this.getData();
     },
@@ -426,10 +449,10 @@ export default {
     //1.列表和分页相关 start ------------------------------------------------------------>
     //1.1 开始请求列表信息方法
     getData(type) {
-      if(type=='search'){
-        this.getApiData.page=1
+      if (type == 'search') {
+        this.getApiData.page = 1
         this.isExpandAll = true;
-      }else{
+      } else {
         this.isExpandAll = false;
       }
       //搜索条件
@@ -442,10 +465,10 @@ export default {
       //   this.getApiData.city_id = this.getApiData.city_id[this.getApiData.city_id.length - 1];
       // }
       //如果是搜索,重新加载第一页
-  
+
       this.$store.dispatch('pool/getCategoryList', this.getApiData).then(res => {
         // console.log("=============:",res.data)
-        this.tableData = res.data.rows; //与内容
+        this.tableData = res.data.rows; //��与内容
         this.allCount = res.data.total
       }).catch(() => {
         this.$message({
@@ -525,41 +548,27 @@ export default {
       this.windowStatus = true;
     },
     //2.1.1 添加栏目池
-    async addCategoryList(row) {
+    addCategoryList(row) {
       this.form.pid_arr = [];
       this.show_url = false;
+      // this.form.is_url = 0;
       this.editId = 0;
       this.editBtn = false;
-      this.tags = [];
-      
-      if(row) {
-        let pidArr = [];
-        if(row.pid == 0) {
-          pidArr = [row.id];
+      this.tags = []
+      if (row) {
+        if (row.pid == 0) {
+          this.form.pid_arr.push(row.id)
         } else {
-          try {
-            pidArr = JSON.parse(row.pid_arr);
-            pidArr.push(row.id);
-          } catch(e) {
-            pidArr = [];
-          }
+          let pidArr = [];
+          // console.log("fuck:",row.pid_arr);
+          pidArr = JSON.parse(row.pid_arr)
+          pidArr.push(row.id)
+          this.form.pid_arr = pidArr
+          // console.log('追加id:',this.form.pid_arr)
         }
-        
-        // 先打开窗口
-        this.openWindow();
-        
-        // 预加载数据
-        for(let i = 0; i < pidArr.length; i++) {
-          const parentId = i === 0 ? 0 : pidArr[i - 1];
-          await this.$store.dispatch('pool/categoryList', { pid: parentId });
-        }
-        
-        // 设置值并更新 key
-        this.form.pid_arr = pidArr;
-        this.parentKey += 1;
-      } else {
-        this.openWindow();
       }
+      // console.log("=========:", this.form.pid_arr)
+      this.openWindow();
     },
     //2.2 关闭弹出框
     closeWindow() {
@@ -572,6 +581,7 @@ export default {
         // this.form.department_arr_id = [];
         // this.form.city_arr_id = [];
         this.form.pid_arr = [];
+        this.form.type = 1;
       }
       if (type == 2) { //type2 全部清理
         this.form.name = "";
@@ -584,6 +594,7 @@ export default {
         this.form.seo_keywords = "";
         this.form.seo_description = "";
         this.form.pid_arr = [];
+        this.form.type = 1;
         //存在验证的时候再清理
         if (this.$refs.form && this.$refs.form.fields.some(field => field.validateState === 'error')) {
           this.$refs.form.clearValidate();
@@ -684,6 +695,7 @@ export default {
         this.form.seo_keywords = res.data.seo_keywords;
         this.tags = res.data.seo_keywords ? res.data.seo_keywords.split(',') : [];
         this.form.seo_description = res.data.seo_description;
+        this.form.type = res.data.type;
 
         //回显排序
         this.form.sort = res.data.sort;
@@ -773,6 +785,7 @@ export default {
 ::v-deep .highlight {
   background-color: yellow;
 }
+
 //表单微调 start------------------------------------------------------------>*/
 ::v-deep .custom-form-item>.el-form-item__label {
   line-height: 140px !important;
@@ -780,50 +793,50 @@ export default {
 
 ::v-deep .custom-textarea .el-textarea__inner {
   resize: none;
-  /* 禁止用拖拽调整大小 */
+  /* 禁止用���拖拽调整大小 */
 }
 
 ::v-deep .custom-align-right .el-form-item__label {
   text-align: right;
   /* 设置标签文字右对齐 */
 }
-.collector {
-        margin-left: 0px;
-        padding-left: 0px;
-        margin-right: 20px;
-        width: 76px;
-        height: 36px;
-        line-height: 36px;
-        position: relative;
-
-        .collectorIcon {
-            display: inline-block;
-            width: 20px;
-            height: 20px;
-            background: url("../../assets/advertise/Graph.png");
-            vertical-align: middle;
-            margin-right: 6px;
-        }
-
-        .collectorIcon1 {
-            position: absolute;
-            top: 12px;
-            left: 8px;
-        }
 
-    }
+.collector {
+  margin-left: 0px;
+  padding-left: 0px;
+  margin-right: 20px;
+  width: 76px;
+  height: 36px;
+  line-height: 36px;
+  position: relative;
+
+  .collectorIcon {
+    display: inline-block;
+    width: 20px;
+    height: 20px;
+    background: url("../../assets/advertise/Graph.png");
+    vertical-align: middle;
+    margin-right: 6px;
+  }
 
+  .collectorIcon1 {
+    position: absolute;
+    top: 12px;
+    left: 8px;
+  }
+}
 
-    .collector {
-        text-align: center;
-        border-radius: 8px;
-        cursor: pointer;
-        color: #519C66;
-        background-color: rgba(81, 156, 102, 0.16);
 
-        >i {
-            padding-right: 8px;
-        }
-    }
+.collector {
+  text-align: center;
+  border-radius: 8px;
+  cursor: pointer;
+  color: #519C66;
+  background-color: rgba(81, 156, 102, 0.16);
+
+  >i {
+    padding-right: 8px;
+  }
+}
 
-//表单微调 end------------------------------------------------------------>*/</style>
+//表单微调 end------------------------------------------------------------>*/</style>