|
@@ -13,7 +13,7 @@
|
|
|
class="task-item"
|
|
|
v-for="item in list"
|
|
|
:key="item"
|
|
|
- @click="routeGoto('workbenchDetail', { id: item.infoNo })"
|
|
|
+ @click="wantTo(item.infoNo)"
|
|
|
:style="
|
|
|
item.is_feed == 1 ? 'background: skyblue;' : 'background:none;'
|
|
|
"
|
|
@@ -186,7 +186,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.searchList();
|
|
|
+ this.searchList(true);
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
if (this.timer) {
|
|
@@ -194,6 +194,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ wantTo(infoNo) {
|
|
|
+ console.log(this.powers);
|
|
|
+ if (
|
|
|
+ this.powers &&
|
|
|
+ this.powers.length > 0 &&
|
|
|
+ this.powers.some((item) => item == "007")
|
|
|
+ ) {
|
|
|
+ this.routeGoto("workbenchDetail", { id: infoNo });
|
|
|
+ }
|
|
|
+ },
|
|
|
async well_timer() {
|
|
|
this.timer = setInterval(async () => {
|
|
|
if (this.num !== 0) {
|
|
@@ -277,65 +287,41 @@ export default {
|
|
|
console.log("取消");
|
|
|
});
|
|
|
},
|
|
|
- async deleteItem(id) {
|
|
|
- await this.$confirm("确定要删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(async () => {
|
|
|
- const model = {
|
|
|
- id: id,
|
|
|
- };
|
|
|
- const res = await asyncRequest.delete(model);
|
|
|
- if (res && res.code === 0) {
|
|
|
- this.$notify.success({
|
|
|
- title: "删除成功",
|
|
|
- message: "",
|
|
|
- });
|
|
|
- this.searchList();
|
|
|
- } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- console.log("取消");
|
|
|
- });
|
|
|
- },
|
|
|
+
|
|
|
imgclick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
// 刷新表格
|
|
|
- async searchList() {
|
|
|
- this.loading = true;
|
|
|
- const { code, data } = await asyncRequest.list(this.parmValue);
|
|
|
- if (code === 0) {
|
|
|
- const { list, count } = data;
|
|
|
- this.list = list;
|
|
|
- this.list.map((e) => {
|
|
|
- e.cat_name = "";
|
|
|
- if (e.can && e.can.length > 0) {
|
|
|
- e.can.forEach((a, ai) => {
|
|
|
- e.cat_name += `${ai !== 0 ? "_" : ""}${a.name}`;
|
|
|
- });
|
|
|
+ async searchList(type) {
|
|
|
+ if (!this.loading) {
|
|
|
+ this.loading = true;
|
|
|
+ const { code, data } = await asyncRequest.list(this.parmValue);
|
|
|
+ if (code === 0) {
|
|
|
+ const { list, count } = data;
|
|
|
+ this.list = list;
|
|
|
+ this.list.map((e) => {
|
|
|
+ e.cat_name = "";
|
|
|
+ if (e.can && e.can.length > 0) {
|
|
|
+ e.can.forEach((a, ai) => {
|
|
|
+ e.cat_name += `${ai !== 0 ? "_" : ""}${a.name}`;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return e;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.pageInfo.total = Number(count);
|
|
|
+ if (type) {
|
|
|
+ await this.well_timer();
|
|
|
}
|
|
|
- return e;
|
|
|
- });
|
|
|
- if (this.list.length > 0) {
|
|
|
- console.log(this.list[0]);
|
|
|
+ } else if (code >= 100 && code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.list = [];
|
|
|
+ this.pageInfo.total = 0;
|
|
|
}
|
|
|
- this.pageInfo.total = Number(count);
|
|
|
- await this.well_timer();
|
|
|
- } else if (code >= 100 && code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.list = [];
|
|
|
- this.pageInfo.total = 0;
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
- this.loading = false;
|
|
|
},
|
|
|
},
|
|
|
};
|