|
@@ -1,16 +1,27 @@
|
|
<template>
|
|
<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="preview">
|
|
<template v-if="widget.type === 'color'">
|
|
<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>
|
|
<template v-else-if="widget.type == 'switch'">
|
|
<template v-else-if="widget.type == 'switch'">
|
|
<el-switch v-model="dataModel" :disabled="true" />
|
|
<el-switch v-model="dataModel" :disabled="true" />
|
|
@@ -20,18 +31,47 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-else-if="widget.type == 'file'">
|
|
<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" />
|
|
<i style="color: #909399" class="el-icon-document" />
|
|
<span>{{ uploadUrlItem.name || uploadUrlItem.url }}</span>
|
|
<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>
|
|
</el-image>
|
|
</div>
|
|
</div>
|
|
<!-- <a :href="uploadUrlItem.url" target="_blank">{{ uploadUrlItem.name || uploadUrlItem.url }}</a> -->
|
|
<!-- <a :href="uploadUrlItem.url" target="_blank">{{ uploadUrlItem.name || uploadUrlItem.url }}</a> -->
|
|
@@ -39,34 +79,61 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-else-if="widget.type == 'imgupload'">
|
|
<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>
|
|
<template v-else-if="widget.type == 'rate'">
|
|
<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>
|
|
<template v-else-if="widget.type === 'divider'">
|
|
<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 }}
|
|
{{ widget.options.defaultValue }}
|
|
</span>
|
|
</span>
|
|
</el-divider>
|
|
</el-divider>
|
|
</template>
|
|
</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>
|
|
<template v-else-if="widget.type === 'cascader'">
|
|
<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>
|
|
<template v-else-if="widget.type === 'textarea'">
|
|
<template v-else-if="widget.type === 'textarea'">
|
|
<span v-html="dataFormatBr(dataModel)"></span>
|
|
<span v-html="dataFormatBr(dataModel)"></span>
|
|
@@ -87,34 +154,68 @@
|
|
</template>
|
|
</template>
|
|
<template v-else>
|
|
<template v-else>
|
|
<template v-if="widget.type === 'input'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type === 'textarea'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type === 'number'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type === 'radio'">
|
|
<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.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-if="widget.options.remote">{{ item.label }}</template>
|
|
<template v-else>{{
|
|
<template v-else>{{
|
|
widget.options.showLabel ? item.label : item.value
|
|
widget.options.showLabel ? item.label : item.value
|
|
@@ -124,13 +225,21 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'checkbox'">
|
|
<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.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-if="widget.options.remote">{{ item.label }}</template>
|
|
<template v-else>{{
|
|
<template v-else>{{
|
|
widget.options.showLabel ? item.label : item.value
|
|
widget.options.showLabel ? item.label : item.value
|
|
@@ -140,56 +249,122 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'time'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type == 'date'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type == 'rate'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type === 'color'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type === 'select'">
|
|
<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>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'organ'">
|
|
<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>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'school'">
|
|
<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>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -198,55 +373,96 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type == 'slider'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type == 'imgupload'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type == 'file'">
|
|
<template v-if="widget.type == 'file'">
|
|
- <FileUpload :element="widget" :data-model="dataModel" @fileList="fileList" />
|
|
|
|
|
|
+ <FileUpload
|
|
|
|
+ :element="widget"
|
|
|
|
+ :data-model="dataModel"
|
|
|
|
+ @fileList="fileList"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'editor'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type === 'cascader'">
|
|
<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>
|
|
|
|
|
|
<template v-if="widget.type === 'text'">
|
|
<template v-if="widget.type === 'text'">
|
|
<!-- color: widget.options.font_color, -->
|
|
<!-- 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 }}
|
|
{{ widget.options.defaultValue }}
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-if="widget.type === 'divider'">
|
|
<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 }}
|
|
{{ widget.options.defaultValue }}
|
|
</span>
|
|
</span>
|
|
</el-divider>
|
|
</el-divider>
|
|
@@ -299,8 +515,8 @@ export default {
|
|
this.subformIndex === undefined
|
|
this.subformIndex === undefined
|
|
? this.models[this.widget.model]
|
|
? this.models[this.widget.model]
|
|
: this.models[this.subformModel][this.subformIndex][
|
|
: this.models[this.subformModel][this.subformIndex][
|
|
- this.widget.model
|
|
|
|
- ],
|
|
|
|
|
|
+ this.widget.model
|
|
|
|
+ ],
|
|
dataModelStr: null,
|
|
dataModelStr: null,
|
|
tableData: [],
|
|
tableData: [],
|
|
cooperationList: [],
|
|
cooperationList: [],
|
|
@@ -317,24 +533,33 @@ export default {
|
|
watch: {
|
|
watch: {
|
|
dataModel: {
|
|
dataModel: {
|
|
deep: true,
|
|
deep: true,
|
|
|
|
+ immediate: true,
|
|
handler(newValue) {
|
|
handler(newValue) {
|
|
- // console.log(newValue, 'model', this.widget.model)
|
|
|
|
|
|
+ // console.log(
|
|
|
|
+ // newValue,
|
|
|
|
+ // "model",
|
|
|
|
+ // this.widget.model,
|
|
|
|
+ // this.subformIndex,
|
|
|
|
+ // JSON.parse(JSON.stringify(this.models))
|
|
|
|
+ // );
|
|
if (newValue !== undefined && newValue !== null) {
|
|
if (newValue !== undefined && newValue !== null) {
|
|
if (this.subformIndex !== undefined) {
|
|
if (this.subformIndex !== undefined) {
|
|
- this.models[this.subformModel][this.subformIndex][
|
|
|
|
- this.widget.model
|
|
|
|
- ] = newValue;
|
|
|
|
|
|
+ // this.models[this.subformModel][this.subformIndex][
|
|
|
|
+ // this.widget.model
|
|
|
|
+ // ] = newValue;
|
|
this.$emit("update:models", {
|
|
this.$emit("update:models", {
|
|
...this.models,
|
|
...this.models,
|
|
[this.subformModel]: this.models[this.subformModel],
|
|
[this.subformModel]: this.models[this.subformModel],
|
|
});
|
|
});
|
|
|
|
+ this.$forceUpdate();
|
|
// this.$emit('input-change', val, this.widget.model, this.subformIndex)
|
|
// this.$emit('input-change', val, this.widget.model, this.subformIndex)
|
|
} else {
|
|
} else {
|
|
- this.models[this.widget.model] = newValue;
|
|
|
|
|
|
+ // this.models[this.widget.model] = newValue;
|
|
this.$emit("update:models", {
|
|
this.$emit("update:models", {
|
|
...this.models,
|
|
...this.models,
|
|
[this.widget.model]: newValue,
|
|
[this.widget.model]: newValue,
|
|
});
|
|
});
|
|
|
|
+ this.$forceUpdate();
|
|
// this.$emit('input-change', val, this.widget.model)
|
|
// this.$emit('input-change', val, this.widget.model)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -342,9 +567,18 @@ export default {
|
|
},
|
|
},
|
|
models: {
|
|
models: {
|
|
deep: true,
|
|
deep: true,
|
|
|
|
+ immediate: true,
|
|
async handler(val) {
|
|
async handler(val) {
|
|
// console.log(val, 'show')
|
|
// console.log(val, 'show')
|
|
- // console.log(this.widget, "12121", this.dataModel, this.subformIndex, ' subformIndex', this.models, this.subformModel);
|
|
|
|
|
|
+ // console.log(
|
|
|
|
+ // this.widget,
|
|
|
|
+ // "12121",
|
|
|
|
+ // this.dataModel,
|
|
|
|
+ // this.subformIndex,
|
|
|
|
+ // " subformIndex",
|
|
|
|
+ // this.models,
|
|
|
|
+ // this.subformModel
|
|
|
|
+ // );
|
|
if (val.status === undefined && val.status === null) {
|
|
if (val.status === undefined && val.status === null) {
|
|
if (this.subformIndex === undefined) {
|
|
if (this.subformIndex === undefined) {
|
|
this.dataModel = val[this.widget.model];
|
|
this.dataModel = val[this.widget.model];
|
|
@@ -440,8 +674,6 @@ export default {
|
|
// console.log(true, "false");
|
|
// console.log(true, "false");
|
|
this.onChangeSelect();
|
|
this.onChangeSelect();
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
isCheckImage(file) {
|
|
isCheckImage(file) {
|
|
@@ -616,7 +848,7 @@ export default {
|
|
if (this.subformModel) {
|
|
if (this.subformModel) {
|
|
organId =
|
|
organId =
|
|
this.models[this.subformModel][this.subformIndex][
|
|
this.models[this.subformModel][this.subformIndex][
|
|
- this.widget.options.displayRelation
|
|
|
|
|
|
+ this.widget.options.displayRelation
|
|
];
|
|
];
|
|
} else {
|
|
} else {
|
|
organId = this.models[this.widget.options.displayRelation];
|
|
organId = this.models[this.widget.options.displayRelation];
|
|
@@ -726,7 +958,7 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style>
|
|
<style>
|
|
-.previewEditorDiv>p {
|
|
|
|
|
|
+.previewEditorDiv > p {
|
|
margin: 0;
|
|
margin: 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -736,7 +968,11 @@ export default {
|
|
color: #303133;
|
|
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: "";
|
|
content: "";
|
|
}
|
|
}
|
|
|
|
|