Commit 5b4e478e by 周海峰

no message

parent 972e1990
...@@ -55,87 +55,22 @@ ...@@ -55,87 +55,22 @@
</q-table> </q-table>
</q-card-main> </q-card-main>
</q-card> </q-card>
<q-modal v-model="editModal" maximized> <!-- 编辑组件 -->
<q-modal-layout> <edit-application
<q-toolbar slot="header"> v-model="editModal"
<q-btn flat round dense @click="editModal = false" icon="reply" /> :temp="temp"
<q-toolbar-title> :subtype="subtype"
{{$t('Edit')}} :uploadurl="uploadurl"
</q-toolbar-title> :select-options="selectOptions"
</q-toolbar> :openmail-options="openmailOptions"
<q-toolbar slot="footer"> :appidflag="appidflag"
<q-toolbar-title> @saved="handleChildSaved"
</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>
</div> </div>
</template> </template>
<script> <script>
import { getPlatformApplicationsPagedList,saveapp,delapp } from "@/service/permission/platformapplications"; import { getPlatformApplicationsPagedList,delapp } from "@/service/permission/platformapplications";
import { getApplicationsGroupList,addApplicationsGroup } from "@/service/permission/platformapplicationsGroup";
const uploadpath="http://nw.sy-metro.com:6104/uploadfileadmin/manager";
export default { export default {
data() { data() {
return { return {
...@@ -230,8 +165,7 @@ ...@@ -230,8 +165,7 @@
}, },
appidflag:true, appidflag:true,
subtype: "add", subtype: "add",
fileCount: 0, fileCount: 0
applicationsGroupOptions: [] // 应用分组下拉选项
} }
}, },
mounted() { mounted() {
...@@ -239,9 +173,9 @@ ...@@ -239,9 +173,9 @@
pagination: this.serverPagination, pagination: this.serverPagination,
filter: this.filter filter: this.filter
}); });
},
// 获取应用分组选项 components: {
this.getApplicationsGroupOptions(); EditApplication: () => import('./EditApplication.vue')
}, },
methods: { methods: {
async request(props) { async request(props) {
...@@ -276,13 +210,8 @@ ...@@ -276,13 +210,8 @@
this.editModal = true; this.editModal = true;
this.appidflag = false; this.appidflag = false;
}, },
async saveapp() { // 保存由子组件处理,这里只负责刷新列表
await saveapp(this.temp); handleChildSaved() {
this.$q.notify({
type: "positive",
message: this.$t("Saved successfully"),
position: "bottom-right"
});
this.editModal = false; this.editModal = false;
this.search(); this.search();
}, },
...@@ -300,6 +229,7 @@ ...@@ -300,6 +229,7 @@
this.editModal = true; this.editModal = true;
this.appidflag = true; this.appidflag = true;
}, },
editappVisible(id){ editappVisible(id){
this.$router.push('/system/sysadv'); this.$router.push('/system/sysadv');
}, },
...@@ -327,77 +257,8 @@ ...@@ -327,77 +257,8 @@
}); });
this.search(); this.search();
} catch (e) {} } 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> </script>
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
loadRecipes, loadRecipes,
updateRecipessStatus, updateRecipessStatus,
saveexceldata saveexceldata
} from "@/service/recipes/recipes"; } from "@/service/recipes/recipes.js";
import tool from "@/service/other/tool"; import tool from "@/service/other/tool";
import { getSysCodelistByKindcode } from "@/service/syscodelist/syscodelist"; import { getSysCodelistByKindcode } from "@/service/syscodelist/syscodelist";
export default { export default {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论