|
@@ -1,27 +1,16 @@
|
|
|
<template>
|
|
|
- <el-form-item
|
|
|
- v-if="showStatus && hidden"
|
|
|
- :label-width="
|
|
|
- isLabel === false || !widget.options.labelWidthStatus ? '0px' : 150 + 'px'
|
|
|
- "
|
|
|
- :label="
|
|
|
- isLabel === false ||
|
|
|
- widget.type === 'divider' ||
|
|
|
- !widget.options.labelWidthStatus
|
|
|
- ? ''
|
|
|
- : widget.name
|
|
|
- "
|
|
|
- :key="propValue"
|
|
|
- :prop="propValue"
|
|
|
- :class="[parentForm, widget.type == 'text' && 'dataModelText']"
|
|
|
- :style="subformIndex !== undefined ? { 'margin-bottom': '0' } : {}"
|
|
|
- >
|
|
|
+ <el-form-item v-if="showStatus && hidden" :label-width="isLabel === false || !widget.options.labelWidthStatus ? '0px' : 150 + 'px'
|
|
|
+ " :label="isLabel === false ||
|
|
|
+ widget.type === 'divider' ||
|
|
|
+ !widget.options.labelWidthStatus
|
|
|
+ ? ''
|
|
|
+ : widget.name
|
|
|
+ " :key="propValue" :prop="propValue" :class="[parentForm, widget.type == 'text' && 'dataModelText']"
|
|
|
+ :style="subformIndex !== undefined ? { 'margin-bottom': '0' } : {}">
|
|
|
<template v-if="preview">
|
|
|
<template v-if="widget.type === 'color'">
|
|
|
- <div
|
|
|
- style="width: 32px; height: 20px; margin-top: 6px; border-radius: 3px"
|
|
|
- :style="{ 'background-color': dataModel }"
|
|
|
- />
|
|
|
+ <div style="width: 32px; height: 20px; margin-top: 6px; border-radius: 3px"
|
|
|
+ :style="{ 'background-color': dataModel }" />
|
|
|
</template>
|
|
|
<template v-else-if="widget.type == 'switch'">
|
|
|
<el-switch v-model="dataModel" :disabled="true" />
|
|
@@ -31,47 +20,18 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="widget.type == 'file'">
|
|
|
- <div
|
|
|
- v-for="(uploadUrlItem, uploadUrlIndex) of dataModel"
|
|
|
- :key="uploadUrlIndex"
|
|
|
- >
|
|
|
+ <div v-for="(uploadUrlItem, uploadUrlIndex) of dataModel" :key="uploadUrlIndex">
|
|
|
<i style="color: #909399" class="el-icon-document" />
|
|
|
<span>{{ uploadUrlItem.name || uploadUrlItem.url }}</span>
|
|
|
- <el-button
|
|
|
- round
|
|
|
- size="mini"
|
|
|
- @click="onDownload(uploadUrlItem, 'download')"
|
|
|
- >下载</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- round
|
|
|
- type="primary"
|
|
|
- @click="onDownload(uploadUrlItem)"
|
|
|
- v-if="
|
|
|
- checkFileSuffix(uploadUrlItem.url) &&
|
|
|
- !isCheckImage(uploadUrlItem.url)
|
|
|
- "
|
|
|
- size="mini"
|
|
|
- >预览</el-button
|
|
|
- >
|
|
|
- <div
|
|
|
- v-if="isCheckImage(uploadUrlItem.url)"
|
|
|
- style="display: inline-flex; position: relative"
|
|
|
- >
|
|
|
- <el-button
|
|
|
- style="position: absolute; left: 0; top: 0"
|
|
|
- round
|
|
|
- type="primary"
|
|
|
- @click="onDownload(uploadUrlItem)"
|
|
|
- v-if="checkFileSuffix(uploadUrlItem.url)"
|
|
|
- size="mini"
|
|
|
- >预览</el-button
|
|
|
- >
|
|
|
- <el-image
|
|
|
- style="width: 56px; height: 28px; opacity: 0"
|
|
|
- :src="uploadUrlItem.url"
|
|
|
- :preview-src-list="[uploadUrlItem.url]"
|
|
|
- >
|
|
|
+ <el-button round size="mini" @click="onDownload(uploadUrlItem, 'download')">下载</el-button>
|
|
|
+ <el-button round type="primary" @click="onDownload(uploadUrlItem)" v-if="checkFileSuffix(uploadUrlItem.url) &&
|
|
|
+ !isCheckImage(uploadUrlItem.url)
|
|
|
+ " size="mini">预览</el-button>
|
|
|
+ <div v-if="isCheckImage(uploadUrlItem.url)" style="display: inline-flex; position: relative">
|
|
|
+ <el-button style="position: absolute; left: 0; top: 0" round type="primary" @click="onDownload(uploadUrlItem)"
|
|
|
+ v-if="checkFileSuffix(uploadUrlItem.url)" size="mini">预览</el-button>
|
|
|
+ <el-image style="width: 56px; height: 28px; opacity: 0" :src="uploadUrlItem.url"
|
|
|
+ :preview-src-list="[uploadUrlItem.url]">
|
|
|
</el-image>
|
|
|
</div>
|
|
|
<!-- <a :href="uploadUrlItem.url" target="_blank">{{ uploadUrlItem.name || uploadUrlItem.url }}</a> -->
|
|
@@ -79,61 +39,34 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="widget.type == 'imgupload'">
|
|
|
- <fm-upload
|
|
|
- v-model="dataModel"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- :width="widget.options.size.width"
|
|
|
- :height="widget.options.size.height"
|
|
|
- :preview="preview"
|
|
|
- />
|
|
|
+ <fm-upload v-model="dataModel" :style="{ width: widget.options.width }" :width="widget.options.size.width"
|
|
|
+ :height="widget.options.size.height" :preview="preview" />
|
|
|
</template>
|
|
|
<template v-else-if="widget.type == 'rate'">
|
|
|
- <el-rate
|
|
|
- v-model="dataModel"
|
|
|
- :max="widget.options.max"
|
|
|
- :disabled="true"
|
|
|
- :allow-half="widget.options.allowHalf"
|
|
|
- />
|
|
|
+ <el-rate v-model="dataModel" :max="widget.options.max" :disabled="true" :allow-half="widget.options.allowHalf" />
|
|
|
</template>
|
|
|
<template v-else-if="widget.type === 'divider'">
|
|
|
- <el-divider
|
|
|
- :direction="widget.options.direction"
|
|
|
- :content-position="widget.options.content_position"
|
|
|
- >
|
|
|
- <span
|
|
|
- :style="{
|
|
|
- 'font-size': widget.options.font_size,
|
|
|
- 'font-family': widget.options.font_family,
|
|
|
- 'font-weight': widget.options.font_weight,
|
|
|
- color: widget.options.font_color,
|
|
|
- }"
|
|
|
- >
|
|
|
+ <el-divider :direction="widget.options.direction" :content-position="widget.options.content_position">
|
|
|
+ <span :style="{
|
|
|
+ 'font-size': widget.options.font_size,
|
|
|
+ 'font-family': widget.options.font_family,
|
|
|
+ 'font-weight': widget.options.font_weight,
|
|
|
+ color: widget.options.font_color,
|
|
|
+ }">
|
|
|
{{ widget.options.defaultValue }}
|
|
|
</span>
|
|
|
</el-divider>
|
|
|
</template>
|
|
|
- <template
|
|
|
- v-else-if="widget.type === 'input' && widget.options.showPassword"
|
|
|
- >
|
|
|
- <input
|
|
|
- :value="dataModel"
|
|
|
- type="password"
|
|
|
- style="border: none; background-color: #ffffff; color: #303133"
|
|
|
- disabled="disabled"
|
|
|
- />
|
|
|
+ <template v-else-if="widget.type === 'input' && widget.options.showPassword">
|
|
|
+ <input :value="dataModel" type="password" style="border: none; background-color: #ffffff; color: #303133"
|
|
|
+ disabled="disabled" />
|
|
|
</template>
|
|
|
<template v-else-if="widget.type === 'cascader'">
|
|
|
- <el-cascader
|
|
|
- v-model="dataModel"
|
|
|
- class="preview-cascader-class"
|
|
|
- :disabled="true"
|
|
|
- :show-all-levels="widget.options.showAllLevels"
|
|
|
- :options="
|
|
|
- widget.options.remote
|
|
|
- ? widget.options.remoteOptions
|
|
|
- : widget.options.options
|
|
|
- "
|
|
|
- />
|
|
|
+ <el-cascader v-model="dataModel" class="preview-cascader-class" :disabled="true"
|
|
|
+ :show-all-levels="widget.options.showAllLevels" :options="widget.options.remote
|
|
|
+ ? widget.options.remoteOptions
|
|
|
+ : widget.options.options
|
|
|
+ " />
|
|
|
</template>
|
|
|
<template v-else-if="widget.type === 'textarea'">
|
|
|
<span v-html="dataFormatBr(dataModel)"></span>
|
|
@@ -154,68 +87,34 @@
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<template v-if="widget.type === 'input'">
|
|
|
- <el-input
|
|
|
- v-if="
|
|
|
- widget.options.dataType === 'number' ||
|
|
|
- widget.options.dataType === 'integer' ||
|
|
|
- widget.options.dataType === 'float'
|
|
|
- "
|
|
|
- v-model="dataModel"
|
|
|
- :type="widget.options.dataType"
|
|
|
- @input="onInputChangeNumber($event)"
|
|
|
- :placeholder="widget.options.placeholder"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :show-password="widget.options.showPassword"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-else
|
|
|
- v-model="dataModel"
|
|
|
- :type="widget.options.dataType"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :placeholder="widget.options.placeholder"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- :show-password="widget.options.showPassword"
|
|
|
- />
|
|
|
+ <el-input v-if="widget.options.dataType === 'number' ||
|
|
|
+ widget.options.dataType === 'integer' ||
|
|
|
+ widget.options.dataType === 'float'
|
|
|
+ " v-model="dataModel" :type="widget.options.dataType" @input="onInputChangeNumber($event)"
|
|
|
+ :placeholder="widget.options.placeholder" :style="{ width: widget.options.width }"
|
|
|
+ :disabled="widget.options.disabled" :show-password="widget.options.showPassword" />
|
|
|
+ <el-input v-else v-model="dataModel" :type="widget.options.dataType" :disabled="widget.options.disabled"
|
|
|
+ :placeholder="widget.options.placeholder" :style="{ width: widget.options.width }"
|
|
|
+ :show-password="widget.options.showPassword" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'textarea'">
|
|
|
- <el-input
|
|
|
- v-model="dataModel"
|
|
|
- type="textarea"
|
|
|
- :rows="5"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :placeholder="widget.options.placeholder"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- />
|
|
|
+ <el-input v-model="dataModel" type="textarea" :rows="5" :disabled="widget.options.disabled"
|
|
|
+ :placeholder="widget.options.placeholder" :style="{ width: widget.options.width }" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'number'">
|
|
|
- <el-input-number
|
|
|
- v-model="dataModel"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- :step="widget.options.step"
|
|
|
- controls-position="right"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- />
|
|
|
+ <el-input-number v-model="dataModel" :style="{ width: widget.options.width }" :step="widget.options.step"
|
|
|
+ controls-position="right" :disabled="widget.options.disabled" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'radio'">
|
|
|
- <el-radio-group
|
|
|
- v-model="dataModel"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- >
|
|
|
- <el-radio
|
|
|
- v-for="(item, index) in widget.options.remote
|
|
|
+ <el-radio-group v-model="dataModel" :style="{ width: widget.options.width }" :disabled="widget.options.disabled">
|
|
|
+ <el-radio v-for="(item, index) in widget.options.remote
|
|
|
? widget.options.remoteOptions
|
|
|
- : widget.options.options"
|
|
|
- :key="index"
|
|
|
- :style="{
|
|
|
- display: widget.options.inline ? 'inline-block' : 'block',
|
|
|
- }"
|
|
|
- :label="item.value"
|
|
|
- >
|
|
|
+ : widget.options.options" :key="index" :style="{
|
|
|
+ display: widget.options.inline ? 'inline-block' : 'block',
|
|
|
+ }" :label="item.value">
|
|
|
<template v-if="widget.options.remote">{{ item.label }}</template>
|
|
|
<template v-else>{{
|
|
|
widget.options.showLabel ? item.label : item.value
|
|
@@ -225,21 +124,13 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'checkbox'">
|
|
|
- <el-checkbox-group
|
|
|
- v-model="dataModel"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- >
|
|
|
- <el-checkbox
|
|
|
- v-for="(item, index) in widget.options.remote
|
|
|
+ <el-checkbox-group v-model="dataModel" :style="{ width: widget.options.width }"
|
|
|
+ :disabled="widget.options.disabled">
|
|
|
+ <el-checkbox v-for="(item, index) in widget.options.remote
|
|
|
? widget.options.remoteOptions
|
|
|
- : widget.options.options"
|
|
|
- :key="index"
|
|
|
- :style="{
|
|
|
- display: widget.options.inline ? 'inline-block' : 'block',
|
|
|
- }"
|
|
|
- :label="item.value"
|
|
|
- >
|
|
|
+ : widget.options.options" :key="index" :style="{
|
|
|
+ display: widget.options.inline ? 'inline-block' : 'block',
|
|
|
+ }" :label="item.value">
|
|
|
<template v-if="widget.options.remote">{{ item.label }}</template>
|
|
|
<template v-else>{{
|
|
|
widget.options.showLabel ? item.label : item.value
|
|
@@ -249,122 +140,56 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'time'">
|
|
|
- <el-time-picker
|
|
|
- v-model="dataModel"
|
|
|
- :is-range="widget.options.isRange"
|
|
|
- :placeholder="widget.options.placeholder"
|
|
|
- :start-placeholder="widget.options.startPlaceholder"
|
|
|
- :end-placeholder="widget.options.endPlaceholder"
|
|
|
- :readonly="widget.options.readonly"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :editable="widget.options.editable"
|
|
|
- :clearable="widget.options.clearable"
|
|
|
- :arrow-control="widget.options.arrowControl"
|
|
|
- :value-format="widget.options.format"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- />
|
|
|
+ <el-time-picker v-model="dataModel" :is-range="widget.options.isRange" :placeholder="widget.options.placeholder"
|
|
|
+ :start-placeholder="widget.options.startPlaceholder" :end-placeholder="widget.options.endPlaceholder"
|
|
|
+ :readonly="widget.options.readonly" :disabled="widget.options.disabled" :editable="widget.options.editable"
|
|
|
+ :clearable="widget.options.clearable" :arrow-control="widget.options.arrowControl"
|
|
|
+ :value-format="widget.options.format" :style="{ width: widget.options.width }" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type == 'date'">
|
|
|
- <el-date-picker
|
|
|
- v-model="dataModel"
|
|
|
- :type="widget.options.type"
|
|
|
- :placeholder="widget.options.placeholder"
|
|
|
- :start-placeholder="widget.options.startPlaceholder"
|
|
|
- :end-placeholder="widget.options.endPlaceholder"
|
|
|
- :readonly="widget.options.readonly"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :editable="widget.options.editable"
|
|
|
- :clearable="widget.options.clearable"
|
|
|
- :value-format="
|
|
|
- widget.options.timestamp ? 'timestamp' : widget.options.format
|
|
|
- "
|
|
|
- :format="widget.options.format"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- />
|
|
|
+ <el-date-picker v-model="dataModel" :type="widget.options.type" :placeholder="widget.options.placeholder"
|
|
|
+ :start-placeholder="widget.options.startPlaceholder" :end-placeholder="widget.options.endPlaceholder"
|
|
|
+ :readonly="widget.options.readonly" :disabled="widget.options.disabled" :editable="widget.options.editable"
|
|
|
+ :clearable="widget.options.clearable" :value-format="widget.options.timestamp ? 'timestamp' : widget.options.format
|
|
|
+ " :format="widget.options.format" :style="{ width: widget.options.width }" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type == 'rate'">
|
|
|
- <el-rate
|
|
|
- v-model="dataModel"
|
|
|
- :max="widget.options.max"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :allow-half="widget.options.allowHalf"
|
|
|
- />
|
|
|
+ <el-rate v-model="dataModel" :max="widget.options.max" :disabled="widget.options.disabled"
|
|
|
+ :allow-half="widget.options.allowHalf" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'color'">
|
|
|
- <el-color-picker
|
|
|
- v-model="dataModel"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :show-alpha="widget.options.showAlpha"
|
|
|
- />
|
|
|
+ <el-color-picker v-model="dataModel" :disabled="widget.options.disabled" :show-alpha="widget.options.showAlpha" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'select'">
|
|
|
- <el-select
|
|
|
- v-model="dataModel"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :multiple="widget.options.multiple"
|
|
|
- :clearable="widget.options.clearable"
|
|
|
- :placeholder="widget.options.placeholder"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- filterable
|
|
|
- @change="onChangeSelect"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in widget.options.remote
|
|
|
- ? widget.options.remoteOptions
|
|
|
- : widget.options.options"
|
|
|
- :key="item.value"
|
|
|
- :value="item.value"
|
|
|
- :label="
|
|
|
- widget.options.showLabel || widget.options.remote
|
|
|
- ? item.label
|
|
|
- : item.value
|
|
|
- "
|
|
|
- />
|
|
|
+ <el-select v-model="dataModel" :disabled="widget.options.disabled" :multiple="widget.options.multiple"
|
|
|
+ :clearable="widget.options.clearable" :placeholder="widget.options.placeholder"
|
|
|
+ :style="{ width: widget.options.width }" filterable @change="onChangeSelect">
|
|
|
+ <el-option v-for="item in widget.options.remote
|
|
|
+ ? widget.options.remoteOptions
|
|
|
+ : widget.options.options" :key="item.value" :value="item.value" :label="widget.options.showLabel || widget.options.remote
|
|
|
+ ? item.label
|
|
|
+ : item.value
|
|
|
+ " />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'organ'">
|
|
|
- <el-select
|
|
|
- v-model="dataModel"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :multiple="widget.options.multiple"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- :placeholder="widget.options.placeholder"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- :name="widget.model"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in organList"
|
|
|
- :key="item.id"
|
|
|
- :value="item.id"
|
|
|
- :label="item.name"
|
|
|
- />
|
|
|
+ <el-select v-model="dataModel" :disabled="widget.options.disabled" :multiple="widget.options.multiple" clearable
|
|
|
+ filterable :placeholder="widget.options.placeholder" :style="{ width: widget.options.width }"
|
|
|
+ :name="widget.model">
|
|
|
+ <el-option v-for="item in organList" :key="item.id" :value="item.id" :label="item.name" />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'school'">
|
|
|
- <el-select
|
|
|
- v-model="dataModel"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :multiple="widget.options.multiple"
|
|
|
- clearable
|
|
|
- :placeholder="widget.options.placeholder"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- filterable
|
|
|
- :loading="selectLoading"
|
|
|
- @visible-change="onGetSchoolList"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in cooperationList"
|
|
|
- :key="item.id"
|
|
|
- :value="item.id"
|
|
|
- :label="item.name"
|
|
|
- />
|
|
|
+ <el-select v-model="dataModel" :disabled="widget.options.disabled" :multiple="widget.options.multiple" clearable
|
|
|
+ :placeholder="widget.options.placeholder" :style="{ width: widget.options.width }" filterable
|
|
|
+ :loading="selectLoading" @visible-change="onGetSchoolList">
|
|
|
+ <el-option v-for="item in cooperationList" :key="item.id" :value="item.id" :label="item.name" />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
|
|
@@ -373,96 +198,55 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type == 'slider'">
|
|
|
- <el-slider
|
|
|
- v-model="dataModel"
|
|
|
- :min="widget.options.min"
|
|
|
- :max="widget.options.max"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :step="widget.options.step"
|
|
|
- :show-input="widget.options.showInput"
|
|
|
- :range="widget.options.range"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- />
|
|
|
+ <el-slider v-model="dataModel" :min="widget.options.min" :max="widget.options.max"
|
|
|
+ :disabled="widget.options.disabled" :step="widget.options.step" :show-input="widget.options.showInput"
|
|
|
+ :range="widget.options.range" :style="{ width: widget.options.width }" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type == 'imgupload'">
|
|
|
- <fm-upload
|
|
|
- v-model="dataModel"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- :width="widget.options.size.width"
|
|
|
- :height="widget.options.size.height"
|
|
|
- :token="widget.options.token"
|
|
|
- :domain="widget.options.domain"
|
|
|
- :multiple="widget.options.multiple"
|
|
|
- :length="widget.options.length"
|
|
|
- :is-qiniu="widget.options.isQiniu"
|
|
|
- :is-delete="widget.options.isDelete"
|
|
|
- :min="widget.options.min"
|
|
|
- :is-edit="widget.options.isEdit"
|
|
|
- :action="widget.options.action"
|
|
|
- />
|
|
|
+ <fm-upload v-model="dataModel" :disabled="widget.options.disabled" :style="{ width: widget.options.width }"
|
|
|
+ :width="widget.options.size.width" :height="widget.options.size.height" :token="widget.options.token"
|
|
|
+ :domain="widget.options.domain" :multiple="widget.options.multiple" :length="widget.options.length"
|
|
|
+ :is-qiniu="widget.options.isQiniu" :is-delete="widget.options.isDelete" :min="widget.options.min"
|
|
|
+ :is-edit="widget.options.isEdit" :action="widget.options.action" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type == 'file'">
|
|
|
- <FileUpload
|
|
|
- :element="widget"
|
|
|
- :data-model="dataModel"
|
|
|
- @fileList="fileList"
|
|
|
- />
|
|
|
+ <FileUpload :element="widget" :data-model="dataModel" @fileList="fileList" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'editor'">
|
|
|
- <vue-editor
|
|
|
- v-model="dataModel"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- />
|
|
|
+ <vue-editor v-model="dataModel" :disabled="widget.options.disabled" :style="{ width: widget.options.width }" />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'cascader'">
|
|
|
- <el-cascader
|
|
|
- v-model="dataModel"
|
|
|
- :disabled="widget.options.disabled"
|
|
|
- :show-all-levels="widget.options.showAllLevels"
|
|
|
- :clearable="widget.options.clearable"
|
|
|
- :placeholder="widget.options.placeholder"
|
|
|
- :style="{ width: widget.options.width }"
|
|
|
- :options="
|
|
|
- widget.options.remote
|
|
|
- ? widget.options.remoteOptions
|
|
|
- : widget.options.options
|
|
|
- "
|
|
|
- />
|
|
|
+ <el-cascader v-model="dataModel" :disabled="widget.options.disabled"
|
|
|
+ :show-all-levels="widget.options.showAllLevels" :clearable="widget.options.clearable"
|
|
|
+ :placeholder="widget.options.placeholder" :style="{ width: widget.options.width }" :options="widget.options.remote
|
|
|
+ ? widget.options.remoteOptions
|
|
|
+ : widget.options.options
|
|
|
+ " />
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'text'">
|
|
|
<!-- color: widget.options.font_color, -->
|
|
|
- <span
|
|
|
- :style="{
|
|
|
- 'font-size': widget.options.font_size,
|
|
|
- 'font-family': widget.options.font_family,
|
|
|
- 'font-weight': widget.options.font_weight,
|
|
|
- }"
|
|
|
- class="dataModelText"
|
|
|
- >
|
|
|
+ <span :style="{
|
|
|
+ 'font-size': widget.options.font_size,
|
|
|
+ 'font-family': widget.options.font_family,
|
|
|
+ 'font-weight': widget.options.font_weight,
|
|
|
+ }" class="dataModelText">
|
|
|
{{ widget.options.defaultValue }}
|
|
|
</span>
|
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'divider'">
|
|
|
- <el-divider
|
|
|
- :direction="widget.options.direction"
|
|
|
- :content-position="widget.options.content_position"
|
|
|
- >
|
|
|
- <span
|
|
|
- :style="{
|
|
|
- 'font-size': widget.options.font_size,
|
|
|
- 'font-family': widget.options.font_family,
|
|
|
- 'font-weight': widget.options.font_weight,
|
|
|
- color: widget.options.font_color,
|
|
|
- }"
|
|
|
- >
|
|
|
+ <el-divider :direction="widget.options.direction" :content-position="widget.options.content_position">
|
|
|
+ <span :style="{
|
|
|
+ 'font-size': widget.options.font_size,
|
|
|
+ 'font-family': widget.options.font_family,
|
|
|
+ 'font-weight': widget.options.font_weight,
|
|
|
+ color: widget.options.font_color,
|
|
|
+ }">
|
|
|
{{ widget.options.defaultValue }}
|
|
|
</span>
|
|
|
</el-divider>
|
|
@@ -515,8 +299,8 @@ export default {
|
|
|
this.subformIndex === undefined
|
|
|
? this.models[this.widget.model]
|
|
|
: this.models[this.subformModel][this.subformIndex][
|
|
|
- this.widget.model
|
|
|
- ],
|
|
|
+ this.widget.model
|
|
|
+ ],
|
|
|
dataModelStr: null,
|
|
|
tableData: [],
|
|
|
cooperationList: [],
|
|
@@ -526,7 +310,7 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
hidden() {
|
|
|
- console.log(this.subformModel, this.widget.hidden);
|
|
|
+ // console.log(this.subformModel, this.widget.hidden);
|
|
|
return this.subformModel ? true : !this.widget.hidden;
|
|
|
},
|
|
|
},
|
|
@@ -560,6 +344,7 @@ export default {
|
|
|
deep: true,
|
|
|
async handler(val) {
|
|
|
// console.log(val, 'show')
|
|
|
+ // console.log(this.widget, "12121", this.dataModel, this.subformIndex, ' subformIndex', this.models, this.subformModel);
|
|
|
if (val.status === undefined && val.status === null) {
|
|
|
if (this.subformIndex === undefined) {
|
|
|
this.dataModel = val[this.widget.model];
|
|
@@ -589,7 +374,8 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
// 判断当前元素是否是分部表单()
|
|
|
- // console.log(this.widget, 'widget subform')
|
|
|
+ // console.log(this.widget, 'widget subform', this.data, '121212111111')
|
|
|
+
|
|
|
if (this.widget.type == "organ" && this.preview) {
|
|
|
let tempStr = null;
|
|
|
this.organList.forEach((item) => {
|
|
@@ -648,18 +434,21 @@ export default {
|
|
|
this.handleDisplayVerifiy();
|
|
|
},
|
|
|
mounted() {
|
|
|
- // console.log(this.widget, "12121", this.dataModel);
|
|
|
+ // console.log(this.widget, "12121", this.dataModel, this.subformIndex, ' subformIndex', this.models, this.subformModel);
|
|
|
+ // 判断是下拉菜单,并且有关联属性
|
|
|
if (this.widget.type == "select" && this.widget.options.relationStatus) {
|
|
|
- console.log(true, "false");
|
|
|
+ // console.log(true, "false");
|
|
|
this.onChangeSelect();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
isCheckImage(file) {
|
|
|
const urlArr = file.split(".");
|
|
|
const suffix = urlArr[urlArr.length - 1];
|
|
|
const imgSuffix = ["png", "jpg", "jpeg", "gif", "ico"];
|
|
|
- console.log(imgSuffix.includes(suffix), "11");
|
|
|
+ // console.log(imgSuffix.includes(suffix), "11");
|
|
|
return imgSuffix.includes(suffix);
|
|
|
},
|
|
|
// 获取学校列表
|
|
@@ -794,7 +583,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- console.log(relationArray, "111", this.dataModel, this.widget.options);
|
|
|
+ // console.log(relationArray, "111", this.dataModel, this.widget.options);
|
|
|
// if (relationArray.length > 0) {
|
|
|
this.$emit("relationFormChange", relationArray, allArray);
|
|
|
// }
|
|
@@ -827,7 +616,7 @@ export default {
|
|
|
if (this.subformModel) {
|
|
|
organId =
|
|
|
this.models[this.subformModel][this.subformIndex][
|
|
|
- this.widget.options.displayRelation
|
|
|
+ this.widget.options.displayRelation
|
|
|
];
|
|
|
} else {
|
|
|
organId = this.models[this.widget.options.displayRelation];
|
|
@@ -937,7 +726,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
-.previewEditorDiv > p {
|
|
|
+.previewEditorDiv>p {
|
|
|
margin: 0;
|
|
|
}
|
|
|
|
|
@@ -947,17 +736,14 @@ export default {
|
|
|
color: #303133;
|
|
|
}
|
|
|
|
|
|
-.preview-cascader-class
|
|
|
- .el-input.is-disabled
|
|
|
- .el-input__suffix
|
|
|
- .el-input__suffix-inner
|
|
|
- .el-input__icon.el-icon-arrow-down:before {
|
|
|
+.preview-cascader-class .el-input.is-disabled .el-input__suffix .el-input__suffix-inner .el-input__icon.el-icon-arrow-down:before {
|
|
|
content: "";
|
|
|
}
|
|
|
|
|
|
.dataModelText {
|
|
|
color: #e7af84;
|
|
|
}
|
|
|
+
|
|
|
.dataModelText .el-form-item__label {
|
|
|
color: #e7af84 !important;
|
|
|
}
|