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

查看返回不需要弹窗提示
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> <p class="label">数据源</p>
<el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input> <el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input>
</div> </div>
</template> </template>
<div class="field"> <div class="field">
<p class="label">关键字</p> <p class="label">关键字</p>
<div class="tag-add" v-if="editing"> <div class="tag-add" v-if="editing">
<el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input> <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>
<div class="tag-wrap"> <div class="tag-wrap">
<el-tag <el-tag
@ -160,6 +164,22 @@ export default {
this.getKeyword() this.getKeyword()
}).catch(res => {}) }).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() { addKeyword() {
const keyword = this.newKeyword const keyword = this.newKeyword
if (keyword) { if (keyword) {

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

@ -17,7 +17,7 @@
</div> </div>
<div> <div>
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="6"> <el-col :span="4">
<el-form-item label="创建人"> <el-form-item label="创建人">
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人" <el-select v-model="queryData.founder" clearable placeholder="请选择创建人"
@change="initData"> @change="initData">
@ -26,7 +26,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="4">
<el-form-item label="状态"> <el-form-item label="状态">
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData"> <el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in stateList" :key="index" :label="item.label" <el-option v-for="(item,index) in stateList" :key="index" :label="item.label"
@ -34,7 +34,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="4">
<el-form-item label="权限"> <el-form-item label="权限">
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData"> <el-select v-model="queryData.permissions" placeholder="请选择" @change="initData">
<el-option <el-option
@ -48,7 +48,8 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <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-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -137,7 +138,7 @@
<script> <script>
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import Setting from "@/setting";
export default { export default {
data() { data() {
return { return {
@ -153,20 +154,16 @@ export default {
status: '', status: '',
listData: [], listData: [],
total: 0, total: 0,
permissionsList: [ permissionsList: [{
{
value: '', value: '',
label: '不限' label: '不限'
}, }, {
{
value: 0, value: 0,
label: '练习' label: '练习'
}, }, {
{
value: 1, value: 1,
label: '考核' label: '考核'
}, }, {
{
value: 2, value: 2,
label: '竞赛' label: '竞赛'
} }
@ -176,12 +173,13 @@ export default {
1: '考核', 1: '考核',
2: '竞赛' 2: '竞赛'
}, },
founderList: [ founderList: [{
{ value: 2,
label: '全部'
}, {
value: 0, value: 0,
label: '系统' label: '系统'
}, }, {
{
value: 1, value: 1,
label: '老师' label: '老师'
} }
@ -190,16 +188,13 @@ export default {
0: '系统', 0: '系统',
1: '老师' 1: '老师'
}, },
stateList: [ stateList: [{
{
value: '', value: '',
label: '不限' label: '不限'
}, }, {
{
value: 0, value: 0,
label: '草稿箱' label: '草稿箱'
}, }, {
{
value: 1, value: 1,
label: '已发布' label: '已发布'
} }
@ -226,6 +221,12 @@ export default {
} }
}, },
mounted() { 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(); this.getData();
}, },
methods: { methods: {
@ -253,10 +254,10 @@ export default {
this.getData(); this.getData();
}, },
add() { // 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) { // 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) { // handleSelectionChange(val) { //
this.multipleSelection = val; this.multipleSelection = val;

Loading…
Cancel
Save