| | |
| | | </div> |
| | | <span v-else-if="columnChildren.type == 'date'">{{ |
| | | formatterDate(scopeChildren.row, columnChildren) |
| | | }}</span> |
| | | }}</span> |
| | | <template v-else> |
| | | {{ scopeChildren.row[columnChildren.field] }} |
| | | </template> |
| | |
| | | <!-- 启用双击编辑功能,带编辑功能的不会渲染下拉框文本背景颜色 --> |
| | | <!-- @click="rowBeginEdit(scope.$index,cindex)" --> |
| | | <!-- 2021.09.21增加编辑时对readonly属性判断 --> |
| | | <template v-else-if="column.edit && !column.readonly && ['file', 'img', 'excel'].indexOf(column.edit.type) != -1"> |
| | | <template |
| | | v-else-if="column.edit && !column.readonly && ['file', 'img', 'excel'].indexOf(column.edit.type) != -1"> |
| | | <div style="display:flex;align-items: center;" @click.stop> |
| | | <i v-if="!column.showUpload || column.showUpload(scope.row, column)" |
| | | style="padding: 3px;margin-right: 10px;color:#8f9293;cursor: pointer;" |
| | |
| | | <!-- 2020.07.24增加日期onChange事件 --> |
| | | <el-date-picker clearable size="default" style="width: 100%" |
| | | v-if="['date', 'datetime'].indexOf(column.edit.type) != -1" v-model="scope.row[column.field]" @change="(val) => { |
| | | column.onChange && |
| | | column.onChange(scope.row, column, val); |
| | | } |
| | | column.onChange && |
| | | column.onChange(scope.row, column, val); |
| | | } |
| | | " :type="column.edit.type" :placeholder="column.placeholder || column.title" |
| | | :disabledDate="(val) => getDateOptions(val, column)" :value-format="getDateFormat(column)" |
| | | :disabled="initColumnDisabled(scope.row, column)"> |
| | | </el-date-picker> |
| | | <el-time-picker clearable size="default" style="width: 100%" v-else-if="column.edit.type == 'time'" |
| | | v-model="scope.row[column.field]" @change="(val) => { |
| | | column.onChange && |
| | | column.onChange(scope.row, column, val); |
| | | } |
| | | column.onChange && |
| | | column.onChange(scope.row, column, val); |
| | | } |
| | | " :placeholder="column.placeholder || column.title" :value-format="column.format || 'HH:mm:ss'" |
| | | :disabled="initColumnDisabled(scope.row, column)"> |
| | | </el-time-picker> |
| | | <el-switch v-else-if="column.edit.type == 'switch'" v-model="scope.row[column.field]" |
| | | active-color="#0f84ff" inactive-color="rgb(194 194 194)" active-text="是" inactive-text="否" |
| | | inline-prompt @change="(val) => { |
| | | switchChange(val, scope.row, column); |
| | | } |
| | | switchChange(val, scope.row, column); |
| | | } |
| | | " :active-value="typeof scope.row[column.field] == 'boolean' |
| | | ? true |
| | | : typeof scope.row[column.field] == 'string' |
| | | ? '1' |
| | | : 1 |
| | | " :inactive-value="typeof scope.row[column.field] == 'boolean' |
| | | " :inactive-value="typeof scope.row[column.field] == 'boolean' |
| | | ? false |
| | | : typeof scope.row[column.field] == 'string' |
| | | ? '0' |
| | | : 0 |
| | | " :disabled="initColumnDisabled(scope.row, column)"> |
| | | " :disabled="initColumnDisabled(scope.row, column)"> |
| | | </el-switch> |
| | | <template v-else-if=" |
| | | ['select', 'selectList'].indexOf(column.edit.type) != -1 |
| | |
| | | </el-select-v2> |
| | | |
| | | <el-select size="default" style="width: 100%" v-else v-model="scope.row[column.field]" :filterable="column.filter || column.bind.data.length > 10 |
| | | ? true |
| | | : false |
| | | ? true |
| | | : false |
| | | " :multiple="column.edit.type == 'select' ? false : true" |
| | | :placeholder="column.placeholder || column.title" :allow-create="column.autocomplete" @change=" |
| | | column.onChange && column.onChange(scope.row, column) |
| | |
| | | v-else-if="column.edit.type == 'treeSelect' || column.edit.type == 'cascader'" |
| | | v-model="scope.row[column.field]" :data="column.bind.data" |
| | | :multiple="column.multiple === undefined ? true : column.multiple" :render-after-expand="false" |
| | | :show-checkbox="true" :check-strictly="column.checkStrictly === undefined ? true : column.checkStrictly" |
| | | check-on-click-node node-key="key" @change="column.onChange && column.onChange(scope.row, column)" |
| | | :show-checkbox="true" |
| | | :check-strictly="column.checkStrictly === undefined ? true : column.checkStrictly" check-on-click-node |
| | | node-key="key" @change="column.onChange && column.onChange(scope.row, column)" |
| | | :props="{ label: 'label' }"> |
| | | <template #default="{ data, node }"> |
| | | {{ data.label }}</template> |
| | |
| | | )" :key="fIndex" @click="dowloadFile(file)">{{ file.name }}</a> |
| | | <span v-else-if="column.type == 'date'">{{ |
| | | formatterDate(scope.row, column) |
| | | }}</span> |
| | | }}</span> |
| | | <div v-else-if="column.formatter" @click="formatterClick(scope.row, column, $event)" |
| | | v-html="column.formatter(scope.row, column)"></div> |
| | | <!-- 2021.11.18修复table数据源设置为normal后点击行$event缺失的问题 --> |
| | |
| | | {{ scope.row[column.field] }} |
| | | </div> |
| | | <div @click="() => { |
| | | column.click && formatterClick(scope.row, column); |
| | | } |
| | | column.click && formatterClick(scope.row, column); |
| | | } |
| | | " v-else-if="column.bind"> |
| | | <el-tag v-if="useTag" class="cell-tag" :class="[isEmptyTag(scope.row, column)]" |
| | | :type="getColor(scope.row, column)" :effect="column.effect">{{ formatter(scope.row, column, true) |
| | | }}</el-tag> |
| | | <template v-else>{{ |
| | | formatter(scope.row, column, true) |
| | | }}</template> |
| | | }}</template> |
| | | </div> |
| | | |
| | | <span v-else>{{ formatter(scope.row, column, true) }}</span> |