|
|
@ -1,16 +1,46 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<div class="app-container">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
<el-form-item label="接口名称" prop="apiName">
|
|
|
|
<el-form-item label="文案内容" prop="content">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="queryParams.apiName"
|
|
|
|
v-model="queryParams.content"
|
|
|
|
placeholder="请输入接口名称"
|
|
|
|
placeholder="请输入文案内容"
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
size="small"
|
|
|
|
size="small"
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="文案来源" prop="source">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="queryParams.source"
|
|
|
|
|
|
|
|
placeholder="请输入文案来源"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="文案类型" prop="type">
|
|
|
|
|
|
|
|
<el-select v-model="queryParams.type" placeholder="请选择文案类型" clearable size="small">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="dict in dict.type.copywriting_type"
|
|
|
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="创建时间">
|
|
|
|
|
|
|
|
<el-date-picker
|
|
|
|
|
|
|
|
v-model="daterangeCreateTime"
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
|
|
|
type="daterange"
|
|
|
|
|
|
|
|
range-separator="-"
|
|
|
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
@ -18,6 +48,10 @@
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="danger"
|
|
|
|
type="danger"
|
|
|
@ -26,9 +60,8 @@
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
:disabled="multiple"
|
|
|
|
:disabled="multiple"
|
|
|
|
@click="handleDelete"
|
|
|
|
@click="handleDelete"
|
|
|
|
v-hasPermi="['english:log:remove']"
|
|
|
|
v-hasPermi="['english:copywriting:remove']"
|
|
|
|
>删除
|
|
|
|
>删除</el-button>
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
@ -37,26 +70,23 @@
|
|
|
|
icon="el-icon-download"
|
|
|
|
icon="el-icon-download"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleExport"
|
|
|
|
@click="handleExport"
|
|
|
|
v-hasPermi="['english:log:export']"
|
|
|
|
v-hasPermi="['english:copywriting:export']"
|
|
|
|
>导出
|
|
|
|
>导出</el-button>
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
|
|
|
|
<el-table v-loading="loading" :data="copyWritingList" @selection-change="handleSelectionChange">
|
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
<el-table-column label="接口名称" align="center" prop="apiName" :show-overflow-tooltip="true"/>
|
|
|
|
<el-table-column label="文案内容" align="center" prop="content" />
|
|
|
|
<el-table-column label="请求URL" align="center" prop="url" :show-overflow-tooltip="true"/>
|
|
|
|
<el-table-column label="文案来源" align="center" prop="source" />
|
|
|
|
<el-table-column label="请求方法" align="center" prop="method" :show-overflow-tooltip="true"/>
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
|
|
<el-table-column label="请求参数" align="center" prop="request" :show-overflow-tooltip="true"/>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="响应参数" align="center" prop="response" :show-overflow-tooltip="true"/>
|
|
|
|
<el-table-column label="文案类型" align="center" prop="type">
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-table-column label="是否请求成功" align="center" prop="isSuccess" :show-overflow-tooltip="true">
|
|
|
|
<dict-tag :options="dict.type.copywriting_type" :value="scope.row.type"/>
|
|
|
|
<template slot-scope="scope">
|
|
|
|
</template>
|
|
|
|
<el-tag :type="scope.row.isSuccess==='成功'?'success':'danger'" size="small">{{ scope.row.isSuccess }}</el-tag>
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
@ -64,9 +94,8 @@
|
|
|
|
type="text"
|
|
|
|
type="text"
|
|
|
|
icon="el-icon-delete"
|
|
|
|
icon="el-icon-delete"
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
v-hasPermi="['english:log:remove']"
|
|
|
|
v-hasPermi="['english:copywriting:remove']"
|
|
|
|
>删除
|
|
|
|
>删除</el-button>
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
@ -78,14 +107,25 @@
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
@pagination="getList"
|
|
|
|
@pagination="getList"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改文案api,通过api获取文案信息对话框 -->
|
|
|
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import {listLog, getLog, delLog} from "@/api/business/english/log";
|
|
|
|
import { listCopyWriting, getCopyWriting, delCopyWriting } from "@/api/business/english/copywriting";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "Log",
|
|
|
|
name: "CopyWriting",
|
|
|
|
|
|
|
|
dicts: ['copywriting_type'],
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
// 遮罩层
|
|
|
|
// 遮罩层
|
|
|
@ -100,33 +140,50 @@ export default {
|
|
|
|
showSearch: true,
|
|
|
|
showSearch: true,
|
|
|
|
// 总条数
|
|
|
|
// 总条数
|
|
|
|
total: 0,
|
|
|
|
total: 0,
|
|
|
|
// 日志表格数据
|
|
|
|
// 文案api,通过api获取文案信息表格数据
|
|
|
|
logList: [],
|
|
|
|
copyWritingList: [],
|
|
|
|
// 弹出层标题
|
|
|
|
// 弹出层标题
|
|
|
|
title: "",
|
|
|
|
title: "",
|
|
|
|
// 是否显示弹出层
|
|
|
|
// 是否显示弹出层
|
|
|
|
open: false,
|
|
|
|
open: false,
|
|
|
|
|
|
|
|
// 文案类型时间范围
|
|
|
|
|
|
|
|
daterangeCreateTime: [],
|
|
|
|
// 查询参数
|
|
|
|
// 查询参数
|
|
|
|
queryParams: {
|
|
|
|
queryParams: {
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
apiName: null
|
|
|
|
content: null,
|
|
|
|
|
|
|
|
source: null,
|
|
|
|
|
|
|
|
createTime: null,
|
|
|
|
|
|
|
|
type: null
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单参数
|
|
|
|
// 表单参数
|
|
|
|
form: {},
|
|
|
|
form: {},
|
|
|
|
// 表单校验
|
|
|
|
// 表单校验
|
|
|
|
rules: {}
|
|
|
|
rules: {
|
|
|
|
|
|
|
|
content: [
|
|
|
|
|
|
|
|
{ required: true, message: "文案内容不能为空", trigger: "blur" }
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
source: [
|
|
|
|
|
|
|
|
{ required: true, message: "文案来源不能为空", trigger: "blur" }
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
/** 查询日志列表 */
|
|
|
|
/** 查询文案api,通过api获取文案信息列表 */
|
|
|
|
getList() {
|
|
|
|
getList() {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
listLog(this.queryParams).then(response => {
|
|
|
|
this.queryParams.params = {};
|
|
|
|
this.logList = response.rows;
|
|
|
|
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
|
|
|
|
|
|
|
|
this.queryParams.createTime = this.daterangeCreateTime[0];
|
|
|
|
|
|
|
|
this.queryParams.endCreateTime = this.daterangeCreateTime[1];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
listCopyWriting(this.queryParams).then(response => {
|
|
|
|
|
|
|
|
this.copyWritingList = response.rows;
|
|
|
|
this.total = response.total;
|
|
|
|
this.total = response.total;
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -140,13 +197,10 @@ export default {
|
|
|
|
reset() {
|
|
|
|
reset() {
|
|
|
|
this.form = {
|
|
|
|
this.form = {
|
|
|
|
id: null,
|
|
|
|
id: null,
|
|
|
|
apiName: null,
|
|
|
|
content: null,
|
|
|
|
url: null,
|
|
|
|
source: null,
|
|
|
|
method: null,
|
|
|
|
createTime: null,
|
|
|
|
request: null,
|
|
|
|
type: null
|
|
|
|
response: null,
|
|
|
|
|
|
|
|
isSuccess: null,
|
|
|
|
|
|
|
|
createTime:null
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.resetForm("form");
|
|
|
|
this.resetForm("form");
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -157,47 +211,51 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
resetQuery() {
|
|
|
|
resetQuery() {
|
|
|
|
|
|
|
|
this.daterangeCreateTime = [];
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
this.handleQuery();
|
|
|
|
this.handleQuery();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 多选框选中数据
|
|
|
|
// 多选框选中数据
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
this.single = selection.length !== 1
|
|
|
|
this.single = selection.length!==1
|
|
|
|
this.multiple = !selection.length
|
|
|
|
this.multiple = !selection.length
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
/** 提交按钮 */
|
|
|
|
handleAdd() {
|
|
|
|
submitForm() {
|
|
|
|
this.reset();
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
this.open = true;
|
|
|
|
if (valid) {
|
|
|
|
this.title = "添加日志";
|
|
|
|
if (this.form.id != null) {
|
|
|
|
},
|
|
|
|
updateCopyWriting(this.form).then(response => {
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
handleUpdate(row) {
|
|
|
|
this.open = false;
|
|
|
|
this.reset();
|
|
|
|
this.getList();
|
|
|
|
const id = row.id || this.ids
|
|
|
|
});
|
|
|
|
getLog(id).then(response => {
|
|
|
|
} else {
|
|
|
|
this.form = response.data;
|
|
|
|
addCopyWriting(this.form).then(response => {
|
|
|
|
this.open = true;
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
this.title = "修改日志";
|
|
|
|
this.open = false;
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
handleDelete(row) {
|
|
|
|
handleDelete(row) {
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
this.$modal.confirm('是否确认删除日志编号为"' + ids + '"的数据项?').then(function () {
|
|
|
|
this.$modal.confirm('是否确认删除文案api,通过api获取文案信息编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
return delLog(ids);
|
|
|
|
return delCopyWriting(ids);
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
}).catch(() => {
|
|
|
|
}).catch(() => {});
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
handleExport() {
|
|
|
|
handleExport() {
|
|
|
|
this.download('english/log/export', {
|
|
|
|
this.download('english/copyWriting/export', {
|
|
|
|
...this.queryParams
|
|
|
|
...this.queryParams
|
|
|
|
}, `log_${new Date().getTime()}.xlsx`)
|
|
|
|
}, `copyWriting_${new Date().getTime()}.xlsx`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|