From d5894106a09ea9bc900bad176c177763a1df0568 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期五, 27 十二月 2024 14:29:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue | 675 ++++++++++++++++++++++++++++++++-----------------------
1 files changed, 394 insertions(+), 281 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 ad7dfe9..9d3f689 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,46 +18,66 @@
@current-change="currentChange"
>
<template slot="menuLeft" slot-scope="scope">
- <el-button icon="el-icon-plus" 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" icon="el-icon-plus" plain size="small" type="primary"
+ @click="rowSaveHandlerClick">鍒涘缓
</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.delBtn" icon="el-icon-delete" plain size="small" type="danger"
+ @click="allDelHandler">鍒犻櫎
+ </el-button>
+ <el-button v-if="permissionList.viewTheScopeBtn" icon="el-icon-view" plain size="small" type="primary"
+ @click="chekView">鏌ョ湅浣跨敤鑼冨洿
+ </el-button>
+ <el-button v-if="permissionList.downloadImportTemplateBtn" icon="el-icon-download" plain size="small"
+ type="primary" @click="downloadTemplateHandler">
+ 涓嬭浇瀵煎叆妯℃澘
+ </el-button>
+ <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary"
+ @click="upLoadHandler">瀵煎叆
+ </el-button>
+ <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary"
+ @click="downLoadHandler">瀵煎嚭
+ </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" icon="el-icon-edit" size="small" type="text"
+ @click="editBtnClick(scope.row)">缂栬緫
</el-button>
- <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎
+ <el-button v-if="permissionList.delBtn" icon="el-icon-delete" size="small" type="text"
+ @click="rowDeleteHandler(scope.row)">鍒犻櫎
</el-button>
</template>
</avue-crud>
</basic-container>
</el-main>
- <!-- 鍙充晶淇℃伅 -->
+ <!-- 鍙充晶淇℃伅 -->
<el-aside width="30%">
<basic-container>
<div style="height: 85vh; overflow-y: auto">
- <el-descriptions :column="1" border size="medium" title="灞炴�ч」">
+ <el-descriptions :column="1" :labelStyle="{width:'120px'}" border size="medium" title="灞炴�ч」">
<el-descriptions-item>
<template slot="label">
鍚嶇О
</template>
- {{ lastItem.id }}
+ <div>
+ {{ lastItem.id }}
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
鏍囩
</template>
- {{ lastItem.name }}
+ <div>
+ {{ lastItem.name }}
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
鎻忚堪
</template>
- {{ lastItem.description }}
+ <div>
+ {{ lastItem.description }}
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
@@ -68,16 +88,19 @@
</el-descriptions>
<!-- 鍊煎煙 -->
- <el-descriptions v-if="!isSpecialDataType" :column="1" :title="lastItem.attributeDataType" border
- class="margin-top"
- size="medium">
+ <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>
- <el-tag :type="lastItem.nullableFlag ? 'success' : 'danger'">
- {{ lastItem.nullableFlag ? '鏄�' : '鍚�' }}
- </el-tag>
+ <div>
+ <el-tag :type="lastItem.nullableFlag ? 'success' : 'danger'">
+ {{ lastItem.nullableFlag ? '鏄�' : '鍚�' }}
+ </el-tag>
+ </div>
</el-descriptions-item>
<el-descriptions-item v-if="accuracy">
<template slot="label">
@@ -89,109 +112,124 @@
<template slot="label">
闀垮害
</template>
- {{ lastItem.attrLength }}
+ <div>
+ {{ lastItem.attrLength }}
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
榛樿鍊�
</template>
- {{ lastItem.defaultValue }}
+ <div>
+ {{ 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="鍊煎煙">
+ :column="1" :labelStyle="{width:'120px'}" border class="margin-top" size="medium" title="鍊煎煙">
<el-descriptions-item>
<template slot="label">
褰撳墠绫诲瀷
</template>
- {{ lastItem.version ? '閾炬帴绫诲瀷' : '涓氬姟绫诲瀷' }}
+ <div>
+ {{ lastItem.version ? '閾炬帴绫诲瀷' : '涓氬姟绫诲瀷' }}
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
褰撳墠绫诲瀷鍊�
</template>
- {{ lastItem.version ? lastItem.linkTypeName : lastItem.btmTypeId }}
+ <div>
+ {{ lastItem.version ? lastItem.linkTypeName : lastItem.btmTypeId }}
+ </div>
</el-descriptions-item>
<el-descriptions-item v-if="lastItem.version">
<template slot="label">
褰撳墠鐗堟湰娆�
</template>
- {{ lastItem.version }}
+ <div>
+ {{ lastItem.version }}
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
浣跨敤鏋氫妇
</template>
- <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
- {{ lastItem.enumId ? '鏄�' : '鍚�' }}
- </el-tag>
+ <div>
+ <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
+ {{ lastItem.enumId ? '鏄�' : '鍚�' }}
+ </el-tag>
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
褰撳墠鏋氫妇绫诲瀷
</template>
- {{ lastItem.enumId }}
+ <div>
+ {{ lastItem.enumId }}
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
鍙栧�艰寖鍥�
</template>
- <div style="width: 330px; height: 80px;overflow: auto">
- <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag>
+ <div>
+ <el-tag v-for="item in rangeList" plain style="margin: 3px 10px 3px 0">{{ item }}</el-tag>
</div>
</el-descriptions-item>
-
</el-descriptions>
<!-- VTInteger && VTInteger -->
<el-descriptions
v-if="lastItem.attributeDataType === 'VTInteger' || lastItem.attributeDataType === 'VTInteger'"
- :column="1" border class="margin-top" size="medium" title="鍊煎煙">
-
+ :column="1" :labelStyle="{width:'120px'}" border class="margin-top" size="medium" title="鍊煎煙">
<el-descriptions-item>
<template slot="label">
浣跨敤鏋氫妇
</template>
- <el-tag :type="lastItem.enumFlag ? 'success' : 'danger'">
- {{ lastItem.enumFlag ? '鏄�' : '鍚�' }}
- </el-tag>
+ <div>
+ <el-tag :type="lastItem.enumFlag ? 'success' : 'danger'">
+ {{ lastItem.enumFlag ? '鏄�' : '鍚�' }}
+ </el-tag>
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
鏋氫妇绫诲瀷
</template>
- {{ lastItem.enumFlag }}
+ <div>
+ {{ lastItem.enumFlag }}
+ </div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
鍙栧�艰寖鍥�
</template>
- <div style="width: 330px; height: 80px;overflow: auto">
- <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag>
+ <div>
+ <el-tag v-for="item in rangeList" plain style="margin: 3px 10px 3px 0">{{ item }}</el-tag>
</div>
</el-descriptions-item>
</el-descriptions>
<!-- VTDouble -->
<el-descriptions v-if="lastItem.attributeDataType === 'VTDouble'"
- :column="1" border class="margin-top" size="medium" title="鍊煎煙">
+ :column="1" :labelStyle="{width:'120px'}" border class="margin-top" size="medium" title="鍊煎煙">
<el-descriptions-item>
<template slot="label">
鍙栧�艰寖鍥�
</template>
- <div style="width: 330px; height: 80px;overflow: auto">
- <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag>
+ <div>
+ <el-tag v-for="item in rangeList" plain style="margin: 3px 10px 3px 0">{{ item }}</el-tag>
</div>
</el-descriptions-item>
-
</el-descriptions>
<!-- VTDate VTTime VTDateTime VTNote VTFilePath VTClob鍧囦笉鏄剧ず VTBoolean涓嶆樉绀哄�煎煙 鍙樉绀虹被鍨� -->
</div>
</basic-container>
</el-aside>
- <!-- 鏂板瀵硅瘽妗� -->
+ <!-- 鏂板瀵硅瘽妗� -->
<el-dialog
v-dialogDrag
v-loading="addLoading"
@@ -199,88 +237,63 @@
:visible.sync="addVisible"
append-to-body="true"
class="avue-dialog"
- width="65%"
+ width="1200px"
@close="addEscHandler"
>
- <el-form ref="form" :model="form" :rules="rules" label-width="120px">
- <el-row>
+ <div style="height: 550px;">
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px" size="small" style="max-height: 600px;">
<div class="addDialog">
- <div>
-
- <h3>灞炴�ч」</h3>
-
- <el-col :span="12">
- <el-form-item label="鍚嶇О锛�" prop="id">
- <el-input v-model="form.id"></el-input>
+ <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">灞炴�ч」</h3>
+ <el-col :span="8">
+ <el-form-item label="鍚嶇О锛�" prop="id">
+ <el-input v-model="form.id" :disabled="dialogTitle !== 'add'"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏍囩锛�" prop="name">
+ <el-input v-model="form.name"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="灞炴�х被鍨嬶細" prop="attributeDataType">
+ <el-select v-model="form.attributeDataType" placeholder="璇烽�夋嫨灞炴�х被鍨�" @change="attributeDataTypeChange">
+ <el-option v-for="item in typeSelectList" :label="item" :value="item"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鎻忚堪锛�" prop="description">
+ <el-input v-model="form.description" :rows="2" type="textarea"></el-input>
+ </el-form-item>
+ </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>
+ <el-col :span="8">
+ <el-form-item label="闀垮害锛�" prop="attrLength">
+ <el-input-number v-model="form.attrLength" :min="0" controls-position="right"></el-input-number>
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="鏍囩锛�" prop="name">
- <el-input v-model="form.name"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="灞炴�х被鍨嬶細" prop="attributeDataType">
- <el-select v-model="form.attributeDataType" placeholder="璇烽�夋嫨灞炴�х被鍨�" @change="attributeDataTypeChange">
- <el-option v-for="item in typeSelectList" :label="item" :value="item"></el-option>
+ <el-col :span="8">
+ <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-col>
- <el-col :span="12">
- <el-form-item label="鎻忚堪锛�" prop="description">
- <el-input v-model="form.description" :rows="2" type="textarea"></el-input>
- </el-form-item>
- </el-col>
-
- </div>
- <div v-if="!hideType" class="addDialogBottom">
- <div class="left">
- <h3>{{ form.attributeDataType }}</h3>
-
- <el-form-item
- v-if="form.attributeDataType !== 'VTInteger' && form.attributeDataType !== 'VTLong'
- && form.attributeDataType !== 'VTDouble' && form.attributeDataType !== 'VTBoolean'"
- label="闀垮害锛�" prop="attrLength">
- <el-input v-model="form.attrLength"></el-input>
- </el-form-item>
-
- <el-form-item v-if="form.attributeDataType === 'VTDouble'" label="绮惧害锛�" prop="precisionLength">
- <el-input v-model="form.precisionLength"></el-input>
- </el-form-item>
-
- <el-form-item v-if="form.attributeDataType === 'VTDouble'" label="闀垮害锛�" prop="scaleLength">
- <el-input v-model="form.scaleLength"></el-input>
- </el-form-item>
-
-
- <el-form-item v-if="form.attributeDataType !== 'VTBoolean' && !form.enumSwitch" label="榛樿鍊硷細"
- prop="defaultValue">
+ <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
<el-input v-model="form.defaultValue"></el-input>
</el-form-item>
-
- <el-form-item v-if="form.attributeDataType === 'VTBoolean'" label="榛樿鍊硷細" prop="defaultValue">
- <el-select v-model="form.defaultValue">
- <el-option label="false" value="false"></el-option>
- <el-option label="true" value="true"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="form.attributeDataType !== 'VTBoolean' && form.enumSwitch" label="榛樿鍊硷細"
- prop="defaultValue">
- <el-select v-model="form.defaultValue">
- <el-option v-for="(item,index) in rangeOptionValue" :key="index" :label="item"
- :value="item"></el-option>
- </el-select>
- </el-form-item>
-
+ </el-col>
+ <el-col :span="8">
<el-form-item label="鍏佽涓虹┖锛�" prop="nullableFlag">
<el-switch v-model="form.nullableFlag"></el-switch>
</el-form-item>
-
- </div>
- <el-divider direction="vertical"></el-divider>
- <!-- VTString -->
- <div v-if="form.attributeDataType === 'VTString'" class="right">
- <h3>鍊煎煙</h3>
+ </el-col>
+ <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="褰撳墠鍊煎煙绫诲瀷锛�" prop="attributeSelectType">
<el-select v-model="form.attributeSelectType" placeholder="璇烽�夋嫨灞炴�х被鍨�"
@change="attributeSelectTypeChange">
@@ -288,54 +301,84 @@
<el-option label="閾炬帴绫诲瀷" value="link"></el-option>
</el-select>
</el-form-item>
-
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="閫夋嫨鍙傜収绫诲瀷锛�" prop="referValue">
+ <el-input v-model="form.referValue" :clearable="true" @focus="referFormFocusHandler"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
<el-form-item v-if="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-form-item label="閫夋嫨鍙傜収绫诲瀷锛�" prop="referValue">
- <el-input v-model="form.referValue" @focus="referFormFocusHandler"></el-input>
- </el-form-item>
-
- <span v-if="!form.referValue">
- <el-form-item label="浣跨敤鏋氫妇锛�" prop="enumSwitch">
- <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
- </el-form-item>
-
-
- <el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鍊煎煙锛�'" prop="enumSwitch">
- <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>
- <el-input v-if="!form.enumSwitch" v-model="form.enumAddValue">
- </el-input>
- </el-form-item>
- <el-form-item v-if="!form.enumSwitch" label="杩愮畻绗︼細">
- <div>
- <el-button size="mini" @click="enumAddHandler"> = </el-button>
- </div>
- </el-form-item>
- <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
- <textarea v-model="form.rangeValue" :readonly="form.enumSwitch"
- style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
- </textarea>
- </el-form-item>
- </span>
+ </el-col>
+ <div v-if="!form.referValue" style="clear: both">
+ <el-col :span="8">
+ <el-form-item label="浣跨敤鏋氫妇锛�" prop="enumSwitch">
+ <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
+ </el-form-item>
+ </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-option v-for="(item,index) in attributeDataTypePickList" :key="index" :label="item.key"
+ :value="item.key"></el-option>
+ </el-select>
+ <el-input v-if="!form.enumSwitch" v-model="form.enumAddValue"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item v-if="!form.enumSwitch" label-width="10px" labeldd="杩愮畻绗︼細">
+ <div>
+ <el-button size="mini" @click="enumAddHandler"> =</el-button>
+ </div>
+ </el-form-item>
+ </el-col>
+ <el-col v-if="form.rangeValue && form.rangeValue.length>0" :span="24">
+ <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
+ <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>
- <!-- VTInteger VTLong -->
- <div v-if="form.attributeDataType === 'VTInteger' || form.attributeDataType === 'VTLong' " class="right">
- <h3>鍊煎煙</h3>
-
+ </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>
+ <el-col :span="8">
+ <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"></el-input-number>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍏佽涓虹┖锛�" prop="nullableFlag">
+ <el-switch v-model="form.nullableFlag"></el-switch>
+ </el-form-item>
+ </el-col>
+ <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="浣跨敤鏋氫妇锛�" prop="enumSwitch">
<el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
</el-form-item>
-
-
+ </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">
@@ -345,7 +388,9 @@
<el-input v-if="!form.enumSwitch" v-model="form.enumAddValue">
</el-input>
</el-form-item>
- <el-form-item v-if="!form.enumSwitch" label="杩愮畻绗︼細">
+ </el-col>
+ <el-col :span="8">
+ <el-form-item v-if="!form.enumSwitch" label-width="10px" labeldd="杩愮畻绗︼細">
<div>
<el-button size="mini" @click="operationHandler('>')"> ></el-button>
<el-button size="mini" @click="operationHandler('<')"> <</el-button>
@@ -353,22 +398,62 @@
<el-button size="mini" @click="operationHandler('<=')"> <=</el-button>
<el-button size="mini" @click="operationHandler('=')"> =</el-button>
<el-button size="mini" @click="operationHandler('!=')"> !=</el-button>
- <el-button size="mini" @click="operationHandler('()')"> ()</el-button>
+ <el-button size="mini" @click="operationHandler('()')"> ([])</el-button>
</div>
</el-form-item>
+ </el-col>
+ <el-col v-if="form.rangeValue && form.rangeValue.length>0" :span="24">
<el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
- <textarea v-model="form.rangeValue" :readonly="form.enumSwitch"
- style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
- </textarea>
+ <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>
- </div>
- <!-- VTDouble -->
- <div v-if="form.attributeDataType === 'VTDouble'" class="right">
- <h3>鍊煎煙</h3>
+ </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>
+ <el-col :span="8">
+ <el-form-item label="绮惧害锛�" prop="precisionLength">
+ <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" :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-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" :precision="form.precisionLength"
+ controls-position="right"></el-input-number>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍏佽涓虹┖锛�" prop="nullableFlag">
+ <el-switch v-model="form.nullableFlag"></el-switch>
+ </el-form-item>
+ </el-col>
+ <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">
<el-form-item label="杩愮畻绗︼細">
<div>
<el-button size="mini" @click="operationHandler('>')"> ></el-button>
@@ -377,80 +462,103 @@
<el-button size="mini" @click="operationHandler('<=')"> <=</el-button>
<el-button size="mini" @click="operationHandler('=')"> =</el-button>
<el-button size="mini" @click="operationHandler('!=')"> !=</el-button>
- <el-button size="mini" @click="operationHandler('()')"> ()</el-button>
+ <el-button size="mini" @click="operationHandler('()')">([])</el-button>
</div>
</el-form-item>
+ </el-col>
+ <el-col v-if="form.rangeValue && form.rangeValue.length>0" :span="24">
<el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
- <textarea v-model="form.rangeValue"
- style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
- </textarea>
+ <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>
- </div>
+ </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>
+ <el-col :span="8">
+ <el-form-item label="榛樿鍊硷細" prop="defaultValue">
+ <el-select v-model="form.defaultValue">
+ <el-option label="false" value="false"></el-option>
+ <el-option label="true" value="true"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍏佽涓虹┖锛�" prop="nullableFlag">
+ <el-switch v-model="form.nullableFlag"></el-switch>
+ </el-form-item>
+ </el-col>
</div>
</div>
- </el-row>
- </el-form>
+ </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"
+ <!-- 涓氬姟绫诲瀷瀵硅瘽妗� -->
+ <el-dialog
+ v-dialogDrag
+ :visible.sync="businessVisible"
+ append-to-body="true"
+ class="avue-dialog"
+ title="涓氬姟绫诲瀷閫夋嫨"
+ width="70%"
>
- </avue-crud>
- <span slot="footer" class="dialog-footer">
+ <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>
- <el-button type="primary" @click="businessSaveHandler">纭� 瀹�</el-button>
</span>
- </el-dialog>
+ </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"
+ <!-- 閾炬帴绫诲瀷瀵硅瘽妗� -->
+ <el-dialog
+ v-dialogDrag
+ :visible.sync="linkTypeVisible"
+ append-to-body="true"
+ class="avue-dialog"
+ title="閾炬帴绫诲瀷閫夋嫨"
+ width="70%"
>
- </avue-crud>
- <span slot="footer" class="dialog-footer">
+ <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>
+ </el-dialog>
+ </div>
<span slot="footer" class="dialog-footer">
- <el-button @click="addEscHandler">鍙� 娑�</el-button>
<el-button type="primary" @click="addSaveHandler">纭� 瀹�</el-button>
+ <el-button @click="addEscHandler">鍙� 娑�</el-button>
</span>
</el-dialog>
<!--瀵煎叆 -->
<upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
@updata="getTableList"></upload-file>
- <!-- 鏌ョ湅浣跨敤鑼冨洿 -->
+ <!-- 鏌ョ湅浣跨敤鑼冨洿 -->
<el-dialog
v-dialogDrag
v-loading="checkViewLoading"
@@ -467,7 +575,6 @@
@search-change="checkHandleSearch"
@search-reset="checkHandleReset"
>
-
</avue-crud>
</el-dialog>
</el-container>
@@ -489,6 +596,7 @@
import basicOption from '@/util/basic-option';
import {column} from "./option"
import func from "@/util/func";
+import {mapGetters} from "vuex";
export default {
name: "index",
@@ -576,6 +684,7 @@
addBtn: false,
editBtn: false,
delBtn: false,
+ menuWidth: 160,
column
},
tableLoading: false,
@@ -598,6 +707,7 @@
searchMenuSpan: 8,
refreshBtn: false,
selection: false,
+ header: false,
column: [
{
label: '鍚嶇О',
@@ -625,6 +735,8 @@
description: "",
nullableFlag: true,
attrLength: 50,
+ precisionLength: 2,//绮惧害
+ scaleLength: 20,//闀垮害
enumFlag: false,
enumId: "",
enumSwitch: false,
@@ -636,7 +748,7 @@
referValue: "",
btmTypeId: "",
linkTypeName: "",
- rangeValue: ""
+ rangeValue: [] //褰撳墠鍊煎煙\褰撳墠鏋氫妇鍊�
},
typeSelectList: ['VTString', 'VTInteger', 'VTLong', 'VTDouble', 'VTBoolean', 'VTDate', 'VTTime', 'VTDateTime', 'VTNote', 'VTFilePath', 'VTClob'],
@@ -653,6 +765,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].downloadImportTemplate, false),
+ viewTheScopeBtn: this.vaildData(this.permission[this.$route.query.id].viewTheScope, false),
+ };
+ },
lastItem() {
return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1] : {};
},
@@ -681,17 +805,9 @@
this.form.attributeDataType === 'VTClob' ||
this.form.attributeDataType === 'VTDateTime' ||
this.form.attributeDataType === 'VTFilePath';
- },
- rangeOptionValue() {
- let values = this.form.rangeValue.split('\n');
-
- // 澶勭悊姣忎釜鍊硷紝鍘婚櫎绛夊彿鍓嶇殑閮ㄥ垎锛屽彧淇濈暀绛夊彿鍚庣殑閮ㄥ垎
- return values.map(value => {
- let parts = value.split('=');
- return parts.length > 1 ? parts[1].trim() : value.trim();
- });
}
},
+ watch: {},
methods: {
//琛ㄦ牸鏌ヨ璇锋眰
getTableList() {
@@ -842,6 +958,7 @@
})
},
+
// 鏌ョ湅浣跨敤鑼冨洿鏌ヨ
checkHandleSearch(params, done) {
const {source} = params;
@@ -850,14 +967,12 @@
this.checkViewData = this.checkViewDataSearch;
return done();
}
- ;
this.checkViewData = this.checkViewData.filter(item => {
return item.source && item.source.includes(source);
});
done();
-
},
// 鏌ョ湅浣跨敤鑼冨洿閲嶇疆
@@ -881,15 +996,19 @@
this.form.attributeSelectType = 'link'
this.form.referValue = row.linkTypeName;
}
-
- this.getEnumMapByTypeHandler(this.form.attributeDataType)
+ if (!row.btmTypeId && !row.linkTypeName) {
+ this.form.attributeSelectType = 'business'
+ this.form.referValue = row.btmTypeId;
+ }
+ this.getEnumMapByTypeHandler(this.form.attributeDataType);
this.addVisible = true;
-
+ this.lastIndex = -1;//闃叉瑙﹀彂琛岀偣鍑讳簨浠跺悗娓呴櫎閫変腑椤�
},
// 灞炴�х被鍨嬩笅鎷夋change
attributeDataTypeChange(val) {
this.form.rangeValue = null;
+ this.form.nullableFlag = true;
this.getEnumMapByTypeHandler(val);
this.form.enumSwitch = false;
if (val === 'VTBoolean') {
@@ -924,7 +1043,8 @@
enumSelectChange(val) {
const list = this.attributeDataTypePickList.find(item => item.key === val).values;
this.form.rangeValue = list.join('\n');
- this.form.defaultValue = this.rangeOptionValue[0];
+ this.enumAddListChange = list;
+ this.form.defaultValue = list[0].replace('=', '');
},
// 浣跨敤鏋氫妇switch婊戝潡change浜嬩欢
@@ -933,15 +1053,17 @@
this.form.enumId = this.attributeDataTypePickList[0].key;
const list = this.attributeDataTypePickList[0].values;
this.form.rangeValue = list.join('\n');
- this.form.defaultValue = this.rangeOptionValue[0];
+ this.enumAddListChange = list;
+ this.form.defaultValue = list[0].replace('=', '');
} else {
this.form.defaultValue = "";
this.form.rangeValue = "";
+ this.enumAddListChange = [];
this.enumId = "";
}
},
- // 涓嶄娇鐢ㄦ灇涓� 鎵嬪姩娣诲姞鏋氫妇鍊�
+ // 涓嶄娇鐢ㄦ灇涓� 鎵嬪姩娣诲姞鏋氫妇鍊� VTString
enumAddHandler() {
// 妫�鏌ュ拰杞崲 this.form.range 涓烘暟缁勶紝鍚屾椂鎺掗櫎绌哄��
let currentRangeArray = this.form.rangeValue ? this.form.rangeValue.split('\n').filter(item => item.trim() !== '') : [];
@@ -967,8 +1089,11 @@
// 澶勭悊 '()' 杩愮畻绗︾殑鎯呭喌
if (val === '()') {
+ let regex = /[,\[\]()]+/g;
+ let firstValue = this.form.enumAddValue[0];
+ let lastValue = this.form.enumAddValue[(this.form.enumAddValue.length - 1)];
// 鍒囧壊 enumAddValue 鐨勯�楀彿
- let values = this.form.enumAddValue.split(',').map(item => item.trim());
+ let values = this.form.enumAddValue.split(regex).map(item => item.trim()).filter(item => item !== "");
// 妫�鏌ユ槸鍚︽湁鏈夋晥鐨勫��
if (values.length < 2 || values.some(item => item === '')) {
@@ -991,7 +1116,7 @@
}
// 鏋勫缓 newValue 鐨勫舰寮� (鍊�1,鍊�2)
- let newValue = `(${values.join(',')})`;
+ let newValue = `${firstValue}${values.join(',')}${lastValue}`;
// 妫�鏌ユ柊鐨勫�兼槸鍚﹀凡瀛樺湪
if (currentRangeArray.includes(newValue)) {
@@ -1016,7 +1141,10 @@
'=': '=',
'!=': '!='
};
-
+ if (isNaN(this.form.enumAddValue.trim())) {
+ this.$message.error('璇疯緭鍏ユ湁鏁堢殑鏁板瓧鍊硷紒');
+ return;
+ }
// 鍒涘缓鏂扮殑鍊�
let newValue = operatorMap[val] + this.form.enumAddValue.trim();
@@ -1032,7 +1160,12 @@
this.form.rangeValue = currentRangeArray.join('\n');
this.form.enumAddValue = "";
},
-
+ //鍒犻櫎鍊煎煙
+ handleRangeValueDel(val) {
+ let currentRangeArray = this.form.rangeValue ? this.form.rangeValue.split('\n').filter(item => item.trim() !== val) : [];
+ this.enumAddListChange = currentRangeArray;
+ this.form.rangeValue = currentRangeArray.join('\n');
+ },
// 鍊煎煙绫诲瀷鍒囨崲
attributeSelectTypeChange() {
this.$forceUpdate(); // 寮哄埗鏇存柊form缁勪欢
@@ -1041,9 +1174,6 @@
// 閫夋嫨鍙傜収
referFormFocusHandler() {
- this.form.enumSwitch = false;
- this.form.rangeValue = "";
- this.form.enumId = "";
const handlers = {
business: () => {
this.businessVisible = true;
@@ -1168,9 +1298,8 @@
this.linkTypeVisible = false;
},
- // 鏂板瀵硅瘽妗� 鍙栨秷浜嬩欢
+ // 鍏抽棴鏂板瀵硅瘽妗�
addEscHandler() {
- this.$refs.form.resetFields(); // 瀵规暣涓〃鍗曡繘琛岄噸缃紝灏嗘墍鏈夊瓧娈靛�奸噸缃负鍒濆鍊煎苟绉婚櫎鏍¢獙缁撴灉
this.addVisible = false;
const form = {
id: "",
@@ -1179,6 +1308,8 @@
description: "",
nullableFlag: true,
attrLength: 50,
+ precisionLength: 2,//绮惧害
+ scaleLength: 20,//闀垮害
enumFlag: false,
enumId: "",
enumSwitch: false,
@@ -1186,68 +1317,43 @@
range: "",
attributeSelectType: "business",
version: 1,
- defaultValue: "",
+ defaultValue: "",//榛樿鍊�
referValue: "",
btmTypeId: "",
linkTypeName: "",
rangeValue: ""
};
this.form = form;
+ this.$refs.form.clearValidate(); // 瀵规暣涓〃鍗曡繘琛岄噸缃紝灏嗘墍鏈夊瓧娈靛�奸噸缃负鍒濆鍊煎苟绉婚櫎鏍¢獙缁撴灉
},
// 鏂板淇濆瓨
addSaveHandler() {
- const form = {
- id: "",
- name: "",
- attributeDataType: "VTString",
- description: "",
- nullableFlag: true,
- attrLength: 50,
- enumFlag: false,
- enumId: "",
- enumSwitch: false,
- enumAddValue: "",
- range: "",
- attributeSelectType: "business",
- version: 1,
- defaultValue: "",
- referValue: "",
- btmTypeId: "",
- linkTypeName: "",
- rangeValue: ""
- };
this.$refs.form.validate((valid) => {
if (valid) {
+ this.form.range = this.form.rangeValue ? this.form.rangeValue.replace(/\n/g, ';') : '';
+ if (this.form.attributeSelectType === 'business') {
+ this.form.btmTypeId = this.form.referValue;
+ this.form.linkTypeName = "";
+ } else {
+ this.form.linkTypeName = this.form.referValue;
+ this.form.btmTypeId = "";
+ }
if (this.dialogTitle === 'add') {
- this.form.range = this.form.rangeValue.replace(/\n/g, ';');
- if (this.form.attributeSelectType === 'business') {
- this.form.btmTypeId = this.form.referValue;
- } else {
- this.form.linkTypeName = this.form.referValue;
- }
addAttribute(this.form).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.obj);
this.getTableList();
- this.form = form;
- this.addVisible = false;
+ this.addEscHandler();
}
})
}
if (this.dialogTitle === 'edit') {
- this.form.range = this.form.rangeValue.replace(/\n/g, ';');
- if (this.form.attributeSelectType === 'business') {
- this.form.btmTypeId = this.form.referValue;
- } else {
- this.form.linkTypeName = this.form.referValue;
- }
updateAttribute(this.form).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.obj);
this.getTableList();
- this.form = form;
- this.addVisible = false;
+ this.addEscHandler();
}
})
}
@@ -1292,6 +1398,12 @@
</script>
<style lang="scss" scoped>
+::v-deep {
+ .el-input-number--small {
+ width: 100%;
+ }
+}
+
.margin-top {
margin-top: 25px;
}
@@ -1309,14 +1421,15 @@
}
.addDialogBottom {
+ margin-top: 30px;
width: 100%;
display: flex;
flex-direction: row;
}
.addDialogBottom > .el-divider--vertical {
- width: 2px;
- height: 78%;
+ width: 1px;
+ height: 70%;
position: absolute;
top: 50%;
left: 50%;
--
Gitblit v1.9.3