Commit 5b4e478e by 周海峰

no message

parent 972e1990
......@@ -55,87 +55,22 @@
</q-table>
</q-card-main>
</q-card>
<q-modal v-model="editModal" maximized>
<q-modal-layout>
<q-toolbar slot="header">
<q-btn flat round dense @click="editModal = false" icon="reply" />
<q-toolbar-title>
{{$t('Edit')}}
</q-toolbar-title>
</q-toolbar>
<q-toolbar slot="footer">
<q-toolbar-title>
</q-toolbar-title>
<q-btn round color="red" @click="saveapp" >{{$t('Save')}}</q-btn>
<q-btn round @click="editModal = false">{{$t('Cancel')}}</q-btn>
</q-toolbar>
<div class="layout-padding">
<q-field :count="255">
<q-input v-model="temp.title" float-label="名称" />
</q-field>
<q-field>
<div class="row no-wrap">
<q-select class="col" v-model="temp.groupCode" float-label="应用分组" radio :options="applicationsGroupOptions"/>
<q-btn color="negative" flat round dense icon="add" @click="openAddApplicationsGroup" />
</div>
</q-field>
<q-field :count="255">
<q-input v-model="temp.href" float-label="电脑入口" />
</q-field>
<q-field :count="255">
<q-input v-model="temp.wechatUrl" float-label="企微入口" />
</q-field>
<q-field :count="64">
<q-input v-model="temp.appid" float-label="应用唯一标识" @blur="getsecret()" :disable=appidflag />
</q-field>
<q-field :count="200">
<q-input v-model="temp.secret" float-label="用户的密钥信息" disable />
</q-field>
<q-field :count="32">
<q-input v-model="temp.databasename" float-label="数据库名称" />
</q-field>
<q-field :count="32">
<q-input v-model="temp.databasepassword" float-label="数据库密码" />
</q-field>
<q-field :count="200">
<q-input v-model="temp.databasecon" float-label="数据库连接" />
</q-field>
<q-field :count="200">
<q-select v-model="temp.openmail" float-label="启用待办(启用后会在待办中显示待办信息)" radio :options="openmailOptions"/>
</q-field>
<q-field :count="200">
<q-input v-model="temp.mailtype" float-label="待办标识(待办唯一标识,需要给到对方系统)" />
</q-field>
<q-field>
<q-input v-model="temp.img" float-label="图标路径" disable v-if="subtype=='edit'"/>
<q-uploader
float-label="上传图标"
ref="attachmentUploader"
name="file"
@uploaded="attachmentUploaded"
:headers="{'Accept': 'application/json;charset=utf-8'}"
:url="uploadurl"
auto-expand
clearable
hide-upload-button
@add="$refs['attachmentUploader'].upload()"
></q-uploader>
</q-field>
<!-- <q-field :count="200">
<q-input v-model="temp.description" type="textarea" :max-height="100" rows="7" :float-label="$t('Role description')" />
</q-field> -->
<q-select v-model="temp.qyflag" float-label="启用/停用" radio :options="selectOptions"/>
</div>
</q-modal-layout>
</q-modal>
<!-- 编辑组件 -->
<edit-application
v-model="editModal"
:temp="temp"
:subtype="subtype"
:uploadurl="uploadurl"
:select-options="selectOptions"
:openmail-options="openmailOptions"
:appidflag="appidflag"
@saved="handleChildSaved"
/>
</div>
</template>
<script>
import { getPlatformApplicationsPagedList,saveapp,delapp } from "@/service/permission/platformapplications";
import { getApplicationsGroupList,addApplicationsGroup } from "@/service/permission/platformapplicationsGroup";
const uploadpath="http://nw.sy-metro.com:6104/uploadfileadmin/manager";
import { getPlatformApplicationsPagedList,delapp } from "@/service/permission/platformapplications";
export default {
data() {
return {
......@@ -230,8 +165,7 @@
},
appidflag:true,
subtype: "add",
fileCount: 0,
applicationsGroupOptions: [] // 应用分组下拉选项
fileCount: 0
}
},
mounted() {
......@@ -239,9 +173,9 @@
pagination: this.serverPagination,
filter: this.filter
});
// 获取应用分组选项
this.getApplicationsGroupOptions();
},
components: {
EditApplication: () => import('./EditApplication.vue')
},
methods: {
async request(props) {
......@@ -276,13 +210,8 @@
this.editModal = true;
this.appidflag = false;
},
async saveapp() {
await saveapp(this.temp);
this.$q.notify({
type: "positive",
message: this.$t("Saved successfully"),
position: "bottom-right"
});
// 保存由子组件处理,这里只负责刷新列表
handleChildSaved() {
this.editModal = false;
this.search();
},
......@@ -300,6 +229,7 @@
this.editModal = true;
this.appidflag = true;
},
editappVisible(id){
this.$router.push('/system/sysadv');
},
......@@ -327,77 +257,8 @@
});
this.search();
} catch (e) {}
},
getsecret(){
this.temp.secret = window.btoa(this.temp.appid);
},
attachmentUploaded(file, xhr) {
let res = JSON.parse(xhr.response).path;
this.fileCount++;
if (res != "") {
this.$q.notify({
message: "上传成功",
type: "positive",
icon: "done",
timeout: 1000,
position: "top-right"
});
this.temp.img = res;
console.log(res);
if (this.fileCount > 1) {
var cNode = document.getElementsByClassName("q-uploader-files")[0];
cNode.removeChild(cNode.childNodes[0]);
}
} else {
this.$q.notify({
message: res.msg,
type: "negative",
icon: "error_outline",
timeout: 3000,
position: "top-right"
});
}
},
// 获取应用分组选项
async getApplicationsGroupOptions() {
try {
const response = await getApplicationsGroupList({});
this.applicationsGroupOptions = response.data.data.map(group => ({
label: group.groupName,
value: group.groupCode
}));
} catch (error) {
console.error("Failed to fetch applications group options:", error);
}
},
// 点击添加应用分组按钮
async openAddApplicationsGroup() {
try {
const name = await this.$q.dialog({
title: '添加应用分组',
prompt: {
model: '',
type: 'text',
isValid: val => val && val.trim().length > 0
},
ok: { label: '添加', push: true },
cancel: { label: '取消', push: true }
});
console.log(name);
// `name` contains the input string in this Quasar version
if (name) {
const groupName = name; // be defensive across versions
await addApplicationsGroup({ groupName: groupName });
this.$q.notify({ type: 'positive', message: '添加成功', position: 'bottom-right' });
// refresh options
await this.getApplicationsGroupOptions();
}
} catch (e) {
// user cancelled or error
}
},
},
}
</script>
......
......@@ -137,7 +137,7 @@
loadRecipes,
updateRecipessStatus,
saveexceldata
} from "@/service/recipes/recipes";
} from "@/service/recipes/recipes.js";
import tool from "@/service/other/tool";
import { getSysCodelistByKindcode } from "@/service/syscodelist/syscodelist";
export default {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论