123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- const text = {
- // 只读模式 or 编辑模式
- readOnly: false,
- //图片类型
- picType: (instance, td, row, col, prop, value, cellProperties) => {
- td.style.color = "#409EFF";
- td.style.cursor = "pointer";
- if (value instanceof Array && value.length > 0) {
- let i = 0
- value.map(item => {
- // if (item.type == "image" || item.type == "video") {
- i++
- // }
- })
- td.innerHTML = "已上传:" + i;
- } else {
- td.innerHTML = text.readOnly?'':'点击上传'
- }
- return td;
- },
- // 文件类型
- fileType: (instance, td, row, col, prop, value, cellProperties) => {
- td.style.color = "#409EFF";
- td.style.cursor = "pointer";
- if (value instanceof Array && value.length > 0) {
- td.innerHTML = "已上传:" + value.length;
- } else {
- td.innerHTML = text.readOnly?'':'点击上传'
- }
- return td;
- },
- //系统类型
- systemList: (instance, td, row, col, prop, value, cellProperties) => {
- td.style.color = "#409EFF";
- td.style.cursor = "pointer";
- if (value instanceof Array && value.length > 0) {
- if (value.length == 1) {
- td.innerHTML = !!value[0].infos ? (value[0].infos.SysLocalName || value[0].infos.SysName) : (value[0].SysLocalName || value[0].SysName)
- } else {
- let text = ""
- for (let i = 0; i < value.length; i++) {
- if (!!value[i].SysLocalName || !!value[i].SysName) {
- if (i == value.length) {
- text += value[i].SysLocalName || value[i].SysName
- } else {
- text = value[i].SysLocalName || value[i].SysName + "、" + text
- }
- } else {
- if (i == value.length) {
- text += value[i].infos.SysLocalName || value[i].infos.SysName
- } else {
- text = value[i].infos.SysLocalName || value[i].infos.SysName + "、" + text
- }
- }
- }
- td.innerHTML = text.substring(0, 40) + "..."
- }
- } else {
- td.innerHTML = "无关联系统"
- }
- return td;
- },
- //四大厂商
- idType: (instance, td, row, col, prop, value, cellProperties) => {
- let html = ''
- let Manufacturer = instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Manufacturer')?instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Manufacturer'):'空',
- Brand = instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Brand')?instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Brand'):'空',
- Specification = instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Specification')?instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Specification'):'空';
- switch (prop){
- case 'DPManufacturerID':
- html = Manufacturer + '/' + Brand + '/' + Specification
- break;
- case 'DPSupplierID':
- html = instance.getDataAtRowProp(row,'LedgerParam.SupplyPurchase.Supplier')
- break;
- case 'DPMaintainerID':
- html = instance.getDataAtRowProp(row,'LedgerParam.OperationMainte.Maintainer')
- break;
- case 'DPInsurerID':
- html = instance.getDataAtRowProp(row,'LedgerParam.InsuranceDoc.Insurer')
- break;
- default:
- break;
- }
- td.style.color = "#409EFF";
- td.style.cursor = "pointer";
- if (!!value) {
- // let data = value.split("-")[1] || "空名"
- td.innerHTML = html
- } else {
- td.innerHTML = "点击选择"
- }
- return td
- },
- //查看二维码
- lookQRCode: (instance, td, row, col, prop, value, cellProperties) => {
- td.style.color = "#409EFF";
- td.style.cursor = "pointer";
- td.innerHTML = "查看二维码"
- return td
- },
- //系统所属建筑楼层
- sysInBuildFloor: (instance, td, row, col, prop, value, cellProperties) => {
- td.style.color = "#409EFF";
- td.style.cursor = "pointer";
- if (value instanceof Array && value.length > 0) {
- let text = ""
- for (let i = 0; i < value.length; i++) {
- if(value[i].BuildID && value[i].FloorID){
- text += `${value[i].BuildLocalName || value[i].BuildName}-${value[i].FloorLocalName || value[i].FloorName }、`
- } else {
- text += `${value[i].BuildLocalName || value[i].BuildName}、`
- }
- }
- text = text.substring(0,text.length-1);
- if(text.length>15){
- text = text.substring(0,15)+ "...";
- }
- td.innerHTML = text;
- } else {
- td.innerHTML = "无所属建筑楼层"
- }
- return td;
- },
- }
- export default text
|