|
@@ -81,6 +81,17 @@
|
|
|
v-hasPermi="['qw:qwCompany:export']"
|
|
v-hasPermi="['qw:qwCompany:export']"
|
|
|
>导出</el-button>
|
|
>导出</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-s-grid"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :disabled="single"
|
|
|
|
|
+ @click="handleSelectArea"
|
|
|
|
|
+ v-hasPermi="['qw:qwCompany:edit']"
|
|
|
|
|
+ >选择区域</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
@@ -96,6 +107,11 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column label="关联区域" align="center" prop="addressBindIp">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="scope.row.addressBindIp">{{ getAddressLabels(scope.row.addressBindIp) }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="statusOptions" :value="scope.row.status"/>
|
|
<dict-tag :options="statusOptions" :value="scope.row.status"/>
|
|
@@ -221,6 +237,17 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="关联区域" prop="addressBindIp">
|
|
|
|
|
+ <el-select filterable v-model="form.addressIds" multiple placeholder="请选择区域" clearable style="width: 50%;">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in availableAddressList"
|
|
|
|
|
+ :key="item.ip"
|
|
|
|
|
+ :label="item.title +(item.ip)"
|
|
|
|
|
+ :value="item.ip"
|
|
|
|
|
+ :disabled="item.disabled"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="状态">
|
|
<el-form-item label="状态">
|
|
|
<el-radio-group v-model="form.status">
|
|
<el-radio-group v-model="form.status">
|
|
@@ -237,13 +264,45 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 选择区域弹窗 -->
|
|
|
|
|
+ <el-dialog :title="areaDialogTitle" :visible.sync="areaDialogVisible" width="800px" append-to-body>
|
|
|
|
|
+ <el-form :inline="true">
|
|
|
|
|
+ <el-form-item label="筛选区域">
|
|
|
|
|
+ <el-input v-model="areaFilter" placeholder="输入区域名称筛选" clearable size="small" style="width: 200px;" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ :data="filteredAddressList"
|
|
|
|
|
+ @selection-change="handleAreaSelectionChange"
|
|
|
|
|
+ ref="areaTable"
|
|
|
|
|
+ max-height="400"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column type="selection" width="55" align="center" :selectable="checkSelectable" />
|
|
|
|
|
+ <el-table-column label="区域IP" align="center" prop="ip" />
|
|
|
|
|
+ <el-table-column label="标题" align="center" prop="title" />
|
|
|
|
|
+ <el-table-column label="地址ID" align="center" prop="addressId" />
|
|
|
|
|
+ <el-table-column label="状态" align="center" prop="status">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-tag v-if="boundAddrIds.indexOf(scope.row.ip) > -1" type="danger">已被其他主体绑定</el-tag>
|
|
|
|
|
+ <el-tag v-else-if="currentAreaSelection.indexOf(scope.row.ip) > -1" type="success">当前选中</el-tag>
|
|
|
|
|
+ <el-tag v-else type="info">未绑定</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitAreaSelection">确 定</el-button>
|
|
|
|
|
+ <el-button @click="areaDialogVisible = false">取 消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { listQwCompany, getQwCompany, delQwCompany, addQwCompany, updateQwCompany, exportQwCompany } from "@/api/qw/qwCompany";
|
|
|
|
|
|
|
+import { listQwCompany, getQwCompany, delQwCompany, addQwCompany, updateQwCompany, exportQwCompany, allCorp } from "@/api/qw/qwCompany";
|
|
|
import { getCompanyList } from "@/api/company/company";
|
|
import { getCompanyList } from "@/api/company/company";
|
|
|
import { listAll } from '@/api/course/coursePlaySourceConfig'
|
|
import { listAll } from '@/api/course/coursePlaySourceConfig'
|
|
|
|
|
+import { listDisQwIpadServer } from '@/api/qw/qwIpadServer'
|
|
|
export default {
|
|
export default {
|
|
|
name: "QwCompany",
|
|
name: "QwCompany",
|
|
|
watch: {
|
|
watch: {
|
|
@@ -312,6 +371,15 @@ export default {
|
|
|
maAppList:[],
|
|
maAppList:[],
|
|
|
miniAppList:[],
|
|
miniAppList:[],
|
|
|
customAppList:[],
|
|
customAppList:[],
|
|
|
|
|
+ // 区域选择相关
|
|
|
|
|
+ areaDialogVisible: false,
|
|
|
|
|
+ areaDialogTitle: "",
|
|
|
|
|
+ areaList: [],
|
|
|
|
|
+ areaFilter: "",
|
|
|
|
|
+ currentAreaSelection: [],
|
|
|
|
|
+ currentCompanyForArea: null,
|
|
|
|
|
+ boundAddrIds: [],
|
|
|
|
|
+ currentAddrIdsForForm: [],
|
|
|
// 表单校验
|
|
// 表单校验
|
|
|
rules: {
|
|
rules: {
|
|
|
corpId: [{ required: true, message: '请输入企业CorpID', trigger: 'blur' }],
|
|
corpId: [{ required: true, message: '请输入企业CorpID', trigger: 'blur' }],
|
|
@@ -330,6 +398,10 @@ export default {
|
|
|
this.companys = response.data;
|
|
this.companys = response.data;
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
+ // 加载区域列表用于表格展示
|
|
|
|
|
+ listDisQwIpadServer({ pageNum: 1, pageSize: 9999 }).then(response => {
|
|
|
|
|
+ this.areaList = this.normalizeAreaData(response.rows || response.data || []);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/** 查询企微主体列表 */
|
|
/** 查询企微主体列表 */
|
|
@@ -365,6 +437,7 @@ export default {
|
|
|
chatToolbar: null,
|
|
chatToolbar: null,
|
|
|
chatToolbarOauth: null,
|
|
chatToolbarOauth: null,
|
|
|
companyIds: null,
|
|
companyIds: null,
|
|
|
|
|
+ addressIds: [],
|
|
|
status: 0,
|
|
status: 0,
|
|
|
createTime: null,
|
|
createTime: null,
|
|
|
updateTime: null,
|
|
updateTime: null,
|
|
@@ -416,7 +489,9 @@ export default {
|
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
this.reset();
|
|
this.reset();
|
|
|
this.getAppList()
|
|
this.getAppList()
|
|
|
- this.open = true;
|
|
|
|
|
|
|
+ this.loadAddressListForForm(null).then(() => {
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ });
|
|
|
this.form.token="1o62d3YxvdHd4LEUiltnu7sK";
|
|
this.form.token="1o62d3YxvdHd4LEUiltnu7sK";
|
|
|
this.form.encodingAesKey="UJfTQ5qKTKlegjkXtp1YuzJzxeHlUKvq5GyFbERN1iU";
|
|
this.form.encodingAesKey="UJfTQ5qKTKlegjkXtp1YuzJzxeHlUKvq5GyFbERN1iU";
|
|
|
this.title = "添加企微主体";
|
|
this.title = "添加企微主体";
|
|
@@ -429,7 +504,10 @@ export default {
|
|
|
getQwCompany(id).then(response => {
|
|
getQwCompany(id).then(response => {
|
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
|
this.form.companyIds=((this.form.companyIds).split(",")).map(Number)
|
|
this.form.companyIds=((this.form.companyIds).split(",")).map(Number)
|
|
|
- this.open = true;
|
|
|
|
|
|
|
+ this.$set(this.form, 'addressIds', this.form.addressBindIp ? this.form.addressBindIp.split(",") : []);
|
|
|
|
|
+ this.loadAddressListForForm(this.form.corpId).then(() => {
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ });
|
|
|
this.title = "修改企微主体";
|
|
this.title = "修改企微主体";
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -437,20 +515,49 @@ export default {
|
|
|
submitForm() {
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- console.log(this.form.companyIds)
|
|
|
|
|
|
|
+
|
|
|
this.form.companyIds = (this.form.companyIds).join(',');
|
|
this.form.companyIds = (this.form.companyIds).join(',');
|
|
|
- if (this.form.id != null) {
|
|
|
|
|
- updateQwCompany(this.form).then(response => {
|
|
|
|
|
- this.msgSuccess("修改成功");
|
|
|
|
|
- this.open = false;
|
|
|
|
|
- this.getList();
|
|
|
|
|
|
|
+ if (this.form.addressIds && this.form.addressIds.length > 0) {
|
|
|
|
|
+ this.form.addressBindIp = this.form.addressIds.join(',');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.addressBindIp = '';
|
|
|
|
|
+ }
|
|
|
|
|
+ // 提交前校验ip唯一性
|
|
|
|
|
+ const doSubmit = () => {
|
|
|
|
|
+ if (this.form.id != null) {
|
|
|
|
|
+ updateQwCompany(this.form).then(response => {
|
|
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ addQwCompany(this.form).then(response => {
|
|
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ if (this.form.addressIds && this.form.addressIds.length > 0) {
|
|
|
|
|
+ allCorp().then(corpRes => {
|
|
|
|
|
+ const allCorps = corpRes.data || [];
|
|
|
|
|
+ const boundIps = [];
|
|
|
|
|
+ allCorps.forEach(corp => {
|
|
|
|
|
+ if (corp.corpId !== this.form.corpId && corp.addressBindIp) {
|
|
|
|
|
+ corp.addressBindIp.split(",").forEach(id => {
|
|
|
|
|
+ if (id && boundIps.indexOf(id) === -1) boundIps.push(id);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ const conflictIps = this.form.addressIds.filter(ip => boundIps.indexOf(ip) > -1);
|
|
|
|
|
+ if (conflictIps.length > 0) {
|
|
|
|
|
+ this.$message.error("以下IP已被其他主体绑定,不能重复绑定:" + conflictIps.join(", "));
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ doSubmit();
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- addQwCompany(this.form).then(response => {
|
|
|
|
|
- this.msgSuccess("新增成功");
|
|
|
|
|
- this.open = false;
|
|
|
|
|
- this.getList();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ doSubmit();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -483,6 +590,174 @@ export default {
|
|
|
this.download(response.msg);
|
|
this.download(response.msg);
|
|
|
this.exportLoading = false;
|
|
this.exportLoading = false;
|
|
|
}).catch(() => {});
|
|
}).catch(() => {});
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 加载表单中可选区域列表 */
|
|
|
|
|
+ loadAddressListForForm(currentCompanyId) {
|
|
|
|
|
+ return Promise.all([
|
|
|
|
|
+ listDisQwIpadServer({ pageNum: 1, pageSize: 9999 }),
|
|
|
|
|
+ allCorp()
|
|
|
|
|
+ ]).then(([serverRes, corpRes]) => {
|
|
|
|
|
+ this.areaList = this.normalizeAreaData(serverRes.rows || serverRes.data || []);
|
|
|
|
|
+ const allCorps = corpRes.data || [];
|
|
|
|
|
+ this.boundAddrIds = [];
|
|
|
|
|
+ this.currentAddrIdsForForm = currentCompanyId
|
|
|
|
|
+ ? ((allCorps.find(c => c.corpId === currentCompanyId) || {}).addressBindIp || "").split(",").filter(Boolean)
|
|
|
|
|
+ : [];
|
|
|
|
|
+ allCorps.forEach(corp => {
|
|
|
|
|
+ if (corp.corpId !== currentCompanyId && corp.addressBindIp) {
|
|
|
|
|
+ const ids = corp.addressBindIp.split(",");
|
|
|
|
|
+ ids.forEach(id => {
|
|
|
|
|
+ if (id && this.boundAddrIds.indexOf(id) === -1) {
|
|
|
|
|
+ this.boundAddrIds.push(id);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 打开选择区域弹窗 */
|
|
|
|
|
+ handleSelectArea() {
|
|
|
|
|
+ const ids = this.ids;
|
|
|
|
|
+ if (!ids || ids.length === 0) {
|
|
|
|
|
+ this.$message.warning("请先选择一条企微主体记录");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const currentRow = this.qwCompanyList.find(item => item.id === ids[0]);
|
|
|
|
|
+ if (!currentRow) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.currentCompanyForArea = currentRow;
|
|
|
|
|
+ this.areaDialogTitle = "选择区域 - " + currentRow.corpName;
|
|
|
|
|
+ this.currentAreaSelection = currentRow.addressBindIp ? currentRow.addressBindIp.split(",") : [];
|
|
|
|
|
+ const preSelectedIps = [...this.currentAreaSelection];
|
|
|
|
|
+ this.areaFilter = "";
|
|
|
|
|
+
|
|
|
|
|
+ // 加载区域列表和已绑定的addressId
|
|
|
|
|
+ Promise.all([
|
|
|
|
|
+ listDisQwIpadServer({ pageNum: 1, pageSize: 9999 }),
|
|
|
|
|
+ allCorp()
|
|
|
|
|
+ ]).then(([serverRes, corpRes]) => {
|
|
|
|
|
+ this.areaList = this.normalizeAreaData(serverRes.rows || serverRes.data || []);
|
|
|
|
|
+ const allCorps = corpRes.data || [];
|
|
|
|
|
+ // 收集所有已被其他主体绑定的addressId(排除当前主体)
|
|
|
|
|
+ this.boundAddrIds = [];
|
|
|
|
|
+ allCorps.forEach(corp => {
|
|
|
|
|
+ if (corp.corpId !== currentRow.corpId && corp.addressBindIp) {
|
|
|
|
|
+ const ids = corp.addressBindIp.split(",");
|
|
|
|
|
+ ids.forEach(id => {
|
|
|
|
|
+ if (id && this.boundAddrIds.indexOf(id) === -1) {
|
|
|
|
|
+ this.boundAddrIds.push(id);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ this.areaDialogVisible = true;
|
|
|
|
|
+ // 在表格中回显已选中的行(延时确保表格渲染完毕)
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ if (this.$refs.areaTable) {
|
|
|
|
|
+ this.areaList.forEach(row => {
|
|
|
|
|
+ if (preSelectedIps.indexOf(row.ip) > -1 && this.boundAddrIds.indexOf(row.ip) === -1) {
|
|
|
|
|
+ this.$refs.areaTable.toggleRowSelection(row, true);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 区域表格多选变化 */
|
|
|
|
|
+ handleAreaSelectionChange(selection) {
|
|
|
|
|
+ // 当前可以被选中的(排除已被其他主体绑定的)
|
|
|
|
|
+ const validSelection = selection.filter(row => this.boundAddrIds.indexOf(row.ip) === -1);
|
|
|
|
|
+ this.currentAreaSelection = validSelection.map(row => row.ip);
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 控制行是否可选(已被其他主体绑定的不可选) */
|
|
|
|
|
+ checkSelectable(row) {
|
|
|
|
|
+ return this.boundAddrIds.indexOf(row.ip) === -1;
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 提交区域选择 */
|
|
|
|
|
+ submitAreaSelection() {
|
|
|
|
|
+ if (!this.currentCompanyForArea) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 提交前实时校验:保证选中的ip没有被其他主体绑定
|
|
|
|
|
+ allCorp().then(corpRes => {
|
|
|
|
|
+ const allCorps = corpRes.data || [];
|
|
|
|
|
+ const boundIps = [];
|
|
|
|
|
+ allCorps.forEach(corp => {
|
|
|
|
|
+ if (corp.corpId !== this.currentCompanyForArea.corpId && corp.addressBindIp) {
|
|
|
|
|
+ corp.addressBindIp.split(",").forEach(id => {
|
|
|
|
|
+ if (id && boundIps.indexOf(id) === -1) boundIps.push(id);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ const conflictIps = this.currentAreaSelection.filter(ip => boundIps.indexOf(ip) > -1);
|
|
|
|
|
+ if (conflictIps.length > 0) {
|
|
|
|
|
+ this.$message.error("以下IP已被其他主体绑定,不能重复绑定:" + conflictIps.join(", "));
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const addressBindIp = this.currentAreaSelection.join(",");
|
|
|
|
|
+ const data = {
|
|
|
|
|
+ id: this.currentCompanyForArea.id,
|
|
|
|
|
+ addressBindIp: addressBindIp
|
|
|
|
|
+ };
|
|
|
|
|
+ updateQwCompany(data).then(() => {
|
|
|
|
|
+ this.msgSuccess("区域选择成功");
|
|
|
|
|
+ this.areaDialogVisible = false;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 统一区域数据格式(兼容字符串数组和对象数组) */
|
|
|
|
|
+ normalizeAreaData(data) {
|
|
|
|
|
+ return (data || []).map(item => {
|
|
|
|
|
+ if (typeof item === 'string') {
|
|
|
|
|
+ return { ip: item, title: '', addressId: '' };
|
|
|
|
|
+ }
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ getAddressLabels(addressIdStr) {
|
|
|
|
|
+ if (!addressIdStr || !this.areaList.length) {
|
|
|
|
|
+ return addressIdStr || "";
|
|
|
|
|
+ }
|
|
|
|
|
+ const ids = addressIdStr.split(",");
|
|
|
|
|
+ return ids.map(id => {
|
|
|
|
|
+ const item = this.areaList.find(a => a.ip === id);
|
|
|
|
|
+ return item ? (item.ip || id) : id;
|
|
|
|
|
+ }).join("、");
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ /** 筛选后的区域列表 */
|
|
|
|
|
+ filteredAddressList() {
|
|
|
|
|
+ if (!this.areaFilter) {
|
|
|
|
|
+ return this.areaList;
|
|
|
|
|
+ }
|
|
|
|
|
+ const filter = this.areaFilter.toLowerCase();
|
|
|
|
|
+ return this.areaList.filter(item =>
|
|
|
|
|
+ (item.ip && item.ip.toLowerCase().indexOf(filter) > -1) ||
|
|
|
|
|
+ (item.title && item.title.toLowerCase().indexOf(filter) > -1) ||
|
|
|
|
|
+ (item.addressId && item.addressId.toLowerCase().indexOf(filter) > -1)
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 表单中可选区域列表(排除已被其他主体绑定的) */
|
|
|
|
|
+ availableAddressList() {
|
|
|
|
|
+ if (!this.areaList.length) {
|
|
|
|
|
+ return [];
|
|
|
|
|
+ }
|
|
|
|
|
+ const currentFormCorpId = this.form.corpId;
|
|
|
|
|
+ const result = this.areaList.map(item => {
|
|
|
|
|
+ const isBoundToOther = this.boundAddrIds.indexOf(item.ip) > -1;
|
|
|
|
|
+ // 编辑时,当前主体已绑定的地址应该可选
|
|
|
|
|
+ const isCurrentOwn = currentFormCorpId && this.currentAddrIdsForForm && this.currentAddrIdsForForm.indexOf(item.ip) > -1;
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ disabled: isBoundToOther && !isCurrentOwn
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ return result;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|