From 0b1c5e6680c2986b54866b8dded31c4d9c497fdc Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 22 四月 2024 17:26:47 +0800
Subject: [PATCH] 消息通知页面
---
src/components/tool/value-table.vue | 88 +++++++++++++++++++++++++++++++++++++++-----
1 files changed, 78 insertions(+), 10 deletions(-)
diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index 44aa439..e3f3b28 100644
--- a/src/components/tool/value-table.vue
+++ b/src/components/tool/value-table.vue
@@ -131,6 +131,7 @@
<span v-else-if="data.linkEvent&&showLink(a.label, data.linkEvent)" style="color:#409EFF;cursor: pointer;"
@click="handleLinkEvent(scope.row,data.linkEvent[a.label])">{{scope.row[a.label]}}</span>
<img style="width: 40px;height: 40px;margin-top: 10px;" :src="javaApi+'/img/'+scope.row[a.label]" v-else-if="showUpload(a.label)&&scope.row[a.label]" alt="">
+ <span v-else-if="showCascader(a.label)&&scope.row[a.label]">{{handleTree(data.cascaderField[a.label].tree,scope.row[a.label].split(',')[scope.row[a.label].split(',').length-1])}}</span>
<span v-else>{{scope.row[a.label]}}</span>
</template>
</el-table-column>
@@ -177,7 +178,7 @@
v-if="showType(a.label, data.selectField) == null&&!showUpload(a.label)&&!showCascader(a.label)" :disabled="isDisabled(a.label)"></el-input>
<el-select v-model="upData[a.label]" :multiple="data.selectField[a.label].choose" size="small"
v-if="showType(a.label, data.selectField) != null" style="width: 100%;" :disabled="isDisabled(a.label)"
- clearable>
+ clearable filterable>
<el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi" :value="b.value"
:label="b.label">
</el-option>
@@ -198,7 +199,16 @@
<img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar" style="width: 80px;height: 80px;border-radius: 6px;">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
- <el-cascader v-model="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props"></el-cascader>
+ <el-cascader
+ :value="upData[a.label]"
+ :options="data.cascaderField[a.label].tree"
+ v-if="showCascader(a.label)"
+ :show-all-levels="false"
+ clearable
+ :props="data.cascaderField.props"
+ size="small"
+ style="width: 100%;"
+ @change="m=>handleCascader(m,a.label)"></el-cascader>
</el-col>
</div>
</div>
@@ -212,7 +222,7 @@
v-if="showType(a.label, data.selectField) == null&&!showUpload(a.label)&&!showCascader(a.label)" :disabled="isDisabled(a.label)"></el-input>
<el-select v-model="upData[a.label]" :multiple="data.selectField[a.label].choose" size="small"
v-if="showType(a.label, data.selectField) != null" style="width: 100%;" :disabled="isDisabled(a.label)"
- clearable>
+ clearable filterable>
<el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi" :value="b.value"
:label="b.label"></el-option>
</el-select>
@@ -232,7 +242,7 @@
<img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar" style="width: 80px;height: 80px;border-radius: 6px;">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
- <el-cascader v-model="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props"></el-cascader>
+ <el-cascader :value="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props" size="small" style="width: 100%;" @change="m=>handleCascader(m,a.label)"></el-cascader>
</el-col>
</el-row>
</div>
@@ -253,7 +263,7 @@
<el-input v-model="upData[a.label]" size="small" clearable :placeholder="`璇疯緭鍏�${a.value}`"
v-if="showType(a.label, data.selectField) == null&&!showUpload(a.label)&&!showCascader(a.label)"></el-input>
<el-select v-model="upData[a.label]" size="small" v-if="showType(a.label, data.selectField) != null"
- style="width: 100%;" :placeholder="`璇烽�夋嫨${a.value}`" clearable>
+ style="width: 100%;" :placeholder="`璇烽�夋嫨${a.value}`" clearable filterable>
<el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi" :value="b.value"
:label="b.label"></el-option>
</el-select>
@@ -273,7 +283,7 @@
<img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar" style="width: 80px;height: 80px;border-radius: 6px;">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
- <el-cascader v-model="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props"></el-cascader>
+ <el-cascader :options="data.cascaderField[a.label].tree" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props" size="small" style="width: 100%;" :show-all-levels="false" @change="m=>handleCascader(m,a.label)"></el-cascader>
</el-col>
</div>
</div>
@@ -305,7 +315,7 @@
<img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar" style="width: 80px;height: 80px;border-radius: 6px;">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
- <el-cascader v-model="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props"></el-cascader>
+ <el-cascader :options="data.cascaderField[a.label].tree" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props" size="small" style="width: 100%;" :show-all-levels="false" @change="m=>handleCascader(m,a.label)"></el-cascader>
</el-col>
</el-row>
</div>
@@ -481,7 +491,7 @@
this.$refs.eltable.doLayout()
})
}
- }
+ },
},
mounted() {
this.data = this.componentData
@@ -701,13 +711,34 @@
return false;
}
},
+ handleTree(arr,value){
+ let label = ''
+ for (let i = 0; i < arr.length; i++) {
+ if(arr[i].id==value){
+ label = arr[i].name
+ return label
+ }else if(arr[i].children){
+ label = this.handleTree(arr[i].children,value)
+ }
+ }
+ return label
+ },
main(row, val) {
if (val.method == undefined) return
else if (val.method == 'doDiy') {
if (val.id == 'update') {
this.upDia = true,
- this.upData = this.HaveJson(row)
+ this.upData = this.HaveJson(row)
this.upHead = this.HaveJson(this.tableHead)
+ this.upHead.forEach((item,index)=>{
+ if(this.data.cascaderField&&this.data.cascaderField[item.label]){
+ if(this.upData[item.label]){
+ this.upData[item.label] = this.upData[item.label].split(',').map(m=>Number(m));
+ }else{
+ this.upData[item.label] = []
+ }
+ }
+ })
this.upHead = this.upHead.filter(a => a.label != 'createTime' && a.label != 'updateTime')
delete this.upData.orderBy
delete this.upData.createTime
@@ -780,6 +811,15 @@
this.upData[a] = JSON.stringify(this.upData[a])
}
}
+ this.upHead.forEach((item,index)=>{
+ if(this.data.cascaderField&&this.data.cascaderField[item.label]){
+ if(this.upData[item.label]){
+ this.upData[item.label] = this.upData[item.label].join(',');
+ }else{
+ this.upData[item.label] = ''
+ }
+ }
+ })
this.$axios.post(this.upUrl, this.upData, {
headers: {
'Content-Type': 'application/json'
@@ -792,6 +832,7 @@
this.$message.success('淇敼鎴愬姛')
this.upDia = false
this.selectList()
+ this.$refs.eltable.doLayout();
this.upLoad = false
}).catch(e => {
this.$message.error('淇敼澶辫触')
@@ -1019,7 +1060,34 @@
this.selectList()
}
}
- }
+ },
+ handleCascader(e,label){
+ this.upData[label] = e;
+ },
+ // 鎵归噺鍒犻櫎
+ batchDelete(){
+ if(this.multipleSelection&&this.multipleSelection.length>0){
+ this.$confirm('鏄惁鍒犻櫎閫変腑鐨勬暟鎹�?', "璀﹀憡", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ }).then(() => {
+ this.$axios.post(this.delUrl, {
+ ids: JSON.stringify(this.multipleSelection.map(item => item.id))
+ }).then(res => {
+ if (res.code === 201) {
+ return
+ }
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.selectList()
+ }).catch(e => {
+ this.$message.error('鍒犻櫎澶辫触')
+ })
+ }).catch(() => {})
+ }else{
+ this.$message.error('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁')
+ }
+ },
}
}
</script>
--
Gitblit v1.9.3