|
@@ -530,6 +530,12 @@
|
|
|
<el-button size="small" type="primary" @click="holidaySeeting()">{{ $t('setup') }}</el-button>
|
|
|
<span style="margin-left:10px;color:#999;">{{'设置部门或人员的特殊节假日'}}</span>
|
|
|
</div>
|
|
|
+ <!-- 屏蔽词设置 -->
|
|
|
+ <div class="yanjiu" v-if="user.companyId == 1071">
|
|
|
+ <p style="margin: 0 68px 0 10px;color:#666;">{{'屏蔽词设置'}}</p>
|
|
|
+ <el-button size="small" type="primary" @click="maskWordSetting()" style="margin-left:28px;">{{ $t('setup') }}</el-button>
|
|
|
+ <span style="margin-left:10px;color:#999;">{{'针对日报设置屏蔽词'}}</span>
|
|
|
+ </div>
|
|
|
|
|
|
<!-- 是否开启主项目管理 -->
|
|
|
<!-- <div class="yanjiu">
|
|
@@ -791,16 +797,86 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 屏蔽词设置列表 -->
|
|
|
+ <el-dialog title="屏蔽词列表" show-header="false" :top="'10vh'" v-if="maskWordSettingDialog" :visible.sync="maskWordSettingDialog" :close-on-click-modal="false" customClass="customWidth" width="1000px">
|
|
|
+ <el-table :data="maskWordSettingDatas" highlight-current-row height="400" style="width: 100%;">
|
|
|
+ <el-table-column prop="wordName" width="150" label="屏蔽词名称">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name" label="有效范围" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.rangeType==0?$t('quanGongSi'):$t('buFenChengYuan')}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name" label="适用部门" width="300">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="user.userNameNeedTranslate != '1'">{{ scope.row.targetDeptsNames }}</div>
|
|
|
+ <div v-else>
|
|
|
+ <span v-for="(v,i) in (scope.row.newDeptName || [])">
|
|
|
+ <TranslationOpenDataText type='departmentName' :openid='v'></TranslationOpenDataText>
|
|
|
+ <span v-if="i < (scope.row.newDeptName || []).length - 1">,</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="alertMsg" label="报错提示语" width="200">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('operation')" width="150" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="small" type="primary" @click="addNewMaskWordSetting(scope.row)">{{ $t('bian-ji') }}</el-button>
|
|
|
+ <el-button size="small" type="danger" @click="deleteMaskWordSetting(scope.row)">{{ $t('btn.delete') }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="maskWordSettingDialog = false">{{ $t('Shutdown') }}</el-button>
|
|
|
+ <el-button type="primary" @click="addNewMaskWordSetting()">{{ $t('addData') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 新增屏蔽词设置 -->
|
|
|
+ <el-dialog title="屏蔽词设置" show-header="false" v-if="addMaskWordSetting" :visible.sync="addMaskWordSetting" :top="'10vh'" :close-on-click-modal="false" customClass="customWidth" width="600px">
|
|
|
+ <el-form ref="maskWordForm" :model="maskWordSettingForm" label-width="100px">
|
|
|
+ <el-form-item label="屏蔽词名称" prop="wordName">
|
|
|
+ <el-input v-model="maskWordSettingForm.wordName" placeholder="请输入屏蔽词名称" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="报错提示语" prop="alertMsg">
|
|
|
+ <el-input v-model="maskWordSettingForm.alertMsg" placeholder="请输入报错提示语" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('youXiaoFanWei')">
|
|
|
+ <el-radio v-model="maskWordSettingForm.rangeType" label="0">{{ $t('quanGongSi') }}</el-radio>
|
|
|
+ <el-radio v-model="maskWordSettingForm.rangeType" label="1">{{ $t('buFenChengYuan') }}</el-radio>
|
|
|
+ </el-form-item>
|
|
|
+ <div style="height: 36vh" v-if="maskWordSettingForm.rangeType!=1"></div>
|
|
|
+ <div v-if="maskWordSettingForm.rangeType==1">
|
|
|
+ <div class="specialHolidaysClass">
|
|
|
+ <div class="titles">适用部门 <el-link type="primary" :underline="false" @click="showMaskWordSelection(1)">{{ $t('addTian') }}</el-link></div>
|
|
|
+ <div class="contents">
|
|
|
+ <el-tag style="margin:10px 0 0 10px" v-for="(item, index) in maskWordDept.labels" :key="item.id" closable @close="maskWordDelete('maskWordDept', index)">
|
|
|
+ <span v-if="user.userNameNeedTranslate != '1'">{{item}}</span>
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='item'></TranslationOpenDataText></span>
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="addMaskWordSetting = false">{{ $t('Shutdown') }}</el-button>
|
|
|
+ <el-button type="primary" @click="submitInsertMaskWordSetting()">{{ $t('save') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 特殊节假日设置 -->
|
|
|
<el-dialog :title="specialHolidays == 1 ? $t('qing-xuan-ze-bu-men') : $t('pleaseselectpersonnel')" :top="'10vh'" v-if="specialHolidaysDialog" :visible.sync="specialHolidaysDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
|
|
|
- <div v-if="user.userNameNeedTranslate == '1'">
|
|
|
+ <!-- 只有在非屏蔽词设置时才显示搜索功能 -->
|
|
|
+ <div v-if="user.userNameNeedTranslate == '1' && !isMaskWordDialog">
|
|
|
<el-input :placeholder="$t('qingShuRuMingZiSouSuo')" v-model.trim="wxFilterText" @keyup.enter.native="echartDepartment()" clearable @clear="clearEchartDepartment()" class="input-with-select">
|
|
|
<el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
<div class="tree" style="height:400px">
|
|
|
<el-scrollbar style="height:100%">
|
|
|
- <el-input v-if="user.userNameNeedTranslate != '1'"
|
|
|
+ <!-- 只有在非屏蔽词设置时才显示搜索功能 -->
|
|
|
+ <el-input v-if="user.userNameNeedTranslate != '1' && !isMaskWordDialog"
|
|
|
:placeholder="$t('keywordfiltering')"
|
|
|
v-model="filterText">
|
|
|
</el-input>
|
|
@@ -825,7 +901,7 @@
|
|
|
</div>
|
|
|
<!-- <div>已选中 {{chosenMembCount}} 人</div> :default-checked-keys="alreadyPartArray" @check-change="onTreeItemChange" -->
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="specialHolidaysDialog = false">{{ $t('btn.cancel') }}</el-button>
|
|
|
+ <el-button @click="specialHolidaysDialog = false, isMaskWordDialog = false">{{ $t('btn.cancel') }}</el-button>
|
|
|
<el-button type="primary" @click="specialHolidaysChange()">{{ $t('btn.determine') }}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -1006,6 +1082,27 @@
|
|
|
},
|
|
|
mechanicalPersonnelList: [],
|
|
|
selectPersonnelType: 'personnel',
|
|
|
+
|
|
|
+ // 屏蔽词设置相关数据
|
|
|
+ maskWordSettingDialog: false,
|
|
|
+ addMaskWordSetting: false,
|
|
|
+ maskWordSettingForm: {
|
|
|
+ rangeType: "0",
|
|
|
+ wordName: '',
|
|
|
+ alertMsg: ''
|
|
|
+ },
|
|
|
+ maskWordSettingDatas: [],
|
|
|
+
|
|
|
+ // 屏蔽词设置的部门和人员选择
|
|
|
+ maskWordDept: {
|
|
|
+ values: [],
|
|
|
+ labels: []
|
|
|
+ },
|
|
|
+ maskWordUser: {
|
|
|
+ values: [],
|
|
|
+ labels: []
|
|
|
+ },
|
|
|
+ isMaskWordDialog: false, // 标识是否为屏蔽词对话框
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -1110,10 +1207,20 @@
|
|
|
setspecialHolidaysNodes() {
|
|
|
let key = []
|
|
|
if(this.specialHolidays == 1) {
|
|
|
- key = this.specialHolidaysDept.values || []
|
|
|
+ // 判断是否为屏蔽词设置
|
|
|
+ if(this.maskWordSettingDialog || this.addMaskWordSetting) {
|
|
|
+ key = this.maskWordDept.values || []
|
|
|
+ } else {
|
|
|
+ key = this.specialHolidaysDept.values || []
|
|
|
+ }
|
|
|
}
|
|
|
if(this.specialHolidays == 2) {
|
|
|
- key = this.specialHolidaysUser.values || []
|
|
|
+ // 判断是否为屏蔽词设置
|
|
|
+ if(this.maskWordSettingDialog || this.addMaskWordSetting) {
|
|
|
+ key = this.maskWordUser.values || []
|
|
|
+ } else {
|
|
|
+ key = this.specialHolidaysUser.values || []
|
|
|
+ }
|
|
|
}
|
|
|
console.log(key, '<=== 设置数据')
|
|
|
this.$refs.specialHolidaysTree.setCheckedKeys(key)
|
|
@@ -1127,14 +1234,25 @@
|
|
|
if(this.specialHolidays == 1) {
|
|
|
let values = selectList.map(item => item.id)
|
|
|
let labels = selectList.map(item => item.label)
|
|
|
- this.specialHolidaysDept = { values, labels }
|
|
|
+ // 判断是否为屏蔽词设置
|
|
|
+ if(this.maskWordSettingDialog || this.addMaskWordSetting) {
|
|
|
+ this.maskWordDept = { values, labels }
|
|
|
+ } else {
|
|
|
+ this.specialHolidaysDept = { values, labels }
|
|
|
+ }
|
|
|
}
|
|
|
if(this.specialHolidays == 2) {
|
|
|
let values = selectList.filter(item => !item.userList).map(item => item.id)
|
|
|
let labels = selectList.filter(item => !item.userList).map(item => item.label)
|
|
|
- this.specialHolidaysUser = { values, labels }
|
|
|
+ // 判断是否为屏蔽词设置
|
|
|
+ if(this.maskWordSettingDialog || this.addMaskWordSetting) {
|
|
|
+ this.maskWordUser = { values, labels }
|
|
|
+ } else {
|
|
|
+ this.specialHolidaysUser = { values, labels }
|
|
|
+ }
|
|
|
}
|
|
|
this.specialHolidaysDialog = false
|
|
|
+ this.isMaskWordDialog = false // 重置屏蔽词对话框标识
|
|
|
},
|
|
|
showSpecialHolidays(key) {
|
|
|
this.specialHolidays = key
|
|
@@ -1219,6 +1337,10 @@
|
|
|
this.holidaySeetingDialog=true,
|
|
|
this.getHolidaySeetingList()
|
|
|
},
|
|
|
+ maskWordSetting() {
|
|
|
+ this.maskWordSettingDialog=true,
|
|
|
+ this.getMaskWordSettingList()
|
|
|
+ },
|
|
|
// 获取节假日设置列表
|
|
|
getHolidaySeetingList(){
|
|
|
this.http.post('/holiday-setting/list',{
|
|
@@ -1718,7 +1840,8 @@
|
|
|
},res => {
|
|
|
if(res.code == 'ok'){
|
|
|
let list = res.data
|
|
|
- if(this.specialHolidays != 1) {
|
|
|
+ // 如果是屏蔽词设置且选择部门,则不添加人员数据
|
|
|
+ if(this.specialHolidays != 1 && !this.isMaskWordDialog) {
|
|
|
this.haveUsersList(list)
|
|
|
}
|
|
|
this.whiteListAll = JSON.parse(JSON.stringify(list))
|
|
@@ -2209,6 +2332,169 @@
|
|
|
this.whiteListAll = this.whiteListAllTwo
|
|
|
},
|
|
|
|
|
|
+ // 屏蔽词设置相关方法
|
|
|
+ // 获取屏蔽词设置列表
|
|
|
+ getMaskWordSettingList() {
|
|
|
+ this.http.post('/mask-word/list', {}, res => {
|
|
|
+ if(res.code == 'ok') {
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ item.newDeptName = item.targetDeptsNames ? item.targetDeptsNames.split(',') : []
|
|
|
+ item.newDeptId = item.targetDepts ? item.targetDepts.split(',') : []
|
|
|
+ })
|
|
|
+ this.maskWordSettingDatas = res.data
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }, err => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 新增/编辑屏蔽词设置
|
|
|
+ addNewMaskWordSetting(item) {
|
|
|
+ if(item) {
|
|
|
+ this.maskWordSettingForm.wordName = item.wordName
|
|
|
+ this.maskWordSettingForm.alertMsg = item.alertMsg
|
|
|
+ this.maskWordSettingForm.id = item.id
|
|
|
+ this.maskWordSettingForm.rangeType = item.rangeType + ""
|
|
|
+ let newDeptForm = {
|
|
|
+ values: item.newDeptId,
|
|
|
+ labels: item.newDeptName
|
|
|
+ }
|
|
|
+ this.maskWordDept = newDeptForm
|
|
|
+ this.maskWordUser = {
|
|
|
+ values: [],
|
|
|
+ labels: []
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.maskWordSettingForm.wordName = ""
|
|
|
+ this.maskWordSettingForm.alertMsg = ""
|
|
|
+ this.maskWordSettingForm.id = null
|
|
|
+ this.maskWordSettingForm.rangeType = "0"
|
|
|
+ this.maskWordDept = {
|
|
|
+ values: [],
|
|
|
+ labels: []
|
|
|
+ }
|
|
|
+ this.maskWordUser = {
|
|
|
+ values: [],
|
|
|
+ labels: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.addMaskWordSetting = true
|
|
|
+ },
|
|
|
+
|
|
|
+ // 删除屏蔽词设置
|
|
|
+ deleteMaskWordSetting(item) {
|
|
|
+ this.$confirm('确定删除这条数据吗?', '删除', {
|
|
|
+ confirmButtonText: this.$t('btn.determine'),
|
|
|
+ cancelButtonText: this.$t('btn.cancel'),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.listLoading = true;
|
|
|
+ this.http.post('/mask-word/delete', {
|
|
|
+ id: item.id
|
|
|
+ }, res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('message.successfullyDeleted'),
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getMaskWordSettingList();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+
|
|
|
+ // 提交屏蔽词设置
|
|
|
+ submitInsertMaskWordSetting() {
|
|
|
+ if(!this.maskWordSettingForm.wordName) {
|
|
|
+ this.$message({
|
|
|
+ message: '请输入屏蔽词名称',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.maskWordSettingForm.alertMsg) {
|
|
|
+ this.$message({
|
|
|
+ message: '请输入报错提示语',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ let newForm = {
|
|
|
+ ...this.maskWordSettingForm,
|
|
|
+ targetDepts: this.maskWordDept.values.join(','),
|
|
|
+ }
|
|
|
+ this.http.post('/mask-word/maskWordSetting', {...newForm}, res => {
|
|
|
+ if(res.code == 'ok') {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('savesuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.addMaskWordSetting = false
|
|
|
+ this.getMaskWordSettingList()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }, err => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 显示屏蔽词部门选择对话框
|
|
|
+ showMaskWordSelection(key) {
|
|
|
+ this.specialHolidays = key
|
|
|
+ this.filterText = ''
|
|
|
+ this.isMaskWordDialog = true // 标识为屏蔽词对话框
|
|
|
+ this.getWhiteListAll()
|
|
|
+ this.specialHolidaysDialog = true
|
|
|
+ },
|
|
|
+
|
|
|
+ // 删除屏蔽词部门/人员标签
|
|
|
+ maskWordDelete(field, index) {
|
|
|
+ this[field].labels.splice(index, 1)
|
|
|
+ this[field].values.splice(index, 1)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 设置屏蔽词选择的节点
|
|
|
+ setMaskWordNodes() {
|
|
|
+ let key = []
|
|
|
+ if(this.specialHolidays == 1) {
|
|
|
+ key = this.maskWordDept.values || []
|
|
|
+ }
|
|
|
+ if(this.specialHolidays == 2) {
|
|
|
+ key = this.maskWordUser.values || []
|
|
|
+ }
|
|
|
+ this.$refs.specialHolidaysTree.setCheckedKeys(key)
|
|
|
+ },
|
|
|
+
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -2294,4 +2580,4 @@
|
|
|
overflow-x: hidden;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|