| | |
| | | :selectable="selectable" |
| | | width="55" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | v-if="columnIndex" |
| | | type="index" |
| | | :fixed="fixed" |
| | | width="55" |
| | | ></el-table-column> |
| | | <el-table-column v-if="columnIndex" type="index" :fixed="fixed" width="55"></el-table-column> |
| | | |
| | | <!-- 2020.10.10ç§»é¤table第ä¸è¡å¼ºå¶æåº --> |
| | | <el-table-column |
| | |
| | | :show-overflow-tooltip="true" |
| | | > |
| | | <template #header> |
| | | <span |
| | | v-if="(column.require || column.required) && column.edit" |
| | | class="column-required" |
| | | >*</span |
| | | >{{ column.title }} |
| | | <span v-if="(column.require || column.required) && column.edit" class="column-required">*</span> |
| | | {{ column.title }} |
| | | </template> |
| | | |
| | | <template #default="scope"> |
| | |
| | | ) |
| | | " |
| | | ></div> |
| | | <div v-else-if="column.bind"> |
| | | {{ formatter(scopeChildren.row, columnChildren, true) }} |
| | | </div> |
| | | <span v-else-if="column.type == 'date'">{{ |
| | | <div v-else-if="column.bind">{{ formatter(scopeChildren.row, columnChildren, true) }}</div> |
| | | <span v-else-if="column.type == 'date'"> |
| | | {{ |
| | | formatterDate(scopeChildren.row, columnChildren) |
| | | }}</span> |
| | | <template v-else> |
| | | {{ scopeChildren.row[columnChildren.field] }} |
| | | </template> |
| | | }} |
| | | </span> |
| | | <template v-else>{{ scopeChildren.row[columnChildren.field] }}</template> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- 2020.06.18å¢å render渲æèªå®ä¹å
容 --> |
| | |
| | | )" |
| | | :key="fIndex" |
| | | @click="dowloadFile(file)" |
| | | >{{ file.name }}</a |
| | | > |
| | | >{{ file.name }}</a> |
| | | </div> |
| | | </template> |
| | | <div |
| | |
| | | :disabledDate="(val) => getDateOptions(val, column)" |
| | | :value-format="getDateFormat(column)" |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | > |
| | | </el-date-picker> |
| | | ></el-date-picker> |
| | | <el-time-picker |
| | | clearable |
| | | size="default" |
| | |
| | | :placeholder="column.placeholder || column.title" |
| | | :value-format="column.format || 'HH:mm:ss'" |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | > |
| | | </el-time-picker> |
| | | ></el-time-picker> |
| | | <el-switch |
| | | v-else-if="column.edit.type == 'switch'" |
| | | v-model="scope.row[column.field]" |
| | |
| | | : 0 |
| | | " |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | > |
| | | </el-switch> |
| | | ></el-switch> |
| | | <template |
| | | v-else-if=" |
| | | ['select', 'selectList'].indexOf(column.edit.type) != -1 |
| | |
| | | clearable |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | > |
| | | <template #default="{ item }"> |
| | | {{ item.label }} |
| | | </template> |
| | | <template #default="{ item }">{{ item.label }}</template> |
| | | </el-select-v2> |
| | | |
| | | <el-select |
| | |
| | | :disabled="item.disabled" |
| | | :label="item.value" |
| | | :value="item.key" |
| | | >{{ item.value }} |
| | | </el-option> |
| | | >{{ item.value }}</el-option> |
| | | </el-select> |
| | | </template> |
| | | <el-input |
| | |
| | | :placeholder="column.placeholder || column.title" |
| | | v-model="scope.row[column.field]" |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | > |
| | | </el-input> |
| | | ></el-input> |
| | | <input |
| | | class="table-input" |
| | | v-else-if="!column.summary && !column.onKeyPress" |
| | |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | ></el-input> |
| | | </div> |
| | | <div |
| | | class="extra" |
| | | v-if="column.extra && edit.rowIndex == scope.$index" |
| | | > |
| | | <div class="extra" v-if="column.extra && edit.rowIndex == scope.$index"> |
| | | <a |
| | | :style="column.extra.style" |
| | | style="text-decoration: none" |
| | |
| | | )" |
| | | :key="fIndex" |
| | | @click="dowloadFile(file)" |
| | | >{{ file.name }}</a |
| | | > |
| | | <span v-else-if="column.type == 'date'">{{ |
| | | >{{ 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-else-if="column.bind && (column.normal || column.edit)" |
| | | @click="formatterClick(scope.row, column, $event)" |
| | | :style="column.getStyle && column.getStyle(scope.row, column)" |
| | | > |
| | | {{ formatter(scope.row, column, true) }} |
| | | </div> |
| | | >{{ formatter(scope.row, column, true) }}</div> |
| | | <div |
| | | v-else-if="column.click && !column.bind" |
| | | @click="formatterClick(scope.row, column)" |
| | | > |
| | | {{ scope.row[column.field] }} |
| | | </div> |
| | | >{{ scope.row[column.field] }}</div> |
| | | <div |
| | | @click=" |
| | | () => { |
| | |
| | | :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) }}</el-tag> |
| | | <template v-else> |
| | | {{ |
| | | formatter(scope.row, column, true) |
| | | }}</template> |
| | | }} |
| | | </template> |
| | | </div> |
| | | |
| | | <span v-else>{{ formatter(scope.row, column, true) }}</span> |
| | |
| | | </template> |
| | | </div> |
| | | |
| | | <VolBox |
| | | v-model="uploadModel" |
| | | title="ä¸ä¼ " |
| | | :height="228" |
| | | :width="500" |
| | | :padding="15" |
| | | lazy |
| | | > |
| | | <VolBox v-model="uploadModel" title="ä¸ä¼ " :height="228" :width="500" :padding="15" lazy> |
| | | <!-- ä¸ä¼ å¾çãexcelæå
¶ä»æä»¶ãæä»¶æ°éã大å°éå¶é½å¯ä»¥ï¼åç
§voluploadç»ä»¶api --> |
| | | <div style="height: 200px; display: flex; align-items: center"> |
| | | <VolUpload |
| | |
| | | </div> |
| | | <template #footer> |
| | | <div style="text-align: center"> |
| | | <el-button type="default" size="small" @click="uploadModel = false" |
| | | >å
³é</el-button |
| | | > |
| | | <el-button type="primary" size="small" @click="saveUpload" |
| | | >ä¿å</el-button |
| | | > |
| | | <el-button type="default" size="small" @click="uploadModel = false">å
³é</el-button> |
| | | <el-button type="primary" size="small" @click="saveUpload">ä¿å</el-button> |
| | | </div> |
| | | </template> |
| | | </VolBox> |
| | |
| | | "tableData.length": { |
| | | handler(newLen, oldLen) { |
| | | this.watchRowSelectChange(newLen, oldLen); |
| | | }, |
| | | } |
| | | }, |
| | | "rowData.length": { |
| | | handler(newLen, oldLen) { |
| | | this.watchRowSelectChange(newLen, oldLen); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | "table-render": VolTableRender, |
| | | VolUpload: defineAsyncComponent(() => |
| | | import("@/components/basic/VolUpload.vue") |
| | | ), |
| | | VolBox: defineAsyncComponent(() => import("@/components/basic/VolBox.vue")), |
| | | VolBox: defineAsyncComponent(() => import("@/components/basic/VolBox.vue")) |
| | | }, |
| | | props: { |
| | | rowKey: { |
| | | // æ å½¢ç»æç主é®å段ï¼å¦æè®¾ç½®å¼é»è®¤ä¼å¼å¯æ å½¢tableï¼æ³¨ærowKeyåæ®µçå¼å¿
é¡»æ¯å¯ä¸ï¼2021.05.02ï¼ |
| | | typeof: String, |
| | | default: undefined, |
| | | default: undefined |
| | | }, |
| | | loadTreeChildren: { |
| | | // æ å½¢ç»æå è½½åèç¹ |
| | | type: Function, |
| | | default: (tree, treeNode, resolve) => { |
| | | return resolve([]); |
| | | }, |
| | | } |
| | | }, |
| | | textInline: { |
| | | // è¡¨æ ¼å
容è¶
åºåæ¯å¦æ¢è¡æ¾ç¤ºï¼2020.01.16ï¼ |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | tableData: { |
| | | // è¡¨æ°æ®æº,é
ç½®äºurlå°±ä¸ç¨ä¼ è¿ä¸ªåæ°äº |
| | | type: Array, |
| | | default: () => { |
| | | return []; |
| | | }, |
| | | } |
| | | }, |
| | | columns: { |
| | | type: Array, |
| | | default: [], |
| | | default: [] |
| | | }, |
| | | height: { |
| | | type: Number, |
| | | default: 0, |
| | | default: 0 |
| | | }, |
| | | maxHeight: { |
| | | type: Number, |
| | | default: 0, |
| | | default: 0 |
| | | }, |
| | | linkView: { |
| | | type: Function, |
| | | default: function () { |
| | | default: function() { |
| | | return 1; |
| | | }, |
| | | } |
| | | }, |
| | | pagination: { |
| | | type: Object, |
| | | default: function () { |
| | | default: function() { |
| | | return { total: 0, size: 30, sortName: "" }; |
| | | }, |
| | | } |
| | | }, |
| | | url: { |
| | | type: String, |
| | | default: "", |
| | | default: "" |
| | | }, |
| | | paginationHide: { |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | color: { |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | index: { |
| | | // æ¯å¦å建索å¼å·,妿éè¦è¡¨æ ¼ç¼è¾åè½ï¼è¿ééè¦è®¾ç½®ä¸ºtrue |
| | | type: Boolean, |
| | | default: false, |
| | | default: false |
| | | }, |
| | | allowEmpty: { |
| | | // è¡¨æ ¼æ°æ®ä¸ºç©ºæ¶æ¯å¦é»è®¤ä¸º-- |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | defaultLoadPage: { |
| | | // ä¼ å
¥äºurlï¼æ¯å¦é»è®¤å è½½è¡¨æ ¼æ°æ® |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | loadKey: { |
| | | // æ¯å¦èªå¨ä»åå°å è½½æ°æ®æº |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | single: { |
| | | type: Boolean, // æ¯å¦åé |
| | | default: false, |
| | | default: false |
| | | }, |
| | | doubleEdit: { |
| | | type: Boolean, // æ¯å¦åå»å¯ç¨ç¼è¾åè½ |
| | | default: true, |
| | | default: true |
| | | }, |
| | | beginEdit: { |
| | | // ç¼è¾å¼å§ |
| | | type: Function, |
| | | default: function (row, column, index) { |
| | | default: function(row, column, index) { |
| | | return true; |
| | | }, |
| | | } |
| | | }, |
| | | endEditBefore: { |
| | | // ç»æç¼è¾å |
| | | type: Function, |
| | | default: function (row, column, index) { |
| | | default: function(row, column, index) { |
| | | return true; |
| | | }, |
| | | } |
| | | }, |
| | | endEditAfter: { |
| | | // ç»æç¼è¾å |
| | | type: Function, |
| | | default: function (row, column, index) { |
| | | default: function(row, column, index) { |
| | | return true; |
| | | }, |
| | | } |
| | | }, |
| | | ck: { |
| | | // æ¯å¦æ¾ç¤ºcheckbox |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | columnIndex: { |
| | | // æ¯å¦æ¾ç¤ºè¡å·(2020..11.1) |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | highlightCurrentRow: { |
| | | //å¢å éä¸è¡é«äº®æ¾ç¤º(2022.10.07) |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | select2Count: { |
| | | //è¶
åºæ°éæ¾ç¤ºselect2ç»ä»¶ |
| | | type: Number, |
| | | default: 500, |
| | | default: 500 |
| | | }, |
| | | selectable: { |
| | | type: Function, |
| | | default: (row, index) => { |
| | | return true; |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | rule: { |
| | | phone: /^[1][3,4,5,6,7,8,9][0-9]{9}$/, |
| | | decimal: /(^[\-0-9][0-9]*(.[0-9]+)?)$/, |
| | | number: /(^[\-0-9][0-9]*([0-9]+)?)$/, |
| | | number: /(^[\-0-9][0-9]*([0-9]+)?)$/ |
| | | }, |
| | | columnNames: [], |
| | | rowData: [], |
| | |
| | | size: 30, // é»è®¤åé¡µå¤§å° |
| | | Wheres: [], |
| | | page: 1, |
| | | rows: 30, |
| | | rows: 30 |
| | | }, |
| | | errorFiled: "", |
| | | edit: { columnIndex: -1, rowIndex: -1 }, // å½ååå»ç¼è¾çè¡ä¸ååæ |
| | |
| | | currentColumn: [], |
| | | fileInfo: [], |
| | | uploadUrl: "", |
| | | uploadModel: false, |
| | | uploadModel: false |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | // } |
| | | this.realHeight = this.getHeight(); |
| | | this.realMaxHeight = this.getMaxHeight(); |
| | | this.fxRight = this.columns.some((x) => { |
| | | this.fxRight = this.columns.some(x => { |
| | | return x.fixed == "right"; |
| | | }); |
| | | //2021.09.21ç§»é¤å¼ºå¶åºå®è¡å·ä¸checkboxå |
| | | if ( |
| | | this.columns.some((x) => { |
| | | this.columns.some(x => { |
| | | return x.fixed && x.fixed != "right"; |
| | | }) |
| | | ) { |
| | |
| | | } |
| | | }); |
| | | if (keys.length > 0) { |
| | | this.http |
| | | .post("/api/Sys_Dictionary/GetVueDictionary", keys) |
| | | .then((dic) => { |
| | | dic.forEach((x) => { |
| | | if (x.data.length > this.select2Count) { |
| | | x.data.forEach((item) => { |
| | | item.label = item.value; |
| | | item.value = item.key; |
| | | this.http.post("/api/Sys_Dictionary/GetVueDictionary", keys).then(dic => { |
| | | dic.forEach(x => { |
| | | if (x.data.length > this.select2Count) { |
| | | x.data.forEach(item => { |
| | | item.label = item.value; |
| | | item.value = item.key; |
| | | }); |
| | | } |
| | | columnBind.forEach(c => { |
| | | // è½¬æ¢æ°æ®æºçç±»åä¸åçç±»åä¸è´(2020.04.04) |
| | | if ( |
| | | c.key == x.dicNo && |
| | | (c.valueTyoe == "int" || c.valueTyoe == "sbyte") |
| | | ) { |
| | | x.data.forEach(d => { |
| | | // 2020.09.01å¢å 对æ°åç±»åçäºæ¬¡å¤æ |
| | | if (!isNaN(d.key)) { |
| | | d.key = ~~d.key; |
| | | } |
| | | }); |
| | | } |
| | | columnBind.forEach((c) => { |
| | | // è½¬æ¢æ°æ®æºçç±»åä¸åçç±»åä¸è´(2020.04.04) |
| | | if ( |
| | | c.key == x.dicNo && |
| | | (c.valueTyoe == "int" || c.valueTyoe == "sbyte") |
| | | ) { |
| | | x.data.forEach((d) => { |
| | | // 2020.09.01å¢å 对æ°åç±»åçäºæ¬¡å¤æ |
| | | if (!isNaN(d.key)) { |
| | | d.key = ~~d.key; |
| | | } |
| | | }); |
| | | } |
| | | if (c.key == x.dicNo) c.data.push(...x.data); |
| | | }); |
| | | if (c.key == x.dicNo) c.data.push(...x.data); |
| | | }); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | this.paginations.sort = this.pagination.sortName; |
| | |
| | | if (this.pagination.size) { |
| | | this.paginations.rows = this.pagination.size; |
| | | } |
| | | this.enableEdit = this.columns.some((x) => { |
| | | this.enableEdit = this.columns.some(x => { |
| | | return x.hasOwnProperty("edit"); |
| | | }); |
| | | let keyColumn = this.columns.find((x) => { |
| | | let keyColumn = this.columns.find(x => { |
| | | return x.isKey; |
| | | }); |
| | | if (keyColumn) { |
| | |
| | | } |
| | | return !x.hidden; |
| | | }); |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | watchRowSelectChange(newLen, oldLen) { |
| | |
| | | if (row.elementIndex == this.edit.rowIndex) { |
| | | // ç¹å»çåå
æ ¼å¦æä¸å¯ä»¥ç¼è¾ï¼ç´æ¥ç»æç¼è¾ |
| | | // 2020.10.12ä¿®å¤ç»æç¼è¾æ¶ï¼element tableé«çæ¬å±æ§è·åä¸å°çé®é¢ |
| | | let _col = this.columns.find((x) => { |
| | | let _col = this.columns.find(x => { |
| | | return x.field == ((event && event.property) || column.property); |
| | | }); |
| | | if (_col && (!_col.edit || _col.readonly)) { |
| | |
| | | file.path, |
| | | file.name, |
| | | { |
| | | Authorization: this.$store.getters.getToken(), |
| | | Authorization: this.$store.getters.getToken() |
| | | }, |
| | | this.http.ipAddress |
| | | ); |
| | |
| | | if (column.base64 && pathSring.indexOf("data") != -1) { |
| | | filePath = ("," + pathSring) |
| | | .split(",data") |
| | | .filter((x) => { |
| | | .filter(x => { |
| | | return x; |
| | | }) |
| | | .map((m) => { |
| | | .map(m => { |
| | | return "data" + m; |
| | | }); |
| | | } else { |
| | |
| | | name: "", |
| | | path: |
| | | (file.indexOf("data") == -1 ? "data:image/png;base64," : "") + |
| | | file, |
| | | file |
| | | }); |
| | | } else if (file.indexOf(".") != -1) { |
| | | let splitFile = file.split("/"); |
| | | if (splitFile.length > 0) { |
| | | fileInfo.push({ |
| | | name: splitFile[splitFile.length - 1], |
| | | path: this.base.isUrl(file) ? file : this.http.ipAddress + file, |
| | | path: this.base.isUrl(file) ? file : this.http.ipAddress + file |
| | | }); |
| | | } |
| | | } |
| | |
| | | if (this.edit.rowIndex != -1) { |
| | | return; |
| | | } |
| | | let _row = this.columns.find((x) => x.field == column.property); |
| | | let _row = this.columns.find(x => x.field == column.property); |
| | | if (_row) { |
| | | if (_row.readonly) { |
| | | return; |
| | |
| | | _errMsg = ""; |
| | | // ç¼è¾å |
| | | this.columns |
| | | .filter((x) => { |
| | | .filter(x => { |
| | | return x.bind && x.bind.data && x.bind.data.length; |
| | | }) |
| | | .forEach((column) => { |
| | | .forEach(column => { |
| | | let val = row[column.field]; |
| | | if (typeof column.bind.data[0].key == "string") { |
| | | if (typeof val == "number") { |
| | |
| | | if (!row) { |
| | | row = {}; |
| | | } |
| | | this.columns.forEach((x) => { |
| | | this.columns.forEach(x => { |
| | | // 2022.05.06 æ·»å è¡æ¶ï¼å¦æåæç¼è¾å±æ§ï¼è®¾ç½®å¼å¯ç¼è¾(é¿å
å
³éç¼è¾åï¼æ æ³å次å¯ç¨ç¼è¾)?? |
| | | //x.readonly = false; |
| | | if (!row.hasOwnProperty(x.field)) { |
| | |
| | | // åªæè®¾ç½®äºå±æ§indexææç´¢å¼è¡ |
| | | return []; |
| | | } |
| | | let indexArr = this.selectRows.map((x) => { |
| | | let indexArr = this.selectRows.map(x => { |
| | | return x.elementIndex; |
| | | }); |
| | | return indexArr || []; |
| | |
| | | // column.bind.data.splice(0); |
| | | let key = column.bind.key; |
| | | let data = []; |
| | | rows.forEach((row) => { |
| | | rows.forEach(row => { |
| | | if (row[column.field] || row[column.field] == "0") { |
| | | if (data.indexOf(row[column.field]) == -1) { |
| | | data.push(row[column.field]); |
| | |
| | | // ha= Object.assign([], ha, hb) |
| | | this.http |
| | | .post("/api/Sys_Dictionary/GetTableDictionary", remoteInfo) |
| | | .then((dic) => { |
| | | dic.forEach((x) => { |
| | | this.remoteColumns.forEach((column) => { |
| | | .then(dic => { |
| | | dic.forEach(x => { |
| | | this.remoteColumns.forEach(column => { |
| | | if (column.bind.key == x.key) { |
| | | column.bind.data = Object.assign([], column.bind.data, x.data); |
| | | // column.bind.data.push(...x.data); |
| | |
| | | rows: this.paginations.rows, |
| | | sort: this.paginations.sort, |
| | | order: this.paginations.order, |
| | | wheres: [], // æ¥è¯¢æ¡ä»¶ï¼æ ¼å¼ä¸º[{ name: "åæ®µ", value: "xx" }] |
| | | wheres: [] // æ¥è¯¢æ¡ä»¶ï¼æ ¼å¼ä¸º[{ name: "åæ®µ", value: "xx" }] |
| | | }; |
| | | let status = true; |
| | | // åå¹¶æ¥è¯¢ä¿¡æ¯(å
æ¥è¯¢å页ãæåºãæ¥è¯¢æ¡ä»¶ç) |
| | |
| | | callBack(true); |
| | | }) |
| | | */ |
| | | this.$emit("loadBefore", param, (result) => { |
| | | this.$emit("loadBefore", param, result => { |
| | | status = result; |
| | | }); |
| | | if (!status) return; |
| | |
| | | } |
| | | this.loading = true; |
| | | this.http.post(this.url, param).then( |
| | | (data) => { |
| | | data => { |
| | | //2021.06.04ä¿®å¤treeä¸å·æ°çé®é¢ |
| | | if (this.rowKey) { |
| | | this.randomTableKey++; |
| | |
| | | this.$emit( |
| | | "loadAfter", |
| | | data.rows || [], |
| | | (result) => { |
| | | result => { |
| | | status = result; |
| | | }, |
| | | data |
| | |
| | | // this.$refs.table.doLayout(); |
| | | // }); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | this.loading = false; |
| | | // this.$Message.error(error || "ç½ç»å¼å¸¸"); |
| | | } |
| | |
| | | this.summaryData.push(""); |
| | | } |
| | | |
| | | this.columns.forEach((col) => { |
| | | this.columns.forEach(col => { |
| | | if (col.children && col.children.length) { |
| | | col.children.forEach((item) => { |
| | | col.children.forEach(item => { |
| | | this.getColumnSummaries(item, data); |
| | | }); |
| | | } else { |
| | |
| | | |
| | | if ( |
| | | column.edit && |
| | | (column.edit.type == "selectList" || column.edit.type == "treeSelect") |
| | | (column.edit.type == "selectList" || |
| | | column.edit.type == "selectlist" || |
| | | column.edit.type == "treeSelect") |
| | | ) { |
| | | if (!Array.isArray(val)) { |
| | | row[column.field] = val.split(","); |
| | |
| | | // ç¼è¾å¤étableæ¾ç¤º |
| | | if ( |
| | | column.bind.type == "selectList" || |
| | | column.bind.type == "selectlist" || |
| | | column.bind.type == "checkbox" || |
| | | column.bind.type == "treeSelect" |
| | | ) { |
| | |
| | | return this.getSelectFormatter(column, val + ""); |
| | | // } |
| | | } |
| | | let source = column.bind.data.filter((x) => { |
| | | let source = column.bind.data.filter(x => { |
| | | // return x.key != "" && x.key == val; |
| | | // 2020.06.06ä¿®å¤åç¬ä½¿ç¨tableç»ä»¶æ¶,key为æ°å0æ¶è½¬æ¢æææ¬å¤±è´¥çé®é¢ |
| | | return x.key !== "" && x.key !== undefined && x.key + "" === val + ""; |
| | |
| | | (column.bind.orginData && column.bind.orginData.length |
| | | ? column.bind.orginData |
| | | : column.bind.data |
| | | ).forEach((x) => { |
| | | ).forEach(x => { |
| | | // 2020.06.06ä¿®å¤æ°æ®æºä¸ºselectListæ¶,key为æ°å0æ¶ä¸è½è½¬æ¢ææ¬çé®é¢ |
| | | if ( |
| | | x.key !== "" && |
| | |
| | | if (!children) { |
| | | return []; |
| | | } |
| | | return children.filter((x) => { |
| | | return children.filter(x => { |
| | | return !x.hidden; |
| | | }); |
| | | }, |
| | |
| | | showUpload(row, column) { |
| | | this.fileInfo = (row[column.field] || "") |
| | | .split(",") |
| | | .filter((x) => { |
| | | .filter(x => { |
| | | return x; |
| | | }) |
| | | .map((item) => { |
| | | .map(item => { |
| | | return { path: item, name: "" }; |
| | | }); |
| | | this.currentRow = row; |
| | |
| | | }, |
| | | saveUpload() { |
| | | //çæä¿ååè¿åçè·¯å¾ |
| | | let arr = this.fileInfo.map((x) => { |
| | | let arr = this.fileInfo.map(x => { |
| | | if (x.path) { |
| | | return x.path; |
| | | } |
| | |
| | | this.currentRow[this.currentColumn.field] = arr.join(","); |
| | | this.uploadModel = false; |
| | | return true; |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="less" scoped> |