指标样式优化

This commit is contained in:
zhujida 2021-01-13 10:54:56 +08:00
parent 188137e06b
commit 8ac1977c61
3 changed files with 67 additions and 23 deletions

View File

@ -57,7 +57,11 @@ export default {
} else { } else {
this.activeIndex = '' this.activeIndex = ''
} }
if (this.auth.evaluationSet && this.auth.roleSet) this.activeIndex = this.$route.query.activeIndex || '0' if (this.auth.evaluationSet && this.auth.roleSet) {
this.activeIndex = this.$route.query.activeIndex || '0'
} else {
this.activeIndex = this.$route.query.activeIndex
}
}, },
beforeMount () { }, beforeMount () { },
mounted () { }, mounted () { },

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="add-target commonFont"> <div class="add-target commonFont">
<el-form <el-form
ref="form" ref="formTarget"
:model="formData" :model="formData"
size="small" size="small"
label-width="200px" label-width="200px"
@ -25,10 +25,11 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="targetType">
prop="targetType" <div
> slot="label"
<div slot="label" style="margin-left:10px;">指标类型</div> style="margin-left:10px;"
>指标类型</div>
<el-radio-group v-model="formData.targetType"> <el-radio-group v-model="formData.targetType">
<el-radio <el-radio
v-for="item in targetRadioList" v-for="item in targetRadioList"
@ -46,27 +47,39 @@
placeholder="请输入指标名称" placeholder="请输入指标名称"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="standard">
prop="standard" <div
> slot="label"
<div slot="label" style="margin-left:10px;">考核标准</div> style="margin-left:10px;"
>考核标准</div>
<el-input <el-input
type="textarea" type="textarea"
v-model="formData.standard" v-model="formData.standard"
placeholder="请输入指标名称" placeholder="请输入指标名称"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item prop="weight">
<div slot="label" style="margin-left:10px;">权重</div> <div
slot="label"
style="margin-left:10px;"
>权重</div>
<el-input <el-input
type="number" type="number"
v-model="formData.targetName" v-model="formData.weight"
placeholder="请输入指标名称" placeholder="请输入指标名称"
> >
<el-button slot="append">%</el-button>
</el-input> </el-input>
<div class="comonPromptFont">权重设置为0时此指标将不参与运算</div>
</el-form-item>
<el-form-item label=" ">
<el-button
type="primary"
@click="handleSaveSet"
>保存设置</el-button>
</el-form-item> </el-form-item>
<el-form-item label=" "><el-button type="primary" @click="handleSaveSet">保存设置</el-button></el-form-item>
</el-form> </el-form>
</div> </div>
@ -75,7 +88,14 @@
export default { export default {
methods: { methods: {
handleSaveSet () { handleSaveSet () {
this.$refs.formTarget.validate((valid) => {
if (valid) {
alert('submit!')
} else {
console.log('error submit!!')
return false
}
})
} }
}, },
data () { data () {

View File

@ -14,7 +14,7 @@
placeholder="搜索指标" placeholder="搜索指标"
style="width:200px;" style="width:200px;"
size="small" size="small"
:value="headerSearchValue" v-model="headerSearchValue"
@change="handleHeaderSearch" @change="handleHeaderSearch"
></el-input> ></el-input>
</el-col> </el-col>
@ -63,14 +63,19 @@
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-dropdown @command="handleClasseDropdown"> <el-dropdown @command="handleClasseDropdown">
<el-button type="text">...</el-button> <div
style="width:40px;height:23px;"
class="el-dropdown-link"
@mousemove="selectedMenuRowIndex=scope.$index"
@mouseout="selectedMenuRowIndex=-1"
>{{selectedMenuRowIndex===scope.$index?'...':' '}}</div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item <el-dropdown-item
:command="{obj:scope.row,type:0}" :command="{obj:scope.row,type:0}"
icon="el-icon-edit" icon="el-icon-edit"
>编辑</el-dropdown-item> >编辑</el-dropdown-item>
<el-dropdown-item <el-dropdown-item
:command="{obj:scope.row,type:0}" :command="{obj:scope.row,type:1}"
icon="el-icon-delete" icon="el-icon-delete"
>删除</el-dropdown-item> >删除</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
@ -89,6 +94,10 @@
height="400px" height="400px"
:header-cell-style="{background:'#f5f4f5'}" :header-cell-style="{background:'#f5f4f5'}"
> >
<div
slot="empty"
class="comonPromptFont"
>{{$isStringEmpty(this.headerSearchValue)?'暂无数据':'未找到关于'+this.headerSearchValue+'的结果'}}</div>
<el-table-column type="selection"></el-table-column> <el-table-column type="selection"></el-table-column>
<el-table-column <el-table-column
label="名称" label="名称"
@ -112,12 +121,12 @@
<script> <script>
export default { export default {
methods: { methods: {
handleHeaderSearch () { handleHeaderSearch (val) {
console.log('搜索指标' + this.headerSearchValue)
}, },
handleAdd () { handleAdd () {
// //
this.$router.push({name: 'workbench-target-add'}) this.$router.push({ name: 'workbench-target-add' })
console.log('新增指标') console.log('新增指标')
}, },
handleMoving () { handleMoving () {
@ -126,6 +135,11 @@ export default {
}, },
handleRemove () { handleRemove () {
console.log('删除指标') console.log('删除指标')
this.$confirm('确认删除选中指标', '提示').then(() => {
console.log('确认删除选中指标')
}).catch(() => {
this.selectedMenuRowModel = null
})
}, },
handleAddCalsse () { handleAddCalsse () {
console.log('添加分类') console.log('添加分类')
@ -144,6 +158,11 @@ export default {
}) })
} else if (type === 1) { } else if (type === 1) {
// //
this.$confirm('您确定要删除此分类吗?', '提示').then(() => {
console.log('确定删除分类')
}).catch(() => {
this.selectedMenuRowModel = null
})
console.log('移除指标') console.log('移除指标')
} }
} }
@ -155,7 +174,9 @@ export default {
tableMenuData: [{ name: '收代理费建安费啦k咳咳咳书法家阿李师傅', id: '1' }], tableMenuData: [{ name: '收代理费建安费啦k咳咳咳书法家阿李师傅', id: '1' }],
tableData: [], tableData: [],
menuDataClasseHide: false, menuDataClasseHide: false,
selectedRowList: [] selectedRowList: [],
selectedMenuRowIndex: -1,
selectedMenuRowModel: null
} }
} }
} }
@ -165,7 +186,6 @@ export default {
background-color: white; background-color: white;
padding: 28px; padding: 28px;
background-color: #fff; background-color: #fff;
&-classe-menu-hide { &-classe-menu-hide {
width: 1px; width: 1px;
} }