站点配置
This commit is contained in:
parent
13714ee18e
commit
e710cbdac0
|
|
@ -1,105 +1,99 @@
|
||||||
<template>
|
<template>
|
||||||
<el-tabs v-model="activeName" @tab-click="handleClick" class="app-container">
|
<el-tabs v-model="activeName" @tab-click="handleClick" class="app-container">
|
||||||
<el-tab-pane label="物资配置" name="first" onclick="handleQuery">
|
<el-tab-pane label="物资配置" name="first">
|
||||||
<div>
|
<div>
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<el-header>库管员配置</el-header>
|
<el-header>库管员配置</el-header>
|
||||||
<el-main>
|
<el-main>
|
||||||
<el-checkbox-group v-model="selectedValues" class="checkbox-group">
|
<el-checkbox-group v-model="selectedValues" class="checkbox-group">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.id"
|
:key="item.roleId"
|
||||||
:label="item.id"
|
:label="item.roleId"
|
||||||
:value="item.id"
|
:value="item.roleId"
|
||||||
:checked="item.check"
|
:checked="item.check"
|
||||||
class="checkbox-item">
|
class="checkbox-item">
|
||||||
{{ item.name }}
|
{{ item.roleKey }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleQuery"
|
@click="handleQuery"
|
||||||
>保存库管员配置</el-button
|
>保存库管员配置</el-button>
|
||||||
>
|
</el-main>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="section">
|
||||||
|
<el-header>维修员配置</el-header>
|
||||||
|
<el-main>
|
||||||
|
<el-checkbox-group v-model="selectedValues" class="checkbox-group">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:checked="item.check"
|
||||||
|
class="checkbox-item">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>保存维修员配置</el-button
|
||||||
|
>
|
||||||
|
</el-main>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
<!-- <el-tab-pane label="新购配置" name="second" >
|
||||||
|
<div>
|
||||||
|
<div class="app-container">
|
||||||
|
<h4 class="form-header h4">库管员配置</h4>
|
||||||
|
<el-main>
|
||||||
|
<el-checkbox-group v-model="selectedValues">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:checked="item.check"
|
||||||
|
class="checkbox-item">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>保存库管员配置</el-button
|
||||||
|
>
|
||||||
|
</el-main>
|
||||||
|
</div>
|
||||||
|
<div class="app-container">
|
||||||
|
<h4 class="form-header h4">维修员配置</h4>
|
||||||
|
<el-main>
|
||||||
|
<el-checkbox-group v-model="selectedValues">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:checked="item.check"
|
||||||
|
class="checkbox-item">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<el-button type="primary" icon="el-icon-plus" size="mini"
|
||||||
|
@click="handleQuery">保存维修员2配置</el-button>
|
||||||
</el-main>
|
</el-main>
|
||||||
</div>
|
</div>
|
||||||
<div class="section">
|
</div>
|
||||||
<el-header>维修员配置</el-header>
|
</el-tab-pane> -->
|
||||||
<el-main>
|
|
||||||
<el-checkbox-group v-model="selectedValues" class="checkbox-group">
|
|
||||||
<el-checkbox
|
|
||||||
v-for="item in options"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.id"
|
|
||||||
:value="item.id"
|
|
||||||
:checked="item.check"
|
|
||||||
class="checkbox-item">
|
|
||||||
{{ item.name }}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleQuery"
|
|
||||||
>保存维修员配置</el-button
|
|
||||||
>
|
|
||||||
</el-main>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="新购配置" name="second" >
|
|
||||||
<div>
|
|
||||||
<div class="app-container">
|
|
||||||
<h4 class="form-header h4">库管员配置</h4>
|
|
||||||
<el-main>
|
|
||||||
<el-checkbox-group v-model="selectedValues">
|
|
||||||
<el-checkbox
|
|
||||||
v-for="item in options"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.id"
|
|
||||||
:value="item.id"
|
|
||||||
:checked="item.check"
|
|
||||||
class="checkbox-item">
|
|
||||||
{{ item.name }}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleQuery"
|
|
||||||
>保存库管员配置</el-button
|
|
||||||
>
|
|
||||||
</el-main>
|
|
||||||
</div>
|
|
||||||
<div class="app-container">
|
|
||||||
<h4 class="form-header h4">维修员配置</h4>
|
|
||||||
<el-main>
|
|
||||||
<el-checkbox-group v-model="selectedValues">
|
|
||||||
<el-checkbox
|
|
||||||
v-for="item in options"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.id"
|
|
||||||
:value="item.id"
|
|
||||||
:checked="item.check"
|
|
||||||
class="checkbox-item">
|
|
||||||
{{ item.name }}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleQuery"
|
|
||||||
>保存维修员2配置</el-button
|
|
||||||
>
|
|
||||||
</el-main>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -137,37 +131,29 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 初始化选中的值,如果需要的话
|
// 初始化选中的值,如果需要的话
|
||||||
this.selectedValues = this.options
|
// this.selectedValues = this.options
|
||||||
.filter(item => item.check) // 过滤出 check 为 true 的选项
|
// .filter(item => item.check) // 过滤出 check 为 true 的选项
|
||||||
.map(item => (item.id));
|
// .map(item => (item.id));
|
||||||
console.log('this.selectedValues',this.selectedValues) // 提取选中的 id
|
// console.log('this.selectedValues',this.selectedValues) // 提取选中的 id
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getList(){
|
async getList(){
|
||||||
const itemName = 'ku_guan_role_ids'
|
const itemName = 'ku_guan_role_ids'
|
||||||
await getKeeperIds(itemName).then((response) =>{
|
await getKeeperIds(itemName).then((response) =>{
|
||||||
const roleIds = response.rows[0].itemValue.split(',').map(item => (item))
|
const roleIds = response.rows[0].itemValue.split(',').map(item => Number(item))
|
||||||
this.roleIdsKeeper = roleIds
|
this.roleIdsKeeper = roleIds
|
||||||
})
|
})
|
||||||
await listRole(this.queryParams).then(response=>{
|
await listRole(this.queryParams).then(response=>{
|
||||||
const list = response.rows
|
const list = response.rows
|
||||||
console.log('this.roleIdsKeeper',this.roleIdsKeeper)
|
console.log('this.roleIdsKeeper',this.roleIdsKeeper)
|
||||||
console.log('this.list',list)
|
console.log('this.list',list)
|
||||||
this.options=[],
|
this.options=list
|
||||||
list.forEach(item=>{
|
this.selectedValues = this.roleIdsKeeper
|
||||||
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)
|
console.log('this.options',this.options)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleQuery(){
|
handleQuery(){
|
||||||
console.log()
|
console.log(this.selectedValues)
|
||||||
},
|
},
|
||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
if(tab.name == 'first'){
|
if(tab.name == 'first'){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue