风控bug代码优化:基础指标,SQL指标,常量指标,衍生指标页面

This commit is contained in:
admin
2025-01-15 10:33:21 +08:00
parent 0430e8d010
commit ca6466d59a
5 changed files with 299 additions and 244 deletions

View File

@@ -2,8 +2,7 @@
<template> <template>
<div class="cont_cont"> <div class="cont_cont">
<!-- <div class="cont_left" v-loading="leftloading">
<!-- <div class="cont_left" v-loading="leftloading">
<div class="cont_header"> <div class="cont_header">
<p class="cont_header_title">{{title}}</p> <p class="cont_header_title">{{title}}</p>
<p class="cont_header_subtitle">{{title}}</p> <p class="cont_header_subtitle">{{title}}</p>
@@ -15,21 +14,27 @@
@updatafilelist="updatafilelist" @delectFun="delectFun"> @updatafilelist="updatafilelist" @delectFun="delectFun">
</fileHome> </fileHome>
</div> </div>
</div>--> </div> -->
<div class="cont_right" v-loading="contloading" @click="tempHintLeft=null;tempHintTop=null;"> <div
class="cont_right"
v-loading="contloading"
@click="tempHintLeft = null; tempHintTop = null;">
<div v-if="!listRedact" class="search-form"> <div v-if="!listRedact" class="search-form">
<el-form :model="searchForm" label-width="100px"> <el-form :model="searchForm" label-width="100px">
<el-row :gutter="20"> <el-row :gutter="20">
<!-- 用户名查询 --> <!-- 用户名查询 -->
<el-col :span="6" v-for="item in getSearch"> <el-col :span="6" v-for="item in getSearch" :key="item.name">
<el-form-item :label="item.name"> <el-form-item :label="item.name">
<el-input v-if="item.type==='1'" v-model="searchForm[item.key]" placeholder="请输入用户名"></el-input> <el-input
v-if="item.type==='1'"
v-model="searchForm[item.key]"
placeholder="请输入用户名"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 角色查询 --> <!-- 角色查询 -->
<!-- <el-col :span="6"> <!-- <el-col :span="6">
<el-form-item label="字段中文名"> <el-form-item label="字段中文名">
<el-input v-model="searchForm.username" placeholder="请输入用户名"></el-input> <el-input v-model="searchForm.username" placeholder="请输入用户名"></el-input>
</el-form-item> </el-form-item>
@@ -53,7 +58,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>--> </el-row> -->
<!-- 查询和重置按钮放在一行 --> <!-- 查询和重置按钮放在一行 -->
<el-row> <el-row>
<el-col :span="24" class="button-container"> <el-col :span="24" class="button-container">
@@ -66,25 +71,40 @@
</el-form> </el-form>
</div> </div>
<div v-if="!listRedact"> <div v-if="!listRedact">
<div v-if="showRight===false" class="cont_right_hint"> <div v-if="showRight === false" class="cont_right_hint">
请先选择左侧文件夹 请先选择左侧文件夹
</div> </div>
<div v-else> <div v-else>
<div class="cont_right_top"> <div class="cont_right_top">
<div> <div>
<!-- <el-button typeof="primary" @click="listRedact=true" :disabled="currid!=99999999?false:'disabled'">新增</el-button>--> <!-- <el-button typeof="primary" @click="listRedact=true" :disabled="currid!=99999999?false:'disabled'">新增</el-button> -->
<el-button type="primary" @click="listRedact=true">新增</el-button> <el-button type="primary" @click="listRedact=true">新增</el-button>
<el-button type="danger" @click="using(-1)" :disabled="this.selection.length>0?false:'disabled'">删除</el-button> <el-button type="danger" @click="using(-1)" :disabled="this.selection.length>0?false:'disabled'">删除</el-button>
<el-button type="success" @click="using(1)" :disabled="this.selection.length>0?false:'disabled'">启用</el-button> <el-button type="success" @click="using(1)" :disabled="this.selection.length>0?false:'disabled'">启用</el-button>
<el-button type="warning" @click="using(0)" :disabled="this.selection.length>0?false:'disabled'">停用</el-button> <el-button type="warning" @click="using(0)" :disabled="this.selection.length>0?false:'disabled'">停用</el-button>
<!-- <el-select v-model="tempMove" placeholder="移动到:" style="margin-left: 10px;" :disabled="this.selection.length>0?false:'disabled'" filterable @change="mixinMoveChange"> --> <!-- <el-select
<!-- <el-select v-model="tempMove" placeholder="移动到:" style="margin-left: 10px;" :disabled="this.selection.length>0?false:'disabled'" v-model="tempMove"
filterable @change="moveChange"> placeholder="移动到:"
<el-option v-for="value in listunfold" :key="value.id" :label="value.name" :value="value.id" v-show="value.id!=99999999"></el-option> style="margin-left: 10px;"
</el-select>--> :disabled="this.selection.length > 0 ? false : 'disabled'"
filterable
@change="mixinMoveChange"> -->
<!-- <el-select
v-model="tempMove"
placeholder="移动到:"
style="margin-left: 10px;"
:disabled="this.selection.length > 0 ? false : 'disabled'"
filterable @change="moveChange">
<el-option
v-for="value in listunfold"
:key="value.id"
:label="value.name"
:value="value.id"
v-show="value.id != 99999999"></el-option>
</el-select> -->
<!-- 断点 准备移动 --> <!-- 断点 准备移动 -->
</div> </div>
<div v-if="getData.type==1"> <div v-if="getData.type == 1">
<el-button @click="upShow=true">批量导入</el-button> <el-button @click="upShow=true">批量导入</el-button>
<el-button @click="down">模板下载</el-button> <el-button @click="down">模板下载</el-button>
</div> </div>
@@ -95,26 +115,35 @@
:cell-style="{padding: '10px'}"> :cell-style="{padding: '10px'}">
<el-table-column type="selection" width="70"> <el-table-column type="selection" width="70">
</el-table-column> </el-table-column>
<el-table-column v-for="item in getData.row" :key="item.id" :prop="item.row" :label="item.label" align="center"> <el-table-column
v-for="item in getData.row"
:key="item.id"
:prop="item.row"
:label="item.label"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.type==='Blooen'"> <span v-if="item.type === 'Blooen'">{{ scope.row[item.row] ? "是" : "否" }}</span>
{{scope.row[item.row]?"":""}} <span v-else-if="item.type === 'State'">{{ scope.row[item.row] == "1" ? '启用' : '未启用' }}</span>
</span> <span v-else-if="item.type === 'type'">
<span v-else-if="item.type==='State'"> {{ scope.row[item.row] == "1"
{{scope.row[item.row]=="1"?'启用':'未启用'}} ? '数值型' : (scope.row[item.row] == "2"
</span> ? '字符型' : (scope.row[item.row] == "3"
<span v-else-if="item.type==='type'"> ? '枚举型' : (scope.row[item.row] == "4"
{{scope.row[item.row]=="1"?'':(scope.row[item.row]=="2"?'字符型':(scope.row[item.row]=="3"?'枚举型':(scope.row[item.row]=="4"?'小数型':(scope.row[item.row]=="5"?'数组型':(scope.row[item.row]=="6"?'JSON型':'')))))}} ? '数型' : (scope.row[item.row] == "5"
</span> ? '数组型' : (scope.row[item.row] == "6"
<span v-else-if="item.fn"> ? 'JSON型' : '')))))}}
{{item.fn(scope.row[item.row])}}
</span>
<span v-else-if="item.type==='Time'" style="white-space: nowrap;" class="contText">{{
new Date(scope.row[item.row]).toLocaleDateString().replace(/\//g, "-") + " " + new Date(scope.row[item.row]).toTimeString().substr(0, 8)
}}</span>
<span class="contText" v-else>
{{scope.row[item.row]}}
</span> </span>
<span v-else-if="item.fn">{{ item.fn(scope.row[item.row]) }}</span>
<span
v-else-if="item.type === 'Time'"
style="white-space: nowrap;"
class="contText">
{{ new Date(scope.row[item.row]).toLocaleDateString().replace(/\//g, "-")
+ " " +
new Date(scope.row[item.row]).toTimeString().substr(0, 8)
}}
</span>
<span class="contText" v-else>{{ scope.row[item.row] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" size="s"> <el-table-column label="操作" align="center" size="s">
@@ -123,29 +152,43 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination style="float: right;margin-right: 40px;margin-top: 40px;" :current-page="currPage" <el-pagination
@current-change="clickpage" background layout="prev, pager, next" :total="data.data.pager.total"> style="float: right; margin-right: 40px; margin-top: 40px;"
:current-page="currPage"
@current-change="clickpage"
background
layout="prev, pager, next"
:total="data.data.pager.total">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<template v-else> <template v-else>
<dataManageRedact @close="listRedact=false;tempRedactId=0" @Ok="listRedact=false;tempRedactId=0;getlist();currPage=1" <dataManageRedact
:updata="getData.updatafield" :id='tempRedactId' :fieldTypeId="currid" :setsave="getData.setsave" :getInfo="getData.getInfo" @close="listRedact=false;tempRedactId=0"
@Ok="listRedact=false;tempRedactId=0;getlist();currPage=1"
:updata="getData.updatafield"
:id='tempRedactId'
:fieldTypeId="currid"
:setsave="getData.setsave"
:getInfo="getData.getInfo"
:ftype="getData.type"></dataManageRedact> :ftype="getData.type"></dataManageRedact>
</template> </template>
</div> </div>
<el-dialog title="上传文件" :visible.sync="upShow" width="30%" :before-close="upShowClose"> <el-dialog title="上传文件" :visible.sync="upShow" width="30%" :before-close="upShowClose">
<div style="margin: 0 auto;display: flex;justify-content: center;"> <div style="margin: 0 auto;display: flex;justify-content: center;">
<el-upload class="upload-demo" ref="upload" action="doUpload" :limit="1" :file-list="fileList" :before-upload="beforeUpload" <el-upload
v-loading="Uploadloading"> class="upload-demo"
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> ref="upload" action="doUpload"
<div slot="tip" class="el-upload__tip">只能上传excel文件且不超过5MB</div> :limit="1"
<div slot="tip" class="el-upload-list__item-name">{{fileName}}</div> :file-list="fileList"
:before-upload="beforeUpload"
v-loading="Uploadloading">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<div slot="tip" class="el-upload__tip">只能上传excel文件且不超过5MB</div>
<div slot="tip" class="el-upload-list__item-name">{{fileName}}</div>
</el-upload> </el-upload>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@@ -169,6 +212,7 @@
mixins: [ mixins: [
contmixin contmixin
], ],
components: { components: {
fileHome, fileHome,
dataManageRedact, dataManageRedact,
@@ -189,8 +233,8 @@
type: Array, type: Array,
default: null default: null
}, },
}, },
watch: { watch: {
list() { list() {
if (this.list.length > 0) { if (this.list.length > 0) {
@@ -198,6 +242,7 @@
} }
} }
}, },
data() { data() {
return { return {
list: [], list: [],
@@ -222,6 +267,7 @@
searchForm: {} searchForm: {}
} }
}, },
created() { created() {
this.getData.getTree({ this.getData.getTree({
type: this.getData.type type: this.getData.type
@@ -230,6 +276,7 @@
this.clickCurrid(99999999) this.clickCurrid(99999999)
}) })
}, },
methods: { methods: {
moveChange(e) { //移动文件夹 moveChange(e) { //移动文件夹
let arr = this.selection.map((value) => { let arr = this.selection.map((value) => {
@@ -255,7 +302,6 @@
}) })
this.tempMove = "" this.tempMove = ""
}, },
down() { down() {
window.open(window.origin + '/Riskmanage/v2/datamanage/field/downTemplate') window.open(window.origin + '/Riskmanage/v2/datamanage/field/downTemplate')
}, },
@@ -275,12 +321,9 @@
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
}); });
this.deepGetCurr(id, this.list, (value, item, index) => { this.deepGetCurr(id, this.list, (value, item, index) => {
item.splice(index, 1) item.splice(index, 1)
}) })
} }
this.leftloading = false this.leftloading = false
this.currid = 99999999 this.currid = 99999999
@@ -294,7 +337,6 @@
updatafilelist(params) { updatafilelist(params) {
this.leftloading = true this.leftloading = true
let tempNum = null let tempNum = null
this.deepGetCurr(params.id, this.list, (value) => { this.deepGetCurr(params.id, this.list, (value) => {
tempNum = value.parentId tempNum = value.parentId
}) })
@@ -324,8 +366,6 @@
this.leftloading = false this.leftloading = false
}) })
}, },
getlist() { getlist() {
this.contloading = true this.contloading = true
this.listRedact = false this.listRedact = false
@@ -338,7 +378,6 @@
this.data = res this.data = res
this.contloading = false this.contloading = false
}) })
}, },
clickpage(e) { clickpage(e) {
this.currPage = e this.currPage = e
@@ -357,7 +396,6 @@
}) })
}, },
using(id) { using(id) {
let arr = this.selection.map((value) => { let arr = this.selection.map((value) => {
return value.id return value.id
}) })
@@ -365,23 +403,58 @@
this.$message.error('未选择任何文件'); this.$message.error('未选择任何文件');
return return
} }
let params = {
status: id,
ids: arr.join(','),
fieldTypeId: this.currid
}
this.getData.fieldusing(params).then(res => { const operations = {
if (res.status == "1") { '-1': '删除',
this.$message({ '1': '启用',
message: '操作成功', '0': '停用'
type: 'success' };
}); let operationText = operations[id.toString()] || '未知操作';
this.getlist()
this.selection = [] this.$confirm(`此操作将永久${operationText}, 是否继续?`, '提示', {
this.$store.dispatch('reGetfielduser') confirmButtonText: '确定',
} cancelButtonText: '取消',
}) type: 'warning'
}).then(() => {
let params = {
status: id,
ids: arr.join(','),
fieldTypeId: this.currid
}
this.getData.fieldusing(params).then(res => {
if (res.status == "1") {
this.$message({
message: '操作成功',
type: 'success'
});
this.getlist()
this.selection = []
this.$store.dispatch('reGetfielduser')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: `已取消${operationText}`
});
});
// let params = {
// status: id,
// ids: arr.join(','),
// fieldTypeId: this.currid
// }
// this.getData.fieldusing(params).then(res => {
// if (res.status == "1") {
// this.$message({
// message: '操作成功',
// type: 'success'
// });
// this.getlist()
// this.selection = []
// this.$store.dispatch('reGetfielduser')
// }
// })
}, },
newFileSure() { newFileSure() {
this.leftloading = true this.leftloading = true
@@ -397,10 +470,13 @@
} }
this.mixnewFileSure(params) this.mixnewFileSure(params)
} },
handleSearch() {
},
handleReset() {
},
} }
} }
</script> </script>

View File

@@ -1,17 +1,22 @@
<template> <template>
<div> <div>
<cont title="指标管理" :getData="getDataFun"></cont> <cont title="指标管理" :getData="getDataFun"></cont>
</div> </div>
</template> </template>
<script> <script>
import cont from '@/components/common/cont.vue' import cont from '@/components/common/cont.vue'
import { import {
getfieldList,addfieldList,getfieldListTree,updatafieldList,getfieldsave,getfieldInfo,updatafield,fieldusing,fielddownTemplate,fieldupdata getfieldList,
addfieldList,
getfieldListTree,
updatafieldList,
getfieldsave,
getfieldInfo,
updatafield,
fieldusing,
fielddownTemplate,
fieldupdata,
} from '@/api/index.js' } from '@/api/index.js'
export default { export default {
@@ -23,31 +28,33 @@
return { return {
getDataFun: { getDataFun: {
type:1, type:1,
row: [ { row: [
label: '序号', {
row: 'id' label: '序号',
}, { row: 'id'
label: '字段名称', }, {
row: 'fieldEn' label: '字段名称',
}, { row: 'fieldEn'
label: '字段中文名', }, {
row: 'fieldCn' label: '字段中文名',
}, { row: 'fieldCn'
label: '字段类型', }, {
row: 'valueType', label: '字段类型',
type: 'type' row: 'valueType',
}, { type: 'type'
label: '状态', }, {
row: 'status', label: '状态',
type: 'State' row: 'status',
}, { type: 'State'
label: '创建人', }, {
row: 'nickName' label: '创建人',
},{ row: 'nickName'
label: '创建时间', }, {
row: 'created', label: '创建时间',
type: 'Time' row: 'created',
} ], type: 'Time'
}
],
redact: "dataManageRedact", redact: "dataManageRedact",
async getTree(e){ async getTree(e){
return await getfieldListTree(e).then(res => { return await getfieldListTree(e).then(res => {
@@ -66,44 +73,36 @@
}) })
}, },
async updatalist(e) { async updatalist(e) {
return await updatafieldList(e).then(res => { return await updatafieldList(e).then(res => {
return res return res
}) })
}, },
async setsave(e) { async setsave(e) {
return await getfieldsave(e).then(res => { return await getfieldsave(e).then(res => {
return res return res
}) })
}, },
async getInfo(e) { async getInfo(e) {
// console.log(e)
return await getfieldInfo(e).then(res => { return await getfieldInfo(e).then(res => {
return res return res
}) })
}, },
async updatafield(e) { async updatafield(e) {
return await updatafield(e).then(res => { return await updatafield(e).then(res => {
return res return res
}) })
}, },
async fieldusing(e) { async fieldusing(e) {
return await fieldusing(e).then(res => { return await fieldusing(e).then(res => {
return res return res
}) })
}, },
async down(e) { async down(e) {
return await fielddownTemplate(e).then(res => { return await fielddownTemplate(e).then(res => {
return res return res
}) })
}, },
async fieldsubmit(e) { async fieldsubmit(e) {
return await fieldupdata(e).then(res => { return await fieldupdata(e).then(res => {
return res return res
}) })
@@ -113,7 +112,3 @@
} }
}; };
</script> </script>
<style>
</style>

View File

@@ -28,31 +28,33 @@
return { return {
getDataFun: { getDataFun: {
type: 3, type: 3,
row: [{ row: [
label: '序号', {
row: 'id' label: '序号',
}, { row: 'id'
label: '字段名称', }, {
row: 'fieldEn' label: '字段名称',
}, { row: 'fieldEn'
label: '字段中文名', }, {
row: 'fieldCn' label: '字段中文名',
}, { row: 'fieldCn'
label: '字段类型', }, {
row: 'valueType', label: '字段类型',
type:'type' row: 'valueType',
}, { type:'type'
label: '状态', }, {
row: 'status', label: '状态',
type: 'State' row: 'status',
}, { type: 'State'
label: '创建人', }, {
row: 'nickName' label: '创建人',
}, { row: 'nickName'
label: '创建时间', }, {
row: 'created', label: '创建时间',
type: 'Time' row: 'created',
}, ], type: 'Time'
}
],
redact: "dataManageRedact", redact: "dataManageRedact",
async getTree(e){ async getTree(e){
return await getfieldListTree(e).then(res => { return await getfieldListTree(e).then(res => {
@@ -66,49 +68,41 @@
}) })
}, },
async addlist(e) { async addlist(e) {
return await addfieldList(e).then(res => { return await addfieldList(e).then(res => {
return res return res
}) })
}, },
async updatalist(e) { async updatalist(e) {
return await updatafieldList(e).then(res => { return await updatafieldList(e).then(res => {
return res return res
}) })
}, },
async setsave(e) { async setsave(e) {
return await getfieldsave(e).then(res => { return await getfieldsave(e).then(res => {
return res return res
}) })
}, },
async getInfo(e) { async getInfo(e) {
return await getfieldInfo(e).then(res => { return await getfieldInfo(e).then(res => {
return res return res
}) })
}, },
async updatafield(e) { async updatafield(e) {
return await updatafield(e).then(res => { return await updatafield(e).then(res => {
return res return res
}) })
}, },
async fieldusing(e) { async fieldusing(e) {
return await fieldusing(e).then(res => { return await fieldusing(e).then(res => {
return res return res
}) })
}, },
async down(e) { async down(e) {
return await fielddownTemplate(e).then(res => { return await fielddownTemplate(e).then(res => {
return res return res
}) })
}, },
async fieldsubmit(e) { async fieldsubmit(e) {
return await fieldupdata(e).then(res => { return await fieldupdata(e).then(res => {
return res return res
}) })
@@ -118,7 +112,3 @@
} }
}; };
</script> </script>
<style>
</style>

View File

@@ -1,17 +1,22 @@
<template> <template>
<div> <div>
<cont title="数据源指标" :getData="getDataFun"></cont> <cont title="数据源指标" :getData="getDataFun"></cont>
</div> </div>
</template> </template>
<script> <script>
import cont from '@/components/common/cont.vue' import cont from '@/components/common/cont.vue'
import { import {
getfieldList,addfieldList,getfieldListTree,updatafieldList,getfieldsave,getfieldInfo,updatafield,fieldusing,fielddownTemplate,fieldupdata getfieldList,
addfieldList,
getfieldListTree,
updatafieldList,
getfieldsave,
getfieldInfo,
updatafield,
fieldusing,
fielddownTemplate,
fieldupdata
} from '@/api/index.js' } from '@/api/index.js'
export default { export default {
@@ -24,39 +29,40 @@
return { return {
getDataFun: { getDataFun: {
type:2, type:2,
row: [ { row: [
label: '序号', {
row: 'id' label: '序号',
}, { row: 'id'
label: '字段名称', }, {
row: 'fieldEn' label: '字段名称',
}, { row: 'fieldEn'
label: '字段中文名', }, {
row: 'fieldCn' label: '字段中文名',
}, { row: 'fieldCn'
label: '数据源类型', }, {
row: 'dataSourceId', label: '数据源类型',
fn:(res)=>{ row: 'dataSourceId',
let obj = this.$store.state.Sourcelist.find(x=>x.id==res) fn: (res) => {
return obj&&obj.type let obj = this.$store.state.Sourcelist.find(x=>x.id == res)
}, return obj && obj.type
},
}, { }, {
label: '字段类型', label: '字段类型',
row: 'valueType', row: 'valueType',
type:'type' type:'type'
}, { }, {
label: '状态', label: '状态',
row: 'status', row: 'status',
type:'State' type:'State'
}, { }, {
label: '创建人', label: '创建人',
row: 'nickName' row: 'nickName'
},{ },{
label: '创建时间', label: '创建时间',
row: 'created', row: 'created',
type:'Time' type:'Time'
},], }
],
redact:"dataManageRedact", redact:"dataManageRedact",
async getTree(e){ async getTree(e){
return await getfieldListTree(e).then(res => { return await getfieldListTree(e).then(res => {
@@ -70,49 +76,41 @@
}) })
}, },
async addlist(e) { async addlist(e) {
return await addfieldList(e).then(res => { return await addfieldList(e).then(res => {
return res return res
}) })
}, },
async updatalist(e) { async updatalist(e) {
return await updatafieldList(e).then(res => { return await updatafieldList(e).then(res => {
return res return res
}) })
}, },
async setsave(e) { async setsave(e) {
return await getfieldsave(e).then(res => { return await getfieldsave(e).then(res => {
return res return res
}) })
}, },
async getInfo(e){ async getInfo(e){
return await getfieldInfo(e).then(res=>{ return await getfieldInfo(e).then(res=>{
return res return res
}) })
}, },
async updatafield(e){ async updatafield(e){
return await updatafield(e).then(res=>{ return await updatafield(e).then(res=>{
return res return res
}) })
}, },
async fieldusing(e){ async fieldusing(e){
return await fieldusing(e).then(res=>{ return await fieldusing(e).then(res=>{
return res return res
}) })
}, },
async down(e){ async down(e){
return await fielddownTemplate(e).then(res=>{ return await fielddownTemplate(e).then(res=>{
return res return res
}) })
}, },
async fieldsubmit(e){ async fieldsubmit(e){
return await fieldupdata(e).then(res=>{ return await fieldupdata(e).then(res=>{
return res return res
}) })

View File

@@ -1,17 +1,22 @@
<template> <template>
<div> <div>
<cont title="常量指标" :getData="getDataFun" :getSearch="getSearchForm"></cont> <cont title="常量指标" :getData="getDataFun" :getSearch="getSearchForm"></cont>
</div> </div>
</template> </template>
<script> <script>
import cont from '@/components/common/cont.vue' import cont from '@/components/common/cont.vue'
import { import {
getfieldList,addfieldList,getfieldListTree,updatafieldList,getfieldsave,getfieldInfo,updatafield,fieldusing,fielddownTemplate,fieldupdata getfieldList,
addfieldList,
getfieldListTree,
updatafieldList,
getfieldsave,
getfieldInfo,
updatafield,
fieldusing,
fielddownTemplate,
fieldupdata
} from '@/api/index.js' } from '@/api/index.js'
export default { export default {
@@ -24,31 +29,33 @@
return { return {
getDataFun: { getDataFun: {
type:5, type:5,
row: [ { row: [
label: '序号', {
row: 'id' label: '序号',
}, { row: 'id'
label: '字段名称', }, {
row: 'fieldEn' label: '字段名称',
}, { row: 'fieldEn'
label: '字段中文名', }, {
row: 'fieldCn' label: '字段中文名',
}, { row: 'fieldCn'
label: '字段类型', }, {
row: 'valueType', label: '字段类型',
type: 'type' row: 'valueType',
}, { type: 'type'
label: '状态', }, {
row: 'status', label: '状态',
type: 'State' row: 'status',
}, { type: 'State'
label: '创建人', }, {
row: 'nickName' label: '创建人',
},{ row: 'nickName'
label: '创建时间', },{
row: 'created', label: '创建时间',
type: 'Time' row: 'created',
} ], type: 'Time'
}
],
redact:"dataManageRedact", redact:"dataManageRedact",
async getTree(e){ async getTree(e){
return await getfieldListTree(e).then(res => { return await getfieldListTree(e).then(res => {
@@ -62,49 +69,41 @@
}) })
}, },
async addlist(e) { async addlist(e) {
return await addfieldList(e).then(res => { return await addfieldList(e).then(res => {
return res return res
}) })
}, },
async updatalist(e) { async updatalist(e) {
return await updatafieldList(e).then(res => { return await updatafieldList(e).then(res => {
return res return res
}) })
}, },
async setsave(e) { async setsave(e) {
return await getfieldsave(e).then(res => { return await getfieldsave(e).then(res => {
return res return res
}) })
}, },
async getInfo(e){ async getInfo(e){
return await getfieldInfo(e).then(res=>{ return await getfieldInfo(e).then(res=>{
return res return res
}) })
}, },
async updatafield(e){ async updatafield(e){
return await updatafield(e).then(res=>{ return await updatafield(e).then(res=>{
return res return res
}) })
}, },
async fieldusing(e){ async fieldusing(e){
return await fieldusing(e).then(res=>{ return await fieldusing(e).then(res=>{
return res return res
}) })
}, },
async down(e){ async down(e){
return await fielddownTemplate(e).then(res=>{ return await fielddownTemplate(e).then(res=>{
return res return res
}) })
}, },
async fieldsubmit(e){ async fieldsubmit(e){
return await fieldupdata(e).then(res=>{ return await fieldupdata(e).then(res=>{
return res return res
}) })
@@ -134,14 +133,11 @@
], ],
}; };
} }
}; };
</script> </script>
<style> <style>
.button-container { .button-container {
text-align: right; /* 使按钮右对齐 */ text-align: right; /* 使按钮右对齐 */
} }
</style> </style>