第一次发布
This commit is contained in:
180
src/views/open-platform/CompanySitePushForm.vue
Normal file
180
src/views/open-platform/CompanySitePushForm.vue
Normal file
@@ -0,0 +1,180 @@
|
||||
<!--
|
||||
开发平台-配置表单页面
|
||||
-骆超
|
||||
-2021年11月02日
|
||||
-->
|
||||
<template>
|
||||
<div class="company-site-push">
|
||||
<el-form ref="form" :rules="rules" :model="companySitePush" label-width="100px" class="form-body">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属公司" prop="pushUrl">
|
||||
<el-select
|
||||
v-model="companySitePush.companyId"
|
||||
remote
|
||||
style="width:100%"
|
||||
filterable
|
||||
:remote-method="serarchCompany"
|
||||
clearable
|
||||
@change="selectedCompany"
|
||||
placeholder="所属公司"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in companyList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="推送URL" prop="pushUrl">
|
||||
<el-input v-model="companySitePush.pushUrl" clearable placeholder="请输入推送URL"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否启用" >
|
||||
<el-switch
|
||||
v-model="companySitePush.enable"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="同步扣款">
|
||||
<el-switch
|
||||
v-model="companySitePush.syncDeductions"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="方法实现类">
|
||||
<el-input v-model="companySitePush.loadClass" clearable placeholder="请输入油站包装的全限定类名"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="油站包装类">
|
||||
<el-input v-model="companySitePush.siteClass" clearable placeholder="请输入油站包装的全限定类名"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="油品包装类">
|
||||
<el-input v-model="companySitePush.oilsClass" clearable placeholder="请输入油品包装的全限定类名"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="对接来源" prop="userSource">
|
||||
<el-input v-model="companySitePush.userSource" placeholder="请输入对接来源" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="对接方公钥" prop="userPublicKey">
|
||||
<el-input type="textarea" :autosize="{ minRows: 2, maxRows: 5}" v-model="companySitePush.userPublicKey" placeholder="请输入对接方公钥" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-col :span="24" class="foot-button">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submit"
|
||||
>提交
|
||||
</el-button>
|
||||
<el-button @click="close">取消</el-button>
|
||||
</el-col>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import openApi from "../../api/open/open";
|
||||
import companySitePushApi from "../../api/open/companySitePush"
|
||||
|
||||
export default {
|
||||
name: "CompanySitePush",
|
||||
data() {
|
||||
return {
|
||||
companySitePush: {
|
||||
companyId : "",
|
||||
companyName : "",
|
||||
pushUrl: "",
|
||||
enable: "1",
|
||||
siteClass: "",
|
||||
oilsClass: "",
|
||||
loadClass: "",
|
||||
userPublicKey: "",
|
||||
syncDeductions: "0",
|
||||
},
|
||||
companyList:[],
|
||||
rules: {
|
||||
pushUrl: [{required: true, message: '请输入推送接口地址', trigger: 'blur'}],
|
||||
siteClass: [{required: true, message: '请输入油站包装类', trigger: 'blur'}],
|
||||
oilsClass: [{required: true, message: '请输入油品包装类', trigger: 'blur'}],
|
||||
userPublicKey: [{required: true, message: '请输入对方公钥', trigger: 'blur'}],
|
||||
userSource: [{required: true, message: '请输入对接来源', trigger: 'blur'}],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
companySitePushApi.save(this.companySitePush).then(res=>{
|
||||
console.log(res)
|
||||
if (res.code===20000){
|
||||
this.$emit("closeDrawer")
|
||||
this.$emit("getPageList")
|
||||
}
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit("closeDrawer")
|
||||
},
|
||||
serarchCompany(value) { // 远程搜索企业
|
||||
if (value) {
|
||||
openApi.getRelationCompany({companyName:value}).then(res => {
|
||||
this.companyList = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
selectedCompany(id){
|
||||
if (id){
|
||||
this.companySitePush.companyId = id
|
||||
this.companySitePush.companyName = this.companyList.find(f => f.id===id).name
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.company-site-push {
|
||||
.form-body {
|
||||
border-top: 1px solid #d9e4e7 !important;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.foot-button {
|
||||
border-top: 1px solid #d9e4e7 !important;
|
||||
text-align: center;
|
||||
bottom: 0px;
|
||||
padding: 30px;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
322
src/views/open-platform/ConversionSettings.vue
Normal file
322
src/views/open-platform/ConversionSettings.vue
Normal file
@@ -0,0 +1,322 @@
|
||||
<!--
|
||||
开发平台-转化配置界面
|
||||
-骆超
|
||||
-2021年11月02日
|
||||
-->
|
||||
<template>
|
||||
<div class="table-header table-div el-scrollbar conversion-settings-cls" ref="conversionSettings">
|
||||
<ListLayout :table-columns="tableColumns">
|
||||
<div slot="search" >
|
||||
<!--这里放顶部搜索-->
|
||||
<!-- 搜索部分开始 -->
|
||||
<!-- <el-form label-width="90px" :inline="true" :model="page" class="search-form" >-->
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <el-autocomplete-->
|
||||
<!-- v-model="page.params.accountName"-->
|
||||
<!-- placeholder="请输入公司名称"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
|
||||
<!-- 搜索部分结束 -->
|
||||
</div>
|
||||
|
||||
<el-row slot="button-group">
|
||||
<!--这里放添加导出等按钮-->
|
||||
<span class="fl">
|
||||
<el-button
|
||||
class="group-item float"
|
||||
type="primary"
|
||||
@click="toAdd"
|
||||
>
|
||||
<svg-icon icon-class="iconxinzeng"/>
|
||||
新增配置
|
||||
</el-button>
|
||||
</span>
|
||||
<!--这里放添加导出等按钮-->
|
||||
<el-button
|
||||
class="group-item"
|
||||
type="primary"
|
||||
@click="getPageList"
|
||||
>
|
||||
查询
|
||||
</el-button>
|
||||
</el-row>
|
||||
|
||||
<div slot="table">
|
||||
<!--这里放表格和分页-->
|
||||
<!-- 列表开始 -->
|
||||
<el-table
|
||||
:data="tableList"
|
||||
fit
|
||||
:height="tableHeight"
|
||||
stripe
|
||||
@sort-change="sortHandler"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
/>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
/>
|
||||
<template v-for="(item, index) in tableColumns">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:fixed="item.fixed"
|
||||
:align="item.align"
|
||||
:show-overflow-tooltip="true"
|
||||
:min-width="item.minWidth"
|
||||
:width="item.width"
|
||||
:prop="item.prop"
|
||||
:sortable="item.sortable"
|
||||
:label="item.label"
|
||||
:formatter="item.render"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<el-table-column fixed="right" align="center" label="操作" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown>
|
||||
<el-button type="text">
|
||||
更多<i class="el-icon-arrow-down el-icon--right"/>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="toUpdate(scope.row.id)">
|
||||
<el-button
|
||||
type="text"
|
||||
>
|
||||
<i class="el-icon-edit-outline">
|
||||
编辑
|
||||
</i>
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="fieldSetting(scope.row.id)">
|
||||
<el-button
|
||||
type="text"
|
||||
>
|
||||
<i class="el-icon-setting">
|
||||
字段配置
|
||||
</i>
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</ListLayout>
|
||||
<div class="page-foot">
|
||||
<el-pagination
|
||||
:current-page="page.currentPage"
|
||||
:page-sizes="[10,15,20,30]"
|
||||
:page-size="page.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="page.totalCount"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<el-drawer
|
||||
title="新增配置"
|
||||
class="table-detail-drawer"
|
||||
size="55%"
|
||||
:visible.sync="formDialog"
|
||||
direction="ltr"
|
||||
>
|
||||
<company-site-push-form
|
||||
v-if="formDialog"
|
||||
@closeDrawer="formDialog=false"
|
||||
@getPageList="getPageList"
|
||||
/>
|
||||
</el-drawer>
|
||||
|
||||
<el-drawer
|
||||
title="字段配置"
|
||||
class="table-detail-drawer"
|
||||
size="60%"
|
||||
:visible.sync="fieldDialog"
|
||||
direction="ltr"
|
||||
>
|
||||
<push-fields-settings
|
||||
v-if="fieldDialog"
|
||||
:pushId="pushId"
|
||||
@closeDrawer="fieldDialog=false;pushId=''"
|
||||
@getPageList="getPageList"
|
||||
/>
|
||||
</el-drawer>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CompanySitePushForm from "./CompanySitePushForm"
|
||||
import PushFieldsSettings from "./PushFieldsSettings"
|
||||
import companySitePushApi from "../../api/open/companySitePush"
|
||||
|
||||
export default {
|
||||
name: "ConversionSettings",
|
||||
|
||||
components:{
|
||||
CompanySitePushForm,
|
||||
PushFieldsSettings
|
||||
},
|
||||
|
||||
data(){
|
||||
return{
|
||||
tableList:[],
|
||||
pushId:"",
|
||||
page: {
|
||||
pageSize: 20, // 每页显示条数
|
||||
currentPage: 1, // 默认页
|
||||
params: {}, // 查询参数
|
||||
sorted: {},
|
||||
columns: []
|
||||
},
|
||||
formDialog:false,
|
||||
fieldDialog:false,
|
||||
tableColumns: [
|
||||
{
|
||||
prop: 'companyName',
|
||||
align: 'center',
|
||||
width: 200,
|
||||
label: '公司名称',
|
||||
show: true,
|
||||
},
|
||||
// {
|
||||
// prop: 'enable', label: '启用状态', align: 'center', show: true, render: (row, column, cell) => {
|
||||
// if (cell === '0') {
|
||||
// return '启用'
|
||||
// }else if (cell === '1') {
|
||||
// return '禁用'
|
||||
// }
|
||||
// return cell
|
||||
// }
|
||||
// },
|
||||
{
|
||||
prop: 'userSource',
|
||||
label: '对接来源',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
prop: 'userPublicKey',
|
||||
label: '对接方公钥',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
prop: 'syncDeductions',
|
||||
label: '同步扣款',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell === '0'?'是':'否'
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'loadClass',
|
||||
label: '加载类',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
prop: 'siteClass',
|
||||
label: '油站全限定类名',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
prop: 'oilsClass',
|
||||
label: '油品全限定类名',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
show: true,
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
tableHeight(){
|
||||
return (window.innerHeight - 350);
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getPageList()
|
||||
},
|
||||
|
||||
methods:{
|
||||
|
||||
getPageList(){
|
||||
companySitePushApi.pageList(this.page).then(res=>{
|
||||
if (res.code===20000){
|
||||
this.tableList = res.data.list
|
||||
this.page = Object.assign(this.page,res.data)
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleSizeChange(){
|
||||
|
||||
},
|
||||
|
||||
handleCurrentChange(){
|
||||
|
||||
},
|
||||
|
||||
toUpdate(id){
|
||||
|
||||
},
|
||||
|
||||
fieldSetting(id){
|
||||
this.pushId = id
|
||||
this.fieldDialog = true
|
||||
},
|
||||
|
||||
|
||||
toAdd(){
|
||||
this.formDialog = true
|
||||
},
|
||||
|
||||
sortHandler(column) {
|
||||
// 排序查询
|
||||
const key = column.prop
|
||||
const value = column.order
|
||||
this.page.sorted = {}
|
||||
this.page.sorted[key] = value
|
||||
// this.getByPage()
|
||||
},
|
||||
handleSelectionChange(){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.conversion-settings-cls{
|
||||
background: white;
|
||||
height: 100vh;
|
||||
.page-foot{
|
||||
bottom: 0px;
|
||||
margin-bottom: 10px;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
302
src/views/open-platform/PushFieldsSettings.vue
Normal file
302
src/views/open-platform/PushFieldsSettings.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<!--
|
||||
开发平台-转化配置字段界面
|
||||
-骆超
|
||||
-2021年11月03日
|
||||
-->
|
||||
<template>
|
||||
<div class="push-fields-settings">
|
||||
<div class="fl pd10">
|
||||
<el-button slot="reference" @click="addFieldSiteNode">新增油站字段</el-button>
|
||||
<el-button slot="reference" @click="addFieldOilsNode">新增油品字段</el-button>
|
||||
</div>
|
||||
<div class="fr pd10">
|
||||
<el-button slot="reference" @click="copyData($event)">复制json</el-button>
|
||||
<el-button slot="reference" @click="pasteData">粘贴json</el-button>
|
||||
<el-button slot="reference" @click="showHelp=!showHelp">字段帮助</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:height="tableHeight"
|
||||
row-key="id"
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column prop="sourceField" align="center" label="字段分类">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.type==='1'" type="success">油站</el-tag>
|
||||
<el-tag v-else type="warning">油品</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sourceField" align="center" label="源字段">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.sourceField" align="center" placeholder="请输入内容"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="targetField" align="center" label="目标字段">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.targetField" align="center" placeholder="请输入内容"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="targetField" align="center" label="转换类型">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.changeType"
|
||||
style="width:100%"
|
||||
filterable
|
||||
remote
|
||||
clear
|
||||
clearable
|
||||
reserve-keyword
|
||||
placeholder="转换类型"
|
||||
>
|
||||
<el-option
|
||||
label="Array"
|
||||
value="Array"
|
||||
/>
|
||||
<el-option
|
||||
label="JSON"
|
||||
value="JSON"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="computed" align="center" label="是否计算">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.computed"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
>
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="designFormulas" align="center" label="计算表达式">
|
||||
<template slot-scope="scope">
|
||||
<el-input type="textarea" :disabled="scope.row.computed==='0'" :autosize="{ minRows: 2, maxRows: 4}"
|
||||
v-model="scope.row.designFormulas" placeholder="请输入内容"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isOilsArray" align="center" label="是否为油品数组">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isOilsArray"
|
||||
active-color="#13ce66"
|
||||
:disabled="scope.row.type!==1"
|
||||
inactive-color="#ff4949"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
>
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<span @click="removeOilsNode(scope.$index)" class="action-cls">删除</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-col :span="23" class="foot-button">
|
||||
<el-button type="primary" @click="saveFields">保存</el-button>
|
||||
<el-button @click="closeDrawer">取消</el-button>
|
||||
</el-col>
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="showHelp"
|
||||
:modal="false"
|
||||
width="30%"
|
||||
>
|
||||
<json-editor v-model="fieldsJson" class="json-area"></json-editor>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="showHelp = false">返回</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
title="粘贴json"
|
||||
:visible.sync="showPaste"
|
||||
:close-on-click-modal="false"
|
||||
:modal="false"
|
||||
width="30%"
|
||||
>
|
||||
<json-editor v-model="pasteJson" class="json-area"></json-editor>
|
||||
<span slot="footer" class="dialog-footer btn-center">
|
||||
<el-button type="primary" @click="surePaste">确定</el-button>
|
||||
<el-button type="info" @click="showPaste = false">返回</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import companySitePushFieldApi from "../../api/open/companySitePushField";
|
||||
import JsonEditor from "../../components/JsonEditor";
|
||||
import sourceFields from "@/api/open/sourceFields";
|
||||
import handleClipboard from '@/utils/clipboard.js'
|
||||
|
||||
export default {
|
||||
|
||||
props: {
|
||||
pushId: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
name: "PushFieldsSettings",
|
||||
components: {JsonEditor},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
fieldsJson: {},
|
||||
showHelp: false,
|
||||
showPaste: false,
|
||||
pasteJson: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fieldsJson = Object.assign({}, sourceFields)
|
||||
this.getList()
|
||||
},
|
||||
|
||||
computed: {
|
||||
tableHeight() {
|
||||
return (window.innerHeight - 230);
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
// 复制json
|
||||
copyData($event) {
|
||||
let arr = Object.assign([], this.tableData)
|
||||
arr.forEach(v => {
|
||||
v.pushId = null
|
||||
v.id = null
|
||||
})
|
||||
handleClipboard(JSON.stringify(arr), $event)
|
||||
},
|
||||
// 粘贴json
|
||||
pasteData() {
|
||||
this.showPaste = true
|
||||
},
|
||||
|
||||
// 确认粘贴
|
||||
surePaste() {
|
||||
if (!this.pasteJson||this.pasteJson.length<1){
|
||||
this.$confirm('当前json数组为空,是否确认置空', '提示', { type: 'warning' }).then(() => {
|
||||
this.tableData = []
|
||||
this.showPaste = false
|
||||
}).catch(() => {
|
||||
return;
|
||||
})
|
||||
}else{
|
||||
let arr = [...JSON.parse(this.pasteJson)]
|
||||
arr.forEach(v=>v.pushId = this.pushId)
|
||||
this.tableData = arr.sort((a, b) => a.type- b.type)
|
||||
this.showPaste = false
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getList() {
|
||||
companySitePushFieldApi.getListByPushId(this.pushId).then(res => {
|
||||
if (res.code === 20000) {
|
||||
this.tableData = [...res.data]
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
saveFields() {
|
||||
companySitePushFieldApi.saveList(this.tableData).then(res => {
|
||||
if (res.code === 20000) {
|
||||
this.$message.success("保存成功")
|
||||
this.$emit("getPageList")
|
||||
this.closeDrawer()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
closeDrawer() {
|
||||
this.$emit("closeDrawer")
|
||||
},
|
||||
|
||||
// 添加新节点
|
||||
addFieldSiteNode() {
|
||||
this.tableData.push({
|
||||
pushId: this.pushId,
|
||||
type: '1',
|
||||
sourceField: "",
|
||||
targetField: "",
|
||||
computed: "",
|
||||
isOilsArray: "",
|
||||
})
|
||||
},
|
||||
// 添加新节点
|
||||
addFieldOilsNode() {
|
||||
this.tableData.push({
|
||||
pushId: this.pushId,
|
||||
type: 2,
|
||||
sourceField: "",
|
||||
targetField: "",
|
||||
computed: "",
|
||||
isOilsArray: "",
|
||||
})
|
||||
},
|
||||
|
||||
removeOilsNode(index) {
|
||||
this.tableData.splice(index, 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.push-fields-settings {
|
||||
padding: 20px;
|
||||
|
||||
.action-cls {
|
||||
cursor: pointer;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.json-area {
|
||||
font-size: 18px !important;
|
||||
line-height: 2 !important;
|
||||
}
|
||||
|
||||
.foot-button {
|
||||
text-align: center;
|
||||
bottom: 0px;
|
||||
padding: 31px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
/deep/ .el-dialog {
|
||||
float: right;
|
||||
margin-right: 100px;
|
||||
.CodeMirror{
|
||||
height: 500px !important;
|
||||
}
|
||||
|
||||
.el-dialog__footer{
|
||||
padding: 20px;
|
||||
padding-top: 10px;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user