|
@@ -105,6 +105,31 @@
|
|
|
<el-button :loading="loading" type="primary" @click="submitAdd">确 定</el-button>
|
|
|
</footer>
|
|
|
</el-dialog>
|
|
|
+ <!-- 更新信息 -->
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="sourceInfoFlag"
|
|
|
+ width="500px"
|
|
|
+ append-to-body
|
|
|
+ :show-close="true"
|
|
|
+ title="设置资源"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <el-form ref="form" label-width="80px" :model="sourceInfo">
|
|
|
+ <el-form-item prop="name" label="名称">
|
|
|
+ <el-input v-model="sourceInfo.name" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="label" label="标签">
|
|
|
+ <el-input v-model="sourceInfo.label" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="intro" label="简介">
|
|
|
+ <el-input v-model="sourceInfo.intro" type="textarea" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="sourceInfoFlag = false">取 消</el-button>
|
|
|
+ <el-button :loading="loading" type="primary" @click="submitSourceInfo">确 定</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -116,6 +141,7 @@ import {
|
|
|
MangerAddResource,
|
|
|
MangerDeleteResource,
|
|
|
MangerUpdateResourceFile,
|
|
|
+ MangerUpdateResourceInfo,
|
|
|
} from '@/api/book';
|
|
|
import { GetProjectBaseInfo } from '@/api/project';
|
|
|
import PaginationPage from '@/components/PaginationPage.vue';
|
|
@@ -193,6 +219,12 @@ export default {
|
|
|
limit: 10,
|
|
|
uploadTip: '',
|
|
|
boxLoading: false,
|
|
|
+ sourceInfoFlag: false, // 设置信息
|
|
|
+ sourceInfo: {
|
|
|
+ name: '',
|
|
|
+ label: '',
|
|
|
+ intro: '',
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -294,6 +326,7 @@ export default {
|
|
|
// 设置信息
|
|
|
handleSetInfo() {
|
|
|
if (this.select_sources_id) {
|
|
|
+ this.sourceInfoFlag = true;
|
|
|
} else {
|
|
|
this.$message.warning('请先选择文件');
|
|
|
}
|
|
@@ -383,6 +416,7 @@ export default {
|
|
|
this.loading = false;
|
|
|
this.sourceAddFlag = false;
|
|
|
if (res.status === 1) {
|
|
|
+ this.$message.success('更换成功');
|
|
|
this.queryList('');
|
|
|
}
|
|
|
})
|
|
@@ -413,8 +447,32 @@ export default {
|
|
|
// 点击资源
|
|
|
selectSourceNode(item) {
|
|
|
this.select_sources_id = item.id;
|
|
|
+ this.sourceInfo = {
|
|
|
+ name: item.name,
|
|
|
+ label: item.label,
|
|
|
+ intro: item.intro,
|
|
|
+ };
|
|
|
},
|
|
|
getCurTime() {},
|
|
|
+ // 更新信息确定按钮
|
|
|
+ submitSourceInfo() {
|
|
|
+ this.loading = true;
|
|
|
+ MangerUpdateResourceInfo({
|
|
|
+ id: this.select_sources_id,
|
|
|
+ resource_info: this.sourceInfo,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.sourceInfoFlag = false;
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.$message.success('设置成功');
|
|
|
+ this.queryList('');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|