1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273 |
- <template>
- <basic-container>
- <el-row :gutter="20" class="h100p">
- <el-col :span="6" class="h100p">
- <div class="grid-content1">
- <el-radio-group v-model="tabPosition" @input="getRoleData">
- <el-radio-button label="1">施工</el-radio-button>
- <el-radio-button label="2">监理</el-radio-button>
- <el-radio-button label="3">业主</el-radio-button>
-
- </el-radio-group>
- <div class="flex" style="margin-top: 10px">
- <el-input
-
- placeholder="请输入岗位名称"
- clearable
- @clear="clearInput"
- v-model="postText"
- >
- </el-input>
- <el-button class="mg-l-10" @click="searchPost"
- >搜索</el-button
- >
-
- </div>
- <div class="post-list">
- <el-scrollbar style="margin-top: 20px; height: 100%" v-loading="roleListLoading">
- <ul
- class="contextmenu"
- >
- <li v-for="item in roleData" :key="item"
- :class="{'selected': selectedItem === item}"
- @click="positionClick($event,item)">
-
- <span>{{item.roleName}}</span>
- </li>
- </ul>
- </el-scrollbar>
- </div>
- </div>
-
- </el-col>
- <el-col :span="18" class="h100p">
- <div class="grid-content2 ">
- <div class="header-btn">
-
- <el-button type="primary" size="small" @click="addEleClick">新增</el-button>
- <el-button type="info" size="small" @click="editEleClick" :disabled="checkedList.length<1">编辑</el-button>
- <el-button type="success" size="small" @click="openClick(row,1)" :loading="openLoading">启用</el-button>
- <el-button type="warning" size="small" @click="openClick(row,0)" :loading="closeLoading">停用</el-button>
- <el-button type="danger" size="small" @click="rowDel(row)" :loading="removeLoad">删除</el-button>
- </div>
- <div class="table-box">
- <el-table
- v-loading="tableLoading"
- ref="multipleTable"
- :data="tableData"
- tooltip-effect="dark"
- style="width: 100%"
- @selection-change="handleSelectionChange">
- <el-table-column
- type="selection"
- width="55">
- </el-table-column>
- <el-table-column
- label="电签元素名称"
- prop="eName"
- >
- </el-table-column>
- <el-table-column
- prop="elementTypeName"
- label="字符类型"
- >
-
- </el-table-column>
- <el-table-column
-
- label="元素来源"
- >
- <template slot-scope="scope">
- <el-link type="primary" @click="eleCheck(scope.row,scope.$index,1)">查看</el-link>
- </template>
- </el-table-column>
- <el-table-column
-
- label="绑定岗位"
- >
- <template slot-scope="scope">
- <el-link type="primary" @click="selectPost(scope.row,scope.$index,1)">查看</el-link>
- </template>
- </el-table-column>
- <el-table-column
- prop="status"
- label="状态"
- width="100"
- >
- <template slot-scope="scope">
- <i class="el-icon-success" style="font-size: 20px;color:#67C23A" v-if="scope.row.status==1"></i>
- <i class="el-icon-error" style="font-size: 20px;color:red" v-else></i>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="pagination-page">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-sizes="[10, 20, 30, 40,50]"
- :page-size="pageSize"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </div>
- </el-col>
-
- </el-row>
- <el-dialog
- class="dialog-footer-center"
- append-to-body
- title="新增电签配置信息"
- :visible.sync="addDialogVisible"
- width="80%"
- :before-close="handleAddClose">
- <div>
- <el-table
- :data="tableData1"
- style="width: 100%"
- max-height="500"
- >
-
- <el-table-column
- label="电签元素名称"
- >
- <template slot-scope="scope">
-
- <el-select v-model="scope.row.eName" placeholder="请选择元素或搜索" filterable size="small" @change="changeEleType($event,scope.row)">
- <el-option
- v-for="item in eleOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="name"
- label="字符类型"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.elementType"
- disabled
- size="small"
- placeholder="请选择"
- >
- <el-option
- v-for="item in dataTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="address"
- label="元素来源"
- >
- <template slot-scope="scope">
- <el-link type="warning" @click="eleCheck(scope.row,scope.$index)">请选择</el-link>
- </template>
- </el-table-column>
- <el-table-column
- prop="address"
- label="绑定岗位"
- > <template slot-scope="scope">
- <el-link type="warning" :underline="true" @click="selectPost(scope.row,scope.$index)">请选择</el-link>
- </template>
- </el-table-column>
- <el-table-column
- prop="tag"
- label="操作"
- width="100"
- >
- <template slot-scope="scope">
- <el-button type="text" @click="handleAdd(scope.row,scope.$index)">
- <i class="el-icon-circle-plus-outline" style="font-size: 20px;color:#67C23A"></i>
- </el-button>
- <el-button type="text" @click="handleDelete(scope.row,row,scope.$index)">
- <i class="el-icon-remove-outline" style="font-size: 20px;color:red"></i>
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
-
- <el-button type="primary" @click="saveBatch" :loading="saveBatchLoading">保存并生效</el-button>
- </span>
- </el-dialog>
- <!-- 选择元素来源 -->
- <el-dialog
- class="dialog-footer-center"
- append-to-body
- title="元素来源"
- :visible.sync="sourceDialogVisible"
- width="50%"
- :close="handleSourceClose">
- <div>
- <p class="tip-text" v-if="!isEleView" >
- 提示:配置之后会把所有元素表该元素字段都自动配置电签岗位对应关系。
- </p>
- <div class="source-radio-group">
- <el-radio-group v-model="selectedSourceOption" :disabled="isEleView">
- <el-radio :label="0">适配所有元素表</el-radio>
- <el-radio :label="1">部分元素表</el-radio>
- </el-radio-group>
- </div>
- <!-- 并行显示的下拉框 -->
- <div v-if="selectedSourceOption === 1&&!isEleView" class="dropdown-container">
- <el-select
- v-model="elementCategorySelect"
- placeholder="请选择表分类"
- style="flex: 1; margin-right: 10px;"
- clearable @change="changeSelect"
-
- >
- <el-option
- v-for="item in elementCategoryOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <el-select
- v-loading="loadingList"
- v-model="elementTableNameSelect"
- placeholder="请输入元素表名称进行模糊检索"
- style="flex: 1;"
- filterable clearable multiple
- class="custom-multi-select"
-
-
- >
- <el-option
- v-for="item in elementTableOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </div>
- <div v-if="selectedSourceOption === 1&&!isEleView" class="element-list-container">
- <el-scrollbar>
- <ul class="element-checkbox-list">
- <li v-for="(item, index) in elementList" :key="item.value" class="element-item">
- <el-checkbox v-model="item.checked" @change="changeEleClick($event,item)">{{ item.label }}</el-checkbox>
- </li>
- </ul>
- </el-scrollbar>
- </div>
- <el-table
- v-loading="elementLoading"
- v-if="selectedSourceOption === 1&&isEleView"
- :data="elementList1"
- border
- style="width: 100%;margin-top: 20px;"
- :header-cell-style="{ background: '#A0B7E2', color: 'black' }"
- >
- <el-table-column
- prop="name"
- label="元素表名称"
- align="center"
- >
- </el-table-column>
-
-
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer" v-if="!isEleView">
-
- <el-button type="primary" @click="confirmSourceSelection">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 绑定岗位弹窗 -->
- <el-dialog
- class="dialog-footer-center"
- append-to-body
- title="绑定岗位"
- :visible.sync="bindPostDialogVisible"
- width="50%"
- :before-close="handleBindPostClose">
- <div class="bind-post-content">
- <!-- 参建方分类 + 岗位名称下拉框 -->
- <div class="dropdown-pair" v-if="!isPosView">
- <el-select v-model="partyCategorySelect" placeholder="请选择参建方分类" style="flex: 1; margin-right: 10px;" @change="changePositionName">
- <el-option
- v-for="item in partyCategoryOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <el-select v-model="positionNameSelect" filterable multiple placeholder="请输入岗位名称进行模糊检索" class="custom-multi-select" style="flex: 1;" v-loading="positionNameLoading">
- <el-option
- v-for="item in positionNameOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </div>
- <!-- 岗位列表 -->
- <div class="position-list-container" v-if="!isPosView">
- <el-scrollbar > <!-- 18行 * 30px = 540px -->
- <ul class="position-checkbox-list">
- <li v-for="(item, index) in positionList" :key="index" class="position-item">
- <el-checkbox v-model="item.checked" @change="changePosClick($event,item)">{{ item.label }}</el-checkbox>
- </li>
- </ul>
- </el-scrollbar>
- </div>
- <el-table
- v-loading="bindPosLoading"
- v-if="isPosView"
- :data="positionList1"
- border
- :header-cell-style="{ background: '#A0B7E2', color: 'black' }"
- style="width: 100%;margin-top: 20px;">
-
- <el-table-column
- prop="type"
- label="所属方"
- align="center"
- >
- </el-table-column>
- <el-table-column
- prop="name"
- label="岗位名称"
- align="center"
- >
- </el-table-column>
-
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer" v-if="!isPosView">
- <el-button @click="positionClose">取 消</el-button>
- <el-button type="primary" @click="confirmBindPostSelection">确 定</el-button>
- </span>
- </el-dialog>
- </basic-container>
- </template>
- <script>
- import {getRoleList,getListPage,getElementList,getTableTypeList,getTableList,queryAllRoleList,submitEle,elementDetail,roleDetail,removeEle,updateStatusEle} from "@/api/sigital/signer.js";
- import { getDictionary } from "@/api/system/dict";
- export default {
- data() {
- return {
- tabPosition: '1',
- postText: '',
- roleData:[],
- roleListLoading:false,
- multipleTable:null,
- tableData: [],
- tableLoading: false,
- selectedItem: {
- id: '',
- },
- removeLoad:false,
- openLoading:false,
- closeLoading:false,
- currentPage: 1,
- pageSize: 10,
- total: 0,
- addDialogVisible: false,
- saveBatchLoading: false,
- checkedList: [],
- tableData1: [{}],
- eleOptions: [
-
- ],
- dataTypeList: [],
- sourceDialogVisible: false, // 控制弹窗显示
- isEleView: true, // 是否查看
- eleCheckRow: {},
- eleIndex: 0,
- selectedSourceOption: 1, // 默认选中 "适配所有元素表"
- elementCategorySelect: '', // 元素分类表分类选中值
- loadingList: false,
- elementTableNameSelect: [], // 元素表名称筛选选中值
- elementCategoryOptions: [
-
- ],
- elementTableOptions: [
-
- ],
- allElementTableOptions: [],
- elementList:[],
- elementList1:[],
- elementLoading: false,
- bindPostDialogVisible: false,
- bindPosLoading: false,
- partyCategorySelect: '', // 参建方分类选中值
- positionNameSelect: [], // 岗位名称选中值
- partyCategoryOptions: [
- { value: '1', label: '施工方' },
- { value: '2', label: '监理方' },
- { value: '3', label: '业主方' }
- ],
- positionNameOptions: [],
- allPositionNameOptions : [],
- positionNameLoading: false,
- positionList: [],
- positionList1:[],
- isPosView: true, //
- // 是否查看
- selectedPostRow: {},
- selectedPostIndex: 0,
- }
- },
- watch: {
- elementTableNameSelect(newVal) {
- if (newVal) {
- let arr=[];
- this.allElementTableOptions.forEach(item => {
- newVal.forEach(tableName => {
- if (item.value === tableName) {
- arr.push(item)
- }
- });
- });
-
- // 更新 elementList 并自动选中对应的项
- this.elementList = arr.map(element => ({
- ...element,
- checked: true // 自动选中
- }))
-
- }
- },
- positionNameSelect(newVal) {
-
-
- if (newVal) {
- let arr=[];
-
- this.allPositionNameOptions.forEach(item => {
- newVal.forEach(roleName => {
- if (item.value === roleName) {
- arr.push(item)
- }
- });
- });
-
- // 更新 elementList 并自动选中对应的项
- this.positionList = arr.map(element => ({
- ...element,
- checked: true // 自动选中
- }))
-
- }
- },
-
-
-
- },
- methods: {
- clearInput() {
- this.postText = ''
- this.getRoleData();
- },
- searchPost() {
- this.getRoleData();
- },
- handleSelectionChange(val) {
- this.checkedList=val
- },
- //获取岗位列表
- getRoleData() {
- this.roleListLoading = true;
- getRoleList({
- type: this.tabPosition,
- roleName: this.postText
- }).then(res => {
- console.log(res,'res');
-
- this.roleListLoading = false;
- if (res.data.code == 200) {
- this.roleListLoading = false;
- this.roleData = res.data.data;
- }else{
- this.roleData = [];
- }
- })
- },
- positionClick(event, item){
- this.selectedItem = item;
- this.getTableData();
-
- },
- getTableData() {
-
-
- this.$refs.multipleTable.clearSelection();
- this.tableLoading = true;
- getListPage({
- size: this.pageSize,
- current: this.currentPage,
- keyword: this.postText,
- roleId: this.selectedItem.roleId||''
- }).then(res => {
- this.tableLoading = false;
- if (res.data.code == 200) {
-
- this.tableData = res.data.data['records'];
- this.total = res.data.data['total'];
- }else{
- this.tableData = [];
- }
- })
- },
- handleSizeChange(val) {
- this.pageSize = val;
- this.getTableData();
- },
- handleCurrentChange(val) {
- this.currentPage = val;
- this.getTableData();
- },
- addEleClick() {
- this.addDialogVisible = true;
- this.tableData1=[{}]
- },
- editEleClick(row) {
-
- this.addDialogVisible = true;
- this.tableData1 = [...this.checkedList]
- console.log( this.tableData1,' this.tableData1');
- this.isPosView=false
- this.isEleView=false
-
- },
- //启用
- openClick(row,type){
- if(type==1){
- this.openLoading=true;
- }else{
- this.closeLoading=true;
- }
- let ids = '';
- if (this.checkedList.length > 0) {
- ids = this.checkedList.map(item => item.id).join(',');
- }
- updateStatusEle({
- ids: ids,
- status: type
- })
- .then(res => {
- if(res.data.code==200){
- this.$message({
- type: 'success',
- message: '操作成功!'
- });
- this.getTableData();
- }else{
- this.$message({
- type: 'error',
- message: res.data.msg
- });
- }
- }).finally(() => {
- if(type==1){
- this.openLoading=false;
- }else{
- this.closeLoading=false;
- }
- });
- },
-
- handleAddClose(){
- this.addDialogVisible = false;
- },
- getEleOptions(){
- getElementList().then(res => {
- if (res.data.code == 200) {
- this.eleOptions = res.data.data.map(item => ({
- value: item.id,
- label: item.ename,
- etype: item.etype,
- }));
- }else{
- this.eleOptions = [];
- }
- });
- },
-
- getDataTypelist() {
- if (this.dataTypeList.length > 1) {
- return;
- }
- getDictionary({
- code: "data_type",
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.dataTypeList = res.data.data;
- });
- },
- handleAdd(row,index) {
- console.log('新增', row);
- this.tableData1.splice(index + 1, 0, {});
- // this.elementList = [];
- // this.selectedSourceOption = 1;
- // this.elementTableNameSelect = [];
- // this.elementCategorySelect = '';
- // this.positionList = [];
- // this.positionNameSelect = [];
- // this.partyCategorySelect = '';
-
- // 新增操作的逻辑
- },
- handleDelete(row,index) {
- console.log('删除', row);
- this.tableData1.splice(index, 1);
- // 删除操作的逻辑
- },
- rowDel() {
- let ids=''
- if (this.checkedList.length > 0) {
- ids = this.checkedList.map(item => item.id).join(',');
- }
- let _that = this;
- this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- _that.remove({ ids });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消删除",
- });
- })
- },
- async remove(ids) {
- this.removeLoad = true;
- removeEle(ids).then(res => {
- console.log(res,'res');
-
- this.removeLoad = false;
- if (res.data.code == 200) {
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- this.getTableData();
- this.getRoleData();
- }
- }).finally(() => {
- this.removeLoad = false;
- });
- },
- changeEleType(value,row) {
- const selectedItem = this.eleOptions.find(item => item.value === value);
- if (selectedItem && selectedItem.etype != null) {
- row.elementType = selectedItem.etype; // 假设接口返回的 eleOptions 中有 etype 字段
- row.eName=selectedItem.label;
- row.elementId=selectedItem.value;
- }
-
- },
- //选择元素来源
- eleCheck(row,index,type) {
-
- this.getAllElements()
- this.eleCheckRow=row;
- this.eleIndex=index;
- if(type===1){
- this.isEleView = true;
- this.getEleDetail(row.id)
- this.selectedSourceOption=row.tableType
- }else{
- this.isEleView = false;
-
- this.selectedSourceOption=row.tableType
-
- if(row.id){
- this.getEleDetail(row.id,1)
- getTableList({
- tableType:''
- }).then(res => {
-
- if (res.data.code == 200) {
- this.elementTableOptions = res.data.data.map(item => ({
- value: item.id,
- label: item.tabChName
- }));
- // this.elementTableNameSelect=row.tableIds
- let arr=[];
- this.elementList.forEach(item => {
- arr.push(item.value)
- // item.checked = false;
- });
- this.elementTableNameSelect=arr
- }else{
- this.elementTableOptions = [];
- this.elementTableNameSelect=[]
- }
- });
- }else{
-
-
- this.elementCategorySelect=row.eleType
- this.changeSelect(row.eleType)
- this.elementTableNameSelect=row.tableIds
-
- }
-
- this.getElementCategoryOptions();
-
- }
- this.sourceDialogVisible = true;
-
-
-
- },
- //查看详情
- getEleDetail(id,type){
- this.elementLoading = true;
- elementDetail({
- id
- }).then(res => {
-
- this.elementLoading = false;
- if (res.data.code == 200) {
- if(type==1){
- // this.elementList = res.data.data;
- this.elementList = res.data.data.map(item => ({
- value: item.id,
- label: item.name,
- checked: true
-
- }));
- console.log( this.elementList,' this.elementList');
-
-
- }else{
- this.elementList1 = res.data.data;
- }
-
- }else{
- this.elementList1 = [];
- this.elementList = [];
- }
- })
- },
- getPosDetail(id){
- this.bindPosLoading = true;
- roleDetail({
- id
- }).then(res => {
- this.bindPosLoading = false;
-
-
- if (res.data.code == 200) {
- this.positionList1 = res.data.data;
- this.positionList = res.data.data;
- this.positionNameSelect=res.data.data.map(item => item.id)
-
- this.positionList.map(item => {
- item.label = item.name;
- item.value = item.id;
- item.checked = true
- });
-
- }else{
- this.positionList1 = [];
- this.positionList = [];
- }
- })
- },
- //获取元素表分类
-
- getElementCategoryOptions(){
-
- getTableTypeList().then(res => {
- if (res.data.code == 200) {
- this.elementCategoryOptions = res.data.data.map(item => ({
- value: item.dictKey,
- label: item.dictValue,
- id:item.id
- }));
- }else{ this.elementCategoryOptions = [];}
- });
- },
- changeSelect(){
- this.getElementTableOptions();
- },
- getAllElements(){
- getTableList({
- tableType:''
- }).then(res => {
-
- if (res.data.code == 200) {
- this.allElementTableOptions = res.data.data.map(item => ({
- value: item.id,
- label: item.tabChName
- }));
- }else{ this.allElementTableOptions = [];}
- });
- },
- //获取元素表List
- getElementTableOptions(){
- this.loadingList = true;
- getTableList({
- tableType:this.elementCategorySelect
- }).then(res => {
- this.loadingList = false;
- if (res.data.code == 200) {
- this.elementTableOptions = res.data.data.map(item => ({
- value: item.id,
- label: item.tabChName
- }));
- this.slec
- }else{ this.elementTableOptions = [];}
- });
- },
- // 弹窗关闭时的回调
- handleSourceClose(done) {
- this.sourceDialogVisible = false;
-
-
- done();
- },
- changeEleClick(value,item) {
- if(!value){
- this.elementTableNameSelect.forEach((ele,index)=>{
- if(ele == item.value){
- this.elementTableNameSelect.splice(index,1);
- }
- })
-
- }
- },
- changePosClick(value,item) {
- if(!value){
- this.positionNameSelect.forEach((ele,index)=>{
- if(ele == item.value){
- this.positionNameSelect.splice(index,1);
- }
- })
-
- }
- },
- quitClose() {
- this.sourceDialogVisible = false;
- this.selectedSourceOption = 1;
- this.elementTableNameSelect = [];
- this.elementList = [];
- this.elementCategorySelect = '';
- },
- positionClose() {
- this.bindPostDialogVisible = false;
- this.partyCategorySelect=''
- this.positionNameSelect = [];
- this.positionList = [];
- this.partyCategorySelect = '';
- },
- // 确认按钮点击事件
- confirmSourceSelection() {
- console.log(this.eleIndex,'eleIndex');
- if(!this.selectedSourceOption){
- this.$message({
- type: 'warning',
- message: '请选择元素来源!'
- });
- return
- }
-
- if (this.selectedSourceOption === 0) {
- // 处理适配所有元素表的逻辑
- console.log("适配所有元素表");
- // this.eleCheckRow.tableType = 1;
- this.tableData1.forEach((item, index) => {
- if (item.id === this.eleCheckRow.id) {
- this.tableData1[index].tableType = 0;
- }
- })
-
-
-
- } else {
- // 处理适配部分元素表的逻辑
-
-
- this.tableData1.forEach((item, index) => {
- if (index==this.eleIndex) {
- this.tableData1[index].tableType = 1;
- }
- })
- if (this.elementTableNameSelect.length > 0) {
- this.tableData1.forEach((item, index) => {
- if (index==this.eleIndex) {
- this.tableData1[index].tableIds = this.elementTableNameSelect
- this.tableData1[index].eleType = this.elementCategorySelect;
- }
- });
- }else{
- this.tableData1.forEach((item, index) => {
- if (index==this.eleIndex) {
- this.tableData1[index].tableIds ='';
- this.tableData1[index].eleType=''
- this.elementList1 = [];
- this.elementList = [];
- }
- });
- }
-
-
-
-
- }
-
- // 关闭弹窗
- this.sourceDialogVisible = false;
- },
- // 打开绑定岗位弹窗
- selectPost(row,index,type) {
- this.selectedPostIndex=index;
- this.getAllPositionNameOptions();
- this.positionNameOptions=this.allPositionNameOptions;
- if(type===1){
- this.isPosView=true
-
- if(row.id){
- this.getPosDetail(row.id)
- }
- }else{
- if(row.id){
- this.getPosDetail(row.id)
-
-
- }
- this.isPosView=false
- this.partyCategorySelect='1'
- this.getPositionList();
- this.selectedPostRow = row;
-
-
- // this.positionNameSelect=arr
- if(!row.id&&row.roleIds&&row.roleIds.length>0){
- this.positionNameSelect = row.roleIds;
- this.partyCategorySelect=row.partyCategory
- }else{
- this.positionNameSelect = [];
- this.partyCategorySelect = '';
- this.positionList = [];
- }
-
- }
- this.bindPostDialogVisible = true;
-
- },
- changePositionName() {
- this.getPositionList();
- },
- getAllPositionNameOptions() {
- queryAllRoleList({
- type:''
- }).then(res => {
- if (res.data.code == 200) {
- this.allPositionNameOptions = res.data.data.map(item => ({
- value: item.id,
- label: item.roleName
- }));
- }else{ this.allPositionNameOptions = [];}
- });
- },
- // 获取岗位列表
- getPositionList() {
- this.positionNameLoading = true;
- queryAllRoleList({
- type:this.partyCategorySelect
- }).then(res => {
- this.positionNameLoading = false;
- if (res.data.code == 200) {
- this.positionNameOptions = res.data.data.map(item => ({
- value: item.id,
- label: item.roleName
- }));
- }else{ this.positionNameOptions = [];}
- });
- },
- // 弹窗关闭回调
- handleBindPostClose(done) {
- this.bindPostDialogVisible = false;
- done();
- },
- // 确认选择岗位
- confirmBindPostSelection() {
- if(this.positionNameSelect.length==0){
- this.$message.error('请选择岗位')
- return
- }
- if (this.positionNameSelect.length > 0) {
- // this.selectedPostRow.roleIds = this.positionNameSelect.join(',');
- this.tableData1.forEach((item, index) => {
- if (this.selectedPostIndex == index) {
- this.tableData1[index].roleIds =this.positionNameSelect
- this.tableData1[index].partyCategory =this.partyCategorySelect
- }
- });
- }else{
- // this.selectedPostRow.roleIds = '';
- this.tableData1.forEach((item, index) => {
- if (this.selectedPostIndex == index) {
- this.tableData1[index].roleIds =[]
- this.tableData1[index].partyCategory = ''
- }
- });
- }
- console.log(this.tableData1,'this.tableData1');
- this.bindPostDialogVisible = false;
- },
- saveBatch(){
- console.log(this.tableData1,'this.tableData1');
- if(this.tableData1.length==0){
- this.$message.error('请选择数据')
- return
- }
- this.saveBatchLoading = true;
- submitEle(
- this.tableData1
- ).then((res) => {
- if(res.data.code==200){
- this.$message.success(res.data.msg)
- this.getTableData();
- this.getRoleData();
- this.addDialogVisible=false
- }else{
- this.$message.error(res.data.msg)
- }
- }).finally(() => {
- this.saveBatchLoading = false;
- });
- }
-
- },
- mounted() {
- this.getRoleData();
- this.getTableData();
- this.getEleOptions();
- this.getDataTypelist();
- },
- components: {}
- }
- </script>
- <style lang="scss" scoped>
- .h100p{
- height: 100%;
- }
- .grid-content1{
- height: 100%;
- border-right: 1px solid #D6D6D6;
- padding-right: 10px;
- .post-list{
- margin-top: -18px;
- height: calc(100% - 110px);
- // border: 1px solid red;
- }
-
- .contextmenu {
- padding: 4px 0; /* 添加适当的内边距 */
- // min-width: 120px;
- }
- .contextmenu ul {
- list-style: none; /* 移除小圆点 */
- padding: 0;
- margin: 0;
- // min-width: 80px;
- background: #fff;
- border: 1px solid #e4e7ed;
- border-radius: 4px;
- box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
- }
- .contextmenu li {
- padding: 8px 16px;
- line-height: 22px;
- display: flex;
- align-items: center;
- cursor: pointer;
- transition: all 0.3s;
- &.selected {
- background-color: #409eff;
- color: white;
- span {
- color: white;
- }
- }
- }
- .contextmenu li i {
- margin-right: 8px;
- font-size: 16px;
- }
- .contextmenu li span {
- font-size: 14px;
- color: #606266;
- }
- .contextmenu li:hover,
- .contextmenu li.active {
- background-color: #f5f7fa;
- color: #409eff;
- }
- .contextmenu li.divider {
- height: 1px;
- background-color: #e4e7ed;
- margin: 4px 0;
- padding: 0;
- }
-
- }
- .grid-content2{
- height: 100%;
- display: flex;
- flex-direction: column;
- .header-btn{
- margin-top: 10px;
- text-align: right;
- }
- .table-box {
- flex: 1;
- overflow: hidden;
-
- .el-table {
- height: 100% !important;
- }
- }
- }
- .tip-text {
- margin-top: -30px;
- color: red;
-
- }
- .source-radio-group{
- margin-top: 20px;
- text-align: center;
- }
- .dropdown-container {
- display: flex;
- margin-top: 20px;
- }
- .element-list-container {
- margin-top: 20px;
- height: 300px;
- overflow-y: auto
- }
- .element-checkbox-list {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- .element-item {
- line-height: 30px;
- padding-left: 10px;
- }
- .bind-post-content {
- padding-bottom: 20px;
- }
- .dropdown-pair {
- display: flex;
- margin-bottom: 20px;
- }
- .position-list-container {
- // border: 1px solid #e4e7ed;
- border-radius: 4px;
- padding: 10px;
- height: 300px;
- overflow-y: auto;
- }
- .position-checkbox-list {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- .position-item {
- line-height: 30px;
- padding-left: 10px;
- }
- .limit-height-select .el-select-dropdown__wrap {
- max-height: 30px !important;
- overflow-y: auto !important;
- }
- </style>
- <style lang="scss" >
- /* 限制已选标签容器高度并启用滚动 */
- .custom-multi-select .el-select__tags {
- max-height: 60px; /* 控制高度 */
- overflow-y: auto; /* 启用滚动 */
- white-space: normal; /* 允许换行(可选) */
- }
- /* 调整折叠标签的显示样式 */
- .custom-multi-select .el-tag {
- margin: 2px 4px 2px 0;
- }
- /* 可选:隐藏原生滚动条(更美观) */
- .custom-multi-select .el-select__tags::-webkit-scrollbar {
- width: 0;
- }
- .dialog-footer-center {
- .el-dialog__footer {
- text-align: center;
- }
- }
- .pagination-page{
- text-align: center;
- margin-top: 10px;
- }
- </style>
|