| | |
| | | > |
| | | <div style="display: flex; align-items: center" @click.stop> |
| | | <i |
| | | style=" |
| | | padding: 3px; |
| | | margin-right: 10px; |
| | | color: #8f9293; |
| | | cursor: pointer; |
| | | " |
| | | style="padding: 3px; margin-right: 10px; color: #8f9293; cursor: pointer" |
| | | @click="showUpload(scope.row, column)" |
| | | class="el-icon-upload" |
| | | ></i> |
| | | <img |
| | | v-show="column.edit.type == 'img'" |
| | | v-for="(file, imgIndex) in getFilePath( |
| | | scope.row[column.field], |
| | | column |
| | | )" |
| | | v-for="(file, imgIndex) in getFilePath(scope.row[column.field], column)" |
| | | :key="imgIndex" |
| | | :onerror="defaultImg" |
| | | @click="viewImg(scope.row, column, file.path, $event)" |
| | |
| | | style="margin-right: 8px" |
| | | v-show="column.edit.type != 'img'" |
| | | class="t-file" |
| | | v-for="(file, fIndex) in getFilePath( |
| | | scope.row[column.field], |
| | | column |
| | | )" |
| | | v-for="(file, fIndex) in getFilePath(scope.row[column.field], column)" |
| | | :key="fIndex" |
| | | @click="dowloadFile(file)" |
| | | >{{ file.name }}</a |
| | |
| | | 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" |
| | |
| | | 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" |
| | |
| | | > |
| | | </el-switch> |
| | | <template |
| | | v-else-if=" |
| | | ['select', 'selectList'].indexOf(column.edit.type) != -1 |
| | | " |
| | | v-else-if="['select', 'selectList'].indexOf(column.edit.type) != -1" |
| | | > |
| | | <el-select-v2 |
| | | style="width: 100%" |
| | |
| | | :placeholder="column.placeholder || column.title" |
| | | :autocomplete="column.autocomplete" |
| | | :options="column.bind.data" |
| | | @change=" |
| | | column.onChange && column.onChange(scope.row, column) |
| | | " |
| | | @change="column.onChange && column.onChange(scope.row, column)" |
| | | clearable |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | > |
| | |
| | | v-else |
| | | v-model="scope.row[column.field]" |
| | | :filterable=" |
| | | column.filter || column.bind.data.length > 10 |
| | | ? true |
| | | : false |
| | | column.filter || column.bind.data.length > 10 ? true : false |
| | | " |
| | | :multiple="column.edit.type == 'select'" |
| | | :placeholder="column.placeholder || column.title" |
| | | :autocomplete="column.autocomplete" |
| | | @change=" |
| | | column.onChange && column.onChange(scope.row, column) |
| | | " |
| | | @change="column.onChange && column.onChange(scope.row, column)" |
| | | clearable |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | > |
| | |
| | | :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" |
| | |
| | | ></a> |
| | | <img |
| | | v-else-if="column.type == 'img'" |
| | | v-for="(file, imgIndex) in getFilePath( |
| | | scope.row[column.field], |
| | | column |
| | | )" |
| | | v-for="(file, imgIndex) in getFilePath(scope.row[column.field], column)" |
| | | :key="imgIndex" |
| | | :onerror="defaultImg" |
| | | @click="viewImg(scope.row, column, file.path, $event)" |
| | |
| | | style="margin-right: 8px" |
| | | v-else-if="column.type == 'file' || column.type == 'excel'" |
| | | class="t-file" |
| | | v-for="(file, fIndex) in getFilePath( |
| | | scope.row[column.field], |
| | | column |
| | | )" |
| | | v-for="(file, fIndex) in getFilePath(scope.row[column.field], column)" |
| | | :key="fIndex" |
| | | @click="dowloadFile(file)" |
| | | >{{ file.name }}</a |
| | |
| | | :effect="column.effect" |
| | | >{{ formatter(scope.row, column, true) }}</el-tag |
| | | > |
| | | <template v-else>{{ |
| | | formatter(scope.row, column, true) |
| | | }}</template> |
| | | <template v-else>{{ formatter(scope.row, column, true) }}</template> |
| | | </div> |
| | | |
| | | <span v-else>{{ formatter(scope.row, column, true) }}</span> |
| | |
| | | :max-file="currentColumn.edit.maxFile" |
| | | :img="currentColumn.edit.type == 'img'" |
| | | :excel="currentColumn.edit.type == 'excel'" |
| | | :fileTypes=" |
| | | currentColumn.edit.fileTypes ? currentColumn.edit.fileTypes : [] |
| | | " |
| | | :fileTypes="currentColumn.edit.fileTypes ? currentColumn.edit.fileTypes : []" |
| | | :fileInfo="fileInfo" |
| | | :upload-after="uploadAfter" |
| | | > |
| | |
| | | <el-button type="default" size="small" @click="uploadModel = false" |
| | | >å
³é</el-button |
| | | > |
| | | <el-button type="primary" size="small" @click="saveUpload" |
| | | >ä¿å</el-button |
| | | > |
| | | <el-button type="primary" size="small" @click="saveUpload">ä¿å</el-button> |
| | | </div> |
| | | </template> |
| | | </VolBox> |
| | |
| | | }, |
| | | components: { |
| | | "table-render": VolTableRender, |
| | | VolUpload: defineAsyncComponent(() => |
| | | import("@/components/basic/VolUpload.vue") |
| | | ), |
| | | VolUpload: defineAsyncComponent(() => import("@/components/basic/VolUpload.vue")), |
| | | VolBox: defineAsyncComponent(() => import("@/components/basic/VolBox.vue")), |
| | | }, |
| | | props: { |
| | |
| | | default: 500, |
| | | }, |
| | | selectable: { |
| | | |
| | | type: Function, |
| | | default: (row, index) => { |
| | | return true; |
| | |
| | | } |
| | | }); |
| | | if (keys.length > 0) { |
| | | this.http |
| | | .post("/api/Sys_Dictionary/GetVueDictionary", keys) |
| | | .then((dic) => { |
| | | this.http.post("/api/Sys_Dictionary/GetVueDictionary", keys).then((dic) => { |
| | | dic.forEach((x) => { |
| | | if (x.data.length > this.select2Count) { |
| | | x.data.forEach((item) => { |
| | |
| | | } |
| | | columnBind.forEach((c) => { |
| | | // è½¬æ¢æ°æ®æºçç±»åä¸åçç±»åä¸è´(2020.04.04) |
| | | if ( |
| | | c.key == x.dicNo && |
| | | (c.valueTyoe == "int" || c.valueTyoe == "sbyte") |
| | | ) { |
| | | if (c.key == x.dicNo && (c.valueTyoe == "int" || c.valueTyoe == "sbyte")) { |
| | | x.data.forEach((d) => { |
| | | // 2020.09.01å¢å 对æ°åç±»åçäºæ¬¡å¤æ |
| | | if (!isNaN(d.key)) { |
| | |
| | | }, |
| | | extraClick(row, column) { |
| | | column.extra.click && |
| | | column.extra.click( |
| | | row, |
| | | column, |
| | | this.url ? this.rowData : this.tableData |
| | | ); |
| | | column.extra.click(row, column, this.url ? this.rowData : this.tableData); |
| | | }, |
| | | headerClick(column, event) { |
| | | if (this.clickEdit && this.edit.rowIndex != -1) { |
| | |
| | | rowDbClick(row, column, event) { |
| | | //2021.05.23å¢å åå»è¡äºä»¶ |
| | | this.$emit("rowDbClick", { row, column, event }); |
| | | },rowClick(row, column, event) { |
| | | }, |
| | | rowClick(row, column, event) { |
| | | // 2022.02.20å¢å ç¹å»æ¶è¡¨æ ¼åæ°å¤æ |
| | | if (!column) { |
| | | return; |
| | |
| | | // ===== ä¼åï¼é离å¤éæ¡ç¹å»äºä»¶ï¼é¿å
åæ³¡å¹²æ° å¼å§ ===== |
| | | // 夿ç¹å»ç®æ æ¯å¦æ¯å¤éæ¡ï¼æå¤éæ¡æå¨çåå
æ ¼/徿 ï¼ |
| | | const targetEl = event.target; |
| | | const isCheckbox = targetEl.classList.contains('el-checkbox__input') || |
| | | targetEl.closest('.el-checkbox__input') || |
| | | targetEl.closest('.el-table-column--selection'); |
| | | const isCheckbox = |
| | | targetEl.classList.contains("el-checkbox__input") || |
| | | targetEl.closest(".el-checkbox__input") || |
| | | targetEl.closest(".el-table-column--selection"); |
| | | // 妿ç¹å»çæ¯å¤éæ¡åºåï¼ç´æ¥è¿åï¼ä¸æ§è¡è¡éä¸é»è¾ |
| | | if (isCheckbox) { |
| | | return; |
| | |
| | | if (column.base64) { |
| | | fileInfo.push({ |
| | | name: "", |
| | | path: |
| | | (file.indexOf("data") == -1 ? "data:image/png;base64," : "") + |
| | | file, |
| | | path: (file.indexOf("data") == -1 ? "data:image/png;base64," : "") + file, |
| | | }); |
| | | } else if (file.indexOf(".") != -1) { |
| | | let splitFile = file.split("/"); |
| | |
| | | this.edit.rowIndex = -1; |
| | | return; |
| | | } |
| | | let row = (this.url ? this.rowData : this.tableData)[ |
| | | this.edit.rowIndex |
| | | ]; |
| | | let row = (this.url ? this.rowData : this.tableData)[this.edit.rowIndex]; |
| | | for (let index = 0; index < this.columns.length; index++) { |
| | | const _column = this.columns[index]; |
| | | if (_column.edit) { |
| | |
| | | let data = this.url ? this.rowData : this.tableData; |
| | | let indexArr = this.getSelectedIndex(); |
| | | if (indexArr.length == 0) { |
| | | return this.$Message.error( |
| | | "å 餿ä½å¿
须设置VolTableç屿§index='true'" |
| | | ); |
| | | return this.$Message.error("å 餿ä½å¿
须设置VolTableç屿§index='true'"); |
| | | } |
| | | // if (indexArr.length == 0 || !this.key) { |
| | | // return this.$message.error( |
| | |
| | | } |
| | | if (remoteInfo.length == 0) return; |
| | | // ha= Object.assign([], ha, hb) |
| | | this.http |
| | | .post("/api/Sys_Dictionary/GetTableDictionary", remoteInfo) |
| | | .then((dic) => { |
| | | this.http.post("/api/Sys_Dictionary/GetTableDictionary", remoteInfo).then((dic) => { |
| | | dic.forEach((x) => { |
| | | this.remoteColumns.forEach((column) => { |
| | | if (column.bind.key == x.key) { |
| | |
| | | if (data.summary.hasOwnProperty(col.field)) { |
| | | let sum = data.summary[col.field]; |
| | | if (sum) { |
| | | sum = |
| | | (sum * 1.0).toFixed(col.numberLength || 2).replace(".00", "") * |
| | | 1.0; |
| | | sum = (sum * 1.0).toFixed(col.numberLength || 2).replace(".00", "") * 1.0; |
| | | } |
| | | this.summaryData.push(sum); |
| | | } else { |
| | |
| | | : column.bind.data |
| | | ).forEach((x) => { |
| | | // 2020.06.06ä¿®å¤æ°æ®æºä¸ºselectListæ¶,key为æ°å0æ¶ä¸è½è½¬æ¢ææ¬çé®é¢ |
| | | if ( |
| | | x.key !== "" && |
| | | x.key !== undefined && |
| | | x.key + "" == valArr[index] + "" |
| | | ) { |
| | | if (x.key !== "" && x.key !== undefined && x.key + "" == valArr[index] + "") { |
| | | valArr[index] = x.label || x.value; |
| | | } |
| | | }); |
| | |
| | | if (column.summary == "avg") { |
| | | sum = sum / (this.rowData.length || this.tableData.length || 1); |
| | | } |
| | | sum = |
| | | (sum * 1.0).toFixed(column.numberLength || 2).replace(".00", "") * |
| | | 1.0; |
| | | sum = (sum * 1.0).toFixed(column.numberLength || 2).replace(".00", "") * 1.0; |
| | | } |
| | | this.summaryData[this.summaryIndex[column.field]] = sum; |
| | | }, |
| | |
| | | return true; |
| | | } |
| | | return ( |
| | | date1.valueOf() < |
| | | (typeof date2 == "number" ? date2 : new Date(date2).valueOf()) |
| | | date1.valueOf() < (typeof date2 == "number" ? date2 : new Date(date2).valueOf()) |
| | | ); |
| | | }, |
| | | getDateOptions(date, item) { |
| | |
| | | //ä¸è®¾ç½®æ¶åç§ï¼åé¢ä¼èªå¨å ä¸ 08:00 |
| | | item.min = item.min + " 00:00:000"; |
| | | } |
| | | return ( |
| | | this.compareDate(date, item.min) || !this.compareDate(date, item.max) |
| | | ); |
| | | return this.compareDate(date, item.min) || !this.compareDate(date, item.max); |
| | | }, |
| | | getDateFormat(column) { |
| | | //è§https://day.js.org/docs/zh-CN/display/format |
| | |
| | | |
| | | if (this.currentColumn.edit.url === undefined) { |
| | | this.uploadUrl = |
| | | "api/" + |
| | | (this.url || "").replace("/api", "api").split("/")[1] + |
| | | "/upload"; |
| | | "api/" + (this.url || "").replace("/api", "api").split("/")[1] + "/upload"; |
| | | } else { |
| | | this.uploadUrl = this.currentColumn.edit.url; |
| | | } |
| | | this.uploadModel = true; |
| | | }, |
| | | uploadAfter(result, files) { |
| | | this.currentColumn.uploadAfter && |
| | | this.currentColumn.uploadAfter(result, files); |
| | | this.currentColumn.uploadAfter && this.currentColumn.uploadAfter(result, files); |
| | | return true; |
| | | }, |
| | | saveUpload() { |