|
@@ -12,12 +12,14 @@
|
|
|
<Input v-model="selectItem.label" placeholder="请输入" />
|
|
|
</a-form-item>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
<!-- +++ -->
|
|
|
<a-form-item
|
|
|
v-if="!hideModel && isDefined(selectItem.model)"
|
|
|
label="表名"
|
|
|
>
|
|
|
- <!-- <Select
|
|
|
+ <!-- <Select
|
|
|
v-model="formList.tableName"
|
|
|
:fieldNames="{
|
|
|
'label': tableComment, 'value': tableName
|
|
@@ -25,21 +27,12 @@
|
|
|
@change="getFormList"
|
|
|
mode="tags"
|
|
|
/> -->
|
|
|
- <el-select
|
|
|
- v-model="selectItem.tableName"
|
|
|
- placeholder="请选择"
|
|
|
- @change="getListName(selectItem)"
|
|
|
- >
|
|
|
+ <el-select v-model="selectItem.tableName" placeholder="请选择" @change="getListName(selectItem)">
|
|
|
<el-option
|
|
|
v-for="item in formList.formName"
|
|
|
:key="item.tableName"
|
|
|
:label="item.tableComment"
|
|
|
- :value="item.tableName"
|
|
|
- >
|
|
|
- <span style="float: left">{{ item.tableComment }}</span>
|
|
|
- <span style="float: right; color: #8492a6; font-size: 13px">{{
|
|
|
- item.tableName
|
|
|
- }}</span>
|
|
|
+ :value="item.tableName">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</a-form-item>
|
|
@@ -52,11 +45,13 @@
|
|
|
v-for="item in formList.listName"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
+ :value="item.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</a-form-item>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<!-- input type start -->
|
|
|
<a-form-item v-if="selectItem.type === 'input'" label="输入框type">
|
|
@@ -139,9 +134,8 @@
|
|
|
<a-form-item v-if="isDefined(options.dictCode)" label="dictCode">
|
|
|
<Input v-model="options.dictCode" />
|
|
|
</a-form-item>
|
|
|
-
|
|
|
<!-- 选项配置及动态数据配置 start -->
|
|
|
- <a-form-item v-if="isDefined(options.options)" label="选项配置">
|
|
|
+ <!-- <a-form-item v-if="isDefined(options.options)" label="选项配置">
|
|
|
<Radio buttonStyle="solid" v-model="options.dynamic">
|
|
|
<RadioButton :value="false">静态数据</RadioButton>
|
|
|
<RadioButton :value="true">动态数据</RadioButton>
|
|
@@ -154,9 +148,8 @@
|
|
|
/>
|
|
|
|
|
|
<KChangeOption v-show="!options.dynamic" v-model="options.options" />
|
|
|
- </a-form-item>
|
|
|
+ </a-form-item> -->
|
|
|
<!-- 选项配置及动态数据配置 end -->
|
|
|
-
|
|
|
<!-- tabs配置 start -->
|
|
|
<a-form-item
|
|
|
v-if="['tabs', 'selectInputList'].includes(selectItem.type)"
|
|
@@ -196,7 +189,6 @@
|
|
|
:count="options.max"
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
-
|
|
|
<a-form-item v-if="selectItem.type === 'select'" label="默认值">
|
|
|
<Select
|
|
|
:options="formList.listName"
|
|
@@ -211,15 +203,13 @@
|
|
|
:value="item.fieldName">
|
|
|
</el-option> -->
|
|
|
</a-form-item>
|
|
|
-
|
|
|
<a-form-item v-if="selectItem.type === 'radio'" label="默认值">
|
|
|
<Radio :options="options.options" v-model="options.defaultValue" />
|
|
|
</a-form-item>
|
|
|
-
|
|
|
<a-form-item v-if="selectItem.type === 'checkbox'" label="默认值">
|
|
|
<Checkbox :options="options.options" v-model="options.defaultValue" />
|
|
|
</a-form-item>
|
|
|
- <!-- 默认值 start -->
|
|
|
+ <!-- 日期选择器默认值 start -->
|
|
|
<a-form-item v-if="selectItem.type === 'date'" label="默认值">
|
|
|
<Input
|
|
|
v-if="!options.range"
|
|
@@ -249,7 +239,7 @@
|
|
|
'select',
|
|
|
'switch',
|
|
|
'slider',
|
|
|
- 'html',
|
|
|
+ 'html'
|
|
|
].includes(selectItem.type) && isDefined(options.defaultValue)
|
|
|
"
|
|
|
label="默认值"
|
|
@@ -408,12 +398,12 @@
|
|
|
<Select
|
|
|
:options="familyOptions"
|
|
|
v-model="options.fontFamily"
|
|
|
- style="width: 36%; margin-left: 2%; vertical-align: bottom"
|
|
|
+ style="width:36%;margin-left:2%;vertical-align:bottom;"
|
|
|
/>
|
|
|
<Select
|
|
|
:options="sizeOptions"
|
|
|
v-model="options.fontSize"
|
|
|
- style="width: 35%; margin-left: 2%; vertical-align: bottom"
|
|
|
+ style="width:35%;margin-left:2%;vertical-align:bottom;"
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
<a-form-item v-if="selectItem.type === 'text'" label="操作属性">
|
|
@@ -423,15 +413,15 @@
|
|
|
<a-form-item
|
|
|
v-if="
|
|
|
typeof options.hidden !== 'undefined' ||
|
|
|
- typeof options.disabled !== 'undefined' ||
|
|
|
- typeof options.readonly !== 'undefined' ||
|
|
|
- typeof options.clearable !== 'undefined' ||
|
|
|
- typeof options.multiple !== 'undefined' ||
|
|
|
- typeof options.range !== 'undefined' ||
|
|
|
- typeof options.showTime !== 'undefined' ||
|
|
|
- typeof options.allowHalf !== 'undefined' ||
|
|
|
- typeof options.showInput !== 'undefined' ||
|
|
|
- typeof options.animated !== 'undefined'
|
|
|
+ typeof options.disabled !== 'undefined' ||
|
|
|
+ typeof options.readonly !== 'undefined' ||
|
|
|
+ typeof options.clearable !== 'undefined' ||
|
|
|
+ typeof options.multiple !== 'undefined' ||
|
|
|
+ typeof options.range !== 'undefined' ||
|
|
|
+ typeof options.showTime !== 'undefined' ||
|
|
|
+ typeof options.allowHalf !== 'undefined' ||
|
|
|
+ typeof options.showInput !== 'undefined' ||
|
|
|
+ typeof options.animated !== 'undefined'
|
|
|
"
|
|
|
label="操作属性"
|
|
|
>
|
|
@@ -575,7 +565,7 @@
|
|
|
import KChangeOption from "../../KChangeOption/index.vue";
|
|
|
import kCheckbox from "../../KCheckbox/index.vue";
|
|
|
import { pluginManager } from "../../../utils/index";
|
|
|
-import { getListName, getFormName } from "@/api/dragform/form";
|
|
|
+import { getListName, getFormName } from "@/api/dragform/form";
|
|
|
const Input = pluginManager.getComponent("input").component;
|
|
|
const InputNumber = pluginManager.getComponent("number").component;
|
|
|
const Rate = pluginManager.getComponent("rate").component;
|
|
@@ -603,7 +593,7 @@ export default {
|
|
|
RadioItem,
|
|
|
RadioButton,
|
|
|
Textarea,
|
|
|
- Select,
|
|
|
+ Select
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -611,97 +601,97 @@ export default {
|
|
|
// 字体选择设置
|
|
|
{
|
|
|
value: "",
|
|
|
- label: "默认",
|
|
|
+ label: "默认"
|
|
|
},
|
|
|
{
|
|
|
value: "SimSun",
|
|
|
- label: "宋体",
|
|
|
+ label: "宋体"
|
|
|
},
|
|
|
{
|
|
|
value: "FangSong",
|
|
|
- label: "仿宋",
|
|
|
+ label: "仿宋"
|
|
|
},
|
|
|
{
|
|
|
value: "SimHei",
|
|
|
- label: "黑体",
|
|
|
+ label: "黑体"
|
|
|
},
|
|
|
{
|
|
|
value: "PingFangSC-Regular",
|
|
|
- label: "苹方",
|
|
|
+ label: "苹方"
|
|
|
},
|
|
|
{
|
|
|
value: "KaiTi",
|
|
|
- label: "楷体",
|
|
|
+ label: "楷体"
|
|
|
},
|
|
|
{
|
|
|
value: "LiSu",
|
|
|
- label: "隶书",
|
|
|
- },
|
|
|
+ label: "隶书"
|
|
|
+ }
|
|
|
],
|
|
|
sizeOptions: [
|
|
|
//字号选择设置
|
|
|
{
|
|
|
value: "26pt",
|
|
|
- label: "一号",
|
|
|
+ label: "一号"
|
|
|
},
|
|
|
{
|
|
|
value: "24pt",
|
|
|
- label: "小一",
|
|
|
+ label: "小一"
|
|
|
},
|
|
|
{
|
|
|
value: "22pt",
|
|
|
- label: "二号",
|
|
|
+ label: "二号"
|
|
|
},
|
|
|
{
|
|
|
value: "18pt",
|
|
|
- label: "小二",
|
|
|
+ label: "小二"
|
|
|
},
|
|
|
{
|
|
|
value: "16pt",
|
|
|
- label: "三号",
|
|
|
+ label: "三号"
|
|
|
},
|
|
|
{
|
|
|
value: "15pt",
|
|
|
- label: "小三",
|
|
|
+ label: "小三"
|
|
|
},
|
|
|
{
|
|
|
value: "14pt",
|
|
|
- label: "四号",
|
|
|
+ label: "四号"
|
|
|
},
|
|
|
{
|
|
|
value: "12pt",
|
|
|
- label: "小四",
|
|
|
+ label: "小四"
|
|
|
},
|
|
|
{
|
|
|
value: "10.5pt",
|
|
|
- label: "五号",
|
|
|
+ label: "五号"
|
|
|
},
|
|
|
{
|
|
|
value: "9pt",
|
|
|
- label: "小五",
|
|
|
- },
|
|
|
+ label: "小五"
|
|
|
+ }
|
|
|
],
|
|
|
- formList: {
|
|
|
- formName: [],
|
|
|
- listName: [],
|
|
|
- tableName: "",
|
|
|
+ formList:{
|
|
|
+ formName:[],
|
|
|
+ listName:[],
|
|
|
+ tableName:""
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
options() {
|
|
|
return this.selectItem.options || {};
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
props: {
|
|
|
selectItem: {
|
|
|
type: Object,
|
|
|
- required: true,
|
|
|
+ required: true
|
|
|
},
|
|
|
hideModel: {
|
|
|
type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
+ default: false
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
@@ -713,28 +703,27 @@ export default {
|
|
|
},
|
|
|
getFormList() {
|
|
|
let par = {
|
|
|
- ...this.$store.state.user.dataSource,
|
|
|
- };
|
|
|
- getFormName(par).then((res) => {
|
|
|
- this.formList.formName = res.data;
|
|
|
+ ... this.$store.state.user.dataSource
|
|
|
+ }
|
|
|
+ getFormName(par).then(res=>{
|
|
|
+ this.formList.formName = res.data
|
|
|
});
|
|
|
},
|
|
|
getListName(item) {
|
|
|
- item.model = "";
|
|
|
+ item.model=''
|
|
|
let par2 = {
|
|
|
- ...this.$store.state.user.dataSource,
|
|
|
- tableName: this.selectItem.tableName,
|
|
|
- isHump: true, //是否要求字段为驼峰
|
|
|
- };
|
|
|
- getListName(par2).then((res) => {
|
|
|
- this.formList.listName = res.map((item) => {
|
|
|
+ ... this.$store.state.user.dataSource,
|
|
|
+ 'tableName':this.selectItem.tableName
|
|
|
+ }
|
|
|
+ getListName(par2).then(res=>{
|
|
|
+ this.formList.listName = res.map(item => {
|
|
|
return {
|
|
|
label: item.fieldName,
|
|
|
- value: item.fieldName,
|
|
|
- };
|
|
|
+ value: item.fieldName
|
|
|
+ }
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getFormList();
|