From 4b9f7d4751b245d3c18b138fa126056159f9bca9 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期四, 09 一月 2025 11:14:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue | 515 ++++++++++++++++++++------------------------------------
1 files changed, 186 insertions(+), 329 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
index 2ab9bd1..95d0ec0 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
@@ -18,20 +18,49 @@
@current-change="currentChange"
>
<template slot="menuLeft" slot-scope="scope">
- <el-button icon="el-icon-plus" plain size="small" type="primary" @click="rowSaveHandlerClick">鍒涘缓</el-button>
- <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">鍒犻櫎</el-button>
- <el-button icon="el-icon-view" plain size="small" type="primary" @click="chekView">鏌ョ湅浣跨敤鑼冨洿</el-button>
- <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">
+ <el-button v-if="permissionList.addBtn" class="button-custom-icon" plain size="small" type="primary"
+ @click="rowSaveHandlerClick">
+ <icon-show :name="permissionList.addBtn.source"></icon-show>
+ 鍒涘缓
+ </el-button>
+ <el-button v-if="permissionList.delBtn" class="button-custom-icon" plain size="small" type="danger"
+ @click="allDelHandler">
+ <icon-show :name="permissionList.delBtn.source"></icon-show>
+ 鍒犻櫎
+ </el-button>
+ <el-button v-if="permissionList.viewTheScopeBtn" class="button-custom-icon" plain size="small"
+ type="primary"
+ @click="chekView">
+ <icon-show :name="permissionList.viewTheScopeBtn.source"></icon-show>
+ 鏌ョ湅浣跨敤鑼冨洿
+ </el-button>
+ <el-button v-if="permissionList.downloadImportTemplateBtn" class="button-custom-icon" plain size="small"
+ type="primary" @click="downloadTemplateHandler">
+ <icon-show :name="permissionList.downloadImportTemplateBtn.source"></icon-show>
涓嬭浇瀵煎叆妯℃澘
</el-button>
- <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadHandler">瀵煎叆</el-button>
- <el-button icon="el-icon-download" plain size="small" type="primary" @click="downLoadHandler">瀵煎嚭</el-button>
+ <el-button v-if="permissionList.importBtn" class="button-custom-icon" plain size="small" type="primary"
+ @click="upLoadHandler">
+ <icon-show :name="permissionList.importBtn.source"></icon-show>
+ 瀵煎叆
+ </el-button>
+ <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary"
+ @click="downLoadHandler">
+ <icon-show :name="permissionList.exportBtn.source"></icon-show>
+ 瀵煎嚭
+ </el-button>
</template>
<template slot="menu" slot-scope="scope">
- <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">缂栬緫
+ <el-button v-if="permissionList.editBtn" size="small" type="text"
+ @click="editBtnClick(scope.row)">
+ <icon-show :name="permissionList.editBtn.source"></icon-show>
+ 缂栬緫
</el-button>
- <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎
+ <el-button v-if="permissionList.delBtn" size="small" type="text"
+ @click="rowDeleteHandler(scope.row)">
+ <icon-show :name="permissionList.delBtn.source"></icon-show>
+ 鍒犻櫎
</el-button>
</template>
</avue-crud>
@@ -41,7 +70,7 @@
<el-aside width="30%">
<basic-container>
<div style="height: 85vh; overflow-y: auto">
- <el-descriptions :column="1" border size="medium" title="灞炴�ч」" :labelStyle="{width:'120px'}">
+ <el-descriptions :column="1" :labelStyle="{width:'120px'}" border size="medium" title="灞炴�ч」">
<el-descriptions-item>
<template slot="label">
鍚嶇О
@@ -55,7 +84,7 @@
鏍囩
</template>
<div>
- {{ lastItem.name }}
+ {{ lastItem.name }}
</div>
</el-descriptions-item>
<el-descriptions-item>
@@ -63,7 +92,7 @@
鎻忚堪
</template>
<div>
- {{ lastItem.description }}
+ {{ lastItem.description }}
</div>
</el-descriptions-item>
<el-descriptions-item>
@@ -75,17 +104,18 @@
</el-descriptions>
<!-- 鍊煎煙 -->
- <el-descriptions v-if="!isSpecialDataType" :column="1" :title="lastItem.attributeDataType || 'VTString'" border
- class="margin-top"
- size="medium" :labelStyle="{width:'120px'}">
+ <el-descriptions v-if="!isSpecialDataType" :column="1" :labelStyle="{width:'120px'}"
+ :title="lastItem.attributeDataType || 'VTString'"
+ border
+ class="margin-top" size="medium">
<el-descriptions-item>
<template slot="label">
鍏佽涓虹┖
</template>
<div>
- <el-tag :type="lastItem.nullableFlag ? 'success' : 'danger'">
- {{ lastItem.nullableFlag ? '鏄�' : '鍚�' }}
- </el-tag>
+ <el-tag :type="lastItem.nullableFlag ? 'success' : 'danger'">
+ {{ lastItem.nullableFlag ? '鏄�' : '鍚�' }}
+ </el-tag>
</div>
</el-descriptions-item>
<el-descriptions-item v-if="accuracy">
@@ -99,7 +129,7 @@
闀垮害
</template>
<div>
- {{ lastItem.attrLength }}
+ {{ lastItem.attrLength }}
</div>
</el-descriptions-item>
<el-descriptions-item>
@@ -107,20 +137,20 @@
榛樿鍊�
</template>
<div>
- {{ lastItem.defaultValue }}
+ {{ lastItem.defaultValue }}
</div>
</el-descriptions-item>
</el-descriptions>
<!-- VTString -->
<el-descriptions v-if="lastItem.attributeDataType === 'VTString' || !lastItem.attributeDataType"
- :column="1" border class="margin-top" size="medium" title="鍊煎煙" :labelStyle="{width:'120px'}">
+ :column="1" :labelStyle="{width:'120px'}" border class="margin-top" size="medium" title="鍊煎煙">
<el-descriptions-item>
<template slot="label">
褰撳墠绫诲瀷
</template>
<div>
- {{ lastItem.version ? '閾炬帴绫诲瀷' : '涓氬姟绫诲瀷' }}
+ {{ lastItem.version ? '閾炬帴绫诲瀷' : '涓氬姟绫诲瀷' }}
</div>
</el-descriptions-item>
<el-descriptions-item>
@@ -128,7 +158,7 @@
褰撳墠绫诲瀷鍊�
</template>
<div>
- {{ lastItem.version ? lastItem.linkTypeName : lastItem.btmTypeId }}
+ {{ lastItem.version ? lastItem.linkTypeName : lastItem.btmTypeId }}
</div>
</el-descriptions-item>
<el-descriptions-item v-if="lastItem.version">
@@ -136,7 +166,7 @@
褰撳墠鐗堟湰娆�
</template>
<div>
- {{ lastItem.version }}
+ {{ lastItem.version }}
</div>
</el-descriptions-item>
<el-descriptions-item>
@@ -144,9 +174,9 @@
浣跨敤鏋氫妇
</template>
<div>
- <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
- {{ lastItem.enumId ? '鏄�' : '鍚�' }}
- </el-tag>
+ <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
+ {{ lastItem.enumId ? '鏄�' : '鍚�' }}
+ </el-tag>
</div>
</el-descriptions-item>
<el-descriptions-item>
@@ -154,7 +184,7 @@
褰撳墠鏋氫妇绫诲瀷
</template>
<div>
- {{ lastItem.enumId }}
+ {{ lastItem.enumId }}
</div>
</el-descriptions-item>
<el-descriptions-item>
@@ -169,15 +199,15 @@
<!-- VTInteger && VTInteger -->
<el-descriptions
v-if="lastItem.attributeDataType === 'VTInteger' || lastItem.attributeDataType === 'VTInteger'"
- :column="1" border class="margin-top" size="medium" title="鍊煎煙" :labelStyle="{width:'120px'}">
+ :column="1" :labelStyle="{width:'120px'}" border class="margin-top" size="medium" title="鍊煎煙">
<el-descriptions-item>
<template slot="label">
浣跨敤鏋氫妇
</template>
<div>
- <el-tag :type="lastItem.enumFlag ? 'success' : 'danger'">
- {{ lastItem.enumFlag ? '鏄�' : '鍚�' }}
- </el-tag>
+ <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
+ {{ lastItem.enumId ? '鏄�' : '鍚�' }}
+ </el-tag>
</div>
</el-descriptions-item>
<el-descriptions-item>
@@ -185,7 +215,7 @@
鏋氫妇绫诲瀷
</template>
<div>
- {{ lastItem.enumFlag }}
+ {{ lastItem.enumId }}
</div>
</el-descriptions-item>
<el-descriptions-item>
@@ -200,7 +230,7 @@
</el-descriptions>
<!-- VTDouble -->
<el-descriptions v-if="lastItem.attributeDataType === 'VTDouble'"
- :column="1" border class="margin-top" size="medium" title="鍊煎煙" :labelStyle="{width:'120px'}">
+ :column="1" :labelStyle="{width:'120px'}" border class="margin-top" size="medium" title="鍊煎煙">
<el-descriptions-item>
<template slot="label">
@@ -254,20 +284,22 @@
</el-col>
<!-- VTString -->
<div v-if="form.attributeDataType === 'VTString'" style="clear: both">
- <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{ form.attributeDataType }}</h3>
+ <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{
+ form.attributeDataType
+ }}</h3>
<el-col :span="8">
<el-form-item label="闀垮害锛�" prop="attrLength">
- <el-input-number v-model="form.attrLength" controls-position="right" :min="0"></el-input-number>
+ <el-input-number v-model="form.attrLength" :min="0" controls-position="right"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item v-if="form.enumSwitch" label="榛樿鍊硷細" prop="defaultValue">
+ <el-form-item v-if="form.enumSwitch" label="榛樿鍊硷細" prop="defaultValue">
<el-select v-model="form.defaultValue">
<el-option v-for="(item,index) in enumAddListChange" :key="index" :label="item.replace('=','')"
:value="item.replace('=','')"></el-option>
</el-select>
</el-form-item>
- <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
+ <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
<el-input v-model="form.defaultValue"></el-input>
</el-form-item>
</el-col>
@@ -288,18 +320,19 @@
</el-col>
<el-col :span="8">
<el-form-item label="閫夋嫨鍙傜収绫诲瀷锛�" prop="referValue">
- <el-input v-model="form.referValue" @focus="referFormFocusHandler" :clearable="true"></el-input>
+ <avue-input-tree key="businessReferValue" v-if="form.attributeSelectType === 'business'" default-expand-all :clearable="true" v-model="form.referValue" placeholder="璇烽�夋嫨鍐呭" :dic="businessData" @change="referValueChange"></avue-input-tree>
+ <avue-input-tree key="linkReferValue" v-else default-expand-all v-model="form.referValue" placeholder="璇烽�夋嫨鍐呭" :clearable="true" :dic="linkTypeData" @change="referValueChange"></avue-input-tree>
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item v-if="form.attributeSelectType === 'link'" label="鐗堟湰娆★細" prop="version">
+ <el-form-item v-show="form.attributeSelectType === 'link'" label="鐗堟湰娆★細" prop="version">
<el-select v-model="form.version" placeholder="璇烽�夋嫨鐗堟湰娆�">
<el-option :value="1" label="褰撳墠鐗堟湰娆�"></el-option>
<el-option :value="3" label="鏈�鏂扮増鏈"></el-option>
</el-select>
</el-form-item>
</el-col>
- <div v-if="!form.referValue" style="clear: both">
+ <div v-show="showEnumSwitch" style="clear: both">
<el-col :span="8">
<el-form-item label="浣跨敤鏋氫妇锛�" prop="enumSwitch">
<el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
@@ -307,7 +340,8 @@
</el-col>
<el-col :span="8">
<el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鍊煎煙锛�'" prop="enumSwitch">
- <el-select v-if="form.enumSwitch" v-model="form.enumId" placeholder="璇烽�夋嫨鏋氫妇绫诲瀷" @change="enumSelectChange">
+ <el-select v-if="form.enumSwitch" v-model="form.enumId" placeholder="璇烽�夋嫨鏋氫妇绫诲瀷"
+ @change="enumSelectChange">
<el-option v-for="(item,index) in attributeDataTypePickList" :key="index" :label="item.key"
:value="item.key"></el-option>
</el-select>
@@ -317,29 +351,36 @@
<el-col :span="8">
<el-form-item v-if="!form.enumSwitch" label-width="10px" labeldd="杩愮畻绗︼細">
<div>
- <el-button size="mini" @click="enumAddHandler"> = </el-button>
+ <el-button size="mini" @click="enumAddHandler"> =</el-button>
</div>
</el-form-item>
</el-col>
- <el-col :span="24" v-if="form.rangeValue && form.rangeValue.length>0">
+ <el-col v-if="form.rangeValue && form.rangeValue.length>0" :span="24">
<el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
- <el-tag :key="item" v-for="item in form.rangeValue.split('\n')" plain :closable="!form.enumSwitch" type="success" @close="handleRangeValueDel(item)" style="margin: 0 10px 5px 0">{{ item }}</el-tag>
- <el-input v-model="form.rangeValue" :readonly="form.enumSwitch" type="textarea" :rows="2" style="width: 0;height:0;overflow: hidden"></el-input>
+ <el-tag v-for="item in form.rangeValue.split('\n')" :key="item" :closable="!form.enumSwitch" plain
+ style="margin: 0 10px 5px 0" type="success" @close="handleRangeValueDel(item)">{{ item }}
+ </el-tag>
+ <el-input v-model="form.rangeValue" :readonly="form.enumSwitch" :rows="2"
+ style="width: 0;height:0;overflow: hidden"
+ type="textarea"></el-input>
</el-form-item>
</el-col>
</div>
</div>
<!-- VTInteger VTLong -->
- <div v-else-if="form.attributeDataType === 'VTInteger' || form.attributeDataType === 'VTLong' " style="clear: both">
- <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{ form.attributeDataType }}</h3>
+ <div v-else-if="form.attributeDataType === 'VTInteger' || form.attributeDataType === 'VTLong' "
+ style="clear: both">
+ <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{
+ form.attributeDataType
+ }}</h3>
<el-col :span="8">
- <el-form-item v-if="form.enumSwitch" label="榛樿鍊硷細" prop="defaultValue">
+ <el-form-item v-if="form.enumSwitch" label="榛樿鍊硷細" prop="defaultValue">
<el-select v-model="form.defaultValue">
<el-option v-for="(item,index) in enumAddListChange" :key="index" :label="item.replace('=','')"
:value="item.replace('=','')"></el-option>
</el-select>
</el-form-item>
- <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
+ <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
<el-input-number v-model="form.defaultValue" controls-position="right"></el-input-number>
</el-form-item>
</el-col>
@@ -378,35 +419,44 @@
</div>
</el-form-item>
</el-col>
- <el-col :span="24" v-if="form.rangeValue && form.rangeValue.length>0">
+ <el-col v-if="form.rangeValue && form.rangeValue.length>0" :span="24">
<el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
- <el-tag :key="item" v-for="item in form.rangeValue.split('\n')" plain :closable="!form.enumSwitch" type="success" @close="handleRangeValueDel(item)" style="margin: 0 10px 5px 0">{{ item }}</el-tag>
- <el-input v-model="form.rangeValue" :readonly="form.enumSwitch" type="textarea" :rows="2" style="width: 0;height:0;overflow: hidden"></el-input>
+ <el-tag v-for="item in form.rangeValue.split('\n')" :key="item" :closable="!form.enumSwitch" plain
+ style="margin: 0 10px 5px 0" type="success" @close="handleRangeValueDel(item)">{{ item }}
+ </el-tag>
+ <el-input v-model="form.rangeValue" :readonly="form.enumSwitch" :rows="2"
+ style="width: 0;height:0;overflow: hidden"
+ type="textarea"></el-input>
</el-form-item>
</el-col>
</div>
<!-- VTDouble -->
<div v-else-if="form.attributeDataType === 'VTDouble'" style="clear: both">
- <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{ form.attributeDataType }}</h3>
+ <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{
+ form.attributeDataType
+ }}</h3>
<el-col :span="8">
<el-form-item label="绮惧害锛�" prop="precisionLength">
- <el-input-number v-model="form.precisionLength" controls-position="right" :precision="0" :step="1" :min="0"></el-input-number>
+ <el-input-number v-model="form.precisionLength" :min="0" :precision="0" :step="1"
+ controls-position="right"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="闀垮害锛�" prop="scaleLength">
- <el-input-number v-model="form.scaleLength" controls-position="right" :precision="0" :step="1" :min="0"></el-input-number>
+ <el-input-number v-model="form.scaleLength" :min="0" :precision="0" :step="1"
+ controls-position="right"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item v-if="form.enumSwitch" label="榛樿鍊硷細" prop="defaultValue">
+ <el-form-item v-if="form.enumSwitch" label="榛樿鍊硷細" prop="defaultValue">
<el-select v-model="form.defaultValue">
<el-option v-for="(item,index) in enumAddListChange" :key="index" :label="item.replace('=','')"
:value="item.replace('=','')"></el-option>
</el-select>
</el-form-item>
- <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
- <el-input-number v-model="form.defaultValue" controls-position="right" :precision="form.precisionLength"></el-input-number>
+ <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
+ <el-input-number v-model="form.defaultValue" :precision="form.precisionLength"
+ controls-position="right"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
@@ -417,7 +467,7 @@
<h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px;clear: both">鍊煎煙</h3>
<el-col :span="8">
<el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鍊煎煙锛�'" prop="enumAddValue">
- <el-input v-model="form.enumAddValue"> </el-input>
+ <el-input v-model="form.enumAddValue"></el-input>
</el-form-item>
</el-col>
<el-col :span="16">
@@ -433,15 +483,21 @@
</div>
</el-form-item>
</el-col>
- <el-col :span="24" v-if="form.rangeValue && form.rangeValue.length>0">
+ <el-col v-if="form.rangeValue && form.rangeValue.length>0" :span="24">
<el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
- <el-tag :key="item" v-for="item in form.rangeValue.split('\n')" plain closable type="success" @close="handleRangeValueDel(item)" style="margin: 0 10px 5px 0">{{ item }}</el-tag>
- <el-input v-model="form.rangeValue" type="textarea" :rows="2" style="width: 0;height:0;overflow: hidden"></el-input>
+ <el-tag v-for="item in form.rangeValue.split('\n')" :key="item" closable plain
+ style="margin: 0 10px 5px 0"
+ type="success" @close="handleRangeValueDel(item)">{{ item }}
+ </el-tag>
+ <el-input v-model="form.rangeValue" :rows="2" style="width: 0;height:0;overflow: hidden"
+ type="textarea"></el-input>
</el-form-item>
</el-col>
</div>
<div v-else-if="form.attributeDataType === 'VTBoolean'" style="clear: both">
- <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{ form.attributeDataType }}</h3>
+ <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{
+ form.attributeDataType
+ }}</h3>
<el-col :span="8">
<el-form-item label="榛樿鍊硷細" prop="defaultValue">
<el-select v-model="form.defaultValue">
@@ -458,58 +514,6 @@
</div>
</div>
</el-form>
-
- <!-- 涓氬姟绫诲瀷瀵硅瘽妗� -->
- <el-dialog
- v-dialogDrag
- :visible.sync="businessVisible"
- append-to-body="true"
- class="avue-dialog"
- title="涓氬姟绫诲瀷閫夋嫨"
- width="70%"
- >
- <avue-crud
- ref="businessCrud"
- :data="businessData"
- :option="businessOption"
- :table-loading="businessLoading"
- @search-change="businessHandleSearch"
- @search-reset="businessHandleReset"
- @row-click="businessRowClick"
- >
- </avue-crud>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="businessSaveHandler">纭� 瀹�</el-button>
- <el-button @click="businessEmpty">娓� 绌�</el-button>
- <el-button @click="businessVisible = false">鍙� 娑�</el-button>
- </span>
- </el-dialog>
-
- <!-- 閾炬帴绫诲瀷瀵硅瘽妗� -->
- <el-dialog
- v-dialogDrag
- :visible.sync="linkTypeVisible"
- append-to-body="true"
- class="avue-dialog"
- title="閾炬帴绫诲瀷閫夋嫨"
- width="70%"
- >
- <avue-crud
- ref="linkTypeCrud"
- :data="linkTypeData"
- :option="linkTypeOption"
- :table-loading="linkTypeLoading"
- @search-change="linkHandleSearch"
- @search-reset="linkHandleReset"
- @row-click="linkRowClick"
- >
- </avue-crud>
- <span slot="footer" class="dialog-footer">
- <el-button @click="linkEmpty">娓� 绌�</el-button>
- <el-button @click="linkTypeVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="linkSaveHandler">纭� 瀹�</el-button>
- </span>
- </el-dialog>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="addSaveHandler">纭� 瀹�</el-button>
@@ -557,6 +561,7 @@
import basicOption from '@/util/basic-option';
import {column} from "./option"
import func from "@/util/func";
+import {mapGetters} from "vuex";
export default {
name: "index",
@@ -569,73 +574,8 @@
]
},
dialogTitle: "",
- businessRow: {},
- linkRow: {},
- linkDataSearch: [],
- businessSearchParams: {},
- linkTypeSearchParams: {},
- businessLoading: false,
- linkTypeLoading: false,
- businessVisible: false,
- linkTypeVisible: false,
businessData: [],
linkTypeData: [],
- businessOption: {
- ...basicOption,
- addBtn: false,
- menu: false,
- searchMenuSpan: 8,
- selection: false,
- refreshBtn: false,
- searchLabelWidth: 100,
- highlightCurrentRow: true,
- column: [
- {
- label: '涓氬姟绫诲瀷鍚�',
- prop: 'name',
- sortable: true,
- search: true
- },
- {
- label: '鏍囩',
- prop: 'label',
- sortable: true,
- },
- {
- label: '鐖剁被',
- prop: 'fName',
- sortable: true,
- },
- {
- label: '鐗堟湰瑙勫垯',
- prop: 'revRuleName',
- sortable: true,
- },
- {
- label: '鐢熷懡鍛ㄦ湡',
- prop: 'lifeCycle',
- sortable: true,
- },
- ]
- },
- linkTypeOption: {
- ...basicOption,
- addBtn: false,
- menu: false,
- searchMenuSpan: 8,
- selection: false,
- refreshBtn: false,
- searchLabelWidth: 100,
- highlightCurrentRow: true,
- column: [
- {
- label: '閾炬帴绫诲瀷鍚�',
- prop: 'name',
- sortable: true,
- search: true
- },
- ]
- },
tableData: [],
option: {
...basicOption,
@@ -667,7 +607,7 @@
searchMenuSpan: 8,
refreshBtn: false,
selection: false,
- header:false,
+ header: false,
column: [
{
label: '鍚嶇О',
@@ -688,6 +628,8 @@
},
addVisible: false,
addLoading: false,
+ referValueDic:[],
+ showEnumSwitch:false,
form: {
id: "",
name: "",
@@ -695,8 +637,8 @@
description: "",
nullableFlag: true,
attrLength: 50,
- precisionLength:2,//绮惧害
- scaleLength:20,//闀垮害
+ precisionLength: 2,//绮惧害
+ scaleLength: 20,//闀垮害
enumFlag: false,
enumId: "",
enumSwitch: false,
@@ -725,6 +667,18 @@
}
},
computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
+ delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
+ editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
+ exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
+ importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
+ downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOADFILE, false),
+ viewTheScopeBtn: this.vaildData(this.permission[this.$route.query.id].VIRTUALVIEW, false),
+ };
+ },
lastItem() {
return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1] : {};
},
@@ -765,9 +719,24 @@
this.tableData = data;
this.page.total = res.data.total;
this.tableLoading = false;
- }).catch(err => {
- this.$message.error(err)
});
+ //鑾峰彇涓氬姟绫诲瀷鏁版嵁
+ getBizTypes().then(res => {
+ const data = res.data.data.map(item => ({
+ label: item.name,
+ value:item.name,
+ desc:item.label
+ }));
+ this.businessData = data;
+ })
+ //鑾峰彇閾炬帴绫诲瀷鏁版嵁
+ getAllLtName().then(res => {
+ const data = res.data.data.map(item => ({
+ label: item,
+ value:item
+ }));
+ this.linkTypeData = data;
+ })
},
// 琛ㄦ牸澶撮儴鍒锋柊
@@ -776,7 +745,7 @@
},
// 鎼滅储
- handleSearch(params, done) {
+ handleSearch(params, done) {debugger;
this.searchParams = {
"conditionMap[id]": "*" + params.id + "*"
};
@@ -805,7 +774,7 @@
this.lastIndex = newIndex;
},
() => {
- this.selectList = [];
+ this.selectList = [row];
}
);
},
@@ -950,18 +919,18 @@
}
this.getEnumMapByTypeHandler(this.form.attributeDataType);
this.addVisible = true;
- this.lastIndex=-1;//闃叉瑙﹀彂琛岀偣鍑讳簨浠跺悗娓呴櫎閫変腑椤�
+ this.lastIndex = -1;//闃叉瑙﹀彂琛岀偣鍑讳簨浠跺悗娓呴櫎閫変腑椤�
},
// 灞炴�х被鍨嬩笅鎷夋change
attributeDataTypeChange(val) {
this.form.rangeValue = null;
- this.form.nullableFlag=true;
+ this.form.nullableFlag = true;
this.getEnumMapByTypeHandler(val);
this.form.enumSwitch = false;
if (val === 'VTBoolean') {
this.form.defaultValue = 'false';
- } else{
+ } else {
this.form.defaultValue = '';
}
},
@@ -991,8 +960,8 @@
enumSelectChange(val) {
const list = this.attributeDataTypePickList.find(item => item.key === val).values;
this.form.rangeValue = list.join('\n');
- this.enumAddListChange=list;
- this.form.defaultValue = list[0].replace('=','');
+ this.enumAddListChange = list;
+ this.form.defaultValue = list[0].replace('=', '');
},
// 浣跨敤鏋氫妇switch婊戝潡change浜嬩欢
@@ -1001,12 +970,12 @@
this.form.enumId = this.attributeDataTypePickList[0].key;
const list = this.attributeDataTypePickList[0].values;
this.form.rangeValue = list.join('\n');
- this.enumAddListChange=list;
- this.form.defaultValue = list[0].replace('=','');
+ this.enumAddListChange = list;
+ this.form.defaultValue = list[0].replace('=', '');
} else {
this.form.defaultValue = "";
this.form.rangeValue = "";
- this.enumAddListChange=[];
+ this.enumAddListChange = [];
this.enumId = "";
}
},
@@ -1111,141 +1080,18 @@
//鍒犻櫎鍊煎煙
handleRangeValueDel(val) {
let currentRangeArray = this.form.rangeValue ? this.form.rangeValue.split('\n').filter(item => item.trim() !== val) : [];
- this.enumAddListChange =currentRangeArray;
+ this.enumAddListChange = currentRangeArray;
this.form.rangeValue = currentRangeArray.join('\n');
},
// 鍊煎煙绫诲瀷鍒囨崲
attributeSelectTypeChange() {
+ this.form.referValue = ''; // 鍒囨崲鍊煎煙绫诲瀷 娓呯┖褰撳墠鍙傜収
this.$forceUpdate(); // 寮哄埗鏇存柊form缁勪欢
- this.form.referValue = null; // 鍒囨崲鍊煎煙绫诲瀷 娓呯┖褰撳墠鍙傜収
},
-
- // 閫夋嫨鍙傜収
- referFormFocusHandler() {
- const handlers = {
- business: () => {
- this.businessVisible = true;
- this.businessLoading = true;
- this.businessGetTable();
- },
- link: () => {
- this.linkTypeVisible = true;
- this.linkTypeLoading = true;
- this.linkGetTable();
- }
- };
-
- const {attributeSelectType} = this.form;
- const handler = handlers[attributeSelectType];
-
- if (handler) {
- handler();
- }
- ;
+ //鍙傜収绫诲瀷鏁版嵁鍙樺寲
+ referValueChange(data){
+ this.showEnumSwitch=!data.value;
},
-
- // 涓氬姟绫诲瀷琛ㄦ牸鏁版嵁璇锋眰
- businessGetTable() {
- getBizTypes(this.businessSearchParams).then(res => {
- const data = res.data.data;
- this.businessData = data;
- this.businessLoading = false;
- })
- },
-
- // 涓氬姟绫诲瀷鍙傜収鎼滅储
- businessHandleSearch(val, done) {
- this.businessSearchParams = {
- btmName: val.name
- }
- this.businessGetTable();
- done()
- },
-
- // 涓氬姟绫诲瀷鍙傜収娓呯┖鎼滅储
- businessHandleReset() {
- this.businessSearchParams = {};
- this.businessGetTable();
- },
-
- // 閾炬帴绫诲瀷琛ㄦ牸鏁版嵁璇锋眰
- linkGetTable() {
- getAllLtName(this.linkTypeSearchParams).then(res => {
- const data = res.data.data.map(item => ({name: item}));
- ;
- this.linkTypeData = data;
- this.linkDataSearch = data;
- this.linkTypeLoading = false;
- })
- },
-
- // 閾炬帴绫诲瀷鍙傜収鎼滅储
- linkHandleSearch(params, done) {
- const {name} = params;
-
- if (!params.name) {
- this.linkTypeData = this.linkDataSearch;
- return done();
- }
- ;
-
- this.linkTypeData = this.linkDataSearch.filter(item => {
- console.log(item)
- return item.name && item.name.includes(name);
- });
-
- done();
- },
-
- // 閾炬帴绫诲瀷鍙傜収娓呯┖鎼滅储
- linkHandleReset() {
- this.linkTypeData = this.linkDataSearch;
- },
-
- // 涓氬姟绫诲瀷琛ㄦ牸琛岀偣鍑�
- businessRowClick(row) {
- this.businessRow = row;
- },
-
- // 涓氬姟绫诲瀷纭畾淇濆瓨
- businessSaveHandler() {
- if (func.isEmptyObject(this.businessRow)) {
- this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹紒')
- return;
- }
-
- this.form.referValue = this.businessRow.name;
- this.businessVisible = false;
- },
-
- // 涓氬姟绫诲瀷娓呯┖
- businessEmpty() {
- this.form.referValue = null;
- this.businessVisible = false;
- },
-
- // 閾炬帴绫诲瀷纭畾淇濆瓨
- linkRowClick(row) {
- this.linkRow = row;
- },
-
- // 涓氬姟绫诲瀷纭畾淇濆瓨
- linkSaveHandler() {
- if (func.isEmptyObject(this.linkRow)) {
- this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹紒')
- return;
- }
-
- this.form.referValue = this.linkRow.name;
- this.linkTypeVisible = false;
- },
-
- // 閾炬帴绫诲瀷娓呯┖
- linkEmpty() {
- this.form.referValue = null;
- this.linkTypeVisible = false;
- },
-
// 鍏抽棴鏂板瀵硅瘽妗�
addEscHandler() {
this.addVisible = false;
@@ -1256,8 +1102,8 @@
description: "",
nullableFlag: true,
attrLength: 50,
- precisionLength:2,//绮惧害
- scaleLength:20,//闀垮害
+ precisionLength: 2,//绮惧害
+ scaleLength: 20,//闀垮害
enumFlag: false,
enumId: "",
enumSwitch: false,
@@ -1266,7 +1112,7 @@
attributeSelectType: "business",
version: 1,
defaultValue: "",//榛樿鍊�
- referValue: "",
+ referValue: null,
btmTypeId: "",
linkTypeName: "",
rangeValue: ""
@@ -1279,13 +1125,23 @@
addSaveHandler() {
this.$refs.form.validate((valid) => {
if (valid) {
- this.form.range = this.form.rangeValue ? this.form.rangeValue.replace(/\n/g, ';') : '';
+ if(this.form.attributeDataType === 'VTString'){
+ if(!this.form.referValue){
+ //鍙傜収绫诲瀷娌℃湁鍊�
+
+ }else {
+ this.form.enumSwitch=false;
+ this.form.rangeValue=''
+ }
+ }
+
+ this.form.range = this.form.rangeValue.length>0 ? this.form.rangeValue.replace(/\n/g, ';') : '';
if (this.form.attributeSelectType === 'business') {
this.form.btmTypeId = this.form.referValue;
- this.form.linkTypeName="";
+ this.form.linkTypeName = "";
} else {
this.form.linkTypeName = this.form.referValue;
- this.form.btmTypeId="";
+ this.form.btmTypeId = "";
}
if (this.dialogTitle === 'add') {
addAttribute(this.form).then(res => {
@@ -1351,6 +1207,7 @@
width: 100%;
}
}
+
.margin-top {
margin-top: 25px;
}
--
Gitblit v1.9.3