<!--
|
* @Author: lzhe lzhe@example.com
|
* @Date: 2024-03-26 10:28:33
|
* @LastEditors: lzhe lzhe@example.com
|
* @LastEditTime: 2024-05-29 17:32:55
|
* @FilePath: /smart-web/src/views/master/person/main/index.vue
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
-->
|
<template>
|
<div class="aposcope-main">
|
<div class="header">
|
<div class="title">计划显示设置</div>
|
<div class="type">
|
<div class="item last" @click="openPlan">新建计划类型模版</div>
|
<div :class="{item:true, activeTab:index == 0?true:false}" v-for="(item,index) in planData">{{item.templateName}}<span>...</span></div>
|
</div>
|
</div>
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
<el-tab-pane label="新建页设置" name="first">
|
<div>
|
<div class="add-field">+ 添加字段</div>
|
<div class="field-title">基础字段</div>
|
<el-table ref="multipleTableRef" :data="tableData0" border style="width: 100%" class="multipleTableRef">
|
<el-table-column prop="fieldName" label="字段名"></el-table-column>
|
<el-table-column prop="fieldDescription" label="提示文字"></el-table-column>
|
<el-table-column prop="defaultValue" label="默认值"></el-table-column>
|
<el-table-column prop="mustField" label="是否必填"></el-table-column>
|
<el-table-column fixed="right" label="操作">
|
<template #default="scope">
|
<el-button text type="primary" :disabled="scope.row.systemFieldLabel == '是'?true: false" size="small" @click="table_del(scope.row, scope.$index)">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
</el-tab-pane>
|
<el-tab-pane label="编辑页设置" name="second">
|
<div class="add-field">+ 添加字段</div>
|
<div class="field-title">基础字段</div>
|
<el-table ref="multipleTableRef" :data="tableData1" border style="width: 100%" class="multipleTableRef">
|
<el-table-column prop="fieldName" label="字段名"></el-table-column>
|
<el-table-column prop="fieldDescription" label="支持编辑"></el-table-column>
|
<el-table-column fixed="right" label="操作">
|
<template #default="scope">
|
<el-button text type="primary" :disabled="scope.row.systemFieldLabel == '是'?true: false" size="small" @click="table_del(scope.row, scope.$index)">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="field-title">扩展字段</div>
|
</el-tab-pane>
|
<el-tab-pane label="查看页设置" name="third">
|
<div class="field-title">基础字段</div>
|
<el-table ref="multipleTableRef" :data="tableData2" border style="width: 100%" class="multipleTableRef">
|
<el-table-column prop="fieldName" label="字段名"></el-table-column>
|
<el-table-column fixed="right" label="操作">
|
<template #default="scope">
|
<el-button text type="primary" :disabled="scope.row.systemFieldLabel == '是'?true: false" size="small" @click="table_del(scope.row, scope.$index)">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="field-title">扩展字段</div>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
<save-dialog v-if="dialog.save" ref="saveDialog" @success="addPlanSuccess" @closed="dialog.save=false"></save-dialog>
|
</template>
|
<script>
|
import saveDialog from './addPlan'
|
export default {
|
name: "custom",
|
data(){
|
return {
|
dialog: {
|
save: false
|
},
|
planData: [],
|
activeName: "first",
|
tableData0: [],
|
tableData1: [],
|
tableData2: []
|
}
|
},
|
created(){
|
|
},
|
mounted(){
|
this.getBaseData();
|
this.gitProduct();
|
},
|
components: {
|
saveDialog
|
},
|
methods: {
|
gitProduct() {
|
this.$HTTP.get(`/api/blade-cps/product-type/list`).then(res=> {
|
if(res.code == 200) {
|
this.productList= res.data;
|
}
|
})
|
},
|
getBaseData() {
|
this.$HTTP.get(`/api/blade-system/custom-template/list?businessType=${this.$route.query.type}`).then(res=> {
|
if(res.code == 200) {
|
this.planData = res.data.reverse();
|
this.getTableList();
|
}
|
})
|
},
|
getTableList() {
|
this.$HTTP.get(`/api/blade-system/custom-template-field/listField?configType=1&templateId=${this.planData[0].id}`).then(res=> {
|
if(res.code == 200) {
|
this.tableData0 = res.data.systemFieldList;
|
}
|
})
|
},
|
openPlan() {
|
this.dialog.save = true
|
this.$nextTick(() => {
|
this.$refs.saveDialog.open(this.productList,this.planData)
|
})
|
},
|
addPlanSuccess() {
|
this.getBaseData();
|
},
|
table_del(row,index) {
|
|
},
|
handleClick(text) {
|
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.aposcope-main {
|
min-height: 100%;
|
margin: 8px;
|
padding:20px;
|
background: #fff;
|
}
|
.header {
|
margin-bottom: 8px;
|
background-color: #fff;
|
font-size: 14px;
|
font-weight: 700;
|
color: #333;
|
}
|
.title {
|
color: #000;
|
margin-bottom: 21px;
|
}
|
.type {
|
padding-bottom: 15px;
|
display: flex;
|
width: 100%;
|
overflow: auto;
|
}
|
.item {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
color: #409eff;
|
cursor: pointer;
|
padding: 18px 12px;
|
margin-right: 24px;
|
border: 1px solid #ccc;
|
width: 260px;
|
}
|
.activeTab {
|
border: 1px solid #409eff;
|
}
|
.add-field {
|
color: #409eff;
|
font-weight: 400;
|
font-size: 14px;
|
cursor: pointer;
|
padding-left: 8px;
|
margin: 0;
|
}
|
.field-title {
|
font-weight: 700;
|
font-size: 14px;
|
color: #000;
|
margin: 14px 0;
|
}
|
</style>
|