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