|
@@ -0,0 +1,692 @@
|
|
|
+<template>
|
|
|
+ <div class="keyword">
|
|
|
+ <el-form ref="queryParam" :model="queryParam" size="small" :inline="true" label-width="100px">
|
|
|
+ <el-row type="flex" justify="space-between">
|
|
|
+ <el-col :span="21">
|
|
|
+ <el-form-item label="条件组合名称">
|
|
|
+ <el-input v-model="queryParam.conditionCombinationName" placeholder="请输入内容" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="生效状态">
|
|
|
+ <el-select v-model="queryParam.status" filterable placeholder="请选择" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusOption"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="关键字">
|
|
|
+ <el-input v-model="queryParam.keyword" placeholder="请输入内容" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="3">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" size="mini" @click="handleSearch" icon="el-icon-search">搜索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <el-row type="flex" justify="end">
|
|
|
+ <el-col :span="3">
|
|
|
+ <el-button type="primary" size="mini" @click="handleAdd" icon="el-icon-plus">新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <el-table
|
|
|
+ :data="tableDataList"
|
|
|
+ :height="tableHeight"
|
|
|
+ style="width: 100%"
|
|
|
+ :header-cell-style="{'text-align':'center'}"
|
|
|
+ @row-dblclick="handleDblclick">
|
|
|
+ <el-table-column
|
|
|
+ label="序号"
|
|
|
+ width="100"
|
|
|
+ align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="conditionCombinationName"
|
|
|
+ label="条件组合名称"
|
|
|
+ width="260"
|
|
|
+ align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="combinationFunctionDescription"
|
|
|
+ label="组合作用描述"
|
|
|
+ width="300"
|
|
|
+ align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="conditionLogic"
|
|
|
+ label="条件逻辑"
|
|
|
+ width="200"
|
|
|
+ align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="status"
|
|
|
+ label="状态"
|
|
|
+ width="175"
|
|
|
+ align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{getChangeType(scope.row.status)}}<!--调用getChangeType方法-->
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="keyword"
|
|
|
+ label="关键字"
|
|
|
+ width="260"
|
|
|
+ align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="remark"
|
|
|
+ label="备注"
|
|
|
+ width="280"
|
|
|
+ align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
+ <el-button type="text" size="small" @click="handleUpAndDown(scope.row)"> {{scope.row.status == '0' ?"停用":"启用"}}</el-button>
|
|
|
+ <el-button type="text" size="text" @click="handleRemove(scope.row)" >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page=this.queryParam.pageNum
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
+ :page-size=this.queryParam.pageSize
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total=this.total>
|
|
|
+ </el-pagination>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="addFlag"
|
|
|
+ width="80%"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-tag >主表规则</el-tag>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="条件组合名称" prop="conditionCombinationName">
|
|
|
+ <el-input v-model="form.conditionCombinationName" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="组合作用描述" prop="combinationFunctionDescription">
|
|
|
+ <el-input v-model="form.combinationFunctionDescription" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="条件逻辑" prop="conditionLogic">
|
|
|
+ <el-select v-model="form.conditionLogic" placeholder="请选择条件逻辑" clearable style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in conditionLogicOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row type="flex" justify="space-between">
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="form.remark" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="3">
|
|
|
+ <el-button style="margin-left: 20px" size="mini" type="primary" @click="addDomain">新增子表规则</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-tag >子表规则</el-tag>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div v-for="(mkKeywordItem,index) in form.mkKeywordItems" :key="index">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item :label="'字段名'+index" :prop="'mkKeywordItems.'+index+'.fieldName'" >
|
|
|
+ <el-input v-model="mkKeywordItem.fieldName" placeholder="请输入字段名" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item :label="'过滤条件'+index" :prop="'mkKeywordItems.'+index+'.filterCondition'" >
|
|
|
+ <el-input v-model="mkKeywordItem.filterCondition" placeholder="请输入过滤条件" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item :label="'过滤条件描述'+index" :prop="'mkKeywordItems.'+index+'.filterConditionDescription'">
|
|
|
+ <el-select v-model="mkKeywordItem.filterConditionDescription" placeholder="请选择过滤条件描述" clearable style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in filterConditionDescriptionOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item :label="'条件逻辑'+index" :prop="'mkKeywordItems.'+index+'.conditionLogic'" >
|
|
|
+ <el-select v-model="mkKeywordItem.conditionLogic" placeholder="请选择条件逻辑" clearable style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in conditionLogicOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item :label="'关键字'+index" :prop="'mkKeywordItems.'+index+'.keyword'" >
|
|
|
+ <el-input v-model="mkKeywordItem.keyword" placeholder="请输入关键字" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item :label="'备注'+index" :prop="'mkKeywordItems.'+index+'.remark'">
|
|
|
+ <el-input v-model="mkKeywordItem.remark" placeholder="请输入备注" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="3">
|
|
|
+ <div v-if="form.mkKeywordItems.length>'1'">
|
|
|
+ <el-button style="margin-left: 20px" size="mini" type="danger" @click="removeDomain(mkKeywordItem)">删除</el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <el-button @click="handleCancel">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="handleSubmit">确 定</el-button>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="editFlag"
|
|
|
+ width="80%"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="条件组合名称" prop="conditionCombinationName">
|
|
|
+ <el-input v-model="form.conditionCombinationName" placeholder="请输入条件组合名称" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="组合作用描术" prop="combinationFunctionDescription">
|
|
|
+ <el-input v-model="form.combinationFunctionDescription" placeholder="请输入组合作用描术" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="条件逻辑" prop="conditionLogic">
|
|
|
+ <el-select v-model="form.conditionLogic" placeholder="请选择条件逻辑" clearable style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in conditionLogicOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="form.remark" placeholder="请输入备注" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <el-row type="flex" justify="end">
|
|
|
+ <el-button type="primary" @click="handleCancel">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="handleEditSubmit">确 定</el-button>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="详情"
|
|
|
+ :visible.sync="detailFlag"
|
|
|
+ width="80%"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <el-descriptions title="主表规则">
|
|
|
+ <el-descriptions-item label="条件组合名称">{{this.form.conditionCombinationName}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="组合作用描述">{{ this.form.combinationFunctionDescription }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="条件逻辑">{{ this.form.conditionLogic }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="状态">{{getChangeType(this.form.status)}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="备注">{{this.form.remark}}</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ <div v-for="(mkKeywordItem,index) in this.form.mkKeywordItems" :key="index">
|
|
|
+ <el-descriptions title="子表规则" :column="4">
|
|
|
+ <el-descriptions-item label="字段名">{{mkKeywordItem.fieldName}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="过滤条件">{{ mkKeywordItem.filterCondition }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="过滤条件描述">{{ mkKeywordItem.filterConditionDescription }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="条件逻辑">{{mkKeywordItem.conditionLogic}}</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ <el-descriptions :column="4">
|
|
|
+ <el-descriptions-item label="状态">{{getChangeType(mkKeywordItem.status)}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="关键字">{{mkKeywordItem.keyword}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="备注">{{mkKeywordItem.remark}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item >
|
|
|
+ <el-button type="text" @click="handleEditItem(mkKeywordItem)">编 辑</el-button>
|
|
|
+ <el-button type="text" @click="handleItemUpAndDown(mkKeywordItem)"> {{mkKeywordItem.status == '0' ?"停用":"启用"}}</el-button>
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <el-row type="flex" justify="end">
|
|
|
+ <el-button type="primary" @click="handleDetailSubmit">确 定</el-button>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="editItemFlag"
|
|
|
+ width="80%"
|
|
|
+ :before-close="handleEditItemClose">
|
|
|
+ <el-form ref="formEditItem" :model="formEditItem" label-width="120px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="字段名" prop="fieldName">
|
|
|
+ <el-input v-model="formEditItem.fieldName" placeholder="请输入字段名" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="过滤条件" prop="filterCondition">
|
|
|
+ <el-input v-model="formEditItem.filterCondition" placeholder="请输入过滤条件" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="过滤条件描述" prop="filterConditionDescription">
|
|
|
+ <el-select v-model="formEditItem.filterConditionDescription" placeholder="请选择过滤条件描述" clearable style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in filterConditionDescriptionOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="条件逻辑" prop="conditionLogic">
|
|
|
+ <el-select v-model="formEditItem.conditionLogic" placeholder="请选择条件逻辑" clearable style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in conditionLogicOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="关键字" prop="keyword">
|
|
|
+ <el-input v-model="formEditItem.keyword" placeholder="请输入关键字" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="formEditItem.remark" placeholder="请输入备注" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <el-row type="flex" justify="end">
|
|
|
+ <el-button type="primary" @click="handleEditItemCancel">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="handleEditItemSubmit">确 定</el-button>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import {list, add, detail, remove, upAndDown, itemUpAndDown, edit, editItem} from '@/api/business/as/keyword'
|
|
|
+
|
|
|
+export default {
|
|
|
+ created() {
|
|
|
+ this.getTableHeight()
|
|
|
+ this.getTableDataList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getChangeType(e) {
|
|
|
+ for (var i = 0; i < this.statusOption.length; i++) {
|
|
|
+ if (this.statusOption[i].value === e) {
|
|
|
+ return this.statusOption[i].label;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleUpAndDown(val){
|
|
|
+ if(val.status == '0'){
|
|
|
+ val.status = '2'
|
|
|
+ }else {
|
|
|
+ val.status = '0'
|
|
|
+ }
|
|
|
+ upAndDown(val).then(res =>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleItemUpAndDown(val){
|
|
|
+ if(val.status == '0'){
|
|
|
+ val.status = '2'
|
|
|
+ }else {
|
|
|
+ val.status = '0'
|
|
|
+ }
|
|
|
+ itemUpAndDown(val).then(res =>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleDblclick(row,event,colum){
|
|
|
+ detail(row.id).then(res =>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.form=res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.detailFlag = true
|
|
|
+ },
|
|
|
+ handleSubmit(){
|
|
|
+ this.$refs["form"].validate((valid) =>{
|
|
|
+ if(valid){
|
|
|
+ add(this.form).then(res =>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.addFlag=false
|
|
|
+ this.$message.success("新增成功")
|
|
|
+ this.getTableDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleEditSubmit(){
|
|
|
+ edit(this.form).then(res =>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ this.editFlag = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleEditItemSubmit(){
|
|
|
+ editItem(this.formEditItem).then(res =>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ this.editItemFlag = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleDetailSubmit(){
|
|
|
+ this.detailFlag=false
|
|
|
+ this.formReset()
|
|
|
+ },
|
|
|
+ handleCancel(){
|
|
|
+ this.addFlag = false
|
|
|
+ this.editFlag = false
|
|
|
+ this.formReset()
|
|
|
+ },
|
|
|
+ handleEditItemCancel(){
|
|
|
+ this.editItemFlag=false
|
|
|
+ this.formEditItemReset()
|
|
|
+ },
|
|
|
+ formReset(){
|
|
|
+ this.form={
|
|
|
+ id:undefined,
|
|
|
+ conditionCombinationName: "",
|
|
|
+ combinationFunctionDescription: "",
|
|
|
+ conditionLogic: "",
|
|
|
+ status:'',
|
|
|
+ remark: "",
|
|
|
+ mkKeywordItems: [
|
|
|
+ {
|
|
|
+ fieldName: "",
|
|
|
+ filterCondition: "",
|
|
|
+ filterConditionDescription: "",
|
|
|
+ conditionLogic: "",
|
|
|
+ status:'',
|
|
|
+ keyword: "",
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ formEditItemReset(){
|
|
|
+ this.formEditItem={
|
|
|
+ id:"",
|
|
|
+ fieldName: "",
|
|
|
+ filterCondition: "",
|
|
|
+ filterConditionDescription: "",
|
|
|
+ conditionLogic: "",
|
|
|
+ status:'',
|
|
|
+ keyword: "",
|
|
|
+ remark: "",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ removeDomain(item) {
|
|
|
+ const index = this.form.mkKeywordItems.indexOf(item)
|
|
|
+ if (index !== -1) {
|
|
|
+ this.form.mkKeywordItems.splice(index, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addDomain() {
|
|
|
+ this.form.mkKeywordItems.push({
|
|
|
+ fieldName: "",
|
|
|
+ filterCondition: "",
|
|
|
+ filterConditionDescription: "",
|
|
|
+ conditionLogic: "",
|
|
|
+ keyword: "",
|
|
|
+ remark: "",
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //计算table高度(动态设置table高度)
|
|
|
+ getTableHeight() {
|
|
|
+ let tableH = 160; //距离页面下方的高度
|
|
|
+ let tableHeightDetil = window.innerHeight - tableH;
|
|
|
+ if (tableHeightDetil <= 300) {
|
|
|
+ this.tableHeight = 300;
|
|
|
+ } else {
|
|
|
+ this.tableHeight = window.innerHeight - tableH;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSearch() {
|
|
|
+ this.getTableDataList(this.queryParam)
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.queryParam.pageSize = val
|
|
|
+ this.getTableDataList()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.queryParam.pageNum = val
|
|
|
+ this.getTableDataList()
|
|
|
+ },
|
|
|
+ handleClose(done) {
|
|
|
+ this.$confirm('确认关闭?')
|
|
|
+ .then(_ => {
|
|
|
+ done()
|
|
|
+ this.formReset()
|
|
|
+ })
|
|
|
+ .catch(_ => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleEditItemClose(done){
|
|
|
+ this.$confirm('确认关闭?')
|
|
|
+ .then(_ => {
|
|
|
+ done()
|
|
|
+ this.formEditItemReset()
|
|
|
+ })
|
|
|
+ .catch(_ => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getTableDataList() {
|
|
|
+ list(this.queryParam).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.tableDataList = res.rows
|
|
|
+ this.total = res.total
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleAdd() {
|
|
|
+ this.title = '新增'
|
|
|
+ this.addFlag = true
|
|
|
+ },
|
|
|
+ handleRemove(val){
|
|
|
+ this.$confirm('确认删除?')
|
|
|
+ .then(_ => {
|
|
|
+ remove({ids:val.id}).then(res =>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ this.getTableDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(_ => {
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ handleEdit(data){
|
|
|
+ this.title = '修改'
|
|
|
+ this.editFlag = true
|
|
|
+ this.form = data
|
|
|
+ },
|
|
|
+ handleEditItem(val){
|
|
|
+ this.title="编辑"
|
|
|
+ this.editItemFlag = true;
|
|
|
+ this.formEditItem =val
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ filterConditionDescriptionOptions:[
|
|
|
+ {
|
|
|
+ value: '=',
|
|
|
+ label: '='
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '>',
|
|
|
+ label: '>'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '<',
|
|
|
+ label: '<'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'like',
|
|
|
+ label: 'like'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'not like',
|
|
|
+ label: 'not like'
|
|
|
+ },
|
|
|
+
|
|
|
+ ],
|
|
|
+ conditionLogicOptions:[
|
|
|
+ {
|
|
|
+ value: 'and',
|
|
|
+ label: 'and'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'or',
|
|
|
+ label: 'or'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ statusOption: [
|
|
|
+ {
|
|
|
+ value: '0',
|
|
|
+ label: '生效'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '2',
|
|
|
+ label: '未生效'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ title: '',
|
|
|
+ detailFlag: false,
|
|
|
+ addFlag: false,
|
|
|
+ editFlag: false,
|
|
|
+ editItemFlag: false,
|
|
|
+ tableHeight: '',
|
|
|
+ total: 0,
|
|
|
+ queryParam: {
|
|
|
+ conditionCombinationName: '',
|
|
|
+ status: '',
|
|
|
+ keyword: '',
|
|
|
+ pageSize: 10,
|
|
|
+ pageNum: 1
|
|
|
+ },
|
|
|
+ form: {
|
|
|
+ id:undefined,
|
|
|
+ conditionCombinationName: "",
|
|
|
+ combinationFunctionDescription: "",
|
|
|
+ conditionLogic: "",
|
|
|
+ status:'',
|
|
|
+ remark: "",
|
|
|
+ mkKeywordItems: [
|
|
|
+ {
|
|
|
+ fieldName: "",
|
|
|
+ filterCondition: "",
|
|
|
+ filterConditionDescription: "",
|
|
|
+ conditionLogic: "",
|
|
|
+ status:'',
|
|
|
+ keyword: "",
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ formEditItem:{
|
|
|
+ id:"",
|
|
|
+ fieldName: "",
|
|
|
+ filterCondition: "",
|
|
|
+ filterConditionDescription: "",
|
|
|
+ conditionLogic: "",
|
|
|
+ status:'',
|
|
|
+ keyword: "",
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ conditionCombinationName: [
|
|
|
+ {required: true, message: "请输入条件组合名称", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ conditionLogic: [
|
|
|
+ {required: true, message: "请输入条件逻辑", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ fieldName: [
|
|
|
+ {required: true, message: "请输入字段名", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ filterCondition: [
|
|
|
+ {required: true, message: "请输入过滤条件", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ filterConditionDescription: [
|
|
|
+ {required: true, message: "请输入字段名", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ keyword: [
|
|
|
+ {required: true, message: "请输入关键字", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ tableDataList: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+<style>
|
|
|
+
|
|
|
+</style>
|