|
|
@@ -39,7 +39,12 @@
|
|
|
</EditDialog>
|
|
|
|
|
|
<ElDialog v-model="showFileDialog" :title="selectedBase?.name" width="80%">
|
|
|
- <PagingTable url="/form/fileds" :where="{ formId: selectedBase?.id }" :order="{ createdAt: 'ASC' }" ref="fileTable">
|
|
|
+ <PagingTable
|
|
|
+ url="/form/fileds"
|
|
|
+ :where="{ formId: selectedBase?.id }"
|
|
|
+ :order="{ createdAt: 'ASC' }"
|
|
|
+ ref="fileTable"
|
|
|
+ >
|
|
|
<template #filter>
|
|
|
<ElButton :icon="Plus" @click="onFiledEdit()">添加</ElButton>
|
|
|
<ElButton :icon="Refresh" @click="fileTable.refresh()"></ElButton>
|
|
|
@@ -112,7 +117,7 @@
|
|
|
>
|
|
|
<ElInput v-model="filedModel.optionsValue" placeholder="选项值">
|
|
|
<template #append>
|
|
|
- <el-button type="text" @click="editOptions(filedModel)">编辑 </el-button>
|
|
|
+ <el-button type="text" @click="openOptions">编辑 </el-button>
|
|
|
</template>
|
|
|
</ElInput>
|
|
|
</ElFormItem>
|
|
|
@@ -122,13 +127,13 @@
|
|
|
<template v-if="filedModel.validate">
|
|
|
<ElFormItem prop="validatorType" label="验证类型">
|
|
|
<el-select v-model="filedModel.validatorType" clearable placeholder="请选择验证类型">
|
|
|
- <el-option
|
|
|
- v-for="item in validatorTypes"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- :key="item.value"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-option
|
|
|
+ v-for="item in validatorTypes"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :key="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</ElFormItem>
|
|
|
<ElFormItem prop="minLength" label="最短长度">
|
|
|
<ElInput v-model="filedModel.minLength" placeholder="请输入最短长度" />
|
|
|
@@ -385,4 +390,19 @@ function confirmOptions() {
|
|
|
function delOptions(index) {
|
|
|
options.value.splice(index, 1)
|
|
|
}
|
|
|
+
|
|
|
+function openOptions() {
|
|
|
+ if (filedModel.value.optionsValue) {
|
|
|
+ options.value = JSON.parse(filedModel.value.optionsValue)
|
|
|
+ } else {
|
|
|
+ options.value = [
|
|
|
+ {
|
|
|
+ label: '',
|
|
|
+ value: '',
|
|
|
+ type: 'string'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ editOptions(filedModel.value)
|
|
|
+}
|
|
|
</script>
|