站点配置
This commit is contained in:
parent
7965252432
commit
31d17904de
|
|
@ -104,36 +104,30 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listRole, } from "@/api/system/role";
|
||||
import {
|
||||
getKeeperIds
|
||||
} from "@/api/ma/typeConfigKeeper";
|
||||
export default {
|
||||
name: 'siteConfig',
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
roleIdsKeeper:[],
|
||||
roleIdsRepair:[],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
},
|
||||
// 模拟后端返回的对象数组
|
||||
options: [
|
||||
{ id: 1, name: 'Option 1', check: true },
|
||||
{ id: 2, name: 'Option 2', check: false },
|
||||
{ id: 3, name: 'Option 3', check: true },
|
||||
{ id: 4, name: 'Option 1', check: true },
|
||||
{ id: 5, name: 'Option 2', check: false },
|
||||
{ id: 6, name: 'Option 3', check: true },
|
||||
{ id: 7, name: 'Option 1', check: true },
|
||||
{ id: 8, name: 'Option 2', check: false },
|
||||
{ id: 9, name: 'Option 3', check: true },
|
||||
{ id: 1, name: 'Option 1', check: true },
|
||||
{ id: 2, name: 'Option 2', check: false },
|
||||
{ id: 3, name: 'Option 3', check: true },
|
||||
{ id: 4, name: 'Option 1', check: true },
|
||||
{ id: 5, name: 'Option 2', check: false },
|
||||
{ id: 6, name: 'Option 3', check: true },
|
||||
{ id: 7, name: 'Option 1', check: true },
|
||||
{ id: 8, name: 'Option 2', check: false },
|
||||
{ id: 9, name: 'Option 3', check: true }
|
||||
],
|
||||
options: [],
|
||||
// 记录选中的 id
|
||||
selectedValues: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
watch: {
|
||||
// 监听选中的值变化,更新后端数据
|
||||
selectedValues(newValues) {
|
||||
|
|
@ -145,9 +139,36 @@ export default {
|
|||
// 初始化选中的值,如果需要的话
|
||||
this.selectedValues = this.options
|
||||
.filter(item => item.check) // 过滤出 check 为 true 的选项
|
||||
.map(item => item.id); // 提取选中的 id
|
||||
.map(item => (item.id));
|
||||
console.log('this.selectedValues',this.selectedValues) // 提取选中的 id
|
||||
},
|
||||
methods: {
|
||||
async getList(){
|
||||
const itemName = 'ku_guan_role_ids'
|
||||
await getKeeperIds(itemName).then((response) =>{
|
||||
const roleIds = response.rows[0].itemValue.split(',').map(item => (item))
|
||||
this.roleIdsKeeper = roleIds
|
||||
})
|
||||
await listRole(this.queryParams).then(response=>{
|
||||
const list = response.rows
|
||||
console.log('this.roleIdsKeeper',this.roleIdsKeeper)
|
||||
console.log('this.list',list)
|
||||
this.options=[],
|
||||
list.forEach(item=>{
|
||||
const isChecked = this.roleIdsKeeper.includes((item.roleId));
|
||||
let obj = {'id':item.roleId,'name':item.roleKey,'check': isChecked}
|
||||
if(this.roleIdsKeeper.includes(item.roleId)){
|
||||
this.options.push(obj)
|
||||
}else{
|
||||
this.options.push(obj)
|
||||
}
|
||||
})
|
||||
console.log('this.options',this.options)
|
||||
})
|
||||
},
|
||||
handleQuery(){
|
||||
console.log()
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
if(tab.name == 'first'){
|
||||
// this.resetForm("queryFormOne");
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@
|
|||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
|
|
@ -250,14 +250,14 @@
|
|||
<el-form-item label="所属上级" prop="parentId" >
|
||||
<treeselect
|
||||
v-model="form.parentId"
|
||||
:options="treeList"
|
||||
:options="treeOptions"
|
||||
:normalizer="normalizer"
|
||||
:show-count="true"
|
||||
:searchable="false"
|
||||
:disable-branch-nodes="false"
|
||||
placeholder="选择上级菜单"
|
||||
@select="onSelect"
|
||||
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="名称" prop="label">
|
||||
<el-form-item label="名称" prop="paName">
|
||||
<el-input v-model="form.paName" placeholder="请输入名称" maxlength="20">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -282,7 +282,7 @@
|
|||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="购置价格(元)" prop="buyPrice">
|
||||
<el-form-item label="购置价格(元)" >
|
||||
<el-input v-model="form.buyPrice" placeholder="请输入购置价格" maxlength="20" type="number">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -442,7 +442,8 @@
|
|||
label: 'label',
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
form: {
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
paName: [
|
||||
|
|
@ -543,10 +544,14 @@
|
|||
this.title = '修改'
|
||||
})
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
this.form = {
|
||||
buyPrice: '',
|
||||
remark: '',
|
||||
label: '',
|
||||
parentId: '',
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
|
|
@ -627,40 +632,11 @@
|
|||
this.idTemp = data.id;
|
||||
console.log('dataAdd',data)
|
||||
console.log('idTemp',data)
|
||||
if (data.level === 3) {
|
||||
if (data.level == 2) {
|
||||
this.reset()
|
||||
Object.assign(this.form, data)
|
||||
this.treeTemp=this.treeOptions[0].children,
|
||||
this.treeTemp.forEach(item=>{
|
||||
item.children.forEach(itemTemp=>{
|
||||
if(itemTemp.level==2 && itemTemp.id==data.parentId){
|
||||
this.level2Temp=itemTemp.id
|
||||
this.level2TempName=itemTemp.label
|
||||
this.level1Temp=itemTemp.parentId
|
||||
}
|
||||
})
|
||||
})
|
||||
// console.log('treeTemp',this.treeTemp)
|
||||
this.treeTemp.forEach(item=>{
|
||||
if(item.level==1 && item.id==this.level1Temp){
|
||||
this.level1TempName=item.label
|
||||
}
|
||||
})
|
||||
this.treeTemp.forEach(item=>{
|
||||
if(item.level==0 && item.id==data.houseId){
|
||||
this.level0TempName=item.label
|
||||
}
|
||||
})
|
||||
this.isLevel1Disabled=true
|
||||
this.isLevel2Disabled=true
|
||||
this.isLevel3Disabled=true
|
||||
this.isLevel4Disabled=true
|
||||
this.form.parentId = data.id
|
||||
this.form.houseName = this.level0TempName
|
||||
this.form.itemType = this.level1TempName
|
||||
this.form.materialType = this.level2TempName
|
||||
this.form.materialName = data.label
|
||||
this.open = true
|
||||
this.showHouse = true
|
||||
this.title = '新增'
|
||||
} else {
|
||||
Object.assign(this.addFormParams, data)
|
||||
|
|
|
|||
Loading…
Reference in New Issue