Commit a6b13c59 authored by 张俊's avatar 张俊

搜索引擎

parent 380066d5
......@@ -145,7 +145,8 @@ export default {
if (response.success == 1) {
this.fileArray.push({
url: response.data,
name: file.name
name: file.name,
size: file.size
});
}
this.$emit("getNewList", this.fileArray);
......
<template>
<div class="index_container">
<div class="decor" v-if="$route.fullPath == '/workplace' || $route.fullPath == '/services_shop' || $route.fullPath == '/fwzc/fwcs' || $route.fullPath == '/app_build' || $route.fullPath == '/intelligent_drawing'"></div>
<div class="decor" v-if="path_arr.indexOf($route.fullPath)!==-1"></div>
<router-view/>
</div>
</template>
<script>
export default {
data: () => ({}),
data: () => ({
path_arr:[
'/workplace',
'/services_shop',
'/fwzc/fwcs',
'/app_build',
'/intelligent_drawing',
'/search_engine'
]
}),
created(){
console.log(this.$route.fullPath);
},
......
......@@ -193,19 +193,31 @@ export default {
{
label: "编辑",
callback: this.editAction,
disabledRule(item) {
              return item.state == 1;
            }
},
{
label: "上架",
callback: this.upAction,
disabledRule(item) {
              return item.state == 1 || item.state == 3;
            }
},
{
label: "下架",
callback: this.downAction,
disabledRule(item) {
              return item.state == 2 || item.state == 3;
            }
},
{
label: "删除",
class: "warn",
callback: this.deleteAction,
disabledRule(item) {
              return item.state == 1;
            }
},
],
},
......@@ -271,16 +283,45 @@ export default {
this.$router.push('/message/banner_add')
},
editAction(item) {
console.log(`编辑${item.name}`);
console.log(item);
this.$router.push('/message/banner_edit?id='+item.serial_num)
},
upAction(item) {
console.log(`上架${item.name}`);
this.$http
.post("/apaas/service/v3/recommend/manage/banners/up",{
serial_num:item.serial_num
})
.then(({ data }) => {
if (data.success == 1) {
this.$message.success('上架成功')
this.initList(this.tempFilter)
}
})
},
downAction(item) {
console.log(`下架${item.name}`);
this.$http
.post("/apaas/service/v3/recommend/manage/banners/down",{
serial_num:item.serial_num
})
.then(({ data }) => {
if (data.success == 1) {
this.$message.success('下架成功')
this.initList(this.tempFilter)
}
})
},
deleteAction(item) {
console.log(`删除${item.name}`);
// console.log(`删除${item.name}`);
this.$http
.post("/apaas/service/v3/recommend/manage/banners/del",[item.serial_num])
.then(({ data }) => {
if (data.success == 1) {
this.$message.success('删除成功')
this.initList(this.tempFilter)
}else{
this.$message.error('删除失败')
}
})
},
},
};
......
......@@ -34,7 +34,7 @@
<el-select
v-model="detail.state"
placeholder="请选择状态"
:disabled="true"
:disabled="disabled"
>
<el-option
v-for="item in types"
......@@ -84,7 +84,7 @@
<upload-file
:multiple="false"
:max="1"
type="cropper"
type="picture"
:readOnly="false"
fit="fill"
:list="imgList"
......@@ -117,6 +117,16 @@
</template>
<script>
 var user_name_pass = (rule, value, callback) => {
      var reg = /^[a-zA-Z0-9|\-|_|\.]+$/;
      setTimeout(() => {
        if (reg.test(value)) {
          callback();
        } else {
          callback(new Error("只支持字母、数字、-、_、."));
        }
      }, 100);
    };
import helper from "@/services/helper.js";
import uploadFile from "@/components/general/upload_file";
export default {
......@@ -133,13 +143,15 @@ export default {
up_time:"",
down_time:"",
fileList:'',
size:'',
id:''
},
imgList: [],
detail_rules: {
name: [
{
required: true,
message: "请输入消息模板名称",
message: "请输入banner名称",
trigger: "blur",
},
{
......@@ -147,39 +159,56 @@ export default {
message: "长度小于16个字符",
trigger: "blur",
},
// { validator: user_name_pass, trigger: 'blur' }
],
tpl_type: [
state: [
{
required: true,
message: "请选择模板类型",
trigger: "blur",
message: "请选择状态",
trigger: "change",
},
],
content: [
rank: [
{
required: true,
message: "请输入消息详情,最多可以输入500字。",
message: "请输入排序",
trigger: "blur",
},
],
up_time: [
{
required: true,
message: "请选择上架时间",
trigger: "change",
},
],
fileList: [
{
required: true,
message: "请选择上传图片",
trigger: "change",
},
],
down_time: [
{
required: true,
message: "请选择下架时间",
trigger: "change",
},
],
url: [
],
},
types: [
{
name: "服务推送",
name: "已上架",
value: 1,
},
{
name: "平台维护",
value: 2,
},
{
name: "版本更新",
value: 3,
},
{
name: "自动消息",
value: 4,
},
name: "已下架",
value: 0,
}
],
submitLoading: false,
}),
......@@ -205,22 +234,27 @@ export default {
methods: {
getNewList(val) {
this.detail.fileList = val[0].url;
this.detail.size = val[0].size;
console.log(this.detail.fileList);
},
getDetail() {
this.$http
.get("/apaas/service/v3/msg/manage/tpl/info", {
params: {
id: this.$route.params.id,
},
})
.get("/apaas/service/v3/recommend/manage/banners/info/"+this.$route.query.id)
.then(({ data }) => {
if (data.success == 1) {
let detail = data.data;
this.detail.name = detail.name;
this.detail.tpl_type = detail.tpl_type;
this.detail.content = detail.content;
var detail = data.data
this.detail = {
name: detail.name,
state: detail.state,
url: detail.url,
rank:detail.ordid,
up_time:detail.up_time,
down_time:detail.down_time,
fileList:detail.image_url,
size:detail.image_size,
id:detail.serial_num,
}
this.imgList = [detail.image_url]
} else {
this.$message({
message: data.errMsg || "获取详情失败",
......@@ -239,20 +273,29 @@ export default {
},
addTemplate() {
this.$http
.post("/apaas/service/v3/msg/manage/tpl/add", this.detail)
.post("/apaas/service/v3/recommend/manage/banners/add", {
"name": this.detail.name,
"url": this.detail.url,
"image_size": this.detail.size,
"image_url": this.detail.fileList,
"up_time": this.detail.up_time,
"down_time": this.detail.down_time,
"state": this.detail.state,
"ordid": parseInt(this.detail.rank)
})
.then(({ data }) => {
if (data.success == 1) {
this.$message({
message: "新增消息模板成功",
message: "新增banner成功",
type: "success",
});
setTimeout(() => {
this.$router.push("/message/message_template");
this.$router.push("/message/banner");
}, 500);
} else {
this.$message({
message: data.errMsg || "新增消息模板失败",
message: data.errMsg || "新增banner失败",
type: "warning",
});
}
......@@ -263,7 +306,7 @@ export default {
console.log(error);
this.$message({
message: "新增消息模板失败",
message: "新增banner失败",
type: "warning",
});
......@@ -272,23 +315,30 @@ export default {
},
editTemplate() {
this.$http
.post("/apaas/service/v3/msg/manage/tpl/update", {
id: this.$route.params.id,
...this.detail,
.post("/apaas/service/v3/recommend/manage/banners/update", {
"serial_num":this.detail.id,
"name": this.detail.name,
"url": this.detail.url,
"image_size": this.detail.size,
"image_url": this.detail.fileList,
"up_time": this.detail.up_time,
"down_time": this.detail.down_time,
"state": this.detail.state,
"ordid": parseInt(this.detail.rank)
})
.then(({ data }) => {
if (data.success == 1) {
this.$message({
message: "编辑消息模板成功",
message: "编辑banner成功",
type: "success",
});
setTimeout(() => {
this.$router.push("/message/message_template");
this.$router.push("/message/banner");
}, 200);
} else {
this.$message({
message: data.errMsg || "编辑消息模板失败",
message: data.errMsg || "编辑banner失败",
type: "warning",
});
}
......@@ -299,7 +349,7 @@ export default {
console.log(error);
this.$message({
message: "编辑消息模板失败",
message: "编辑banner失败",
type: "warning",
});
......@@ -307,11 +357,11 @@ export default {
});
},
cancelAction() {
this.$router.push("/message/message_template");
this.$router.push("/message/banner");
},
primaryAction() {
if (this.pageType === 2) {
this.$router.push("/message/message_template");
this.$router.push("/message/banner");
} else {
this.$refs.detail_form.validate((valid) => {
if (valid) {
......@@ -332,4 +382,13 @@ export default {
.apaas_detail_container .banner_contaner .el-input__inner{
width: 970px;
}
.apaas_detail_container .el-upload--picture-card{
width: 526px;
height: 174px;
line-height: 174px;
}
.apaas_detail_container .el-upload-list--picture-card .el-upload-list__item{
width: 526px;
height: 174px;
}
</style>
<template>
<div class="contain">
<p class="now_page_title">在线组件工具/ <span>搜索引擎</span> </p>
<div class="contain_table">
<div class="table_header">
<div class="table_search">
<el-input
placeholder="请输入内容"
prefix-icon="el-icon-search"
v-model="input2">
<span slot="append" @click="search_list()">搜索</span>
</el-input>
</div>
</div>
<div class="table_container">
<el-table
:data="tableData"
height="100%"
border
:header-cell-style="rowClass"
style="width: 100%;border-radius:12px;overflow:hidden;border-top:0;">
<el-table-column
prop="index"
label="序号"
align="center"
width="70">
</el-table-column>
<el-table-column
prop="COMPANY_NAME"
label="企业名称"
width="330">
</el-table-column>
<el-table-column
prop="HAZARD_NAME"
label="危险源名称"
align="center"
width="190">
</el-table-column>
<el-table-column
prop="_source"
align="left"
header-align="center"
label="内容">
</el-table-column>
</el-table>
</div>
<list-pagination
:total="listTotal"
:page-size="pageSize"
:page-sizes="[10,50,100]"
:current-page="currentPage"
@current-change="changeCurrentPage"
@size-change="changeCurrentSize"
></list-pagination>
</div>
</div>
</template>
<script>
import ListPagination from "@/components/comments-pagination";
export default {
props: [],
components: {
ListPagination
},
data() {
return {
input2:'',
tableData:[],
listTotal:0,
pageSize: 10,
currentPage:1,
};
},
watch: {
},
computed: {
},
created() {
this.search_list()
},
mounted() {
},
methods: {
search_list(){
this.$http
.get(`/apaas/service/v3/service/manager/searchES?search=${this.input2}&limit=${this.pageSize}&page=${this.currentPage}`)
.then(response => {
if(response.data.success){
console.log(response.data);
this.listTotal = response.data.data.total
var temp = []
response.data.data.data.forEach((e,idx) => {
temp.push({...e._source,_source:JSON.stringify(e._source),index:idx+1+(this.currentPage-1)*10})
});
this.tableData = temp
}
})
},
changeCurrentPage(value) {
this.currentPage = value;
this.search_list();
},
changeCurrentSize(value) {
this.pageSize = value;
this.search_list();
},
rowClass({ row, column, rowIndex, columnIndex}) {
console.log(columnIndex) //表头行下标
if(columnIndex==0){
return 'background:#faf2e2;color:#242c43;border:1px solid #ebd9b6;borderRadius:12px 0 0 0;'
}else if(columnIndex==4){
return 'background:#faf2e2;color:#242c43;border:1px solid #ebd9b6;borderRadius:0 12px 0 0;'
}else{
return 'background:#faf2e2;color:#242c43;border:1px solid #ebd9b6;borderLeft:0;'
}
}
},
};
</script>
<style>
.table_search .el-input-group__append, .el-input-group__prepend {
border-radius:0 8px 8px 0;
width: 110px;
text-align: center;
background-color: #0f2683;
font-size: 17px;
color:#fff;
font-weight: 600;
cursor: pointer;
border: 1px solid #0f2683;
}
.table_search .el-input__inner{
background-color: #f7f8f9;
}
.table_search .el-table--scrollable-y .el-table__body-wrapper{
border-left: 1px solid #e3e5ef;
}
</style>
<style scoped>
.contain {
width: calc(100% - 80px);
height: calc(100vh - 210px);
margin: 0 auto;
margin-top: -157px;
margin-bottom: 20px;
}
.now_page_title {
margin:20px 0;
color: #626de9;
margin-top: 50px;
padding-left: 20px;
}
.now_page_title span {
color: #b4c0f5;
}
.contain_table{
width: 100%;
height: 100%;
background-color: #fff;
box-shadow: 0px 3px 6px 0px #f4f7fc;
border-radius: 12px;
padding: 20px;
}
.table_header{
height: 70px;
width: 100%;
border-bottom: 2px solid #f4f7fc;
}
.table_search{
width: 800px;
height: 44px;
margin: 0 auto;
}
.table_container{
width: 100%;
height: calc(100% - 130px);
margin-top: 30px;
}
</style>
......@@ -1026,7 +1026,14 @@ export default {
url:'',
},
]
}
},
{
text: "搜索引擎",
pic: require("@/assets/imgs/home_tool_ic_ssyq.png"),
bg: "#f1f1f3",
color: "#58617a",
url:'/search_engine',
},
],
service_arr: [
["服务列表", "申请服务", "云资源"],
......
......@@ -242,6 +242,11 @@ export default new Router({
name: "intelligent_drawing",
component: () => import("@/pages/workbench/intelligent_drawing"),
}, // 智能制图
{
path: "/search_engine",
name: "search_act",
component: () => import("@/pages/workbench/search_act"),
}, // 搜索引擎
{
path: "/user", // 个人中心
name: "user",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment