|
@@ -1,29 +1,24 @@
|
|
|
<template>
|
|
|
- <el-dialog title="按条件批量配置" :visible.sync="dialog.config" width="900px">
|
|
|
- <el-form ref="form" :model="form" label-width="85px">
|
|
|
+ <el-dialog title="按条件批量配置" :visible.sync="dialog.config" @close="handleClose" width="900px">
|
|
|
+ <el-form ref="dataForm" :model="form" label-width="90px">
|
|
|
<el-form-item label="方案:">
|
|
|
- <el-radio-group v-model="form.resource">
|
|
|
- <el-radio label="custom">全新设定</el-radio>
|
|
|
- <el-radio label="scheme1">预置方案1</el-radio>
|
|
|
- <el-radio label="scheme2">预置方案2</el-radio>
|
|
|
+ <el-radio-group v-model="form.SchemeId">
|
|
|
+ <el-radio label="schemeZero">全新设定</el-radio>
|
|
|
+ <el-radio label="schemeOne">预置方案1</el-radio>
|
|
|
+ <!-- <el-radio label="schemeTwo">预置方案2</el-radio> -->
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="form.resource == 'custom'" label="优先级:">
|
|
|
- <el-checkbox-group v-model="form.priority">
|
|
|
- <el-checkbox label="S" name="priority">(S)关键信息</el-checkbox>
|
|
|
- <el-checkbox label="M" name="priority">(M)次要信息</el-checkbox>
|
|
|
- <el-checkbox label="R" name="priority">(R)参考信息</el-checkbox>
|
|
|
+ <el-form-item v-show="form.SchemeId == 'schemeZero'" label="优先级:">
|
|
|
+ <el-checkbox-group v-model="form.PriorityList">
|
|
|
+ <el-checkbox v-for="item in PriorityList" :key="item.Priority" :label="item.Priority" name="priority">{{ item.name }}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="form.resource == 'custom'" label="一级标签:">
|
|
|
- <el-checkbox-group v-model="form.firstTag">
|
|
|
- <el-checkbox label="1" name="firstTag">能耗信息</el-checkbox>
|
|
|
- <el-checkbox label="2" name="firstTag">基本信息</el-checkbox>
|
|
|
- <el-checkbox label="3" name="firstTag">台账参数</el-checkbox>
|
|
|
- <el-checkbox label="4" name="firstTag">通讯参数</el-checkbox>
|
|
|
+ <el-form-item v-show="form.SchemeId == 'schemeZero'" label="一级标签:">
|
|
|
+ <el-checkbox-group v-model="form.FirstNameList">
|
|
|
+ <el-checkbox style="width:99px;" v-for="(item, index) in FirstNameList" :key="index" :label="item.FirstName" name="firstTag"></el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="form.resource == 'custom'" label="二级标签:">
|
|
|
+ <el-form-item v-show="form.SchemeId == 'schemeZero'" label="二级标签:">
|
|
|
<span style="color:#bbb;font-size:12px;">二级标签暂未提供,如确实需要请联系产品添加。</span>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -34,7 +29,7 @@
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { getDataDictionary } from "@/api/scan/request"
|
|
|
+import { getDataDictionary, setInfoPoint } from "@/api/scan/request"
|
|
|
import { mapGetters, mapActions } from "vuex"
|
|
|
export default {
|
|
|
props: {
|
|
@@ -50,25 +45,103 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
form: {
|
|
|
- resource: 'custom',
|
|
|
- priority: [],
|
|
|
- firstTag: []
|
|
|
+ SchemeId: 'schemeZero',
|
|
|
+ PriorityList: [],
|
|
|
+ FirstNameList: []
|
|
|
},
|
|
|
+ FirstNameList: [],
|
|
|
+ PriorityList: [],
|
|
|
loading: false
|
|
|
};
|
|
|
},
|
|
|
- created() { },
|
|
|
+ created() {
|
|
|
+ this.getInfos()
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapGetters("layout", ["projectId", "secret", "userId"])
|
|
|
},
|
|
|
methods: {
|
|
|
+ getInfos() {
|
|
|
+ let params1 = {
|
|
|
+ data: {
|
|
|
+ Distinct: true,
|
|
|
+ Filters: "FirstName != ''",
|
|
|
+ Orders: "FirstName desc",
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 1000,
|
|
|
+ Projection: [ "FirstName" ]
|
|
|
+ },
|
|
|
+ type: ""
|
|
|
+ }, params2 = {
|
|
|
+ data: {
|
|
|
+ Distinct: true,
|
|
|
+ Filters: "Priority != '';Priority != 'null'",
|
|
|
+ Orders: "Priority desc",
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 1000,
|
|
|
+ Projection: [ "Priority" ]
|
|
|
+ },
|
|
|
+ type: ""
|
|
|
+ };
|
|
|
+ let promise1 = new Promise((resolve, reject) => {
|
|
|
+ getDataDictionary(params1, res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let promise2 = new Promise((resolve, reject) => {
|
|
|
+ getDataDictionary(params2, res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ Promise.all([promise1, promise2]).then(values => {
|
|
|
+ this.FirstNameList = values[0].Content
|
|
|
+ this.PriorityList = values[1].Content.map((item) => {
|
|
|
+ if (item.Priority == "S") {
|
|
|
+ item.name = `(${item.Priority})关键信息`
|
|
|
+ return item
|
|
|
+ } else if (item.Priority == "M") {
|
|
|
+ item.name = `(${item.Priority})次要信息`
|
|
|
+ return item
|
|
|
+ } else if (item.Priority == "R") {
|
|
|
+ item.name = `(${item.Priority})参考信息`
|
|
|
+ return item
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //确定
|
|
|
onSubmit() {
|
|
|
+ let params = {}
|
|
|
this.loading = true
|
|
|
- console.log(this.form);
|
|
|
+ if (this.form.SchemeId == 'schemeZero') {
|
|
|
+ params = this.form
|
|
|
+ } else {
|
|
|
+ params = {
|
|
|
+ SchemeId: this.form.SchemeId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setInfoPoint(params, res => {
|
|
|
+ this.form.SchemeId = 'schemeZero'
|
|
|
+ this.form.FirstNameList = []
|
|
|
+ this.form.PriorityList = []
|
|
|
+ this.dialog.config = false
|
|
|
+ this.loading = false
|
|
|
+ this.$emit('configInfo')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //弹窗关闭回调
|
|
|
+ handleClose() {
|
|
|
+ this.form.SchemeId = 'schemeZero'
|
|
|
+ this.form.FirstNameList = []
|
|
|
+ this.form.PriorityList = []
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
- },
|
|
|
- watch: {
|
|
|
-
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
+<style lang="scss">
|
|
|
+ .el-dialog__body {
|
|
|
+ max-height: 420px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+</style>
|