From eafd90c248a7e0560f98c957eaf05cb6e71e2f3b Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期四, 09 二月 2023 10:40:47 +0800
Subject: [PATCH] 2022/2/9 肖辉 部门管理处理
---
src/views/operate/images/index.vue | 159 ++++++++++++++++++++++++++++++-----------------------
1 files changed, 90 insertions(+), 69 deletions(-)
diff --git a/src/views/operate/images/index.vue b/src/views/operate/images/index.vue
index 56712ad..728865e 100644
--- a/src/views/operate/images/index.vue
+++ b/src/views/operate/images/index.vue
@@ -20,21 +20,19 @@
>鏌ヨ</el-button
>
</div>
- <!-- <div class="findBtn">
- <el-button
- type="primary"
- @click="handleUpdateImageResource(null, 'create')"
- >娣诲姞鍥剧墖</el-button
- >
- </div> -->
</div>
+ <div class="addBtn">
+ <el-button type="primary" @click="handleUpdateImageResource(null,'create')"
+ >鏂板</el-button
+ >
+ </div>
</div>
</header>
<main>
<div class="mainContent">
<div class="type-nav">
<div
- @click="changeTypeChecked(index)"
+ @click="changeTypeChecked(item)"
v-for="(item, index) in typeList"
:key="item.name"
:class="[item.checked ? 'is-active' : '', 'type-item']"
@@ -44,11 +42,11 @@
</div>
<!-- 鏁版嵁灞曠ず -->
<el-table
+ border
+ stripe
ref="multipleTable"
:header-cell-style="{
- background: '#06122c',
- 'font-size': '12px',
- color: '#4b9bb7',
+ 'background':'#F5F5F5',
'font-weight': '650',
'line-height': '45px',
}"
@@ -57,7 +55,7 @@
:row-class-name="tableRowClassName"
@selection-change="tableChange"
>
- <el-table-column type="selection" min-width="5"> </el-table-column>
+ <el-table-column type="selection" min-width="5" :selectable="selectable"> </el-table-column>
<el-table-column prop="code" label="鎵�灞炰簨浠剁紪鍙�" min-width="18">
</el-table-column>
<el-table-column prop="category" label="闂绫诲埆" min-width="8">
@@ -72,8 +70,6 @@
</el-table-column>
<el-table-column prop="regionName" label="绀惧尯鍚嶇О" min-width="8">
</el-table-column>
- <!-- <el-table-column prop="id" label="鍥剧墖Id" min-width="8">
- </el-table-column> -->
<el-table-column
prop="createTime"
label="涓婁紶鏃堕棿"
@@ -87,12 +83,12 @@
<span @click="handleUpdateImageResource(scope.row, 'view')"
>鏌ョ湅</span
>
- <span class="line">|</span>
- <span @click="handleUpdateImageResource(scope.row, 'update')"
+ <span v-if="mystatus === 3" class="line">|</span>
+ <span v-if="mystatus === 3" @click="handleUdeletepdateImageResource(scope.row, 'update')"
>淇敼</span
>
- <span class="line">|</span>
- <span @click="handleDelete(scope.row)">鍒犻櫎</span>
+ <span v-if="mystatus === 3" class="line">|</span>
+ <span v-if="mystatus === 3" @click="handleDelete(scope.row)">鍒犻櫎</span>
</div>
</template>
</el-table-column>
@@ -113,7 +109,7 @@
</el-dialog>
<div class="tools">
<div class="funs">
- <div class="funsItem funs-sp">
+ <div class="funsItem funs-sp funs-first">
<el-checkbox v-model="all" @change="selectAll()"
>鍏ㄩ��</el-checkbox
>
@@ -127,8 +123,6 @@
<el-select
v-model="myIdx"
placeholder="鎵归噺鎿嶄綔"
- @change="selectChange"
- disabled
>
<el-option
v-for="item in options"
@@ -136,6 +130,7 @@
:label="item.label"
:value="item.value"
:disabled="item.disabled"
+ @click.native="selectChange"
>
</el-option>
</el-select>
@@ -208,14 +203,14 @@
label: "鎵归噺鎿嶄綔",
disabled: true,
},
- {
- value: 1,
- label: "鎵归噺鍚敤",
- },
- {
- value: 2,
- label: "鎵归噺绂佺敤",
- },
+ // {
+ // value: 1,
+ // label: "鎵归噺鍚敤",
+ // },
+ // {
+ // value: 2,
+ // label: "鎵归噺绂佺敤",
+ // },
{
value: 3,
label: "鎵归噺鍒犻櫎",
@@ -225,7 +220,7 @@
typeList: [
{
name: "鎽勫儚澶存帹閫�",
- value: null,
+ value: "01",
checked: true,
},
{
@@ -255,21 +250,35 @@
// 鎵归噺鍒犻櫎
mulDelete(idArr) {
- imageManagement
- .deleteImageResources({ ids: idArr })
- .then(() => {
- this.$message.success("鎿嶄綔鎴愬姛");
- this.getImageResourceList();
- })
- .catch((err) => this.$message.error(`${err}`));
+ this.$confirm("鎮ㄧ‘瀹氳鎵归噺鍒犻櫎鍥剧墖鍚�?")
+ .then((_) => {
+ this.$axios({
+ method: "delete",
+ url: "/sccg/image_resources/deletion_batch?ids=" + idArr,
+ }).then((res) => {
+ if (res.code === 200) {
+ this.$message({
+ type: "success",
+ message: "鎵归噺鍒犻櫎鍥剧墖鎴愬姛",
+ });
+ this.getImageResourceList();
+ } else {
+ this.$message({
+ type: "error",
+ message: res.message,
+ });
+ }
+ });
+ })
+ .catch((err) => {
+ console.log(err);
+ });
},
// 鎵ц涓嬫媺妗嗘搷浣�
selectChange(list) {
if (this.tempList.length !== 0) {
- if (list === 3) {
this.preMyIdx = list;
this.mulDelete(this.tempList);
- }
} else {
this.myIdx = this.preMyIdx;
this.$message({
@@ -282,7 +291,7 @@
tableChange(list) {
this.tempList = [];
list.forEach((item) => {
- this.tempList.push(item.code);
+ this.tempList.push(item.id);
});
this.all = list.length === this.tableData.length;
},
@@ -303,6 +312,7 @@
.deleteImageResource({ id: id })
.then(() => {
this.$message.success("鎿嶄綔鎴愬姛");
+ this.getImageResourceList();
})
.catch((err) => this.$message.error(`${err}`));
});
@@ -328,12 +338,13 @@
.catch((err) => this.$message({ type: "error", message: err }));
},
// 鏇存敼杩濊/杩濆缓
- changeTypeChecked(idx) {
- this.typeList.forEach((item) => {
- item.checked = item.value === idx;
- });
- this.mystatus = idx + 1;
- this.size = idx;
+ changeTypeChecked(data) {
+ this.typeList.forEach(item => {
+ item.checked = data.name === item.name;
+ })
+ const checkedType = this.typeList.find(item => item.checked);
+ this.mystatus = +checkedType.value;
+ this.size = checkedType.value;
this.getImageResourceList();
},
// 璁剧疆琛ㄦ牸鏂戦┈绾�
@@ -367,20 +378,27 @@
getEventSource(value) {
return EVENT_SOURCE.find((item) => item.value === value);
},
+ selectable(row,index){
+ if(this.mystatus == '1'){
+ return false;//绂佺敤鐘舵��
+ }else{
+ return true;//闈炵鐢ㄧ姸鎬�
+ }
+ },
},
};
</script>
<style lang="scss" scoped>
.userList {
text-align: left;
- margin: 10px 20px;
+ padding: 10px 20px;
color: #4b9bb7;
-
+ border: 1px solid #ccc;
header {
- background-color: #09152f;
+ background-color: white;
.headerContent {
- padding: 0 40px;
+ padding: 0;
display: flex;
line-height: 100px;
justify-content: space-between;
@@ -399,8 +417,8 @@
color: #1d3f57;
&::v-deep .el-input__inner {
- background-color: #09152f;
- border: 1px solid #17324c;
+ // background-color: #09152f;
+ //border: 1px solid #17324c;
}
}
}
@@ -414,26 +432,26 @@
.el-button {
padding: 12px 25px;
- border-radius: 20px;
+ //border-radius: 20px;
}
}
.addBtn {
- background-color: #eb5d01;
+ // background-color: #eb5d01;
border: none;
- border-radius: 20px;
+ //border-radius: 20px;
padding: 12px 30px;
}
}
}
&::v-deep .el-input__inner {
- background-color: #09152f;
- border: 1px solid #17324c;
+ // background-color: #09152f;
+ //border: 1px solid #17324c;
}
main {
- background-color: #09152f;
+ // background-color: #09152f;
margin-top: 20px;
padding-bottom: 50px;
@@ -444,7 +462,7 @@
.type-nav {
display: flex;
line-height: 40px;
- margin-left: 30px;
+ //margin-left: 30px;
padding-top: 10px;
margin-bottom: 10px;
@@ -459,9 +477,10 @@
}
.is-active {
- background-color: #070f22;
+ // background-color: #070f22;
border-radius: 4px;
- color: #fff;
+ color: #333;
+ font-size: 500;
}
}
@@ -469,10 +488,12 @@
display: flex;
justify-content: space-between;
align-items: center;
- padding: 0 20px;
-
+ padding: 0;
+ .funs-first{
+ margin-left: 0!important;
+ }
.funs-sp {
- border: 1px solid #17324c;
+ border: 1px solid #DCDFE6;
}
.funs {
@@ -515,7 +536,7 @@
&::v-deep li,
&::v-deep .btn-prev,
&::v-deep .btn-next {
- background-color: #071f39;
+ // background-color: #071f39;
color: #4b9bb7;
}
@@ -528,8 +549,8 @@
}
.el-table {
- color: #4b9bb7;
- font-size: 10px;
+ // color: #4b9bb7;
+ // font-size: 10px;
&::v-deep .cell {
text-overflow: ellipsis;
@@ -556,7 +577,7 @@
}
:deep(.el-range-input) {
- background-color: #09152f;
+ // background-color: #09152f;
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0