Commit ebfc240f authored by 罗超's avatar 罗超

调整字典

parent 980d4286
......@@ -36,3 +36,4 @@ package-lock.json
/webfont/*
src/assets/webfont/
.vscode
font.css
......@@ -47,7 +47,7 @@ module.exports = function (ctx) {
vueRouterMode: 'hash', // available values: 'hash', 'history'
env: ctx.dev ? {
API: 'http://192.168.20.24:8300/api',
API: 'http://192.168.20.51:8088/api',
API_ZC:'http://192.168.20.9:8087/api',
API_SK:'ws:192.168.20.214:'
} : {
......
......@@ -11,6 +11,29 @@ export function setConten(data) {
});
}
/**
* 公告系统设置
*/
export function getDictList(data) {
return request({
url: '/UserCenter/GetDictValueList',
method: 'post',
data
});
}
/**
* 公告系统设置
*/
export function saveDict(data) {
return request({
url: '/UserCenter/SaveDict',
method: 'post',
data
});
}
/**
* 获取公告系统设置
*/
......
@font-face{
/* @font-face{
font-family:'katongjian';
src:url('../../webfont/katongjian.ttf') format('truetype')
}
......@@ -68,7 +68,7 @@
@font-face{
font-family:'pingfang';
src:url('../../webfont/pingfang.ttf') format('truetype')
}
} */
.adv-box{
box-sizing: border-box;
position: absolute;
......
<template>
<div>
<q-select @input="updateModel" :label="msg.Name" v-if="!multiple" option-value="Id" option-label="EmployeeName" color="primary" filled :rules="[val => !!val|| '请选择人员信息']" emit-value v-model="msg.Content" use-input clearable @filter="filterFn" :options="EmployeeListOption" map-options ref="Admin">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
<q-select @blur="updateMultipleModel" multiple :label="msg.Name" v-if="multiple" option-value="Id" option-label="EmployeeName" color="primary" filled :rules="[val => !!val|| '请选择人员信息']" emit-value v-model="msg.Content" use-input clearable @filter="filterFn" :options="EmployeeListOption" map-options ref="Admin">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div>
</template>
<script>
import {
queryEmployee
} from '../../api/users/user';
export default {
props: ["dict", "multiple"],
data() {
return {
EmployeeListOption: [],
allEmployeeListOption: [],
msg: {}
}
},
// watch: {
// dict: {
// handler(val) {
// this.msg = val
// console.log(this.msg)
// },
// deep: true
// }
// },
created() {
try {
if (!this.multiple) {
this.dict.Content = parseInt(this.dict.Content);
} else {
if (this.dict.Content && this.dict.Content.length > 0) {
this.dict.Content = this.dict.Content.split(',').map(Number)
} else {
this.dict.Content = []
}
}
this.msg = this.dict
console.log(this.msg)
} catch (error) {
console.log('错误', error)
}
},
mounted() {
this.getEmployee()
},
methods: {
getEmployee() {
var qMsg = {
Dept_Id: 0
}
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
this.EmployeeListOption = res.Data;
this.allEmployeeListOption = res.Data;
}
}).catch(() => {})
},
filterFn(val, update) {
update(() => {
if (val === '') {
this.EmployeeListOption = JSON.parse(JSON.stringify(this.allEmployeeListOption))
} else {
const needle = val.toLowerCase();
this.EmployeeListOption = this.allEmployeeListOption.filter(v => v.EmployeeName.toLowerCase().indexOf(
needle) > -1);
}
})
},
updateMultipleModel() {
if (this.msg.Content && this.msg.Content != "") {
this.msg.Mask = ""
this.allEmployeeListOption.forEach(x => {
if (this.msg.Content.indexOf(x.Id)!=-1){
this.msg.Mask+=x.EmployeeName+","
}
})
this.msg.Mask=this.msg.Mask.substring(0,this.msg.Mask.length-1);
this.msg.Content=this.msg.Content.join(',')
this.$emit("blur", this.msg)
}
},
updateModel(val) {
if (this.msg.Content && this.msg.Content != "") {
this.msg.Mask = this.msg.Content
this.allEmployeeListOption.forEach(x => {
if (x.Id == this.msg.Content) {
this.msg.Mask = x.EmployeeName
}
})
this.$emit("blur", this.msg)
}
}
},
}
</script>
<style>
</style>
......@@ -8,7 +8,7 @@
</style>
<template>
<div class="page-body">
<div class="col row wrap">
<!-- <div class="col row wrap">
<div class="col-2 baseSet_Title">
公告审批人:
</div>
......@@ -28,6 +28,26 @@
<div class="col-3" style="padding:18px 0 0 10px;color:gray">
</div>
</div>
<div class="col row wrap">
<div class="col-2 baseSet_Title">
学员缺勤推送:
</div>
<div class="col-3">
<q-select option-value="Id" option-label="EmployeeName" color="primary" filled
:rules="[val => !!val|| '请选择学员缺勤推送人员']" v-model="msg.Content" use-input clearable @filter="filterFn"
:options="EmployeeListOption" emit-value map-options ref="Admin">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="col-3" style="padding:18px 0 0 10px;color:gray">
</div>
</div>
<div class="col row wrap">
<div class="col-2 baseSet_Title">
</div>
......@@ -35,24 +55,46 @@
<q-btn label="保存" color="accent q-px-md" style="font-weight:400 !important;margin-top:20px;width:100%;"
@click="saveInfo" />
</div>
</div>-->
<div class="text-h5 text-weight-medium q-mb-lg">系统字典维护</div>
<div class="row q-col-gutter-xs q-px-lg">
<div class="col-6 relative-position " :class="{'dict-item':!x.EditorStatus}" v-for="(x,i) in dictList" :key="i">
<div class="edit-box" >
<q-avatar rounded size="24px" color="orange" @click="changeStatus(x)">
<q-icon size="18" color="white" name="iconfont icon-edit"></q-icon>
</q-avatar>
</div>
<div style="max-width:300px">
<q-field v-if="!x.EditorStatus" borderless :label="x.Name" v-model="x.Mask" readonly>
<span class="text-dark text-weight-medium">{{x.Mask}}</span>
</q-field>
<dictSelectEmp @blur="changeFinishModel" v-if="x.DictKey=='Notice_BaseKey' && x.EditorStatus" :dict="x" :multiple="false"></dictSelectEmp>
<dictSelectEmp @blur="changeFinishModel" v-if="(x.DictKey=='Push_Absence'||x.DictKey=='Push_Arrears'||x.DictKey=='Push_EndClass') && x.EditorStatus" :dict="x" :multiple="true"></dictSelectEmp>
<q-input @blur="changeModel(x)" :rules="[val => !!val|| '请填写字典值']" filled v-else-if="x.EditorStatus" borderless :label="x.Name" v-model="x.Content"></q-input>
</div>
</div>
</div>
</div>
</template>
<script>
import dictSelectEmp from '../../components/system/dict-select-emp'
import {
queryEmployee
} from '../../api/users/user'; //获取业务员
import {
setConten,
getConten
getConten,
getDictList,
saveDict
} from "../../api/system/notiveSysSet"
export default {
meta: {
title: "公告系统设置"
},
props: {},
components: {},
components: {
dictSelectEmp
},
data() {
return {
msg: {
......@@ -60,14 +102,43 @@
},
EmployeeListOption: [],
allEmployeeListOption: [],
dictList:[]
}
},
created() {},
mounted() {
this.getEmployee(0);
this.getData();
this.init();
},
methods: {
changeModel(x){
if(x.Content!=''){
x.Mask=x.Content
this.changeStatus(x)
saveDict(x).then(r=>{});
}
},
changeFinishModel(x){
this.changeStatus(x)
saveDict(x).then(r=>{});
},
changeStatus(x){
x.EditorStatus=!x.EditorStatus
console.log(x)
this.$forceUpdate()
},
init(){
getDictList({}).then(r=>{
r.Data.forEach(x=>{
if(!x.Mask||x.Mask==''){
x.Mask=x.Content==""?"未设定":x.Content
}
x.EditorStatus=false
})
this.dictList=r.Data
})
},
//获取业务员
getEmployee(id) {
var qMsg = {
......@@ -117,7 +188,16 @@
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
<style>
.dict-item:hover .edit-box{
display: block;
}
.edit-box{
position: absolute;
left: 256px;
top: 20px;
display: none;
cursor: pointer;
z-index: 9;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment