添加项目时候返回列表默认上次选择创建人

查看返回不需要弹窗提示
dev_2022-03-03
e 3 years ago
parent ae33bde9c1
commit ce1667716d
  1. 20
      src/views/data/Introduce.vue
  2. 7
      src/views/serve/projectAdd.vue
  3. 51
      src/views/serve/projectList.vue

@ -24,11 +24,15 @@
<p class="label">数据源</p>
<el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input>
</div>
</template>
<div class="field">
<p class="label">关键字</p>
<div class="tag-add" v-if="editing">
<el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input>
<span v-if="editing">
<el-button @click="save" style="color: #9076FF;border: 1px solid #9076FF;border-radius:5px;height: 25px;line-height: 0px"> </el-button>
</span>
</div>
<div class="tag-wrap">
<el-tag
@ -160,6 +164,22 @@ export default {
this.getKeyword()
}).catch(res => {})
},
save(){
const keyword = this.newKeyword
if (keyword) {
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!')
// this.confirmEdit()
this.$post(this.api.addKeyword,{
categoryId: this.categoryId,
keyword
}).then(res => {
this.newKeyword = ''
this.getKeyword()
}).catch(res => {})
} else {
this.confirmEdit()
}
},
addKeyword() {
const keyword = this.newKeyword
if (keyword) {

@ -229,9 +229,10 @@ export default {
data() {
return {
projectId: this.$route.query.projectId,
founder: this.$route.query.founder,
token: btoa(sessionStorage.getItem("token")),
isDetail: Boolean(this.$route.query.show),
isDetail: this.$route.query.show,
isDetails:this.$route.query.isDetails,
projectManage: {
founder: 0, // (0 1)
projectName: "", //
@ -331,7 +332,7 @@ export default {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
}).then(() => {
this.$router.back();
this.$router.push(`/projectList?systemId=${this.$route.query.systemId}&show=${this.isDetails}&founder=${this.founder}`);
}).catch(() => {
});
}

@ -17,7 +17,7 @@
</div>
<div>
<el-form label-width="80px">
<el-col :span="6">
<el-col :span="4">
<el-form-item label="创建人">
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人"
@change="initData">
@ -26,7 +26,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="4">
<el-form-item label="状态">
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in stateList" :key="index" :label="item.label"
@ -34,7 +34,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="4">
<el-form-item label="权限">
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData">
<el-option
@ -48,7 +48,8 @@
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search"
v-model="keyword" clearable></el-input>
</el-form-item>
</el-col>
</el-form>
@ -137,7 +138,7 @@
<script>
import { mapState, mapActions } from 'vuex';
import Setting from "@/setting";
export default {
data() {
return {
@ -153,20 +154,16 @@ export default {
status: '',
listData: [],
total: 0,
permissionsList: [
{
permissionsList: [{
value: '',
label: '不限'
},
{
}, {
value: 0,
label: '练习'
},
{
}, {
value: 1,
label: '考核'
},
{
}, {
value: 2,
label: '竞赛'
}
@ -176,12 +173,13 @@ export default {
1: '考核',
2: '竞赛'
},
founderList: [
{
founderList: [{
value: 2,
label: '全部'
}, {
value: 0,
label: '系统'
},
{
}, {
value: 1,
label: '老师'
}
@ -190,16 +188,13 @@ export default {
0: '系统',
1: '老师'
},
stateList: [
{
stateList: [{
value: '',
label: '不限'
},
{
}, {
value: 0,
label: '草稿箱'
},
{
}, {
value: 1,
label: '已发布'
}
@ -226,6 +221,12 @@ export default {
}
},
mounted() {
console.log(this.$route.query.founder)
if (this.$route.query.founder && this.$route.query.founder != 'undefined'){
this.queryData.founder = +this.$route.query.founder
}else{
this.queryData.founder = 2
}
this.getData();
},
methods: {
@ -253,10 +254,10 @@ export default {
this.getData();
},
add() { //
this.$router.push(`/projectAdd?systemId=${this.systemId}`);
this.$router.push(`/projectAdd?systemId=${this.systemId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}`);
},
edit(row) { //
this.$router.push(`/projectAdd?systemId=${this.systemId}&projectId=${row.projectId}`);
this.$router.push(`/projectAdd?systemId=${this.systemId}&projectId=${row.projectId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}`);
},
handleSelectionChange(val) { //
this.multipleSelection = val;

Loading…
Cancel
Save