parent
7bdb89ff4a
commit
6c39508368
|
|
@ -1,6 +1,6 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询日志列表
|
||||
// 翻译
|
||||
export function translation(query) {
|
||||
return request({
|
||||
url: '/english/translation',
|
||||
|
|
@ -8,3 +8,12 @@ export function translation(query) {
|
|||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
//获取文案
|
||||
export function getCopyWriting(query) {
|
||||
return request({
|
||||
url: '/english/copyWriting',
|
||||
method: 'get',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,24 +78,33 @@
|
|||
|
||||
<el-table v-loading="loading" :data="copyWritingList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="文案内容" align="center" prop="content" />
|
||||
<el-table-column label="文案来源" align="center" prop="source" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column label="文案内容" align="center" prop="content" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="文案来源" align="center" prop="source" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180" :show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
<el-table-column label="文案类型" align="center" prop="type">
|
||||
<el-table-column label="文案类型" align="center" prop="type" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.copywriting_type" :value="scope.row.type"/>
|
||||
</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">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
<el-tooltip class="item" effect="dark" content="点击查看详情" placement="top-start">
|
||||
<el-button circle
|
||||
type=""
|
||||
icon="el-icon-view"
|
||||
@click="handleView(scope.row,scope.index)"
|
||||
v-hasPermi="['english:copywriting:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="item" effect="dark" content="点击删除" placement="top-start">
|
||||
<el-button circle
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['english:copywriting:remove']"
|
||||
>删除</el-button>
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -108,13 +117,17 @@
|
|||
@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-dialog title="内容详细" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form ref="form" :model="form" label-width="100px" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="文案内容:">{{ form.content }}</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button @click="open = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -174,6 +187,12 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 详细按钮操作 */
|
||||
handleView(row) {
|
||||
this.open = true;
|
||||
this.form = row;
|
||||
},
|
||||
|
||||
/** 查询文案api,通过api获取文案信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
|
|
|||
|
|
@ -60,12 +60,12 @@
|
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
circle
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['english:log:remove']"
|
||||
>删除
|
||||
>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,18 @@
|
|||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="grid-content bg-purple" style="height: 100px"></div>
|
||||
<div class="grid-content bg-purple" style="height: 180px">
|
||||
<!-- 文案内容区域-->
|
||||
<!-- 内容-->
|
||||
<div class="content_div">
|
||||
{{responseCopyWriting.content}}
|
||||
</div>
|
||||
<!-- 来源-->
|
||||
<div class="source_div">
|
||||
{{responseCopyWriting.source}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
|
|
@ -59,7 +70,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {translation} from "@/api/business/english/translation";
|
||||
import {translation,getCopyWriting} from "@/api/business/english/translation";
|
||||
|
||||
export default {
|
||||
dicts: ['translation_type'],
|
||||
|
|
@ -73,6 +84,13 @@ export default {
|
|||
translationType: '',
|
||||
q: '',
|
||||
},
|
||||
|
||||
//文案参数
|
||||
copyWriting:[],
|
||||
|
||||
//文案响应数据
|
||||
responseCopyWriting:{},
|
||||
|
||||
translationRules: {
|
||||
translationType: [{
|
||||
required: true,
|
||||
|
|
@ -96,16 +114,22 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
this.getCopyWriting()
|
||||
},
|
||||
methods: {
|
||||
//获取文案
|
||||
getCopyWriting() {
|
||||
getCopyWriting(this.copyWriting).then(res =>{
|
||||
this.responseCopyWriting=res.data
|
||||
})
|
||||
},
|
||||
|
||||
submitForm() {
|
||||
this.$refs['translation'].validate(valid => {
|
||||
if (valid) {
|
||||
translation(this.translationData).then(res => {
|
||||
let result = res.data.transResult
|
||||
let results = ''
|
||||
console.log(result)
|
||||
result.forEach(r => {
|
||||
results = results + ' ' + r.dst;
|
||||
})
|
||||
|
|
@ -147,4 +171,16 @@ export default {
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
.content_div{
|
||||
float: left;
|
||||
width: 88%;
|
||||
text-shadow: 2px 2px 2px grey;
|
||||
}
|
||||
.source_div{
|
||||
float: left;
|
||||
padding-top: 70px;
|
||||
width: 12%;
|
||||
text-shadow: 2px 2px 2px grey;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue