站点配置

This commit is contained in:
jjLv 2024-11-08 14:29:22 +08:00
parent 7965252432
commit 31d17904de
2 changed files with 59 additions and 62 deletions

View File

@ -104,36 +104,30 @@
</template> </template>
<script> <script>
import { listRole, } from "@/api/system/role";
import {
getKeeperIds
} from "@/api/ma/typeConfigKeeper";
export default { export default {
name: 'siteConfig', name: 'siteConfig',
data() { data() {
return { return {
activeName: 'first', activeName: 'first',
roleIdsKeeper:[],
roleIdsRepair:[],
queryParams: {
pageNum: 1,
pageSize: 1000,
},
// //
options: [ 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 }
],
// id // id
selectedValues: [] selectedValues: []
}; };
}, },
created() {
this.getList();
},
watch: { watch: {
// //
selectedValues(newValues) { selectedValues(newValues) {
@ -145,9 +139,36 @@ export default {
// //
this.selectedValues = this.options this.selectedValues = this.options
.filter(item => item.check) // check true .filter(item => item.check) // check true
.map(item => item.id); // id .map(item => (item.id));
console.log('this.selectedValues',this.selectedValues) // id
}, },
methods: { 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) { handleClick(tab, event) {
if(tab.name == 'first'){ if(tab.name == 'first'){
// this.resetForm("queryFormOne"); // this.resetForm("queryFormOne");

View File

@ -114,7 +114,7 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain plain
@ -123,7 +123,7 @@
@click="handleAdd" @click="handleAdd"
>新增</el-button >新增</el-button
> >
</el-col> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
@ -250,14 +250,14 @@
<el-form-item label="所属上级" prop="parentId" > <el-form-item label="所属上级" prop="parentId" >
<treeselect <treeselect
v-model="form.parentId" v-model="form.parentId"
:options="treeList" :options="treeOptions"
:normalizer="normalizer" :normalizer="normalizer"
:show-count="true" :show-count="true"
:searchable="false" :searchable="false"
:disable-branch-nodes="false" :disable-branch-nodes="false"
placeholder="选择上级菜单" placeholder="选择上级菜单"
@select="onSelect" @select="onSelect"
disabled
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -265,7 +265,7 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <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 v-model="form.paName" placeholder="请输入名称" maxlength="20">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -282,7 +282,7 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <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 v-model="form.buyPrice" placeholder="请输入购置价格" maxlength="20" type="number">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -442,7 +442,8 @@
label: 'label', label: 'label',
}, },
// //
form: {}, form: {
},
// //
rules: { rules: {
paName: [ paName: [
@ -543,10 +544,14 @@
this.title = '修改' this.title = '修改'
}) })
}, },
//
reset() { reset() {
this.form = {}; this.form = {
this.resetForm("form"); buyPrice: '',
remark: '',
label: '',
parentId: '',
}
this.resetForm('form')
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
@ -627,40 +632,11 @@
this.idTemp = data.id; this.idTemp = data.id;
console.log('dataAdd',data) console.log('dataAdd',data)
console.log('idTemp',data) console.log('idTemp',data)
if (data.level === 3) { if (data.level == 2) {
this.reset() this.reset()
Object.assign(this.form, data) 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.parentId = data.id
this.form.houseName = this.level0TempName this.showHouse = true
this.form.itemType = this.level1TempName
this.form.materialType = this.level2TempName
this.form.materialName = data.label
this.open = true
this.title = '新增' this.title = '新增'
} else { } else {
Object.assign(this.addFormParams, data) Object.assign(this.addFormParams, data)