|
@@ -4,34 +4,53 @@
|
|
|
<div class="panel-body">
|
|
<div class="panel-body">
|
|
|
<el-form-item v-if="types.includes('selector_type')" label-width="110px">
|
|
<el-form-item v-if="types.includes('selector_type')" label-width="110px">
|
|
|
<template slot="label">选择器类型<help-tip prop="selectorType" /></template>
|
|
<template slot="label">选择器类型<help-tip prop="selectorType" /></template>
|
|
|
- <el-select v-model="fieldOptions.selector_type" style="width: 100%" @change="(val) => selectorChange(val)">
|
|
|
|
|
- <el-option v-for="option in selectorTypeOptions" :key="option.value" :value="option.value" :label="option.label" />
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="fieldOptions.selector_type"
|
|
|
|
|
+ style="width:100%;"
|
|
|
|
|
+ @change="(val)=>selectorChange(val)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="option in selectorTypeOptions"
|
|
|
|
|
+ :key="option.value"
|
|
|
|
|
+ :value="option.value"
|
|
|
|
|
+ :label="option.label"
|
|
|
|
|
+ />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item v-if="types.includes('multiple')">
|
|
<el-form-item v-if="types.includes('multiple')">
|
|
|
<template slot="label">是否多选<help-tip prop="multiple" /></template>
|
|
<template slot="label">是否多选<help-tip prop="multiple" /></template>
|
|
|
<el-switch v-model="fieldOptions.multiple" @change="setDefaultValue" />
|
|
<el-switch v-model="fieldOptions.multiple" @change="setDefaultValue" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="types.includes('multiple')">
|
|
|
|
|
|
|
+ <el-form-item v-if="types.includes('filtrate')">
|
|
|
<template slot="label">是否过滤</template>
|
|
<template slot="label">是否过滤</template>
|
|
|
<el-switch v-model="fieldOptions.filtrate" @change="setDefaultValue" />
|
|
<el-switch v-model="fieldOptions.filtrate" @change="setDefaultValue" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!--TODO:选择器范围-->
|
|
<!--TODO:选择器范围-->
|
|
|
<el-form-item v-if="types.includes('selector_type')" label-width="95px">
|
|
<el-form-item v-if="types.includes('selector_type')" label-width="95px">
|
|
|
<template slot="label">选择范围<help-tip prop="checkScope" /></template>
|
|
<template slot="label">选择范围<help-tip prop="checkScope" /></template>
|
|
|
- <el-button icon="el-icon-s-tools" :disabled="(fieldOptions.selector_type === 'user' && fieldOptions.filter.length === 4) || (fieldOptions.selector_type !== 'user' && fieldOptions.filter.length === 1)" type="primary" size="mini" style="font-size: 14px" plain @click="addScope"> 设置 </el-button>
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ icon="el-icon-s-tools"
|
|
|
|
|
+ :disabled="(fieldOptions.selector_type==='user'&&fieldOptions.filter.length===4)||(fieldOptions.selector_type!=='user'&&fieldOptions.filter.length===1)"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ style="font-size:14px;"
|
|
|
|
|
+ plain
|
|
|
|
|
+ @click="addScope"
|
|
|
|
|
+ >
|
|
|
|
|
+ 设置
|
|
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!--范围 -->
|
|
<!--范围 -->
|
|
|
<el-form-item label-width="95px">
|
|
<el-form-item label-width="95px">
|
|
|
- <div v-for="(filter, i) in fieldOptions.filter" :key="i" class="list-scope-group-item">
|
|
|
|
|
|
|
+ <div v-for="(filter,i) in fieldOptions.filter" :key="i" class="list-scope-group-item">
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<!-- <el-col :span="filter.type==='role'?6:filter.type==='user'?18:12"> -->
|
|
<!-- <el-col :span="filter.type==='role'?6:filter.type==='user'?18:12"> -->
|
|
|
<el-col :span="18">
|
|
<el-col :span="18">
|
|
|
<el-tag v-if="$utils.isNotEmpty(filter.userType)" effect="plain">
|
|
<el-tag v-if="$utils.isNotEmpty(filter.userType)" effect="plain">
|
|
|
- {{ filter.userType | optionsFilter(partyTypeOptions, 'label') }}
|
|
|
|
|
|
|
+ {{ filter.userType|optionsFilter(partyTypeOptions,'label') }}
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
- <el-tag v-if="$utils.isNotEmpty(filter.descVal)" effect="plain" style="margin-left: 2px">
|
|
|
|
|
- {{ filter.descVal | optionsFilter(selectorScopeOption, 'label') }}
|
|
|
|
|
|
|
+ <el-tag v-if="$utils.isNotEmpty(filter.descVal)" effect="plain" style="margin-left:2px;">
|
|
|
|
|
+ {{ filter.descVal|optionsFilter(selectorScopeOption,'label') }}
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
|
|
|
|
|
<el-button-group class="actions">
|
|
<el-button-group class="actions">
|
|
@@ -39,48 +58,73 @@
|
|
|
<el-button size="small" type="text" title="删除" icon="el-icon-delete" @click="removeButton(i)" />
|
|
<el-button size="small" type="text" title="删除" icon="el-icon-delete" @click="removeButton(i)" />
|
|
|
</el-button-group>
|
|
</el-button-group>
|
|
|
<!-- <el-tag v-if="filter.type!=='role'&&$utils.isNotEmpty(filter.includeSub)" effect="plain" style="margin-left:2px;">
|
|
<!-- <el-tag v-if="filter.type!=='role'&&$utils.isNotEmpty(filter.includeSub)" effect="plain" style="margin-left:2px;">
|
|
|
- {{ filter.includeSub?'含子集':'不含子集' }}
|
|
|
|
|
- </el-tag> -->
|
|
|
|
|
|
|
+ {{ filter.includeSub?'含子集':'不含子集' }}
|
|
|
|
|
+ </el-tag> -->
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<!-- <el-col :span="4">
|
|
<!-- <el-col :span="4">
|
|
|
- <el-button-group class="actions">
|
|
|
|
|
- <el-button size="small" type="text" title="设置" icon="ibps-icon-cog" @click="settingButton(i)" />
|
|
|
|
|
- <el-button size="small" type="text" title="删除" icon="el-icon-delete" @click="removeButton(i)" />
|
|
|
|
|
- </el-button-group>
|
|
|
|
|
- </el-col> -->
|
|
|
|
|
|
|
+ <el-button-group class="actions">
|
|
|
|
|
+ <el-button size="small" type="text" title="设置" icon="ibps-icon-cog" @click="settingButton(i)" />
|
|
|
|
|
+ <el-button size="small" type="text" title="删除" icon="el-icon-delete" @click="removeButton(i)" />
|
|
|
|
|
+ </el-button-group>
|
|
|
|
|
+ </el-col> -->
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item v-if="types.includes('store')">
|
|
<el-form-item v-if="types.includes('store')">
|
|
|
<template slot="label">存储格式<help-tip prop="selectorStore" /></template>
|
|
<template slot="label">存储格式<help-tip prop="selectorStore" /></template>
|
|
|
- <el-select v-model="fieldOptions.store" style="width: 100%" @change="selectorStoreValue">
|
|
|
|
|
- <el-option v-for="store in selectorStoreOptions" :key="store.value" :value="store.value" :label="store.label" />
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="fieldOptions.store"
|
|
|
|
|
+ style="width:100%;"
|
|
|
|
|
+ @change="selectorStoreValue"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="store in selectorStoreOptions"
|
|
|
|
|
+ :key="store.value"
|
|
|
|
|
+ :value="store.value"
|
|
|
|
|
+ :label="store.label"
|
|
|
|
|
+ />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="fieldOptions.store === 'bind'">
|
|
|
|
|
- <template slot="label">绑定值<help-tip :prop="fieldOptions.selector_type === 'user' ? 'bind' : 'bindOther'" /></template>
|
|
|
|
|
- <el-select v-model="fieldOptions.bind" style="width: 100%">
|
|
|
|
|
- <el-option v-for="store in bindValueOptions" :key="store.value" :value="store.value" :label="store.label" /> </el-select
|
|
|
|
|
- ></el-form-item>
|
|
|
|
|
- <el-form-item v-if="fieldOptions.store === 'bind'">
|
|
|
|
|
|
|
+ <el-form-item v-if="fieldOptions.store==='bind'">
|
|
|
|
|
+ <template slot="label">绑定值<help-tip :prop="fieldOptions.selector_type==='user'?'bind':'bindOther'" /></template>
|
|
|
|
|
+ <el-select v-model="fieldOptions.bind" style="width:100%;">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="store in bindValueOptions"
|
|
|
|
|
+ :key="store.value"
|
|
|
|
|
+ :value="store.value"
|
|
|
|
|
+ :label="store.label"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item v-if="fieldOptions.store==='bind'">
|
|
|
<template slot="label">存储字段<help-tip prop="bindFiled" /></template>
|
|
<template slot="label">存储字段<help-tip prop="bindFiled" /></template>
|
|
|
<ibps-bo-select v-model="fieldItem.bindFiled" :data="boFields" placeholder="请绑定属性" empty-text="未设置存储字段" @change="changeBoName" />
|
|
<ibps-bo-select v-model="fieldItem.bindFiled" :data="boFields" placeholder="请绑定属性" empty-text="未设置存储字段" @change="changeBoName" />
|
|
|
-
|
|
|
|
|
<!-- <ibps-tree-select
|
|
<!-- <ibps-tree-select
|
|
|
- v-model="fieldOptions.bindFiled"
|
|
|
|
|
- :data="boTreeData"
|
|
|
|
|
- :props="props"
|
|
|
|
|
- :multiple="false"
|
|
|
|
|
- :allow-selection="changeBoName"
|
|
|
|
|
- node-key="key"
|
|
|
|
|
- empty-text="未设置存储字段"
|
|
|
|
|
- clearable
|
|
|
|
|
- filterable
|
|
|
|
|
- /> -->
|
|
|
|
|
|
|
+ v-model="fieldOptions.bindFiled"
|
|
|
|
|
+ :data="boTreeData"
|
|
|
|
|
+ :props="props"
|
|
|
|
|
+ :multiple="false"
|
|
|
|
|
+ :allow-selection="changeBoName"
|
|
|
|
|
+ node-key="key"
|
|
|
|
|
+ empty-text="未设置存储字段"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ filterable
|
|
|
|
|
+ /> -->
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- // 设置 -->
|
|
<!-- // 设置 -->
|
|
|
- <setting-optional-scope :title="title" :visible="settingOptionalScopeVisible" :data="editData" :bo-data="boData" :readonly="readonly" :button-key="buttonKey" :existing-type-scope="existingTypeScope" :selector-type="fieldOptions.selector_type" @callback="setDataTemplateScopeAttr" @close="(visible) => (settingOptionalScopeVisible = visible)" />
|
|
|
|
|
|
|
+ <setting-optional-scope
|
|
|
|
|
+ :title="title"
|
|
|
|
|
+ :visible="settingOptionalScopeVisible"
|
|
|
|
|
+ :data="editData"
|
|
|
|
|
+ :bo-data="boData"
|
|
|
|
|
+ :readonly="readonly"
|
|
|
|
|
+ :button-key="buttonKey"
|
|
|
|
|
+ :existing-type-scope="existingTypeScope"
|
|
|
|
|
+ :selector-type="fieldOptions.selector_type"
|
|
|
|
|
+ @callback="setDataTemplateScopeAttr"
|
|
|
|
|
+ @close="visible => settingOptionalScopeVisible = visible"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -105,7 +149,7 @@ export default {
|
|
|
default: 'selector_type,multiple,store'
|
|
default: 'selector_type,multiple,store'
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- data() {
|
|
|
|
|
|
|
+ data () {
|
|
|
return {
|
|
return {
|
|
|
settingOptionalScopeVisible: false,
|
|
settingOptionalScopeVisible: false,
|
|
|
partyTypeOptions: partyTypeOptions,
|
|
partyTypeOptions: partyTypeOptions,
|
|
@@ -126,15 +170,15 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// computed: {
|
|
// computed: {
|
|
|
- // boTreeData() {
|
|
|
|
|
- // return TreeUtils.transformToTreeFormat(this.boData, {
|
|
|
|
|
- // idKey: 'id',
|
|
|
|
|
- // pIdKey: 'parentId'
|
|
|
|
|
- // })
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ // boTreeData () {
|
|
|
|
|
+ // return TreeUtils.transformToTreeFormat(this.boData, {
|
|
|
|
|
+ // idKey: 'id',
|
|
|
|
|
+ // pIdKey: 'parentId'
|
|
|
|
|
+ // })
|
|
|
|
|
+ // }
|
|
|
// },
|
|
// },
|
|
|
methods: {
|
|
methods: {
|
|
|
- changeBoName(value, data) {
|
|
|
|
|
|
|
+ changeBoName (value, data) {
|
|
|
if (data.data.key === 'id' || data.data.key === 'parentId') {
|
|
if (data.data.key === 'id' || data.data.key === 'parentId') {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
title: '提示',
|
|
title: '提示',
|
|
@@ -151,16 +195,16 @@ export default {
|
|
|
// console.info(data, this.fieldOptions, '=>>选择器关联表单字段详细信息')
|
|
// console.info(data, this.fieldOptions, '=>>选择器关联表单字段详细信息')
|
|
|
return true
|
|
return true
|
|
|
},
|
|
},
|
|
|
- selectorStoreValue(val) {
|
|
|
|
|
|
|
+ selectorStoreValue (val) {
|
|
|
// if (val !== 'bind') {
|
|
// if (val !== 'bind') {
|
|
|
- // this.fieldOptions.bind = ''
|
|
|
|
|
- // this.fieldOptions.bindFiled = ''
|
|
|
|
|
|
|
+ // this.fieldOptions.bind = ''
|
|
|
|
|
+ // this.fieldOptions.bindFiled = ''
|
|
|
// }
|
|
// }
|
|
|
// this.fieldOptions.attrType = ''
|
|
// this.fieldOptions.attrType = ''
|
|
|
// this.fieldOptions.tableName = ''
|
|
// this.fieldOptions.tableName = ''
|
|
|
// this.fieldOptions.isSub = false
|
|
// this.fieldOptions.isSub = false
|
|
|
},
|
|
},
|
|
|
- selectorChange(val) {
|
|
|
|
|
|
|
+ selectorChange (val) {
|
|
|
this.setDefaultValue()
|
|
this.setDefaultValue()
|
|
|
this.bindValueOptions = val === 'user' ? bindValueEmployeeOptions : bindValueOtherOptions
|
|
this.bindValueOptions = val === 'user' ? bindValueEmployeeOptions : bindValueOtherOptions
|
|
|
this.fieldOptions.bind = 'id'
|
|
this.fieldOptions.bind = 'id'
|
|
@@ -169,16 +213,16 @@ export default {
|
|
|
this.fieldOptions.filter = []
|
|
this.fieldOptions.filter = []
|
|
|
this.fieldOptions.store = 'id'
|
|
this.fieldOptions.store = 'id'
|
|
|
},
|
|
},
|
|
|
- setDataTemplateScopeAttr(data) {
|
|
|
|
|
- this.buttonKey === 'add' ? (this.fieldOptions.filter = [...this.fieldOptions.filter, ...data]) : (this.fieldOptions.filter[this.editIndex] = data[0])
|
|
|
|
|
|
|
+ setDataTemplateScopeAttr (data) {
|
|
|
|
|
+ this.buttonKey === 'add' ? this.fieldOptions.filter = [...this.fieldOptions.filter, ...data] : this.fieldOptions.filter[this.editIndex] = data[0]
|
|
|
},
|
|
},
|
|
|
- settlingDefaultValue() {
|
|
|
|
|
|
|
+ settlingDefaultValue () {
|
|
|
if (this.fieldOptions.default_value_type === 'fixed') {
|
|
if (this.fieldOptions.default_value_type === 'fixed') {
|
|
|
this.fieldOptions.default_value = ''
|
|
this.fieldOptions.default_value = ''
|
|
|
}
|
|
}
|
|
|
this.fieldOptions.filter = []
|
|
this.fieldOptions.filter = []
|
|
|
},
|
|
},
|
|
|
- addScope() {
|
|
|
|
|
|
|
+ addScope () {
|
|
|
this.readonly = false
|
|
this.readonly = false
|
|
|
this.editData = {}
|
|
this.editData = {}
|
|
|
this.buttonKey = 'add'
|
|
this.buttonKey = 'add'
|
|
@@ -187,7 +231,7 @@ export default {
|
|
|
this.settingOptionalScopeVisible = true
|
|
this.settingOptionalScopeVisible = true
|
|
|
},
|
|
},
|
|
|
// 设置按钮
|
|
// 设置按钮
|
|
|
- settingButton(i) {
|
|
|
|
|
|
|
+ settingButton (i) {
|
|
|
this.readonly = false
|
|
this.readonly = false
|
|
|
this.buttonKey = 'setting'
|
|
this.buttonKey = 'setting'
|
|
|
this.title = '编辑范围'
|
|
this.title = '编辑范围'
|
|
@@ -197,10 +241,10 @@ export default {
|
|
|
this.settingOptionalScopeVisible = true
|
|
this.settingOptionalScopeVisible = true
|
|
|
},
|
|
},
|
|
|
// 设置类型切换值
|
|
// 设置类型切换值
|
|
|
- setTypeOptions() {
|
|
|
|
|
|
|
+ setTypeOptions () {
|
|
|
const existingTypeScope = []
|
|
const existingTypeScope = []
|
|
|
const typeScope = []
|
|
const typeScope = []
|
|
|
- this.fieldOptions.filter.forEach((f) => {
|
|
|
|
|
|
|
+ this.fieldOptions.filter.forEach(f => {
|
|
|
existingTypeScope.push(f.userType)
|
|
existingTypeScope.push(f.userType)
|
|
|
})
|
|
})
|
|
|
// 根据已选范围动态调整范围下拉数据
|
|
// 根据已选范围动态调整范围下拉数据
|
|
@@ -213,9 +257,10 @@ export default {
|
|
|
this.existingTypeScope = typeScope
|
|
this.existingTypeScope = typeScope
|
|
|
},
|
|
},
|
|
|
// 删除按钮
|
|
// 删除按钮
|
|
|
- removeButton(i) {
|
|
|
|
|
|
|
+ removeButton (i) {
|
|
|
this.fieldOptions.filter.splice(i, 1)
|
|
this.fieldOptions.filter.splice(i, 1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|