Commit 85f331e3 authored by 赵啸非's avatar 赵啸非

修改js文件

parent 0dbaf26b
...@@ -158,7 +158,6 @@ export default { ...@@ -158,7 +158,6 @@ export default {
formatterYES(row, column, val) { formatterYES(row, column, val) {
const content = formatter(this.tableData, column, val); const content = formatter(this.tableData, column, val);
console.log("content",content)
if (content) { if (content) {
if (val == '0') { if (val == '0') {
return <el-tag type={'danger'} size='mini'>{content}</el-tag> return <el-tag type={'danger'} size='mini'>{content}</el-tag>
...@@ -197,7 +196,7 @@ export default { ...@@ -197,7 +196,7 @@ export default {
formatters(row, column, val) { formatters(row, column, val) {
if (val) { if (val) {
return ( return (
val.split(',').map(v => { return formatter(this.tableData, column, v) }).join(",") val.split(',').map(v => formatter(this.tableData, column, v) ).join(",")
) )
} }
return '--' return '--'
......
...@@ -9,8 +9,11 @@ ...@@ -9,8 +9,11 @@
*/ */
const formatter = (tableData, column, val) => { const formatter = (tableData, column, val) => {
const key = column.property; const key = column.property;
console.log(val);
val = val ? val : "--"; if(val===null||val===undefined){
val="--"
}
if (tableData.dict && tableData.dict[key]) { if (tableData.dict && tableData.dict[key]) {
const dict = tableData.dict[key]; const dict = tableData.dict[key];
return dict[val] || val; return dict[val] || val;
......
...@@ -55,12 +55,6 @@ ...@@ -55,12 +55,6 @@
}, },
data() { data() {
return { return {
/** 子表列元素 */
columnSet:[
{label: "产品名称", prop: "productName"},
{label: "问题", prop: "question"},
{label: "常见问题回答", prop: "answer"},
],
config: { config: {
search: [ search: [
], ],
...@@ -70,15 +64,15 @@ ...@@ -70,15 +64,15 @@
{label: "产品名称", prop: "productName"}, {label: "产品名称", prop: "productName"},
{label: "产品分类", prop: "categoryIds",formatter: this.formatters}, {label: "产品分类", prop: "categoryId",formatter: this.formatters},
{label: "所属企业", prop: "companyIds",formatter: this.formatters}, {label: "所属企业", prop: "companyId",formatter: this.formatters},
{label: "产品介绍", prop: "productIntroduction" , width: 120}, {label: "产品介绍", prop: "productIntroduction" , width: 500},
{label: "发布时间", prop: "publishTime", formatter: this.formatterDate}, {label: "发布时间", prop: "publishTime", formatter: this.formatterDate},
{label: "热门", prop: "hot",formatter: this.formatterYES}, {label: "热门", prop: "hot",formatter: this.formatterYES, width: 50},
{label: "最近更新时间", prop: "updateTime", formatter: this.formatterDate}, {label: "最近更新时间", prop: "updateTime", formatter: this.formatterDate},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment